From 2cfd3012bfcb5c5c61bbaf662ef084e0ab789d79 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 16 Jul 2007 16:48:14 +0300 Subject: Update internal BDB to version 4.5.20 --- db/LICENSE | 13 +- db/README | 4 +- db/btree/bt_compact.c | 2398 ++ db/btree/bt_compare.c | 27 +- db/btree/bt_conv.c | 12 +- db/btree/bt_curadj.c | 243 +- db/btree/bt_cursor.c | 533 +- db/btree/bt_delete.c | 215 +- db/btree/bt_method.c | 39 +- db/btree/bt_open.c | 95 +- db/btree/bt_put.c | 193 +- db/btree/bt_rec.c | 675 +- db/btree/bt_reclaim.c | 28 +- db/btree/bt_recno.c | 214 +- db/btree/bt_rsearch.c | 93 +- db/btree/bt_search.c | 366 +- db/btree/bt_split.c | 306 +- db/btree/bt_stat.c | 67 +- db/btree/bt_upgrade.c | 13 +- db/btree/bt_verify.c | 460 +- db/btree/btree.src | 79 +- db/btree/btree_auto.c | 1277 +- db/btree/btree_autop.c | 276 +- db/build_vxworks/BerkeleyDB20.wpj | 597 +- db/build_vxworks/BerkeleyDB20small.wpj | 521 +- db/build_vxworks/BerkeleyDB22.wpj | 597 +- db/build_vxworks/BerkeleyDB22small.wpj | 521 +- db/build_vxworks/clib_port.h | 97 + db/build_vxworks/db.h | 1289 +- db/build_vxworks/db_archive/db_archive.c | 47 +- db/build_vxworks/db_archive/db_archive20.wpj | 2 - db/build_vxworks/db_archive/db_archive22.wpj | 2 - db/build_vxworks/db_checkpoint/db_checkpoint.c | 88 +- db/build_vxworks/db_checkpoint/db_checkpoint20.wpj | 2 - db/build_vxworks/db_checkpoint/db_checkpoint22.wpj | 2 - db/build_vxworks/db_config.h | 173 +- db/build_vxworks/db_config_small.h | 173 +- db/build_vxworks/db_deadlock/db_deadlock.c | 90 +- db/build_vxworks/db_deadlock/db_deadlock20.wpj | 2 - db/build_vxworks/db_deadlock/db_deadlock22.wpj | 2 - db/build_vxworks/db_dump/db_dump.c | 52 +- db/build_vxworks/db_dump/db_dump20.wpj | 2 - db/build_vxworks/db_dump/db_dump22.wpj | 2 - db/build_vxworks/db_hotbackup/db_hotbackup.c | 839 + db/build_vxworks/db_hotbackup/db_hotbackup20.wpj | 158 + db/build_vxworks/db_hotbackup/db_hotbackup22.wpj | 192 + db/build_vxworks/db_int.h | 251 +- db/build_vxworks/db_load/db_load.c | 312 +- db/build_vxworks/db_load/db_load20.wpj | 2 - db/build_vxworks/db_load/db_load22.wpj | 2 - db/build_vxworks/db_printlog/db_printlog.c | 286 +- db/build_vxworks/db_printlog/db_printlog20.wpj | 146 +- db/build_vxworks/db_printlog/db_printlog22.wpj | 146 +- db/build_vxworks/db_recover/db_recover.c | 62 +- db/build_vxworks/db_recover/db_recover20.wpj | 2 - db/build_vxworks/db_recover/db_recover22.wpj | 2 - db/build_vxworks/db_stat/db_stat.c | 162 +- db/build_vxworks/db_stat/db_stat20.wpj | 2 - db/build_vxworks/db_stat/db_stat22.wpj | 2 - db/build_vxworks/db_upgrade/db_upgrade.c | 59 +- db/build_vxworks/db_upgrade/db_upgrade20.wpj | 2 - db/build_vxworks/db_upgrade/db_upgrade22.wpj | 2 - db/build_vxworks/db_verify/db_verify.c | 59 +- db/build_vxworks/db_verify/db_verify20.wpj | 2 - db/build_vxworks/db_verify/db_verify22.wpj | 2 - db/build_vxworks/dbdemo/dbdemo.c | 6 +- db/build_vxworks/dbdemo/dbdemo20.wpj | 2 - db/build_vxworks/dbdemo/dbdemo22.wpj | 2 - db/build_windows/Berkeley_DB.dsw | 818 + db/build_windows/app_dsp.src | 261 + db/build_windows/build_all.dsp | 185 + db/build_windows/clib_port.h | 97 + db/build_windows/db.h | 2573 ++ db/build_windows/db_archive.dsp | 256 + db/build_windows/db_checkpoint.dsp | 256 + db/build_windows/db_config.h | 479 + db/build_windows/db_cxx.h | 1182 + db/build_windows/db_deadlock.dsp | 256 + db/build_windows/db_dll.dsp | 1204 + db/build_windows/db_dump.dsp | 256 + db/build_windows/db_hotbackup.dsp | 256 + db/build_windows/db_int.h | 771 + db/build_windows/db_java.dsp | 412 + db/build_windows/db_java.dsp.postbuild | 17 + db/build_windows/db_java_xa.dsp | 85 + db/build_windows/db_java_xaj.mak | 21 + db/build_windows/db_load.dsp | 256 + db/build_windows/db_perf.dsp | 332 + db/build_windows/db_printlog.dsp | 292 + db/build_windows/db_recover.dsp | 256 + db/build_windows/db_reptest.dsp | 348 + db/build_windows/db_small.dsp | 958 + db/build_windows/db_stat.dsp | 256 + db/build_windows/db_static.dsp | 1158 + db/build_windows/db_tcl.dsp | 328 + db/build_windows/db_test.dsp | 296 + db/build_windows/db_test.dsp.postbuild | 5 + db/build_windows/db_upgrade.dsp | 256 + db/build_windows/db_verify.dsp | 256 + db/build_windows/dbkill.cpp | 131 + db/build_windows/dynamic_dsp.src | 281 + db/build_windows/ex_access.dsp | 256 + db/build_windows/ex_btrec.dsp | 256 + db/build_windows/ex_csvcode.dsp | 296 + db/build_windows/ex_csvcode.dsp.postbuild | 5 + db/build_windows/ex_csvload.dsp | 276 + db/build_windows/ex_csvquery.dsp | 276 + db/build_windows/ex_env.dsp | 256 + db/build_windows/ex_lock.dsp | 256 + db/build_windows/ex_mpool.dsp | 256 + db/build_windows/ex_rep_base.dsp | 268 + db/build_windows/ex_rep_mgr.dsp | 260 + db/build_windows/ex_sequence.dsp | 256 + db/build_windows/ex_tpcb.dsp | 256 + db/build_windows/ex_txnguide.dsp | 256 + db/build_windows/ex_txnguide_inmem.dsp | 256 + db/build_windows/example_database_load.dsp | 260 + db/build_windows/example_database_read.dsp | 260 + db/build_windows/excxx_access.dsp | 256 + db/build_windows/excxx_btrec.dsp | 256 + db/build_windows/excxx_env.dsp | 256 + db/build_windows/excxx_example_database_load.dsp | 260 + db/build_windows/excxx_example_database_read.dsp | 260 + db/build_windows/excxx_lock.dsp | 256 + db/build_windows/excxx_mpool.dsp | 256 + db/build_windows/excxx_repquote.dsp | 260 + db/build_windows/excxx_sequence.dsp | 256 + db/build_windows/excxx_tpcb.dsp | 256 + db/build_windows/excxx_txnguide.dsp | 256 + db/build_windows/excxx_txnguide_inmem.dsp | 256 + db/build_windows/include.tcl | 28 + db/build_windows/libdb.def | 177 + db/build_windows/libdb.rc | 33 + db/build_windows/libdb_tcl.def | 7 + db/build_windows/libdbrc.src | 33 + db/build_windows/srcfile_dsp.src | 4 + db/build_windows/static_dsp.src | 235 + db/build_windows/tm.dsp | 256 + db/build_windows/win_db.h | 143 + db/clib/abort.c | 29 + db/clib/atoi.c | 50 + db/clib/atol.c | 50 + db/clib/ctime.c | 41 + db/clib/getaddrinfo.c | 161 + db/clib/getcwd.c | 18 +- db/clib/getopt.c | 12 +- db/clib/isalpha.c | 29 + db/clib/isdigit.c | 29 + db/clib/isprint.c | 29 + db/clib/isspace.c | 27 + db/clib/memcmp.c | 12 +- db/clib/memmove.c | 22 +- db/clib/printf.c | 143 + db/clib/raise.c | 15 +- db/clib/rand.c | 27 + db/clib/snprintf.c | 15 +- db/clib/strcasecmp.c | 6 +- db/clib/strcat.c | 53 + db/clib/strchr.c | 57 + db/clib/strdup.c | 10 +- db/clib/strerror.c | 190 +- db/clib/strncat.c | 69 + db/clib/strncmp.c | 61 + db/clib/strrchr.c | 58 + db/clib/strsep.c | 80 + db/clib/strtol.c | 16 +- db/clib/strtoul.c | 14 +- db/common/crypto_stub.c | 12 +- db/common/db_byteorder.c | 12 +- db/common/db_clock.c | 31 + db/common/db_err.c | 516 +- db/common/db_getlong.c | 30 +- db/common/db_idspace.c | 12 +- db/common/db_log2.c | 10 +- db/common/mkpath.c | 69 + db/common/util_arg.c | 10 +- db/common/util_cache.c | 14 +- db/common/util_log.c | 33 +- db/common/util_sig.c | 61 +- db/crypto/aes_method.c | 12 +- db/crypto/crypto.c | 171 +- db/crypto/crypto.html | 13 +- db/crypto/mersenne/mt19937db.c | 41 +- db/crypto/rijndael/rijndael-alg-fst.c | 2 +- db/crypto/rijndael/rijndael-alg-fst.h | 6 +- db/crypto/rijndael/rijndael-api-fst.c | 37 +- db/crypto/rijndael/rijndael-api-fst.h | 2 +- db/cxx/cxx_db.cpp | 52 +- db/cxx/cxx_dbc.cpp | 18 +- db/cxx/cxx_dbt.cpp | 10 +- db/cxx/cxx_env.cpp | 358 +- db/cxx/cxx_except.cpp | 50 +- db/cxx/cxx_lock.cpp | 9 +- db/cxx/cxx_logc.cpp | 10 +- db/cxx/cxx_mpool.cpp | 15 +- db/cxx/cxx_multi.cpp | 16 +- db/cxx/cxx_seq.cpp | 19 +- db/cxx/cxx_txn.cpp | 11 +- db/db/crdel.src | 52 +- db/db/crdel_auto.c | 746 +- db/db/crdel_autop.c | 174 +- db/db/crdel_rec.c | 256 +- db/db/db.c | 454 +- db/db/db.src | 115 +- db/db/db_am.c | 274 +- db/db/db_auto.c | 1191 +- db/db/db_autop.c | 384 +- db/db/db_cam.c | 859 +- db/db/db_cds.c | 173 + db/db/db_conv.c | 30 +- db/db/db_dispatch.c | 340 +- db/db/db_dup.c | 24 +- db/db/db_iface.c | 1185 +- db/db/db_join.c | 145 +- db/db/db_meta.c | 757 +- db/db/db_method.c | 278 +- db/db/db_open.c | 243 +- db/db/db_overflow.c | 97 +- db/db/db_ovfl_vrfy.c | 37 +- db/db/db_pr.c | 392 +- db/db/db_rec.c | 1125 +- db/db/db_reclaim.c | 35 +- db/db/db_remove.c | 215 +- db/db/db_rename.c | 175 +- db/db/db_ret.c | 34 +- db/db/db_setid.c | 183 +- db/db/db_setlsn.c | 97 +- db/db/db_stati.c | 201 +- db/db/db_truncate.c | 103 +- db/db/db_upg.c | 86 +- db/db/db_upg_opd.c | 26 +- db/db/db_vrfy.c | 484 +- db/db/db_vrfy_stub.c | 14 +- db/db/db_vrfyutil.c | 156 +- db/db185/db185.c | 45 +- db/db185/db185_int.in | 14 +- db/db_archive/db_archive.c | 47 +- db/db_checkpoint/db_checkpoint.c | 88 +- db/db_deadlock/db_deadlock.c | 90 +- db/db_dump/db_dump.c | 52 +- db/db_dump185/db_dump185.c | 8 +- db/db_hotbackup/db_hotbackup.c | 824 + db/db_load/db_load.c | 312 +- db/db_printlog/README | 2 +- db/db_printlog/commit.awk | 2 +- db/db_printlog/count.awk | 2 +- db/db_printlog/db_printlog.c | 286 +- db/db_printlog/dbname.awk | 3 +- db/db_printlog/fileid.awk | 2 +- db/db_printlog/logstat.awk | 2 +- db/db_printlog/pgno.awk | 2 +- db/db_printlog/range.awk | 2 +- db/db_printlog/rectype.awk | 2 +- db/db_printlog/status.awk | 4 +- db/db_printlog/txn.awk | 2 +- db/db_recover/db_recover.c | 62 +- db/db_stat/db_stat.c | 162 +- db/db_stat/dd.sh | 14 +- db/db_upgrade/db_upgrade.c | 59 +- db/db_verify/db_verify.c | 59 +- db/dbinc/btree.h | 77 +- db/dbinc/crypto.h | 16 +- db/dbinc/cxx_int.h | 13 +- db/dbinc/db.in | 1286 +- db/dbinc/db_185.in | 16 +- db/dbinc/db_am.h | 109 +- db/dbinc/db_cxx.in | 161 +- db/dbinc/db_dispatch.h | 28 +- db/dbinc/db_int.in | 255 +- db/dbinc/db_join.h | 13 +- db/dbinc/db_page.h | 36 +- db/dbinc/db_server_int.h | 37 +- db/dbinc/db_swap.h | 59 +- db/dbinc/db_upgrade.h | 13 +- db/dbinc/db_verify.h | 45 +- db/dbinc/debug.h | 45 +- db/dbinc/fop.h | 24 +- db/dbinc/globals.h | 18 +- db/dbinc/hash.h | 27 +- db/dbinc/hmac.h | 14 +- db/dbinc/lock.h | 54 +- db/dbinc/log.h | 182 +- db/dbinc/mp.h | 256 +- db/dbinc/mutex.h | 1023 +- db/dbinc/mutex_int.h | 851 + db/dbinc/os.h | 88 +- db/dbinc/qam.h | 46 +- db/dbinc/queue.h | 1 - db/dbinc/region.h | 213 +- db/dbinc/rep.h | 459 +- db/dbinc/repmgr.h | 375 + db/dbinc/shqueue.h | 102 +- db/dbinc/tcl_db.h | 60 +- db/dbinc/txn.h | 103 +- db/dbinc/xa.h | 23 +- db/dbinc_auto/btree_auto.h | 64 +- db/dbinc_auto/btree_ext.h | 32 +- db/dbinc_auto/clib_ext.h | 65 + db/dbinc_auto/common_ext.h | 21 +- db/dbinc_auto/crdel_auto.h | 32 +- db/dbinc_auto/db_auto.h | 94 +- db/dbinc_auto/db_ext.h | 105 +- db/dbinc_auto/dbreg_auto.h | 2 +- db/dbinc_auto/dbreg_ext.h | 9 +- db/dbinc_auto/env_ext.h | 71 +- db/dbinc_auto/ext_def.in | 2 +- db/dbinc_auto/fileops_auto.h | 10 +- db/dbinc_auto/hash_auto.h | 48 +- db/dbinc_auto/hash_ext.h | 10 +- db/dbinc_auto/hmac_ext.h | 4 +- db/dbinc_auto/int_def.in | 799 +- db/dbinc_auto/lock_ext.h | 25 +- db/dbinc_auto/log_ext.h | 29 +- db/dbinc_auto/mp_ext.h | 39 +- db/dbinc_auto/mutex_ext.h | 64 +- db/dbinc_auto/os_ext.h | 31 +- db/dbinc_auto/qam_auto.h | 10 +- db/dbinc_auto/qam_ext.h | 5 +- db/dbinc_auto/rep_auto.h | 7 +- db/dbinc_auto/rep_ext.h | 83 +- db/dbinc_auto/repmgr_ext.h | 87 + db/dbinc_auto/rpc_client_ext.h | 218 +- db/dbinc_auto/rpc_server_ext.h | 137 +- db/dbinc_auto/tcl_ext.h | 15 +- db/dbinc_auto/txn_auto.h | 32 +- db/dbinc_auto/txn_ext.h | 40 +- db/dbinc_auto/xa_ext.h | 2 +- db/dbm/dbm.c | 45 +- db/dbreg/dbreg.c | 296 +- db/dbreg/dbreg.src | 15 +- db/dbreg/dbreg_auto.c | 53 +- db/dbreg/dbreg_autop.c | 19 +- db/dbreg/dbreg_rec.c | 87 +- db/dbreg/dbreg_stat.c | 58 +- db/dbreg/dbreg_util.c | 212 +- db/dist/Makefile.in | 739 +- db/dist/RELEASE | 8 +- db/dist/aclocal/config.ac | 42 +- db/dist/aclocal/libtool.ac | 1326 +- db/dist/aclocal/mutex.ac | 163 +- db/dist/aclocal/options.ac | 57 +- db/dist/aclocal/programs.ac | 85 +- db/dist/aclocal/rpc.ac | 14 +- db/dist/aclocal/sequence.ac | 59 +- db/dist/aclocal/sosuffix.ac | 2 +- db/dist/aclocal/tcl.ac | 22 +- db/dist/aclocal/types.ac | 14 +- db/dist/aclocal_java/ac_check_class.ac | 2 +- db/dist/aclocal_java/ac_check_classpath.ac | 2 +- db/dist/aclocal_java/ac_check_junit.ac | 2 +- db/dist/aclocal_java/ac_check_rqrd_class.ac | 2 +- db/dist/aclocal_java/ac_java_options.ac | 2 +- db/dist/aclocal_java/ac_jni_include_dirs.ac | 4 +- db/dist/aclocal_java/ac_prog_jar.ac | 2 +- db/dist/aclocal_java/ac_prog_java.ac | 4 +- db/dist/aclocal_java/ac_prog_java_works.ac | 2 +- db/dist/aclocal_java/ac_prog_javac.ac | 2 +- db/dist/aclocal_java/ac_prog_javac_works.ac | 2 +- db/dist/aclocal_java/ac_prog_javadoc.ac | 2 +- db/dist/aclocal_java/ac_prog_javah.ac | 2 +- db/dist/aclocal_java/ac_try_compile_java.ac | 2 +- db/dist/aclocal_java/ac_try_run_javac.ac | 2 +- db/dist/buildrel | 45 +- db/dist/clib_port.h | 97 + db/dist/config.guess | 595 +- db/dist/config.hin | 174 +- db/dist/config.sub | 143 +- db/dist/configure | 28714 +++++++++++-------- db/dist/configure.ac | 190 +- db/dist/errno.h | 186 + db/dist/gen_inc.awk | 18 +- db/dist/gen_rec.awk | 165 +- db/dist/gen_rpc.awk | 470 +- db/dist/ltmain.sh | 1043 +- db/dist/pubdef.in | 813 +- db/dist/s_all | 6 +- db/dist/s_config | 17 +- db/dist/s_crypto | 6 +- db/dist/s_include | 13 +- db/dist/s_java | 2 +- db/dist/s_java_const | 2 +- db/dist/s_java_stat | 82 +- db/dist/s_java_swig | 22 +- db/dist/s_je2db | 2 +- db/dist/s_perm | 8 +- db/dist/s_readme | 4 +- db/dist/s_recover | 6 +- db/dist/s_rpc | 2 +- db/dist/s_symlink | 7 +- db/dist/s_tags | 13 +- db/dist/s_test | 22 +- db/dist/s_vxworks | 111 +- db/dist/s_windows | 197 + db/dist/s_windows_dsp | 144 + db/dist/s_winmsi | 134 + db/dist/srcfiles.in | 210 +- db/dist/tags | 5245 ++-- db/dist/template/db_server_proc | 1051 +- db/dist/template/gen_client_ret | 299 +- db/dist/template/rec_btree | 192 +- db/dist/template/rec_crdel | 204 +- db/dist/template/rec_ctemp | 18 +- db/dist/template/rec_db | 316 +- db/dist/template/rec_dbreg | 6 - db/dist/template/rec_fileops | 6 - db/dist/template/rec_hash | 310 +- db/dist/template/rec_qam | 238 +- db/dist/template/rec_rep | 6 - db/dist/template/rec_txn | 178 +- db/dist/vx_2.0/wpj.in | 24 - db/dist/vx_2.2/wpj.in | 24 - db/dist/vx_buildcd | 6 +- db/dist/vx_config.in | 167 +- db/dist/vx_setup/LICENSE.TXT | 4 +- db/dist/vx_setup/README.in | 4 +- db/dist/vx_setup/SETUP.BMP | Bin 187962 -> 523208 bytes db/dist/vx_setup/vx_setup.in | 6 +- db/dist/win_config.in | 162 +- db/dist/win_db.in | 81 +- db/dist/win_exports.in | 68 +- db/dist/winmsi/dbcorewix.in | 196 + db/dist/winmsi/dbvarsbat.in | 25 + db/dist/winmsi/dbwix.m4 | 833 + db/dist/winmsi/environment.in | 23 + db/dist/winmsi/features.in | 33 + db/dist/winmsi/files.in | 91 + db/dist/winmsi/images/caticon.ibd | Bin 0 -> 1406 bytes db/dist/winmsi/images/foldernew.ibd | Bin 0 -> 1078 bytes db/dist/winmsi/images/folderup.ibd | Bin 0 -> 1078 bytes db/dist/winmsi/images/oracle.jpg | Bin 0 -> 10496 bytes db/dist/winmsi/images/topstripe.ibd | Bin 0 -> 1827 bytes db/dist/winmsi/images/webicon.ico | Bin 0 -> 318 bytes db/dist/winmsi/links.in | 17 + db/dist/winmsi/s_winmsi.fcn | 1435 + db/dist/winmsi/winbuild.bat | 113 + db/docs/api_c/api_core.html | 66 +- db/docs/api_c/c_pindex.html | 163 +- db/docs/api_c/db_associate.html | 50 +- db/docs/api_c/db_class.html | 22 +- db/docs/api_c/db_close.html | 4 +- db/docs/api_c/db_compact.html | 140 + db/docs/api_c/db_cursor.html | 50 +- db/docs/api_c/db_del.html | 28 +- db/docs/api_c/db_err.html | 25 +- db/docs/api_c/db_fd.html | 12 +- db/docs/api_c/db_get.html | 41 +- db/docs/api_c/db_get_byteswapped.html | 4 +- db/docs/api_c/db_get_mpf.html | 21 +- db/docs/api_c/db_get_type.html | 6 +- db/docs/api_c/db_getenv.html | 8 +- db/docs/api_c/db_join.html | 11 +- db/docs/api_c/db_key_range.html | 17 +- db/docs/api_c/db_list.html | 12 +- db/docs/api_c/db_open.html | 74 +- db/docs/api_c/db_put.html | 29 +- db/docs/api_c/db_remove.html | 11 +- db/docs/api_c/db_rename.html | 11 +- db/docs/api_c/db_set_alloc.html | 4 +- db/docs/api_c/db_set_append_recno.html | 10 +- db/docs/api_c/db_set_bt_compare.html | 4 +- db/docs/api_c/db_set_bt_minkey.html | 4 +- db/docs/api_c/db_set_bt_prefix.html | 4 +- db/docs/api_c/db_set_cachesize.html | 35 +- db/docs/api_c/db_set_dup_compare.html | 4 +- db/docs/api_c/db_set_encrypt.html | 4 +- db/docs/api_c/db_set_errcall.html | 13 +- db/docs/api_c/db_set_errfile.html | 20 +- db/docs/api_c/db_set_errpfx.html | 9 +- db/docs/api_c/db_set_feedback.html | 10 +- db/docs/api_c/db_set_flags.html | 4 +- db/docs/api_c/db_set_h_ffactor.html | 4 +- db/docs/api_c/db_set_h_hash.html | 4 +- db/docs/api_c/db_set_h_nelem.html | 4 +- db/docs/api_c/db_set_lorder.html | 4 +- db/docs/api_c/db_set_msgcall.html | 13 +- db/docs/api_c/db_set_msgfile.html | 20 +- db/docs/api_c/db_set_pagesize.html | 12 +- db/docs/api_c/db_set_q_extentsize.html | 4 +- db/docs/api_c/db_set_re_delim.html | 4 +- db/docs/api_c/db_set_re_len.html | 4 +- db/docs/api_c/db_set_re_pad.html | 4 +- db/docs/api_c/db_set_re_source.html | 9 +- db/docs/api_c/db_stat.html | 45 +- db/docs/api_c/db_sync.html | 5 +- db/docs/api_c/db_truncate.html | 29 +- db/docs/api_c/db_upgrade.html | 4 +- db/docs/api_c/db_verify.html | 13 +- db/docs/api_c/dbc_class.html | 4 +- db/docs/api_c/dbc_close.html | 6 +- db/docs/api_c/dbc_count.html | 7 +- db/docs/api_c/dbc_del.html | 7 +- db/docs/api_c/dbc_dup.html | 5 +- db/docs/api_c/dbc_get.html | 17 +- db/docs/api_c/dbc_list.html | 8 +- db/docs/api_c/dbc_put.html | 7 +- db/docs/api_c/dbm.html | 4 +- db/docs/api_c/dbt_bulk.html | 60 +- db/docs/api_c/dbt_class.html | 4 +- db/docs/api_c/dbt_package.html | 4 +- db/docs/api_c/env_cdsgroup_begin.html | 60 + db/docs/api_c/env_class.html | 18 +- db/docs/api_c/env_close.html | 4 +- db/docs/api_c/env_dbremove.html | 22 +- db/docs/api_c/env_dbrename.html | 22 +- db/docs/api_c/env_err.html | 25 +- db/docs/api_c/env_event_notify.html | 93 + db/docs/api_c/env_failchk.html | 92 + db/docs/api_c/env_fileid_reset.html | 72 + db/docs/api_c/env_list.html | 19 +- db/docs/api_c/env_lsn_reset.html | 78 + db/docs/api_c/env_open.html | 101 +- db/docs/api_c/env_remove.html | 9 +- db/docs/api_c/env_set_alloc.html | 4 +- db/docs/api_c/env_set_app_dispatch.html | 4 +- db/docs/api_c/env_set_cachesize.html | 43 +- db/docs/api_c/env_set_data_dir.html | 17 +- db/docs/api_c/env_set_encrypt.html | 4 +- db/docs/api_c/env_set_errcall.html | 13 +- db/docs/api_c/env_set_errfile.html | 20 +- db/docs/api_c/env_set_errpfx.html | 9 +- db/docs/api_c/env_set_feedback.html | 10 +- db/docs/api_c/env_set_flags.html | 102 +- db/docs/api_c/env_set_isalive.html | 83 + db/docs/api_c/env_set_lg_bsize.html | 25 +- db/docs/api_c/env_set_lg_dir.html | 17 +- db/docs/api_c/env_set_lg_max.html | 12 +- db/docs/api_c/env_set_lg_mode.html | 89 + db/docs/api_c/env_set_lg_regionmax.html | 21 +- db/docs/api_c/env_set_lk_conflicts.html | 8 +- db/docs/api_c/env_set_lk_detect.html | 21 +- db/docs/api_c/env_set_lk_max_lockers.html | 12 +- db/docs/api_c/env_set_lk_max_locks.html | 12 +- db/docs/api_c/env_set_lk_max_objects.html | 12 +- db/docs/api_c/env_set_mp_mmapsize.html | 12 +- db/docs/api_c/env_set_msgcall.html | 13 +- db/docs/api_c/env_set_msgfile.html | 20 +- db/docs/api_c/env_set_rpc_server.html | 4 +- db/docs/api_c/env_set_shm_key.html | 12 +- db/docs/api_c/env_set_thread_count.html | 93 + db/docs/api_c/env_set_thread_id.html | 123 + db/docs/api_c/env_set_thread_id_string.html | 85 + db/docs/api_c/env_set_timeout.html | 28 +- db/docs/api_c/env_set_tmp_dir.html | 17 +- db/docs/api_c/env_set_tx_max.html | 22 +- db/docs/api_c/env_set_tx_timestamp.html | 4 +- db/docs/api_c/env_set_verbose.html | 31 +- db/docs/api_c/env_stat.html | 15 +- db/docs/api_c/env_strerror.html | 4 +- db/docs/api_c/env_version.html | 4 +- db/docs/api_c/frame.html | 6 +- db/docs/api_c/hsearch.html | 4 +- db/docs/api_c/lock_class.html | 4 +- db/docs/api_c/lock_detect.html | 4 +- db/docs/api_c/lock_get.html | 4 +- db/docs/api_c/lock_id.html | 6 +- db/docs/api_c/lock_id_free.html | 4 +- db/docs/api_c/lock_list.html | 7 +- db/docs/api_c/lock_put.html | 4 +- db/docs/api_c/lock_stat.html | 21 +- db/docs/api_c/lock_vec.html | 4 +- db/docs/api_c/log_archive.html | 4 +- db/docs/api_c/log_compare.html | 4 +- db/docs/api_c/log_cursor.html | 6 +- db/docs/api_c/log_file.html | 6 +- db/docs/api_c/log_flush.html | 4 +- db/docs/api_c/log_list.html | 8 +- db/docs/api_c/log_printf.html | 69 + db/docs/api_c/log_put.html | 6 +- db/docs/api_c/log_stat.html | 25 +- db/docs/api_c/logc_class.html | 4 +- db/docs/api_c/logc_close.html | 4 +- db/docs/api_c/logc_get.html | 4 +- db/docs/api_c/lsn_class.html | 4 +- db/docs/api_c/memp_fclose.html | 4 +- db/docs/api_c/memp_fcreate.html | 4 +- db/docs/api_c/memp_fget.html | 36 +- db/docs/api_c/memp_fopen.html | 13 +- db/docs/api_c/memp_fput.html | 19 +- db/docs/api_c/memp_fset.html | 9 +- db/docs/api_c/memp_fsync.html | 4 +- db/docs/api_c/memp_list.html | 12 +- db/docs/api_c/memp_maxwrite.html | 37 +- db/docs/api_c/memp_openfd.html | 32 +- db/docs/api_c/memp_register.html | 4 +- db/docs/api_c/memp_set_clear_len.html | 21 +- db/docs/api_c/memp_set_fileid.html | 10 +- db/docs/api_c/memp_set_flags.html | 10 +- db/docs/api_c/memp_set_ftype.html | 17 +- db/docs/api_c/memp_set_lsn_offset.html | 17 +- db/docs/api_c/memp_set_maxsize.html | 12 +- db/docs/api_c/memp_set_pgcookie.html | 17 +- db/docs/api_c/memp_set_priority.html | 8 +- db/docs/api_c/memp_stat.html | 41 +- db/docs/api_c/memp_sync.html | 14 +- db/docs/api_c/memp_trickle.html | 6 +- db/docs/api_c/mempfile_class.html | 4 +- db/docs/api_c/mutex_alloc.html | 74 + db/docs/api_c/mutex_free.html | 60 + db/docs/api_c/mutex_list.html | 29 + db/docs/api_c/mutex_lock.html | 62 + db/docs/api_c/mutex_set_align.html | 94 + db/docs/api_c/mutex_set_max.html | 158 + db/docs/api_c/mutex_set_tas_spins.html | 89 + db/docs/api_c/mutex_stat.html | 113 + db/docs/api_c/mutex_unlock.html | 61 + db/docs/api_c/object.html | 3 +- db/docs/api_c/rep_config.html | 106 + db/docs/api_c/rep_elect.html | 100 +- db/docs/api_c/rep_limit.html | 40 +- db/docs/api_c/rep_list.html | 26 +- db/docs/api_c/rep_message.html | 38 +- db/docs/api_c/rep_nsites.html | 77 + db/docs/api_c/rep_priority.html | 75 + db/docs/api_c/rep_start.html | 37 +- db/docs/api_c/rep_stat.html | 92 +- db/docs/api_c/rep_sync.html | 62 + db/docs/api_c/rep_timeout.html | 97 + db/docs/api_c/rep_transport.html | 50 +- db/docs/api_c/repmgr_ack_policy.html | 100 + db/docs/api_c/repmgr_local_site.html | 56 + db/docs/api_c/repmgr_remote_site.html | 68 + db/docs/api_c/repmgr_site_list.html | 77 + db/docs/api_c/repmgr_start.html | 96 + db/docs/api_c/seq_class.html | 4 +- db/docs/api_c/seq_close.html | 4 +- db/docs/api_c/seq_get.html | 53 +- db/docs/api_c/seq_initial_value.html | 60 + db/docs/api_c/seq_list.html | 8 +- db/docs/api_c/seq_open.html | 33 +- db/docs/api_c/seq_remove.html | 25 +- db/docs/api_c/seq_set_cachesize.html | 4 +- db/docs/api_c/seq_set_flags.html | 4 +- db/docs/api_c/seq_set_range.html | 4 +- db/docs/api_c/seq_stat.html | 4 +- db/docs/api_c/set_func_close.html | 4 +- db/docs/api_c/set_func_dirfree.html | 4 +- db/docs/api_c/set_func_dirlist.html | 7 +- db/docs/api_c/set_func_exists.html | 4 +- db/docs/api_c/set_func_free.html | 4 +- db/docs/api_c/set_func_fsync.html | 4 +- db/docs/api_c/set_func_ftruncate.html | 4 +- db/docs/api_c/set_func_ioinfo.html | 4 +- db/docs/api_c/set_func_malloc.html | 4 +- db/docs/api_c/set_func_map.html | 4 +- db/docs/api_c/set_func_open.html | 4 +- db/docs/api_c/set_func_pread.html | 4 +- db/docs/api_c/set_func_pwrite.html | 4 +- db/docs/api_c/set_func_read.html | 4 +- db/docs/api_c/set_func_realloc.html | 4 +- db/docs/api_c/set_func_rename.html | 4 +- db/docs/api_c/set_func_seek.html | 4 +- db/docs/api_c/set_func_sleep.html | 4 +- db/docs/api_c/set_func_unlink.html | 4 +- db/docs/api_c/set_func_unmap.html | 4 +- db/docs/api_c/set_func_write.html | 7 +- db/docs/api_c/set_func_yield.html | 4 +- db/docs/api_c/txn_abort.html | 4 +- db/docs/api_c/txn_begin.html | 25 +- db/docs/api_c/txn_checkpoint.html | 12 +- db/docs/api_c/txn_class.html | 8 +- db/docs/api_c/txn_commit.html | 4 +- db/docs/api_c/txn_discard.html | 4 +- db/docs/api_c/txn_id.html | 4 +- db/docs/api_c/txn_list.html | 7 +- db/docs/api_c/txn_prepare.html | 4 +- db/docs/api_c/txn_recover.html | 6 +- db/docs/api_c/txn_set_name.html | 76 + db/docs/api_c/txn_set_timeout.html | 10 +- db/docs/api_c/txn_stat.html | 46 +- db/docs/api_cxx/api_core.html | 66 +- db/docs/api_cxx/cxx_pindex.html | 163 +- db/docs/api_cxx/db_associate.html | 52 +- db/docs/api_cxx/db_class.html | 12 +- db/docs/api_cxx/db_close.html | 4 +- db/docs/api_cxx/db_compact.html | 146 + db/docs/api_cxx/db_cursor.html | 50 +- db/docs/api_cxx/db_del.html | 28 +- db/docs/api_cxx/db_err.html | 25 +- db/docs/api_cxx/db_fd.html | 12 +- db/docs/api_cxx/db_get.html | 41 +- db/docs/api_cxx/db_get_byteswapped.html | 4 +- db/docs/api_cxx/db_get_mpf.html | 10 +- db/docs/api_cxx/db_get_type.html | 6 +- db/docs/api_cxx/db_getenv.html | 8 +- db/docs/api_cxx/db_join.html | 11 +- db/docs/api_cxx/db_key_range.html | 17 +- db/docs/api_cxx/db_list.html | 12 +- db/docs/api_cxx/db_open.html | 74 +- db/docs/api_cxx/db_put.html | 29 +- db/docs/api_cxx/db_remove.html | 11 +- db/docs/api_cxx/db_rename.html | 11 +- db/docs/api_cxx/db_set_alloc.html | 4 +- db/docs/api_cxx/db_set_append_recno.html | 13 +- db/docs/api_cxx/db_set_bt_compare.html | 4 +- db/docs/api_cxx/db_set_bt_minkey.html | 4 +- db/docs/api_cxx/db_set_bt_prefix.html | 4 +- db/docs/api_cxx/db_set_cachesize.html | 35 +- db/docs/api_cxx/db_set_dup_compare.html | 4 +- db/docs/api_cxx/db_set_encrypt.html | 4 +- db/docs/api_cxx/db_set_errcall.html | 13 +- db/docs/api_cxx/db_set_errfile.html | 21 +- db/docs/api_cxx/db_set_error_stream.html | 11 +- db/docs/api_cxx/db_set_errpfx.html | 9 +- db/docs/api_cxx/db_set_feedback.html | 13 +- db/docs/api_cxx/db_set_flags.html | 4 +- db/docs/api_cxx/db_set_h_ffactor.html | 4 +- db/docs/api_cxx/db_set_h_hash.html | 4 +- db/docs/api_cxx/db_set_h_nelem.html | 4 +- db/docs/api_cxx/db_set_lorder.html | 4 +- db/docs/api_cxx/db_set_msg_stream.html | 11 +- db/docs/api_cxx/db_set_msgcall.html | 16 +- db/docs/api_cxx/db_set_msgfile.html | 21 +- db/docs/api_cxx/db_set_pagesize.html | 12 +- db/docs/api_cxx/db_set_q_extentsize.html | 4 +- db/docs/api_cxx/db_set_re_delim.html | 4 +- db/docs/api_cxx/db_set_re_len.html | 4 +- db/docs/api_cxx/db_set_re_pad.html | 4 +- db/docs/api_cxx/db_set_re_source.html | 9 +- db/docs/api_cxx/db_stat.html | 45 +- db/docs/api_cxx/db_sync.html | 5 +- db/docs/api_cxx/db_truncate.html | 29 +- db/docs/api_cxx/db_upgrade.html | 4 +- db/docs/api_cxx/db_verify.html | 13 +- db/docs/api_cxx/dbc_class.html | 4 +- db/docs/api_cxx/dbc_close.html | 6 +- db/docs/api_cxx/dbc_count.html | 7 +- db/docs/api_cxx/dbc_del.html | 7 +- db/docs/api_cxx/dbc_dup.html | 5 +- db/docs/api_cxx/dbc_get.html | 17 +- db/docs/api_cxx/dbc_list.html | 8 +- db/docs/api_cxx/dbc_put.html | 7 +- db/docs/api_cxx/dbt_bulk_class.html | 4 +- db/docs/api_cxx/dbt_class.html | 15 +- db/docs/api_cxx/dbt_package.html | 4 +- db/docs/api_cxx/deadlock_class.html | 4 +- db/docs/api_cxx/env_cdsgroup_begin.html | 59 + db/docs/api_cxx/env_class.html | 8 +- db/docs/api_cxx/env_close.html | 4 +- db/docs/api_cxx/env_dbremove.html | 22 +- db/docs/api_cxx/env_dbrename.html | 22 +- db/docs/api_cxx/env_err.html | 25 +- db/docs/api_cxx/env_event_notify.html | 94 + db/docs/api_cxx/env_failchk.html | 96 + db/docs/api_cxx/env_fileid_reset.html | 76 + db/docs/api_cxx/env_list.html | 19 +- db/docs/api_cxx/env_lsn_reset.html | 82 + db/docs/api_cxx/env_open.html | 101 +- db/docs/api_cxx/env_remove.html | 9 +- db/docs/api_cxx/env_set_alloc.html | 4 +- db/docs/api_cxx/env_set_app_dispatch.html | 4 +- db/docs/api_cxx/env_set_cachesize.html | 43 +- db/docs/api_cxx/env_set_data_dir.html | 17 +- db/docs/api_cxx/env_set_encrypt.html | 4 +- db/docs/api_cxx/env_set_errcall.html | 13 +- db/docs/api_cxx/env_set_errfile.html | 21 +- db/docs/api_cxx/env_set_error_stream.html | 11 +- db/docs/api_cxx/env_set_errpfx.html | 9 +- db/docs/api_cxx/env_set_feedback.html | 13 +- db/docs/api_cxx/env_set_flags.html | 102 +- db/docs/api_cxx/env_set_isalive.html | 86 + db/docs/api_cxx/env_set_lg_bsize.html | 25 +- db/docs/api_cxx/env_set_lg_dir.html | 17 +- db/docs/api_cxx/env_set_lg_max.html | 12 +- db/docs/api_cxx/env_set_lg_mode.html | 91 + db/docs/api_cxx/env_set_lg_regionmax.html | 21 +- db/docs/api_cxx/env_set_lk_conflicts.html | 8 +- db/docs/api_cxx/env_set_lk_detect.html | 21 +- db/docs/api_cxx/env_set_lk_max_lockers.html | 12 +- db/docs/api_cxx/env_set_lk_max_locks.html | 12 +- db/docs/api_cxx/env_set_lk_max_objects.html | 12 +- db/docs/api_cxx/env_set_mp_mmapsize.html | 12 +- db/docs/api_cxx/env_set_msg_stream.html | 11 +- db/docs/api_cxx/env_set_msgcall.html | 16 +- db/docs/api_cxx/env_set_msgfile.html | 21 +- db/docs/api_cxx/env_set_rpc_server.html | 4 +- db/docs/api_cxx/env_set_shm_key.html | 12 +- db/docs/api_cxx/env_set_thread_count.html | 98 + db/docs/api_cxx/env_set_thread_id.html | 126 + db/docs/api_cxx/env_set_thread_id_string.html | 88 + db/docs/api_cxx/env_set_timeout.html | 28 +- db/docs/api_cxx/env_set_tmp_dir.html | 17 +- db/docs/api_cxx/env_set_tx_max.html | 22 +- db/docs/api_cxx/env_set_tx_timestamp.html | 4 +- db/docs/api_cxx/env_set_verbose.html | 31 +- db/docs/api_cxx/env_stat.html | 15 +- db/docs/api_cxx/env_strerror.html | 4 +- db/docs/api_cxx/env_version.html | 4 +- db/docs/api_cxx/exc_package.html | 4 +- db/docs/api_cxx/except_class.html | 4 +- db/docs/api_cxx/frame.html | 6 +- db/docs/api_cxx/lock_class.html | 4 +- db/docs/api_cxx/lock_detect.html | 4 +- db/docs/api_cxx/lock_get.html | 4 +- db/docs/api_cxx/lock_id.html | 6 +- db/docs/api_cxx/lock_id_free.html | 4 +- db/docs/api_cxx/lock_list.html | 7 +- db/docs/api_cxx/lock_put.html | 4 +- db/docs/api_cxx/lock_stat.html | 21 +- db/docs/api_cxx/lock_vec.html | 4 +- db/docs/api_cxx/lockng_class.html | 4 +- db/docs/api_cxx/log_archive.html | 4 +- db/docs/api_cxx/log_compare.html | 4 +- db/docs/api_cxx/log_cursor.html | 6 +- db/docs/api_cxx/log_file.html | 6 +- db/docs/api_cxx/log_flush.html | 4 +- db/docs/api_cxx/log_list.html | 8 +- db/docs/api_cxx/log_printf.html | 73 + db/docs/api_cxx/log_put.html | 6 +- db/docs/api_cxx/log_stat.html | 25 +- db/docs/api_cxx/logc_class.html | 4 +- db/docs/api_cxx/logc_close.html | 4 +- db/docs/api_cxx/logc_get.html | 4 +- db/docs/api_cxx/lsn_class.html | 4 +- db/docs/api_cxx/memp_class.html | 4 +- db/docs/api_cxx/memp_fclose.html | 4 +- db/docs/api_cxx/memp_fcreate.html | 4 +- db/docs/api_cxx/memp_fget.html | 37 +- db/docs/api_cxx/memp_fopen.html | 13 +- db/docs/api_cxx/memp_fput.html | 19 +- db/docs/api_cxx/memp_fset.html | 9 +- db/docs/api_cxx/memp_fsync.html | 4 +- db/docs/api_cxx/memp_list.html | 12 +- db/docs/api_cxx/memp_maxwrite.html | 37 +- db/docs/api_cxx/memp_openfd.html | 32 +- db/docs/api_cxx/memp_register.html | 4 +- db/docs/api_cxx/memp_set_clear_len.html | 22 +- db/docs/api_cxx/memp_set_fileid.html | 10 +- db/docs/api_cxx/memp_set_flags.html | 10 +- db/docs/api_cxx/memp_set_ftype.html | 18 +- db/docs/api_cxx/memp_set_lsn_offset.html | 18 +- db/docs/api_cxx/memp_set_maxsize.html | 12 +- db/docs/api_cxx/memp_set_pgcookie.html | 18 +- db/docs/api_cxx/memp_set_priority.html | 8 +- db/docs/api_cxx/memp_stat.html | 41 +- db/docs/api_cxx/memp_sync.html | 17 +- db/docs/api_cxx/memp_trickle.html | 6 +- db/docs/api_cxx/mempfile_class.html | 4 +- db/docs/api_cxx/mutex_alloc.html | 78 + db/docs/api_cxx/mutex_free.html | 64 + db/docs/api_cxx/mutex_list.html | 29 + db/docs/api_cxx/mutex_lock.html | 66 + db/docs/api_cxx/mutex_set_align.html | 99 + db/docs/api_cxx/mutex_set_max.html | 167 + db/docs/api_cxx/mutex_set_tas_spins.html | 94 + db/docs/api_cxx/mutex_stat.html | 118 + db/docs/api_cxx/mutex_unlock.html | 65 + db/docs/api_cxx/object.html | 3 +- db/docs/api_cxx/pindex.src | 127 +- db/docs/api_cxx/rep_config.html | 111 + db/docs/api_cxx/rep_elect.html | 99 +- db/docs/api_cxx/rep_limit.html | 40 +- db/docs/api_cxx/rep_list.html | 26 +- db/docs/api_cxx/rep_message.html | 38 +- db/docs/api_cxx/rep_nsites.html | 79 + db/docs/api_cxx/rep_priority.html | 77 + db/docs/api_cxx/rep_start.html | 37 +- db/docs/api_cxx/rep_stat.html | 92 +- db/docs/api_cxx/rep_sync.html | 63 + db/docs/api_cxx/rep_timeout.html | 102 + db/docs/api_cxx/rep_transport.html | 50 +- db/docs/api_cxx/repmgr_ack_policy.html | 102 + db/docs/api_cxx/repmgr_local_site.html | 56 + db/docs/api_cxx/repmgr_remote_site.html | 68 + db/docs/api_cxx/repmgr_site_list.html | 77 + db/docs/api_cxx/repmgr_start.html | 97 + db/docs/api_cxx/runrec_class.html | 4 +- db/docs/api_cxx/seq_class.html | 4 +- db/docs/api_cxx/seq_close.html | 4 +- db/docs/api_cxx/seq_get.html | 53 +- db/docs/api_cxx/seq_initial_value.html | 64 + db/docs/api_cxx/seq_list.html | 8 +- db/docs/api_cxx/seq_open.html | 33 +- db/docs/api_cxx/seq_remove.html | 25 +- db/docs/api_cxx/seq_set_cachesize.html | 4 +- db/docs/api_cxx/seq_set_flags.html | 4 +- db/docs/api_cxx/seq_set_range.html | 4 +- db/docs/api_cxx/seq_stat.html | 4 +- db/docs/api_cxx/txn_abort.html | 4 +- db/docs/api_cxx/txn_begin.html | 25 +- db/docs/api_cxx/txn_checkpoint.html | 12 +- db/docs/api_cxx/txn_class.html | 8 +- db/docs/api_cxx/txn_commit.html | 4 +- db/docs/api_cxx/txn_discard.html | 4 +- db/docs/api_cxx/txn_id.html | 4 +- db/docs/api_cxx/txn_list.html | 7 +- db/docs/api_cxx/txn_prepare.html | 4 +- db/docs/api_cxx/txn_recover.html | 6 +- db/docs/api_cxx/txn_set_name.html | 78 + db/docs/api_cxx/txn_set_timeout.html | 10 +- db/docs/api_cxx/txn_stat.html | 46 +- db/docs/api_tcl/api_tcl.html | 6 +- db/docs/api_tcl/db_close.html | 6 +- db/docs/api_tcl/db_count.html | 6 +- db/docs/api_tcl/db_cursor.html | 16 +- db/docs/api_tcl/db_del.html | 22 +- db/docs/api_tcl/db_get.html | 23 +- db/docs/api_tcl/db_get_join.html | 16 +- db/docs/api_tcl/db_get_type.html | 6 +- db/docs/api_tcl/db_is_byteswapped.html | 6 +- db/docs/api_tcl/db_join.html | 6 +- db/docs/api_tcl/db_open.html | 24 +- db/docs/api_tcl/db_put.html | 23 +- db/docs/api_tcl/db_remove.html | 6 +- db/docs/api_tcl/db_rename.html | 6 +- db/docs/api_tcl/db_stat.html | 6 +- db/docs/api_tcl/db_sync.html | 10 +- db/docs/api_tcl/db_truncate.html | 22 +- db/docs/api_tcl/dbc_close.html | 10 +- db/docs/api_tcl/dbc_del.html | 6 +- db/docs/api_tcl/dbc_dup.html | 6 +- db/docs/api_tcl/dbc_get.html | 12 +- db/docs/api_tcl/dbc_put.html | 10 +- db/docs/api_tcl/env_close.html | 6 +- db/docs/api_tcl/env_dbremove.html | 17 +- db/docs/api_tcl/env_dbrename.html | 17 +- db/docs/api_tcl/env_open.html | 6 +- db/docs/api_tcl/env_remove.html | 6 +- db/docs/api_tcl/txn.html | 6 +- db/docs/api_tcl/txn_abort.html | 6 +- db/docs/api_tcl/txn_checkpoint.html | 6 +- db/docs/api_tcl/txn_commit.html | 10 +- db/docs/api_tcl/version.html | 6 +- db/docs/collections/tutorial/BasicProgram.html | 30 +- .../tutorial/BerkeleyDB-Java-Collections.pdf | Bin 461364 -> 448647 bytes db/docs/collections/tutorial/Entity.html | 26 +- .../collections/tutorial/SerializableEntity.html | 24 +- db/docs/collections/tutorial/Summary.html | 8 +- db/docs/collections/tutorial/Tuple.html | 4 +- .../collections/tutorial/UsingCollectionsAPI.html | 27 +- db/docs/collections/tutorial/UsingSecondaries.html | 2 +- .../tutorial/UsingStoredCollections.html | 4 +- .../collections/tutorial/addingdatabaseitems.html | 89 +- .../collections/tutorial/collectionOverview.html | 12 +- .../tutorial/createbindingscollections.html | 2 +- db/docs/collections/tutorial/developing.html | 22 +- .../tutorial/entitieswithcollections.html | 82 +- .../collections/tutorial/handlingexceptions.html | 4 +- db/docs/collections/tutorial/implementingmain.html | 14 +- db/docs/collections/tutorial/index.html | 51 +- db/docs/collections/tutorial/intro.html | 44 +- db/docs/collections/tutorial/moreinfo.html | 108 + db/docs/collections/tutorial/openclasscatalog.html | 10 +- db/docs/collections/tutorial/opendatabases.html | 12 +- .../collections/tutorial/opendbenvironment.html | 4 +- .../collections/tutorial/openingforeignkeys.html | 4 +- db/docs/collections/tutorial/preface.html | 27 +- .../collections/tutorial/retrievingbyindexkey.html | 20 +- .../tutorial/retrievingdatabaseitems.html | 11 +- .../collections/tutorial/tutorialintroduction.html | 15 +- .../collections/tutorial/usingtransactions.html | 4 +- db/docs/gsg/C/BerkeleyDB-Core-C-GSG.pdf | Bin 467269 -> 456016 bytes db/docs/gsg/C/CoreCursorUsage.html | 44 +- db/docs/gsg/C/CoreDBAdmin.html | 6 +- db/docs/gsg/C/CoreDbUsage.html | 18 +- db/docs/gsg/C/CoreEnvUsage.html | 16 +- db/docs/gsg/C/DB.html | 5 +- db/docs/gsg/C/DBEntry.html | 6 +- db/docs/gsg/C/DBOpenFlags.html | 2 +- db/docs/gsg/C/DbUsage.html | 32 +- db/docs/gsg/C/DeleteEntryWCursor.html | 2 +- db/docs/gsg/C/Positioning.html | 39 +- db/docs/gsg/C/PutEntryWCursor.html | 29 +- db/docs/gsg/C/ReplacingEntryWCursor.html | 12 +- db/docs/gsg/C/accessmethods.html | 2 +- db/docs/gsg/C/btree.html | 14 +- db/docs/gsg/C/concepts.html | 2 +- db/docs/gsg/C/coreindexusage.html | 89 +- db/docs/gsg/C/cstructs.html | 14 +- db/docs/gsg/C/dbErrorReporting.html | 10 +- db/docs/gsg/C/dbconfig.html | 9 +- db/docs/gsg/C/environments.html | 11 +- db/docs/gsg/C/gettingit.html | 10 +- db/docs/gsg/C/index.html | 50 +- db/docs/gsg/C/indexes.html | 18 +- db/docs/gsg/C/introduction.html | 8 +- db/docs/gsg/C/joins.html | 16 +- db/docs/gsg/C/preface.html | 78 +- db/docs/gsg/C/readSecondary.html | 2 +- db/docs/gsg/C/returns.html | 101 + db/docs/gsg/C/secondaryCursor.html | 3 +- db/docs/gsg/C/secondaryDelete.html | 46 +- db/docs/gsg/C/usingDbt.html | 42 +- db/docs/gsg/CXX/BerkeleyDB-Core-Cxx-GSG.pdf | Bin 440972 -> 429750 bytes db/docs/gsg/CXX/CoreCursorUsage.html | 50 +- db/docs/gsg/CXX/CoreDBAdmin.html | 6 +- db/docs/gsg/CXX/CoreDbCXXUsage.html | 16 +- db/docs/gsg/CXX/CoreEnvUsage.html | 35 +- db/docs/gsg/CXX/DB.html | 5 +- db/docs/gsg/CXX/DBEntry.html | 6 +- db/docs/gsg/CXX/DBOpenFlags.html | 2 +- db/docs/gsg/CXX/DbCXXUsage.html | 50 +- db/docs/gsg/CXX/DeleteEntryWCursor.html | 6 +- db/docs/gsg/CXX/Positioning.html | 57 +- db/docs/gsg/CXX/PutEntryWCursor.html | 33 +- db/docs/gsg/CXX/ReplacingEntryWCursor.html | 8 +- db/docs/gsg/CXX/accessmethods.html | 2 +- db/docs/gsg/CXX/btree.html | 12 +- db/docs/gsg/CXX/concepts.html | 2 +- db/docs/gsg/CXX/coreExceptions.html | 4 +- db/docs/gsg/CXX/coreindexusage.html | 131 +- db/docs/gsg/CXX/dbErrorReporting.html | 10 +- db/docs/gsg/CXX/dbconfig.html | 9 +- db/docs/gsg/CXX/environments.html | 11 +- db/docs/gsg/CXX/gettingit.html | 10 +- db/docs/gsg/CXX/index.html | 54 +- db/docs/gsg/CXX/indexes.html | 18 +- db/docs/gsg/CXX/introduction.html | 8 +- db/docs/gsg/CXX/joins.html | 16 +- db/docs/gsg/CXX/preface.html | 78 +- db/docs/gsg/CXX/readSecondary.html | 2 +- db/docs/gsg/CXX/returns.html | 81 + db/docs/gsg/CXX/secondaryCursor.html | 3 +- db/docs/gsg/CXX/secondaryDelete.html | 46 +- db/docs/gsg/CXX/usingDbt.html | 40 +- db/docs/gsg/JAVA/BerkeleyDB-Core-JAVA-GSG.pdf | Bin 502662 -> 491548 bytes db/docs/gsg/JAVA/CoreEnvUsage.html | 18 +- db/docs/gsg/JAVA/CoreJavaUsage.html | 20 +- db/docs/gsg/JAVA/Cursors.html | 11 +- db/docs/gsg/JAVA/DB.html | 11 +- db/docs/gsg/JAVA/DBAdmin.html | 52 +- db/docs/gsg/JAVA/DBEntry.html | 30 +- db/docs/gsg/JAVA/DeleteEntryWCursor.html | 11 +- db/docs/gsg/JAVA/Positioning.html | 90 +- db/docs/gsg/JAVA/PutEntryWCursor.html | 27 +- db/docs/gsg/JAVA/ReplacingEntryWCursor.html | 6 +- db/docs/gsg/JAVA/accessmethods.html | 2 +- db/docs/gsg/JAVA/bindAPI.html | 104 +- db/docs/gsg/JAVA/btree.html | 16 +- db/docs/gsg/JAVA/concepts.html | 2 +- db/docs/gsg/JAVA/coredbclose.html | 6 +- db/docs/gsg/JAVA/cursorJavaUsage.html | 54 +- db/docs/gsg/JAVA/dbErrorReporting.html | 4 +- db/docs/gsg/JAVA/dbconfig.html | 9 +- db/docs/gsg/JAVA/dbtJavaUsage.html | 66 +- db/docs/gsg/JAVA/environments.html | 11 +- db/docs/gsg/JAVA/gettingit.html | 10 +- db/docs/gsg/JAVA/index.html | 46 +- db/docs/gsg/JAVA/indexes.html | 13 +- db/docs/gsg/JAVA/introduction.html | 10 +- db/docs/gsg/JAVA/javaindexusage.html | 53 +- db/docs/gsg/JAVA/joins.html | 26 +- db/docs/gsg/JAVA/keyCreator.html | 32 +- db/docs/gsg/JAVA/preface.html | 88 +- db/docs/gsg/JAVA/readSecondary.html | 6 +- db/docs/gsg/JAVA/secondaryCursor.html | 7 +- db/docs/gsg/JAVA/secondaryDelete.html | 48 +- db/docs/gsg/JAVA/secondaryProps.html | 4 +- db/docs/gsg/JAVA/usingDbt.html | 59 +- db/docs/gsg_db_rep/C/Replication-C-GSG.pdf | Bin 0 -> 357663 bytes db/docs/gsg_db_rep/C/addfeatures.html | 191 + db/docs/gsg_db_rep/C/apioverview.html | 225 + db/docs/gsg_db_rep/C/bulk.html | 139 + db/docs/gsg_db_rep/C/c2ctransfer.html | 131 + db/docs/gsg_db_rep/C/elections.html | 227 + db/docs/gsg_db_rep/C/electiontimes.html | 152 + db/docs/gsg_db_rep/C/exampledoloop.html | 643 + db/docs/gsg_db_rep/C/fmwrkconnectretry.html | 76 + db/docs/gsg_db_rep/C/fwrkmasterreplica.html | 301 + db/docs/gsg_db_rep/C/fwrkpermmessage.html | 355 + db/docs/gsg_db_rep/C/gettingStarted.css | 41 + db/docs/gsg_db_rep/C/index.html | 447 + db/docs/gsg_db_rep/C/introduction.html | 395 + db/docs/gsg_db_rep/C/manageblock.html | 88 + db/docs/gsg_db_rep/C/noautoinit.html | 88 + db/docs/gsg_db_rep/C/permmessages.html | 390 + db/docs/gsg_db_rep/C/preface.html | 212 + db/docs/gsg_db_rep/C/processingloop.html | 255 + db/docs/gsg_db_rep/C/repadvantage.html | 184 + db/docs/gsg_db_rep/C/repapp.html | 720 + db/docs/gsg_db_rep/C/repmgr_init_example_c.html | 383 + db/docs/gsg_db_rep/C/simpleprogramlisting.html | 557 + db/docs/gsg_db_rep/C/txnapp.html | 174 + db/docs/gsg_db_rep/CXX/Replication-CXX-GSG.pdf | Bin 0 -> 362032 bytes db/docs/gsg_db_rep/CXX/addfeatures.html | 191 + db/docs/gsg_db_rep/CXX/apioverview.html | 225 + db/docs/gsg_db_rep/CXX/bulk.html | 139 + db/docs/gsg_db_rep/CXX/c2ctransfer.html | 131 + db/docs/gsg_db_rep/CXX/elections.html | 227 + db/docs/gsg_db_rep/CXX/electiontimes.html | 152 + db/docs/gsg_db_rep/CXX/exampledoloop.html | 541 + db/docs/gsg_db_rep/CXX/fmwrkconnectretry.html | 76 + db/docs/gsg_db_rep/CXX/fwrkmasterreplica.html | 297 + db/docs/gsg_db_rep/CXX/fwrkpermmessage.html | 372 + db/docs/gsg_db_rep/CXX/gettingStarted.css | 41 + db/docs/gsg_db_rep/CXX/index.html | 460 + db/docs/gsg_db_rep/CXX/introduction.html | 395 + db/docs/gsg_db_rep/CXX/manageblock.html | 88 + db/docs/gsg_db_rep/CXX/noautoinit.html | 88 + db/docs/gsg_db_rep/CXX/permmessages.html | 390 + db/docs/gsg_db_rep/CXX/preface.html | 216 + db/docs/gsg_db_rep/CXX/processingloop.html | 259 + db/docs/gsg_db_rep/CXX/repadvantage.html | 184 + db/docs/gsg_db_rep/CXX/repapp.html | 711 + db/docs/gsg_db_rep/CXX/repmgr_init_example_c.html | 520 + db/docs/gsg_db_rep/CXX/simpleprogramlisting.html | 628 + db/docs/gsg_db_rep/CXX/txnapp.html | 187 + db/docs/gsg_db_rep/JAVA/Replication-JAVA-GSG.pdf | Bin 0 -> 361196 bytes db/docs/gsg_db_rep/JAVA/addfeatures.html | 192 + db/docs/gsg_db_rep/JAVA/apioverview.html | 227 + db/docs/gsg_db_rep/JAVA/bulk.html | 140 + db/docs/gsg_db_rep/JAVA/c2ctransfer.html | 135 + db/docs/gsg_db_rep/JAVA/elections.html | 227 + db/docs/gsg_db_rep/JAVA/electiontimes.html | 146 + db/docs/gsg_db_rep/JAVA/exampledoloop.html | 559 + db/docs/gsg_db_rep/JAVA/fmwrkconnectretry.html | 81 + db/docs/gsg_db_rep/JAVA/fwrkmasterreplica.html | 270 + db/docs/gsg_db_rep/JAVA/fwrkpermmessage.html | 358 + db/docs/gsg_db_rep/JAVA/gettingStarted.css | 41 + db/docs/gsg_db_rep/JAVA/index.html | 460 + db/docs/gsg_db_rep/JAVA/introduction.html | 395 + db/docs/gsg_db_rep/JAVA/manageblock.html | 91 + db/docs/gsg_db_rep/JAVA/noautoinit.html | 89 + db/docs/gsg_db_rep/JAVA/permmessages.html | 390 + db/docs/gsg_db_rep/JAVA/preface.html | 223 + db/docs/gsg_db_rep/JAVA/processingloop.html | 215 + db/docs/gsg_db_rep/JAVA/repadvantage.html | 184 + db/docs/gsg_db_rep/JAVA/repapp.html | 705 + db/docs/gsg_db_rep/JAVA/repmgr_init_example_c.html | 529 + db/docs/gsg_db_rep/JAVA/simpleprogramlisting.html | 564 + db/docs/gsg_db_rep/JAVA/txnapp.html | 182 + db/docs/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf | Bin 0 -> 651712 bytes db/docs/gsg_txn/C/abortresults.html | 95 + db/docs/gsg_txn/C/architectrecovery.html | 446 + db/docs/gsg_txn/C/autocommit.html | 223 + db/docs/gsg_txn/C/backuprestore.html | 341 + db/docs/gsg_txn/C/blocking_deadlocks.html | 674 + db/docs/gsg_txn/C/deadlock.jpg | Bin 0 -> 12599 bytes db/docs/gsg_txn/C/enabletxn.html | 928 + db/docs/gsg_txn/C/envopen.html | 241 + db/docs/gsg_txn/C/filemanagement.html | 403 + db/docs/gsg_txn/C/gettingStarted.css | 41 + db/docs/gsg_txn/C/hotfailover.html | 210 + db/docs/gsg_txn/C/index.html | 525 + db/docs/gsg_txn/C/inmem_txnexample_c.html | 618 + db/docs/gsg_txn/C/introduction.html | 441 + db/docs/gsg_txn/C/isolation.html | 961 + db/docs/gsg_txn/C/lockingsubsystem.html | 558 + db/docs/gsg_txn/C/logconfig.html | 444 + db/docs/gsg_txn/C/logfileremoval.html | 206 + db/docs/gsg_txn/C/maxtxns.html | 239 + db/docs/gsg_txn/C/nestedtxn.html | 140 + db/docs/gsg_txn/C/perftune-intro.html | 88 + db/docs/gsg_txn/C/preface.html | 215 + db/docs/gsg_txn/C/readblock.jpg | Bin 0 -> 10504 bytes db/docs/gsg_txn/C/readmodifywrite.html | 122 + db/docs/gsg_txn/C/recovery-intro.html | 104 + db/docs/gsg_txn/C/recovery.html | 322 + db/docs/gsg_txn/C/reversesplit.html | 195 + db/docs/gsg_txn/C/rwlocks1.jpg | Bin 0 -> 7428 bytes db/docs/gsg_txn/C/simplelock.jpg | Bin 0 -> 4453 bytes db/docs/gsg_txn/C/txn_ccursor.html | 201 + db/docs/gsg_txn/C/txnconcurrency.html | 360 + db/docs/gsg_txn/C/txncursor.html | 155 + db/docs/gsg_txn/C/txnexample_c.html | 757 + db/docs/gsg_txn/C/txnindices.html | 130 + db/docs/gsg_txn/C/txnnowait.html | 91 + db/docs/gsg_txn/C/usingtxns.html | 590 + db/docs/gsg_txn/C/wrapup.html | 283 + db/docs/gsg_txn/C/writeblock.jpg | Bin 0 -> 6369 bytes db/docs/gsg_txn/CXX/BerkeleyDB-Core-Cxx-Txn.pdf | Bin 0 -> 621636 bytes db/docs/gsg_txn/CXX/abortresults.html | 95 + db/docs/gsg_txn/CXX/architectrecovery.html | 446 + db/docs/gsg_txn/CXX/autocommit.html | 179 + db/docs/gsg_txn/CXX/backuprestore.html | 341 + db/docs/gsg_txn/CXX/blocking_deadlocks.html | 674 + db/docs/gsg_txn/CXX/deadlock.jpg | Bin 0 -> 12599 bytes db/docs/gsg_txn/CXX/enabletxn.html | 942 + db/docs/gsg_txn/CXX/envopen.html | 190 + db/docs/gsg_txn/CXX/filemanagement.html | 384 + db/docs/gsg_txn/CXX/gettingStarted.css | 41 + db/docs/gsg_txn/CXX/hotfailover.html | 210 + db/docs/gsg_txn/CXX/index.html | 525 + db/docs/gsg_txn/CXX/inmem_txnexample_c.html | 546 + db/docs/gsg_txn/CXX/introduction.html | 441 + db/docs/gsg_txn/CXX/isolation.html | 821 + db/docs/gsg_txn/CXX/lockingsubsystem.html | 502 + db/docs/gsg_txn/CXX/logconfig.html | 397 + db/docs/gsg_txn/CXX/logfileremoval.html | 206 + db/docs/gsg_txn/CXX/maxtxns.html | 203 + db/docs/gsg_txn/CXX/nestedtxn.html | 140 + db/docs/gsg_txn/CXX/perftune-intro.html | 88 + db/docs/gsg_txn/CXX/preface.html | 221 + db/docs/gsg_txn/CXX/readblock.jpg | Bin 0 -> 10504 bytes db/docs/gsg_txn/CXX/readmodifywrite.html | 124 + db/docs/gsg_txn/CXX/recovery-intro.html | 104 + db/docs/gsg_txn/CXX/recovery.html | 288 + db/docs/gsg_txn/CXX/reversesplit.html | 158 + db/docs/gsg_txn/CXX/rwlocks1.jpg | Bin 0 -> 7428 bytes db/docs/gsg_txn/CXX/simplelock.jpg | Bin 0 -> 4453 bytes db/docs/gsg_txn/CXX/txn_ccursor.html | 163 + db/docs/gsg_txn/CXX/txnconcurrency.html | 360 + db/docs/gsg_txn/CXX/txncursor.html | 124 + db/docs/gsg_txn/CXX/txnexample_c.html | 674 + db/docs/gsg_txn/CXX/txnindices.html | 118 + db/docs/gsg_txn/CXX/txnnowait.html | 91 + db/docs/gsg_txn/CXX/usingtxns.html | 535 + db/docs/gsg_txn/CXX/wrapup.html | 283 + db/docs/gsg_txn/CXX/writeblock.jpg | Bin 0 -> 6369 bytes db/docs/gsg_txn/JAVA/BerkeleyDB-Core-JAVA-Txn.pdf | Bin 0 -> 627919 bytes db/docs/gsg_txn/JAVA/abortresults.html | 95 + db/docs/gsg_txn/JAVA/architectrecovery.html | 337 + db/docs/gsg_txn/JAVA/autocommit.html | 144 + db/docs/gsg_txn/JAVA/backuprestore.html | 336 + db/docs/gsg_txn/JAVA/blocking_deadlocks.html | 674 + db/docs/gsg_txn/JAVA/deadlock.jpg | Bin 0 -> 12599 bytes db/docs/gsg_txn/JAVA/enabletxn.html | 875 + db/docs/gsg_txn/JAVA/envopen.html | 159 + db/docs/gsg_txn/JAVA/filemanagement.html | 484 + db/docs/gsg_txn/JAVA/gettingStarted.css | 41 + db/docs/gsg_txn/JAVA/hotfailover.html | 210 + db/docs/gsg_txn/JAVA/index.html | 549 + db/docs/gsg_txn/JAVA/inmem_txnexample_java.html | 561 + db/docs/gsg_txn/JAVA/introduction.html | 441 + db/docs/gsg_txn/JAVA/isolation.html | 917 + db/docs/gsg_txn/JAVA/lockingsubsystem.html | 479 + db/docs/gsg_txn/JAVA/logconfig.html | 381 + db/docs/gsg_txn/JAVA/logfileremoval.html | 202 + db/docs/gsg_txn/JAVA/maxtxns.html | 202 + db/docs/gsg_txn/JAVA/nestedtxn.html | 139 + db/docs/gsg_txn/JAVA/perftune-intro.html | 88 + db/docs/gsg_txn/JAVA/preface.html | 227 + db/docs/gsg_txn/JAVA/readblock.jpg | Bin 0 -> 10504 bytes db/docs/gsg_txn/JAVA/readmodifywrite.html | 120 + db/docs/gsg_txn/JAVA/recovery-intro.html | 104 + db/docs/gsg_txn/JAVA/recovery.html | 298 + db/docs/gsg_txn/JAVA/reversesplit.html | 144 + db/docs/gsg_txn/JAVA/rwlocks1.jpg | Bin 0 -> 7428 bytes db/docs/gsg_txn/JAVA/simplelock.jpg | Bin 0 -> 4453 bytes db/docs/gsg_txn/JAVA/txn_ccursor.html | 166 + db/docs/gsg_txn/JAVA/txnconcurrency.html | 369 + db/docs/gsg_txn/JAVA/txncursor.html | 128 + db/docs/gsg_txn/JAVA/txnexample_java.html | 801 + db/docs/gsg_txn/JAVA/txnindices.html | 136 + db/docs/gsg_txn/JAVA/txnnowait.html | 91 + db/docs/gsg_txn/JAVA/usingtxns.html | 525 + db/docs/gsg_txn/JAVA/wrapup.html | 302 + db/docs/gsg_txn/JAVA/writeblock.jpg | Bin 0 -> 6369 bytes db/docs/images/Oracle_BerkeleyDB_clr.bmp | Bin 0 -> 523208 bytes db/docs/index.html | 65 +- db/docs/java/allclasses-frame.html | 62 +- db/docs/java/allclasses-noframe.html | 62 +- .../java/com/sleepycat/bind/ByteArrayBinding.html | 65 +- db/docs/java/com/sleepycat/bind/EntityBinding.html | 67 +- db/docs/java/com/sleepycat/bind/EntryBinding.html | 61 +- .../com/sleepycat/bind/RecordNumberBinding.html | 65 +- .../sleepycat/bind/class-use/ByteArrayBinding.html | 24 +- .../sleepycat/bind/class-use/EntityBinding.html | 114 +- .../com/sleepycat/bind/class-use/EntryBinding.html | 188 +- .../bind/class-use/RecordNumberBinding.html | 24 +- db/docs/java/com/sleepycat/bind/package-frame.html | 4 +- .../java/com/sleepycat/bind/package-summary.html | 34 +- db/docs/java/com/sleepycat/bind/package-tree.html | 32 +- db/docs/java/com/sleepycat/bind/package-use.html | 44 +- .../com/sleepycat/bind/serial/ClassCatalog.html | 59 +- .../java/com/sleepycat/bind/serial/SerialBase.html | 330 + .../com/sleepycat/bind/serial/SerialBinding.html | 128 +- .../com/sleepycat/bind/serial/SerialInput.html | 183 +- .../com/sleepycat/bind/serial/SerialOutput.html | 107 +- .../sleepycat/bind/serial/SerialSerialBinding.html | 67 +- .../bind/serial/SerialSerialKeyCreator.html | 140 +- .../sleepycat/bind/serial/StoredClassCatalog.html | 65 +- .../sleepycat/bind/serial/TupleSerialBinding.html | 111 +- .../bind/serial/TupleSerialKeyCreator.html | 116 +- .../bind/serial/TupleSerialMarshalledBinding.html | 101 +- .../serial/TupleSerialMarshalledKeyCreator.html | 97 +- .../bind/serial/class-use/ClassCatalog.html | 98 +- .../bind/serial/class-use/SerialBase.html | 177 + .../bind/serial/class-use/SerialBinding.html | 100 +- .../bind/serial/class-use/SerialInput.html | 24 +- .../bind/serial/class-use/SerialOutput.html | 24 +- .../bind/serial/class-use/SerialSerialBinding.html | 24 +- .../serial/class-use/SerialSerialKeyCreator.html | 24 +- .../bind/serial/class-use/StoredClassCatalog.html | 24 +- .../bind/serial/class-use/TupleSerialBinding.html | 34 +- .../serial/class-use/TupleSerialKeyCreator.html | 34 +- .../class-use/TupleSerialMarshalledBinding.html | 34 +- .../class-use/TupleSerialMarshalledKeyCreator.html | 34 +- .../com/sleepycat/bind/serial/package-frame.html | 6 +- .../com/sleepycat/bind/serial/package-summary.html | 39 +- .../com/sleepycat/bind/serial/package-tree.html | 62 +- .../com/sleepycat/bind/serial/package-use.html | 43 +- .../com/sleepycat/bind/tuple/BooleanBinding.html | 112 +- .../java/com/sleepycat/bind/tuple/ByteBinding.html | 112 +- .../com/sleepycat/bind/tuple/CharacterBinding.html | 112 +- .../com/sleepycat/bind/tuple/DoubleBinding.html | 117 +- .../com/sleepycat/bind/tuple/FloatBinding.html | 117 +- .../com/sleepycat/bind/tuple/IntegerBinding.html | 120 +- .../java/com/sleepycat/bind/tuple/LongBinding.html | 124 +- .../sleepycat/bind/tuple/MarshalledTupleEntry.html | 57 +- .../bind/tuple/MarshalledTupleKeyEntity.html | 63 +- .../com/sleepycat/bind/tuple/ShortBinding.html | 120 +- .../sleepycat/bind/tuple/SortedDoubleBinding.html | 418 + .../sleepycat/bind/tuple/SortedFloatBinding.html | 418 + .../com/sleepycat/bind/tuple/StringBinding.html | 120 +- .../java/com/sleepycat/bind/tuple/TupleBase.html | 457 + .../com/sleepycat/bind/tuple/TupleBinding.html | 222 +- .../java/com/sleepycat/bind/tuple/TupleInput.html | 285 +- .../sleepycat/bind/tuple/TupleInputBinding.html | 61 +- .../bind/tuple/TupleMarshalledBinding.html | 79 +- .../java/com/sleepycat/bind/tuple/TupleOutput.html | 201 +- .../sleepycat/bind/tuple/TupleTupleBinding.html | 73 +- .../sleepycat/bind/tuple/TupleTupleKeyCreator.html | 83 +- .../bind/tuple/TupleTupleMarshalledBinding.html | 79 +- .../bind/tuple/TupleTupleMarshalledKeyCreator.html | 77 +- .../bind/tuple/class-use/BooleanBinding.html | 24 +- .../bind/tuple/class-use/ByteBinding.html | 24 +- .../bind/tuple/class-use/CharacterBinding.html | 24 +- .../bind/tuple/class-use/DoubleBinding.html | 24 +- .../bind/tuple/class-use/FloatBinding.html | 24 +- .../bind/tuple/class-use/IntegerBinding.html | 24 +- .../bind/tuple/class-use/LongBinding.html | 24 +- .../bind/tuple/class-use/MarshalledTupleEntry.html | 24 +- .../tuple/class-use/MarshalledTupleKeyEntity.html | 24 +- .../bind/tuple/class-use/ShortBinding.html | 24 +- .../bind/tuple/class-use/SortedDoubleBinding.html | 140 + .../bind/tuple/class-use/SortedFloatBinding.html | 140 + .../bind/tuple/class-use/StringBinding.html | 24 +- .../sleepycat/bind/tuple/class-use/TupleBase.html | 374 + .../bind/tuple/class-use/TupleBinding.html | 54 +- .../sleepycat/bind/tuple/class-use/TupleInput.html | 182 +- .../bind/tuple/class-use/TupleInputBinding.html | 24 +- .../tuple/class-use/TupleMarshalledBinding.html | 24 +- .../bind/tuple/class-use/TupleOutput.html | 370 +- .../bind/tuple/class-use/TupleTupleBinding.html | 34 +- .../bind/tuple/class-use/TupleTupleKeyCreator.html | 34 +- .../class-use/TupleTupleMarshalledBinding.html | 34 +- .../class-use/TupleTupleMarshalledKeyCreator.html | 24 +- .../com/sleepycat/bind/tuple/package-frame.html | 10 +- .../com/sleepycat/bind/tuple/package-summary.html | 49 +- .../com/sleepycat/bind/tuple/package-tree.html | 58 +- .../java/com/sleepycat/bind/tuple/package-use.html | 50 +- .../sleepycat/collections/CurrentTransaction.html | 55 +- .../sleepycat/collections/MapEntryParameter.html | 69 +- .../sleepycat/collections/PrimaryKeyAssigner.html | 59 +- .../sleepycat/collections/StoredCollection.html | 317 +- .../sleepycat/collections/StoredCollections.html | 376 +- .../com/sleepycat/collections/StoredContainer.html | 172 +- .../com/sleepycat/collections/StoredEntrySet.html | 118 +- .../com/sleepycat/collections/StoredIterator.html | 181 +- .../com/sleepycat/collections/StoredKeySet.html | 111 +- .../java/com/sleepycat/collections/StoredList.html | 131 +- .../java/com/sleepycat/collections/StoredMap.html | 187 +- .../collections/StoredSortedEntrySet.html | 123 +- .../sleepycat/collections/StoredSortedKeySet.html | 127 +- .../com/sleepycat/collections/StoredSortedMap.html | 111 +- .../collections/StoredSortedValueSet.html | 129 +- .../com/sleepycat/collections/StoredValueSet.html | 144 +- .../sleepycat/collections/TransactionRunner.html | 143 +- .../sleepycat/collections/TransactionWorker.html | 59 +- .../sleepycat/collections/TupleSerialFactory.html | 61 +- .../collections/class-use/CurrentTransaction.html | 34 +- .../collections/class-use/MapEntryParameter.html | 24 +- .../collections/class-use/PrimaryKeyAssigner.html | 82 +- .../collections/class-use/StoredCollection.html | 36 +- .../collections/class-use/StoredCollections.html | 24 +- .../collections/class-use/StoredContainer.html | 36 +- .../collections/class-use/StoredEntrySet.html | 34 +- .../collections/class-use/StoredIterator.html | 56 +- .../collections/class-use/StoredKeySet.html | 34 +- .../collections/class-use/StoredList.html | 24 +- .../sleepycat/collections/class-use/StoredMap.html | 36 +- .../class-use/StoredSortedEntrySet.html | 24 +- .../collections/class-use/StoredSortedKeySet.html | 24 +- .../collections/class-use/StoredSortedMap.html | 34 +- .../class-use/StoredSortedValueSet.html | 24 +- .../collections/class-use/StoredValueSet.html | 34 +- .../collections/class-use/TransactionRunner.html | 24 +- .../collections/class-use/TransactionWorker.html | 36 +- .../collections/class-use/TupleSerialFactory.html | 24 +- .../com/sleepycat/collections/package-frame.html | 4 +- .../com/sleepycat/collections/package-summary.html | 40 +- .../com/sleepycat/collections/package-tree.html | 56 +- .../com/sleepycat/collections/package-use.html | 32 +- .../com/sleepycat/db/BtreePrefixCalculator.html | 59 +- db/docs/java/com/sleepycat/db/BtreeStats.html | 113 +- db/docs/java/com/sleepycat/db/CacheFile.html | 67 +- .../java/com/sleepycat/db/CacheFilePriority.html | 97 +- db/docs/java/com/sleepycat/db/CacheFileStats.html | 58 +- db/docs/java/com/sleepycat/db/CacheStats.html | 142 +- .../java/com/sleepycat/db/CheckpointConfig.html | 76 +- db/docs/java/com/sleepycat/db/CompactConfig.html | 548 + db/docs/java/com/sleepycat/db/CompactStats.html | 370 + db/docs/java/com/sleepycat/db/Cursor.html | 62 +- db/docs/java/com/sleepycat/db/CursorConfig.html | 271 +- db/docs/java/com/sleepycat/db/Database.html | 171 +- db/docs/java/com/sleepycat/db/DatabaseConfig.html | 353 +- db/docs/java/com/sleepycat/db/DatabaseEntry.html | 261 +- .../java/com/sleepycat/db/DatabaseException.html | 175 +- db/docs/java/com/sleepycat/db/DatabaseStats.html | 63 +- db/docs/java/com/sleepycat/db/DatabaseType.html | 101 +- .../java/com/sleepycat/db/DeadlockException.html | 81 +- db/docs/java/com/sleepycat/db/Environment.html | 551 +- .../java/com/sleepycat/db/EnvironmentConfig.html | 1687 +- db/docs/java/com/sleepycat/db/ErrorHandler.html | 63 +- db/docs/java/com/sleepycat/db/EventHandler.html | 226 + db/docs/java/com/sleepycat/db/EventType.html | 367 + db/docs/java/com/sleepycat/db/FeedbackHandler.html | 65 +- db/docs/java/com/sleepycat/db/HashStats.html | 64 +- db/docs/java/com/sleepycat/db/Hasher.html | 59 +- db/docs/java/com/sleepycat/db/JoinConfig.html | 60 +- db/docs/java/com/sleepycat/db/JoinCursor.html | 55 +- db/docs/java/com/sleepycat/db/KeyRange.html | 64 +- db/docs/java/com/sleepycat/db/Lock.html | 59 +- db/docs/java/com/sleepycat/db/LockDetectMode.html | 97 +- db/docs/java/com/sleepycat/db/LockMode.html | 188 +- .../com/sleepycat/db/LockNotGrantedException.html | 79 +- db/docs/java/com/sleepycat/db/LockOperation.html | 101 +- db/docs/java/com/sleepycat/db/LockRequest.html | 61 +- db/docs/java/com/sleepycat/db/LockRequestMode.html | 101 +- db/docs/java/com/sleepycat/db/LockStats.html | 174 +- db/docs/java/com/sleepycat/db/LogCursor.html | 59 +- .../java/com/sleepycat/db/LogRecordHandler.html | 65 +- .../java/com/sleepycat/db/LogSequenceNumber.html | 63 +- db/docs/java/com/sleepycat/db/LogStats.html | 104 +- db/docs/java/com/sleepycat/db/MemoryException.html | 99 +- db/docs/java/com/sleepycat/db/MessageHandler.html | 61 +- .../java/com/sleepycat/db/MultipleDataEntry.html | 75 +- db/docs/java/com/sleepycat/db/MultipleEntry.html | 65 +- .../com/sleepycat/db/MultipleKeyDataEntry.html | 75 +- .../com/sleepycat/db/MultipleKeyNIODataEntry.html | 310 + .../com/sleepycat/db/MultipleNIODataEntry.html | 310 + .../com/sleepycat/db/MultipleRecnoDataEntry.html | 79 +- .../sleepycat/db/MultipleRecnoNIODataEntry.html | 314 + db/docs/java/com/sleepycat/db/MutexStats.html | 421 + db/docs/java/com/sleepycat/db/OperationStatus.html | 105 +- db/docs/java/com/sleepycat/db/PanicHandler.html | 61 +- .../java/com/sleepycat/db/PreparedTransaction.html | 59 +- db/docs/java/com/sleepycat/db/QueueStats.html | 64 +- .../com/sleepycat/db/RecordNumberAppender.html | 63 +- .../java/com/sleepycat/db/RecoveryOperation.html | 90 +- .../java/com/sleepycat/db/ReplicationConfig.html | 337 + .../db/ReplicationDuplicateMasterException.html | 221 + .../db/ReplicationHandleDeadException.html | 81 +- .../db/ReplicationHoldElectionException.html | 219 + .../com/sleepycat/db/ReplicationHostAddress.html | 368 + .../db/ReplicationJoinFailureException.html | 221 + .../sleepycat/db/ReplicationLockoutException.html | 218 + .../sleepycat/db/ReplicationManagerAckPolicy.html | 392 + .../db/ReplicationManagerStartPolicy.html | 332 + .../db/ReplicationSiteUnavailableException.html | 219 + .../java/com/sleepycat/db/ReplicationStats.html | 271 +- .../java/com/sleepycat/db/ReplicationStatus.html | 152 +- .../com/sleepycat/db/ReplicationTimeoutType.html | 337 + .../com/sleepycat/db/ReplicationTransport.html | 91 +- .../com/sleepycat/db/RunRecoveryException.html | 81 +- db/docs/java/com/sleepycat/db/SecondaryConfig.html | 176 +- db/docs/java/com/sleepycat/db/SecondaryCursor.html | 61 +- .../java/com/sleepycat/db/SecondaryDatabase.html | 227 +- .../java/com/sleepycat/db/SecondaryKeyCreator.html | 94 +- db/docs/java/com/sleepycat/db/Sequence.html | 59 +- db/docs/java/com/sleepycat/db/SequenceConfig.html | 96 +- db/docs/java/com/sleepycat/db/SequenceStats.html | 137 +- db/docs/java/com/sleepycat/db/StatsConfig.html | 60 +- db/docs/java/com/sleepycat/db/Transaction.html | 164 +- .../java/com/sleepycat/db/TransactionConfig.html | 399 +- .../com/sleepycat/db/TransactionStats.Active.html | 175 +- .../java/com/sleepycat/db/TransactionStats.html | 113 +- .../com/sleepycat/db/UpdateConflictException.html | 219 + db/docs/java/com/sleepycat/db/VerifyConfig.html | 146 +- .../com/sleepycat/db/VersionMismatchException.html | 219 + .../db/class-use/BtreePrefixCalculator.html | 38 +- .../com/sleepycat/db/class-use/BtreeStats.html | 24 +- .../java/com/sleepycat/db/class-use/CacheFile.html | 36 +- .../sleepycat/db/class-use/CacheFilePriority.html | 40 +- .../com/sleepycat/db/class-use/CacheFileStats.html | 36 +- .../com/sleepycat/db/class-use/CacheStats.html | 36 +- .../sleepycat/db/class-use/CheckpointConfig.html | 38 +- .../com/sleepycat/db/class-use/CompactConfig.html | 199 + .../com/sleepycat/db/class-use/CompactStats.html | 182 + .../java/com/sleepycat/db/class-use/Cursor.html | 57 +- .../com/sleepycat/db/class-use/CursorConfig.html | 175 +- .../java/com/sleepycat/db/class-use/Database.html | 254 +- .../com/sleepycat/db/class-use/DatabaseConfig.html | 83 +- .../com/sleepycat/db/class-use/DatabaseEntry.html | 1263 +- .../sleepycat/db/class-use/DatabaseException.html | 1684 +- .../com/sleepycat/db/class-use/DatabaseStats.html | 38 +- .../com/sleepycat/db/class-use/DatabaseType.html | 40 +- .../sleepycat/db/class-use/DeadlockException.html | 36 +- .../com/sleepycat/db/class-use/Environment.html | 119 +- .../sleepycat/db/class-use/EnvironmentConfig.html | 42 +- .../com/sleepycat/db/class-use/ErrorHandler.html | 38 +- .../com/sleepycat/db/class-use/EventHandler.html | 193 + .../java/com/sleepycat/db/class-use/EventType.html | 237 + .../sleepycat/db/class-use/FeedbackHandler.html | 38 +- .../java/com/sleepycat/db/class-use/HashStats.html | 24 +- .../java/com/sleepycat/db/class-use/Hasher.html | 38 +- .../com/sleepycat/db/class-use/JoinConfig.html | 46 +- .../com/sleepycat/db/class-use/JoinCursor.html | 36 +- .../java/com/sleepycat/db/class-use/KeyRange.html | 36 +- db/docs/java/com/sleepycat/db/class-use/Lock.html | 48 +- .../com/sleepycat/db/class-use/LockDetectMode.html | 72 +- .../java/com/sleepycat/db/class-use/LockMode.html | 406 +- .../db/class-use/LockNotGrantedException.html | 24 +- .../com/sleepycat/db/class-use/LockOperation.html | 42 +- .../com/sleepycat/db/class-use/LockRequest.html | 36 +- .../sleepycat/db/class-use/LockRequestMode.html | 74 +- .../java/com/sleepycat/db/class-use/LockStats.html | 36 +- .../java/com/sleepycat/db/class-use/LogCursor.html | 36 +- .../sleepycat/db/class-use/LogRecordHandler.html | 38 +- .../sleepycat/db/class-use/LogSequenceNumber.html | 146 +- .../java/com/sleepycat/db/class-use/LogStats.html | 36 +- .../sleepycat/db/class-use/MemoryException.html | 24 +- .../com/sleepycat/db/class-use/MessageHandler.html | 38 +- .../sleepycat/db/class-use/MultipleDataEntry.html | 24 +- .../com/sleepycat/db/class-use/MultipleEntry.html | 63 +- .../db/class-use/MultipleKeyDataEntry.html | 24 +- .../db/class-use/MultipleKeyNIODataEntry.html | 140 + .../db/class-use/MultipleNIODataEntry.html | 140 + .../db/class-use/MultipleRecnoDataEntry.html | 24 +- .../db/class-use/MultipleRecnoNIODataEntry.html | 140 + .../com/sleepycat/db/class-use/MutexStats.html | 177 + .../sleepycat/db/class-use/OperationStatus.html | 590 +- .../com/sleepycat/db/class-use/PanicHandler.html | 38 +- .../db/class-use/PreparedTransaction.html | 36 +- .../com/sleepycat/db/class-use/QueueStats.html | 24 +- .../db/class-use/RecordNumberAppender.html | 38 +- .../sleepycat/db/class-use/RecoveryOperation.html | 62 +- .../sleepycat/db/class-use/ReplicationConfig.html | 230 + .../ReplicationDuplicateMasterException.html | 140 + .../class-use/ReplicationHandleDeadException.html | 24 +- .../ReplicationHoldElectionException.html | 140 + .../db/class-use/ReplicationHostAddress.html | 202 + .../class-use/ReplicationJoinFailureException.html | 140 + .../db/class-use/ReplicationLockoutException.html | 140 + .../db/class-use/ReplicationManagerAckPolicy.html | 261 + .../class-use/ReplicationManagerStartPolicy.html | 218 + .../ReplicationSiteUnavailableException.html | 140 + .../sleepycat/db/class-use/ReplicationStats.html | 36 +- .../sleepycat/db/class-use/ReplicationStatus.html | 36 +- .../db/class-use/ReplicationTimeoutType.html | 231 + .../db/class-use/ReplicationTransport.html | 38 +- .../db/class-use/RunRecoveryException.html | 24 +- .../sleepycat/db/class-use/SecondaryConfig.html | 42 +- .../sleepycat/db/class-use/SecondaryCursor.html | 46 +- .../sleepycat/db/class-use/SecondaryDatabase.html | 62 +- .../db/class-use/SecondaryKeyCreator.html | 56 +- .../java/com/sleepycat/db/class-use/Sequence.html | 36 +- .../com/sleepycat/db/class-use/SequenceConfig.html | 41 +- .../com/sleepycat/db/class-use/SequenceStats.html | 36 +- .../com/sleepycat/db/class-use/StatsConfig.html | 90 +- .../com/sleepycat/db/class-use/Transaction.html | 343 +- .../sleepycat/db/class-use/TransactionConfig.html | 67 +- .../db/class-use/TransactionStats.Active.html | 36 +- .../sleepycat/db/class-use/TransactionStats.html | 36 +- .../db/class-use/UpdateConflictException.html | 140 + .../com/sleepycat/db/class-use/VerifyConfig.html | 47 +- .../db/class-use/VersionMismatchException.html | 140 + db/docs/java/com/sleepycat/db/package-frame.html | 48 +- db/docs/java/com/sleepycat/db/package-summary.html | 149 +- db/docs/java/com/sleepycat/db/package-tree.html | 77 +- db/docs/java/com/sleepycat/db/package-use.html | 138 +- .../com/sleepycat/util/ExceptionUnwrapper.html | 65 +- .../java/com/sleepycat/util/ExceptionWrapper.html | 90 +- .../java/com/sleepycat/util/FastInputStream.html | 211 +- .../java/com/sleepycat/util/FastOutputStream.html | 129 +- .../com/sleepycat/util/IOExceptionWrapper.html | 112 +- db/docs/java/com/sleepycat/util/PackedInteger.html | 390 + .../sleepycat/util/RuntimeExceptionWrapper.html | 112 +- db/docs/java/com/sleepycat/util/UtfOps.html | 61 +- .../util/class-use/ExceptionUnwrapper.html | 24 +- .../sleepycat/util/class-use/ExceptionWrapper.html | 34 +- .../sleepycat/util/class-use/FastInputStream.html | 34 +- .../sleepycat/util/class-use/FastOutputStream.html | 64 +- .../util/class-use/IOExceptionWrapper.html | 24 +- .../sleepycat/util/class-use/PackedInteger.html | 140 + .../util/class-use/RuntimeExceptionWrapper.html | 24 +- .../java/com/sleepycat/util/class-use/UtfOps.html | 24 +- db/docs/java/com/sleepycat/util/package-frame.html | 6 +- .../java/com/sleepycat/util/package-summary.html | 44 +- db/docs/java/com/sleepycat/util/package-tree.html | 52 +- db/docs/java/com/sleepycat/util/package-use.html | 56 +- db/docs/java/constant-values.html | 108 +- db/docs/java/deprecated-list.html | 220 +- db/docs/java/help-doc.html | 48 +- db/docs/java/index-all.html | 6901 +++-- db/docs/java/index.html | 21 +- db/docs/java/overview-frame.html | 8 +- db/docs/java/overview-summary.html | 34 +- db/docs/java/overview-tree.html | 171 +- db/docs/java/serialized-form.html | 147 +- db/docs/java/style.css | 6 + db/docs/license/license_db.html | 113 + db/docs/license/license_xml.html | 184 + db/docs/ref/am/close.html | 4 +- db/docs/ref/am/count.html | 4 +- db/docs/ref/am/curclose.html | 4 +- db/docs/ref/am/curdel.html | 4 +- db/docs/ref/am/curdup.html | 4 +- db/docs/ref/am/curget.html | 6 +- db/docs/ref/am/curput.html | 4 +- db/docs/ref/am/cursor.html | 8 +- db/docs/ref/am/delete.html | 4 +- db/docs/ref/am/get.html | 4 +- db/docs/ref/am/join.html | 4 +- db/docs/ref/am/open.html | 4 +- db/docs/ref/am/opensub.html | 4 +- db/docs/ref/am/ops.html | 12 +- db/docs/ref/am/put.html | 4 +- db/docs/ref/am/second.html | 8 +- db/docs/ref/am/second.javas | 8 +- db/docs/ref/am/stat.html | 4 +- db/docs/ref/am/sync.html | 4 +- db/docs/ref/am/truncate.html | 4 +- db/docs/ref/am/upgrade.html | 4 +- db/docs/ref/am/verify.html | 4 +- db/docs/ref/am_conf/bt_compare.html | 4 +- db/docs/ref/am_conf/bt_minkey.html | 4 +- db/docs/ref/am_conf/bt_prefix.html | 4 +- db/docs/ref/am_conf/bt_recnum.html | 4 +- db/docs/ref/am_conf/byteorder.html | 4 +- db/docs/ref/am_conf/cachesize.html | 4 +- db/docs/ref/am_conf/dup.html | 4 +- db/docs/ref/am_conf/extentsize.html | 4 +- db/docs/ref/am_conf/h_ffactor.html | 4 +- db/docs/ref/am_conf/h_hash.html | 4 +- db/docs/ref/am_conf/h_nelem.html | 4 +- db/docs/ref/am_conf/intro.html | 4 +- db/docs/ref/am_conf/logrec.html | 4 +- db/docs/ref/am_conf/malloc.html | 4 +- db/docs/ref/am_conf/pagesize.html | 4 +- db/docs/ref/am_conf/re_source.html | 4 +- db/docs/ref/am_conf/recno.html | 4 +- db/docs/ref/am_conf/renumber.html | 4 +- db/docs/ref/am_conf/select.html | 4 +- db/docs/ref/am_misc/align.html | 4 +- db/docs/ref/am_misc/dbsizes.html | 12 +- db/docs/ref/am_misc/diskspace.html | 4 +- db/docs/ref/am_misc/error.html | 4 +- db/docs/ref/am_misc/faq.html | 28 +- db/docs/ref/am_misc/get_bulk.html | 4 +- db/docs/ref/am_misc/partial.html | 4 +- db/docs/ref/am_misc/perm.html | 4 +- db/docs/ref/am_misc/stability.html | 13 +- db/docs/ref/am_misc/struct.html | 4 +- db/docs/ref/am_misc/tune.html | 18 +- db/docs/ref/apprec/auto.html | 7 +- db/docs/ref/apprec/config.html | 4 +- db/docs/ref/apprec/def.html | 11 +- db/docs/ref/apprec/intro.html | 9 +- db/docs/ref/arch/apis.html | 4 +- db/docs/ref/arch/bigpic.html | 4 +- db/docs/ref/arch/progmodel.html | 4 +- db/docs/ref/arch/script.html | 8 +- db/docs/ref/arch/utilities.html | 4 +- db/docs/ref/build_unix/aix.html | 6 +- db/docs/ref/build_unix/conf.html | 32 +- db/docs/ref/build_unix/flags.html | 4 +- db/docs/ref/build_unix/freebsd.html | 4 +- db/docs/ref/build_unix/hpux.html | 4 +- db/docs/ref/build_unix/install.html | 4 +- db/docs/ref/build_unix/intro.html | 14 +- db/docs/ref/build_unix/irix.html | 4 +- db/docs/ref/build_unix/linux.html | 4 +- db/docs/ref/build_unix/macosx.html | 39 +- db/docs/ref/build_unix/notes.html | 13 +- db/docs/ref/build_unix/osf1.html | 4 +- db/docs/ref/build_unix/qnx.html | 19 +- db/docs/ref/build_unix/sco.html | 4 +- db/docs/ref/build_unix/shlib.html | 6 +- db/docs/ref/build_unix/small.html | 18 +- db/docs/ref/build_unix/solaris.html | 4 +- db/docs/ref/build_unix/sunos.html | 4 +- db/docs/ref/build_unix/test.html | 4 +- db/docs/ref/build_unix/ultrix.html | 4 +- db/docs/ref/build_vxworks/faq.html | 4 +- db/docs/ref/build_vxworks/intro.html | 4 +- db/docs/ref/build_vxworks/introae.html | 4 +- db/docs/ref/build_vxworks/notes.html | 4 +- db/docs/ref/build_win/faq.html | 26 +- db/docs/ref/build_win/intro.html | 239 +- db/docs/ref/build_win/notes.html | 78 +- db/docs/ref/build_win/small.html | 24 +- db/docs/ref/build_win/test.html | 20 +- db/docs/ref/cam/app.html | 310 +- db/docs/ref/cam/fail.html | 84 + db/docs/ref/cam/intro.html | 55 +- db/docs/ref/debug/common.html | 14 +- db/docs/ref/debug/compile.html | 4 +- db/docs/ref/debug/intro.html | 31 +- db/docs/ref/debug/printlog.html | 12 +- db/docs/ref/debug/runtime.html | 4 +- db/docs/ref/distrib/layout.html | 17 +- db/docs/ref/distrib/port.html | 15 +- db/docs/ref/dumpload/format.html | 4 +- db/docs/ref/dumpload/text.html | 4 +- db/docs/ref/dumpload/utility.html | 4 +- db/docs/ref/env/create.html | 23 +- db/docs/ref/env/db_config.html | 17 +- db/docs/ref/env/encrypt.html | 8 +- db/docs/ref/env/error.html | 4 +- db/docs/ref/env/faq.html | 27 +- db/docs/ref/env/intro.html | 19 +- db/docs/ref/env/naming.html | 4 +- db/docs/ref/env/open.html | 4 +- db/docs/ref/env/region.html | 31 +- db/docs/ref/env/remote.html | 73 +- db/docs/ref/env/security.html | 4 +- db/docs/ref/ext/mod.html | 8 +- db/docs/ref/ext/perl.html | 8 +- db/docs/ref/ext/php.html | 4 +- db/docs/ref/install/file.html | 4 +- db/docs/ref/install/magic.s5.be.txt | 38 +- db/docs/ref/install/magic.s5.le.txt | 38 +- db/docs/ref/install/magic.txt | 9 +- db/docs/ref/install/multiple.html | 4 +- db/docs/ref/intro/data.html | 16 +- db/docs/ref/intro/dbis.html | 42 +- db/docs/ref/intro/dbisnot.html | 4 +- db/docs/ref/intro/distrib.html | 15 +- db/docs/ref/intro/need.html | 4 +- db/docs/ref/intro/products.html | 34 +- db/docs/ref/intro/terrain.html | 4 +- db/docs/ref/intro/what.html | 4 +- db/docs/ref/intro/where.html | 4 +- db/docs/ref/java/compat.html | 4 +- db/docs/ref/java/conf.html | 14 +- db/docs/ref/java/faq.html | 39 +- db/docs/ref/java/program.html | 4 +- db/docs/ref/lock/am_conv.html | 4 +- db/docs/ref/lock/cam_conv.html | 4 +- db/docs/ref/lock/config.html | 4 +- db/docs/ref/lock/dead.html | 8 +- db/docs/ref/lock/deaddbg.html | 10 +- db/docs/ref/lock/intro.html | 7 +- db/docs/ref/lock/max.html | 13 +- db/docs/ref/lock/nondb.html | 4 +- db/docs/ref/lock/notxn.html | 4 +- db/docs/ref/lock/page.html | 4 +- db/docs/ref/lock/stdmode.html | 4 +- db/docs/ref/lock/timeout.html | 10 +- db/docs/ref/lock/twopl.html | 4 +- db/docs/ref/log/config.html | 16 +- db/docs/ref/log/intro.html | 8 +- db/docs/ref/log/limits.html | 4 +- db/docs/ref/mp/config.html | 4 +- db/docs/ref/mp/intro.html | 12 +- db/docs/ref/pindex.src | 1 + db/docs/ref/program/appsignals.html | 4 +- db/docs/ref/program/cache.html | 4 +- db/docs/ref/program/compatible.html | 4 +- db/docs/ref/program/copy.html | 101 +- db/docs/ref/program/environ.html | 4 +- db/docs/ref/program/errorret.html | 29 +- db/docs/ref/program/faq.html | 4 +- db/docs/ref/program/mt.html | 8 +- db/docs/ref/program/namespace.html | 4 +- db/docs/ref/program/ram.html | 141 +- db/docs/ref/program/runtime.html | 20 +- db/docs/ref/program/scope.html | 4 +- db/docs/ref/refs/bdb_usenix.html | 2 +- db/docs/ref/refs/refs.html | 10 +- db/docs/ref/refs/witold.html | 4 +- db/docs/ref/rep/app.html | 140 +- db/docs/ref/rep/base_meth.html | 61 + db/docs/ref/rep/bulk.html | 43 + db/docs/ref/rep/comm.html | 52 +- db/docs/ref/rep/elect.html | 42 +- db/docs/ref/rep/ex.html | 53 +- db/docs/ref/rep/ex_comm.html | 172 +- db/docs/ref/rep/ex_rq.html | 224 +- db/docs/ref/rep/faq.html | 18 +- db/docs/ref/rep/id.html | 8 +- db/docs/ref/rep/init.html | 58 + db/docs/ref/rep/intro.html | 75 +- db/docs/ref/rep/mastersync.html | 118 + db/docs/ref/rep/mgr_meth.html | 72 + db/docs/ref/rep/newsite.html | 11 +- db/docs/ref/rep/partition.html | 30 +- db/docs/ref/rep/pri.html | 12 +- db/docs/ref/rep/trans.html | 26 +- db/docs/ref/rpc/client.html | 4 +- db/docs/ref/rpc/faq.html | 4 +- db/docs/ref/rpc/intro.html | 4 +- db/docs/ref/rpc/server.html | 4 +- db/docs/ref/sequence/intro.html | 8 +- db/docs/ref/tcl/error.html | 4 +- db/docs/ref/tcl/faq.html | 4 +- db/docs/ref/tcl/intro.html | 19 +- db/docs/ref/tcl/program.html | 10 +- db/docs/ref/tcl/using.html | 4 +- db/docs/ref/test/faq.html | 4 +- db/docs/ref/test/run.html | 10 +- db/docs/ref/toc.html | 40 +- db/docs/ref/transapp/admin.html | 4 +- db/docs/ref/transapp/app.html | 311 +- db/docs/ref/transapp/archival.html | 8 +- db/docs/ref/transapp/atomicity.html | 4 +- db/docs/ref/transapp/checkpoint.html | 6 +- db/docs/ref/transapp/cursor.html | 6 +- db/docs/ref/transapp/data_open.html | 4 +- db/docs/ref/transapp/deadlock.html | 4 +- db/docs/ref/transapp/env_open.html | 4 +- db/docs/ref/transapp/fail.html | 72 + db/docs/ref/transapp/faq.html | 45 +- db/docs/ref/transapp/filesys.html | 4 +- db/docs/ref/transapp/hotfail.html | 8 +- db/docs/ref/transapp/inc.html | 8 +- db/docs/ref/transapp/intro.html | 4 +- db/docs/ref/transapp/logfile.html | 4 +- db/docs/ref/transapp/nested.html | 4 +- db/docs/ref/transapp/put.html | 39 +- db/docs/ref/transapp/read.html | 133 +- db/docs/ref/transapp/reclimit.html | 8 +- db/docs/ref/transapp/recovery.html | 12 +- db/docs/ref/transapp/term.html | 10 +- db/docs/ref/transapp/throughput.html | 4 +- db/docs/ref/transapp/transapp.cs | 2 +- db/docs/ref/transapp/tune.html | 64 +- db/docs/ref/transapp/why.html | 4 +- db/docs/ref/transapp/writetest.cs | 4 +- db/docs/ref/txn/config.html | 4 +- db/docs/ref/txn/intro.html | 7 +- db/docs/ref/txn/limits.html | 4 +- db/docs/ref/upgrade.2.0/convert.html | 4 +- db/docs/ref/upgrade.2.0/disk.html | 4 +- db/docs/ref/upgrade.2.0/intro.html | 4 +- db/docs/ref/upgrade.2.0/system.html | 4 +- db/docs/ref/upgrade.2.0/toc.html | 4 +- db/docs/ref/upgrade.3.0/close.html | 4 +- db/docs/ref/upgrade.3.0/cxx.html | 4 +- db/docs/ref/upgrade.3.0/db.html | 8 +- db/docs/ref/upgrade.3.0/db_cxx.html | 4 +- db/docs/ref/upgrade.3.0/dbenv.html | 8 +- db/docs/ref/upgrade.3.0/dbenv_cxx.html | 4 +- db/docs/ref/upgrade.3.0/dbinfo.html | 4 +- db/docs/ref/upgrade.3.0/disk.html | 4 +- db/docs/ref/upgrade.3.0/eacces.html | 4 +- db/docs/ref/upgrade.3.0/eagain.html | 4 +- db/docs/ref/upgrade.3.0/envopen.html | 4 +- db/docs/ref/upgrade.3.0/func.html | 4 +- db/docs/ref/upgrade.3.0/intro.html | 4 +- db/docs/ref/upgrade.3.0/java.html | 4 +- db/docs/ref/upgrade.3.0/join.html | 4 +- db/docs/ref/upgrade.3.0/jump_set.html | 4 +- db/docs/ref/upgrade.3.0/lock_detect.html | 4 +- db/docs/ref/upgrade.3.0/lock_notheld.html | 4 +- db/docs/ref/upgrade.3.0/lock_put.html | 4 +- db/docs/ref/upgrade.3.0/lock_stat.html | 4 +- db/docs/ref/upgrade.3.0/log_register.html | 4 +- db/docs/ref/upgrade.3.0/log_stat.html | 4 +- db/docs/ref/upgrade.3.0/memp_stat.html | 4 +- db/docs/ref/upgrade.3.0/open.html | 4 +- db/docs/ref/upgrade.3.0/rmw.html | 4 +- db/docs/ref/upgrade.3.0/stat.html | 4 +- db/docs/ref/upgrade.3.0/toc.html | 4 +- db/docs/ref/upgrade.3.0/txn_begin.html | 4 +- db/docs/ref/upgrade.3.0/txn_commit.html | 4 +- db/docs/ref/upgrade.3.0/txn_stat.html | 4 +- db/docs/ref/upgrade.3.0/value_set.html | 4 +- db/docs/ref/upgrade.3.0/xa.html | 4 +- db/docs/ref/upgrade.3.1/btstat.html | 4 +- db/docs/ref/upgrade.3.1/config.html | 4 +- db/docs/ref/upgrade.3.1/disk.html | 4 +- db/docs/ref/upgrade.3.1/dup.html | 4 +- db/docs/ref/upgrade.3.1/env.html | 4 +- db/docs/ref/upgrade.3.1/intro.html | 4 +- db/docs/ref/upgrade.3.1/log_register.html | 4 +- db/docs/ref/upgrade.3.1/logalloc.html | 8 +- db/docs/ref/upgrade.3.1/memp_register.html | 4 +- db/docs/ref/upgrade.3.1/put.html | 4 +- db/docs/ref/upgrade.3.1/set_feedback.html | 4 +- db/docs/ref/upgrade.3.1/set_paniccall.html | 14 +- db/docs/ref/upgrade.3.1/set_tx_recover.html | 4 +- db/docs/ref/upgrade.3.1/sysmem.html | 4 +- db/docs/ref/upgrade.3.1/tcl.html | 4 +- db/docs/ref/upgrade.3.1/tmp.html | 4 +- db/docs/ref/upgrade.3.1/toc.html | 4 +- db/docs/ref/upgrade.3.1/txn_check.html | 4 +- db/docs/ref/upgrade.3.2/callback.html | 4 +- db/docs/ref/upgrade.3.2/db_dump.html | 4 +- db/docs/ref/upgrade.3.2/disk.html | 4 +- db/docs/ref/upgrade.3.2/handle.html | 4 +- db/docs/ref/upgrade.3.2/incomplete.html | 4 +- db/docs/ref/upgrade.3.2/intro.html | 4 +- db/docs/ref/upgrade.3.2/mutexlock.html | 4 +- db/docs/ref/upgrade.3.2/notfound.html | 4 +- db/docs/ref/upgrade.3.2/renumber.html | 4 +- db/docs/ref/upgrade.3.2/set_flags.html | 4 +- db/docs/ref/upgrade.3.2/toc.html | 4 +- db/docs/ref/upgrade.3.2/tx_recover.html | 4 +- db/docs/ref/upgrade.3.3/alloc.html | 4 +- db/docs/ref/upgrade.3.3/bigfile.html | 4 +- db/docs/ref/upgrade.3.3/conflict.html | 4 +- db/docs/ref/upgrade.3.3/disk.html | 4 +- db/docs/ref/upgrade.3.3/getswap.html | 4 +- db/docs/ref/upgrade.3.3/gettype.html | 4 +- db/docs/ref/upgrade.3.3/intro.html | 4 +- db/docs/ref/upgrade.3.3/memp_fget.html | 4 +- db/docs/ref/upgrade.3.3/rpc.html | 4 +- db/docs/ref/upgrade.3.3/shared.html | 4 +- db/docs/ref/upgrade.3.3/toc.html | 4 +- db/docs/ref/upgrade.3.3/txn_prepare.html | 4 +- db/docs/ref/upgrade.4.0/asr.html | 9 +- db/docs/ref/upgrade.4.0/cxx.html | 12 +- db/docs/ref/upgrade.4.0/deadlock.html | 4 +- db/docs/ref/upgrade.4.0/disk.html | 4 +- db/docs/ref/upgrade.4.0/env.html | 18 +- db/docs/ref/upgrade.4.0/intro.html | 4 +- db/docs/ref/upgrade.4.0/java.html | 12 +- db/docs/ref/upgrade.4.0/lock.html | 4 +- db/docs/ref/upgrade.4.0/lock_id_free.html | 4 +- db/docs/ref/upgrade.4.0/log.html | 4 +- db/docs/ref/upgrade.4.0/mp.html | 4 +- db/docs/ref/upgrade.4.0/rpc.html | 4 +- db/docs/ref/upgrade.4.0/set_lk_max.html | 4 +- db/docs/ref/upgrade.4.0/toc.html | 4 +- db/docs/ref/upgrade.4.0/txn.html | 4 +- db/docs/ref/upgrade.4.1/app_dispatch.html | 4 +- db/docs/ref/upgrade.4.1/checkpoint.html | 13 +- db/docs/ref/upgrade.4.1/cxx.html | 4 +- db/docs/ref/upgrade.4.1/disk.html | 4 +- db/docs/ref/upgrade.4.1/excl.html | 4 +- db/docs/ref/upgrade.4.1/fop.html | 4 +- db/docs/ref/upgrade.4.1/hash_nelem.html | 4 +- db/docs/ref/upgrade.4.1/incomplete.html | 4 +- db/docs/ref/upgrade.4.1/intro.html | 4 +- db/docs/ref/upgrade.4.1/java.html | 4 +- db/docs/ref/upgrade.4.1/log_register.html | 9 +- db/docs/ref/upgrade.4.1/log_stat.html | 4 +- db/docs/ref/upgrade.4.1/memp_sync.html | 8 +- db/docs/ref/upgrade.4.1/toc.html | 4 +- db/docs/ref/upgrade.4.2/cksum.html | 4 +- db/docs/ref/upgrade.4.2/client.html | 4 +- db/docs/ref/upgrade.4.2/del.html | 4 +- db/docs/ref/upgrade.4.2/disk.html | 4 +- db/docs/ref/upgrade.4.2/intro.html | 4 +- db/docs/ref/upgrade.4.2/java.html | 30 +- db/docs/ref/upgrade.4.2/lockng.html | 4 +- db/docs/ref/upgrade.4.2/nosync.html | 4 +- db/docs/ref/upgrade.4.2/priority.html | 4 +- db/docs/ref/upgrade.4.2/queue.html | 4 +- db/docs/ref/upgrade.4.2/repinit.html | 4 +- db/docs/ref/upgrade.4.2/tcl.html | 4 +- db/docs/ref/upgrade.4.2/toc.html | 4 +- db/docs/ref/upgrade.4.2/verify.html | 4 +- db/docs/ref/upgrade.4.3/cput.html | 4 +- db/docs/ref/upgrade.4.3/disk.html | 10 +- db/docs/ref/upgrade.4.3/enomem.html | 4 +- db/docs/ref/upgrade.4.3/err.html | 4 +- db/docs/ref/upgrade.4.3/fileopen.html | 4 +- db/docs/ref/upgrade.4.3/intro.html | 4 +- db/docs/ref/upgrade.4.3/java.html | 10 +- db/docs/ref/upgrade.4.3/log.html | 4 +- db/docs/ref/upgrade.4.3/repl.html | 12 +- db/docs/ref/upgrade.4.3/rtc.html | 4 +- db/docs/ref/upgrade.4.3/stat.html | 10 +- db/docs/ref/upgrade.4.3/toc.html | 4 +- db/docs/ref/upgrade.4.3/verb.html | 4 +- db/docs/ref/upgrade.4.4/autocommit.html | 41 + db/docs/ref/upgrade.4.4/clear.html | 32 + db/docs/ref/upgrade.4.4/disk.html | 26 + db/docs/ref/upgrade.4.4/intro.html | 26 + db/docs/ref/upgrade.4.4/isolation.html | 28 + db/docs/ref/upgrade.4.4/joinenv.html | 60 + db/docs/ref/upgrade.4.4/lockstat.html | 28 + db/docs/ref/upgrade.4.4/mutex.html | 32 + db/docs/ref/upgrade.4.4/toc.html | 33 + db/docs/ref/upgrade.4.5/alive.html | 30 + db/docs/ref/upgrade.4.5/applog.html | 33 + db/docs/ref/upgrade.4.5/collect.html | 31 + db/docs/ref/upgrade.4.5/config.html | 31 + db/docs/ref/upgrade.4.5/deprecate.html | 34 + db/docs/ref/upgrade.4.5/disk.html | 26 + db/docs/ref/upgrade.4.5/elect.html | 39 + db/docs/ref/upgrade.4.5/intro.html | 26 + db/docs/ref/upgrade.4.5/memp.html | 29 + db/docs/ref/upgrade.4.5/pagesize.html | 27 + db/docs/ref/upgrade.4.5/paniccall.html | 34 + db/docs/ref/upgrade.4.5/rep_event.html | 29 + db/docs/ref/upgrade.4.5/rep_set.html | 30 + db/docs/ref/upgrade.4.5/source.html | 37 + db/docs/ref/upgrade.4.5/toc.html | 39 + db/docs/ref/upgrade/process.html | 34 +- db/docs/ref/upgrade/version.html | 4 +- db/docs/ref/xa/build.html | 4 +- db/docs/ref/xa/faq.html | 4 +- db/docs/ref/xa/intro.html | 4 +- db/docs/ref/xa/xa_config.html | 4 +- db/docs/ref/xa/xa_intro.html | 4 +- db/docs/utility/berkeley_db_svc.html | 4 +- db/docs/utility/db_archive.html | 9 +- db/docs/utility/db_checkpoint.html | 15 +- db/docs/utility/db_deadlock.html | 4 +- db/docs/utility/db_dump.html | 4 +- db/docs/utility/db_hotbackup.html | 129 + db/docs/utility/db_load.html | 4 +- db/docs/utility/db_printlog.html | 4 +- db/docs/utility/db_recover.html | 10 +- db/docs/utility/db_stat.html | 23 +- db/docs/utility/db_upgrade.html | 9 +- db/docs/utility/db_verify.html | 4 +- db/docs/utility/index.html | 7 +- db/env/db_salloc.c | 41 +- db/env/db_shash.c | 10 +- db/env/env_config.c | 370 + db/env/env_failchk.c | 335 + db/env/env_file.c | 131 +- db/env/env_method.c | 717 +- db/env/env_open.c | 1092 +- db/env/env_recover.c | 324 +- db/env/env_region.c | 711 +- db/env/env_register.c | 422 + db/env/env_stat.c | 341 +- db/examples_c/README | 6 +- db/examples_c/bench_001.c | 137 +- db/examples_c/csv/DbRecord.c | 471 + db/examples_c/csv/README | 409 + db/examples_c/csv/code.c | 406 + db/examples_c/csv/csv.h | 102 + db/examples_c/csv/csv_extern.h | 38 + db/examples_c/csv/db.c | 245 + db/examples_c/csv/load.c | 347 + db/examples_c/csv/load_main.c | 118 + db/examples_c/csv/query.c | 242 + db/examples_c/csv/query_main.c | 100 + db/examples_c/csv/sample.csv | 8 + db/examples_c/csv/sample.desc | 10 + db/examples_c/csv/util.c | 310 + db/examples_c/ex_access.c | 6 +- db/examples_c/ex_apprec/ex_apprec.c | 6 +- db/examples_c/ex_apprec/ex_apprec.h | 6 +- db/examples_c/ex_apprec/ex_apprec.src | 8 +- db/examples_c/ex_apprec/ex_apprec_auto.c | 26 +- db/examples_c/ex_apprec/ex_apprec_auto.h | 2 +- db/examples_c/ex_apprec/ex_apprec_autop.c | 12 +- db/examples_c/ex_apprec/ex_apprec_rec.c | 6 +- db/examples_c/ex_apprec/ex_apprec_template | 6 - db/examples_c/ex_btrec.c | 6 +- db/examples_c/ex_dbclient.c | 6 +- db/examples_c/ex_env.c | 6 +- db/examples_c/ex_lock.c | 6 +- db/examples_c/ex_mpool.c | 8 +- db/examples_c/ex_rep/README | 19 + db/examples_c/ex_rep/base/rep_base.c | 252 + db/examples_c/ex_rep/base/rep_base.h | 132 + db/examples_c/ex_rep/base/rep_msg.c | 464 + db/examples_c/ex_rep/base/rep_net.c | 748 + db/examples_c/ex_rep/common/rep_common.c | 286 + db/examples_c/ex_rep/common/rep_common.h | 18 + db/examples_c/ex_rep/mgr/rep_mgr.c | 149 + db/examples_c/ex_sequence.c | 36 +- db/examples_c/ex_thread.c | 12 +- db/examples_c/ex_tpcb.c | 23 +- .../getting_started/example_database_load.c | 29 +- .../getting_started/example_database_read.c | 16 +- .../getting_started/gettingstarted_common.c | 9 +- .../getting_started/gettingstarted_common.h | 51 +- db/examples_c/txn_guide/txn_guide.c | 461 + db/examples_c/txn_guide/txn_guide_inmemory.c | 450 + db/examples_cxx/AccessExample.cpp | 6 +- db/examples_cxx/BtRecExample.cpp | 6 +- db/examples_cxx/EnvExample.cpp | 6 +- db/examples_cxx/LockExample.cpp | 6 +- db/examples_cxx/MpoolExample.cpp | 8 +- db/examples_cxx/SequenceExample.cpp | 12 +- db/examples_cxx/TpcbExample.cpp | 89 +- db/examples_cxx/excxx_repquote/RepConfigInfo.cpp | 53 + db/examples_cxx/excxx_repquote/RepConfigInfo.h | 36 + db/examples_cxx/excxx_repquote/RepQuoteExample.cpp | 459 + .../excxx_example_database_load.cpp | 17 +- .../excxx_example_database_read.cpp | 7 +- .../getting_started/gettingStartedCommon.hpp | 34 +- db/examples_cxx/txn_guide/TxnGuide.cpp | 387 + db/examples_cxx/txn_guide/TxnGuideInMemory.cpp | 369 + .../src/collections/access/AccessExample.java | 286 + .../src/collections/hello/HelloDatabaseWorld.java | 163 + .../src/collections/ship/basic/PartData.java | 65 + .../src/collections/ship/basic/PartKey.java | 41 + .../src/collections/ship/basic/Sample.java | 267 + .../src/collections/ship/basic/SampleDatabase.java | 135 + .../src/collections/ship/basic/SampleViews.java | 123 + .../src/collections/ship/basic/ShipmentData.java | 42 + .../src/collections/ship/basic/ShipmentKey.java | 49 + .../src/collections/ship/basic/SupplierData.java | 58 + .../src/collections/ship/basic/SupplierKey.java | 41 + .../src/collections/ship/basic/Weight.java | 50 + .../src/collections/ship/entity/Part.java | 73 + .../src/collections/ship/entity/PartData.java | 66 + .../src/collections/ship/entity/PartKey.java | 41 + .../src/collections/ship/entity/Sample.java | 250 + .../collections/ship/entity/SampleDatabase.java | 330 + .../src/collections/ship/entity/SampleViews.java | 307 + .../src/collections/ship/entity/Shipment.java | 56 + .../src/collections/ship/entity/ShipmentData.java | 43 + .../src/collections/ship/entity/ShipmentKey.java | 49 + .../src/collections/ship/entity/Supplier.java | 64 + .../src/collections/ship/entity/SupplierData.java | 59 + .../src/collections/ship/entity/SupplierKey.java | 41 + .../src/collections/ship/entity/Weight.java | 50 + .../src/collections/ship/factory/Part.java | 107 + .../src/collections/ship/factory/PartKey.java | 61 + .../src/collections/ship/factory/Sample.java | 248 + .../collections/ship/factory/SampleDatabase.java | 225 + .../src/collections/ship/factory/SampleViews.java | 143 + .../src/collections/ship/factory/Shipment.java | 103 + .../src/collections/ship/factory/ShipmentKey.java | 71 + .../src/collections/ship/factory/Supplier.java | 109 + .../src/collections/ship/factory/SupplierKey.java | 61 + .../src/collections/ship/factory/Weight.java | 50 + .../src/collections/ship/index/PartData.java | 65 + .../src/collections/ship/index/PartKey.java | 41 + .../src/collections/ship/index/Sample.java | 303 + .../src/collections/ship/index/SampleDatabase.java | 330 + .../src/collections/ship/index/SampleViews.java | 162 + .../src/collections/ship/index/ShipmentData.java | 42 + .../src/collections/ship/index/ShipmentKey.java | 49 + .../src/collections/ship/index/SupplierData.java | 58 + .../src/collections/ship/index/SupplierKey.java | 41 + .../src/collections/ship/index/Weight.java | 50 + .../collections/ship/marshal/MarshalledEnt.java | 43 + .../collections/ship/marshal/MarshalledKey.java | 37 + .../src/collections/ship/marshal/Part.java | 117 + .../src/collections/ship/marshal/PartKey.java | 60 + .../src/collections/ship/marshal/Sample.java | 250 + .../collections/ship/marshal/SampleDatabase.java | 259 + .../src/collections/ship/marshal/SampleViews.java | 277 + .../src/collections/ship/marshal/Shipment.java | 114 + .../src/collections/ship/marshal/ShipmentKey.java | 70 + .../src/collections/ship/marshal/Supplier.java | 119 + .../src/collections/ship/marshal/SupplierKey.java | 60 + .../src/collections/ship/marshal/Weight.java | 50 + .../src/collections/ship/sentity/Part.java | 91 + .../src/collections/ship/sentity/PartKey.java | 39 + .../src/collections/ship/sentity/Sample.java | 250 + .../collections/ship/sentity/SampleDatabase.java | 322 + .../src/collections/ship/sentity/SampleViews.java | 420 + .../src/collections/ship/sentity/Shipment.java | 76 + .../src/collections/ship/sentity/ShipmentKey.java | 47 + .../src/collections/ship/sentity/Supplier.java | 83 + .../src/collections/ship/sentity/SupplierKey.java | 39 + .../src/collections/ship/sentity/Weight.java | 50 + .../src/collections/ship/tuple/Part.java | 73 + .../src/collections/ship/tuple/PartData.java | 66 + .../src/collections/ship/tuple/PartKey.java | 39 + .../src/collections/ship/tuple/Sample.java | 249 + .../src/collections/ship/tuple/SampleDatabase.java | 322 + .../src/collections/ship/tuple/SampleViews.java | 397 + .../src/collections/ship/tuple/Shipment.java | 56 + .../src/collections/ship/tuple/ShipmentData.java | 43 + .../src/collections/ship/tuple/ShipmentKey.java | 47 + .../src/collections/ship/tuple/Supplier.java | 64 + .../src/collections/ship/tuple/SupplierData.java | 59 + .../src/collections/ship/tuple/SupplierKey.java | 39 + .../src/collections/ship/tuple/Weight.java | 50 + db/examples_java/src/db/AccessExample.java | 183 + db/examples_java/src/db/BtRecExample.java | 289 + db/examples_java/src/db/BulkAccessExample.java | 162 + db/examples_java/src/db/BulkAccessNIOExample.java | 182 + db/examples_java/src/db/EnvExample.java | 116 + .../src/db/GettingStarted/ExampleDatabaseLoad.java | 223 + .../src/db/GettingStarted/ExampleDatabaseRead.java | 197 + .../src/db/GettingStarted/Inventory.java | 62 + .../src/db/GettingStarted/InventoryBinding.java | 46 + .../src/db/GettingStarted/ItemNameKeyCreator.java | 37 + db/examples_java/src/db/GettingStarted/MyDbs.java | 157 + db/examples_java/src/db/GettingStarted/Vendor.java | 82 + .../src/db/GettingStarted/inventory.txt | 800 + db/examples_java/src/db/GettingStarted/vendors.txt | 6 + db/examples_java/src/db/LockExample.java | 212 + db/examples_java/src/db/RPCExample.java | 107 + db/examples_java/src/db/SequenceExample.java | 93 + db/examples_java/src/db/TpcbExample.java | 789 + db/examples_java/src/db/repquote/RepConfig.java | 104 + .../src/db/repquote/RepQuoteEnvironment.java | 41 + .../src/db/repquote/RepQuoteExample.java | 407 + db/examples_java/src/db/txn/DBWriter.java | 205 + db/examples_java/src/db/txn/PayloadData.java | 19 + db/examples_java/src/db/txn/TxnGuide.java | 173 + db/examples_java/src/db/txn/TxnGuideInMemory.java | 164 + db/fileops/fileops.src | 24 +- db/fileops/fileops_auto.c | 238 +- db/fileops/fileops_autop.c | 68 +- db/fileops/fop_basic.c | 90 +- db/fileops/fop_rec.c | 76 +- db/fileops/fop_util.c | 1081 +- db/hash/hash.c | 294 +- db/hash/hash.src | 63 +- db/hash/hash_auto.c | 679 +- db/hash/hash_autop.c | 199 +- db/hash/hash_conv.c | 10 +- db/hash/hash_dup.c | 117 +- db/hash/hash_func.c | 10 +- db/hash/hash_meta.c | 42 +- db/hash/hash_method.c | 10 +- db/hash/hash_open.c | 92 +- db/hash/hash_page.c | 252 +- db/hash/hash_rec.c | 746 +- db/hash/hash_reclaim.c | 20 +- db/hash/hash_stat.c | 38 +- db/hash/hash_stub.c | 44 +- db/hash/hash_upgrade.c | 16 +- db/hash/hash_verify.c | 113 +- db/hmac/hmac.c | 74 +- db/hmac/sha1.c | 26 +- db/hsearch/hsearch.c | 25 +- .../src/com/sleepycat/bind/ByteArrayBinding.java | 24 +- db/java/src/com/sleepycat/bind/EntityBinding.java | 6 +- db/java/src/com/sleepycat/bind/EntryBinding.java | 6 +- .../com/sleepycat/bind/RecordNumberBinding.java | 6 +- db/java/src/com/sleepycat/bind/package.html | 2 +- .../com/sleepycat/bind/serial/ClassCatalog.java | 6 +- .../src/com/sleepycat/bind/serial/SerialBase.java | 93 + .../com/sleepycat/bind/serial/SerialBinding.java | 51 +- .../src/com/sleepycat/bind/serial/SerialInput.java | 45 +- .../com/sleepycat/bind/serial/SerialOutput.java | 15 +- .../sleepycat/bind/serial/SerialSerialBinding.java | 6 +- .../bind/serial/SerialSerialKeyCreator.java | 6 +- .../sleepycat/bind/serial/StoredClassCatalog.java | 56 +- .../sleepycat/bind/serial/TupleSerialBinding.java | 17 +- .../bind/serial/TupleSerialKeyCreator.java | 17 +- .../bind/serial/TupleSerialMarshalledBinding.java | 6 +- .../serial/TupleSerialMarshalledKeyCreator.java | 6 +- db/java/src/com/sleepycat/bind/serial/package.html | 2 +- .../com/sleepycat/bind/tuple/BooleanBinding.java | 24 +- .../src/com/sleepycat/bind/tuple/ByteBinding.java | 23 +- .../com/sleepycat/bind/tuple/CharacterBinding.java | 23 +- .../com/sleepycat/bind/tuple/DoubleBinding.java | 29 +- .../src/com/sleepycat/bind/tuple/FloatBinding.java | 28 +- .../com/sleepycat/bind/tuple/IntegerBinding.java | 23 +- .../src/com/sleepycat/bind/tuple/LongBinding.java | 23 +- .../sleepycat/bind/tuple/MarshalledTupleEntry.java | 6 +- .../bind/tuple/MarshalledTupleKeyEntity.java | 6 +- .../src/com/sleepycat/bind/tuple/ShortBinding.java | 23 +- .../sleepycat/bind/tuple/SortedDoubleBinding.java | 86 + .../sleepycat/bind/tuple/SortedFloatBinding.java | 85 + .../com/sleepycat/bind/tuple/StringBinding.java | 24 +- .../src/com/sleepycat/bind/tuple/TupleBase.java | 164 + .../src/com/sleepycat/bind/tuple/TupleBinding.java | 112 +- .../src/com/sleepycat/bind/tuple/TupleInput.java | 205 +- .../sleepycat/bind/tuple/TupleInputBinding.java | 6 +- .../bind/tuple/TupleMarshalledBinding.java | 6 +- .../src/com/sleepycat/bind/tuple/TupleOutput.java | 112 +- .../sleepycat/bind/tuple/TupleTupleBinding.java | 17 +- .../sleepycat/bind/tuple/TupleTupleKeyCreator.java | 29 +- .../bind/tuple/TupleTupleMarshalledBinding.java | 6 +- .../bind/tuple/TupleTupleMarshalledKeyCreator.java | 6 +- db/java/src/com/sleepycat/bind/tuple/package.html | 2 +- .../com/sleepycat/collections/BaseIterator.java | 35 + .../com/sleepycat/collections/BlockIterator.java | 728 + .../sleepycat/collections/CurrentTransaction.java | 67 +- .../src/com/sleepycat/collections/DataCursor.java | 309 +- .../src/com/sleepycat/collections/DataView.java | 147 +- .../sleepycat/collections/MapEntryParameter.java | 6 +- .../com/sleepycat/collections/MyRangeCursor.java | 74 + .../sleepycat/collections/PrimaryKeyAssigner.java | 6 +- .../sleepycat/collections/StoredCollection.java | 201 +- .../sleepycat/collections/StoredCollections.java | 214 +- .../com/sleepycat/collections/StoredContainer.java | 147 +- .../com/sleepycat/collections/StoredEntrySet.java | 38 +- .../com/sleepycat/collections/StoredIterator.java | 71 +- .../com/sleepycat/collections/StoredKeySet.java | 26 +- .../src/com/sleepycat/collections/StoredList.java | 67 +- .../src/com/sleepycat/collections/StoredMap.java | 195 +- .../com/sleepycat/collections/StoredMapEntry.java | 18 +- .../collections/StoredSortedEntrySet.java | 35 +- .../sleepycat/collections/StoredSortedKeySet.java | 35 +- .../com/sleepycat/collections/StoredSortedMap.java | 36 +- .../collections/StoredSortedValueSet.java | 35 +- .../com/sleepycat/collections/StoredValueSet.java | 58 +- .../sleepycat/collections/TransactionRunner.java | 97 +- .../sleepycat/collections/TransactionWorker.java | 6 +- .../sleepycat/collections/TupleSerialFactory.java | 6 +- db/java/src/com/sleepycat/collections/package.html | 11 +- db/java/src/com/sleepycat/compat/DbCompat.java | 45 +- .../com/sleepycat/db/BtreePrefixCalculator.java | 6 +- db/java/src/com/sleepycat/db/BtreeStats.java | 12 +- db/java/src/com/sleepycat/db/CacheFile.java | 6 +- .../src/com/sleepycat/db/CacheFilePriority.java | 14 +- db/java/src/com/sleepycat/db/CacheFileStats.java | 6 +- db/java/src/com/sleepycat/db/CacheStats.java | 36 +- db/java/src/com/sleepycat/db/CheckpointConfig.java | 14 +- db/java/src/com/sleepycat/db/CompactConfig.java | 79 + db/java/src/com/sleepycat/db/CompactStats.java | 85 + db/java/src/com/sleepycat/db/Cursor.java | 25 +- db/java/src/com/sleepycat/db/CursorConfig.java | 62 +- db/java/src/com/sleepycat/db/Database.java | 43 +- db/java/src/com/sleepycat/db/DatabaseConfig.java | 56 +- db/java/src/com/sleepycat/db/DatabaseEntry.java | 114 +- .../src/com/sleepycat/db/DatabaseException.java | 13 +- db/java/src/com/sleepycat/db/DatabaseStats.java | 13 +- db/java/src/com/sleepycat/db/DatabaseType.java | 14 +- .../src/com/sleepycat/db/DeadlockException.java | 13 +- db/java/src/com/sleepycat/db/Environment.java | 114 +- .../src/com/sleepycat/db/EnvironmentConfig.java | 377 +- db/java/src/com/sleepycat/db/ErrorHandler.java | 11 +- db/java/src/com/sleepycat/db/EventHandler.java | 14 + db/java/src/com/sleepycat/db/EventType.java | 68 + db/java/src/com/sleepycat/db/FeedbackHandler.java | 11 +- db/java/src/com/sleepycat/db/HashStats.java | 6 +- db/java/src/com/sleepycat/db/Hasher.java | 11 +- db/java/src/com/sleepycat/db/JoinConfig.java | 14 +- db/java/src/com/sleepycat/db/JoinCursor.java | 14 +- db/java/src/com/sleepycat/db/KeyRange.java | 11 +- db/java/src/com/sleepycat/db/Lock.java | 12 +- db/java/src/com/sleepycat/db/LockDetectMode.java | 14 +- db/java/src/com/sleepycat/db/LockMode.java | 27 +- .../com/sleepycat/db/LockNotGrantedException.java | 13 +- db/java/src/com/sleepycat/db/LockOperation.java | 14 +- db/java/src/com/sleepycat/db/LockRequest.java | 11 +- db/java/src/com/sleepycat/db/LockRequestMode.java | 14 +- db/java/src/com/sleepycat/db/LockStats.java | 38 +- db/java/src/com/sleepycat/db/LogCursor.java | 10 +- db/java/src/com/sleepycat/db/LogRecordHandler.java | 11 +- .../src/com/sleepycat/db/LogSequenceNumber.java | 6 +- db/java/src/com/sleepycat/db/LogStats.java | 18 +- db/java/src/com/sleepycat/db/MemoryException.java | 13 +- db/java/src/com/sleepycat/db/MessageHandler.java | 11 +- .../src/com/sleepycat/db/MultipleDataEntry.java | 19 +- db/java/src/com/sleepycat/db/MultipleEntry.java | 27 +- .../src/com/sleepycat/db/MultipleKeyDataEntry.java | 19 +- .../com/sleepycat/db/MultipleKeyNIODataEntry.java | 74 + .../src/com/sleepycat/db/MultipleNIODataEntry.java | 69 + .../com/sleepycat/db/MultipleRecnoDataEntry.java | 19 +- .../sleepycat/db/MultipleRecnoNIODataEntry.java | 73 + db/java/src/com/sleepycat/db/MutexStats.java | 74 + db/java/src/com/sleepycat/db/OperationStatus.java | 14 +- db/java/src/com/sleepycat/db/PanicHandler.java | 11 +- .../src/com/sleepycat/db/PreparedTransaction.java | 11 +- db/java/src/com/sleepycat/db/QueueStats.java | 6 +- .../src/com/sleepycat/db/RecordNumberAppender.java | 11 +- .../src/com/sleepycat/db/RecoveryOperation.java | 14 +- .../src/com/sleepycat/db/ReplicationConfig.java | 60 + .../db/ReplicationDuplicateMasterException.java | 19 + .../db/ReplicationHandleDeadException.java | 13 +- .../db/ReplicationHoldElectionException.java | 19 + .../com/sleepycat/db/ReplicationHostAddress.java | 43 + .../db/ReplicationJoinFailureException.java | 19 + .../sleepycat/db/ReplicationLockoutException.java | 19 + .../sleepycat/db/ReplicationManagerAckPolicy.java | 76 + .../db/ReplicationManagerStartPolicy.java | 68 + .../db/ReplicationSiteUnavailableException.java | 19 + db/java/src/com/sleepycat/db/ReplicationStats.java | 60 +- .../src/com/sleepycat/db/ReplicationStatus.java | 38 +- .../com/sleepycat/db/ReplicationTimeoutType.java | 61 + .../src/com/sleepycat/db/ReplicationTransport.java | 15 +- .../src/com/sleepycat/db/RunRecoveryException.java | 13 +- db/java/src/com/sleepycat/db/SecondaryConfig.java | 25 +- db/java/src/com/sleepycat/db/SecondaryCursor.java | 14 +- .../src/com/sleepycat/db/SecondaryDatabase.java | 14 +- .../src/com/sleepycat/db/SecondaryKeyCreator.java | 14 +- db/java/src/com/sleepycat/db/Sequence.java | 6 +- db/java/src/com/sleepycat/db/SequenceConfig.java | 14 +- db/java/src/com/sleepycat/db/SequenceStats.java | 6 +- db/java/src/com/sleepycat/db/StatsConfig.java | 14 +- db/java/src/com/sleepycat/db/Transaction.java | 26 +- .../src/com/sleepycat/db/TransactionConfig.java | 52 +- db/java/src/com/sleepycat/db/TransactionStats.java | 50 +- db/java/src/com/sleepycat/db/VerifyConfig.java | 14 +- .../com/sleepycat/db/VersionMismatchException.java | 19 + db/java/src/com/sleepycat/db/internal/Db.java | 68 +- .../src/com/sleepycat/db/internal/DbConstants.java | 226 +- db/java/src/com/sleepycat/db/internal/DbEnv.java | 183 +- db/java/src/com/sleepycat/db/internal/DbLock.java | 11 +- db/java/src/com/sleepycat/db/internal/DbLogc.java | 11 +- .../src/com/sleepycat/db/internal/DbMpoolFile.java | 11 +- .../src/com/sleepycat/db/internal/DbSequence.java | 11 +- db/java/src/com/sleepycat/db/internal/DbTxn.java | 17 +- db/java/src/com/sleepycat/db/internal/DbUtil.java | 11 +- db/java/src/com/sleepycat/db/internal/Dbc.java | 11 +- db/java/src/com/sleepycat/db/internal/db_java.java | 5 +- .../src/com/sleepycat/db/internal/db_javaJNI.java | 76 +- db/java/src/com/sleepycat/db/package.html | 8 +- .../src/com/sleepycat/util/ExceptionUnwrapper.java | 12 +- .../src/com/sleepycat/util/ExceptionWrapper.java | 28 +- .../src/com/sleepycat/util/FastInputStream.java | 29 +- .../src/com/sleepycat/util/FastOutputStream.java | 71 +- .../src/com/sleepycat/util/IOExceptionWrapper.java | 14 +- db/java/src/com/sleepycat/util/PackedInteger.java | 183 + .../sleepycat/util/RuntimeExceptionWrapper.java | 14 +- db/java/src/com/sleepycat/util/UtfOps.java | 6 +- .../src/com/sleepycat/util/keyrange/KeyRange.java | 342 + .../sleepycat/util/keyrange/KeyRangeException.java | 26 + .../com/sleepycat/util/keyrange/RangeCursor.java | 1060 + db/java/src/com/sleepycat/util/package.html | 2 +- db/libdb_java/README | 6 +- db/libdb_java/db.i | 534 +- db/libdb_java/db_java.i | 110 +- db/libdb_java/db_java_wrap.c | 12425 ++++---- db/libdb_java/java_callbacks.i | 287 +- db/libdb_java/java_except.i | 45 +- db/libdb_java/java_stat.i | 30 +- db/libdb_java/java_stat_auto.c | 82 +- db/libdb_java/java_typemaps.i | 350 +- db/libdb_java/java_util.i | 225 +- db/lock/Design | 2 +- db/lock/lock.c | 413 +- db/lock/lock_deadlock.c | 232 +- db/lock/lock_failchk.c | 95 + db/lock/lock_id.c | 135 +- db/lock/lock_list.c | 37 +- db/lock/lock_method.c | 191 +- db/lock/lock_region.c | 172 +- db/lock/lock_stat.c | 170 +- db/lock/lock_timer.c | 26 +- db/lock/lock_util.c | 63 +- db/log/log.c | 519 +- db/log/log_archive.c | 192 +- db/log/log_compare.c | 54 +- db/log/log_debug.c | 153 + db/log/log_get.c | 415 +- db/log/log_method.c | 188 +- db/log/log_put.c | 494 +- db/log/log_stat.c | 84 +- db/mod_db4/ABOUT | 3 +- db/mod_db4/BSD | 10 + db/mod_db4/Makefile.in | 7 +- db/mod_db4/configure | 500 +- db/mod_db4/configure.in | 18 +- db/mod_db4/mm_hash.c | 13 +- db/mod_db4/mm_hash.h | 12 +- db/mod_db4/mod_db4.c | 8 +- db/mod_db4/mod_db4_export.h | 8 +- db/mod_db4/sem_utils.c | 8 +- db/mod_db4/sem_utils.h | 8 +- db/mod_db4/skiplist.c | 8 +- db/mod_db4/skiplist.h | 8 +- db/mod_db4/utils.c | 8 +- db/mod_db4/utils.h | 8 +- db/mp/mp_alloc.c | 279 +- db/mp/mp_bh.c | 329 +- db/mp/mp_fget.c | 575 +- db/mp/mp_fmethod.c | 144 +- db/mp/mp_fopen.c | 779 +- db/mp/mp_fput.c | 173 +- db/mp/mp_fset.c | 151 +- db/mp/mp_method.c | 560 +- db/mp/mp_mvcc.c | 682 + db/mp/mp_region.c | 302 +- db/mp/mp_register.c | 75 +- db/mp/mp_stat.c | 544 +- db/mp/mp_sync.c | 470 +- db/mp/mp_trickle.c | 59 +- db/mutex/README | 58 +- db/mutex/mut_alloc.c | 230 + db/mutex/mut_failchk.c | 69 + db/mutex/mut_fcntl.c | 163 +- db/mutex/mut_method.c | 286 + db/mutex/mut_pthread.c | 321 +- db/mutex/mut_region.c | 356 + db/mutex/mut_stat.c | 450 + db/mutex/mut_tas.c | 228 +- db/mutex/mut_win32.c | 240 +- db/mutex/tm.c | 938 +- db/mutex/uts4_cc.s | 6 +- db/os/os_abs.c | 10 +- db/os/os_alloc.c | 56 +- db/os/os_clock.c | 27 +- db/os/os_config.c | 56 +- db/os/os_dir.c | 41 +- db/os/os_errno.c | 89 +- db/os/os_fid.c | 72 +- db/os/os_flock.c | 55 + db/os/os_fsync.c | 30 +- db/os/os_fzero.c | 104 + db/os/os_getenv.c | 59 + db/os/os_handle.c | 31 +- db/os/os_map.c | 172 +- db/os/os_method.c | 10 +- db/os/os_mkdir.c | 52 + db/os/os_oflags.c | 90 +- db/os/os_open.c | 170 +- db/os/os_pid.c | 61 + db/os/os_region.c | 47 +- db/os/os_rename.c | 25 +- db/os/os_root.c | 12 +- db/os/os_rpath.c | 36 +- db/os/os_rw.c | 212 +- db/os/os_seek.c | 61 +- db/os/os_sleep.c | 53 +- db/os/os_spin.c | 67 +- db/os/os_stat.c | 30 +- db/os/os_tmpdir.c | 83 +- db/os/os_truncate.c | 20 +- db/os/os_uid.c | 52 + db/os/os_unlink.c | 32 +- db/os/os_yield.c | 48 + db/os_vxworks/os_vx_abs.c | 6 +- db/os_vxworks/os_vx_config.c | 38 +- db/os_vxworks/os_vx_map.c | 43 +- db/os_vxworks/os_vx_rpath.c | 56 + db/os_windows/os_abs.c | 31 + db/os_windows/os_clock.c | 30 + db/os_windows/os_config.c | 118 + db/os_windows/os_dir.c | 104 + db/os_windows/os_errno.c | 405 + db/os_windows/os_fid.c | 147 + db/os_windows/os_flock.c | 69 + db/os_windows/os_fsync.c | 38 + db/os_windows/os_getenv.c | 97 + db/os_windows/os_handle.c | 119 + db/os_windows/os_map.c | 309 + db/os_windows/os_open.c | 186 + db/os_windows/os_rename.c | 70 + db/os_windows/os_rw.c | 186 + db/os_windows/os_seek.c | 55 + db/os_windows/os_sleep.c | 34 + db/os_windows/os_spin.c | 38 + db/os_windows/os_stat.c | 84 + db/os_windows/os_truncate.c | 90 + db/os_windows/os_unlink.c | 109 + db/os_windows/os_yield.c | 27 + db/perl/BerkeleyDB/BerkeleyDB.pm | 36 +- db/perl/BerkeleyDB/BerkeleyDB.pod | 48 +- db/perl/BerkeleyDB/BerkeleyDB.pod.P | 46 + db/perl/BerkeleyDB/BerkeleyDB.xs | 391 +- db/perl/BerkeleyDB/Changes | 39 + db/perl/BerkeleyDB/MANIFEST | 3 + db/perl/BerkeleyDB/META.yml | 2 +- db/perl/BerkeleyDB/Makefile.PL | 13 + db/perl/BerkeleyDB/README | 44 +- db/perl/BerkeleyDB/constants.h | 894 +- db/perl/BerkeleyDB/mkconsts | 45 +- db/perl/BerkeleyDB/t/Test/Builder.pm | 1591 + db/perl/BerkeleyDB/t/Test/More.pm | 1448 + db/perl/BerkeleyDB/t/btree.t | 17 +- db/perl/BerkeleyDB/t/cds.t | 10 +- db/perl/BerkeleyDB/t/db-3.0.t | 10 +- db/perl/BerkeleyDB/t/db-3.1.t | 165 +- db/perl/BerkeleyDB/t/db-3.2.t | 10 +- db/perl/BerkeleyDB/t/db-3.3.t | 298 +- db/perl/BerkeleyDB/t/db-4.4.t | 57 + db/perl/BerkeleyDB/t/destroy.t | 10 +- db/perl/BerkeleyDB/t/encrypt.t | 10 +- db/perl/BerkeleyDB/t/env.t | 39 +- db/perl/BerkeleyDB/t/examples.t | 22 +- db/perl/BerkeleyDB/t/examples.t.T | 22 +- db/perl/BerkeleyDB/t/examples3.t | 29 +- db/perl/BerkeleyDB/t/examples3.t.T | 29 +- db/perl/BerkeleyDB/t/filter.t | 10 +- db/perl/BerkeleyDB/t/hash.t | 15 +- db/perl/BerkeleyDB/t/join.t | 10 +- db/perl/BerkeleyDB/t/mldbm.t | 12 +- db/perl/BerkeleyDB/t/queue.t | 555 +- db/perl/BerkeleyDB/t/recno.t | 10 +- db/perl/BerkeleyDB/t/strict.t | 10 +- db/perl/BerkeleyDB/t/subdb.t | 153 +- db/perl/BerkeleyDB/t/txn.t | 10 +- db/perl/BerkeleyDB/t/unknown.t | 12 +- db/perl/BerkeleyDB/t/util.pm | 54 +- db/perl/BerkeleyDB/typemap | 57 +- db/perl/DB_File/Changes | 24 + db/perl/DB_File/DB_File.pm | 18 +- db/perl/DB_File/DB_File.xs | 47 +- db/perl/DB_File/META.yml | 4 +- db/perl/DB_File/Makefile.PL | 13 + db/perl/DB_File/README | 31 +- db/perl/DB_File/t/db-btree.t | 8 +- db/perl/DB_File/t/db-hash.t | 7 +- db/perl/DB_File/t/db-recno.t | 4 +- db/perl/DB_File/typemap | 26 +- db/php_db4/INSTALL | 14 +- db/php_db4/config.m4 | 9 +- db/php_db4/db4.cpp | 181 +- db/php_db4/php_db4.h | 10 +- db/php_db4/samples/simple_counter.php | 4 +- db/php_db4/samples/transactional_counter.php | 4 +- db/qam/qam.c | 529 +- db/qam/qam.src | 23 +- db/qam/qam_auto.c | 277 +- db/qam/qam_autop.c | 67 +- db/qam/qam_conv.c | 10 +- db/qam/qam_files.c | 171 +- db/qam/qam_method.c | 21 +- db/qam/qam_open.c | 55 +- db/qam/qam_rec.c | 279 +- db/qam/qam_stat.c | 28 +- db/qam/qam_stub.c | 14 +- db/qam/qam_upgrade.c | 12 +- db/qam/qam_verify.c | 21 +- db/rep/rep.src | 23 +- db/rep/rep_auto.c | 35 +- db/rep/rep_autop.c | 6 - db/rep/rep_backup.c | 1427 +- db/rep/rep_elect.c | 995 + db/rep/rep_log.c | 703 + db/rep/rep_method.c | 1444 +- db/rep/rep_record.c | 1833 +- db/rep/rep_region.c | 253 +- db/rep/rep_stat.c | 124 +- db/rep/rep_stub.c | 224 +- db/rep/rep_util.c | 1231 +- db/rep/rep_verify.c | 536 + db/repmgr/repmgr_elect.c | 369 + db/repmgr/repmgr_method.c | 442 + db/repmgr/repmgr_msg.c | 333 + db/repmgr/repmgr_net.c | 1041 + db/repmgr/repmgr_posix.c | 714 + db/repmgr/repmgr_queue.c | 158 + db/repmgr/repmgr_sel.c | 875 + db/repmgr/repmgr_stat.c | 116 + db/repmgr/repmgr_util.c | 415 + db/repmgr/repmgr_windows.c | 708 + db/rpc_client/client.c | 75 +- db/rpc_client/gen_client.c | 4463 ++- db/rpc_client/gen_client_ret.c | 112 +- db/rpc_server/c/db_server_proc.c | 762 +- db/rpc_server/c/db_server_util.c | 47 +- db/rpc_server/c/gen_db_server.c | 883 +- db/rpc_server/clsrv.html | 435 +- db/rpc_server/cxx/db_server_cxxproc.cpp | 557 +- db/rpc_server/cxx/db_server_cxxutil.cpp | 41 +- db/rpc_server/db_server.x | 666 +- db/rpc_server/rpc.src | 1039 +- db/sequence/seq_stat.c | 85 +- db/sequence/sequence.c | 508 +- db/tcl/docs/db.html | 2 +- db/tcl/docs/env.html | 9 +- db/tcl/docs/historic.html | 2 +- db/tcl/docs/index.html | 2 +- db/tcl/docs/library.html | 2 +- db/tcl/docs/lock.html | 2 +- db/tcl/docs/log.html | 2 +- db/tcl/docs/mpool.html | 2 +- db/tcl/docs/rep.html | 2 +- db/tcl/docs/test.html | 48 +- db/tcl/docs/txn.html | 2 +- db/tcl/tcl_compat.c | 18 +- db/tcl/tcl_db.c | 506 +- db/tcl/tcl_db_pkg.c | 389 +- db/tcl/tcl_dbcursor.c | 158 +- db/tcl/tcl_env.c | 332 +- db/tcl/tcl_internal.c | 157 +- db/tcl/tcl_lock.c | 21 +- db/tcl/tcl_log.c | 41 +- db/tcl/tcl_mp.c | 84 +- db/tcl/tcl_rep.c | 571 +- db/tcl/tcl_seq.c | 26 +- db/tcl/tcl_txn.c | 175 +- db/tcl/tcl_util.c | 266 +- db/test/README | 6 +- db/test/TESTS | 718 +- db/test/archive.tcl | 6 +- db/test/bigfile001.tcl | 39 +- db/test/bigfile002.tcl | 13 +- db/test/byteorder.tcl | 6 +- db/test/conscript.tcl | 6 +- db/test/dbm.tcl | 6 +- db/test/dbscript.tcl | 6 +- db/test/ddoyscript.tcl | 6 +- db/test/ddscript.tcl | 6 +- db/test/dead001.tcl | 17 +- db/test/dead002.tcl | 13 +- db/test/dead003.tcl | 6 +- db/test/dead004.tcl | 6 +- db/test/dead005.tcl | 10 +- db/test/dead006.tcl | 6 +- db/test/dead007.tcl | 6 +- db/test/env001.tcl | 44 +- db/test/env002.tcl | 6 +- db/test/env003.tcl | 6 +- db/test/env004.tcl | 6 +- db/test/env005.tcl | 6 +- db/test/env006.tcl | 6 +- db/test/env007.tcl | 156 +- db/test/env008.tcl | 6 +- db/test/env009.tcl | 8 +- db/test/env010.tcl | 6 +- db/test/env011.tcl | 10 +- db/test/env012.tcl | 253 + db/test/env013.tcl | 85 + db/test/env014.tcl | 118 + db/test/env015.tcl | 80 + db/test/envscript.tcl | 90 + db/test/fop001.tcl | 118 +- db/test/fop002.tcl | 6 +- db/test/fop003.tcl | 6 +- db/test/fop004.tcl | 6 +- db/test/fop005.tcl | 6 +- db/test/fop006.tcl | 69 +- db/test/fop007.tcl | 22 + db/test/fop008.tcl | 16 + db/test/fopscript.tcl | 27 +- db/test/foputils.tcl | 84 +- db/test/hsearch.tcl | 6 +- db/test/include.tcl | 10 +- db/test/join.tcl | 6 +- db/test/lock001.tcl | 10 +- db/test/lock002.tcl | 28 +- db/test/lock003.tcl | 6 +- db/test/lock004.tcl | 6 +- db/test/lock005.tcl | 6 +- db/test/lock006.tcl | 6 +- db/test/lockscript.tcl | 6 +- db/test/log001.tcl | 6 +- db/test/log002.tcl | 6 +- db/test/log003.tcl | 6 +- db/test/log004.tcl | 6 +- db/test/log005.tcl | 6 +- db/test/log006.tcl | 6 +- db/test/log007.tcl | 111 + db/test/log008.tcl | 46 + db/test/log008script.tcl | 83 + db/test/log009.tcl | 123 + db/test/logtrack.list | 102 +- db/test/logtrack.tcl | 10 +- db/test/mdbscript.tcl | 6 +- db/test/memp001.tcl | 16 +- db/test/memp002.tcl | 6 +- db/test/memp003.tcl | 6 +- db/test/memp004.tcl | 6 +- db/test/mpoolscript.tcl | 14 +- db/test/ndbm.tcl | 6 +- db/test/parallel.tcl | 17 +- db/test/plat001.tcl | 76 + db/test/recd001.tcl | 14 +- db/test/recd002.tcl | 9 +- db/test/recd003.tcl | 6 +- db/test/recd004.tcl | 6 +- db/test/recd005.tcl | 11 +- db/test/recd006.tcl | 6 +- db/test/recd007.tcl | 141 +- db/test/recd008.tcl | 13 +- db/test/recd009.tcl | 6 +- db/test/recd010.tcl | 6 +- db/test/recd011.tcl | 6 +- db/test/recd012.tcl | 6 +- db/test/recd013.tcl | 7 +- db/test/recd014.tcl | 6 +- db/test/recd015.tcl | 6 +- db/test/recd016.tcl | 8 +- db/test/recd017.tcl | 6 +- db/test/recd018.tcl | 6 +- db/test/recd019.tcl | 6 +- db/test/recd020.tcl | 8 +- db/test/recd021.tcl | 19 +- db/test/recd022.tcl | 132 + db/test/recd023.tcl | 84 + db/test/recd15scr.tcl | 6 +- db/test/recdscript.tcl | 6 +- db/test/rep001.tcl | 85 +- db/test/rep002.tcl | 69 +- db/test/rep003.tcl | 23 +- db/test/rep005.tcl | 25 +- db/test/rep006.tcl | 63 +- db/test/rep007.tcl | 57 +- db/test/rep008.tcl | 37 +- db/test/rep009.tcl | 44 +- db/test/rep010.tcl | 31 +- db/test/rep011.tcl | 30 +- db/test/rep012.tcl | 47 +- db/test/rep013.tcl | 100 +- db/test/rep014.tcl | 42 +- db/test/rep015.tcl | 40 +- db/test/rep016.tcl | 36 +- db/test/rep017.tcl | 32 +- db/test/rep017script.tcl | 21 +- db/test/rep018.tcl | 27 +- db/test/rep018script.tcl | 15 +- db/test/rep019.tcl | 34 +- db/test/rep020.tcl | 35 +- db/test/rep021.tcl | 53 +- db/test/rep022.tcl | 31 +- db/test/rep023.tcl | 43 +- db/test/rep024.tcl | 32 +- db/test/rep025.tcl | 207 + db/test/rep026.tcl | 53 +- db/test/rep027.tcl | 38 +- db/test/rep028.tcl | 72 +- db/test/rep029.tcl | 266 +- db/test/rep030.tcl | 265 +- db/test/rep031.tcl | 235 +- db/test/rep032.tcl | 108 +- db/test/rep033.tcl | 47 +- db/test/rep034.tcl | 110 +- db/test/rep035.tcl | 38 +- db/test/rep035script.tcl | 7 +- db/test/rep036.tcl | 45 +- db/test/rep036script.tcl | 29 +- db/test/rep037.tcl | 142 +- db/test/rep038.tcl | 210 + db/test/rep039.tcl | 263 + db/test/rep040.tcl | 205 + db/test/rep040script.tcl | 69 + db/test/rep041.tcl | 210 + db/test/rep042.tcl | 194 + db/test/rep042script.tcl | 77 + db/test/rep043.tcl | 233 + db/test/rep043script.tcl | 114 + db/test/rep044.tcl | 256 + db/test/rep045.tcl | 256 + db/test/rep045script.tcl | 138 + db/test/rep046.tcl | 228 + db/test/rep047.tcl | 204 + db/test/rep048.tcl | 123 + db/test/rep048script.tcl | 75 + db/test/rep049.tcl | 221 + db/test/rep050.tcl | 346 + db/test/rep051.tcl | 189 + db/test/rep052.tcl | 223 + db/test/rep053.tcl | 194 + db/test/rep054.tcl | 257 + db/test/rep055.tcl | 209 + db/test/rep056.tcl | 23 + db/test/rep057.tcl | 24 + db/test/rep058.tcl | 133 + db/test/rep059.tcl | 123 + db/test/rep060.tcl | 303 + db/test/rep061.tcl | 375 + db/test/rep062.tcl | 284 + db/test/rep063.tcl | 362 + db/test/rep064.tcl | 137 + db/test/rep065.tcl | 420 + db/test/rep065script.tcl | 391 + db/test/rep066.tcl | 229 + db/test/reputils.tcl | 1106 +- db/test/rpc001.tcl | 12 +- db/test/rpc002.tcl | 20 +- db/test/rpc003.tcl | 6 +- db/test/rpc004.tcl | 6 +- db/test/rpc005.tcl | 6 +- db/test/rpc006.tcl | 4 +- db/test/rsrc001.tcl | 6 +- db/test/rsrc002.tcl | 6 +- db/test/rsrc003.tcl | 9 +- db/test/rsrc004.tcl | 6 +- db/test/scr001/chk.code | 4 +- db/test/scr002/chk.def | 12 +- db/test/scr003/chk.define | 17 +- db/test/scr004/chk.javafiles | 4 +- db/test/scr005/chk.nl | 2 +- db/test/scr006/chk.offt | 18 +- db/test/scr007/chk.proto | 2 +- db/test/scr009/chk.srcfiles | 5 +- db/test/scr010/chk.str | 2 +- db/test/scr010/spell.ok | 637 + db/test/scr011/chk.tags | 7 +- db/test/scr012/chk.vx_code | 17 +- db/test/scr013/chk.stats | 5 +- db/test/scr014/chk.err | 2 +- db/test/scr015/README | 2 +- db/test/scr015/TestConstruct01.cpp | 9 +- db/test/scr015/TestGetSetMethods.cpp | 12 +- db/test/scr015/TestKeyRange.cpp | 9 +- db/test/scr015/TestLogc.cpp | 6 +- db/test/scr015/TestSimpleAccess.cpp | 6 +- db/test/scr015/TestTruncate.cpp | 6 +- db/test/scr015/chk.cxxtests | 2 +- db/test/scr015/ignore | 2 +- db/test/scr015/testall | 2 +- db/test/scr015/testone | 2 +- db/test/scr017/chk.db185 | 2 +- db/test/scr018/chk.comma | 2 +- db/test/scr018/t.c | 3 +- db/test/scr019/chk.include | 7 +- db/test/scr020/chk.inc | 2 +- db/test/scr021/chk.flags | 10 +- db/test/scr021/t.c | 3 +- db/test/scr022/chk.rr | 5 +- db/test/scr023/chk.q | 2 +- db/test/scr024/chk.bdb | 9 +- db/test/scr024/coverage/build.xml | 17 +- .../bind/serial/test/MarshalledObject.java | 7 +- .../bind/serial/test/NullClassCatalog.java | 6 +- .../bind/serial/test/SerialBindingTest.java | 135 +- .../bind/serial/test/TestClassCatalog.java | 6 +- .../com/sleepycat/bind/test/BindingSpeedTest.java | 140 +- .../bind/tuple/test/MarshalledObject.java | 6 +- .../bind/tuple/test/TupleBindingTest.java | 188 +- .../sleepycat/bind/tuple/test/TupleFormatTest.java | 126 +- .../bind/tuple/test/TupleOrderingTest.java | 118 +- .../com/sleepycat/collections/KeyRangeTest.java | 8 +- .../sleepycat/collections/test/CollectionTest.java | 280 +- .../com/sleepycat/collections/test/DbTestUtil.java | 8 +- .../collections/test/IterDeadlockTest.java | 10 +- .../com/sleepycat/collections/test/JoinTest.java | 7 +- .../collections/test/NullTransactionRunner.java | 6 +- .../collections/test/SecondaryDeadlockTest.java | 36 +- .../collections/test/TestDataBinding.java | 6 +- .../com/sleepycat/collections/test/TestEntity.java | 6 +- .../collections/test/TestEntityBinding.java | 6 +- .../com/sleepycat/collections/test/TestEnv.java | 17 +- .../collections/test/TestKeyAssigner.java | 6 +- .../sleepycat/collections/test/TestKeyCreator.java | 6 +- .../com/sleepycat/collections/test/TestStore.java | 8 +- .../collections/test/TransactionTest.java | 225 +- .../test/serial/CatalogCornerCaseTest.java | 99 + .../test/serial/StoredClassCatalogTest.java | 6 +- .../test/serial/StoredClassCatalogTestInit.java | 13 +- .../collections/test/serial/TestSerial.java | 6 +- .../test/serial/TestSerial.java.original | 6 +- .../sleepycat/util/test/ExceptionWrapperTest.java | 43 +- .../sleepycat/util/test/FastOutputStreamTest.java | 73 + .../com/sleepycat/util/test/PackedIntegerTest.java | 106 + .../src/com/sleepycat/util/test/UtfTest.java | 6 +- db/test/scr025/TestMulti.cpp | 3 +- db/test/scr025/chk.cxxmulti | 2 +- db/test/scr025/ignore | 2 +- db/test/scr026/chk.method | 12 +- db/test/scr027/chk.javas | 2 +- db/test/scr028/chk.rtc | 2 +- db/test/scr029/chk.get | 2 +- db/test/scr030/chk.build | 100 +- db/test/scr031/chk.xa | 294 + db/test/scr031/src/client.c | 339 + db/test/scr031/src/datafml.fml | 5 + db/test/scr031/src/datafml.h | 5 + db/test/scr031/src/hcommonxa.h | 8 + db/test/scr031/src/hdbrec.h | 14 + db/test/scr031/src/htimestampxa.c | 14 + db/test/scr031/src/htimestampxa.h | 13 + db/test/scr031/src/server.c | 287 + db/test/scr032/chk.rpc | 82 + db/test/sdb001.tcl | 6 +- db/test/sdb002.tcl | 6 +- db/test/sdb003.tcl | 6 +- db/test/sdb004.tcl | 6 +- db/test/sdb005.tcl | 6 +- db/test/sdb006.tcl | 6 +- db/test/sdb007.tcl | 112 +- db/test/sdb008.tcl | 6 +- db/test/sdb009.tcl | 6 +- db/test/sdb010.tcl | 8 +- db/test/sdb011.tcl | 6 +- db/test/sdb012.tcl | 23 +- db/test/sdb013.tcl | 174 + db/test/sdb014.tcl | 113 + db/test/sdb015.tcl | 118 + db/test/sdb016.tcl | 99 + db/test/sdb017.tcl | 100 + db/test/sdb018.tcl | 157 + db/test/sdb019.tcl | 140 + db/test/sdb020.tcl | 125 + db/test/sdbscript.tcl | 6 +- db/test/sdbtest001.tcl | 6 +- db/test/sdbtest002.tcl | 11 +- db/test/sdbutils.tcl | 16 +- db/test/sec001.tcl | 6 +- db/test/sec002.tcl | 6 +- db/test/shelltest.tcl | 9 +- db/test/si001.tcl | 355 +- db/test/si002.tcl | 57 +- db/test/si003.tcl | 60 +- db/test/si004.tcl | 57 +- db/test/si005.tcl | 66 +- db/test/si006.tcl | 187 + db/test/si007.tcl | 189 + db/test/si008.tcl | 274 + db/test/sijointest.tcl | 8 +- db/test/siutils.tcl | 6 +- db/test/sysscript.tcl | 24 +- db/test/t106script.tcl | 6 +- db/test/test.tcl | 222 +- db/test/test001.tcl | 6 +- db/test/test002.tcl | 6 +- db/test/test003.tcl | 6 +- db/test/test004.tcl | 6 +- db/test/test005.tcl | 6 +- db/test/test006.tcl | 6 +- db/test/test007.tcl | 6 +- db/test/test008.tcl | 6 +- db/test/test009.tcl | 6 +- db/test/test010.tcl | 6 +- db/test/test011.tcl | 6 +- db/test/test012.tcl | 6 +- db/test/test013.tcl | 8 +- db/test/test014.tcl | 6 +- db/test/test015.tcl | 11 +- db/test/test016.tcl | 6 +- db/test/test017.tcl | 6 +- db/test/test018.tcl | 6 +- db/test/test019.tcl | 6 +- db/test/test020.tcl | 6 +- db/test/test021.tcl | 6 +- db/test/test022.tcl | 6 +- db/test/test023.tcl | 6 +- db/test/test024.tcl | 6 +- db/test/test025.tcl | 6 +- db/test/test026.tcl | 6 +- db/test/test027.tcl | 6 +- db/test/test028.tcl | 6 +- db/test/test029.tcl | 6 +- db/test/test030.tcl | 6 +- db/test/test031.tcl | 6 +- db/test/test032.tcl | 6 +- db/test/test033.tcl | 6 +- db/test/test034.tcl | 6 +- db/test/test035.tcl | 6 +- db/test/test036.tcl | 6 +- db/test/test037.tcl | 6 +- db/test/test038.tcl | 6 +- db/test/test039.tcl | 6 +- db/test/test040.tcl | 6 +- db/test/test041.tcl | 6 +- db/test/test042.tcl | 6 +- db/test/test043.tcl | 6 +- db/test/test044.tcl | 6 +- db/test/test045.tcl | 6 +- db/test/test046.tcl | 6 +- db/test/test047.tcl | 6 +- db/test/test048.tcl | 6 +- db/test/test049.tcl | 6 +- db/test/test050.tcl | 6 +- db/test/test051.tcl | 12 +- db/test/test052.tcl | 6 +- db/test/test053.tcl | 6 +- db/test/test054.tcl | 6 +- db/test/test055.tcl | 6 +- db/test/test056.tcl | 6 +- db/test/test057.tcl | 6 +- db/test/test058.tcl | 6 +- db/test/test059.tcl | 6 +- db/test/test060.tcl | 6 +- db/test/test061.tcl | 6 +- db/test/test062.tcl | 6 +- db/test/test063.tcl | 6 +- db/test/test064.tcl | 6 +- db/test/test065.tcl | 6 +- db/test/test066.tcl | 6 +- db/test/test067.tcl | 6 +- db/test/test068.tcl | 23 +- db/test/test069.tcl | 6 +- db/test/test070.tcl | 6 +- db/test/test071.tcl | 6 +- db/test/test072.tcl | 6 +- db/test/test073.tcl | 6 +- db/test/test074.tcl | 6 +- db/test/test076.tcl | 12 +- db/test/test077.tcl | 6 +- db/test/test078.tcl | 6 +- db/test/test079.tcl | 6 +- db/test/test081.tcl | 6 +- db/test/test082.tcl | 6 +- db/test/test083.tcl | 6 +- db/test/test084.tcl | 6 +- db/test/test085.tcl | 6 +- db/test/test086.tcl | 6 +- db/test/test087.tcl | 6 +- db/test/test088.tcl | 6 +- db/test/test089.tcl | 8 +- db/test/test090.tcl | 6 +- db/test/test091.tcl | 6 +- db/test/test092.tcl | 45 +- db/test/test093.tcl | 6 +- db/test/test094.tcl | 6 +- db/test/test095.tcl | 6 +- db/test/test096.tcl | 19 +- db/test/test097.tcl | 6 +- db/test/test098.tcl | 6 +- db/test/test099.tcl | 6 +- db/test/test100.tcl | 6 +- db/test/test101.tcl | 6 +- db/test/test102.tcl | 6 +- db/test/test103.tcl | 6 +- db/test/test106.tcl | 12 +- db/test/test107.tcl | 44 +- db/test/test109.tcl | 104 +- db/test/test110.tcl | 164 + db/test/test111.tcl | 326 + db/test/test112.tcl | 241 + db/test/test113.tcl | 223 + db/test/test114.tcl | 294 + db/test/test115.tcl | 340 + db/test/test116.tcl | 257 + db/test/test117.tcl | 200 + db/test/test119.tcl | 254 + db/test/test120.tcl | 97 + db/test/test121.tcl | 124 + db/test/test122.tcl | 100 + db/test/testparams.tcl | 147 +- db/test/testutils.tcl | 316 +- db/test/testutils42.tcl | 17 + db/test/txn001.tcl | 7 +- db/test/txn002.tcl | 7 +- db/test/txn003.tcl | 16 +- db/test/txn004.tcl | 7 +- db/test/txn005.tcl | 7 +- db/test/txn006.tcl | 7 +- db/test/txn007.tcl | 8 +- db/test/txn008.tcl | 7 +- db/test/txn009.tcl | 7 +- db/test/txn010.tcl | 6 +- db/test/txn011.tcl | 284 +- db/test/txn012.tcl | 62 + db/test/txn012script.tcl | 34 + db/test/txn013.tcl | 77 + db/test/txnscript.tcl | 6 +- db/test/update.tcl | 6 +- db/test/upgrade.tcl | 123 +- db/test/wrap.tcl | 32 +- db/txn/txn.c | 1182 +- db/txn/txn.src | 53 +- db/txn/txn_auto.c | 360 +- db/txn/txn_autop.c | 180 +- db/txn/txn_chkpt.c | 329 + db/txn/txn_failchk.c | 96 + db/txn/txn_method.c | 87 +- db/txn/txn_rec.c | 208 +- db/txn/txn_recover.c | 125 +- db/txn/txn_region.c | 319 +- db/txn/txn_stat.c | 227 +- db/txn/txn_util.c | 35 +- db/xa/xa.c | 169 +- db/xa/xa_db.c | 136 +- db/xa/xa_map.c | 34 +- 3094 files changed, 285665 insertions(+), 82947 deletions(-) create mode 100644 db/btree/bt_compact.c create mode 100644 db/build_vxworks/clib_port.h create mode 100644 db/build_vxworks/db_hotbackup/db_hotbackup.c create mode 100755 db/build_vxworks/db_hotbackup/db_hotbackup20.wpj create mode 100755 db/build_vxworks/db_hotbackup/db_hotbackup22.wpj create mode 100644 db/build_windows/Berkeley_DB.dsw create mode 100644 db/build_windows/app_dsp.src create mode 100644 db/build_windows/build_all.dsp create mode 100644 db/build_windows/clib_port.h create mode 100644 db/build_windows/db.h create mode 100644 db/build_windows/db_archive.dsp create mode 100644 db/build_windows/db_checkpoint.dsp create mode 100644 db/build_windows/db_config.h create mode 100644 db/build_windows/db_cxx.h create mode 100644 db/build_windows/db_deadlock.dsp create mode 100644 db/build_windows/db_dll.dsp create mode 100644 db/build_windows/db_dump.dsp create mode 100644 db/build_windows/db_hotbackup.dsp create mode 100644 db/build_windows/db_int.h create mode 100644 db/build_windows/db_java.dsp create mode 100644 db/build_windows/db_java.dsp.postbuild create mode 100644 db/build_windows/db_java_xa.dsp create mode 100644 db/build_windows/db_java_xaj.mak create mode 100644 db/build_windows/db_load.dsp create mode 100644 db/build_windows/db_perf.dsp create mode 100644 db/build_windows/db_printlog.dsp create mode 100644 db/build_windows/db_recover.dsp create mode 100644 db/build_windows/db_reptest.dsp create mode 100644 db/build_windows/db_small.dsp create mode 100644 db/build_windows/db_stat.dsp create mode 100644 db/build_windows/db_static.dsp create mode 100644 db/build_windows/db_tcl.dsp create mode 100644 db/build_windows/db_test.dsp create mode 100644 db/build_windows/db_test.dsp.postbuild create mode 100644 db/build_windows/db_upgrade.dsp create mode 100644 db/build_windows/db_verify.dsp create mode 100644 db/build_windows/dbkill.cpp create mode 100644 db/build_windows/dynamic_dsp.src create mode 100644 db/build_windows/ex_access.dsp create mode 100644 db/build_windows/ex_btrec.dsp create mode 100644 db/build_windows/ex_csvcode.dsp create mode 100644 db/build_windows/ex_csvcode.dsp.postbuild create mode 100644 db/build_windows/ex_csvload.dsp create mode 100644 db/build_windows/ex_csvquery.dsp create mode 100644 db/build_windows/ex_env.dsp create mode 100644 db/build_windows/ex_lock.dsp create mode 100644 db/build_windows/ex_mpool.dsp create mode 100644 db/build_windows/ex_rep_base.dsp create mode 100644 db/build_windows/ex_rep_mgr.dsp create mode 100644 db/build_windows/ex_sequence.dsp create mode 100644 db/build_windows/ex_tpcb.dsp create mode 100644 db/build_windows/ex_txnguide.dsp create mode 100644 db/build_windows/ex_txnguide_inmem.dsp create mode 100644 db/build_windows/example_database_load.dsp create mode 100644 db/build_windows/example_database_read.dsp create mode 100644 db/build_windows/excxx_access.dsp create mode 100644 db/build_windows/excxx_btrec.dsp create mode 100644 db/build_windows/excxx_env.dsp create mode 100644 db/build_windows/excxx_example_database_load.dsp create mode 100644 db/build_windows/excxx_example_database_read.dsp create mode 100644 db/build_windows/excxx_lock.dsp create mode 100644 db/build_windows/excxx_mpool.dsp create mode 100644 db/build_windows/excxx_repquote.dsp create mode 100644 db/build_windows/excxx_sequence.dsp create mode 100644 db/build_windows/excxx_tpcb.dsp create mode 100644 db/build_windows/excxx_txnguide.dsp create mode 100644 db/build_windows/excxx_txnguide_inmem.dsp create mode 100644 db/build_windows/include.tcl create mode 100644 db/build_windows/libdb.def create mode 100644 db/build_windows/libdb.rc create mode 100644 db/build_windows/libdb_tcl.def create mode 100644 db/build_windows/libdbrc.src create mode 100644 db/build_windows/srcfile_dsp.src create mode 100644 db/build_windows/static_dsp.src create mode 100644 db/build_windows/tm.dsp create mode 100644 db/build_windows/win_db.h create mode 100644 db/clib/abort.c create mode 100644 db/clib/atoi.c create mode 100644 db/clib/atol.c create mode 100644 db/clib/ctime.c create mode 100644 db/clib/getaddrinfo.c create mode 100644 db/clib/isalpha.c create mode 100644 db/clib/isdigit.c create mode 100644 db/clib/isprint.c create mode 100644 db/clib/isspace.c create mode 100644 db/clib/printf.c create mode 100644 db/clib/rand.c create mode 100644 db/clib/strcat.c create mode 100644 db/clib/strchr.c create mode 100644 db/clib/strncat.c create mode 100644 db/clib/strncmp.c create mode 100644 db/clib/strrchr.c create mode 100644 db/clib/strsep.c create mode 100644 db/common/db_clock.c create mode 100644 db/common/mkpath.c create mode 100644 db/db/db_cds.c create mode 100644 db/db_hotbackup/db_hotbackup.c create mode 100644 db/dbinc/mutex_int.h create mode 100644 db/dbinc/repmgr.h create mode 100644 db/dbinc_auto/repmgr_ext.h create mode 100644 db/dist/clib_port.h create mode 100644 db/dist/errno.h mode change 100644 => 100755 db/dist/s_all mode change 100644 => 100755 db/dist/s_crypto mode change 100644 => 100755 db/dist/s_rpc mode change 100644 => 100755 db/dist/s_vxworks create mode 100755 db/dist/s_windows create mode 100755 db/dist/s_windows_dsp create mode 100644 db/dist/s_winmsi create mode 100644 db/dist/winmsi/dbcorewix.in create mode 100644 db/dist/winmsi/dbvarsbat.in create mode 100644 db/dist/winmsi/dbwix.m4 create mode 100644 db/dist/winmsi/environment.in create mode 100644 db/dist/winmsi/features.in create mode 100644 db/dist/winmsi/files.in create mode 100644 db/dist/winmsi/images/caticon.ibd create mode 100644 db/dist/winmsi/images/foldernew.ibd create mode 100644 db/dist/winmsi/images/folderup.ibd create mode 100644 db/dist/winmsi/images/oracle.jpg create mode 100644 db/dist/winmsi/images/topstripe.ibd create mode 100644 db/dist/winmsi/images/webicon.ico create mode 100644 db/dist/winmsi/links.in create mode 100644 db/dist/winmsi/s_winmsi.fcn create mode 100644 db/dist/winmsi/winbuild.bat create mode 100644 db/docs/api_c/db_compact.html create mode 100644 db/docs/api_c/env_cdsgroup_begin.html create mode 100644 db/docs/api_c/env_event_notify.html create mode 100644 db/docs/api_c/env_failchk.html create mode 100644 db/docs/api_c/env_fileid_reset.html create mode 100644 db/docs/api_c/env_lsn_reset.html create mode 100644 db/docs/api_c/env_set_isalive.html create mode 100644 db/docs/api_c/env_set_lg_mode.html create mode 100644 db/docs/api_c/env_set_thread_count.html create mode 100644 db/docs/api_c/env_set_thread_id.html create mode 100644 db/docs/api_c/env_set_thread_id_string.html create mode 100644 db/docs/api_c/log_printf.html create mode 100644 db/docs/api_c/mutex_alloc.html create mode 100644 db/docs/api_c/mutex_free.html create mode 100644 db/docs/api_c/mutex_list.html create mode 100644 db/docs/api_c/mutex_lock.html create mode 100644 db/docs/api_c/mutex_set_align.html create mode 100644 db/docs/api_c/mutex_set_max.html create mode 100644 db/docs/api_c/mutex_set_tas_spins.html create mode 100644 db/docs/api_c/mutex_stat.html create mode 100644 db/docs/api_c/mutex_unlock.html create mode 100644 db/docs/api_c/rep_config.html create mode 100644 db/docs/api_c/rep_nsites.html create mode 100644 db/docs/api_c/rep_priority.html create mode 100644 db/docs/api_c/rep_sync.html create mode 100644 db/docs/api_c/rep_timeout.html create mode 100644 db/docs/api_c/repmgr_ack_policy.html create mode 100644 db/docs/api_c/repmgr_local_site.html create mode 100644 db/docs/api_c/repmgr_remote_site.html create mode 100644 db/docs/api_c/repmgr_site_list.html create mode 100644 db/docs/api_c/repmgr_start.html create mode 100644 db/docs/api_c/seq_initial_value.html create mode 100644 db/docs/api_c/txn_set_name.html create mode 100644 db/docs/api_cxx/db_compact.html create mode 100644 db/docs/api_cxx/env_cdsgroup_begin.html create mode 100644 db/docs/api_cxx/env_event_notify.html create mode 100644 db/docs/api_cxx/env_failchk.html create mode 100644 db/docs/api_cxx/env_fileid_reset.html create mode 100644 db/docs/api_cxx/env_lsn_reset.html create mode 100644 db/docs/api_cxx/env_set_isalive.html create mode 100644 db/docs/api_cxx/env_set_lg_mode.html create mode 100644 db/docs/api_cxx/env_set_thread_count.html create mode 100644 db/docs/api_cxx/env_set_thread_id.html create mode 100644 db/docs/api_cxx/env_set_thread_id_string.html create mode 100644 db/docs/api_cxx/log_printf.html create mode 100644 db/docs/api_cxx/mutex_alloc.html create mode 100644 db/docs/api_cxx/mutex_free.html create mode 100644 db/docs/api_cxx/mutex_list.html create mode 100644 db/docs/api_cxx/mutex_lock.html create mode 100644 db/docs/api_cxx/mutex_set_align.html create mode 100644 db/docs/api_cxx/mutex_set_max.html create mode 100644 db/docs/api_cxx/mutex_set_tas_spins.html create mode 100644 db/docs/api_cxx/mutex_stat.html create mode 100644 db/docs/api_cxx/mutex_unlock.html create mode 100644 db/docs/api_cxx/rep_config.html create mode 100644 db/docs/api_cxx/rep_nsites.html create mode 100644 db/docs/api_cxx/rep_priority.html create mode 100644 db/docs/api_cxx/rep_sync.html create mode 100644 db/docs/api_cxx/rep_timeout.html create mode 100644 db/docs/api_cxx/repmgr_ack_policy.html create mode 100644 db/docs/api_cxx/repmgr_local_site.html create mode 100644 db/docs/api_cxx/repmgr_remote_site.html create mode 100644 db/docs/api_cxx/repmgr_site_list.html create mode 100644 db/docs/api_cxx/repmgr_start.html create mode 100644 db/docs/api_cxx/seq_initial_value.html create mode 100644 db/docs/api_cxx/txn_set_name.html create mode 100644 db/docs/collections/tutorial/moreinfo.html create mode 100644 db/docs/gsg/C/returns.html create mode 100644 db/docs/gsg/CXX/returns.html create mode 100644 db/docs/gsg_db_rep/C/Replication-C-GSG.pdf create mode 100644 db/docs/gsg_db_rep/C/addfeatures.html create mode 100644 db/docs/gsg_db_rep/C/apioverview.html create mode 100644 db/docs/gsg_db_rep/C/bulk.html create mode 100644 db/docs/gsg_db_rep/C/c2ctransfer.html create mode 100644 db/docs/gsg_db_rep/C/elections.html create mode 100644 db/docs/gsg_db_rep/C/electiontimes.html create mode 100644 db/docs/gsg_db_rep/C/exampledoloop.html create mode 100644 db/docs/gsg_db_rep/C/fmwrkconnectretry.html create mode 100644 db/docs/gsg_db_rep/C/fwrkmasterreplica.html create mode 100644 db/docs/gsg_db_rep/C/fwrkpermmessage.html create mode 100644 db/docs/gsg_db_rep/C/gettingStarted.css create mode 100644 db/docs/gsg_db_rep/C/index.html create mode 100644 db/docs/gsg_db_rep/C/introduction.html create mode 100644 db/docs/gsg_db_rep/C/manageblock.html create mode 100644 db/docs/gsg_db_rep/C/noautoinit.html create mode 100644 db/docs/gsg_db_rep/C/permmessages.html create mode 100644 db/docs/gsg_db_rep/C/preface.html create mode 100644 db/docs/gsg_db_rep/C/processingloop.html create mode 100644 db/docs/gsg_db_rep/C/repadvantage.html create mode 100644 db/docs/gsg_db_rep/C/repapp.html create mode 100644 db/docs/gsg_db_rep/C/repmgr_init_example_c.html create mode 100644 db/docs/gsg_db_rep/C/simpleprogramlisting.html create mode 100644 db/docs/gsg_db_rep/C/txnapp.html create mode 100644 db/docs/gsg_db_rep/CXX/Replication-CXX-GSG.pdf create mode 100644 db/docs/gsg_db_rep/CXX/addfeatures.html create mode 100644 db/docs/gsg_db_rep/CXX/apioverview.html create mode 100644 db/docs/gsg_db_rep/CXX/bulk.html create mode 100644 db/docs/gsg_db_rep/CXX/c2ctransfer.html create mode 100644 db/docs/gsg_db_rep/CXX/elections.html create mode 100644 db/docs/gsg_db_rep/CXX/electiontimes.html create mode 100644 db/docs/gsg_db_rep/CXX/exampledoloop.html create mode 100644 db/docs/gsg_db_rep/CXX/fmwrkconnectretry.html create mode 100644 db/docs/gsg_db_rep/CXX/fwrkmasterreplica.html create mode 100644 db/docs/gsg_db_rep/CXX/fwrkpermmessage.html create mode 100644 db/docs/gsg_db_rep/CXX/gettingStarted.css create mode 100644 db/docs/gsg_db_rep/CXX/index.html create mode 100644 db/docs/gsg_db_rep/CXX/introduction.html create mode 100644 db/docs/gsg_db_rep/CXX/manageblock.html create mode 100644 db/docs/gsg_db_rep/CXX/noautoinit.html create mode 100644 db/docs/gsg_db_rep/CXX/permmessages.html create mode 100644 db/docs/gsg_db_rep/CXX/preface.html create mode 100644 db/docs/gsg_db_rep/CXX/processingloop.html create mode 100644 db/docs/gsg_db_rep/CXX/repadvantage.html create mode 100644 db/docs/gsg_db_rep/CXX/repapp.html create mode 100644 db/docs/gsg_db_rep/CXX/repmgr_init_example_c.html create mode 100644 db/docs/gsg_db_rep/CXX/simpleprogramlisting.html create mode 100644 db/docs/gsg_db_rep/CXX/txnapp.html create mode 100644 db/docs/gsg_db_rep/JAVA/Replication-JAVA-GSG.pdf create mode 100644 db/docs/gsg_db_rep/JAVA/addfeatures.html create mode 100644 db/docs/gsg_db_rep/JAVA/apioverview.html create mode 100644 db/docs/gsg_db_rep/JAVA/bulk.html create mode 100644 db/docs/gsg_db_rep/JAVA/c2ctransfer.html create mode 100644 db/docs/gsg_db_rep/JAVA/elections.html create mode 100644 db/docs/gsg_db_rep/JAVA/electiontimes.html create mode 100644 db/docs/gsg_db_rep/JAVA/exampledoloop.html create mode 100644 db/docs/gsg_db_rep/JAVA/fmwrkconnectretry.html create mode 100644 db/docs/gsg_db_rep/JAVA/fwrkmasterreplica.html create mode 100644 db/docs/gsg_db_rep/JAVA/fwrkpermmessage.html create mode 100644 db/docs/gsg_db_rep/JAVA/gettingStarted.css create mode 100644 db/docs/gsg_db_rep/JAVA/index.html create mode 100644 db/docs/gsg_db_rep/JAVA/introduction.html create mode 100644 db/docs/gsg_db_rep/JAVA/manageblock.html create mode 100644 db/docs/gsg_db_rep/JAVA/noautoinit.html create mode 100644 db/docs/gsg_db_rep/JAVA/permmessages.html create mode 100644 db/docs/gsg_db_rep/JAVA/preface.html create mode 100644 db/docs/gsg_db_rep/JAVA/processingloop.html create mode 100644 db/docs/gsg_db_rep/JAVA/repadvantage.html create mode 100644 db/docs/gsg_db_rep/JAVA/repapp.html create mode 100644 db/docs/gsg_db_rep/JAVA/repmgr_init_example_c.html create mode 100644 db/docs/gsg_db_rep/JAVA/simpleprogramlisting.html create mode 100644 db/docs/gsg_db_rep/JAVA/txnapp.html create mode 100644 db/docs/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf create mode 100644 db/docs/gsg_txn/C/abortresults.html create mode 100644 db/docs/gsg_txn/C/architectrecovery.html create mode 100644 db/docs/gsg_txn/C/autocommit.html create mode 100644 db/docs/gsg_txn/C/backuprestore.html create mode 100644 db/docs/gsg_txn/C/blocking_deadlocks.html create mode 100644 db/docs/gsg_txn/C/deadlock.jpg create mode 100644 db/docs/gsg_txn/C/enabletxn.html create mode 100644 db/docs/gsg_txn/C/envopen.html create mode 100644 db/docs/gsg_txn/C/filemanagement.html create mode 100644 db/docs/gsg_txn/C/gettingStarted.css create mode 100644 db/docs/gsg_txn/C/hotfailover.html create mode 100644 db/docs/gsg_txn/C/index.html create mode 100644 db/docs/gsg_txn/C/inmem_txnexample_c.html create mode 100644 db/docs/gsg_txn/C/introduction.html create mode 100644 db/docs/gsg_txn/C/isolation.html create mode 100644 db/docs/gsg_txn/C/lockingsubsystem.html create mode 100644 db/docs/gsg_txn/C/logconfig.html create mode 100644 db/docs/gsg_txn/C/logfileremoval.html create mode 100644 db/docs/gsg_txn/C/maxtxns.html create mode 100644 db/docs/gsg_txn/C/nestedtxn.html create mode 100644 db/docs/gsg_txn/C/perftune-intro.html create mode 100644 db/docs/gsg_txn/C/preface.html create mode 100644 db/docs/gsg_txn/C/readblock.jpg create mode 100644 db/docs/gsg_txn/C/readmodifywrite.html create mode 100644 db/docs/gsg_txn/C/recovery-intro.html create mode 100644 db/docs/gsg_txn/C/recovery.html create mode 100644 db/docs/gsg_txn/C/reversesplit.html create mode 100644 db/docs/gsg_txn/C/rwlocks1.jpg create mode 100644 db/docs/gsg_txn/C/simplelock.jpg create mode 100644 db/docs/gsg_txn/C/txn_ccursor.html create mode 100644 db/docs/gsg_txn/C/txnconcurrency.html create mode 100644 db/docs/gsg_txn/C/txncursor.html create mode 100644 db/docs/gsg_txn/C/txnexample_c.html create mode 100644 db/docs/gsg_txn/C/txnindices.html create mode 100644 db/docs/gsg_txn/C/txnnowait.html create mode 100644 db/docs/gsg_txn/C/usingtxns.html create mode 100644 db/docs/gsg_txn/C/wrapup.html create mode 100644 db/docs/gsg_txn/C/writeblock.jpg create mode 100644 db/docs/gsg_txn/CXX/BerkeleyDB-Core-Cxx-Txn.pdf create mode 100644 db/docs/gsg_txn/CXX/abortresults.html create mode 100644 db/docs/gsg_txn/CXX/architectrecovery.html create mode 100644 db/docs/gsg_txn/CXX/autocommit.html create mode 100644 db/docs/gsg_txn/CXX/backuprestore.html create mode 100644 db/docs/gsg_txn/CXX/blocking_deadlocks.html create mode 100644 db/docs/gsg_txn/CXX/deadlock.jpg create mode 100644 db/docs/gsg_txn/CXX/enabletxn.html create mode 100644 db/docs/gsg_txn/CXX/envopen.html create mode 100644 db/docs/gsg_txn/CXX/filemanagement.html create mode 100644 db/docs/gsg_txn/CXX/gettingStarted.css create mode 100644 db/docs/gsg_txn/CXX/hotfailover.html create mode 100644 db/docs/gsg_txn/CXX/index.html create mode 100644 db/docs/gsg_txn/CXX/inmem_txnexample_c.html create mode 100644 db/docs/gsg_txn/CXX/introduction.html create mode 100644 db/docs/gsg_txn/CXX/isolation.html create mode 100644 db/docs/gsg_txn/CXX/lockingsubsystem.html create mode 100644 db/docs/gsg_txn/CXX/logconfig.html create mode 100644 db/docs/gsg_txn/CXX/logfileremoval.html create mode 100644 db/docs/gsg_txn/CXX/maxtxns.html create mode 100644 db/docs/gsg_txn/CXX/nestedtxn.html create mode 100644 db/docs/gsg_txn/CXX/perftune-intro.html create mode 100644 db/docs/gsg_txn/CXX/preface.html create mode 100644 db/docs/gsg_txn/CXX/readblock.jpg create mode 100644 db/docs/gsg_txn/CXX/readmodifywrite.html create mode 100644 db/docs/gsg_txn/CXX/recovery-intro.html create mode 100644 db/docs/gsg_txn/CXX/recovery.html create mode 100644 db/docs/gsg_txn/CXX/reversesplit.html create mode 100644 db/docs/gsg_txn/CXX/rwlocks1.jpg create mode 100644 db/docs/gsg_txn/CXX/simplelock.jpg create mode 100644 db/docs/gsg_txn/CXX/txn_ccursor.html create mode 100644 db/docs/gsg_txn/CXX/txnconcurrency.html create mode 100644 db/docs/gsg_txn/CXX/txncursor.html create mode 100644 db/docs/gsg_txn/CXX/txnexample_c.html create mode 100644 db/docs/gsg_txn/CXX/txnindices.html create mode 100644 db/docs/gsg_txn/CXX/txnnowait.html create mode 100644 db/docs/gsg_txn/CXX/usingtxns.html create mode 100644 db/docs/gsg_txn/CXX/wrapup.html create mode 100644 db/docs/gsg_txn/CXX/writeblock.jpg create mode 100644 db/docs/gsg_txn/JAVA/BerkeleyDB-Core-JAVA-Txn.pdf create mode 100644 db/docs/gsg_txn/JAVA/abortresults.html create mode 100644 db/docs/gsg_txn/JAVA/architectrecovery.html create mode 100644 db/docs/gsg_txn/JAVA/autocommit.html create mode 100644 db/docs/gsg_txn/JAVA/backuprestore.html create mode 100644 db/docs/gsg_txn/JAVA/blocking_deadlocks.html create mode 100644 db/docs/gsg_txn/JAVA/deadlock.jpg create mode 100644 db/docs/gsg_txn/JAVA/enabletxn.html create mode 100644 db/docs/gsg_txn/JAVA/envopen.html create mode 100644 db/docs/gsg_txn/JAVA/filemanagement.html create mode 100644 db/docs/gsg_txn/JAVA/gettingStarted.css create mode 100644 db/docs/gsg_txn/JAVA/hotfailover.html create mode 100644 db/docs/gsg_txn/JAVA/index.html create mode 100644 db/docs/gsg_txn/JAVA/inmem_txnexample_java.html create mode 100644 db/docs/gsg_txn/JAVA/introduction.html create mode 100644 db/docs/gsg_txn/JAVA/isolation.html create mode 100644 db/docs/gsg_txn/JAVA/lockingsubsystem.html create mode 100644 db/docs/gsg_txn/JAVA/logconfig.html create mode 100644 db/docs/gsg_txn/JAVA/logfileremoval.html create mode 100644 db/docs/gsg_txn/JAVA/maxtxns.html create mode 100644 db/docs/gsg_txn/JAVA/nestedtxn.html create mode 100644 db/docs/gsg_txn/JAVA/perftune-intro.html create mode 100644 db/docs/gsg_txn/JAVA/preface.html create mode 100644 db/docs/gsg_txn/JAVA/readblock.jpg create mode 100644 db/docs/gsg_txn/JAVA/readmodifywrite.html create mode 100644 db/docs/gsg_txn/JAVA/recovery-intro.html create mode 100644 db/docs/gsg_txn/JAVA/recovery.html create mode 100644 db/docs/gsg_txn/JAVA/reversesplit.html create mode 100644 db/docs/gsg_txn/JAVA/rwlocks1.jpg create mode 100644 db/docs/gsg_txn/JAVA/simplelock.jpg create mode 100644 db/docs/gsg_txn/JAVA/txn_ccursor.html create mode 100644 db/docs/gsg_txn/JAVA/txnconcurrency.html create mode 100644 db/docs/gsg_txn/JAVA/txncursor.html create mode 100644 db/docs/gsg_txn/JAVA/txnexample_java.html create mode 100644 db/docs/gsg_txn/JAVA/txnindices.html create mode 100644 db/docs/gsg_txn/JAVA/txnnowait.html create mode 100644 db/docs/gsg_txn/JAVA/usingtxns.html create mode 100644 db/docs/gsg_txn/JAVA/wrapup.html create mode 100644 db/docs/gsg_txn/JAVA/writeblock.jpg create mode 100644 db/docs/images/Oracle_BerkeleyDB_clr.bmp create mode 100644 db/docs/java/com/sleepycat/bind/serial/SerialBase.html create mode 100644 db/docs/java/com/sleepycat/bind/serial/class-use/SerialBase.html create mode 100644 db/docs/java/com/sleepycat/bind/tuple/SortedDoubleBinding.html create mode 100644 db/docs/java/com/sleepycat/bind/tuple/SortedFloatBinding.html create mode 100644 db/docs/java/com/sleepycat/bind/tuple/TupleBase.html create mode 100644 db/docs/java/com/sleepycat/bind/tuple/class-use/SortedDoubleBinding.html create mode 100644 db/docs/java/com/sleepycat/bind/tuple/class-use/SortedFloatBinding.html create mode 100644 db/docs/java/com/sleepycat/bind/tuple/class-use/TupleBase.html create mode 100644 db/docs/java/com/sleepycat/db/CompactConfig.html create mode 100644 db/docs/java/com/sleepycat/db/CompactStats.html create mode 100644 db/docs/java/com/sleepycat/db/EventHandler.html create mode 100644 db/docs/java/com/sleepycat/db/EventType.html create mode 100644 db/docs/java/com/sleepycat/db/MultipleKeyNIODataEntry.html create mode 100644 db/docs/java/com/sleepycat/db/MultipleNIODataEntry.html create mode 100644 db/docs/java/com/sleepycat/db/MultipleRecnoNIODataEntry.html create mode 100644 db/docs/java/com/sleepycat/db/MutexStats.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationConfig.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationDuplicateMasterException.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationHoldElectionException.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationHostAddress.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationJoinFailureException.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationLockoutException.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationManagerAckPolicy.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationManagerStartPolicy.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationSiteUnavailableException.html create mode 100644 db/docs/java/com/sleepycat/db/ReplicationTimeoutType.html create mode 100644 db/docs/java/com/sleepycat/db/UpdateConflictException.html create mode 100644 db/docs/java/com/sleepycat/db/VersionMismatchException.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/CompactConfig.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/CompactStats.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/EventHandler.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/EventType.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/MultipleKeyNIODataEntry.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/MultipleNIODataEntry.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/MultipleRecnoNIODataEntry.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/MutexStats.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationConfig.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationDuplicateMasterException.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationHoldElectionException.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationHostAddress.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationJoinFailureException.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationLockoutException.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationManagerAckPolicy.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationManagerStartPolicy.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationSiteUnavailableException.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/ReplicationTimeoutType.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/UpdateConflictException.html create mode 100644 db/docs/java/com/sleepycat/db/class-use/VersionMismatchException.html create mode 100644 db/docs/java/com/sleepycat/util/PackedInteger.html create mode 100644 db/docs/java/com/sleepycat/util/class-use/PackedInteger.html create mode 100644 db/docs/license/license_db.html create mode 100644 db/docs/license/license_xml.html create mode 100644 db/docs/ref/cam/fail.html create mode 100644 db/docs/ref/rep/base_meth.html create mode 100644 db/docs/ref/rep/bulk.html create mode 100644 db/docs/ref/rep/init.html create mode 100644 db/docs/ref/rep/mastersync.html create mode 100644 db/docs/ref/rep/mgr_meth.html create mode 100644 db/docs/ref/transapp/fail.html create mode 100644 db/docs/ref/upgrade.4.4/autocommit.html create mode 100644 db/docs/ref/upgrade.4.4/clear.html create mode 100644 db/docs/ref/upgrade.4.4/disk.html create mode 100644 db/docs/ref/upgrade.4.4/intro.html create mode 100644 db/docs/ref/upgrade.4.4/isolation.html create mode 100644 db/docs/ref/upgrade.4.4/joinenv.html create mode 100644 db/docs/ref/upgrade.4.4/lockstat.html create mode 100644 db/docs/ref/upgrade.4.4/mutex.html create mode 100644 db/docs/ref/upgrade.4.4/toc.html create mode 100644 db/docs/ref/upgrade.4.5/alive.html create mode 100644 db/docs/ref/upgrade.4.5/applog.html create mode 100644 db/docs/ref/upgrade.4.5/collect.html create mode 100644 db/docs/ref/upgrade.4.5/config.html create mode 100644 db/docs/ref/upgrade.4.5/deprecate.html create mode 100644 db/docs/ref/upgrade.4.5/disk.html create mode 100644 db/docs/ref/upgrade.4.5/elect.html create mode 100644 db/docs/ref/upgrade.4.5/intro.html create mode 100644 db/docs/ref/upgrade.4.5/memp.html create mode 100644 db/docs/ref/upgrade.4.5/pagesize.html create mode 100644 db/docs/ref/upgrade.4.5/paniccall.html create mode 100644 db/docs/ref/upgrade.4.5/rep_event.html create mode 100644 db/docs/ref/upgrade.4.5/rep_set.html create mode 100644 db/docs/ref/upgrade.4.5/source.html create mode 100644 db/docs/ref/upgrade.4.5/toc.html create mode 100644 db/docs/utility/db_hotbackup.html create mode 100644 db/env/env_config.c create mode 100644 db/env/env_failchk.c create mode 100644 db/env/env_register.c create mode 100644 db/examples_c/csv/DbRecord.c create mode 100644 db/examples_c/csv/README create mode 100644 db/examples_c/csv/code.c create mode 100644 db/examples_c/csv/csv.h create mode 100644 db/examples_c/csv/csv_extern.h create mode 100644 db/examples_c/csv/db.c create mode 100644 db/examples_c/csv/load.c create mode 100644 db/examples_c/csv/load_main.c create mode 100644 db/examples_c/csv/query.c create mode 100644 db/examples_c/csv/query_main.c create mode 100644 db/examples_c/csv/sample.csv create mode 100644 db/examples_c/csv/sample.desc create mode 100644 db/examples_c/csv/util.c create mode 100644 db/examples_c/ex_rep/README create mode 100644 db/examples_c/ex_rep/base/rep_base.c create mode 100644 db/examples_c/ex_rep/base/rep_base.h create mode 100644 db/examples_c/ex_rep/base/rep_msg.c create mode 100644 db/examples_c/ex_rep/base/rep_net.c create mode 100644 db/examples_c/ex_rep/common/rep_common.c create mode 100644 db/examples_c/ex_rep/common/rep_common.h create mode 100644 db/examples_c/ex_rep/mgr/rep_mgr.c create mode 100644 db/examples_c/txn_guide/txn_guide.c create mode 100644 db/examples_c/txn_guide/txn_guide_inmemory.c create mode 100644 db/examples_cxx/excxx_repquote/RepConfigInfo.cpp create mode 100644 db/examples_cxx/excxx_repquote/RepConfigInfo.h create mode 100644 db/examples_cxx/excxx_repquote/RepQuoteExample.cpp create mode 100644 db/examples_cxx/txn_guide/TxnGuide.cpp create mode 100644 db/examples_cxx/txn_guide/TxnGuideInMemory.cpp create mode 100644 db/examples_java/src/collections/access/AccessExample.java create mode 100644 db/examples_java/src/collections/hello/HelloDatabaseWorld.java create mode 100644 db/examples_java/src/collections/ship/basic/PartData.java create mode 100644 db/examples_java/src/collections/ship/basic/PartKey.java create mode 100644 db/examples_java/src/collections/ship/basic/Sample.java create mode 100644 db/examples_java/src/collections/ship/basic/SampleDatabase.java create mode 100644 db/examples_java/src/collections/ship/basic/SampleViews.java create mode 100644 db/examples_java/src/collections/ship/basic/ShipmentData.java create mode 100644 db/examples_java/src/collections/ship/basic/ShipmentKey.java create mode 100644 db/examples_java/src/collections/ship/basic/SupplierData.java create mode 100644 db/examples_java/src/collections/ship/basic/SupplierKey.java create mode 100644 db/examples_java/src/collections/ship/basic/Weight.java create mode 100644 db/examples_java/src/collections/ship/entity/Part.java create mode 100644 db/examples_java/src/collections/ship/entity/PartData.java create mode 100644 db/examples_java/src/collections/ship/entity/PartKey.java create mode 100644 db/examples_java/src/collections/ship/entity/Sample.java create mode 100644 db/examples_java/src/collections/ship/entity/SampleDatabase.java create mode 100644 db/examples_java/src/collections/ship/entity/SampleViews.java create mode 100644 db/examples_java/src/collections/ship/entity/Shipment.java create mode 100644 db/examples_java/src/collections/ship/entity/ShipmentData.java create mode 100644 db/examples_java/src/collections/ship/entity/ShipmentKey.java create mode 100644 db/examples_java/src/collections/ship/entity/Supplier.java create mode 100644 db/examples_java/src/collections/ship/entity/SupplierData.java create mode 100644 db/examples_java/src/collections/ship/entity/SupplierKey.java create mode 100644 db/examples_java/src/collections/ship/entity/Weight.java create mode 100644 db/examples_java/src/collections/ship/factory/Part.java create mode 100644 db/examples_java/src/collections/ship/factory/PartKey.java create mode 100644 db/examples_java/src/collections/ship/factory/Sample.java create mode 100644 db/examples_java/src/collections/ship/factory/SampleDatabase.java create mode 100644 db/examples_java/src/collections/ship/factory/SampleViews.java create mode 100644 db/examples_java/src/collections/ship/factory/Shipment.java create mode 100644 db/examples_java/src/collections/ship/factory/ShipmentKey.java create mode 100644 db/examples_java/src/collections/ship/factory/Supplier.java create mode 100644 db/examples_java/src/collections/ship/factory/SupplierKey.java create mode 100644 db/examples_java/src/collections/ship/factory/Weight.java create mode 100644 db/examples_java/src/collections/ship/index/PartData.java create mode 100644 db/examples_java/src/collections/ship/index/PartKey.java create mode 100644 db/examples_java/src/collections/ship/index/Sample.java create mode 100644 db/examples_java/src/collections/ship/index/SampleDatabase.java create mode 100644 db/examples_java/src/collections/ship/index/SampleViews.java create mode 100644 db/examples_java/src/collections/ship/index/ShipmentData.java create mode 100644 db/examples_java/src/collections/ship/index/ShipmentKey.java create mode 100644 db/examples_java/src/collections/ship/index/SupplierData.java create mode 100644 db/examples_java/src/collections/ship/index/SupplierKey.java create mode 100644 db/examples_java/src/collections/ship/index/Weight.java create mode 100644 db/examples_java/src/collections/ship/marshal/MarshalledEnt.java create mode 100644 db/examples_java/src/collections/ship/marshal/MarshalledKey.java create mode 100644 db/examples_java/src/collections/ship/marshal/Part.java create mode 100644 db/examples_java/src/collections/ship/marshal/PartKey.java create mode 100644 db/examples_java/src/collections/ship/marshal/Sample.java create mode 100644 db/examples_java/src/collections/ship/marshal/SampleDatabase.java create mode 100644 db/examples_java/src/collections/ship/marshal/SampleViews.java create mode 100644 db/examples_java/src/collections/ship/marshal/Shipment.java create mode 100644 db/examples_java/src/collections/ship/marshal/ShipmentKey.java create mode 100644 db/examples_java/src/collections/ship/marshal/Supplier.java create mode 100644 db/examples_java/src/collections/ship/marshal/SupplierKey.java create mode 100644 db/examples_java/src/collections/ship/marshal/Weight.java create mode 100644 db/examples_java/src/collections/ship/sentity/Part.java create mode 100644 db/examples_java/src/collections/ship/sentity/PartKey.java create mode 100644 db/examples_java/src/collections/ship/sentity/Sample.java create mode 100644 db/examples_java/src/collections/ship/sentity/SampleDatabase.java create mode 100644 db/examples_java/src/collections/ship/sentity/SampleViews.java create mode 100644 db/examples_java/src/collections/ship/sentity/Shipment.java create mode 100644 db/examples_java/src/collections/ship/sentity/ShipmentKey.java create mode 100644 db/examples_java/src/collections/ship/sentity/Supplier.java create mode 100644 db/examples_java/src/collections/ship/sentity/SupplierKey.java create mode 100644 db/examples_java/src/collections/ship/sentity/Weight.java create mode 100644 db/examples_java/src/collections/ship/tuple/Part.java create mode 100644 db/examples_java/src/collections/ship/tuple/PartData.java create mode 100644 db/examples_java/src/collections/ship/tuple/PartKey.java create mode 100644 db/examples_java/src/collections/ship/tuple/Sample.java create mode 100644 db/examples_java/src/collections/ship/tuple/SampleDatabase.java create mode 100644 db/examples_java/src/collections/ship/tuple/SampleViews.java create mode 100644 db/examples_java/src/collections/ship/tuple/Shipment.java create mode 100644 db/examples_java/src/collections/ship/tuple/ShipmentData.java create mode 100644 db/examples_java/src/collections/ship/tuple/ShipmentKey.java create mode 100644 db/examples_java/src/collections/ship/tuple/Supplier.java create mode 100644 db/examples_java/src/collections/ship/tuple/SupplierData.java create mode 100644 db/examples_java/src/collections/ship/tuple/SupplierKey.java create mode 100644 db/examples_java/src/collections/ship/tuple/Weight.java create mode 100644 db/examples_java/src/db/AccessExample.java create mode 100644 db/examples_java/src/db/BtRecExample.java create mode 100644 db/examples_java/src/db/BulkAccessExample.java create mode 100644 db/examples_java/src/db/BulkAccessNIOExample.java create mode 100644 db/examples_java/src/db/EnvExample.java create mode 100644 db/examples_java/src/db/GettingStarted/ExampleDatabaseLoad.java create mode 100644 db/examples_java/src/db/GettingStarted/ExampleDatabaseRead.java create mode 100644 db/examples_java/src/db/GettingStarted/Inventory.java create mode 100644 db/examples_java/src/db/GettingStarted/InventoryBinding.java create mode 100644 db/examples_java/src/db/GettingStarted/ItemNameKeyCreator.java create mode 100644 db/examples_java/src/db/GettingStarted/MyDbs.java create mode 100644 db/examples_java/src/db/GettingStarted/Vendor.java create mode 100644 db/examples_java/src/db/GettingStarted/inventory.txt create mode 100644 db/examples_java/src/db/GettingStarted/vendors.txt create mode 100644 db/examples_java/src/db/LockExample.java create mode 100644 db/examples_java/src/db/RPCExample.java create mode 100644 db/examples_java/src/db/SequenceExample.java create mode 100644 db/examples_java/src/db/TpcbExample.java create mode 100644 db/examples_java/src/db/repquote/RepConfig.java create mode 100644 db/examples_java/src/db/repquote/RepQuoteEnvironment.java create mode 100644 db/examples_java/src/db/repquote/RepQuoteExample.java create mode 100644 db/examples_java/src/db/txn/DBWriter.java create mode 100644 db/examples_java/src/db/txn/PayloadData.java create mode 100644 db/examples_java/src/db/txn/TxnGuide.java create mode 100644 db/examples_java/src/db/txn/TxnGuideInMemory.java create mode 100644 db/java/src/com/sleepycat/bind/serial/SerialBase.java create mode 100644 db/java/src/com/sleepycat/bind/tuple/SortedDoubleBinding.java create mode 100644 db/java/src/com/sleepycat/bind/tuple/SortedFloatBinding.java create mode 100644 db/java/src/com/sleepycat/bind/tuple/TupleBase.java create mode 100644 db/java/src/com/sleepycat/collections/BaseIterator.java create mode 100644 db/java/src/com/sleepycat/collections/BlockIterator.java create mode 100644 db/java/src/com/sleepycat/collections/MyRangeCursor.java create mode 100644 db/java/src/com/sleepycat/db/CompactConfig.java create mode 100644 db/java/src/com/sleepycat/db/CompactStats.java create mode 100644 db/java/src/com/sleepycat/db/EventHandler.java create mode 100644 db/java/src/com/sleepycat/db/EventType.java create mode 100644 db/java/src/com/sleepycat/db/MultipleKeyNIODataEntry.java create mode 100644 db/java/src/com/sleepycat/db/MultipleNIODataEntry.java create mode 100644 db/java/src/com/sleepycat/db/MultipleRecnoNIODataEntry.java create mode 100644 db/java/src/com/sleepycat/db/MutexStats.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationConfig.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationDuplicateMasterException.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationHoldElectionException.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationHostAddress.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationJoinFailureException.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationLockoutException.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationManagerAckPolicy.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationManagerStartPolicy.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationSiteUnavailableException.java create mode 100644 db/java/src/com/sleepycat/db/ReplicationTimeoutType.java create mode 100644 db/java/src/com/sleepycat/db/VersionMismatchException.java create mode 100644 db/java/src/com/sleepycat/util/PackedInteger.java create mode 100644 db/java/src/com/sleepycat/util/keyrange/KeyRange.java create mode 100644 db/java/src/com/sleepycat/util/keyrange/KeyRangeException.java create mode 100644 db/java/src/com/sleepycat/util/keyrange/RangeCursor.java create mode 100644 db/lock/lock_failchk.c create mode 100644 db/log/log_debug.c create mode 100644 db/mod_db4/BSD create mode 100644 db/mp/mp_mvcc.c create mode 100644 db/mutex/mut_alloc.c create mode 100644 db/mutex/mut_failchk.c create mode 100644 db/mutex/mut_method.c create mode 100644 db/mutex/mut_region.c create mode 100644 db/mutex/mut_stat.c create mode 100644 db/os/os_flock.c create mode 100644 db/os/os_fzero.c create mode 100644 db/os/os_getenv.c create mode 100644 db/os/os_mkdir.c create mode 100644 db/os/os_pid.c create mode 100644 db/os/os_uid.c create mode 100644 db/os/os_yield.c create mode 100644 db/os_vxworks/os_vx_rpath.c create mode 100644 db/os_windows/os_abs.c create mode 100644 db/os_windows/os_clock.c create mode 100644 db/os_windows/os_config.c create mode 100644 db/os_windows/os_dir.c create mode 100644 db/os_windows/os_errno.c create mode 100644 db/os_windows/os_fid.c create mode 100644 db/os_windows/os_flock.c create mode 100644 db/os_windows/os_fsync.c create mode 100644 db/os_windows/os_getenv.c create mode 100644 db/os_windows/os_handle.c create mode 100644 db/os_windows/os_map.c create mode 100644 db/os_windows/os_open.c create mode 100644 db/os_windows/os_rename.c create mode 100644 db/os_windows/os_rw.c create mode 100644 db/os_windows/os_seek.c create mode 100644 db/os_windows/os_sleep.c create mode 100644 db/os_windows/os_spin.c create mode 100644 db/os_windows/os_stat.c create mode 100644 db/os_windows/os_truncate.c create mode 100644 db/os_windows/os_unlink.c create mode 100644 db/os_windows/os_yield.c create mode 100644 db/perl/BerkeleyDB/t/Test/Builder.pm create mode 100644 db/perl/BerkeleyDB/t/Test/More.pm create mode 100644 db/perl/BerkeleyDB/t/db-4.4.t create mode 100644 db/rep/rep_elect.c create mode 100644 db/rep/rep_log.c create mode 100644 db/rep/rep_verify.c create mode 100644 db/repmgr/repmgr_elect.c create mode 100644 db/repmgr/repmgr_method.c create mode 100644 db/repmgr/repmgr_msg.c create mode 100644 db/repmgr/repmgr_net.c create mode 100644 db/repmgr/repmgr_posix.c create mode 100644 db/repmgr/repmgr_queue.c create mode 100644 db/repmgr/repmgr_sel.c create mode 100644 db/repmgr/repmgr_stat.c create mode 100644 db/repmgr/repmgr_util.c create mode 100644 db/repmgr/repmgr_windows.c create mode 100644 db/test/env012.tcl create mode 100644 db/test/env013.tcl create mode 100644 db/test/env014.tcl create mode 100644 db/test/env015.tcl create mode 100644 db/test/envscript.tcl create mode 100644 db/test/fop007.tcl create mode 100644 db/test/fop008.tcl create mode 100644 db/test/log007.tcl create mode 100644 db/test/log008.tcl create mode 100644 db/test/log008script.tcl create mode 100644 db/test/log009.tcl create mode 100644 db/test/plat001.tcl create mode 100644 db/test/recd022.tcl create mode 100644 db/test/recd023.tcl create mode 100644 db/test/rep025.tcl create mode 100644 db/test/rep038.tcl create mode 100644 db/test/rep039.tcl create mode 100644 db/test/rep040.tcl create mode 100644 db/test/rep040script.tcl create mode 100644 db/test/rep041.tcl create mode 100644 db/test/rep042.tcl create mode 100644 db/test/rep042script.tcl create mode 100644 db/test/rep043.tcl create mode 100644 db/test/rep043script.tcl create mode 100644 db/test/rep044.tcl create mode 100644 db/test/rep045.tcl create mode 100644 db/test/rep045script.tcl create mode 100644 db/test/rep046.tcl create mode 100644 db/test/rep047.tcl create mode 100644 db/test/rep048.tcl create mode 100644 db/test/rep048script.tcl create mode 100644 db/test/rep049.tcl create mode 100644 db/test/rep050.tcl create mode 100644 db/test/rep051.tcl create mode 100644 db/test/rep052.tcl create mode 100644 db/test/rep053.tcl create mode 100644 db/test/rep054.tcl create mode 100644 db/test/rep055.tcl create mode 100644 db/test/rep056.tcl create mode 100644 db/test/rep057.tcl create mode 100644 db/test/rep058.tcl create mode 100644 db/test/rep059.tcl create mode 100644 db/test/rep060.tcl create mode 100644 db/test/rep061.tcl create mode 100644 db/test/rep062.tcl create mode 100644 db/test/rep063.tcl create mode 100644 db/test/rep064.tcl create mode 100644 db/test/rep065.tcl create mode 100644 db/test/rep065script.tcl create mode 100644 db/test/rep066.tcl create mode 100644 db/test/scr024/src/com/sleepycat/collections/test/serial/CatalogCornerCaseTest.java create mode 100644 db/test/scr024/src/com/sleepycat/util/test/FastOutputStreamTest.java create mode 100644 db/test/scr024/src/com/sleepycat/util/test/PackedIntegerTest.java create mode 100644 db/test/scr031/chk.xa create mode 100644 db/test/scr031/src/client.c create mode 100644 db/test/scr031/src/datafml.fml create mode 100644 db/test/scr031/src/datafml.h create mode 100644 db/test/scr031/src/hcommonxa.h create mode 100644 db/test/scr031/src/hdbrec.h create mode 100644 db/test/scr031/src/htimestampxa.c create mode 100644 db/test/scr031/src/htimestampxa.h create mode 100644 db/test/scr031/src/server.c create mode 100644 db/test/scr032/chk.rpc create mode 100644 db/test/sdb013.tcl create mode 100644 db/test/sdb014.tcl create mode 100644 db/test/sdb015.tcl create mode 100644 db/test/sdb016.tcl create mode 100644 db/test/sdb017.tcl create mode 100644 db/test/sdb018.tcl create mode 100644 db/test/sdb019.tcl create mode 100644 db/test/sdb020.tcl create mode 100644 db/test/si006.tcl create mode 100644 db/test/si007.tcl create mode 100644 db/test/si008.tcl create mode 100644 db/test/test110.tcl create mode 100644 db/test/test111.tcl create mode 100644 db/test/test112.tcl create mode 100644 db/test/test113.tcl create mode 100644 db/test/test114.tcl create mode 100644 db/test/test115.tcl create mode 100644 db/test/test116.tcl create mode 100644 db/test/test117.tcl create mode 100644 db/test/test119.tcl create mode 100644 db/test/test120.tcl create mode 100644 db/test/test121.tcl create mode 100644 db/test/test122.tcl create mode 100644 db/test/testutils42.tcl create mode 100644 db/test/txn012.tcl create mode 100644 db/test/txn012script.tcl create mode 100644 db/test/txn013.tcl create mode 100644 db/txn/txn_chkpt.c create mode 100644 db/txn/txn_failchk.c (limited to 'db') diff --git a/db/LICENSE b/db/LICENSE index 8cb10e79b..ffe7f3e33 100644 --- a/db/LICENSE +++ b/db/LICENSE @@ -1,17 +1,16 @@ /*- - * $Id: LICENSE,v 11.12 2004/03/30 20:49:44 bostic Exp $ + * $Id: LICENSE,v 12.4 2006/08/25 18:42:22 bostic Exp $ */ The following is the license that applies to this copy of the Berkeley DB software. For a license to use the Berkeley DB software under conditions other than those described here, or to purchase support for this software, -please contact Sleepycat Software by email at info@sleepycat.com, or on -the Web at http://www.sleepycat.com. +please contact Oracle Corporation at berkeleydb-info_us@oracle.com. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /* - * Copyright (c) 1990-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1990-2006 + * Oracle Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,10 +31,10 @@ the Web at http://www.sleepycat.com. * files that typically accompany the major components of the operating * system on which the executable file runs. * - * THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS'' AND ANY EXPRESS + * THIS SOFTWARE IS PROVIDED BY ORACLE CORPORATION ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR - * NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL SLEEPYCAT SOFTWARE + * NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL ORACLE CORPORATION * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS diff --git a/db/README b/db/README index abfe1d675..0b084ff5b 100644 --- a/db/README +++ b/db/README @@ -1,5 +1,5 @@ -Sleepycat Software: Berkeley DB 4.3.27: (December 22, 2004) +Berkeley DB 4.5.20: (September 20, 2006) -This is version 4.3.27 of Berkeley DB from Sleepycat Software. To view +This is version 4.5.20 of Berkeley DB from Oracle Corporation. To view the release and installation documentation, load the distribution file docs/index.html into your web browser. diff --git a/db/btree/bt_compact.c b/db/btree/bt_compact.c new file mode 100644 index 000000000..c5fa483b1 --- /dev/null +++ b/db/btree/bt_compact.c @@ -0,0 +1,2398 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1999-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: bt_compact.c,v 12.53 2006/08/24 14:44:43 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" +#include "dbinc/lock.h" +#include "dbinc/log.h" +#include "dbinc/mp.h" +#include "dbinc/txn.h" + +static int __bam_compact_dups __P((DBC *, + PAGE **, u_int32_t, int, DB_COMPACT *, int *)); +static int __bam_compact_int __P((DBC *, + DBT *, DBT *, u_int32_t, int *, DB_COMPACT *, int *)); +static int __bam_csearch __P((DBC *, DBT *, u_int32_t, int)); +static int __bam_merge __P((DBC *, + DBC *, u_int32_t, DBT *, DB_COMPACT *,int *)); +static int __bam_merge_internal __P((DBC *, DBC *, int, DB_COMPACT *, int *)); +static int __bam_merge_pages __P((DBC *, DBC *, DB_COMPACT *)); +static int __bam_merge_records __P((DBC *, DBC*, u_int32_t, DB_COMPACT *)); +static int __bam_truncate_internal_overflow __P((DBC *, PAGE *, DB_COMPACT *)); +static int __bam_truncate_overflow __P((DBC *, + db_pgno_t, db_pgno_t, DB_COMPACT *)); +static int __bam_truncate_page __P((DBC *, PAGE **, int)); +static int __bam_truncate_root_page __P((DBC *, + PAGE *, u_int32_t, DB_COMPACT *)); + +#ifdef HAVE_FTRUNCATE +static int __bam_free_freelist __P((DB *, DB_TXN *)); +static int __bam_savekey __P((DBC *, int, DBT *)); +static int __bam_setup_freelist __P((DB *, struct pglist *, u_int32_t)); +static int __bam_truncate_internal __P((DB *, DB_TXN *, DB_COMPACT *)); +#endif + +#define SAVE_START \ + do { \ + save_data = *c_data; \ + ret = __db_retcopy(dbenv, \ + &save_start, end->data, end->size, \ + &save_start.data, &save_start.ulen); \ + } while (0) + +/* + * Only restore those things that are negated by aborting the + * transaction. We don't restore the number of deadlocks, for example. + */ + +#define RESTORE_START \ + do { \ + c_data->compact_pages_free = \ + save_data.compact_pages_free; \ + c_data->compact_levels = save_data.compact_levels; \ + c_data->compact_truncate = save_data.compact_truncate; \ + ret = __db_retcopy(dbenv, end, \ + save_start.data, save_start.size, \ + &end->data, &end->ulen); \ + } while (0) +/* + * __bam_compact -- compact a btree. + * + * PUBLIC: int __bam_compact __P((DB *, DB_TXN *, + * PUBLIC: DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *)); + */ +int +__bam_compact(dbp, txn, start, stop, c_data, flags, end) + DB *dbp; + DB_TXN *txn; + DBT *start, *stop; + DB_COMPACT *c_data; + u_int32_t flags; + DBT *end; +{ + DBT current, save_start; + DBC *dbc; + DB_COMPACT save_data; + DB_ENV *dbenv; + db_pgno_t last_pgno; + struct pglist *list; + u_int32_t factor, nelems, truncated; + int deadlock, done, ret, span, t_ret, txn_local; + + dbenv = dbp->dbenv; + + memset(¤t, 0, sizeof(current)); + memset(&save_start, 0, sizeof(save_start)); + dbc = NULL; + deadlock = 0; + done = 0; + factor = 0; + ret = 0; + span = 0; + truncated = 0; + last_pgno = 0; + + /* + * We pass "end" to the internal routine, indicating where + * that routine should begin its work and expecting that it + * will return to us the last key that it processed. + */ + if (end == NULL) + end = ¤t; + if (start != NULL && (ret = __db_retcopy(dbenv, + end, start->data, start->size, &end->data, &end->ulen)) != 0) + return (ret); + + list = NULL; + nelems = 0; + + if (IS_DB_AUTO_COMMIT(dbp, txn)) + txn_local = 1; + else + txn_local = 0; + if (!LF_ISSET(DB_FREE_SPACE | DB_FREELIST_ONLY)) + goto no_free; + if (LF_ISSET(DB_FREELIST_ONLY)) + LF_SET(DB_FREE_SPACE); + +#ifdef HAVE_FTRUNCATE + /* Sort the freelist and set up the in-memory list representation. */ + if (txn_local && (ret = __txn_begin(dbenv, NULL, &txn, 0)) != 0) + goto err; + + if ((ret = __db_free_truncate(dbp, + txn, flags, c_data, &list, &nelems, &last_pgno)) != 0) { + LF_CLR(DB_FREE_SPACE); + goto terr; + } + + /* If the freelist is empty and we are not filling, get out. */ + if (nelems == 0 && LF_ISSET(DB_FREELIST_ONLY)) { + ret = 0; + LF_CLR(DB_FREE_SPACE); + goto terr; + } + if ((ret = __bam_setup_freelist(dbp, list, nelems)) != 0) { + /* Someone else owns the free list. */ + if (ret == EBUSY) + ret = 0; + } + + /* Commit the txn and release the meta page lock. */ +terr: if (txn_local) { + if ((t_ret = __txn_commit(txn, DB_TXN_NOSYNC)) != 0 && ret == 0) + ret = t_ret; + txn = NULL; + } + if (ret != 0) + goto err; + + /* Save the number truncated so far, we will add what we get below. */ + truncated = c_data->compact_pages_truncated; + if (LF_ISSET(DB_FREELIST_ONLY)) + goto done; +#endif + + /* + * We want factor to be the target number of free bytes on each page, + * so we know when to stop adding items to a page. Make sure to + * subtract the page overhead when computing this target. This can + * result in a 1-2% error on the smallest page. + * First figure out how many bytes we should use: + */ +no_free: + factor = dbp->pgsize - SIZEOF_PAGE; + if (c_data->compact_fillpercent != 0) { + factor *= c_data->compact_fillpercent; + factor /= 100; + } + /* Now convert to the number of free bytes to target. */ + factor = (dbp->pgsize - SIZEOF_PAGE) - factor; + + if (c_data->compact_pages == 0) + c_data->compact_pages = DB_MAX_PAGES; + + do { + deadlock = 0; + + SAVE_START; + if (ret != 0) + break; + + if (txn_local) { + if ((ret = __txn_begin(dbenv, NULL, &txn, 0)) != 0) + break; + + if (c_data->compact_timeout != 0 && + (ret = __txn_set_timeout(txn, + c_data->compact_timeout, DB_SET_LOCK_TIMEOUT)) != 0) + goto err; + } + + if ((ret = __db_cursor(dbp, txn, &dbc, 0)) != 0) + goto err; + + if ((ret = __bam_compact_int(dbc, end, stop, factor, + &span, c_data, &done)) == DB_LOCK_DEADLOCK && txn_local) { + /* + * We retry on deadlock. Cancel the statistics + * and reset the start point to before this + * iteration. + */ + deadlock = 1; + c_data->compact_deadlock++; + RESTORE_START; + } + + if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0) + ret = t_ret; + +err: if (txn_local && txn != NULL) { + if (ret == 0 && deadlock == 0) + ret = __txn_commit(txn, DB_TXN_NOSYNC); + else if ((t_ret = __txn_abort(txn)) != 0 && ret == 0) + ret = t_ret; + txn = NULL; + } + } while (ret == 0 && !done); + + if (current.data != NULL) + __os_free(dbenv, current.data); + if (save_start.data != NULL) + __os_free(dbenv, save_start.data); + +#ifdef HAVE_FTRUNCATE + /* + * Finish up truncation work. If there are pages left in the free + * list then search the internal nodes of the tree as we may have + * missed some while walking the leaf nodes. Then calculate how + * many pages we have truncated and release the in-memory free list. + */ +done: if (LF_ISSET(DB_FREE_SPACE)) { + DBMETA *meta; + db_pgno_t pgno; + + pgno = PGNO_BASE_MD; + done = 1; + if (ret == 0 && !LF_ISSET(DB_FREELIST_ONLY) && (t_ret = + __memp_fget(dbp->mpf, &pgno, txn, 0, &meta)) == 0) { + done = meta->free == PGNO_INVALID; + ret = __memp_fput(dbp->mpf, meta, 0); + } + + if (!done) + ret = __bam_truncate_internal(dbp, txn, c_data); + + /* Clean up the free list. */ + if (list != NULL) + __os_free(dbenv, list); + + if ((t_ret = + __memp_fget(dbp->mpf, &pgno, txn, 0, &meta)) == 0) { + c_data->compact_pages_truncated = + truncated + last_pgno - meta->last_pgno; + if ((t_ret = + __memp_fput(dbp->mpf, meta, 0)) != 0 && ret == 0) + ret = t_ret; + } else if (ret == 0) + ret = t_ret; + + if ((t_ret = __bam_free_freelist(dbp, txn)) != 0 && ret == 0) + t_ret = ret; + } +#endif + + return (ret); +} + +/* + * __bam_csearch -- isolate search code for bam_compact. + * This routine hides the differences between searching + * a BTREE and a RECNO from the rest of the code. + */ +#define CS_READ 0 /* We are just reading. */ +#define CS_PARENT 1 /* We want the parent too, write lock. */ +#define CS_NEXT 2 /* Get the next page. */ +#define CS_NEXT_WRITE 3 /* Get the next page and write lock. */ +#define CS_DEL 4 /* Get a stack to delete a page. */ +#define CS_START 5 /* Starting level for stack, write lock. */ +#define CS_GETRECNO 0x80 /* Extract record number from start. */ + +static int +__bam_csearch(dbc, start, sflag, level) + DBC *dbc; + DBT *start; + u_int32_t sflag; + int level; +{ + BTREE_CURSOR *cp; + int not_used, ret; + + cp = (BTREE_CURSOR *)dbc->internal; + + if (dbc->dbtype == DB_RECNO) { + /* If GETRECNO is not set the cp->recno is what we want. */ + if (FLD_ISSET(sflag, CS_GETRECNO)) { + if (start == NULL || start->size == 0) + cp->recno = 1; + else if ((ret = + __ram_getno(dbc, start, &cp->recno, 0)) != 0) + return (ret); + FLD_CLR(sflag, CS_GETRECNO); + } + switch (sflag) { + case CS_READ: + sflag = SR_READ; + break; + case CS_NEXT: + sflag = SR_PARENT | SR_READ; + break; + case CS_START: + level = LEAFLEVEL; + /* FALLTHROUGH */ + case CS_DEL: + case CS_NEXT_WRITE: + sflag = SR_STACK; + break; + case CS_PARENT: + sflag = SR_PARENT | SR_WRITE; + break; + default: + return (__db_panic(dbc->dbp->dbenv, EINVAL)); + } + if ((ret = __bam_rsearch(dbc, + &cp->recno, sflag, level, ¬_used)) != 0) + return (ret); + /* Reset the cursor's recno to the beginning of the page. */ + cp->recno -= cp->csp->indx; + } else { + FLD_CLR(sflag, CS_GETRECNO); + switch (sflag) { + case CS_READ: + sflag = SR_READ | SR_DUPFIRST; + break; + case CS_DEL: + sflag = SR_DEL; + break; + case CS_NEXT: + sflag = SR_NEXT; + break; + case CS_NEXT_WRITE: + sflag = SR_NEXT | SR_WRITE; + break; + case CS_START: + sflag = SR_START | SR_WRITE; + break; + case CS_PARENT: + sflag = SR_PARENT | SR_WRITE; + break; + default: + return (__db_panic(dbc->dbp->dbenv, EINVAL)); + } + if (start == NULL || start->size == 0) + FLD_SET(sflag, SR_MIN); + + if ((ret = __bam_search(dbc, + cp->root, start, sflag, level, NULL, ¬_used)) != 0) + return (ret); + } + + return (0); +} + +/* + * __bam_compact_int -- internal compaction routine. + * Called either with a cursor on the main database + * or a cursor initialized to the root of an off page duplicate + * tree. + */ +static int +__bam_compact_int(dbc, start, stop, factor, spanp, c_data, donep) + DBC *dbc; + DBT *start, *stop; + u_int32_t factor; + int *spanp; + DB_COMPACT *c_data; + int *donep; +{ + BTREE_CURSOR *cp, *ncp; + DB *dbp; + DBC *ndbc; + DB_ENV *dbenv; + DB_LOCK nolock; + EPG *epg; + DB_MPOOLFILE *dbmp; + PAGE *pg, *ppg, *npg; + db_pgno_t npgno; + db_recno_t next_recno; + u_int32_t sflag; + int check_dups, check_trunc, done, level; + int merged, nentry, next_page, pgs_done, ret, t_ret, tdone; + +#ifdef DEBUG +#define CTRACE(dbc, location, t, start, f) do { \ + DBT __trace; \ + DB_SET_DBT(__trace, t, strlen(t)); \ + DEBUG_LWRITE( \ + dbc, (dbc)->txn, location, &__trace, start, f) \ + } while (0) +#define PTRACE(dbc, location, p, start, f) do { \ + char __buf[32]; \ + (void)snprintf(__buf, \ + sizeof(__buf), "pgno: %lu", (u_long)p); \ + CTRACE(dbc, location, __buf, start, f); \ + } while (0) +#else +#define CTRACE(dbc, location, t, start, f) +#define PTRACE(dbc, location, p, start, f) +#endif + + ndbc = NULL; + pg = NULL; + npg = NULL; + done = 0; + tdone = 0; + pgs_done = 0; + next_recno = 0; + next_page = 0; + LOCK_INIT(nolock); + check_trunc = c_data->compact_truncate != PGNO_INVALID; + check_dups = (!F_ISSET(dbc, DBC_OPD) && + F_ISSET(dbc->dbp, DB_AM_DUP)) || check_trunc; + + dbp = dbc->dbp; + dbenv = dbp->dbenv; + dbmp = dbp->mpf; + cp = (BTREE_CURSOR *)dbc->internal; + + /* Search down the tree for the starting point. */ + if ((ret = __bam_csearch(dbc, + start, CS_READ | CS_GETRECNO, LEAFLEVEL)) != 0) { + /* Its not an error to compact an empty db. */ + if (ret == DB_NOTFOUND) + ret = 0; + done = 1; + goto err; + } + + /* + * Get the first leaf page. The loop below will change pg so + * we clear the stack reference so we don't put a a page twice. + */ + pg = cp->csp->page; + cp->csp->page = NULL; + next_recno = cp->recno; +next: /* + * This is the start of the main compaction loop. There are 3 + * parts to the process: + * 1) Walk the leaf pages of the tree looking for a page to + * process. We do this with read locks. Save the + * key from the page and release it. + * 2) Set up a cursor stack which will write lock the page + * and enough of its ancestors to get the job done. + * This could go to the root if we might delete a subtree + * or we have record numbers to update. + * 3) Loop fetching pages after the above page and move enough + * data to fill it. + * We exit the loop if we are at the end of the leaf pages, are + * about to lock a new subtree (we span) or on error. + */ + + /* Walk the pages looking for something to fill up. */ + while ((npgno = NEXT_PGNO(pg)) != PGNO_INVALID) { + c_data->compact_pages_examine++; + PTRACE(dbc, "Next", PGNO(pg), start, 0); + + /* If we have fetched the next page, get the new key. */ + if (next_page == 1 && + dbc->dbtype != DB_RECNO && NUM_ENT(pg) != 0) { + if ((ret = __db_ret(dbp, dbc->txn, pg, + 0, start, &start->data, &start->ulen)) != 0) + goto err; + } + next_recno += NUM_ENT(pg); + if (P_FREESPACE(dbp, pg) > factor || + (check_trunc && PGNO(pg) > c_data->compact_truncate)) + break; + /* + * The page does not need more data or to be swapped, + * check to see if we want to look at possible duplicate + * trees or overflow records and the move on to the next page. + */ + cp->recno += NUM_ENT(pg); + next_page = 1; + tdone = pgs_done; + PTRACE(dbc, "Dups", PGNO(pg), start, 0); + if (check_dups && (ret = __bam_compact_dups( + dbc, &pg, factor, 0, c_data, &pgs_done)) != 0) + goto err; + npgno = NEXT_PGNO(pg); + if ((ret = __memp_fput(dbmp, pg, 0)) != 0) + goto err; + pg = NULL; + /* + * If we don't do anything we don't need to hold + * the lock on the previous page, so couple always. + */ + if ((ret = __db_lget(dbc, + tdone == pgs_done ? LCK_COUPLE_ALWAYS : LCK_COUPLE, + npgno, DB_LOCK_READ, 0, &cp->csp->lock)) != 0) + goto err; + if ((ret = __memp_fget(dbmp, &npgno, dbc->txn, 0, &pg)) != 0) + goto err; + } + + /* + * When we get here we have 3 cases: + * 1) We've reached the end of the leaf linked list and are done. + * 2) A page whose freespace exceeds our target and therefore needs + * to have data added to it. + * 3) A page that doesn't have too much free space but needs to be + * checked for truncation. + * In both cases 2 and 3, we need that page's first key or record + * number. We may already have it, if not get it here. + */ + if ((nentry = NUM_ENT(pg)) != 0) { + next_page = 0; + /* Get a copy of the first recno on the page. */ + if (dbc->dbtype == DB_RECNO) { + if ((ret = __db_retcopy(dbp->dbenv, start, + &cp->recno, sizeof(cp->recno), + &start->data, &start->ulen)) != 0) + goto err; + } else if (start->size == 0 && + (ret = __db_ret(dbp, dbc->txn, pg, + 0, start, &start->data, &start->ulen)) != 0) + goto err; + + if (npgno == PGNO_INVALID) { + /* End of the tree, check its duplicates and exit. */ + PTRACE(dbc, "GoDone", PGNO(pg), start, 0); + if (check_dups && (ret = __bam_compact_dups(dbc, + &pg, factor, 0, c_data, &pgs_done)) != 0) + goto err; + c_data->compact_pages_examine++; + done = 1; + goto done; + } + } + + /* Release the page so we don't deadlock getting its parent. */ + if ((ret = __LPUT(dbc, cp->csp->lock)) != 0) + goto err; + if ((ret = __memp_fput(dbmp, pg, 0)) != 0) + goto err; + BT_STK_CLR(cp); + pg = NULL; + + /* + * Setup the cursor stack. There are 3 cases: + * 1) the page is empty and will be deleted: nentry == 0. + * 2) the next page has the same parent: *spanp == 0. + * 3) the next page has a different parent: *spanp == 1. + * + * We now need to search the tree again, getting a write lock + * on the page we are going to merge or delete. We do this by + * searching down the tree and locking as much of the subtree + * above the page as needed. In the case of a delete we will + * find the maximal subtree that can be deleted. In the case + * of merge if the current page and the next page are siblings + * with the same parent then we only need to lock the parent. + * Otherwise *span will be set and we need to search to find the + * lowest common ancestor. Dbc will be set to contain the subtree + * containing the page to be merged or deleted. Ndbc will contain + * the minimal subtree containing that page and its next sibling. + * In all cases for DB_RECNO we simplify things and get the whole + * tree if we need more than a single parent. + */ + + /* Case 1 -- page is empty. */ + if (nentry == 0) { + CTRACE(dbc, "Empty", "", start, 0); + if (next_page == 1) + sflag = CS_NEXT_WRITE; + else + sflag = CS_DEL; + if ((ret = __bam_csearch(dbc, start, sflag, LEAFLEVEL)) != 0) + goto err; + + pg = cp->csp->page; + /* Check to see if the page is still empty. */ + if (NUM_ENT(pg) != 0) + npgno = PGNO(pg); + else { + npgno = NEXT_PGNO(pg); + /* If this is now the root, we are very done. */ + if (PGNO(pg) == cp->root) + done = 1; + else { + if ((ret = __bam_dpages(dbc, 0, 0)) != 0) + goto err; + c_data->compact_pages_free++; + goto next_no_release; + } + } + goto next_page; + } + + /* case 3 -- different parents. */ + if (*spanp) { + CTRACE(dbc, "Span", "", start, 0); + if (ndbc == NULL && (ret = __db_c_dup(dbc, &ndbc, 0)) != 0) + goto err; + ncp = (BTREE_CURSOR *)ndbc->internal; + ncp->recno = next_recno; + /* + * Search the tree looking for the next page after the + * current key. For RECNO get the whole stack. + * For BTREE the return will contain the stack that + * dominates both the current and next pages. + */ + if ((ret = __bam_csearch(ndbc, start, CS_NEXT_WRITE, 0)) != 0) + goto err; + + if (dbc->dbtype == DB_RECNO) { + /* + * The record we are looking for may have moved + * to the previous page. This page should + * be at the beginning of its parent. + * If not, then start over. + */ + if (ncp->csp[-1].indx != 0) { + *spanp = 0; + goto deleted; + } + + } + if ((ret = + __memp_dirty(dbp->mpf, &ncp->csp->page, dbc->txn, 0)) != 0) + goto err; + PTRACE(dbc, "SDups", PGNO(ncp->csp->page), start, 0); + if (check_dups && (ret = __bam_compact_dups(ndbc, + &ncp->csp->page, factor, 1, c_data, &pgs_done)) != 0) + goto err; + + /* Check to see if the tree collapsed. */ + if (PGNO(ncp->csp->page) == ncp->root) + goto done; + /* + * We need the stacks to be the same height + * so that we can merge parents. + */ + level = LEVEL(ncp->sp->page); + sflag = CS_START; + if ((ret = __bam_csearch(dbc, start, sflag, level)) != 0) + goto err; + pg = cp->csp->page; + *spanp = 0; + + /* + * The page may have emptied while we waited for the lock. + * Reset npgno so we re-get this page when we go back to the + * top. + */ + if (NUM_ENT(pg) == 0) { + npgno = PGNO(pg); + goto next_page; + } + if (check_trunc && PGNO(pg) > c_data->compact_truncate) { + pgs_done++; + /* Get a fresh low numbered page. */ + if ((ret = __bam_truncate_page(dbc, &pg, 1)) != 0) + goto err1; + } + + if ((ret = + __memp_dirty(dbp->mpf, &cp->csp->page, dbc->txn, 0)) != 0) + goto err1; + pg = cp->csp->page; + npgno = NEXT_PGNO(pg); + PTRACE(dbc, "SDups", PGNO(pg), start, 0); + if (check_dups && (ret = + __bam_compact_dups(dbc, &cp->csp->page, + factor, 1, c_data, &pgs_done)) != 0) + goto err1; + + /* + * We may have dropped our locks, check again + * to see if we still need to fill this page and + * we are in a spanning situation. + */ + + if (P_FREESPACE(dbp, pg) <= factor || + cp->csp[-1].indx != NUM_ENT(cp->csp[-1].page) - 1) + goto next_page; + + /* + * Try to move things into a single parent. + */ + merged = 0; + for (epg = cp->sp; epg != cp->csp; epg++) { + if (PGNO(epg->page) == cp->root) + continue; + PTRACE(dbc, "PMerge", PGNO(epg->page), start, 0); + if ((ret = __bam_merge_internal(dbc, + ndbc, LEVEL(epg->page), c_data, &merged)) != 0) + goto err1; + if (merged) + break; + } + + /* If we merged the parent, then we nolonger span. */ + if (merged) { + pgs_done++; + if (cp->csp->page == NULL) + goto deleted; + npgno = PGNO(pg); + goto next_page; + } + PTRACE(dbc, "SMerge", PGNO(cp->csp->page), start, 0); + npgno = NEXT_PGNO(ncp->csp->page); + if ((ret = __bam_merge(dbc, + ndbc, factor, stop, c_data, &done)) != 0) + goto err1; + pgs_done++; + /* + * __bam_merge could have freed our stack if it + * deleted a page possibly collapsing the tree. + */ + if (cp->csp->page == NULL) + goto deleted; + cp->recno += NUM_ENT(pg); + + /* If we did not bump to the next page something did not fit. */ + if (npgno != NEXT_PGNO(pg)) { + npgno = NEXT_PGNO(pg); + goto next_page; + } + } else { + /* Case 2 -- same parents. */ + CTRACE(dbc, "Sib", "", start, 0); + if ((ret = + __bam_csearch(dbc, start, CS_PARENT, LEAFLEVEL)) != 0) + goto err; + + pg = cp->csp->page; + npgno = PGNO(pg); + + /* We now have a write lock, recheck the page. */ + if ((nentry = NUM_ENT(pg)) == 0) + goto next_page; + + if ((ret = __memp_dirty(dbp->mpf, &cp->csp->page, + dbc->txn, 0)) != 0) + goto err; + pg = cp->csp->page; + + npgno = NEXT_PGNO(pg); + + /* Check duplicate trees, we have a write lock on the page. */ + PTRACE(dbc, "SibDup", PGNO(pg), start, 0); + if (check_dups && (ret = + __bam_compact_dups(dbc, &cp->csp->page, + factor, 1, c_data, &pgs_done)) != 0) + goto err1; + pg = cp->csp->page; + + /* Check to see if the tree collapsed. */ + if (PGNO(pg) == cp->root) + goto err1; + DB_ASSERT(dbenv, cp->csp - cp->sp == 1); + + if (check_trunc && PGNO(pg) > c_data->compact_truncate) { + pgs_done++; + /* Get a fresh low numbered page. */ + if ((ret = __bam_truncate_page(dbc, &pg, 1)) != 0) + goto err1; + } + + /* After re-locking check to see if we still need to fill. */ + if (P_FREESPACE(dbp, pg) <= factor) + goto next_page; + + /* If they have the same parent, just dup the cursor */ + if (ndbc != NULL && (ret = __db_c_close(ndbc)) != 0) + goto err1; + if ((ret = __db_c_dup(dbc, &ndbc, DB_POSITION)) != 0) + goto err1; + ncp = (BTREE_CURSOR *)ndbc->internal; + + /* + * ncp->recno needs to have the recno of the next page. + * Bump it by the number of records on the current page. + */ + ncp->recno += NUM_ENT(pg); + } + + /* Fetch pages until we fill this one. */ + while (!done && npgno != PGNO_INVALID && + P_FREESPACE(dbp, pg) > factor && c_data->compact_pages != 0) { + /* + * If our current position is the last one on a parent + * page, then we are about to merge across different + * internal nodes. Thus, we need to lock higher up + * in the tree. We will exit the routine and commit + * what we have done so far. Set spanp so we know + * we are in this case when we come back. + */ + if (cp->csp[-1].indx == NUM_ENT(cp->csp[-1].page) - 1) { + *spanp = 1; + npgno = PGNO(pg); + next_recno = cp->recno; + goto next_page; + } + + /* Lock and get the next page. */ + if ((ret = __db_lget(dbc, LCK_COUPLE, + npgno, DB_LOCK_WRITE, 0, &ncp->lock)) != 0) + goto err1; + if ((ret = __memp_fget(dbmp, &npgno, dbc->txn, + DB_MPOOL_DIRTY, &npg)) != 0) + goto err1; + + /* Fix up the next page cursor with its parent node. */ + if ((ret = __memp_fget(dbmp, &PGNO(cp->csp[-1].page), + dbc->txn, 0, &ppg)) != 0) + goto err1; + BT_STK_PUSH(dbenv, ncp, ppg, + cp->csp[-1].indx + 1, nolock, DB_LOCK_NG, ret); + if (ret != 0) + goto err1; + + /* Put the page on the stack. */ + BT_STK_ENTER(dbenv, ncp, npg, 0, ncp->lock, DB_LOCK_WRITE, ret); + + LOCK_INIT(ncp->lock); + npg = NULL; + + c_data->compact_pages_examine++; + + PTRACE(dbc, "MDups", PGNO(ncp->csp->page), start, 0); + if (check_dups && (ret = __bam_compact_dups(ndbc, + &ncp->csp->page, factor, 1, c_data, &pgs_done)) != 0) + goto err1; + + npgno = NEXT_PGNO(ncp->csp->page); + /* + * Merge the pages. This will either free the next + * page or just update its parent pointer. + */ + PTRACE(dbc, "Merge", PGNO(cp->csp->page), start, 0); + if ((ret = __bam_merge(dbc, + ndbc, factor, stop, c_data, &done)) != 0) + goto err1; + + pgs_done++; + + /* + * __bam_merge could have freed our stack if it + * deleted a page possibly collapsing the tree. + */ + if (cp->csp->page == NULL) + goto deleted; + /* If we did not bump to the next page something did not fit. */ + if (npgno != NEXT_PGNO(pg)) + break; + } + + /* Bottom of the main loop. Move to the next page. */ + npgno = NEXT_PGNO(pg); + cp->recno += NUM_ENT(pg); + next_recno = cp->recno; + +next_page: + if ((ret = __bam_stkrel(dbc, pgs_done == 0 ? STK_NOLOCK : 0)) != 0) + goto err1; + if (ndbc != NULL && + (ret = __bam_stkrel(ndbc, pgs_done == 0 ? STK_NOLOCK : 0)) != 0) + goto err1; + +next_no_release: + pg = NULL; + + if (npgno == PGNO_INVALID || c_data->compact_pages == 0) + done = 1; + if (!done) { + /* + * If we are at the end of this parent commit the + * transaction so we don't tie things up. + */ + if (pgs_done != 0 && *spanp) { +deleted: if (((ret = __bam_stkrel(ndbc, 0)) != 0 || + (ret = __db_c_close(ndbc)) != 0)) + goto err; + *donep = 0; + return (0); + } + + /* Reget the next page to look at. */ + cp->recno = next_recno; + if ((ret = __db_lget(dbc, + pgs_done ? LCK_COUPLE_ALWAYS : LCK_COUPLE, + npgno, DB_LOCK_READ, 0, &cp->csp->lock)) != 0 || + (ret = __memp_fget(dbmp, &npgno, dbc->txn, 0, &pg)) != 0) + goto err; + next_page = 1; + goto next; + } + +done: + if (0) { + /* We come here if pg is the same as cp->csp->page. */ +err1: pg = NULL; + } +err: if (dbc != NULL && + (t_ret = __bam_stkrel(dbc, STK_CLRDBC)) != 0 && ret == 0) + ret = t_ret; + if (ndbc != NULL) { + if ((t_ret = __bam_stkrel(ndbc, STK_CLRDBC)) != 0 && ret == 0) + ret = t_ret; + else if ((t_ret = __db_c_close(ndbc)) != 0 && ret == 0) + ret = t_ret; + } + + if (pg != NULL && (t_ret = __memp_fput(dbmp, pg, 0) != 0) && ret == 0) + ret = t_ret; + if (npg != NULL && (t_ret = __memp_fput(dbmp, npg, 0) != 0) && ret == 0) + ret = t_ret; + + *donep = done; + + return (ret); +} + +/* + * __bam_merge -- do actual merging of leaf pages. + */ +static int +__bam_merge(dbc, ndbc, factor, stop, c_data, donep) + DBC *dbc, *ndbc; + u_int32_t factor; + DBT *stop; + DB_COMPACT *c_data; + int *donep; +{ + BTREE_CURSOR *cp, *ncp; + BTREE *t; + DB *dbp; + PAGE *pg, *npg; + db_indx_t adj, nent; + db_recno_t recno; + int cmp, ret; + int (*func) __P((DB *, const DBT *, const DBT *)); + + dbp = dbc->dbp; + t = dbp->bt_internal; + cp = (BTREE_CURSOR *)dbc->internal; + ncp = (BTREE_CURSOR *)ndbc->internal; + pg = cp->csp->page; + npg = ncp->csp->page; + + nent = NUM_ENT(npg); + + /* If the page is empty just throw it away. */ + if (nent == 0) + goto free; + adj = TYPE(npg) == P_LBTREE ? P_INDX : O_INDX; + /* Find if the stopping point is on this page. */ + if (stop != NULL && stop->size != 0) { + if (dbc->dbtype == DB_RECNO) { + if ((ret = __ram_getno(dbc, stop, &recno, 0)) != 0) + goto err; + if (ncp->recno > recno) { + *donep = 1; + if (cp->recno > recno) + goto done; + } + } else { + func = TYPE(npg) == P_LBTREE ? + (dbp->dup_compare == NULL ? + __bam_defcmp : dbp->dup_compare) : t->bt_compare; + + if ((ret = __bam_cmp(dbp, dbc->txn, + stop, npg, nent - adj, func, &cmp)) != 0) + goto err; + + /* + * If the last record is beyond the stopping + * point we are done after this page. If the + * first record is beyond the stopping point + * don't even bother with this page. + */ + if (cmp <= 0) { + *donep = 1; + if ((ret = __bam_cmp(dbp, dbc->txn, + stop, npg, 0, func, &cmp)) != 0) + goto err; + if (cmp <= 0) + goto done; + } + } + } + + /* + * If there is too much data then just move records one at a time. + * Otherwise copy the data space over and fix up the index table. + * If we are on the left most child we will effect our parent's + * index entry so we call merge_records to figure out key sizes. + */ + if ((dbc->dbtype == DB_BTREE && + ncp->csp[-1].indx == 0 && ncp->csp[-1].entries != 1) || + (int)(P_FREESPACE(dbp, pg) - + ((dbp->pgsize - P_OVERHEAD(dbp)) - + P_FREESPACE(dbp, npg))) < (int)factor) + ret = __bam_merge_records(dbc, ndbc, factor, c_data); + else +free: ret = __bam_merge_pages(dbc, ndbc, c_data); + +done: +err: return (ret); +} + +static int +__bam_merge_records(dbc, ndbc, factor, c_data) + DBC *dbc, *ndbc; + u_int32_t factor; + DB_COMPACT *c_data; +{ + BINTERNAL *bi; + BKEYDATA *bk, *tmp_bk; + BTREE *t; + BTREE_CURSOR *cp, *ncp; + DB *dbp; + DBT a, b, data, hdr; + DB_ENV *dbenv; + EPG *epg; + PAGE *pg, *npg; + db_indx_t adj, indx, nent, *ninp, pind; + int32_t adjust; + u_int32_t freespace, nksize, pfree, size; + int first_dup, is_dup, next_dup, n_ok, ret; + size_t (*func) __P((DB *, const DBT *, const DBT *)); + + dbp = dbc->dbp; + dbenv = dbp->dbenv; + t = dbp->bt_internal; + cp = (BTREE_CURSOR *)dbc->internal; + ncp = (BTREE_CURSOR *)ndbc->internal; + pg = cp->csp->page; + npg = ncp->csp->page; + memset(&hdr, 0, sizeof(hdr)); + pind = NUM_ENT(pg); + n_ok = 0; + adjust = 0; + ret = 0; + nent = NUM_ENT(npg); + + DB_ASSERT(dbenv, nent != 0); + + /* See if we want to swap out this page. */ + if (c_data->compact_truncate != PGNO_INVALID && + PGNO(npg) > c_data->compact_truncate) { + /* Get a fresh low numbered page. */ + if ((ret = __bam_truncate_page(ndbc, &npg, 1)) != 0) + goto err; + } + + ninp = P_INP(dbp, npg); + + /* + * pg is the page that is being filled, it is in the stack in cp. + * npg is the next page, it is in the stack in ncp. + */ + freespace = P_FREESPACE(dbp, pg); + + adj = TYPE(npg) == P_LBTREE ? P_INDX : O_INDX; + /* + * Loop through the records and find the stopping point. + */ + for (indx = 0; indx < nent; indx += adj) { + bk = GET_BKEYDATA(dbp, npg, indx); + + /* Size of the key. */ + size = BITEM_PSIZE(bk); + + /* Size of the data. */ + if (TYPE(pg) == P_LBTREE) + size += BITEM_PSIZE(GET_BKEYDATA(dbp, npg, indx + 1)); + /* + * If we are at a duplicate set, skip ahead to see and + * get the total size for the group. + */ + n_ok = adj; + if (TYPE(pg) == P_LBTREE && + indx < nent - adj && + ninp[indx] == ninp[indx + adj]) { + do { + /* Size of index for key reference. */ + size += sizeof(db_indx_t); + n_ok++; + /* Size of data item. */ + size += BITEM_PSIZE( + GET_BKEYDATA(dbp, npg, indx + n_ok)); + n_ok++; + } while (indx + n_ok < nent && + ninp[indx] == ninp[indx + n_ok]); + } + /* if the next set will not fit on the page we are done. */ + if (freespace < size) + break; + + /* + * Otherwise figure out if we are past the goal and if + * adding this set will put us closer to the goal than + * we are now. + */ + if ((freespace - size) < factor) { + if (freespace - factor > factor - (freespace - size)) + indx += n_ok; + break; + } + freespace -= size; + indx += n_ok - adj; + } + if (indx == 0) + goto done; + if (TYPE(pg) != P_LBTREE && TYPE(pg) != P_LDUP) { + if (indx == nent) + return (__bam_merge_pages(dbc, ndbc, c_data)); + goto no_check; + } + /* + * We need to update npg's parent key. Avoid creating a new key + * that will be too big. Get what space will be available on the + * parents. Then if there will not be room for this key, see if + * prefix compression will make it work, if not backup till we + * find something that will. (Needless to say, this is a very + * unlikely event.) If we are deleting this page then we will + * need to propagate the next key to our grand parents, so we + * see if that will fit. + */ + pfree = dbp->pgsize; + for (epg = &ncp->csp[-1]; epg >= ncp->sp; epg--) + if ((freespace = P_FREESPACE(dbp, epg->page)) < pfree) { + bi = GET_BINTERNAL(dbp, epg->page, epg->indx); + /* Add back in the key we will be deleting. */ + freespace += BINTERNAL_PSIZE(bi->len); + if (freespace < pfree) + pfree = freespace; + if (epg->indx != 0) + break; + } + + /* + * If we are at the end, we will delete this page. We need to + * check the next parent key only if we are the leftmost page and + * will therefore have to propagate the key up the tree. + */ + if (indx == nent) { + if (ncp->csp[-1].indx != 0 || ncp->csp[-1].entries == 1 || + BINTERNAL_PSIZE(GET_BINTERNAL(dbp, + ncp->csp[-1].page, 1)->len) <= pfree) + return (__bam_merge_pages(dbc, ndbc, c_data)); + indx -= adj; + } + bk = GET_BKEYDATA(dbp, npg, indx); + if (indx != 0 && BINTERNAL_SIZE(bk->len) >= pfree) { + if (F_ISSET(dbc, DBC_OPD)) { + if (dbp->dup_compare == __bam_defcmp) + func = __bam_defpfx; + else + func = NULL; + } else + func = t->bt_prefix; + } else + func = NULL; + + /* Skip to the beginning of a duplicate set. */ + while (indx != 0 && ninp[indx] == ninp[indx - adj]) + indx -= adj; + + while (indx != 0 && BINTERNAL_SIZE(bk->len) >= pfree) { + if (B_TYPE(bk->type) != B_KEYDATA) + goto noprefix; + /* + * Figure out if we can truncate this key. + * Code borrowed from bt_split.c + */ + if (func == NULL) + goto noprefix; + tmp_bk = GET_BKEYDATA(dbp, npg, indx - adj); + if (B_TYPE(tmp_bk->type) != B_KEYDATA) + goto noprefix; + memset(&a, 0, sizeof(a)); + a.size = tmp_bk->len; + a.data = tmp_bk->data; + memset(&b, 0, sizeof(b)); + b.size = bk->len; + b.data = bk->data; + nksize = (u_int32_t)func(dbp, &a, &b); + if (BINTERNAL_PSIZE(nksize) < pfree) + break; +noprefix: + /* Skip to the beginning of a duplicate set. */ + do { + indx -= adj; + } while (indx != 0 && ninp[indx] == ninp[indx - adj]); + + bk = GET_BKEYDATA(dbp, npg, indx); + } + + if (indx == 0) + goto done; + DB_ASSERT(dbenv, indx <= nent); + + /* Loop through the records and move them from npg to pg. */ +no_check: is_dup = first_dup = next_dup = 0; + if ((ret = __memp_dirty(dbp->mpf, &cp->csp->page, dbc->txn, 0)) != 0 || + (ret = __memp_dirty(dbp->mpf, &ncp->csp->page, dbc->txn, 0)) != 0) + goto err; + pg = cp->csp->page; + npg = ncp->csp->page; + ninp = P_INP(dbp, npg); + do { + bk = GET_BKEYDATA(dbp, npg, 0); + /* Figure out if we are in a duplicate group or not. */ + if ((NUM_ENT(npg) % 2) == 0) { + if (NUM_ENT(npg) > 2 && ninp[0] == ninp[2]) { + if (!is_dup) { + first_dup = 1; + is_dup = 1; + } else + first_dup = 0; + + next_dup = 1; + } else if (next_dup) { + is_dup = 1; + first_dup = 0; + next_dup = 0; + } else + is_dup = 0; + } + + if (is_dup && !first_dup && (pind % 2) == 0) { + /* Duplicate key. */ + if ((ret = __bam_adjindx(dbc, + pg, pind, pind - P_INDX, 1)) != 0) + goto err; + if (!next_dup) + is_dup = 0; + } else switch (B_TYPE(bk->type)) { + case B_KEYDATA: + hdr.data = bk; + hdr.size = SSZA(BKEYDATA, data); + data.size = bk->len; + data.data = bk->data; + if ((ret = __db_pitem(dbc, pg, pind, + BKEYDATA_SIZE(bk->len), &hdr, &data)) != 0) + goto err; + break; + case B_OVERFLOW: + case B_DUPLICATE: + data.size = BOVERFLOW_SIZE; + data.data = bk; + if ((ret = __db_pitem(dbc, pg, pind, + BOVERFLOW_SIZE, &data, NULL)) != 0) + goto err; + break; + default: + __db_errx(dbenv, + "Unknown record format, page %lu, indx 0", + (u_long)PGNO(pg)); + ret = EINVAL; + goto err; + } + pind++; + if (next_dup && (NUM_ENT(npg) % 2) == 0) { + if ((ret = __bam_adjindx(ndbc, + npg, 0, O_INDX, 0)) != 0) + goto err; + } else { + if ((ret = __db_ditem(ndbc, + npg, 0, BITEM_SIZE(bk))) != 0) + goto err; + } + adjust++; + } while (--indx != 0); + + DB_ASSERT(dbenv, NUM_ENT(npg) != 0); + + if (adjust != 0 && + (F_ISSET(cp, C_RECNUM) || F_ISSET(dbc, DBC_OPD))) { + DB_ASSERT(dbenv, cp->csp - cp->sp == ncp->csp - ncp->sp); + if (TYPE(pg) == P_LBTREE) + adjust /= P_INDX; + if ((ret = __bam_adjust(ndbc, -adjust)) != 0) + goto err; + + if ((ret = __bam_adjust(dbc, adjust)) != 0) + goto err; + } + + /* Update parent with new key. */ + if (ndbc->dbtype == DB_BTREE && + (ret = __bam_pupdate(ndbc, pg)) != 0) + goto err; + +done: ret = __bam_stkrel(ndbc, STK_CLRDBC); + +err: return (ret); +} + +static int +__bam_merge_pages(dbc, ndbc, c_data) + DBC *dbc, *ndbc; + DB_COMPACT *c_data; +{ + BTREE_CURSOR *cp, *ncp; + DB *dbp; + DBT data, hdr, ind; + DB_MPOOLFILE *dbmp; + PAGE *pg, *npg; + db_indx_t nent, *ninp, *pinp; + db_pgno_t ppgno; + u_int8_t *bp; + u_int32_t len; + int i, level, ret; + + COMPQUIET(ppgno, PGNO_INVALID); + dbp = dbc->dbp; + dbmp = dbp->mpf; + cp = (BTREE_CURSOR *)dbc->internal; + ncp = (BTREE_CURSOR *)ndbc->internal; + pg = cp->csp->page; + npg = ncp->csp->page; + memset(&hdr, 0, sizeof(hdr)); + nent = NUM_ENT(npg); + + /* If the page is empty just throw it away. */ + if (nent == 0) + goto free; + + if ((ret = __memp_dirty(dbp->mpf, &cp->csp->page, dbc->txn, 0)) != 0 || + (ret = __memp_dirty(dbp->mpf, &ncp->csp->page, dbc->txn, 0)) != 0) + goto err; + pg = cp->csp->page; + npg = ncp->csp->page; + DB_ASSERT(dbp->dbenv, nent == NUM_ENT(npg)); + + /* Bulk copy the data to the new page. */ + len = dbp->pgsize - HOFFSET(npg); + if (DBC_LOGGING(dbc)) { + data.data = (u_int8_t *)npg + HOFFSET(npg); + data.size = len; + ind.data = P_INP(dbp, npg); + ind.size = NUM_ENT(npg) * sizeof(db_indx_t); + if ((ret = __bam_merge_log(dbp, + dbc->txn, &LSN(pg), 0, PGNO(pg), + &LSN(pg), PGNO(npg), &LSN(npg), NULL, &data, &ind)) != 0) + goto err; + } else + LSN_NOT_LOGGED(LSN(pg)); + LSN(npg) = LSN(pg); + bp = (u_int8_t *)pg + HOFFSET(pg) - len; + memcpy(bp, (u_int8_t *)npg + HOFFSET(npg), len); + + /* Copy index table offset by what was there already. */ + pinp = P_INP(dbp, pg) + NUM_ENT(pg); + ninp = P_INP(dbp, npg); + for (i = 0; i < NUM_ENT(npg); i++) + *pinp++ = *ninp++ - (dbp->pgsize - HOFFSET(pg)); + HOFFSET(pg) -= len; + NUM_ENT(pg) += i; + + NUM_ENT(npg) = 0; + HOFFSET(npg) += len; + + if (F_ISSET(cp, C_RECNUM) || F_ISSET(dbc, DBC_OPD)) { + DB_ASSERT(dbp->dbenv, cp->csp - cp->sp == ncp->csp - ncp->sp); + if (TYPE(pg) == P_LBTREE) + i /= P_INDX; + if ((ret = __bam_adjust(ndbc, -i)) != 0) + goto err; + + if ((ret = __bam_adjust(dbc, i)) != 0) + goto err; + } + +free: /* + * __bam_dpages may decide to collapse the tree. + * This can happen if we have the root and there + * are exactly 2 pointers left in it. + * If it can collapse the tree we must free the other + * stack since it will nolonger be valid. This + * must be done before hand because we cannot + * hold a page pinned if it might be truncated. + */ + if (PGNO(ncp->sp->page) == ncp->root && + NUM_ENT(ncp->sp->page) == 2) { + if ((ret = __bam_stkrel(dbc, STK_CLRDBC | STK_PGONLY)) != 0) + goto err; + level = LEVEL(ncp->sp->page); + ppgno = PGNO(ncp->csp[-1].page); + } else + level = 0; + if (c_data->compact_truncate > PGNO(npg)) + c_data->compact_truncate--; + if ((ret = __bam_dpages(ndbc, + 0, ndbc->dbtype == DB_RECNO ? 0 : 1)) != 0) + goto err; + npg = NULL; + c_data->compact_pages_free++; + c_data->compact_pages--; + if (level != 0) { + if ((ret = __memp_fget(dbmp, &ncp->root, dbc->txn, + 0, &npg)) != 0) + goto err; + if (level == LEVEL(npg)) + level = 0; + if ((ret = __memp_fput(dbmp, npg, 0)) != 0) + goto err; + npg = NULL; + if (level != 0) { + c_data->compact_levels++; + c_data->compact_pages_free++; + if (c_data->compact_truncate > ppgno) + c_data->compact_truncate--; + if (c_data->compact_pages != 0) + c_data->compact_pages--; + } + } + +err: return (ret); +} + +/* + * __bam_merge_internal -- + * Merge internal nodes of the tree. + */ +static int +__bam_merge_internal(dbc, ndbc, level, c_data, merged) + DBC *dbc, *ndbc; + int level; + DB_COMPACT *c_data; + int *merged; +{ + BINTERNAL bi, *bip, *fip; + BTREE_CURSOR *cp, *ncp; + DB *dbp; + DBT data, hdr; + DB_MPOOLFILE *dbmp; + EPG *epg, *save_csp, *nsave_csp; + PAGE *pg, *npg; + RINTERNAL *rk; + db_indx_t indx, pind; + db_pgno_t ppgno; + int32_t trecs; + u_int16_t size; + u_int32_t freespace, pfree; + int ret; + + COMPQUIET(bip, NULL); + COMPQUIET(ppgno, PGNO_INVALID); + + /* + * ndbc will contain the the dominating parent of the subtree. + * dbc will have the tree containing the left child. + * + * The stacks descend to the leaf level. + * If this is a recno tree then both stacks will start at the root. + */ + dbp = dbc->dbp; + dbmp = dbp->mpf; + cp = (BTREE_CURSOR *)dbc->internal; + ncp = (BTREE_CURSOR *)ndbc->internal; + *merged = 0; + ret = 0; + + /* + * Set the stacks to the level requested. + * Save the old value to restore when we exit. + */ + save_csp = cp->csp; + cp->csp = &cp->csp[-level + 1]; + pg = cp->csp->page; + pind = NUM_ENT(pg); + + nsave_csp = ncp->csp; + ncp->csp = &ncp->csp[-level + 1]; + npg = ncp->csp->page; + indx = NUM_ENT(npg); + + /* + * The caller may have two stacks that include common ancestors, we + * check here for convenience. + */ + if (npg == pg) + goto done; + + if ((ret = __memp_dirty(dbmp, &cp->csp->page, dbc->txn, 0)) != 0 || + (ret = __memp_dirty(dbmp, &ncp->csp->page, dbc->txn, 0)) != 0) + goto err; + pg = cp->csp->page; + npg = ncp->csp->page; + + if (TYPE(pg) == P_IBTREE) { + /* + * Check for overflow keys on both pages while we have + * them locked. + */ + if ((ret = + __bam_truncate_internal_overflow(dbc, pg, c_data)) != 0) + goto err; + if ((ret = + __bam_truncate_internal_overflow(dbc, npg, c_data)) != 0) + goto err; + } + + /* + * If we are about to move data off the left most page of an + * internal node we will need to update its parents, make sure there + * will be room for the new key on all the parents in the stack. + * If not, move less data. + */ + fip = NULL; + if (TYPE(pg) == P_IBTREE) { + /* See where we run out of space. */ + freespace = P_FREESPACE(dbp, pg); + /* + * The leftmost key of an internal page is not accurate. + * Go up the tree to find a non-leftmost parent. + */ + epg = ncp->csp; + while (--epg >= ncp->sp && epg->indx == 0) + continue; + fip = bip = GET_BINTERNAL(dbp, epg->page, epg->indx); + epg = ncp->csp; + + for (indx = 0;;) { + size = BINTERNAL_PSIZE(bip->len); + if (size > freespace) + break; + freespace -= size; + if (++indx >= NUM_ENT(npg)) + break; + bip = GET_BINTERNAL(dbp, npg, indx); + } + + /* See if we are deleting the page and we are not left most. */ + if (indx == NUM_ENT(npg) && epg[-1].indx != 0) + goto fits; + + pfree = dbp->pgsize; + for (epg--; epg >= ncp->sp; epg--) + if ((freespace = P_FREESPACE(dbp, epg->page)) < pfree) { + bip = GET_BINTERNAL(dbp, epg->page, epg->indx); + /* Add back in the key we will be deleting. */ + freespace += BINTERNAL_PSIZE(bip->len); + if (freespace < pfree) + pfree = freespace; + if (epg->indx != 0) + break; + } + epg = ncp->csp; + + /* If we are at the end of the page we will delete it. */ + if (indx == NUM_ENT(npg)) { + if (NUM_ENT(epg[-1].page) == 1) + goto fits; + bip = + GET_BINTERNAL(dbp, epg[-1].page, epg[-1].indx + 1); + } else + bip = GET_BINTERNAL(dbp, npg, indx); + + /* Back up until we have a key that fits. */ + while (indx != 0 && BINTERNAL_PSIZE(bip->len) > pfree) { + indx--; + bip = GET_BINTERNAL(dbp, npg, indx); + } + if (indx == 0) + goto done; + } + +fits: memset(&bi, 0, sizeof(bi)); + memset(&hdr, 0, sizeof(hdr)); + memset(&data, 0, sizeof(data)); + trecs = 0; + + /* + * Copy data between internal nodes till one is full + * or the other is empty. + */ + do { + if (dbc->dbtype == DB_BTREE) { + bip = GET_BINTERNAL(dbp, npg, 0); + size = fip == NULL ? + BINTERNAL_SIZE(bip->len) : + BINTERNAL_SIZE(fip->len); + if (P_FREESPACE(dbp, pg) < size + sizeof(db_indx_t)) + break; + + if (fip == NULL) { + data.size = bip->len; + data.data = bip->data; + } else { + data.size = fip->len; + data.data = fip->data; + } + bi.len = data.size; + B_TSET(bi.type, bip->type); + bi.pgno = bip->pgno; + bi.nrecs = bip->nrecs; + hdr.data = &bi; + hdr.size = SSZA(BINTERNAL, data); + if (F_ISSET(cp, C_RECNUM) || F_ISSET(dbc, DBC_OPD)) + trecs += (int32_t)bip->nrecs; + } else { + rk = GET_RINTERNAL(dbp, npg, 0); + size = RINTERNAL_SIZE; + if (P_FREESPACE(dbp, pg) < size + sizeof(db_indx_t)) + break; + + hdr.data = rk; + hdr.size = size; + trecs += (int32_t)rk->nrecs; + } + if ((ret = __db_pitem(dbc, pg, pind, size, &hdr, &data)) != 0) + goto err; + pind++; + if (fip != NULL) { + /* reset size to be for the record being deleted. */ + size = BINTERNAL_SIZE(bip->len); + fip = NULL; + } + if ((ret = __db_ditem(ndbc, npg, 0, size)) != 0) + goto err; + *merged = 1; + } while (--indx != 0); + + if (c_data->compact_truncate != PGNO_INVALID && + PGNO(pg) > c_data->compact_truncate && cp->csp != cp->sp) { + if ((ret = __bam_truncate_page(dbc, &pg, 1)) != 0) + goto err; + } + + if (NUM_ENT(npg) != 0 && c_data->compact_truncate != PGNO_INVALID && + PGNO(npg) > c_data->compact_truncate && ncp->csp != ncp->sp) { + if ((ret = __bam_truncate_page(ndbc, &npg, 1)) != 0) + goto err; + } + + if (!*merged) + goto done; + + if (trecs != 0) { + DB_ASSERT(dbp->dbenv, cp->csp - cp->sp == ncp->csp - ncp->sp); + cp->csp--; + if ((ret = __bam_adjust(dbc, trecs)) != 0) + goto err; + + ncp->csp--; + if ((ret = __bam_adjust(ndbc, -trecs)) != 0) + goto err; + ncp->csp++; + } + cp->csp = save_csp; + + /* + * Either we emptied the page or we need to update its + * parent to reflect the first page we now point to. + * First get rid of the bottom of the stack, + * bam_dpages will clear the stack. We can drop + * the locks on those pages as we have not done + * anything to them. + */ + do { + if ((ret = __memp_fput(dbmp, nsave_csp->page, 0)) != 0) + goto err; + if ((ret = __LPUT(dbc, nsave_csp->lock)) != 0) + goto err; + nsave_csp--; + } while (nsave_csp != ncp->csp); + + if (NUM_ENT(npg) == 0) { + /* + * __bam_dpages may decide to collapse the tree + * so we need to free our other stack. The tree + * will change in hight and our stack will nolonger + * be valid. + */ + if (PGNO(ncp->sp->page) == ncp->root && + NUM_ENT(ncp->sp->page) == 2) { + if ((ret = __bam_stkrel(dbc, STK_CLRDBC)) != 0) + goto err; + level = LEVEL(ncp->sp->page); + ppgno = PGNO(ncp->csp[-1].page); + } else + level = 0; + + if (c_data->compact_truncate > PGNO(npg)) + c_data->compact_truncate--; + ret = __bam_dpages(ndbc, + 0, ndbc->dbtype == DB_RECNO ? 0 : 1); + c_data->compact_pages_free++; + if (ret == 0 && level != 0) { + if ((ret = __memp_fget(dbmp, &ncp->root, dbc->txn, + 0, &npg)) != 0) + goto err; + if (level == LEVEL(npg)) + level = 0; + if ((ret = __memp_fput(dbmp, npg, 0)) != 0) + goto err; + npg = NULL; + if (level != 0) { + c_data->compact_levels++; + c_data->compact_pages_free++; + if (c_data->compact_truncate > ppgno) + c_data->compact_truncate--; + if (c_data->compact_pages != 0) + c_data->compact_pages--; + } + } + } else + ret = __bam_pupdate(ndbc, npg); + return (ret); + +done: +err: cp->csp = save_csp; + ncp->csp = nsave_csp; + + return (ret); +} + +/* + * __bam_compact_dups -- try to compress off page dup trees. + * We may or may not have a write lock on this page. + */ +static int +__bam_compact_dups(dbc, ppg, factor, have_lock, c_data, donep) + DBC *dbc; + PAGE **ppg; + u_int32_t factor; + int have_lock; + DB_COMPACT *c_data; + int *donep; +{ + BOVERFLOW *bo; + BTREE_CURSOR *cp; + DB *dbp; + DBC *opd; + DBT start; + DB_ENV *dbenv; + DB_MPOOLFILE *dbmp; + PAGE *dpg, *pg; + db_indx_t i; + int done, level, ret, span, t_ret; + + span = 0; + ret = 0; + opd = NULL; + + dbp = dbc->dbp; + dbenv = dbp->dbenv; + dbmp = dbp->mpf; + cp = (BTREE_CURSOR *)dbc->internal; + pg = *ppg; + + for (i = 0; i < NUM_ENT(pg); i++) { + bo = GET_BOVERFLOW(dbp, pg, i); + if (B_TYPE(bo->type) == B_KEYDATA) + continue; + c_data->compact_pages_examine++; + if (bo->pgno > c_data->compact_truncate) { + (*donep)++; + if (!have_lock) { + if ((ret = __db_lget(dbc, 0, PGNO(pg), + DB_LOCK_WRITE, 0, &cp->csp->lock)) != 0) + goto err; + have_lock = 1; + if ((ret = __memp_dirty(dbp->mpf, ppg, + dbc->txn, 0)) != 0) + goto err; + pg = *ppg; + } + if ((ret = + __bam_truncate_root_page(dbc, pg, i, c_data)) != 0) + goto err; + /* Just in case it should move. Could it? */ + bo = GET_BOVERFLOW(dbp, pg, i); + } + + if (B_TYPE(bo->type) == B_OVERFLOW) { + if ((ret = __bam_truncate_overflow(dbc, bo->pgno, + have_lock ? PGNO_INVALID : PGNO(pg), c_data)) != 0) + goto err; + (*donep)++; + continue; + } + /* + * Take a peek at the root. If it's a leaf then + * there is no tree here, avoid all the trouble. + */ + if ((ret = __memp_fget(dbmp, &bo->pgno, dbc->txn, + 0, &dpg)) != 0) + goto err; + + level = dpg->level; + if ((ret = __memp_fput(dbmp, dpg, 0)) != 0) + goto err; + if (level == LEAFLEVEL) + continue; + if ((ret = __db_c_newopd(dbc, bo->pgno, NULL, &opd)) != 0) + return (ret); + if (!have_lock) { + if ((ret = __db_lget(dbc, 0, + PGNO(pg), DB_LOCK_WRITE, 0, &cp->csp->lock)) != 0) + goto err; + have_lock = 1; + if ((ret = __memp_dirty(dbp->mpf, ppg, + dbc->txn, 0)) != 0) + goto err; + pg = *ppg; + } + (*donep)++; + memset(&start, 0, sizeof(start)); + do { + if ((ret = __bam_compact_int(opd, &start, + NULL, factor, &span, c_data, &done)) != 0) + break; + } while (!done); + + if (start.data != NULL) + __os_free(dbenv, start.data); + + if (ret != 0) + goto err; + + ret = __db_c_close(opd); + opd = NULL; + if (ret != 0) + goto err; + } + +err: if (opd != NULL && (t_ret = __db_c_close(opd)) != 0 && ret == 0) + ret = t_ret; + return (ret); +} + +/* + * __bam_truncate_page -- swap a page with a lower numbered page. + * The cusor has a stack which includes at least the + * immediate parent of this page. + */ +static int +__bam_truncate_page(dbc, pgp, update_parent) + DBC *dbc; + PAGE **pgp; + int update_parent; +{ + BTREE_CURSOR *cp; + DB *dbp; + DBT data, hdr, ind; + DB_LSN lsn; + EPG *epg; + PAGE *newpage; + db_pgno_t newpgno, *pgnop; + int ret; + + dbp = dbc->dbp; + + /* + * We want to free a page that lives in the part of the file that + * can be truncated, so we're going to move it onto a free page + * that is in the part of the file that need not be truncated. + * Since the freelist is ordered now, we can simply call __db_new + * which will grab the first element off the freelist; we know this + * is the lowest numbered free page. + */ + if ((ret = __db_new(dbc, P_DONTEXTEND | TYPE(*pgp), &newpage)) != 0) + return (ret); + + /* + * If newpage is null then __db_new would have had to allocate + * a new page from the filesystem, so there is no reason + * to continue this action. + */ + if (newpage == NULL) + return (0); + + /* + * It is possible that a higher page is allocated if other threads + * are allocating at the same time, if so, just put it back. + */ + if (PGNO(newpage) > PGNO(*pgp)) { + /* Its unfortunate but you can't just free a new overflow. */ + if (TYPE(newpage) == P_OVERFLOW) + OV_LEN(newpage) = 0; + return (__db_free(dbc, newpage)); + } + + if ((ret = __memp_dirty(dbp->mpf, &newpage, dbc->txn, 0)) != 0) + goto err; + + /* Log if necessary. */ + if (DBC_LOGGING(dbc)) { + hdr.data = *pgp; + hdr.size = P_OVERHEAD(dbp); + if (TYPE(*pgp) == P_OVERFLOW) { + data.data = (u_int8_t *)*pgp + P_OVERHEAD(dbp); + data.size = OV_LEN(*pgp); + ind.size = 0; + } else { + data.data = (u_int8_t *)*pgp + HOFFSET(*pgp); + data.size = dbp->pgsize - HOFFSET(*pgp); + ind.data = P_INP(dbp, *pgp); + ind.size = NUM_ENT(*pgp) * sizeof(db_indx_t); + } + if ((ret = __bam_merge_log(dbp, dbc->txn, + &LSN(newpage), 0, PGNO(newpage), &LSN(newpage), + PGNO(*pgp), &LSN(*pgp), &hdr, &data, &ind)) != 0) + goto err; + } else + LSN_NOT_LOGGED(LSN(newpage)); + + newpgno = PGNO(newpage); + lsn = LSN(newpage); + memcpy(newpage, *pgp, dbp->pgsize); + PGNO(newpage) = newpgno; + LSN(newpage) = lsn; + + /* Empty the old page. */ + if ((ret = __memp_dirty(dbp->mpf, pgp, dbc->txn, 0)) != 0) + goto err; + if (TYPE(*pgp) == P_OVERFLOW) + OV_LEN(*pgp) = 0; + else { + HOFFSET(*pgp) = dbp->pgsize; + NUM_ENT(*pgp) = 0; + } + LSN(*pgp) = lsn; + + /* Update siblings. */ + switch (TYPE(newpage)) { + case P_OVERFLOW: + case P_LBTREE: + case P_LRECNO: + case P_LDUP: + if (NEXT_PGNO(newpage) == PGNO_INVALID && + PREV_PGNO(newpage) == PGNO_INVALID) + break; + if ((ret = __bam_relink(dbc, *pgp, PGNO(newpage))) != 0) + goto err; + break; + default: + break; + } + cp = (BTREE_CURSOR*)dbc->internal; + + /* + * Now, if we free this page, it will get truncated, when we free + * all the pages after it in the file. + */ + ret = __db_free(dbc, *pgp); + /* db_free always puts the page. */ + *pgp = newpage; + + if (ret != 0) + return (ret); + + if (!update_parent) + goto done; + + /* Update the parent. */ + epg = &cp->csp[-1]; + if ((ret = __memp_dirty(dbp->mpf, &epg->page, dbc->txn, 0)) != 0) + return (ret); + + switch (TYPE(epg->page)) { + case P_IBTREE: + pgnop = &GET_BINTERNAL(dbp, epg->page, epg->indx)->pgno; + break; + case P_IRECNO: + pgnop = &GET_RINTERNAL(dbp, epg->page, epg->indx)->pgno; + break; + default: + pgnop = &GET_BOVERFLOW(dbp, epg->page, epg->indx)->pgno; + break; + } + if (DBC_LOGGING(dbc)) { + if ((ret = __bam_pgno_log(dbp, dbc->txn, &LSN(epg->page), + 0, PGNO(epg->page), &LSN(epg->page), (u_int32_t)epg->indx, + *pgnop, PGNO(newpage))) != 0) + return (ret); + } else + LSN_NOT_LOGGED(LSN(epg->page)); + + *pgnop = PGNO(newpage); + cp->csp->page = newpage; + +done: return (0); + +err: (void)__memp_fput(dbp->mpf, newpage, 0); + return (ret); +} + +/* + * __bam_truncate_overflow -- find overflow pages to truncate. + * Walk the pages of an overflow chain and swap out + * high numbered pages. We are passed the first page + * but only deal with the second and subsequent pages. + */ + +static int +__bam_truncate_overflow(dbc, pgno, pg_lock, c_data) + DBC *dbc; + db_pgno_t pgno; + db_pgno_t pg_lock; + DB_COMPACT *c_data; +{ + DB *dbp; + DB_LOCK lock; + PAGE *page; + int ret, t_ret; + + dbp = dbc->dbp; + page = NULL; + LOCK_INIT(lock); + + if ((ret = __memp_fget(dbp->mpf, &pgno, dbc->txn, 0, &page)) != 0) + return (ret); + + while ((pgno = NEXT_PGNO(page)) != PGNO_INVALID) { + if ((ret = __memp_fput(dbp->mpf, page, 0)) != 0) + return (ret); + if ((ret = __memp_fget(dbp->mpf, &pgno, dbc->txn, + 0, &page)) != 0) + return (ret); + if (pgno <= c_data->compact_truncate) + continue; + if (pg_lock != PGNO_INVALID) { + if ((ret = __db_lget(dbc, + 0, pg_lock, DB_LOCK_WRITE, 0, &lock)) != 0) + break; + pg_lock = PGNO_INVALID; + } + if ((ret = __bam_truncate_page(dbc, &page, 0)) != 0) + break; + } + + if (page != NULL && + (t_ret = __memp_fput(dbp->mpf, page, 0)) != 0 && ret == 0) + ret = t_ret; + if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0) + ret = t_ret; + return (ret); +} + +/* + * __bam_truncate_root_page -- swap a page which is + * the root of an off page dup tree or the head of an overflow. + * The page is reference by the pg/indx passed in. + */ +static int +__bam_truncate_root_page(dbc, pg, indx, c_data) + DBC *dbc; + PAGE *pg; + u_int32_t indx; + DB_COMPACT *c_data; +{ + BINTERNAL *bi; + BOVERFLOW *bo; + DB *dbp; + DBT orig; + PAGE *page; + db_pgno_t newpgno, *pgnop; + int ret, t_ret; + + COMPQUIET(c_data, NULL); + COMPQUIET(bo, NULL); + COMPQUIET(newpgno, PGNO_INVALID); + dbp = dbc->dbp; + page = NULL; + if (TYPE(pg) == P_IBTREE) { + bi = GET_BINTERNAL(dbp, pg, indx); + if (B_TYPE(bi->type) == B_OVERFLOW) { + bo = (BOVERFLOW *)(bi->data); + pgnop = &bo->pgno; + } else + pgnop = &bi->pgno; + } else { + bo = GET_BOVERFLOW(dbp, pg, indx); + pgnop = &bo->pgno; + } + + DB_ASSERT(dbp->dbenv, IS_DIRTY(pg)); + + if ((ret = __memp_fget(dbp->mpf, pgnop, dbc->txn, 0, &page)) != 0) + goto err; + + /* + * If this is a multiply reference overflow key, then we will just + * copy it and decrement the reference count. This is part of a + * fix to get rid of multiple references. + */ + if (TYPE(page) == P_OVERFLOW && OV_REF(page) > 1) { + if ((ret = __db_ovref(dbc, bo->pgno)) != 0) + goto err; + memset(&orig, 0, sizeof(orig)); + if ((ret = __db_goff(dbp, dbc->txn, &orig, + bo->tlen, bo->pgno, &orig.data, &orig.size)) == 0) + ret = __db_poff(dbc, &orig, &newpgno); + if (orig.data != NULL) + __os_free(dbp->dbenv, orig.data); + if (ret != 0) + goto err; + } else { + if ((ret = __bam_truncate_page(dbc, &page, 0)) != 0) + goto err; + newpgno = PGNO(page); + /* If we could not allocate from the free list, give up.*/ + if (newpgno == *pgnop) + goto err; + } + + /* Update the reference. */ + if (DBC_LOGGING(dbc)) { + if ((ret = __bam_pgno_log(dbp, + dbc->txn, &LSN(pg), 0, PGNO(pg), + &LSN(pg), (u_int32_t)indx, *pgnop, newpgno)) != 0) + goto err; + } else + LSN_NOT_LOGGED(LSN(pg)); + + *pgnop = newpgno; + +err: if (page != NULL && (t_ret = + __memp_fput(dbp->mpf, page, 0)) != 0 && ret == 0) + ret = t_ret; + return (ret); +} + +/* + * -- bam_truncate_internal_overflow -- find overflow keys + * on internal pages and if they have high page + * numbers swap them with lower pages and truncate them. + * Note that if there are overflow keys in the internal + * nodes they will get copied adding pages to the database. + */ +static int +__bam_truncate_internal_overflow(dbc, page, c_data) + DBC *dbc; + PAGE *page; + DB_COMPACT *c_data; +{ + BINTERNAL *bi; + BOVERFLOW *bo; + db_indx_t indx; + int ret; + + COMPQUIET(bo, NULL); + ret = 0; + for (indx = 0; indx < NUM_ENT(page); indx++) { + bi = GET_BINTERNAL(dbc->dbp, page, indx); + if (B_TYPE(bi->type) != B_OVERFLOW) + continue; + bo = (BOVERFLOW *)(bi->data); + if (bo->pgno > c_data->compact_truncate && (ret = + __bam_truncate_root_page(dbc, page, indx, c_data)) != 0) + break; + if ((ret = __bam_truncate_overflow( + dbc, bo->pgno, PGNO_INVALID, c_data)) != 0) + break; + } + return (ret); +} + +#ifdef HAVE_FTRUNCATE +/* + * __bam_savekey -- save the key from an internal page. + * We need to save information so that we can + * fetch then next internal node of the tree. This means + * we need the btree key on this current page, or the + * next record number. + */ +static int +__bam_savekey(dbc, next, start) + DBC *dbc; + int next; + DBT *start; +{ + BINTERNAL *bi; + BOVERFLOW *bo; + BTREE_CURSOR *cp; + DB *dbp; + DB_ENV *dbenv; + PAGE *pg; + RINTERNAL *ri; + db_indx_t indx, top; + + dbp = dbc->dbp; + dbenv = dbp->dbenv; + cp = (BTREE_CURSOR *)dbc->internal; + pg = cp->csp->page; + + if (dbc->dbtype == DB_RECNO) { + if (next) + for (indx = 0, top = NUM_ENT(pg); indx != top; indx++) { + ri = GET_RINTERNAL(dbp, pg, indx); + cp->recno += ri->nrecs; + } + return (__db_retcopy(dbenv, start, &cp->recno, + sizeof(cp->recno), &start->data, &start->ulen)); + + } + bi = GET_BINTERNAL(dbp, pg, NUM_ENT(pg) - 1); + if (B_TYPE(bi->type) == B_OVERFLOW) { + bo = (BOVERFLOW *)(bi->data); + return (__db_goff(dbp, dbc->txn, start, + bo->tlen, bo->pgno, &start->data, &start->ulen)); + } + return (__db_retcopy(dbenv, + start, bi->data, bi->len, &start->data, &start->ulen)); +} + +/* + * bam_truncate_internal -- + * Find high numbered pages in the internal nodes of a tree and + * swap them. + */ +static int +__bam_truncate_internal(dbp, txn, c_data) + DB *dbp; + DB_TXN *txn; + DB_COMPACT *c_data; +{ + BTREE_CURSOR *cp; + DBC *dbc; + DBT start; + PAGE *pg; + db_pgno_t pgno; + u_int32_t sflag; + int level, local_txn, ret, t_ret; + + dbc = NULL; + memset(&start, 0, sizeof(start)); + + if (IS_DB_AUTO_COMMIT(dbp, txn)) { + local_txn = 1; + txn = NULL; + } else + local_txn = 0; + + level = LEAFLEVEL + 1; + sflag = CS_READ | CS_GETRECNO; + +new_txn: + if (local_txn && (ret = __txn_begin(dbp->dbenv, NULL, &txn, 0)) != 0) + goto err; + + if ((ret = __db_cursor(dbp, txn, &dbc, 0)) != 0) + goto err; + cp = (BTREE_CURSOR *)dbc->internal; + + pgno = PGNO_INVALID; + do { + if ((ret = __bam_csearch(dbc, &start, sflag, level)) != 0) { + /* No more at this level, go up one. */ + if (ret == DB_NOTFOUND) { + level++; + if (start.data != NULL) + __os_free(dbp->dbenv, start.data); + memset(&start, 0, sizeof(start)); + sflag = CS_READ | CS_GETRECNO; + continue; + } + goto err; + } + c_data->compact_pages_examine++; + + pg = cp->csp->page; + pgno = PGNO(pg); + + sflag = CS_NEXT | CS_GETRECNO; + /* Grab info about the page and drop the stack. */ + if (pgno != cp->root && (ret = __bam_savekey(dbc, + pgno <= c_data->compact_truncate, &start)) != 0) + goto err; + + if ((ret = __bam_stkrel(dbc, STK_NOLOCK)) != 0) + goto err; + if (pgno == cp->root) + break; + + if (pgno <= c_data->compact_truncate) + continue; + + /* Reget the page with a write lock, and its parent too. */ + if ((ret = __bam_csearch(dbc, + &start, CS_PARENT | CS_GETRECNO, level)) != 0) + goto err; + pg = cp->csp->page; + pgno = PGNO(pg); + + if (pgno > c_data->compact_truncate) { + if ((ret = __bam_truncate_page(dbc, &pg, 1)) != 0) + goto err; + } + if ((ret = __bam_stkrel(dbc, + pgno > c_data->compact_truncate ? 0 : STK_NOLOCK)) != 0) + goto err; + + /* We are locking subtrees, so drop the write locks asap. */ + if (local_txn && pgno > c_data->compact_truncate) + break; + } while (pgno != cp->root); + + if ((ret = __db_c_close(dbc)) != 0) + goto err; + dbc = NULL; + if (local_txn) { + if ((ret = __txn_commit(txn, DB_TXN_NOSYNC)) != 0) + goto err; + txn = NULL; + } + if (pgno != ((BTREE *)dbp->bt_internal)->bt_root) + goto new_txn; + +err: if (dbc != NULL && (t_ret = __bam_stkrel(dbc, 0)) != 0 && ret == 0) + ret = t_ret; + if (dbc != NULL && (t_ret = __db_c_close(dbc)) != 0 && ret == 0) + ret = t_ret; + if (local_txn && + txn != NULL && (t_ret = __txn_abort(txn)) != 0 && ret == 0) + ret = t_ret; + if (start.data != NULL) + __os_free(dbp->dbenv, start.data); + return (ret); +} + +static int +__bam_setup_freelist(dbp, list, nelems) + DB *dbp; + struct pglist *list; + u_int32_t nelems; +{ + DB_MPOOLFILE *mpf; + db_pgno_t *plist; + int ret; + + mpf = dbp->mpf; + + if ((ret = __memp_alloc_freelist(mpf, nelems, &plist)) != 0) + return (ret); + + while (nelems-- != 0) + *plist++ = list++->pgno; + + return (0); +} + +static int +__bam_free_freelist(dbp, txn) + DB *dbp; + DB_TXN *txn; +{ + DBC *dbc; + DB_LOCK lock; + int ret, t_ret; + + LOCK_INIT(lock); + ret = 0; + + /* + * If we are not in a transaction then we need to get + * a lock on the meta page, otherwise we should already + * have the lock. + */ + + dbc = NULL; + if (IS_DB_AUTO_COMMIT(dbp, txn)) { + /* Get a cursor so we can call __db_lget. */ + if ((ret = __db_cursor(dbp, NULL, &dbc, 0)) != 0) + return (ret); + + if ((ret = __db_lget(dbc, + 0, PGNO_BASE_MD, DB_LOCK_WRITE, 0, &lock)) != 0) + goto err; + } + + ret = __memp_free_freelist(dbp->mpf); + +err: if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0) + ret = t_ret; + + if (dbc != NULL && (t_ret = __db_c_close(dbc)) != 0 && ret == 0) + ret = t_ret; + + return (ret); +} +#endif diff --git a/db/btree/bt_compare.c b/db/btree/bt_compare.c index 81ffe098b..17950a664 100644 --- a/db/btree/bt_compare.c +++ b/db/btree/bt_compare.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 @@ -39,15 +39,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bt_compare.c,v 11.20 2004/02/21 15:54:44 bostic Exp $ + * $Id: bt_compare.c,v 12.7 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/btree.h" @@ -56,12 +52,13 @@ * __bam_cmp -- * Compare a key to a given record. * - * PUBLIC: int __bam_cmp __P((DB *, const DBT *, PAGE *, - * PUBLIC: u_int32_t, int (*)(DB *, const DBT *, const DBT *), int *)); + * PUBLIC: int __bam_cmp __P((DB *, DB_TXN *, const DBT *, PAGE *, u_int32_t, + * PUBLIC: int (*)(DB *, const DBT *, const DBT *), int *)); */ int -__bam_cmp(dbp, dbt, h, indx, func, cmpp) +__bam_cmp(dbp, txn, dbt, h, indx, func, cmpp) DB *dbp; + DB_TXN *txn; const DBT *dbt; PAGE *h; u_int32_t indx; @@ -82,9 +79,9 @@ __bam_cmp(dbp, dbt, h, indx, func, cmpp) * !!! * We do not clear the pg_dbt DBT even though it's likely to contain * random bits. That should be okay, because the app's comparison - * routine had better not be looking at fields other than data/size. - * We don't clear it because we go through this path a lot and it's - * expensive. + * routine had better not be looking at fields other than data, size + * and app_data. We don't clear it because we go through this path a + * lot and it's expensive. */ switch (TYPE(h)) { case P_LBTREE: @@ -94,6 +91,7 @@ __bam_cmp(dbp, dbt, h, indx, func, cmpp) if (B_TYPE(bk->type) == B_OVERFLOW) bo = (BOVERFLOW *)bk; else { + pg_dbt.app_data = NULL; pg_dbt.data = bk->data; pg_dbt.size = bk->len; *cmpp = func(dbp, dbt, &pg_dbt); @@ -127,6 +125,7 @@ __bam_cmp(dbp, dbt, h, indx, func, cmpp) if (B_TYPE(bi->type) == B_OVERFLOW) bo = (BOVERFLOW *)(bi->data); else { + pg_dbt.app_data = NULL; pg_dbt.data = bi->data; pg_dbt.size = bi->len; *cmpp = func(dbp, dbt, &pg_dbt); @@ -140,7 +139,7 @@ __bam_cmp(dbp, dbt, h, indx, func, cmpp) /* * Overflow. */ - return (__db_moff(dbp, dbt, + return (__db_moff(dbp, txn, dbt, bo->pgno, bo->tlen, func == __bam_defcmp ? NULL : func, cmpp)); } diff --git a/db/btree/bt_conv.c b/db/btree/bt_conv.c index 39a9d8253..04de0688c 100644 --- a/db/btree/bt_conv.c +++ b/db/btree/bt_conv.c @@ -1,18 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_conv.c,v 11.15 2004/01/28 03:35:48 bostic Exp $ + * $Id: bt_conv.c,v 12.5 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/db_swap.h" @@ -88,7 +84,7 @@ __bam_mswap(pg) p = (u_int8_t *)pg + sizeof(DBMETA); - SWAP32(p); /* maxkey */ + p += sizeof(u_int32_t); /* unused */ SWAP32(p); /* minkey */ SWAP32(p); /* re_len */ SWAP32(p); /* re_pad */ diff --git a/db/btree/bt_curadj.c b/db/btree/bt_curadj.c index 477f00b8f..950d2bfac 100644 --- a/db/btree/bt_curadj.c +++ b/db/btree/bt_curadj.c @@ -1,21 +1,18 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_curadj.c,v 11.37 2004/03/13 14:11:33 bostic Exp $ + * $Id: bt_curadj.c,v 12.11 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/btree.h" +#include "dbinc/mp.h" static int __bam_opd_cursor __P((DB *, DBC *, db_pgno_t, u_int32_t, u_int32_t)); @@ -35,14 +32,14 @@ static int __bam_opd_cursor __P((DB *, DBC *, db_pgno_t, u_int32_t, u_int32_t)); * Update the cursors when items are deleted and when already deleted * items are overwritten. Return the number of relevant cursors found. * - * PUBLIC: int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int)); + * PUBLIC: int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int, int *)); */ int -__bam_ca_delete(dbp, pgno, indx, delete) +__bam_ca_delete(dbp, pgno, indx, delete, countp) DB *dbp; db_pgno_t pgno; u_int32_t indx; - int delete; + int delete, *countp; { BTREE_CURSOR *cp; DB *ldbp; @@ -63,15 +60,16 @@ __bam_ca_delete(dbp, pgno, indx, delete) * Each cursor is single-threaded, so we only need to lock the * list of DBs and then the list of cursors in each DB. */ - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); - for (count = 0, ldbp = __dblist_get(dbenv, dbp->adj_fileid); + MUTEX_LOCK(dbenv, dbenv->mtx_dblist); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (count = 0; ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { - MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { + MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) { cp = (BTREE_CURSOR *)dbc->internal; - if (cp->pgno == pgno && cp->indx == indx) { + if (cp->pgno == pgno && cp->indx == indx && + !MVCC_SKIP_CURADJ(dbc, pgno)) { /* * [#8032] This assert is checking * for possible race conditions where we @@ -82,7 +80,7 @@ __bam_ca_delete(dbp, pgno, indx, delete) * be a problem, but this assert should * be re-activated when the Btree stack * code is re-written. - DB_ASSERT(!STD_LOCKING(dbc) || + DB_ASSERT(dbenv, !STD_LOCKING(dbc) || cp->lock_mode != DB_LOCK_NG); */ if (delete) @@ -92,48 +90,55 @@ __bam_ca_delete(dbp, pgno, indx, delete) ++count; } } - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); } - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); + MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist); - return (count); + if (countp != NULL) + *countp = count; + return (0); } /* * __ram_ca_delete -- - * Return the number of relevant cursors. + * Return if any relevant cursors found. * - * PUBLIC: int __ram_ca_delete __P((DB *, db_pgno_t)); + * PUBLIC: int __ram_ca_delete __P((DB *, db_pgno_t, int *)); */ int -__ram_ca_delete(dbp, root_pgno) +__ram_ca_delete(dbp, root_pgno, foundp) DB *dbp; db_pgno_t root_pgno; + int *foundp; { DB *ldbp; DBC *dbc; DB_ENV *dbenv; int found; - found = 0; dbenv = dbp->dbenv; /* * Review the cursors. See the comment in __bam_ca_delete(). */ - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); - for (ldbp = __dblist_get(dbenv, dbp->adj_fileid); + MUTEX_LOCK(dbenv, dbenv->mtx_dblist); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (found = 0; found == 0 && ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { - MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - found == 0 && dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) - if (dbc->internal->root == root_pgno) + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { + MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) + if (dbc->internal->root == root_pgno && + !MVCC_SKIP_CURADJ(dbc, root_pgno)) { found = 1; - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + break; + } + MUTEX_UNLOCK(dbenv, dbp->mutex); } - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); - return (found); + MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist); + + *foundp = found; + return (0); } /* @@ -165,22 +170,22 @@ __bam_ca_di(my_dbc, pgno, indx, adjust) /* * Adjust the cursors. See the comment in __bam_ca_delete(). */ - found = 0; - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); - for (ldbp = __dblist_get(dbenv, dbp->adj_fileid); + MUTEX_LOCK(dbenv, dbenv->mtx_dblist); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (found = 0; ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { - MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { + MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) { if (dbc->dbtype == DB_RECNO) continue; cp = dbc->internal; - if (cp->pgno == pgno && cp->indx >= indx) { + if (cp->pgno == pgno && cp->indx >= indx && + (dbc == my_dbc || !MVCC_SKIP_CURADJ(dbc, pgno))) { /* Cursor indices should never be negative. */ - DB_ASSERT(cp->indx != 0 || adjust > 0); + DB_ASSERT(dbenv, cp->indx != 0 || adjust > 0); /* [#8032] - DB_ASSERT(!STD_LOCKING(dbc) || + DB_ASSERT(dbenv, !STD_LOCKING(dbc) || cp->lock_mode != DB_LOCK_NG); */ cp->indx += adjust; @@ -188,9 +193,9 @@ __bam_ca_di(my_dbc, pgno, indx, adjust) found = 1; } } - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); } - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); + MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist); if (found != 0 && DBC_LOGGING(my_dbc)) { if ((ret = __bam_curadj_log(dbp, my_dbc->txn, &lsn, 0, @@ -227,7 +232,7 @@ __bam_opd_cursor(dbp, dbc, first, tpgno, ti) * an old off-page dup cursor--to augment the checking db_c_newopd * will do, assert this. */ - DB_ASSERT(orig_cp->opd == NULL); + DB_ASSERT(dbp->dbenv, orig_cp->opd == NULL); if ((ret = __db_c_newopd(dbc, tpgno, orig_cp->opd, &dbc_nopd)) != 0) return (ret); @@ -279,26 +284,27 @@ __bam_ca_dup(my_dbc, first, fpgno, fi, tpgno, ti) DB_ENV *dbenv; DB_LSN lsn; DB_TXN *my_txn; - int found, ret; + int found, ret, t_ret; dbp = my_dbc->dbp; dbenv = dbp->dbenv; my_txn = IS_SUBTRANSACTION(my_dbc->txn) ? my_dbc->txn : NULL; + ret = 0; /* * Adjust the cursors. See the comment in __bam_ca_delete(). */ - found = 0; - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); - for (ldbp = __dblist_get(dbenv, dbp->adj_fileid); + MUTEX_LOCK(dbenv, dbenv->mtx_dblist); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (found = 0; ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { -loop: MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { +loop: MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) { /* Find cursors pointing to this record. */ orig_cp = (BTREE_CURSOR *)dbc->internal; - if (orig_cp->pgno != fpgno || orig_cp->indx != fi) + if (orig_cp->pgno != fpgno || orig_cp->indx != fi || + MVCC_SKIP_CURADJ(dbc, fpgno)) continue; /* @@ -308,29 +314,31 @@ loop: MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); if (orig_cp->opd != NULL) continue; - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); /* [#8032] - DB_ASSERT(!STD_LOCKING(dbc) || + DB_ASSERT(dbenv, !STD_LOCKING(dbc) || orig_cp->lock_mode != DB_LOCK_NG); */ if ((ret = __bam_opd_cursor(dbp, - dbc, first, tpgno, ti)) !=0) - return (ret); + dbc, first, tpgno, ti)) != 0) + goto err; if (my_txn != NULL && dbc->txn != my_txn) found = 1; /* We released the mutex to get a cursor, start over. */ goto loop; } - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); } - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); +err: MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist); if (found != 0 && DBC_LOGGING(my_dbc)) { - if ((ret = __bam_curadj_log(dbp, my_dbc->txn, - &lsn, 0, DB_CA_DUP, fpgno, tpgno, 0, first, fi, ti)) != 0) - return (ret); + if ((t_ret = __bam_curadj_log(dbp, my_dbc->txn, + &lsn, 0, DB_CA_DUP, fpgno, tpgno, 0, first, fi, ti)) != 0 && + ret == 0) + ret = t_ret; } - return (0); + + return (ret); } /* @@ -355,17 +363,18 @@ __bam_ca_undodup(dbp, first, fpgno, fi, ti) int ret; dbenv = dbp->dbenv; + ret = 0; /* * Adjust the cursors. See the comment in __bam_ca_delete(). */ - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); - for (ldbp = __dblist_get(dbenv, dbp->adj_fileid); + MUTEX_LOCK(dbenv, dbenv->mtx_dblist); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (; ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { -loop: MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { +loop: MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) { orig_cp = (BTREE_CURSOR *)dbc->internal; /* @@ -377,13 +386,13 @@ loop: MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); */ if (orig_cp->pgno != fpgno || orig_cp->indx != first || - orig_cp->opd == NULL || - ((BTREE_CURSOR *)orig_cp->opd->internal)->indx - != ti) + orig_cp->opd == NULL || ((BTREE_CURSOR *) + orig_cp->opd->internal)->indx != ti || + MVCC_SKIP_CURADJ(dbc, fpgno)) continue; - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); if ((ret = __db_c_close(orig_cp->opd)) != 0) - return (ret); + goto err; orig_cp->opd = NULL; orig_cp->indx = fi; /* @@ -392,11 +401,11 @@ loop: MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); */ goto loop; } - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); } - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); +err: MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist); - return (0); + return (ret); } /* @@ -424,29 +433,29 @@ __bam_ca_rsplit(my_dbc, fpgno, tpgno) /* * Adjust the cursors. See the comment in __bam_ca_delete(). */ - found = 0; - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); - for (ldbp = __dblist_get(dbenv, dbp->adj_fileid); + MUTEX_LOCK(dbenv, dbenv->mtx_dblist); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (found = 0; ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { - MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { + MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) { if (dbc->dbtype == DB_RECNO) continue; - if (dbc->internal->pgno == fpgno) { + if (dbc->internal->pgno == fpgno && + !MVCC_SKIP_CURADJ(dbc, fpgno)) { dbc->internal->pgno = tpgno; /* [#8032] - DB_ASSERT(!STD_LOCKING(dbc) || + DB_ASSERT(dbenv, !STD_LOCKING(dbc) || dbc->internal->lock_mode != DB_LOCK_NG); */ if (my_txn != NULL && dbc->txn != my_txn) found = 1; } } - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); } - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); + MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist); if (found != 0 && DBC_LOGGING(my_dbc)) { if ((ret = __bam_curadj_log(dbp, my_dbc->txn, @@ -492,20 +501,20 @@ __bam_ca_split(my_dbc, ppgno, lpgno, rpgno, split_indx, cleft) * the cursor is on the right page, it is decremented by the number of * records split to the left page. */ - found = 0; - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); - for (ldbp = __dblist_get(dbenv, dbp->adj_fileid); + MUTEX_LOCK(dbenv, dbenv->mtx_dblist); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (found = 0; ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { - MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { + MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) { if (dbc->dbtype == DB_RECNO) continue; cp = dbc->internal; - if (cp->pgno == ppgno) { + if (cp->pgno == ppgno && + !MVCC_SKIP_CURADJ(dbc, ppgno)) { /* [#8032] - DB_ASSERT(!STD_LOCKING(dbc) || + DB_ASSERT(dbenv, !STD_LOCKING(dbc) || cp->lock_mode != DB_LOCK_NG); */ if (my_txn != NULL && dbc->txn != my_txn) @@ -519,9 +528,9 @@ __bam_ca_split(my_dbc, ppgno, lpgno, rpgno, split_indx, cleft) } } } - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); } - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); + MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist); if (found != 0 && DBC_LOGGING(my_dbc)) { if ((ret = __bam_curadj_log(dbp, @@ -540,10 +549,10 @@ __bam_ca_split(my_dbc, ppgno, lpgno, rpgno, split_indx, cleft) * left and the right pages. * Called only during undo processing. * - * PUBLIC: void __bam_ca_undosplit __P((DB *, + * PUBLIC: int __bam_ca_undosplit __P((DB *, * PUBLIC: db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t)); */ -void +int __bam_ca_undosplit(dbp, frompgno, topgno, lpgno, split_indx) DB *dbp; db_pgno_t frompgno, topgno, lpgno; @@ -562,23 +571,27 @@ __bam_ca_undosplit(dbp, frompgno, topgno, lpgno, split_indx) * When backing out a split, we move the cursor back * to the original offset and bump it by the split_indx. */ - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); - for (ldbp = __dblist_get(dbenv, dbp->adj_fileid); + MUTEX_LOCK(dbenv, dbenv->mtx_dblist); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (; ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { - MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { + MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) { if (dbc->dbtype == DB_RECNO) continue; cp = dbc->internal; - if (cp->pgno == topgno) { + if (cp->pgno == topgno && + !MVCC_SKIP_CURADJ(dbc, topgno)) { cp->pgno = frompgno; cp->indx += split_indx; - } else if (cp->pgno == lpgno) + } else if (cp->pgno == lpgno && + !MVCC_SKIP_CURADJ(dbc, lpgno)) cp->pgno = frompgno; } - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); } - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); + MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist); + + return (0); } diff --git a/db/btree/bt_cursor.c b/db/btree/bt_cursor.c index 82d6cc435..dbcda5a40 100644 --- a/db/btree/bt_cursor.c +++ b/db/btree/bt_cursor.c @@ -1,23 +1,16 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_cursor.c,v 11.190 2004/09/22 21:46:32 ubell Exp $ + * $Id: bt_cursor.c,v 12.23 2006/09/14 23:55:24 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" -#include "dbinc/db_shash.h" #include "dbinc/btree.h" #include "dbinc/lock.h" #include "dbinc/mp.h" @@ -26,10 +19,8 @@ static int __bam_bulk __P((DBC *, DBT *, u_int32_t)); static int __bam_c_close __P((DBC *, db_pgno_t, int *)); static int __bam_c_del __P((DBC *)); static int __bam_c_destroy __P((DBC *)); -static int __bam_c_first __P((DBC *)); static int __bam_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); static int __bam_c_getstack __P((DBC *)); -static int __bam_c_last __P((DBC *)); static int __bam_c_next __P((DBC *, int, int)); static int __bam_c_physdel __P((DBC *)); static int __bam_c_prev __P((DBC *)); @@ -55,7 +46,7 @@ static int __bam_isopd __P((DBC *, db_pgno_t *)); * the held interior page so we use ACQUIRE_COUPLE. */ #undef ACQUIRE -#define ACQUIRE(dbc, mode, lpgno, lock, fpgno, pagep, ret) do { \ +#define ACQUIRE(dbc, mode, lpgno, lock, fpgno, pagep, flags, ret) do { \ DB_MPOOLFILE *__mpf = (dbc)->dbp->mpf; \ if ((pagep) != NULL) { \ ret = __memp_fput(__mpf, pagep, 0); \ @@ -63,50 +54,20 @@ static int __bam_isopd __P((DBC *, db_pgno_t *)); } else \ ret = 0; \ if ((ret) == 0 && STD_LOCKING(dbc)) \ - ret = __db_lget(dbc, LCK_COUPLE, lpgno, mode, 0, &(lock));\ + ret = __db_lget( \ + dbc, LCK_COUPLE, lpgno, mode, flags, &(lock)); \ if ((ret) == 0) \ - ret = __memp_fget(__mpf, &(fpgno), 0, &(pagep)); \ -} while (0) - -#undef ACQUIRE_COUPLE -#define ACQUIRE_COUPLE(dbc, mode, lpgno, lock, fpgno, pagep, ret) do { \ - DB_MPOOLFILE *__mpf = (dbc)->dbp->mpf; \ - if ((pagep) != NULL) { \ - ret = __memp_fput(__mpf, pagep, 0); \ - pagep = NULL; \ - } else \ - ret = 0; \ - if ((ret) == 0 && STD_LOCKING(dbc)) \ - ret = __db_lget(dbc, \ - LCK_COUPLE_ALWAYS, lpgno, mode, 0, &(lock)); \ - if ((ret) == 0) \ - ret = __memp_fget(__mpf, &(fpgno), 0, &(pagep)); \ + ret = __memp_fget(__mpf, &(fpgno), (dbc)->txn, \ + 0, &(pagep)); \ } while (0) /* Acquire a new page/lock for a cursor. */ #undef ACQUIRE_CUR -#define ACQUIRE_CUR(dbc, mode, p, ret) do { \ - BTREE_CURSOR *__cp = (BTREE_CURSOR *)(dbc)->internal; \ - if (p != __cp->pgno) \ - __cp->pgno = PGNO_INVALID; \ - ACQUIRE(dbc, mode, p, __cp->lock, p, __cp->page, ret); \ - if ((ret) == 0) { \ - __cp->pgno = p; \ - __cp->lock_mode = (mode); \ - } \ -} while (0) - -/* - * Acquire a new page/lock for a cursor and release the previous. - * This is typically used when descending a tree and we do not - * want to hold the interior nodes locked. - */ -#undef ACQUIRE_CUR_COUPLE -#define ACQUIRE_CUR_COUPLE(dbc, mode, p, ret) do { \ +#define ACQUIRE_CUR(dbc, mode, p, flags, ret) do { \ BTREE_CURSOR *__cp = (BTREE_CURSOR *)(dbc)->internal; \ if (p != __cp->pgno) \ __cp->pgno = PGNO_INVALID; \ - ACQUIRE_COUPLE(dbc, mode, p, __cp->lock, p, __cp->page, ret); \ + ACQUIRE(dbc, mode, p, __cp->lock, p, __cp->page, flags, ret); \ if ((ret) == 0) { \ __cp->pgno = p; \ __cp->lock_mode = (mode); \ @@ -196,11 +157,11 @@ __bam_c_init(dbc, dbtype) /* Allocate/initialize the internal structure. */ if (dbc->internal == NULL && (ret = - __os_malloc(dbenv, sizeof(BTREE_CURSOR), &dbc->internal)) != 0) + __os_calloc(dbenv, 1, sizeof(BTREE_CURSOR), &dbc->internal)) != 0) return (ret); /* Initialize methods. */ - dbc->c_close = __db_c_close; + dbc->c_close = __db_c_close_pp; dbc->c_count = __db_c_count_pp; dbc->c_del = __db_c_del_pp; dbc->c_dup = __db_c_dup_pp; @@ -257,8 +218,11 @@ __bam_c_refresh(dbc) LOCK_INIT(cp->lock); cp->lock_mode = DB_LOCK_NG; - cp->sp = cp->csp = cp->stack; - cp->esp = cp->stack + sizeof(cp->stack) / sizeof(cp->stack[0]); + if (cp->sp == NULL) { + cp->sp = cp->stack; + cp->esp = cp->stack + sizeof(cp->stack) / sizeof(cp->stack[0]); + } + BT_STK_CLR(cp); /* * The btree leaf page data structures require that two key/data pairs @@ -308,7 +272,7 @@ __bam_c_close(dbc, root_pgno, rmroot) DBC *dbc_opd, *dbc_c; DB_MPOOLFILE *mpf; PAGE *h; - int cdb_lock, ret; + int cdb_lock, count, ret; dbp = dbc->dbp; mpf = dbp->mpf; @@ -378,22 +342,28 @@ __bam_c_close(dbc, root_pgno, rmroot) dbc_c = dbc; switch (dbc->dbtype) { case DB_BTREE: /* Case #1, #3. */ - if (__bam_ca_delete(dbp, cp->pgno, cp->indx, 1) == 0) + if ((ret = __bam_ca_delete( + dbp, cp->pgno, cp->indx, 1, &count)) != 0) + goto err; + if (count == 0) goto lock; goto done; case DB_RECNO: if (!F_ISSET(dbc, DBC_OPD)) /* Case #1. */ goto done; /* Case #3. */ - if (__ram_ca_delete(dbp, cp->root) == 0) + if ((ret = __ram_ca_delete(dbp, cp->root, &count)) != 0) + goto err; + if (count == 0) goto lock; goto done; case DB_HASH: case DB_QUEUE: case DB_UNKNOWN: default: - return (__db_unknown_type(dbp->dbenv, - "__bam_c_close", dbc->dbtype)); + ret = __db_unknown_type(dbp->dbenv, + "__bam_c_close", dbc->dbtype); + goto err; } } @@ -405,7 +375,7 @@ __bam_c_close(dbc, root_pgno, rmroot) * We will not have been provided a root page number. Acquire * one from the primary database. */ - if ((ret = __memp_fget(mpf, &cp->pgno, 0, &h)) != 0) + if ((ret = __memp_fget(mpf, &cp->pgno, dbc->txn, 0, &h)) != 0) goto err; root_pgno = GET_BOVERFLOW(dbp, h, cp->indx + O_INDX)->pgno; if ((ret = __memp_fput(mpf, h, 0)) != 0) @@ -414,20 +384,26 @@ __bam_c_close(dbc, root_pgno, rmroot) dbc_c = dbc_opd; switch (dbc_opd->dbtype) { case DB_BTREE: - if (__bam_ca_delete( - dbp, cp_opd->pgno, cp_opd->indx, 1) == 0) + if ((ret = __bam_ca_delete( + dbp, cp_opd->pgno, cp_opd->indx, 1, &count)) != 0) + goto err; + if (count == 0) goto lock; goto done; case DB_RECNO: - if (__ram_ca_delete(dbp, cp_opd->root) == 0) + if ((ret = + __ram_ca_delete(dbp, cp_opd->root, &count)) != 0) + goto err; + if (count == 0) goto lock; goto done; case DB_HASH: case DB_QUEUE: case DB_UNKNOWN: default: - return (__db_unknown_type( - dbp->dbenv, "__bam_c_close", dbc->dbtype)); + ret = __db_unknown_type( + dbp->dbenv, "__bam_c_close", dbc->dbtype); + goto err; } } goto done; @@ -508,7 +484,8 @@ delete: /* * Delete the on-page physical item referenced by the cursor. */ if (dbc_c->dbtype == DB_BTREE) { - if ((ret = __memp_fget(mpf, &cp_c->pgno, 0, &cp_c->page)) != 0) + if ((ret = __memp_fget(mpf, &cp_c->pgno, dbc->txn, + DB_MPOOL_DIRTY, &cp_c->page)) != 0) goto err; if ((ret = __bam_c_physdel(dbc_c)) != 0) goto err; @@ -530,7 +507,7 @@ delete: /* * in that case. So, if the off-page duplicate tree is empty at this * point, we want to remove it. */ - if ((ret = __memp_fget(mpf, &root_pgno, 0, &h)) != 0) + if ((ret = __memp_fget(mpf, &root_pgno, dbc->txn, 0, &h)) != 0) goto err; if (NUM_ENT(h) == 0) { DISCARD_CUR(dbc_c, ret); @@ -557,7 +534,8 @@ delete: /* * the primary page. */ if (dbc_opd != NULL) { - if ((ret = __memp_fget(mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = __memp_fget(mpf, &cp->pgno, dbc->txn, + DB_MPOOL_DIRTY, &cp->page)) != 0) goto err; if ((ret = __bam_c_physdel(dbc)) != 0) goto err; @@ -588,8 +566,14 @@ static int __bam_c_destroy(dbc) DBC *dbc; { + BTREE_CURSOR *cp; + + cp = (BTREE_CURSOR *)dbc->internal; + /* Discard the structures. */ - __os_free(dbc->dbp->dbenv, dbc->internal); + if (cp->sp != cp->stack) + __os_free(dbc->dbp->dbenv, cp->sp); + __os_free(dbc->dbp->dbenv, cp); return (0); } @@ -625,7 +609,8 @@ __bam_c_count(dbc, recnop) /* * On-page duplicates, get the page and count. */ - if ((ret = __memp_fget(mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = __memp_fget(mpf, &cp->pgno, dbc->txn, + 0, &cp->page)) != 0) return (ret); /* @@ -649,8 +634,8 @@ __bam_c_count(dbc, recnop) * Off-page duplicates tree, get the root page of the off-page * duplicate tree. */ - if ((ret = __memp_fget( - mpf, &cp->opd->internal->root, 0, &cp->page)) != 0) + if ((ret = __memp_fget(mpf, &cp->opd->internal->root, + dbc->txn, 0, &cp->page)) != 0) return (ret); /* @@ -693,7 +678,7 @@ __bam_c_del(dbc) BTREE_CURSOR *cp; DB *dbp; DB_MPOOLFILE *mpf; - int ret, t_ret; + int count, ret, t_ret; dbp = dbc->dbp; mpf = dbp->mpf; @@ -707,7 +692,7 @@ __bam_c_del(dbc) /* * This code is always called with a page lock but no page. */ - DB_ASSERT(cp->page == NULL); + DB_ASSERT(dbp->dbenv, cp->page == NULL); /* * We don't physically delete the record until the cursor moves, so @@ -723,11 +708,15 @@ __bam_c_del(dbc) goto err; cp->page = cp->csp->page; } else { - ACQUIRE_CUR(dbc, DB_LOCK_WRITE, cp->pgno, ret); + ACQUIRE_CUR(dbc, DB_LOCK_WRITE, cp->pgno, 0, ret); if (ret != 0) goto err; } + /* Mark the page dirty. */ + if ((ret = __memp_dirty(mpf, &cp->page, dbc->txn, 0)) != 0) + goto err; + /* Log the change. */ if (DBC_LOGGING(dbc)) { if ((ret = __bam_cdel_log(dbp, dbc->txn, &LSN(cp->page), 0, @@ -742,14 +731,12 @@ __bam_c_del(dbc) else B_DSET(GET_BKEYDATA(dbp, cp->page, cp->indx)->type); - /* Mark the page dirty. */ - ret = __memp_fset(mpf, cp->page, DB_MPOOL_DIRTY); - err: /* * If we've been successful so far and the tree has record numbers, * adjust the record counts. Either way, release acquired page(s). */ if (F_ISSET(cp, C_RECNUM)) { + cp->csp->page = cp->page; if (ret == 0) ret = __bam_adjust(dbc, -1); (void)__bam_stkrel(dbc, 0); @@ -760,9 +747,12 @@ err: /* cp->page = NULL; - /* Update the cursors last, after all chance of failure is past. */ + /* + * Update the cursors last, after all chance of recoverable failure + * is past. + */ if (ret == 0) - (void)__bam_ca_delete(dbp, cp->pgno, cp->indx, 1); + ret = __bam_ca_delete(dbp, cp->pgno, cp->indx, 1, &count); return (ret); } @@ -779,22 +769,10 @@ __bam_c_dup(orig_dbc, new_dbc) DBC *orig_dbc, *new_dbc; { BTREE_CURSOR *orig, *new; - int ret; orig = (BTREE_CURSOR *)orig_dbc->internal; new = (BTREE_CURSOR *)new_dbc->internal; - /* - * If we're holding a lock we need to acquire a copy of it, unless - * we're in a transaction. We don't need to copy any lock we're - * holding inside a transaction because all the locks are retained - * until the transaction commits or aborts. - */ - if (orig_dbc->txn == NULL && LOCK_ISSET(orig->lock)) - if ((ret = __db_lget(new_dbc, - 0, new->pgno, new->lock_mode, 0, &new->lock)) != 0) - return (ret); - new->ovflsize = orig->ovflsize; new->recno = orig->recno; new->flags = orig->flags; @@ -841,12 +819,14 @@ __bam_c_get(dbc, key, data, flags, pgnop) * write lock, but upgrading to a write lock has no better * chance of succeeding now instead of later, so don't try. */ - if ((ret = __memp_fget(mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = __memp_fget(mpf, &cp->pgno, dbc->txn, + 0, &cp->page)) != 0) goto err; break; case DB_FIRST: newopd = 1; - if ((ret = __bam_c_first(dbc)) != 0) + if ((ret = __bam_c_search(dbc, + PGNO_INVALID, NULL, flags, &exact)) != 0) goto err; break; case DB_GET_BOTH: @@ -910,13 +890,15 @@ __bam_c_get(dbc, key, data, flags, pgnop) break; case DB_LAST: newopd = 1; - if ((ret = __bam_c_last(dbc)) != 0) + if ((ret = __bam_c_search(dbc, + PGNO_INVALID, NULL, flags, &exact)) != 0) goto err; break; case DB_NEXT: newopd = 1; if (cp->pgno == PGNO_INVALID) { - if ((ret = __bam_c_first(dbc)) != 0) + if ((ret = __bam_c_search(dbc, + PGNO_INVALID, NULL, DB_FIRST, &exact)) != 0) goto err; } else if ((ret = __bam_c_next(dbc, 1, 0)) != 0) @@ -933,7 +915,8 @@ __bam_c_get(dbc, key, data, flags, pgnop) case DB_NEXT_NODUP: newopd = 1; if (cp->pgno == PGNO_INVALID) { - if ((ret = __bam_c_first(dbc)) != 0) + if ((ret = __bam_c_search(dbc, + PGNO_INVALID, NULL, DB_FIRST, &exact)) != 0) goto err; } else do { @@ -944,7 +927,8 @@ __bam_c_get(dbc, key, data, flags, pgnop) case DB_PREV: newopd = 1; if (cp->pgno == PGNO_INVALID) { - if ((ret = __bam_c_last(dbc)) != 0) + if ((ret = __bam_c_search(dbc, + PGNO_INVALID, NULL, DB_LAST, &exact)) != 0) goto err; } else if ((ret = __bam_c_prev(dbc)) != 0) @@ -953,7 +937,8 @@ __bam_c_get(dbc, key, data, flags, pgnop) case DB_PREV_NODUP: newopd = 1; if (cp->pgno == PGNO_INVALID) { - if ((ret = __bam_c_last(dbc)) != 0) + if ((ret = __bam_c_search(dbc, + PGNO_INVALID, NULL, DB_LAST, &exact)) != 0) goto err; } else do { @@ -996,17 +981,6 @@ __bam_c_get(dbc, key, data, flags, pgnop) if (newopd && pgnop != NULL) (void)__bam_isopd(dbc, pgnop); - /* - * Don't return the key, it was passed to us (this is true even if the - * application defines a compare function returning equality for more - * than one key value, since in that case which actual value we store - * in the database is undefined -- and particularly true in the case of - * duplicates where we only store one key value). - */ - if (flags == DB_GET_BOTH || - flags == DB_GET_BOTH_RANGE || flags == DB_SET) - F_SET(key, DB_DBT_ISSET); - err: /* * Regardless of whether we were successful or not, if the cursor * moved, clear the delete flag, DBcursor->c_get never references @@ -1411,7 +1385,8 @@ __bam_bulk_overflow(dbc, len, pgno, dp) F_SET(&dbt, DB_DBT_USERMEM); dbt.ulen = len; dbt.data = (void *)dp; - return (__db_goff(dbc->dbp, &dbt, len, pgno, NULL, NULL)); + return (__db_goff(dbc->dbp, + dbc->txn, &dbt, len, pgno, NULL, NULL)); } /* @@ -1627,7 +1602,7 @@ __bam_getbothc(dbc, data) * write lock, but upgrading to a write lock has no better * chance of succeeding now instead of later, so don't try. */ - if ((ret = __memp_fget(mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = __memp_fget(mpf, &cp->pgno, dbc->txn, 0, &cp->page)) != 0) return (ret); /* @@ -1640,7 +1615,8 @@ __bam_getbothc(dbc, data) * Check to make sure the desired item comes strictly after * the current position; if it doesn't, return DB_NOTFOUND. */ - if ((ret = __bam_cmp(dbp, data, cp->page, cp->indx, + if ((ret = __bam_cmp(dbp, dbc->txn, + data, cp->page, cp->indx, dbp->dup_compare == NULL ? __bam_defcmp : dbp->dup_compare, &cmp)) != 0) return (ret); @@ -1708,7 +1684,7 @@ __bam_getboth_finddatum(dbc, data, flags) if (dbp->dup_compare == NULL) { for (;; cp->indx += P_INDX) { if (!IS_CUR_DELETED(dbc) && - (ret = __bam_cmp(dbp, data, cp->page, + (ret = __bam_cmp(dbp, dbc->txn, data, cp->page, cp->indx + O_INDX, __bam_defcmp, &cmp)) != 0) return (ret); if (cmp == 0) @@ -1733,7 +1709,7 @@ __bam_getboth_finddatum(dbc, data, flags) if (!IS_DUPLICATE(dbc, cp->indx, top)) break; if (base == (top - P_INDX)) { - if ((ret = __bam_cmp(dbp, data, + if ((ret = __bam_cmp(dbp, dbc->txn, data, cp->page, cp->indx + O_INDX, dbp->dup_compare, &cmp)) != 0) return (ret); return (cmp == 0 || @@ -1742,7 +1718,7 @@ __bam_getboth_finddatum(dbc, data, flags) for (lim = (top - base) / (db_indx_t)P_INDX; lim != 0; lim >>= 1) { cp->indx = base + ((lim >> 1) * P_INDX); - if ((ret = __bam_cmp(dbp, data, cp->page, + if ((ret = __bam_cmp(dbp, dbc->txn, data, cp->page, cp->indx + O_INDX, dbp->dup_compare, &cmp)) != 0) return (ret); if (cmp == 0) { @@ -1818,12 +1794,14 @@ split: ret = stack = 0; ACQUIRE_WRITE_LOCK(dbc, ret); if (ret != 0) goto err; - if ((ret = __memp_fget(mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = __memp_fget(mpf, &cp->pgno, dbc->txn, + 0, &cp->page)) != 0) goto err; break; case DB_KEYFIRST: case DB_KEYLAST: case DB_NODUPDATA: + case DB_NOOVERWRITE: own = 0; /* * Searching off-page, sorted duplicate tree: do a tree search @@ -1875,12 +1853,22 @@ split: ret = stack = 0; if (!exact) { iiop = DB_KEYFIRST; break; + + /* + * Check for NOOVERWRITE. It is possible that there + * is a key with an empty duplicate page attached. + */ + } else if (flags == DB_NOOVERWRITE && !IS_CUR_DELETED(dbc)) { + if (pgnop != NULL && __bam_isopd(dbc, pgnop)) + ret = __bam_opd_exists(dbc, *pgnop); + else + ret = DB_KEYEXIST; + if (ret != 0) + goto err; } /* * If duplicates aren't supported, replace the current item. - * (If implementing the DB->put function, our caller already - * checked the DB_NOOVERWRITE flag.) */ if (!F_ISSET(dbp, DB_AM_DUP)) { iiop = DB_CURRENT; @@ -1916,7 +1904,7 @@ split: ret = stack = 0; * on-page duplicates. Walk the list to find the right slot. */ for (;; cp->indx += P_INDX) { - if ((ret = __bam_cmp(dbp, data, cp->page, + if ((ret = __bam_cmp(dbp, dbc->txn, data, cp->page, cp->indx + O_INDX, dbp->dup_compare, &cmp)) != 0) goto err; if (cmp < 0) { @@ -1958,8 +1946,8 @@ split: ret = stack = 0; if (flags == DB_AFTER || flags == DB_BEFORE || flags == DB_CURRENT) { memset(&dbt, 0, sizeof(DBT)); - if ((ret = __db_ret(dbp, cp->page, 0, &dbt, - &dbc->my_rkey.data, &dbc->my_rkey.ulen)) != 0) + if ((ret = __db_ret(dbp, dbc->txn, cp->page, 0, + &dbt, &dbc->my_rkey.data, &dbc->my_rkey.ulen)) != 0) goto err; arg = &dbt; } else @@ -2084,10 +2072,10 @@ __bam_c_rget(dbc, data) * Get a copy of the key. * Release the page, making sure we don't release it twice. */ - if ((ret = __memp_fget(mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = __memp_fget(mpf, &cp->pgno, dbc->txn, 0, &cp->page)) != 0) return (ret); memset(&dbt, 0, sizeof(DBT)); - if ((ret = __db_ret(dbp, cp->page, + if ((ret = __db_ret(dbp, dbc->txn, cp->page, cp->indx, &dbt, &dbc->my_rkey.data, &dbc->my_rkey.ulen)) != 0) goto err; ret = __memp_fput(mpf, cp->page, 0); @@ -2096,7 +2084,7 @@ __bam_c_rget(dbc, data) return (ret); if ((ret = __bam_search(dbc, PGNO_INVALID, &dbt, - F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND, + F_ISSET(dbc, DBC_RMW) ? SR_FIND_WR : SR_FIND, 1, &recno, &exact)) != 0) goto err; @@ -2136,99 +2124,6 @@ __bam_c_writelock(dbc) return (ret); } -/* - * __bam_c_first -- - * Return the first record. - */ -static int -__bam_c_first(dbc) - DBC *dbc; -{ - BTREE_CURSOR *cp; - db_pgno_t pgno; - int ret; - - cp = (BTREE_CURSOR *)dbc->internal; - ret = 0; - - /* Walk down the left-hand side of the tree. */ - for (pgno = cp->root;;) { - ACQUIRE_CUR_COUPLE(dbc, DB_LOCK_READ, pgno, ret); - if (ret != 0) - return (ret); - - /* If we find a leaf page, we're done. */ - if (ISLEAF(cp->page)) - break; - - pgno = GET_BINTERNAL(dbc->dbp, cp->page, 0)->pgno; - } - - /* If we want a write lock instead of a read lock, get it now. */ - if (F_ISSET(dbc, DBC_RMW)) { - ACQUIRE_WRITE_LOCK(dbc, ret); - if (ret != 0) - return (ret); - } - - cp->indx = 0; - - /* If on an empty page or a deleted record, move to the next one. */ - if (NUM_ENT(cp->page) == 0 || IS_CUR_DELETED(dbc)) - if ((ret = __bam_c_next(dbc, 0, 0)) != 0) - return (ret); - - return (0); -} - -/* - * __bam_c_last -- - * Return the last record. - */ -static int -__bam_c_last(dbc) - DBC *dbc; -{ - BTREE_CURSOR *cp; - db_pgno_t pgno; - int ret; - - cp = (BTREE_CURSOR *)dbc->internal; - ret = 0; - - /* Walk down the right-hand side of the tree. */ - for (pgno = cp->root;;) { - ACQUIRE_CUR_COUPLE(dbc, DB_LOCK_READ, pgno, ret); - if (ret != 0) - return (ret); - - /* If we find a leaf page, we're done. */ - if (ISLEAF(cp->page)) - break; - - pgno = GET_BINTERNAL(dbc->dbp, cp->page, - NUM_ENT(cp->page) - O_INDX)->pgno; - } - - /* If we want a write lock instead of a read lock, get it now. */ - if (F_ISSET(dbc, DBC_RMW)) { - ACQUIRE_WRITE_LOCK(dbc, ret); - if (ret != 0) - return (ret); - } - - cp->indx = NUM_ENT(cp->page) == 0 ? 0 : - NUM_ENT(cp->page) - - (TYPE(cp->page) == P_LBTREE ? P_INDX : O_INDX); - - /* If on an empty page or a deleted record, move to the previous one. */ - if (NUM_ENT(cp->page) == 0 || IS_CUR_DELETED(dbc)) - if ((ret = __bam_c_prev(dbc)) != 0) - return (ret); - - return (0); -} - /* * __bam_c_next -- * Move to the next record. @@ -2263,7 +2158,7 @@ __bam_c_next(dbc, initial_move, deleted_okay) F_ISSET(dbc, DBC_RMW) ? DB_LOCK_WRITE : DB_LOCK_READ; } if (cp->page == NULL) { - ACQUIRE_CUR(dbc, lock_mode, cp->pgno, ret); + ACQUIRE_CUR(dbc, lock_mode, cp->pgno, 0, ret); if (ret != 0) return (ret); } @@ -2284,7 +2179,7 @@ __bam_c_next(dbc, initial_move, deleted_okay) = NEXT_PGNO(cp->page)) == PGNO_INVALID) return (DB_NOTFOUND); - ACQUIRE_CUR(dbc, lock_mode, pgno, ret); + ACQUIRE_CUR(dbc, lock_mode, pgno, 0, ret); if (ret != 0) return (ret); cp->indx = 0; @@ -2332,7 +2227,7 @@ __bam_c_prev(dbc) F_ISSET(dbc, DBC_RMW) ? DB_LOCK_WRITE : DB_LOCK_READ; } if (cp->page == NULL) { - ACQUIRE_CUR(dbc, lock_mode, cp->pgno, ret); + ACQUIRE_CUR(dbc, lock_mode, cp->pgno, 0, ret); if (ret != 0) return (ret); } @@ -2344,7 +2239,7 @@ __bam_c_prev(dbc) PREV_PGNO(cp->page)) == PGNO_INVALID) return (DB_NOTFOUND); - ACQUIRE_CUR(dbc, lock_mode, pgno, ret); + ACQUIRE_CUR(dbc, lock_mode, pgno, 0, ret); if (ret != 0) return (ret); @@ -2398,30 +2293,39 @@ __bam_c_search(dbc, root_pgno, key, flags, exactp) return (ret); switch (flags) { + case DB_FIRST: + sflags = (F_ISSET(dbc, DBC_RMW) ? SR_WRITE : SR_READ) | SR_MIN; + goto search; + case DB_LAST: + sflags = (F_ISSET(dbc, DBC_RMW) ? SR_WRITE : SR_READ) | SR_MAX; + goto search; case DB_SET_RECNO: if ((ret = __ram_getno(dbc, key, &recno, 0)) != 0) return (ret); - sflags = (F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND) | S_EXACT; + sflags = + (F_ISSET(dbc, DBC_RMW) ? SR_FIND_WR : SR_FIND) | SR_EXACT; if ((ret = __bam_rsearch(dbc, &recno, sflags, 1, exactp)) != 0) return (ret); break; case DB_SET: case DB_GET_BOTH: - sflags = (F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND) | S_EXACT; + sflags = + (F_ISSET(dbc, DBC_RMW) ? SR_FIND_WR : SR_FIND) | SR_EXACT; goto search; case DB_GET_BOTH_RANGE: - sflags = (F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND); + sflags = (F_ISSET(dbc, DBC_RMW) ? SR_FIND_WR : SR_FIND); goto search; case DB_SET_RANGE: sflags = - (F_ISSET(dbc, DBC_RMW) ? S_WRITE : S_READ) | S_DUPFIRST; + (F_ISSET(dbc, DBC_RMW) ? SR_WRITE : SR_READ) | SR_DUPFIRST; goto search; case DB_KEYFIRST: - sflags = S_KEYFIRST; + case DB_NOOVERWRITE: + sflags = SR_KEYFIRST; goto fast_search; case DB_KEYLAST: case DB_NODUPDATA: - sflags = S_KEYLAST; + sflags = SR_KEYLAST; fast_search: /* * If the application has a history of inserting into the first * or last pages of the database, we check those pages first to @@ -2452,12 +2356,15 @@ fast_search: /* * * The page may not exist: if a transaction created the page * and then aborted, the page might have been truncated from - * the end of the file. + * the end of the file. We don't want to wait on the lock. + * The page may not even be relevant to this search. */ h = NULL; - ACQUIRE_CUR(dbc, DB_LOCK_WRITE, bt_lpgno, ret); + ACQUIRE_CUR(dbc, DB_LOCK_WRITE, bt_lpgno, DB_LOCK_NOWAIT, ret); if (ret != 0) { - if (ret == DB_PAGE_NOTFOUND) + if (ret == DB_LOCK_DEADLOCK || + ret == DB_LOCK_NOTGRANTED || + ret == DB_PAGE_NOTFOUND) ret = 0; goto fast_miss; } @@ -2474,7 +2381,7 @@ fast_search: /* /* Verify that this page cannot have moved to another db. */ if (F_ISSET(dbp, DB_AM_SUBDB) && - log_compare(&t->bt_llsn, &LSN(h)) != 0) + LOG_COMPARE(&t->bt_llsn, &LSN(h)) != 0) goto fast_miss; /* * What we do here is test to see if we're at the beginning or @@ -2486,9 +2393,9 @@ fast_search: /* */ if (h->next_pgno == PGNO_INVALID) { indx = NUM_ENT(h) - P_INDX; - if ((ret = __bam_cmp(dbp, + if ((ret = __bam_cmp(dbp, dbc->txn, key, h, indx, t->bt_compare, &cmp)) != 0) - return (ret); + goto fast_miss; if (cmp < 0) goto try_begin; @@ -2514,9 +2421,9 @@ fast_search: /* } try_begin: if (h->prev_pgno == PGNO_INVALID) { indx = 0; - if ((ret = __bam_cmp(dbp, + if ((ret = __bam_cmp(dbp, dbc->txn, key, h, indx, t->bt_compare, &cmp)) != 0) - return (ret); + goto fast_miss; if (cmp > 0) goto fast_miss; @@ -2575,7 +2482,6 @@ search: if ((ret = __bam_search(dbc, root_pgno, default: return (__db_unknown_flag(dbp->dbenv, "__bam_c_search", flags)); } - /* Initialize the cursor from the stack. */ cp->page = cp->csp->page; cp->pgno = cp->csp->page->pgno; @@ -2583,6 +2489,16 @@ search: if ((ret = __bam_search(dbc, root_pgno, cp->lock = cp->csp->lock; cp->lock_mode = cp->csp->lock_mode; + /* If on an empty page or a deleted record, move to the next one. */ + if (flags == DB_FIRST && + (NUM_ENT(cp->page) == 0 || IS_CUR_DELETED(dbc))) + if ((ret = __bam_c_next(dbc, 0, 0)) != 0) + return (ret); + if (flags == DB_LAST && + (NUM_ENT(cp->page) == 0 || IS_CUR_DELETED(dbc))) + if ((ret = __bam_c_prev(dbc)) != 0) + return (ret); + return (0); } @@ -2597,15 +2513,10 @@ __bam_c_physdel(dbc) BTREE_CURSOR *cp; DB *dbp; DBT key; - DB_LOCK lock; - DB_MPOOLFILE *mpf; - PAGE *h; - db_pgno_t pgno; - int delete_page, empty_page, exact, level, ret; + int delete_page, empty_page, exact, ret; dbp = dbc->dbp; memset(&key, 0, sizeof(DBT)); - mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; delete_page = empty_page = ret = 0; @@ -2641,10 +2552,11 @@ __bam_c_physdel(dbc) * to temporarily hold this key. We shouldn't own any returned-data * memory of interest--if we do, we're in trouble anyway. */ - if (delete_page) - if ((ret = __db_ret(dbp, cp->page, + if (delete_page) { + if ((ret = __db_ret(dbp, dbc->txn, cp->page, 0, &key, &dbc->my_rkey.data, &dbc->my_rkey.ulen)) != 0) return (ret); + } /* * Delete the items. If page isn't empty, we adjust the cursors. @@ -2661,6 +2573,8 @@ __bam_c_physdel(dbc) * Delete the key item first, otherwise the on-page duplicate checks * in __bam_ditem() won't work! */ + if ((ret = __memp_dirty(dbp->mpf, &cp->page, dbc->txn, 0)) != 0) + return (ret); if (TYPE(cp->page) == P_LBTREE) { if ((ret = __bam_ditem(dbc, cp->page, cp->indx)) != 0) return (ret); @@ -2679,95 +2593,19 @@ __bam_c_physdel(dbc) if ((ret = __bam_ca_di(dbc, PGNO(cp->page), cp->indx, -1)) != 0) return (ret); - /* If we're not going to try and delete the page, we're done. */ - if (!delete_page) - return (0); - /* - * Call __bam_search to reacquire the empty leaf page, but this time - * get both the leaf page and it's parent, locked. Jump back up the - * tree, until we have the top pair of pages that we want to delete. - * Once we have the top page that we want to delete locked, lock the - * underlying pages and check to make sure they're still empty. If - * they are, delete them. + * Need to downgrade write locks here or non-txn locks will get stuck. */ - for (level = LEAFLEVEL;; ++level) { - /* Acquire a page and its parent, locked. */ - if ((ret = __bam_search(dbc, PGNO_INVALID, - &key, S_WRPAIR, level, NULL, &exact)) != 0) + if (F_ISSET(dbc->dbp, DB_AM_READ_UNCOMMITTED)) { + if ((ret = __TLPUT(dbc, cp->lock)) != 0) return (ret); - - /* - * If we reach the root or the parent page isn't going to be - * empty when we delete one record, stop. - */ - h = cp->csp[-1].page; - if (h->pgno == cp->root || NUM_ENT(h) != 1) - break; - - /* Discard the stack, retaining no locks. */ - (void)__bam_stkrel(dbc, STK_NOLOCK); - } - - /* - * Move the stack pointer one after the last entry, we may be about - * to push more items onto the page stack. - */ - ++cp->csp; - - /* - * cp->csp[-2].page is now the parent page, which we may or may not be - * going to delete, and cp->csp[-1].page is the first page we know we - * are going to delete. Walk down the chain of pages, acquiring pages - * until we've acquired a leaf page. Generally, this shouldn't happen; - * we should only see a single internal page with one item and a single - * leaf page with no items. The scenario where we could see something - * else is if reverse splits were turned off for awhile and then turned - * back on. That could result in all sorts of strangeness, e.g., empty - * pages in the tree, trees that looked like linked lists, and so on. - * - * !!! - * Sheer paranoia: if we find any pages that aren't going to be emptied - * by the delete, someone else added an item while we were walking the - * tree, and we discontinue the delete. Shouldn't be possible, but we - * check regardless. - */ - for (h = cp->csp[-1].page;;) { - if (ISLEAF(h)) { - if (NUM_ENT(h) != 0) - break; - break; - } else - if (NUM_ENT(h) != 1) - break; - - /* - * Get the next page, write lock it and push it onto the stack. - * We know it's index 0, because it can only have one element. - */ - switch (TYPE(h)) { - case P_IBTREE: - pgno = GET_BINTERNAL(dbp, h, 0)->pgno; - break; - case P_IRECNO: - pgno = GET_RINTERNAL(dbp, h, 0)->pgno; - break; - default: - return (__db_pgfmt(dbp->dbenv, PGNO(h))); - } - - if ((ret = - __db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &lock)) != 0) - break; - if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) - break; - BT_STK_PUSH(dbp->dbenv, cp, h, 0, lock, DB_LOCK_WRITE, ret); - if (ret != 0) - break; + cp->lock_mode = DB_LOCK_WWRITE; } + /* If we're not going to try and delete the page, we're done. */ + if (!delete_page) + return (0); - /* Adjust the cursor stack to reference the last page on the stack. */ - BT_STK_POP(cp); + ret = __bam_search(dbc, PGNO_INVALID, &key, SR_DEL, 0, NULL, &exact); /* * If everything worked, delete the stack, otherwise, release the @@ -2776,7 +2614,7 @@ __bam_c_physdel(dbc) if (ret == 0) DISCARD_CUR(dbc, ret); if (ret == 0) - ret = __bam_dpages(dbc, cp->sp); + ret = __bam_dpages(dbc, 1, 0); else (void)__bam_stkrel(dbc, 0); @@ -2807,19 +2645,19 @@ __bam_c_getstack(dbc) * routine has to already hold a read lock on the page, so there * is no additional lock to acquire. */ - if ((ret = __memp_fget(mpf, &cp->pgno, 0, &h)) != 0) + if ((ret = __memp_fget(mpf, &cp->pgno, dbc->txn, 0, &h)) != 0) return (ret); /* Get a copy of a key from the page. */ memset(&dbt, 0, sizeof(DBT)); - if ((ret = __db_ret(dbp, + if ((ret = __db_ret(dbp, dbc->txn, h, 0, &dbt, &dbc->my_rkey.data, &dbc->my_rkey.ulen)) != 0) goto err; /* Get a write-locked stack for the page. */ exact = 0; ret = __bam_search(dbc, PGNO_INVALID, - &dbt, S_KEYFIRST, 1, NULL, &exact); + &dbt, SR_KEYFIRST, 1, NULL, &exact); err: /* Discard the key and the page. */ if ((t_ret = __memp_fput(mpf, h, 0)) != 0 && ret == 0) @@ -2851,3 +2689,34 @@ __bam_isopd(dbc, pgnop) } return (0); } + +/* + * __bam_opd_exists -- + * Return if the current position has any data. + * PUBLIC: int __bam_opd_exists __P((DBC *, db_pgno_t)); + */ +int +__bam_opd_exists(dbc, pgno) + DBC *dbc; + db_pgno_t pgno; +{ + PAGE *h; + int ret; + + if ((ret = __memp_fget(dbc->dbp->mpf, &pgno, dbc->txn, 0, &h)) != 0) + return (ret); + + /* + * We always collapse OPD trees so we only need to check + * the number of entries on the root. If there is a non-empty + * tree then there will be duplicates. + */ + if (NUM_ENT(h) == 0) + ret = 0; + else + ret = DB_KEYEXIST; + + (void)__memp_fput(dbc->dbp->mpf, h, 0); + + return (ret); +} diff --git a/db/btree/bt_delete.c b/db/btree/bt_delete.c index 018c8ef49..04efaafa2 100644 --- a/db/btree/bt_delete.c +++ b/db/btree/bt_delete.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 @@ -39,20 +39,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bt_delete.c,v 11.49 2004/02/27 12:38:28 bostic Exp $ + * $Id: bt_delete.c,v 12.21 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" -#include "dbinc/db_shash.h" #include "dbinc/btree.h" #include "dbinc/lock.h" #include "dbinc/mp.h" @@ -72,15 +65,16 @@ __bam_ditem(dbc, h, indx) BINTERNAL *bi; BKEYDATA *bk; DB *dbp; - DB_MPOOLFILE *mpf; u_int32_t nbytes; int ret; db_indx_t *inp; dbp = dbc->dbp; - mpf = dbp->mpf; inp = P_INP(dbp, h); + /* The page should already have been dirtied by our caller. */ + DB_ASSERT(dbp->dbenv, IS_DIRTY(h)); + switch (TYPE(h)) { case P_IBTREE: bi = GET_BINTERNAL(dbp, h, indx); @@ -160,8 +154,6 @@ __bam_ditem(dbc, h, indx) /* Delete the item and mark the page dirty. */ if ((ret = __db_ditem(dbc, h, indx, nbytes)) != 0) return (ret); - if ((ret = __memp_fset(mpf, h, DB_MPOOL_DIRTY)) != 0) - return (ret); return (0); } @@ -180,12 +172,10 @@ __bam_adjindx(dbc, h, indx, indx_copy, is_insert) int is_insert; { DB *dbp; - DB_MPOOLFILE *mpf; db_indx_t copy, *inp; int ret; dbp = dbc->dbp; - mpf = dbp->mpf; inp = P_INP(dbp, h); /* Log the change. */ @@ -210,8 +200,6 @@ __bam_adjindx(dbc, h, indx, indx_copy, is_insert) memmove(&inp[indx], &inp[indx + O_INDX], sizeof(db_indx_t) * (NUM_ENT(h) - indx)); } - if ((ret = __memp_fset(mpf, h, DB_MPOOL_DIRTY)) != 0) - return (ret); return (0); } @@ -220,20 +208,21 @@ __bam_adjindx(dbc, h, indx, indx_copy, is_insert) * __bam_dpages -- * Delete a set of locked pages. * - * PUBLIC: int __bam_dpages __P((DBC *, EPG *)); + * PUBLIC: int __bam_dpages __P((DBC *, int, int)); */ int -__bam_dpages(dbc, stack_epg) +__bam_dpages(dbc, use_top, update) DBC *dbc; - EPG *stack_epg; + int use_top; + int update; { - BTREE_CURSOR *cp; BINTERNAL *bi; + BTREE_CURSOR *cp; DB *dbp; DBT a, b; DB_LOCK c_lock, p_lock; DB_MPOOLFILE *mpf; - EPG *epg; + EPG *epg, *save_sp, *stack_epg; PAGE *child, *parent; db_indx_t nitems; db_pgno_t pgno, root_pgno; @@ -243,30 +232,27 @@ __bam_dpages(dbc, stack_epg) dbp = dbc->dbp; mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; + nitems = 0; + pgno = PGNO_INVALID; /* * We have the entire stack of deletable pages locked. * - * Btree calls us with a pointer to the beginning of a stack, where - * the first page in the stack is to have a single item deleted, and - * the rest of the pages are to be removed. + * Btree calls us with the first page in the stack is to have a + * single item deleted, and the rest of the pages are to be removed. * - * Recno calls us with a pointer into the middle of the stack, where - * the referenced page is to have a single item deleted, and pages - * after the stack reference are to be removed. - * - * First, discard any pages that we don't care about. + * Recno always has a stack to the root and __bam_merge operations + * may have unneeded items in the sack. We find the lowest page + * in the stack that has more than one record in it and start there. */ ret = 0; - for (epg = cp->sp; epg < stack_epg; ++epg) { - if ((t_ret = __memp_fput(mpf, epg->page, 0)) != 0 && ret == 0) - ret = t_ret; - if ((t_ret = __TLPUT(dbc, epg->lock)) != 0 && ret == 0) - ret = t_ret; - } - if (ret != 0) - goto err; - + if (use_top) + stack_epg = cp->sp; + else + for (stack_epg = cp->csp; stack_epg > cp->sp; --stack_epg) + if (NUM_ENT(stack_epg->page) > 1) + break; + epg = stack_epg; /* * !!! * There is an interesting deadlock situation here. We have to relink @@ -276,8 +262,9 @@ __bam_dpages(dbc, stack_epg) * It will deadlock here. Before we unlink the subtree, we relink the * leaf page chain. */ - if ((ret = __bam_relink(dbc, cp->csp->page, NULL)) != 0) - goto err; + if (LEVEL(cp->csp->page) == 1 && + (ret = __bam_relink(dbc, cp->csp->page, PGNO_INVALID)) != 0) + goto discard; /* * Delete the last item that references the underlying pages that are @@ -287,10 +274,21 @@ __bam_dpages(dbc, stack_epg) * transactions, this lets the rest of the tree get back to business * immediately. */ + if ((ret = __memp_dirty(mpf, &epg->page, dbc->txn, 0)) != 0) + goto discard; if ((ret = __bam_ditem(dbc, epg->page, epg->indx)) != 0) - goto err; + goto discard; if ((ret = __bam_ca_di(dbc, PGNO(epg->page), epg->indx, -1)) != 0) - goto err; + goto discard; + + if (update && epg->indx == 0) { + save_sp = cp->csp; + cp->csp = epg; + ret = __bam_pupdate(dbc, epg->page); + cp->csp = save_sp; + if (ret != 0) + goto discard; + } pgno = PGNO(epg->page); nitems = NUM_ENT(epg->page); @@ -301,8 +299,21 @@ __bam_dpages(dbc, stack_epg) if (ret != 0) goto err_inc; + /* Then, discard any pages that we don't care about. */ +discard: for (epg = cp->sp; epg < stack_epg; ++epg) { + if ((t_ret = __memp_fput(mpf, epg->page, 0)) != 0 && ret == 0) + ret = t_ret; + epg->page = NULL; + if ((t_ret = __TLPUT(dbc, epg->lock)) != 0 && ret == 0) + ret = t_ret; + } + if (ret != 0) + goto err; + /* Free the rest of the pages in the stack. */ while (++epg <= cp->csp) { + if ((ret = __memp_dirty(mpf, &epg->page, dbc->txn, 0)) != 0) + goto err; /* * Delete page entries so they will be restored as part of * recovery. We don't need to do cursor adjustment here as @@ -310,13 +321,24 @@ __bam_dpages(dbc, stack_epg) * be referenced by a cursor. */ if (NUM_ENT(epg->page) != 0) { - DB_ASSERT(NUM_ENT(epg->page) == 1); + DB_ASSERT(dbp->dbenv, LEVEL(epg->page) != 1); if ((ret = __bam_ditem(dbc, epg->page, epg->indx)) != 0) goto err; + /* + * Sheer paranoia: if we find any pages that aren't + * emptied by the delete, someone else added an item + * while we were walking the tree, and we discontinue + * the delete. Shouldn't be possible, but we check + * regardless. + */ + if (NUM_ENT(epg->page) != 0) + goto err; } ret = __db_free(dbc, epg->page); + if (cp->page == epg->page) + cp->page = NULL; epg->page = NULL; if ((t_ret = __TLPUT(dbc, epg->lock)) != 0 && ret == 0) ret = t_ret; @@ -357,7 +379,8 @@ err: for (; epg <= cp->csp; ++epg) { if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &p_lock)) != 0) goto stop; - if ((ret = __memp_fget(mpf, &pgno, 0, &parent)) != 0) + if ((ret = __memp_fget(mpf, &pgno, dbc->txn, + DB_MPOOL_DIRTY, &parent)) != 0) goto stop; if (NUM_ENT(parent) != 1) @@ -387,7 +410,8 @@ err: for (; epg <= cp->csp; ++epg) { if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &c_lock)) != 0) goto stop; - if ((ret = __memp_fget(mpf, &pgno, 0, &child)) != 0) + if ((ret = __memp_fget(mpf, &pgno, dbc->txn, + DB_MPOOL_DIRTY, &child)) != 0) goto stop; /* Log the change. */ @@ -425,12 +449,6 @@ err: for (; epg <= cp->csp; ++epg) { if (F_ISSET(cp, C_RECNUM) && LEVEL(child) > LEAFLEVEL) RE_NREC_SET(parent, rcnt); - /* Mark the pages dirty. */ - if ((ret = __memp_fset(mpf, parent, DB_MPOOL_DIRTY)) != 0) - goto stop; - if ((ret = __memp_fset(mpf, child, DB_MPOOL_DIRTY)) != 0) - goto stop; - /* Adjust the cursors. */ if ((ret = __bam_ca_rsplit(dbc, PGNO(child), root_pgno)) != 0) goto stop; @@ -468,12 +486,13 @@ stop: done = 1; * __bam_relink -- * Relink around a deleted page. * - * PUBLIC: int __bam_relink __P((DBC *, PAGE *, PAGE **)); + * PUBLIC: int __bam_relink __P((DBC *, PAGE *, db_pgno_t)); */ int -__bam_relink(dbc, pagep, new_next) +__bam_relink(dbc, pagep, new_pgno) DBC *dbc; - PAGE *pagep, **new_next; + PAGE *pagep; + db_pgno_t new_pgno; { DB *dbp; PAGE *np, *pp; @@ -499,7 +518,8 @@ __bam_relink(dbc, pagep, new_next) if ((ret = __db_lget(dbc, 0, pagep->next_pgno, DB_LOCK_WRITE, 0, &npl)) != 0) goto err; - if ((ret = __memp_fget(mpf, &pagep->next_pgno, 0, &np)) != 0) { + if ((ret = __memp_fget(mpf, &pagep->next_pgno, dbc->txn, + DB_MPOOL_DIRTY, &np)) != 0) { ret = __db_pgerr(dbp, pagep->next_pgno, ret); goto err; } @@ -509,7 +529,8 @@ __bam_relink(dbc, pagep, new_next) if ((ret = __db_lget(dbc, 0, pagep->prev_pgno, DB_LOCK_WRITE, 0, &ppl)) != 0) goto err; - if ((ret = __memp_fget(mpf, &pagep->prev_pgno, 0, &pp)) != 0) { + if ((ret = __memp_fget(mpf, &pagep->prev_pgno, + dbc->txn, DB_MPOOL_DIRTY, &pp)) != 0) { ret = __db_pgerr(dbp, pagep->prev_pgno, ret); goto err; } @@ -519,7 +540,7 @@ __bam_relink(dbc, pagep, new_next) /* Log the change. */ if (DBC_LOGGING(dbc)) { if ((ret = __bam_relink_log(dbp, dbc->txn, &ret_lsn, 0, - pagep->pgno, &pagep->lsn, pagep->prev_pgno, plsnp, + pagep->pgno, new_pgno, pagep->prev_pgno, plsnp, pagep->next_pgno, nlsnp)) != 0) goto err; } else @@ -528,34 +549,28 @@ __bam_relink(dbc, pagep, new_next) np->lsn = ret_lsn; if (pp != NULL) pp->lsn = ret_lsn; - pagep->lsn = ret_lsn; /* * Modify and release the two pages. - * - * !!! - * The parameter new_next gets set to the page following the page we - * are removing. If there is no following page, then new_next gets - * set to NULL. */ if (np != NULL) { - np->prev_pgno = pagep->prev_pgno; - if (new_next == NULL) - ret = __memp_fput(mpf, np, DB_MPOOL_DIRTY); - else { - *new_next = np; - ret = __memp_fset(mpf, np, DB_MPOOL_DIRTY); - } + if (new_pgno == PGNO_INVALID) + np->prev_pgno = pagep->prev_pgno; + else + np->prev_pgno = new_pgno; + ret = __memp_fput(mpf, np, 0); if ((t_ret = __TLPUT(dbc, npl)) != 0 && ret == 0) ret = t_ret; if (ret != 0) goto err; - } else if (new_next != NULL) - *new_next = NULL; + } if (pp != NULL) { - pp->next_pgno = pagep->next_pgno; - ret = __memp_fput(mpf, pp, DB_MPOOL_DIRTY); + if (new_pgno == PGNO_INVALID) + pp->next_pgno = pagep->next_pgno; + else + pp->next_pgno = new_pgno; + ret = __memp_fput(mpf, pp, 0); if ((t_ret = __TLPUT(dbc, ppl)) != 0 && ret == 0) ret = t_ret; if (ret != 0) @@ -571,3 +586,51 @@ err: if (np != NULL) (void)__TLPUT(dbc, ppl); return (ret); } + +/* + * __bam_pupdate -- + * Update parent key pointers up the tree. + * + * PUBLIC: int __bam_pupdate __P((DBC *, PAGE *)); + */ +int +__bam_pupdate(dbc, lpg) + DBC *dbc; + PAGE *lpg; +{ + BTREE_CURSOR *cp; + DB_ENV *dbenv; + EPG *epg; + int ret; + + dbenv = dbc->dbp->dbenv; + cp = (BTREE_CURSOR *)dbc->internal; + ret = 0; + + /* + * Update the parents up the tree. __bam_pinsert only looks at the + * left child if is a leaf page, so we don't need to change it. We + * just do a delete and insert; a replace is possible but reusing + * pinsert is better. + */ + for (epg = &cp->csp[-1]; epg >= cp->sp; epg--) { + if ((ret = __memp_dirty(dbc->dbp->mpf, + &epg->page, dbc->txn, 0)) != 0) + return (ret); + if ((ret = __bam_ditem(dbc, epg->page, epg->indx)) != 0) + return (ret); + epg->indx--; + if ((ret = __bam_pinsert(dbc, epg, + lpg, epg[1].page, BPI_NORECNUM)) != 0) { + if (ret == DB_NEEDSPLIT) { + /* This should not happen. */ + __db_errx(dbenv, + "Not enough room in parent: %s: page %lu", + dbc->dbp->fname, (u_long)PGNO(epg->page)); + ret = __db_panic(dbenv, EINVAL); + } + return (ret); + } + } + return (ret); +} diff --git a/db/btree/bt_method.c b/db/btree/bt_method.c index 0b67da91e..ba71116e0 100644 --- a/db/btree/bt_method.c +++ b/db/btree/bt_method.c @@ -1,24 +1,19 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1999-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1999-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_method.c,v 11.38 2004/09/22 03:31:26 bostic Exp $ + * $Id: bt_method.c,v 12.6 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/btree.h" #include "dbinc/qam.h" -static int __bam_set_bt_maxkey __P((DB *, u_int32_t)); static int __bam_set_bt_minkey __P((DB *, u_int32_t)); static int __bam_set_bt_prefix __P((DB *, size_t(*)(DB *, const DBT *, const DBT *))); @@ -52,7 +47,6 @@ __bam_db_create(dbp) t->bt_prefix = __bam_defpfx; dbp->set_bt_compare = __bam_set_bt_compare; - dbp->set_bt_maxkey = __bam_set_bt_maxkey; dbp->get_bt_minkey = __bam_get_bt_minkey; dbp->set_bt_minkey = __bam_set_bt_minkey; dbp->set_bt_prefix = __bam_set_bt_prefix; @@ -208,31 +202,6 @@ __bam_set_bt_compare(dbp, func) return (0); } -/* - * __bam_set_bt_maxkey -- - * Set the maximum keys per page. - */ -static int -__bam_set_bt_maxkey(dbp, bt_maxkey) - DB *dbp; - u_int32_t bt_maxkey; -{ - BTREE *t; - - DB_ILLEGAL_AFTER_OPEN(dbp, "DB->set_bt_maxkey"); - DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE); - - t = dbp->bt_internal; - - if (bt_maxkey < 1) { - __db_err(dbp->dbenv, "minimum bt_maxkey value is 1"); - return (EINVAL); - } - - t->bt_maxkey = bt_maxkey; - return (0); -} - /* * __db_get_bt_minkey -- * Get the minimum keys per page. @@ -270,7 +239,7 @@ __bam_set_bt_minkey(dbp, bt_minkey) t = dbp->bt_internal; if (bt_minkey < 2) { - __db_err(dbp->dbenv, "minimum bt_minkey value is 2"); + __db_errx(dbp->dbenv, "minimum bt_minkey value is 2"); return (EINVAL); } diff --git a/db/btree/bt_open.c b/db/btree/bt_open.c index e890c5dd7..916223258 100644 --- a/db/btree/bt_open.c +++ b/db/btree/bt_open.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 @@ -39,23 +39,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bt_open.c,v 11.92 2004/04/29 14:39:47 ubell Exp $ + * $Id: bt_open.c,v 12.12 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/crypto.h" #include "dbinc/db_page.h" #include "dbinc/db_swap.h" #include "dbinc/btree.h" -#include "dbinc/db_shash.h" #include "dbinc/lock.h" #include "dbinc/log.h" #include "dbinc/mp.h" @@ -89,7 +82,7 @@ __bam_open(dbp, txn, name, base_pgno, flags) * comparison routine to get it right. */ if (t->bt_compare == __bam_defcmp && t->bt_prefix != __bam_defpfx) { - __db_err(dbp->dbenv, + __db_errx(dbp->dbenv, "prefix comparison may not be specified for default comparison routine"); return (EINVAL); } @@ -100,7 +93,7 @@ __bam_open(dbp, txn, name, base_pgno, flags) */ if (B_MINKEY_TO_OVFLSIZE(dbp, t->bt_minkey, dbp->pgsize) > B_MINKEY_TO_OVFLSIZE(dbp, DEFMINKEYPAGE, dbp->pgsize)) { - __db_err(dbp->dbenv, + __db_errx(dbp->dbenv, "bt_minkey value of %lu too high for page size of %lu", (u_long)t->bt_minkey, (u_long)dbp->pgsize); return (EINVAL); @@ -137,7 +130,7 @@ __bam_metachk(dbp, name, btm) switch (vers) { case 6: case 7: - __db_err(dbenv, + __db_errx(dbenv, "%s: btree version %lu requires a version upgrade", name, (u_long)vers); return (DB_OLD_VERSION); @@ -145,7 +138,7 @@ __bam_metachk(dbp, name, btm) case 9: break; default: - __db_err(dbenv, + __db_errx(dbenv, "%s: unsupported btree version: %lu", name, (u_long)vers); return (EINVAL); } @@ -178,7 +171,7 @@ __bam_metachk(dbp, name, btm) F_SET(dbp, DB_AM_DUP); else if (F_ISSET(dbp, DB_AM_DUP)) { - __db_err(dbenv, + __db_errx(dbenv, "%s: DB_DUP specified to open method but not set in database", name); return (EINVAL); @@ -194,7 +187,7 @@ __bam_metachk(dbp, name, btm) return (ret); } else if (F_ISSET(dbp, DB_AM_RECNUM)) { - __db_err(dbenv, + __db_errx(dbenv, "%s: DB_RECNUM specified to open method but not set in database", name); return (EINVAL); @@ -206,7 +199,7 @@ __bam_metachk(dbp, name, btm) F_SET(dbp, DB_AM_FIXEDLEN); } else if (F_ISSET(dbp, DB_AM_FIXEDLEN)) { - __db_err(dbenv, + __db_errx(dbenv, "%s: DB_FIXEDLEN specified to open method but not set in database", name); return (EINVAL); @@ -218,7 +211,7 @@ __bam_metachk(dbp, name, btm) F_SET(dbp, DB_AM_RENUMBER); } else if (F_ISSET(dbp, DB_AM_RENUMBER)) { - __db_err(dbenv, + __db_errx(dbenv, "%s: DB_RENUMBER specified to open method but not set in database", name); return (EINVAL); @@ -228,7 +221,7 @@ __bam_metachk(dbp, name, btm) F_SET(dbp, DB_AM_SUBDB); else if (F_ISSET(dbp, DB_AM_SUBDB)) { - __db_err(dbenv, + __db_errx(dbenv, "%s: multiple databases specified but not supported by file", name); return (EINVAL); @@ -240,7 +233,7 @@ __bam_metachk(dbp, name, btm) F_SET(dbp, DB_AM_DUPSORT); } else if (dbp->dup_compare != NULL) { - __db_err(dbenv, + __db_errx(dbenv, "%s: duplicate sort specified but not supported in database", name); return (EINVAL); @@ -256,10 +249,10 @@ __bam_metachk(dbp, name, btm) wrong_type: if (dbp->type == DB_BTREE) - __db_err(dbenv, + __db_errx(dbenv, "open method type is Btree, database type is Recno"); else - __db_err(dbenv, + __db_errx(dbenv, "open method type is Recno, database type is Btree"); return (EINVAL); } @@ -285,6 +278,7 @@ __bam_read_root(dbp, txn, base_pgno, flags) int ret, t_ret; COMPQUIET(flags, 0); + meta = NULL; t = dbp->bt_internal; LOCK_INIT(metalock); @@ -299,7 +293,7 @@ __bam_read_root(dbp, txn, base_pgno, flags) if ((ret = __db_lget(dbc, 0, base_pgno, DB_LOCK_READ, 0, &metalock)) != 0) goto err; - if ((ret = __memp_fget(mpf, &base_pgno, 0, &meta)) != 0) + if ((ret = __memp_fget(mpf, &base_pgno, dbc->txn, 0, &meta)) != 0) goto err; /* @@ -311,7 +305,6 @@ __bam_read_root(dbp, txn, base_pgno, flags) * metadata page will be created/initialized elsewhere. */ if (meta->dbmeta.magic == DB_BTREEMAGIC) { - t->bt_maxkey = meta->maxkey; t->bt_minkey = meta->minkey; t->re_pad = (int)meta->re_pad; t->re_len = meta->re_len; @@ -319,8 +312,8 @@ __bam_read_root(dbp, txn, base_pgno, flags) t->bt_meta = base_pgno; t->bt_root = meta->root; } else { - DB_ASSERT(IS_RECOVERING(dbp->dbenv) || - F_ISSET(dbp, DB_AM_RECOVER)); + DB_ASSERT(dbp->dbenv, + IS_RECOVERING(dbp->dbenv) || F_ISSET(dbp, DB_AM_RECOVER)); } /* @@ -359,8 +352,12 @@ __bam_init_meta(dbp, meta, pgno, lsnp) db_pgno_t pgno; DB_LSN *lsnp; { + DB_ENV *dbenv; BTREE *t; + dbenv = dbp->dbenv; + t = dbp->bt_internal; + memset(meta, 0, sizeof(BTMETA)); meta->dbmeta.lsn = *lsnp; meta->dbmeta.pgno = pgno; @@ -371,8 +368,8 @@ __bam_init_meta(dbp, meta, pgno, lsnp) FLD_SET(meta->dbmeta.metaflags, DBMETA_CHKSUM); if (F_ISSET(dbp, DB_AM_ENCRYPT)) { meta->dbmeta.encrypt_alg = - ((DB_CIPHER *)dbp->dbenv->crypto_handle)->alg; - DB_ASSERT(meta->dbmeta.encrypt_alg != 0); + ((DB_CIPHER *)dbenv->crypto_handle)->alg; + DB_ASSERT(dbenv, meta->dbmeta.encrypt_alg != 0); meta->crypto_magic = meta->dbmeta.magic; } meta->dbmeta.type = P_BTREEMETA; @@ -394,8 +391,6 @@ __bam_init_meta(dbp, meta, pgno, lsnp) F_SET(&meta->dbmeta, BTM_RECNO); memcpy(meta->dbmeta.uid, dbp->fileid, DB_FILE_ID_LEN); - t = dbp->bt_internal; - meta->maxkey = t->bt_maxkey; meta->minkey = t->bt_minkey; meta->re_len = t->re_len; meta->re_pad = (u_int32_t)t->re_pad; @@ -428,7 +423,7 @@ __bam_new_file(dbp, txn, fhp, name) DBT pdbt; PAGE *root; db_pgno_t pgno; - int ret; + int ret, t_ret; void *buf; dbenv = dbp->dbenv; @@ -437,30 +432,36 @@ __bam_new_file(dbp, txn, fhp, name) meta = NULL; buf = NULL; - if (name == NULL) { + if (F_ISSET(dbp, DB_AM_INMEM)) { /* Build the meta-data page. */ pgno = PGNO_BASE_MD; - if ((ret = - __memp_fget(mpf, &pgno, DB_MPOOL_CREATE, &meta)) != 0) + if ((ret = __memp_fget(mpf, &pgno, txn, + DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &meta)) != 0) return (ret); LSN_NOT_LOGGED(lsn); __bam_init_meta(dbp, meta, PGNO_BASE_MD, &lsn); meta->root = 1; meta->dbmeta.last_pgno = 1; - ret = __memp_fput(mpf, meta, DB_MPOOL_DIRTY); + if ((ret = + __db_log_page(dbp, txn, &lsn, pgno, (PAGE *)meta)) != 0) + goto err; + ret = __memp_fput(mpf, meta, 0); meta = NULL; if (ret != 0) goto err; /* Build the root page. */ pgno = 1; - if ((ret = - __memp_fget(mpf, &pgno, DB_MPOOL_CREATE, &root)) != 0) + if ((ret = __memp_fget(mpf, &pgno, + txn, DB_MPOOL_CREATE, &root)) != 0) goto err; P_INIT(root, dbp->pgsize, 1, PGNO_INVALID, PGNO_INVALID, LEAFLEVEL, dbp->type == DB_RECNO ? P_LRECNO : P_LBTREE); LSN_NOT_LOGGED(root->lsn); - ret = __memp_fput(mpf, root, DB_MPOOL_DIRTY); + if ((ret = + __db_log_page(dbp, txn, &root->lsn, pgno, root)) != 0) + goto err; + ret = __memp_fput(mpf, root, 0); root = NULL; if (ret != 0) goto err; @@ -509,10 +510,12 @@ __bam_new_file(dbp, txn, fhp, name) err: if (buf != NULL) __os_free(dbenv, buf); else { - if (meta != NULL) - (void)__memp_fput(mpf, meta, 0); - if (root != NULL) - (void)__memp_fput(mpf, root, 0); + if (meta != NULL && + (t_ret = __memp_fput(mpf, meta, 0)) != 0 && ret == 0) + ret = t_ret; + if (root != NULL && + (t_ret = __memp_fput(mpf, root, 0)) != 0 && ret == 0) + ret = t_ret; } return (ret); } @@ -551,8 +554,8 @@ __bam_new_subdb(mdbp, dbp, txn) if ((ret = __db_lget(dbc, 0, dbp->meta_pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) goto err; - if ((ret = - __memp_fget(mpf, &dbp->meta_pgno, DB_MPOOL_CREATE, &meta)) != 0) + if ((ret = __memp_fget(mpf, &dbp->meta_pgno, + txn, DB_MPOOL_CREATE, &meta)) != 0) goto err; /* Build meta-data page. */ @@ -579,10 +582,10 @@ __bam_new_subdb(mdbp, dbp, txn) goto err; /* Release the metadata and root pages. */ - if ((ret = __memp_fput(mpf, meta, DB_MPOOL_DIRTY)) != 0) + if ((ret = __memp_fput(mpf, meta, 0)) != 0) goto err; meta = NULL; - if ((ret = __memp_fput(mpf, root, DB_MPOOL_DIRTY)) != 0) + if ((ret = __memp_fput(mpf, root, 0)) != 0) goto err; root = NULL; err: diff --git a/db/btree/bt_put.c b/db/btree/bt_put.c index 128b16a82..6665341e2 100644 --- a/db/btree/bt_put.c +++ b/db/btree/bt_put.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 @@ -39,26 +39,21 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bt_put.c,v 11.80 2004/10/29 17:33:25 ubell Exp $ + * $Id: bt_put.c,v 12.21 2006/09/06 20:37:00 ubell Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" -#include "dbinc/db_shash.h" #include "dbinc/btree.h" #include "dbinc/mp.h" static int __bam_build __P((DBC *, u_int32_t, DBT *, PAGE *, u_int32_t, u_int32_t)); -static int __bam_dup_convert __P((DBC *, PAGE *, u_int32_t)); +static int __bam_dup_check __P((DBC *, u_int32_t, + PAGE *, u_int32_t, u_int32_t, db_indx_t *)); +static int __bam_dup_convert __P((DBC *, PAGE *, u_int32_t, u_int32_t)); static int __bam_ovput __P((DBC *, u_int32_t, db_pgno_t, PAGE *, u_int32_t, DBT *)); static u_int32_t @@ -84,11 +79,13 @@ __bam_iitem(dbc, key, data, op, flags) DBT bk_hdr, tdbt; DB_MPOOLFILE *mpf; PAGE *h; - db_indx_t indx; - u_int32_t data_size, have_bytes, need_bytes, needed; - int cmp, bigkey, bigdata, dupadjust, padrec, replace, ret, was_deleted; + db_indx_t cnt, indx; + u_int32_t data_size, have_bytes, need_bytes, needed, pages, pagespace; + int cmp, bigkey, bigdata, del, dupadjust; + int padrec, replace, ret, t_ret, was_deleted; COMPQUIET(bk, NULL); + COMPQUIET(cnt, 0); dbp = dbc->dbp; dbenv = dbp->dbenv; @@ -97,7 +94,7 @@ __bam_iitem(dbc, key, data, op, flags) t = dbp->bt_internal; h = cp->page; indx = cp->indx; - dupadjust = replace = was_deleted = 0; + del = dupadjust = replace = was_deleted = 0; /* * Fixed-length records with partial puts: it's an error to specify @@ -149,12 +146,12 @@ __bam_iitem(dbc, key, data, op, flags) * we build the real record so that we're comparing the real items. */ if (op == DB_CURRENT && dbp->dup_compare != NULL) { - if ((ret = __bam_cmp(dbp, data, h, + if ((ret = __bam_cmp(dbp, dbc->txn, data, h, indx + (TYPE(h) == P_LBTREE ? O_INDX : 0), dbp->dup_compare, &cmp)) != 0) return (ret); if (cmp != 0) { - __db_err(dbenv, + __db_errx(dbenv, "Existing data sorts differently from put data"); return (EINVAL); } @@ -217,13 +214,52 @@ __bam_iitem(dbc, key, data, op, flags) return (__db_unknown_flag(dbenv, "DB->put", op)); } - /* - * If there's not enough room, or the user has put a ceiling on the - * number of keys permitted in the page, split the page. - */ + /* Split the page if there's not enough room. */ if (P_FREESPACE(dbp, h) < needed) return (DB_NEEDSPLIT); + /* + * Check to see if we will convert to off page duplicates -- if + * so, we'll need a page. + */ + if (F_ISSET(dbp, DB_AM_DUP) && + TYPE(h) == P_LBTREE && op != DB_KEYFIRST && + P_FREESPACE(dbp, h) - needed <= dbp->pgsize / 2 && + __bam_dup_check(dbc, op, h, indx, needed, &cnt)) { + pages = 1; + dupadjust = 1; + } else + pages = 0; + + /* + * If we are not using transactions and there is a page limit + * set on the file, then figure out if things will fit before + * taking action. + */ + if (dbc->txn == NULL && mpf->mfp->maxpgno != 0) { + pagespace = P_MAXSPACE(dbp, dbp->pgsize); + if (bigdata) + pages += ((data_size - 1) / pagespace) + 1; + if (bigkey) + pages += ((key->size - 1) / pagespace) + 1; + + if (pages > (mpf->mfp->maxpgno - mpf->mfp->last_pgno)) + return (__db_space_err(dbp)); + } + + if ((ret = __memp_dirty(mpf, &h, dbc->txn, 0)) != 0) + return (ret); + if (cp->csp->page == cp->page) + cp->csp->page = h; + cp->page = h; + + /* + * Recalculate this pointer -- the page pointer (h) may have + * changed during the update. + */ + bk = GET_BKEYDATA(dbp, h, + indx + (TYPE(h) == P_LBTREE ? O_INDX : 0)); + /* * The code breaks it up into five cases: * @@ -259,7 +295,6 @@ __bam_iitem(dbc, key, data, op, flags) return (ret); indx += 3; - dupadjust = 1; cp->indx += 2; } else { @@ -276,7 +311,6 @@ __bam_iitem(dbc, key, data, op, flags) return (ret); ++indx; - dupadjust = 1; } break; case DB_CURRENT: @@ -287,11 +321,11 @@ __bam_iitem(dbc, key, data, op, flags) * will try and remove the item because the cursor's delete * flag is set. */ - (void)__bam_ca_delete(dbp, PGNO(h), indx, 0); + if ((ret = __bam_ca_delete(dbp, PGNO(h), indx, 0, NULL)) != 0) + return (ret); if (TYPE(h) == P_LBTREE) { ++indx; - dupadjust = 1; } /* @@ -316,6 +350,7 @@ __bam_iitem(dbc, key, data, op, flags) if (bigdata || B_TYPE(bk->type) != B_KEYDATA) { if ((ret = __bam_ditem(dbc, h, indx)) != 0) return (ret); + del = 1; break; } @@ -332,13 +367,12 @@ __bam_iitem(dbc, key, data, op, flags) * We do not have to handle deleted (BI_DELETED) records * in this case; the actual records should never be created. */ - DB_ASSERT(!LF_ISSET(BI_DELETED)); - if ((ret = __bam_ovput(dbc, - B_OVERFLOW, PGNO_INVALID, h, indx, data)) != 0) - return (ret); + DB_ASSERT(dbenv, !LF_ISSET(BI_DELETED)); + ret = __bam_ovput(dbc, + B_OVERFLOW, PGNO_INVALID, h, indx, data); } else { if (LF_ISSET(BI_DELETED)) { - B_TSET(bk_tmp.type, B_KEYDATA, 1); + B_TSET_DELETED(bk_tmp.type, B_KEYDATA); bk_tmp.len = data->size; bk_hdr.data = &bk_tmp; bk_hdr.size = SSZA(BKEYDATA, data); @@ -349,11 +383,16 @@ __bam_iitem(dbc, key, data, op, flags) else ret = __db_pitem(dbc, h, indx, BKEYDATA_SIZE(data->size), NULL, data); - if (ret != 0) - return (ret); } - if ((ret = __memp_fset(mpf, h, DB_MPOOL_DIRTY)) != 0) + if (ret != 0) { + if (del == 1 && (t_ret = + __bam_ca_di(dbc, PGNO(h), indx + 1, -1)) != 0) { + __db_err(dbenv, t_ret, + "cursor adjustment after delete failed"); + return (__db_panic(dbenv, t_ret)); + } return (ret); + } /* * Re-position the cursors if necessary and reset the current cursor @@ -380,10 +419,9 @@ __bam_iitem(dbc, key, data, op, flags) * up at least 25% of the space on the page. If it does, move it onto * its own page. */ - if (dupadjust && P_FREESPACE(dbp, h) <= dbp->pgsize / 2) { - if ((ret = __bam_dup_convert(dbc, h, indx - O_INDX)) != 0) - return (ret); - } + if (dupadjust && + (ret = __bam_dup_convert(dbc, h, indx - O_INDX, cnt)) != 0) + return (ret); /* If we've modified a recno file, set the flag. */ if (dbc->dbtype == DB_RECNO) @@ -490,7 +528,7 @@ __bam_build(dbc, op, dbt, h, indx, nbytes) bo = (BOVERFLOW *)bk; } else { bk = &tbk; - B_TSET(bk->type, B_KEYDATA, 0); + B_TSET(bk->type, B_KEYDATA); bk->len = 0; } if (B_TYPE(bk->type) == B_OVERFLOW) { @@ -499,7 +537,7 @@ __bam_build(dbc, op, dbt, h, indx, nbytes) * in the current record rather than allocate a separate copy. */ memset(©, 0, sizeof(copy)); - if ((ret = __db_goff(dbp, ©, bo->tlen, + if ((ret = __db_goff(dbp, dbc->txn, ©, bo->tlen, bo->pgno, &rdata->data, &rdata->ulen)) != 0) return (ret); @@ -656,7 +694,7 @@ __bam_ritem(dbc, h, indx, data) /* Copy the new item onto the page. */ bk = (BKEYDATA *)t; - B_TSET(bk->type, B_KEYDATA, 0); + B_TSET(bk->type, B_KEYDATA); bk->len = data->size; memcpy(bk->data, data->data, data->size); @@ -664,26 +702,22 @@ __bam_ritem(dbc, h, indx, data) } /* - * __bam_dup_convert -- + * __bam_dup_check -- * Check to see if the duplicate set at indx should have its own page. - * If it should, create it. */ static int -__bam_dup_convert(dbc, h, indx) +__bam_dup_check(dbc, op, h, indx, sz, cntp) DBC *dbc; + u_int32_t op; PAGE *h; - u_int32_t indx; + u_int32_t indx, sz; + db_indx_t *cntp; { BKEYDATA *bk; DB *dbp; - DBT hdr; - DB_MPOOLFILE *mpf; - PAGE *dp; - db_indx_t cnt, cpindx, dindx, first, *inp, sz; - int ret; + db_indx_t cnt, first, *inp; dbp = dbc->dbp; - mpf = dbp->mpf; inp = P_INP(dbp, h); /* @@ -695,11 +729,21 @@ __bam_dup_convert(dbc, h, indx) /* Count the key once. */ bk = GET_BKEYDATA(dbp, h, indx); - sz = B_TYPE(bk->type) == B_KEYDATA ? + sz += B_TYPE(bk->type) == B_KEYDATA ? BKEYDATA_PSIZE(bk->len) : BOVERFLOW_PSIZE; /* Sum up all the data items. */ - for (cnt = 0, first = indx; + first = indx; + + /* + * Account for the record being inserted. If we are replacing it, + * don't count it twice. + * + * We execute the loop with first == indx to get the size of the + * first record. + */ + cnt = op == DB_CURRENT ? 0 : 1; + for (first = indx; indx < NUM_ENT(h) && inp[first] == inp[indx]; ++cnt, indx += P_INDX) { bk = GET_BKEYDATA(dbp, h, indx + O_INDX); @@ -726,6 +770,36 @@ __bam_dup_convert(dbc, h, indx) if (sz < dbp->pgsize / 4) return (0); + *cntp = cnt; + return (1); +} + +/* + * __bam_dup_convert -- + * Move a set of duplicates off-page and into their own tree. + */ +static int +__bam_dup_convert(dbc, h, indx, cnt) + DBC *dbc; + PAGE *h; + u_int32_t indx, cnt; +{ + BKEYDATA *bk; + DB *dbp; + DBT hdr; + DB_MPOOLFILE *mpf; + PAGE *dp; + db_indx_t cpindx, dindx, first, *inp; + int ret, t_ret; + + dbp = dbc->dbp; + mpf = dbp->mpf; + inp = P_INP(dbp, h); + + /* Move to the beginning of the dup set. */ + while (indx > 0 && inp[indx] == inp[indx - P_INDX]) + indx -= P_INDX; + /* Get a new page. */ if ((ret = __db_new(dbc, dbp->dup_compare == NULL ? P_LRECNO : P_LDUP, &dp)) != 0) @@ -739,8 +813,8 @@ __bam_dup_convert(dbc, h, indx) * we're dealing with. */ memset(&hdr, 0, sizeof(hdr)); - dindx = first; - indx = first; + first = indx; + dindx = indx; cpindx = 0; do { /* Move cursors referencing the old entry to the new entry. */ @@ -797,13 +871,12 @@ __bam_dup_convert(dbc, h, indx) goto err; /* Adjust cursors for all the above movements. */ - if ((ret = __bam_ca_di(dbc, - PGNO(h), first + P_INDX, (int)(first + P_INDX - indx))) != 0) - goto err; + ret = __bam_ca_di(dbc, + PGNO(h), first + P_INDX, (int)(first + P_INDX - indx)); - return (__memp_fput(mpf, dp, DB_MPOOL_DIRTY)); +err: if ((t_ret = __memp_fput(mpf, dp, 0)) != 0 && ret == 0) + ret = t_ret; -err: (void)__memp_fput(mpf, dp, 0); return (ret); } @@ -825,7 +898,7 @@ __bam_ovput(dbc, type, pgno, h, indx, item) int ret; UMRW_SET(bo.unused1); - B_TSET(bo.type, type, 0); + B_TSET(bo.type, type); UMRW_SET(bo.unused2); /* diff --git a/db/btree/bt_rec.c b/db/btree/bt_rec.c index e3fa7363c..45df8d7c1 100644 --- a/db/btree/bt_rec.c +++ b/db/btree/bt_rec.c @@ -1,23 +1,16 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_rec.c,v 11.70 2004/09/24 00:43:12 bostic Exp $ + * $Id: bt_rec.c,v 12.21 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" -#include "dbinc/db_shash.h" #include "dbinc/btree.h" #include "dbinc/lock.h" #include "dbinc/log.h" @@ -58,7 +51,7 @@ __bam_split_recover(dbenv, dbtp, lsnp, op, info) _lp = lp = np = pp = _rp = rp = NULL; sp = NULL; - REC_INTRO(__bam_split_read, 1); + REC_INTRO(__bam_split_read, 1, 0); /* * There are two kinds of splits that we have to recover from. The @@ -95,22 +88,22 @@ redo: if (DB_REDO(op)) { if (rootsplit) { REC_FGET(mpf, root_pgno, &pp, do_left); cmp = - log_compare(&LSN(pp), &LSN(argp->pg.data)); - CHECK_LSN(op, + LOG_COMPARE(&LSN(pp), &LSN(argp->pg.data)); + CHECK_LSN(dbenv, op, cmp, &LSN(pp), &LSN(argp->pg.data)); p_update = cmp == 0; } do_left: if (lp != NULL) { - cmp = log_compare(&LSN(lp), &argp->llsn); - CHECK_LSN(op, cmp, &LSN(lp), &argp->llsn); + cmp = LOG_COMPARE(&LSN(lp), &argp->llsn); + CHECK_LSN(dbenv, op, cmp, &LSN(lp), &argp->llsn); if (cmp == 0) l_update = 1; } if (rp != NULL) { - cmp = log_compare(&LSN(rp), &argp->rlsn); - CHECK_LSN(op, cmp, &LSN(rp), &argp->rlsn); + cmp = LOG_COMPARE(&LSN(rp), &argp->rlsn); + CHECK_LSN(dbenv, op, cmp, &LSN(rp), &argp->rlsn); if (cmp == 0) r_update = 1; } @@ -148,17 +141,19 @@ do_left: if (lp != NULL) { goto out; if (l_update) { + REC_DIRTY(mpf, &lp); memcpy(lp, _lp, file_dbp->pgsize); lp->lsn = *lsnp; - if ((ret = __memp_fput(mpf, lp, DB_MPOOL_DIRTY)) != 0) + if ((ret = __memp_fput(mpf, lp, 0)) != 0) goto out; lp = NULL; } if (r_update) { + REC_DIRTY(mpf, &rp); memcpy(rp, _rp, file_dbp->pgsize); rp->lsn = *lsnp; - if ((ret = __memp_fput(mpf, rp, DB_MPOOL_DIRTY)) != 0) + if ((ret = __memp_fput(mpf, rp, 0)) != 0) goto out; rp = NULL; } @@ -178,13 +173,14 @@ do_left: if (lp != NULL) { rc = 1; } + REC_DIRTY(mpf, &pp); P_INIT(pp, file_dbp->pgsize, root_pgno, PGNO_INVALID, PGNO_INVALID, _lp->level + 1, ptype); RE_NREC_SET(pp, rc ? __bam_total(file_dbp, _lp) + __bam_total(file_dbp, _rp) : 0); pp->lsn = *lsnp; - if ((ret = __memp_fput(mpf, pp, DB_MPOOL_DIRTY)) != 0) + if ((ret = __memp_fput(mpf, pp, 0)) != 0) goto out; pp = NULL; } @@ -197,8 +193,8 @@ check_next: /* * page must exist because we're redoing the operation. */ if (!rootsplit && argp->npgno != PGNO_INVALID) { - if ((ret = - __memp_fget(mpf, &argp->npgno, 0, &np)) != 0) { + if ((ret = __memp_fget(mpf, &argp->npgno, NULL, + 0, &np)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -210,13 +206,14 @@ check_next: /* } else goto done; } - cmp = log_compare(&LSN(np), &argp->nlsn); - CHECK_LSN(op, cmp, &LSN(np), &argp->nlsn); + cmp = LOG_COMPARE(&LSN(np), &argp->nlsn); + CHECK_LSN(dbenv, op, cmp, &LSN(np), &argp->nlsn); if (cmp == 0) { + REC_DIRTY(mpf, &np); PREV_PGNO(np) = argp->right; np->lsn = *lsnp; if ((ret = - __memp_fput(mpf, np, DB_MPOOL_DIRTY)) != 0) + __memp_fput(mpf, np, 0)) != 0) goto out; np = NULL; } @@ -229,13 +226,15 @@ check_next: /* * the adds onto the page that caused the split, and there's * really no undo-ing to be done. */ - if ((ret = __memp_fget(mpf, &pgno, 0, &pp)) != 0) { + if ((ret = __memp_fget(mpf, &pgno, NULL, + DB_MPOOL_EDIT, &pp)) != 0) { pp = NULL; goto lrundo; } - if (log_compare(lsnp, &LSN(pp)) == 0) { + if (LOG_COMPARE(lsnp, &LSN(pp)) == 0) { + REC_DIRTY(mpf, &pp); memcpy(pp, argp->pg.data, argp->pg.size); - if ((ret = __memp_fput(mpf, pp, DB_MPOOL_DIRTY)) != 0) + if ((ret = __memp_fput(mpf, pp, 0)) != 0) goto out; pp = NULL; } @@ -250,18 +249,20 @@ check_next: /* */ lrundo: if ((rootsplit && lp != NULL) || rp != NULL) { if (rootsplit && lp != NULL && - log_compare(lsnp, &LSN(lp)) == 0) { + LOG_COMPARE(lsnp, &LSN(lp)) == 0) { + REC_DIRTY(mpf, &lp); lp->lsn = argp->llsn; if ((ret = - __memp_fput(mpf, lp, DB_MPOOL_DIRTY)) != 0) + __memp_fput(mpf, lp, 0)) != 0) goto out; lp = NULL; } if (rp != NULL && - log_compare(lsnp, &LSN(rp)) == 0) { + LOG_COMPARE(lsnp, &LSN(rp)) == 0) { + REC_DIRTY(mpf, &rp); rp->lsn = argp->rlsn; if ((ret = - __memp_fput(mpf, rp, DB_MPOOL_DIRTY)) != 0) + __memp_fput(mpf, rp, 0)) != 0) goto out; rp = NULL; } @@ -276,15 +277,16 @@ lrundo: if ((rootsplit && lp != NULL) || rp != NULL) { * if there's nothing to undo. */ if (!rootsplit && argp->npgno != PGNO_INVALID) { - if ((ret = - __memp_fget(mpf, &argp->npgno, 0, &np)) != 0) { + if ((ret = __memp_fget(mpf, &argp->npgno, NULL, + DB_MPOOL_EDIT, &np)) != 0) { np = NULL; goto done; } - if (log_compare(lsnp, &LSN(np)) == 0) { + if (LOG_COMPARE(lsnp, &LSN(np)) == 0) { + REC_DIRTY(mpf, &np); PREV_PGNO(np) = argp->left; np->lsn = argp->nlsn; - if (__memp_fput(mpf, np, DB_MPOOL_DIRTY)) + if (__memp_fput(mpf, np, 0)) goto out; np = NULL; } @@ -337,16 +339,18 @@ __bam_rsplit_recover(dbenv, dbtp, lsnp, op, info) DB_MPOOLFILE *mpf; PAGE *pagep; db_pgno_t pgno, root_pgno; - int cmp_n, cmp_p, modified, ret; + db_recno_t rcnt; + int cmp_n, cmp_p, ret; pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_rsplit_print); - REC_INTRO(__bam_rsplit_read, 1); + REC_INTRO(__bam_rsplit_read, 1, 1); /* Fix the root page. */ pgno = root_pgno = argp->root_pgno; - if ((ret = __memp_fget(mpf, &pgno, 0, &pagep)) != 0) { + if ((ret = __memp_fget(mpf, &pgno, NULL, + 0, &pagep)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -358,18 +362,27 @@ __bam_rsplit_recover(dbenv, dbtp, lsnp, op, info) goto do_page; } - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - cmp_p = log_compare(&LSN(pagep), &argp->rootlsn); - CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->rootlsn); + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->rootlsn); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->rootlsn); if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ + /* + * Copy the new data to the root page. If it is not now a + * leaf page we need to restore the record number. We could + * try to determine if C_RECNUM was set in the btree, but + * that's not really necessary since the field is not used + * otherwise. + */ + REC_DIRTY(mpf, &pagep); + rcnt = RE_NREC(pagep); memcpy(pagep, argp->pgdbt.data, argp->pgdbt.size); + if (LEVEL(pagep) > LEAFLEVEL) + RE_NREC_SET(pagep, rcnt); pagep->pgno = root_pgno; pagep->lsn = *lsnp; - modified = 1; } else if (cmp_n == 0 && DB_UNDO(op)) { /* Need to undo update described. */ + REC_DIRTY(mpf, &pagep); P_INIT(pagep, file_dbp->pgsize, root_pgno, argp->nrec, PGNO_INVALID, pagep->level + 1, IS_BTREE_PAGE(pagep) ? P_IBTREE : P_IRECNO); @@ -377,9 +390,8 @@ __bam_rsplit_recover(dbenv, dbtp, lsnp, op, info) argp->rootent.size, &argp->rootent, NULL)) != 0) goto out; pagep->lsn = argp->rootlsn; - modified = 1; } - if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) goto out; do_page: @@ -388,7 +400,8 @@ do_page: * page never made it to disk, so if we're undo-ing and the page * doesn't exist, it's okay and there's nothing further to do. */ - if ((ret = __memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { + if ((ret = __memp_fget(mpf, &argp->pgno, NULL, + 0, &pagep)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -399,21 +412,20 @@ do_page: } else goto done; } - modified = 0; (void)__ua_memcpy(©_lsn, &LSN(argp->pgdbt.data), sizeof(DB_LSN)); - cmp_n = log_compare(lsnp, &LSN(pagep)); - cmp_p = log_compare(&LSN(pagep), ©_lsn); - CHECK_LSN(op, cmp_p, &LSN(pagep), ©_lsn); + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), ©_lsn); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), ©_lsn); if (cmp_p == 0 && DB_REDO(op)) { /* Need to redo update described. */ + REC_DIRTY(mpf, &pagep); pagep->lsn = *lsnp; - modified = 1; } else if (cmp_n == 0 && DB_UNDO(op)) { /* Need to undo update described. */ + REC_DIRTY(mpf, &pagep); memcpy(pagep, argp->pgdbt.data, argp->pgdbt.size); - modified = 1; } - if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) goto out; pagep = NULL; @@ -445,15 +457,16 @@ __bam_adj_recover(dbenv, dbtp, lsnp, op, info) DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; - int cmp_n, cmp_p, modified, ret; + int cmp_n, cmp_p, ret; pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_adj_print); - REC_INTRO(__bam_adj_read, 1); + REC_INTRO(__bam_adj_read, 1, 1); /* Get the page; if it never existed and we're undoing, we're done. */ - if ((ret = __memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { + if ((ret = __memp_fget(mpf, &argp->pgno, NULL, + 0, &pagep)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -465,28 +478,27 @@ __bam_adj_recover(dbenv, dbtp, lsnp, op, info) goto done; } - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - cmp_p = log_compare(&LSN(pagep), &argp->lsn); - CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->lsn); + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn); if (cmp_p == 0 && DB_REDO(op)) { /* Need to redo update described. */ + REC_DIRTY(mpf, &pagep); if ((ret = __bam_adjindx(dbc, pagep, argp->indx, argp->indx_copy, argp->is_insert)) != 0) goto out; LSN(pagep) = *lsnp; - modified = 1; } else if (cmp_n == 0 && DB_UNDO(op)) { /* Need to undo update described. */ + REC_DIRTY(mpf, &pagep); if ((ret = __bam_adjindx(dbc, pagep, argp->indx, argp->indx_copy, !argp->is_insert)) != 0) goto out; LSN(pagep) = argp->lsn; - modified = 1; } - if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) goto out; pagep = NULL; @@ -519,15 +531,16 @@ __bam_cadjust_recover(dbenv, dbtp, lsnp, op, info) DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; - int cmp_n, cmp_p, modified, ret; + int cmp_n, cmp_p, ret; pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_cadjust_print); - REC_INTRO(__bam_cadjust_read, 1); + REC_INTRO(__bam_cadjust_read, 1, 0); /* Get the page; if it never existed and we're undoing, we're done. */ - if ((ret = __memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { + if ((ret = __memp_fget(mpf, &argp->pgno, NULL, + 0, &pagep)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -539,12 +552,12 @@ __bam_cadjust_recover(dbenv, dbtp, lsnp, op, info) goto done; } - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - cmp_p = log_compare(&LSN(pagep), &argp->lsn); - CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->lsn); + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn); if (cmp_p == 0 && DB_REDO(op)) { /* Need to redo update described. */ + REC_DIRTY(mpf, &pagep); if (IS_BTREE_PAGE(pagep)) { GET_BINTERNAL(file_dbp, pagep, argp->indx)->nrecs += argp->adjust; @@ -558,9 +571,9 @@ __bam_cadjust_recover(dbenv, dbtp, lsnp, op, info) } LSN(pagep) = *lsnp; - modified = 1; } else if (cmp_n == 0 && DB_UNDO(op)) { /* Need to undo update described. */ + REC_DIRTY(mpf, &pagep); if (IS_BTREE_PAGE(pagep)) { GET_BINTERNAL(file_dbp, pagep, argp->indx)->nrecs -= argp->adjust; @@ -573,9 +586,8 @@ __bam_cadjust_recover(dbenv, dbtp, lsnp, op, info) RE_NREC_ADJ(pagep, -(argp->adjust)); } LSN(pagep) = argp->lsn; - modified = 1; } - if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) goto out; pagep = NULL; @@ -608,15 +620,16 @@ __bam_cdel_recover(dbenv, dbtp, lsnp, op, info) DB_MPOOLFILE *mpf; PAGE *pagep; u_int32_t indx; - int cmp_n, cmp_p, modified, ret; + int cmp_n, cmp_p, ret; pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_cdel_print); - REC_INTRO(__bam_cdel_read, 1); + REC_INTRO(__bam_cdel_read, 1, 0); /* Get the page; if it never existed and we're undoing, we're done. */ - if ((ret = __memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { + if ((ret = __memp_fget(mpf, &argp->pgno, NULL, + 0, &pagep)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -628,28 +641,29 @@ __bam_cdel_recover(dbenv, dbtp, lsnp, op, info) goto done; } - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - cmp_p = log_compare(&LSN(pagep), &argp->lsn); - CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->lsn); + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn); if (cmp_p == 0 && DB_REDO(op)) { /* Need to redo update described. */ + REC_DIRTY(mpf, &pagep); indx = argp->indx + (TYPE(pagep) == P_LBTREE ? O_INDX : 0); B_DSET(GET_BKEYDATA(file_dbp, pagep, indx)->type); LSN(pagep) = *lsnp; - modified = 1; } else if (cmp_n == 0 && DB_UNDO(op)) { /* Need to undo update described. */ + REC_DIRTY(mpf, &pagep); indx = argp->indx + (TYPE(pagep) == P_LBTREE ? O_INDX : 0); B_DCLR(GET_BKEYDATA(file_dbp, pagep, indx)->type); - (void)__bam_ca_delete(file_dbp, argp->pgno, argp->indx, 0); + if ((ret = __bam_ca_delete( + file_dbp, argp->pgno, argp->indx, 0, NULL)) != 0) + goto out; LSN(pagep) = argp->lsn; - modified = 1; } - if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) goto out; pagep = NULL; @@ -683,16 +697,17 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info) DBT dbt; DB_MPOOLFILE *mpf; PAGE *pagep; - int cmp_n, cmp_p, modified, ret; + int cmp_n, cmp_p, ret; u_int8_t *p; pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_repl_print); - REC_INTRO(__bam_repl_read, 1); + REC_INTRO(__bam_repl_read, 1, 1); /* Get the page; if it never existed and we're undoing, we're done. */ - if ((ret = __memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { + if ((ret = __memp_fget(mpf, &argp->pgno, NULL, + 0, &pagep)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -705,16 +720,16 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info) } bk = GET_BKEYDATA(file_dbp, pagep, argp->indx); - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - cmp_p = log_compare(&LSN(pagep), &argp->lsn); - CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->lsn); + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn); if (cmp_p == 0 && DB_REDO(op)) { /* * Need to redo update described. * * Re-build the replacement item. */ + REC_DIRTY(mpf, &pagep); memset(&dbt, 0, sizeof(dbt)); dbt.size = argp->prefix + argp->suffix + argp->repl.size; if ((ret = __os_malloc(dbenv, dbt.size, &dbt.data)) != 0) @@ -732,13 +747,13 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info) goto out; LSN(pagep) = *lsnp; - modified = 1; } else if (cmp_n == 0 && DB_UNDO(op)) { /* * Need to undo update described. * * Re-build the original item. */ + REC_DIRTY(mpf, &pagep); memset(&dbt, 0, sizeof(dbt)); dbt.size = argp->prefix + argp->suffix + argp->orig.size; if ((ret = __os_malloc(dbenv, dbt.size, &dbt.data)) != 0) @@ -760,9 +775,8 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info) B_DSET(GET_BKEYDATA(file_dbp, pagep, argp->indx)->type); LSN(pagep) = argp->lsn; - modified = 1; } - if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) goto out; pagep = NULL; @@ -794,14 +808,15 @@ __bam_root_recover(dbenv, dbtp, lsnp, op, info) DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; - int cmp_n, cmp_p, modified, ret; + int cmp_n, cmp_p, ret; meta = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_root_print); - REC_INTRO(__bam_root_read, 0); + REC_INTRO(__bam_root_read, 0, 0); - if ((ret = __memp_fget(mpf, &argp->meta_pgno, 0, &meta)) != 0) { + if ((ret = __memp_fget(mpf, &argp->meta_pgno, NULL, + 0, &meta)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -813,22 +828,21 @@ __bam_root_recover(dbenv, dbtp, lsnp, op, info) goto done; } - modified = 0; - cmp_n = log_compare(lsnp, &LSN(meta)); - cmp_p = log_compare(&LSN(meta), &argp->meta_lsn); - CHECK_LSN(op, cmp_p, &LSN(meta), &argp->meta_lsn); + cmp_n = LOG_COMPARE(lsnp, &LSN(meta)); + cmp_p = LOG_COMPARE(&LSN(meta), &argp->meta_lsn); + CHECK_LSN(dbenv, op, cmp_p, &LSN(meta), &argp->meta_lsn); if (cmp_p == 0 && DB_REDO(op)) { /* Need to redo update described. */ + REC_DIRTY(mpf, &meta); meta->root = argp->root_pgno; meta->dbmeta.lsn = *lsnp; ((BTREE *)file_dbp->bt_internal)->bt_root = meta->root; - modified = 1; } else if (cmp_n == 0 && DB_UNDO(op)) { /* Nothing to undo except lsn. */ + REC_DIRTY(mpf, &meta); meta->dbmeta.lsn = argp->meta_lsn; - modified = 1; } - if ((ret = __memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = __memp_fput(mpf, meta, 0)) != 0) goto out; meta = NULL; @@ -866,7 +880,7 @@ __bam_curadj_recover(dbenv, dbtp, lsnp, op, info) COMPQUIET(mpf, NULL); REC_PRINT(__bam_curadj_print); - REC_INTRO(__bam_curadj_read, 0); + REC_INTRO(__bam_curadj_read, 0, 1); ret = 0; if (op != DB_TXN_ABORT) @@ -891,8 +905,9 @@ __bam_curadj_recover(dbenv, dbtp, lsnp, op, info) break; case DB_CA_SPLIT: - __bam_ca_undosplit(file_dbp, argp->from_pgno, - argp->to_pgno, argp->left_pgno, argp->from_indx); + if ((ret = __bam_ca_undosplit(file_dbp, argp->from_pgno, + argp->to_pgno, argp->left_pgno, argp->from_indx)) != 0) + goto out; break; } @@ -928,7 +943,7 @@ __bam_rcuradj_recover(dbenv, dbtp, lsnp, op, info) rdbc = NULL; REC_PRINT(__bam_rcuradj_print); - REC_INTRO(__bam_rcuradj_read, 0); + REC_INTRO(__bam_rcuradj_read, 0, 1); ret = t_ret = 0; @@ -962,7 +977,8 @@ __bam_rcuradj_recover(dbenv, dbtp, lsnp, op, info) F_SET(cp, C_DELETED); F_SET(cp, C_RENUMBER); /* Just in case. */ cp->order = argp->order; - (void)__ram_ca(rdbc, CA_ICURRENT); + if ((ret = __ram_ca(rdbc, CA_ICURRENT, NULL)) != 0) + goto out; break; case CA_IAFTER: case CA_IBEFORE: @@ -973,7 +989,8 @@ __bam_rcuradj_recover(dbenv, dbtp, lsnp, op, info) */ F_CLR(cp, C_DELETED); cp->order = INVALID_ORDER; - (void)__ram_ca(rdbc, CA_DELETE); + if ((ret = __ram_ca(rdbc, CA_DELETE, NULL)) != 0) + goto out; break; } @@ -1003,12 +1020,12 @@ __bam_relink_recover(dbenv, dbtp, lsnp, op, info) DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; - int cmp_n, cmp_p, modified, ret; + int cmp_n, cmp_p, ret; pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_relink_print); - REC_INTRO(__bam_relink_read, 1); + REC_INTRO(__bam_relink_read, 1, 0); /* * There are up to three pages we need to check -- the page, and the @@ -1016,7 +1033,397 @@ __bam_relink_recover(dbenv, dbtp, lsnp, op, info) * the current page is the result of a split and is being recovered * elsewhere, so all we need do is recover the next page. */ - if ((ret = __memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { + if ((ret = __memp_fget(mpf, &argp->next, NULL, + 0, &pagep)) != 0) { + if (ret != DB_PAGE_NOTFOUND +#ifndef HAVE_FTRUNCATE + || DB_REDO(op) +#endif + ) { + ret = __db_pgerr(file_dbp, argp->next, ret); + goto out; + } else + goto prev; + } + + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn_next); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn_next); + if (cmp_p == 0 && DB_REDO(op)) { + /* Redo the remove or replace. */ + REC_DIRTY(mpf, &pagep); + if (argp->new_pgno == PGNO_INVALID) + pagep->prev_pgno = argp->prev; + else + pagep->prev_pgno = argp->new_pgno; + + pagep->lsn = *lsnp; + } else if (cmp_n == 0 && DB_UNDO(op)) { + /* Undo the remove or replace. */ + REC_DIRTY(mpf, &pagep); + pagep->prev_pgno = argp->pgno; + + pagep->lsn = argp->lsn_next; + } + + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) + goto out; + pagep = NULL; + +prev: if ((ret = __memp_fget(mpf, &argp->prev, NULL, + 0, &pagep)) != 0) { + if (ret != DB_PAGE_NOTFOUND +#ifndef HAVE_FTRUNCATE + || DB_REDO(op) +#endif + ) { + ret = __db_pgerr(file_dbp, argp->prev, ret); + goto out; + } else + goto done; + } + + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn_prev); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn_prev); + if (cmp_p == 0 && DB_REDO(op)) { + /* Redo the relink. */ + REC_DIRTY(mpf, &pagep); + if (argp->new_pgno == PGNO_INVALID) + pagep->next_pgno = argp->next; + else + pagep->next_pgno = argp->new_pgno; + + pagep->lsn = *lsnp; + } else if (LOG_COMPARE(lsnp, &LSN(pagep)) == 0 && DB_UNDO(op)) { + /* Undo the relink. */ + REC_DIRTY(mpf, &pagep); + pagep->next_pgno = argp->pgno; + pagep->lsn = argp->lsn_prev; + } + + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) + goto out; + pagep = NULL; + +done: *lsnp = argp->prev_lsn; + ret = 0; + +out: if (pagep != NULL) + (void)__memp_fput(mpf, pagep, 0); + REC_CLOSE; +} + +/* + * __bam_merge_recover -- + * Recovery function for merge. + * + * PUBLIC: int __bam_merge_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__bam_merge_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + __bam_merge_args *argp; + BKEYDATA *bk; + DB *file_dbp; + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *pagep; + db_indx_t indx, *ninp, *pinp; + u_int32_t size; + u_int8_t *bp; + int cmp_n, cmp_p, i, ret; + + COMPQUIET(info, NULL); + + REC_PRINT(__bam_merge_print); + REC_INTRO(__bam_merge_read, 1, 1); + + if ((ret = __memp_fget(mpf, &argp->pgno, NULL, + 0, &pagep)) != 0) { + if (ret != DB_PAGE_NOTFOUND +#ifndef HAVE_FTRUNCATE + || DB_REDO(op) +#endif + ) { + ret = __db_pgerr(file_dbp, argp->pgno, ret); + goto out; + } else + goto next; + } + + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn); + CHECK_LSN(file_dbp->dbenv, op, cmp_p, &LSN(pagep), &argp->lsn); + + if (cmp_p == 0 && DB_REDO(op)) { + /* + * If the header is provided the page is empty, copy the + * needed data. + */ + DB_ASSERT(dbenv, argp->hdr.size == 0 || NUM_ENT(pagep) == 0); + REC_DIRTY(mpf, &pagep); + if (argp->hdr.size != 0) { + P_INIT(pagep, file_dbp->pgsize, pagep->pgno, + PREV_PGNO(argp->hdr.data), + NEXT_PGNO(argp->hdr.data), + LEVEL(argp->hdr.data), TYPE(argp->hdr.data)); + } + if (TYPE(pagep) == P_OVERFLOW) { + OV_REF(pagep) = OV_REF(argp->hdr.data); + OV_LEN(pagep) = OV_LEN(argp->hdr.data); + bp = (u_int8_t *) pagep + P_OVERHEAD(file_dbp); + memcpy(bp, argp->data.data, argp->data.size); + } else { + /* Copy the data segment. */ + bp = (u_int8_t *)pagep + + (db_indx_t)(HOFFSET(pagep) - argp->data.size); + memcpy(bp, argp->data.data, argp->data.size); + + /* Copy index table offset past the current entries. */ + pinp = P_INP(file_dbp, pagep) + NUM_ENT(pagep); + ninp = argp->ind.data; + for (i = 0; + i < (int)(argp->ind.size / sizeof(*ninp)); i++) + *pinp++ = *ninp++ + - (file_dbp->pgsize - HOFFSET(pagep)); + HOFFSET(pagep) -= argp->data.size; + NUM_ENT(pagep) += i; + } + pagep->lsn = *lsnp; + } else if (cmp_n == 0 && !DB_REDO(op)) { + /* + * Since logging is logical at the page level + * we cannot just truncate the data space. Delete + * the proper number of items from the logical end + * of the page. + */ + REC_DIRTY(mpf, &pagep); + for (i = 0; i < (int)(argp->ind.size / sizeof(*ninp)); i++) { + indx = NUM_ENT(pagep) - 1; + if (P_INP(file_dbp, pagep)[indx] == + P_INP(file_dbp, pagep)[indx - P_INDX]) { + NUM_ENT(pagep)--; + continue; + } + switch (TYPE(pagep)) { + case P_LBTREE: + case P_LRECNO: + case P_LDUP: + bk = GET_BKEYDATA(file_dbp, pagep, indx); + size = BITEM_SIZE(bk); + break; + + case P_IBTREE: + size = BINTERNAL_SIZE( + GET_BINTERNAL(file_dbp, pagep, indx)->len); + break; + case P_IRECNO: + size = RINTERNAL_SIZE; + break; + + default: + ret = __db_pgfmt(dbenv, PGNO(pagep)); + goto out; + } + if ((ret = + __db_ditem(dbc, pagep, indx, size)) != 0) + goto out; + } + if (argp->ind.size == 0) + HOFFSET(pagep) = file_dbp->pgsize; + pagep->lsn = argp->lsn; + } + + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) + goto out; + +next: if ((ret = __memp_fget(mpf, &argp->npgno, NULL, + 0, &pagep)) != 0) { + if (ret != DB_PAGE_NOTFOUND +#ifndef HAVE_FTRUNCATE + || DB_REDO(op) +#endif + ) { + ret = __db_pgerr(file_dbp, argp->pgno, ret); + goto out; + } else + goto done; + } + + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->nlsn); + CHECK_LSN(file_dbp->dbenv, op, cmp_p, &LSN(pagep), &argp->nlsn); + + if (cmp_p == 0 && DB_REDO(op)) { + /* Need to truncate the page. */ + REC_DIRTY(mpf, &pagep); + HOFFSET(pagep) = file_dbp->pgsize; + NUM_ENT(pagep) = 0; + pagep->lsn = *lsnp; + } else if (cmp_n == 0 && !DB_REDO(op)) { + /* Need to put the data back on the page. */ + REC_DIRTY(mpf, &pagep); + if (TYPE(pagep) == P_OVERFLOW) { + OV_REF(pagep) = OV_REF(argp->hdr.data); + OV_LEN(pagep) = OV_LEN(argp->hdr.data); + bp = (u_int8_t *) pagep + P_OVERHEAD(file_dbp); + memcpy(bp, argp->data.data, argp->data.size); + } else { + bp = (u_int8_t *)pagep + + (db_indx_t)(HOFFSET(pagep) - argp->data.size); + memcpy(bp, argp->data.data, argp->data.size); + + /* Copy index table. */ + pinp = P_INP(file_dbp, pagep) + NUM_ENT(pagep); + ninp = argp->ind.data; + for (i = 0; + i < (int)(argp->ind.size / sizeof(*ninp)); i++) + *pinp++ = *ninp++; + HOFFSET(pagep) -= argp->data.size; + NUM_ENT(pagep) = i; + } + pagep->lsn = argp->nlsn; + } + + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) + goto out; +done: + *lsnp = argp->prev_lsn; + ret = 0; + +out: REC_CLOSE; +} + +/* + * __bam_pgno_recover -- + * Recovery function for page number replacment. + * + * PUBLIC: int __bam_pgno_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__bam_pgno_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + BINTERNAL *bi; + __bam_pgno_args *argp; + DB *file_dbp; + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *pagep, *npagep; + db_pgno_t *pgnop; + int cmp_n, cmp_p, ret; + + COMPQUIET(info, NULL); + + REC_PRINT(__bam_pgno_print); + REC_INTRO(__bam_pgno_read, 1, 0); + + REC_FGET(mpf, argp->pgno, &pagep, done); + + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn); + CHECK_LSN(file_dbp->dbenv, op, cmp_p, &LSN(pagep), &argp->lsn); + + if ((cmp_p == 0 && DB_REDO(op)) || (cmp_n == 0 && !DB_REDO(op))) { + switch (TYPE(pagep)) { + case P_IBTREE: + /* + * An internal record can have both a overflow + * and child pointer. Fetch the page to see + * which it is. + */ + bi = GET_BINTERNAL(file_dbp, pagep, argp->indx); + if (B_TYPE(bi->type) == B_OVERFLOW) { + REC_FGET(mpf, argp->npgno, &npagep, out); + + if (TYPE(npagep) == P_OVERFLOW) + pgnop = + &((BOVERFLOW *)(bi->data))->pgno; + else + pgnop = &bi->pgno; + if ((ret = __memp_fput(mpf, npagep, 0)) != 0) + goto out; + break; + } + pgnop = &bi->pgno; + break; + case P_IRECNO: + pgnop = + &GET_RINTERNAL(file_dbp, pagep, argp->indx)->pgno; + break; + default: + pgnop = + &GET_BOVERFLOW(file_dbp, pagep, argp->indx)->pgno; + break; + } + + if (DB_REDO(op)) { + /* Need to redo update described. */ + REC_DIRTY(mpf, &pagep); + *pgnop = argp->npgno; + pagep->lsn = *lsnp; + } else { + REC_DIRTY(mpf, &pagep); + *pgnop = argp->opgno; + pagep->lsn = argp->lsn; + } + } + + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) + goto out; + +done: + *lsnp = argp->prev_lsn; + ret = 0; + +out: REC_CLOSE; +} + +/* + * __bam_relink_43_recover -- + * Recovery function for relink. + * + * PUBLIC: int __bam_relink_43_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__bam_relink_43_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + __bam_relink_43_args *argp; + DB *file_dbp; + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *pagep; + int cmp_n, cmp_p, modified, ret; + + pagep = NULL; + COMPQUIET(info, NULL); + REC_PRINT(__bam_relink_43_print); + REC_INTRO(__bam_relink_43_read, 1, 0); + + /* + * There are up to three pages we need to check -- the page, and the + * previous and next pages, if they existed. For a page add operation, + * the current page is the result of a split and is being recovered + * elsewhere, so all we need do is recover the next page. + */ + if ((ret = __memp_fget(mpf, &argp->pgno, NULL, 0, &pagep)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -1029,13 +1436,13 @@ __bam_relink_recover(dbenv, dbtp, lsnp, op, info) } modified = 0; - cmp_p = log_compare(&LSN(pagep), &argp->lsn); - CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->lsn); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn); if (cmp_p == 0 && DB_REDO(op)) { /* Redo the relink. */ pagep->lsn = *lsnp; modified = 1; - } else if (log_compare(lsnp, &LSN(pagep)) == 0 && DB_UNDO(op)) { + } else if (LOG_COMPARE(lsnp, &LSN(pagep)) == 0 && DB_UNDO(op)) { /* Undo the relink. */ pagep->next_pgno = argp->next; pagep->prev_pgno = argp->prev; @@ -1047,7 +1454,7 @@ __bam_relink_recover(dbenv, dbtp, lsnp, op, info) goto out; pagep = NULL; -next2: if ((ret = __memp_fget(mpf, &argp->next, 0, &pagep)) != 0) { +next2: if ((ret = __memp_fget(mpf, &argp->next, NULL, 0, &pagep)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -1060,31 +1467,31 @@ next2: if ((ret = __memp_fget(mpf, &argp->next, 0, &pagep)) != 0) { } modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - cmp_p = log_compare(&LSN(pagep), &argp->lsn_next); - CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->lsn_next); + cmp_n = LOG_COMPARE(lsnp, &LSN(pagep)); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn_next); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn_next); if (cmp_p == 0 && DB_REDO(op)) { /* Redo the remove or undo the add. */ + REC_DIRTY(mpf, &pagep); pagep->prev_pgno = argp->prev; - modified = 1; } else if (cmp_n == 0 && DB_UNDO(op)) { /* Undo the remove or redo the add. */ + REC_DIRTY(mpf, &pagep); pagep->prev_pgno = argp->pgno; - modified = 1; } - if (modified == 1) { + if (modified) { if (DB_UNDO(op)) pagep->lsn = argp->lsn_next; else pagep->lsn = *lsnp; } - if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) goto out; pagep = NULL; -prev: if ((ret = __memp_fget(mpf, &argp->prev, 0, &pagep)) != 0) { +prev: if ((ret = __memp_fget(mpf, &argp->prev, NULL, 0, &pagep)) != 0) { if (ret != DB_PAGE_NOTFOUND #ifndef HAVE_FTRUNCATE || DB_REDO(op) @@ -1097,26 +1504,26 @@ prev: if ((ret = __memp_fget(mpf, &argp->prev, 0, &pagep)) != 0) { } modified = 0; - cmp_p = log_compare(&LSN(pagep), &argp->lsn_prev); - CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->lsn_prev); + cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn_prev); + CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn_prev); if (cmp_p == 0 && DB_REDO(op)) { /* Redo the relink. */ + REC_DIRTY(mpf, &pagep); pagep->next_pgno = argp->next; - modified = 1; - } else if (log_compare(lsnp, &LSN(pagep)) == 0 && DB_UNDO(op)) { + } else if (LOG_COMPARE(lsnp, &LSN(pagep)) == 0 && DB_UNDO(op)) { /* Undo the relink. */ + REC_DIRTY(mpf, &pagep); pagep->next_pgno = argp->pgno; - modified = 1; } - if (modified == 1) { + if (modified) { if (DB_UNDO(op)) pagep->lsn = argp->lsn_prev; else pagep->lsn = *lsnp; } - if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = __memp_fput(mpf, pagep, 0)) != 0) goto out; pagep = NULL; diff --git a/db/btree/bt_reclaim.c b/db/btree/bt_reclaim.c index ee722a30f..d48c9dfcf 100644 --- a/db/btree/bt_reclaim.c +++ b/db/btree/bt_reclaim.c @@ -1,23 +1,18 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1998-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1998-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_reclaim.c,v 11.15 2004/01/28 03:35:49 bostic Exp $ + * $Id: bt_reclaim.c,v 12.6 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/btree.h" +#include "dbinc/lock.h" /* * __bam_reclaim -- @@ -31,18 +26,28 @@ __bam_reclaim(dbp, txn) DB_TXN *txn; { DBC *dbc; + DB_LOCK meta_lock; int ret, t_ret; /* Acquire a cursor. */ if ((ret = __db_cursor(dbp, txn, &dbc, 0)) != 0) return (ret); + /* Write lock the metapage for deallocations. */ + if ((ret = __db_lget(dbc, + 0, PGNO_BASE_MD, DB_LOCK_WRITE, 0, &meta_lock)) != 0) + goto err; + + /* Avoid locking every page, we have the handle locked exclusive. */ + F_SET(dbc, DBC_DONTLOCK); + /* Walk the tree, freeing pages. */ ret = __bam_traverse(dbc, DB_LOCK_WRITE, dbc->internal->root, __db_reclaim_callback, dbc); + __TLPUT(dbc, meta_lock); /* Discard the cursor. */ - if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0) +err: if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); @@ -69,7 +74,8 @@ __bam_truncate(dbc, countp) ret = __bam_traverse(dbc, DB_LOCK_WRITE, dbc->internal->root, __db_truncate_callback, &trunc); - *countp = trunc.count; + if (countp != NULL) + *countp = trunc.count; return (ret); } diff --git a/db/btree/bt_recno.c b/db/btree/bt_recno.c index 78f149dd6..e0a8b393b 100644 --- a/db/btree/bt_recno.c +++ b/db/btree/bt_recno.c @@ -1,25 +1,19 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1997-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_recno.c,v 11.117 2004/03/28 17:01:01 bostic Exp $ + * $Id: bt_recno.c,v 12.28 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/btree.h" -#include "dbinc/db_shash.h" #include "dbinc/lock.h" +#include "dbinc/mp.h" static int __ram_add __P((DBC *, db_recno_t *, DBT *, u_int32_t, u_int32_t)); static int __ram_source __P((DB *)); @@ -203,8 +197,7 @@ __ram_c_del(dbc) DB *dbp; DB_LSN lsn; DBT hdr, data; - EPG *epg; - int exact, ret, stack, t_ret; + int exact, nc, ret, stack, t_ret; dbp = dbc->dbp; cp = (BTREE_CURSOR *)dbc->internal; @@ -226,7 +219,7 @@ __ram_c_del(dbc) return (DB_KEYEMPTY); /* Search the tree for the key; delete only deletes exact matches. */ - if ((ret = __bam_rsearch(dbc, &cp->recno, S_DELETE, 1, &exact)) != 0) + if ((ret = __bam_rsearch(dbc, &cp->recno, SR_DELETE, 1, &exact)) != 0) goto err; if (!exact) { ret = DB_NOTFOUND; @@ -235,6 +228,8 @@ __ram_c_del(dbc) stack = 1; /* Copy the page into the cursor. */ + if ((ret = __memp_dirty(dbp->mpf, &cp->csp->page, dbc->txn, 0)) != 0) + goto err; STACK_TO_CURSOR(cp, ret); if (ret != 0) goto err; @@ -261,7 +256,9 @@ __ram_c_del(dbc) goto err; if ((ret = __bam_adjust(dbc, -1)) != 0) goto err; - if (__ram_ca(dbc, CA_DELETE) > 0 && + if ((ret = __ram_ca(dbc, CA_DELETE, &nc)) != 0) + goto err; + if (nc > 0 && CURADJ_LOG(dbc) && (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0, CA_DELETE, cp->root, cp->recno, cp->order)) != 0) goto err; @@ -280,21 +277,11 @@ __ram_c_del(dbc) * are closed, and then clean it up. */ if (NUM_ENT(cp->page) == 0 && PGNO(cp->page) != cp->root) { - /* - * We already have a locked stack of pages. However, - * there are likely entries in the stack that aren't - * going to be emptied by removing the single reference - * to the emptied page (or one of its parents). - */ - for (epg = cp->csp; epg >= cp->sp; --epg) - if (NUM_ENT(epg->page) > 1) - break; - /* * We want to delete a single item out of the last page * that we're not deleting. */ - ret = __bam_dpages(dbc, epg); + ret = __bam_dpages(dbc, 0, 0); /* * Regardless of the return from __bam_dpages, it will @@ -308,14 +295,10 @@ __ram_c_del(dbc) if ((ret = __bam_ditem(dbc, cp->page, cp->indx)) != 0) goto err; - B_TSET(bk.type, B_KEYDATA, 1); + B_TSET_DELETED(bk.type, B_KEYDATA); bk.len = 0; - memset(&hdr, 0, sizeof(hdr)); - hdr.data = &bk; - hdr.size = SSZA(BKEYDATA, data); - memset(&data, 0, sizeof(data)); - data.data = (void *)""; - data.size = 0; + DB_INIT_DBT(hdr, &bk, SSZA(BKEYDATA, data)); + DB_INIT_DBT(data, "", 0); if ((ret = __db_pitem(dbc, cp->page, cp->indx, BKEYDATA_SIZE(0), &hdr, &data)) != 0) goto err; @@ -488,7 +471,7 @@ retry: switch (flags) { for (;; ++cp->recno) { /* Search the tree for the record. */ if ((ret = __bam_rsearch(dbc, &cp->recno, - F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND, + F_ISSET(dbc, DBC_RMW) ? SR_FIND_WR : SR_FIND, 1, &exact)) != 0) goto err; if (!exact) { @@ -538,7 +521,7 @@ retry: switch (flags) { if (flags == DB_GET_BOTH || flags == DB_GET_BOTHC || flags == DB_GET_BOTH_RANGE) { - if ((ret = __bam_cmp(dbp, data, + if ((ret = __bam_cmp(dbp, dbc->txn, data, cp->page, cp->indx, __bam_defcmp, &cmp)) != 0) return (ret); if (cmp == 0) @@ -553,12 +536,10 @@ retry: switch (flags) { } /* Return the key if the user didn't give us one. */ - if (!F_ISSET(dbc, DBC_OPD)) { - if (flags != DB_GET_BOTH && flags != DB_GET_BOTH_RANGE && - flags != DB_SET && flags != DB_SET_RANGE) - ret = __db_retcopy(dbp->dbenv, - key, &cp->recno, sizeof(cp->recno), - &dbc->rkey->data, &dbc->rkey->ulen); + if (!F_ISSET(dbc, DBC_OPD) && !F_ISSET(key, DB_DBT_ISSET)) { + ret = __db_retcopy(dbp->dbenv, + key, &cp->recno, sizeof(cp->recno), + &dbc->rkey->data, &dbc->rkey->ulen); F_SET(key, DB_DBT_ISSET); } @@ -583,14 +564,16 @@ __ram_c_put(dbc, key, data, flags, pgnop) { BTREE_CURSOR *cp; DB *dbp; + DB_ENV *dbenv; DB_LSN lsn; - int exact, nc, ret, t_ret; u_int32_t iiflags; + int exact, nc, ret, t_ret; void *arg; COMPQUIET(pgnop, NULL); dbp = dbc->dbp; + dbenv = dbp->dbenv; cp = (BTREE_CURSOR *)dbc->internal; /* @@ -623,15 +606,12 @@ __ram_c_put(dbc, key, data, flags, pgnop) * Handle normal DB_KEYFIRST/DB_KEYLAST; for a recno, which has * no duplicates, these are identical and mean "put the given * datum at the given recno". - * - * Note that the code here used to be in __ram_put; now, we - * go through the access-method-common __db_put function, which - * handles DB_NOOVERWRITE, so we and __ram_add don't have to. */ - if (flags == DB_KEYFIRST || flags == DB_KEYLAST) { + if (flags == DB_KEYFIRST || + flags == DB_KEYLAST || flags == DB_NOOVERWRITE) { ret = __ram_getno(dbc, key, &cp->recno, 1); if (ret == 0 || ret == DB_NOTFOUND) - ret = __ram_add(dbc, &cp->recno, data, 0, 0); + ret = __ram_add(dbc, &cp->recno, data, flags, 0); return (ret); } @@ -648,13 +628,13 @@ __ram_c_put(dbc, key, data, flags, pgnop) else iiflags = flags; -split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) +split: if ((ret = __bam_rsearch(dbc, &cp->recno, SR_INSERT, 1, &exact)) != 0) goto err; /* * An inexact match is okay; it just means we're one record past the * end, which is reasonable if we're marked deleted. */ - DB_ASSERT(exact || CD_ISSET(cp)); + DB_ASSERT(dbenv, exact || CD_ISSET(cp)); /* Copy the page into the cursor. */ STACK_TO_CURSOR(cp, ret); @@ -677,7 +657,8 @@ split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) switch (flags) { /* Adjust the cursors. */ case DB_AFTER: - nc = __ram_ca(dbc, CA_IAFTER); + if ((ret = __ram_ca(dbc, CA_IAFTER, &nc)) != 0) + goto err; /* * We only need to adjust this cursor forward if we truly added @@ -694,7 +675,8 @@ split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) goto err; break; case DB_BEFORE: - nc = __ram_ca(dbc, CA_IBEFORE); + if ((ret = __ram_ca(dbc, CA_IBEFORE, &nc)) != 0) + goto err; --cp->recno; /* Only log if __ram_ca found any relevant cursors. */ @@ -708,11 +690,14 @@ split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) * We only need to do an adjustment if we actually * added an item, which we only would have done if the * cursor was marked deleted. - * - * Only log if __ram_ca found any relevant cursors. */ - if (CD_ISSET(cp) && __ram_ca(dbc, CA_ICURRENT) > 0 && - CURADJ_LOG(dbc) && + if (!CD_ISSET(cp)) + break; + + /* Only log if __ram_ca found any relevant cursors. */ + if ((ret = __ram_ca(dbc, CA_ICURRENT, &nc)) != 0) + goto err; + if (nc > 0 && CURADJ_LOG(dbc) && (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0, CA_ICURRENT, cp->root, cp->recno, cp->order)) != 0) goto err; @@ -723,7 +708,7 @@ split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) /* Return the key if we've created a new record. */ if (!F_ISSET(dbc, DBC_OPD) && (flags == DB_AFTER || flags == DB_BEFORE)) - ret = __db_retcopy(dbp->dbenv, key, &cp->recno, + ret = __db_retcopy(dbenv, key, &cp->recno, sizeof(cp->recno), &dbc->rkey->data, &dbc->rkey->ulen); /* The cursor was reset, no further delete adjustment is necessary. */ @@ -736,39 +721,37 @@ err: CD_CLR(cp); * __ram_ca -- * Adjust cursors. Returns the number of relevant cursors. * - * PUBLIC: int __ram_ca __P((DBC *, ca_recno_arg)); + * PUBLIC: int __ram_ca __P((DBC *, ca_recno_arg, int *)); */ int -__ram_ca(dbc_arg, op) +__ram_ca(dbc_arg, op, foundp) DBC *dbc_arg; ca_recno_arg op; + int *foundp; { BTREE_CURSOR *cp, *cp_arg; DB *dbp, *ldbp; DB_ENV *dbenv; DBC *dbc; db_recno_t recno; - int adjusted, found; u_int32_t order; + int adjusted, found; dbp = dbc_arg->dbp; dbenv = dbp->dbenv; cp_arg = (BTREE_CURSOR *)dbc_arg->internal; recno = cp_arg->recno; - found = 0; - /* * It only makes sense to adjust cursors if we're a renumbering * recno; we should only be called if this is one. */ - DB_ASSERT(F_ISSET(cp_arg, C_RENUMBER)); + DB_ASSERT(dbenv, F_ISSET(cp_arg, C_RENUMBER)); - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); + MUTEX_LOCK(dbenv, dbenv->mtx_dblist); /* * Adjust the cursors. See the comment in __bam_ca_delete(). - */ - /* + * * If we're doing a delete, we need to find the highest * order of any cursor currently pointing at this item, * so we can assign a higher order to the newly deleted @@ -776,33 +759,34 @@ __ram_ca(dbc_arg, op) * the cursor list. */ if (op == CA_DELETE) { - order = 1; - for (ldbp = __dblist_get(dbenv, dbp->adj_fileid); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (order = 1; ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { - MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { + MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) { cp = (BTREE_CURSOR *)dbc->internal; if (cp_arg->root == cp->root && recno == cp->recno && CD_ISSET(cp) && - order <= cp->order) + order <= cp->order && + !MVCC_SKIP_CURADJ(dbc, cp->root)) order = cp->order + 1; } - MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbenv, dbp->mutex); } } else order = INVALID_ORDER; /* Now go through and do the actual adjustments. */ - for (ldbp = __dblist_get(dbenv, dbp->adj_fileid); + FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp); + for (found = 0; ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid; - ldbp = LIST_NEXT(ldbp, dblistlinks)) { - MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&ldbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { + ldbp = TAILQ_NEXT(ldbp, dblistlinks)) { + MUTEX_LOCK(dbenv, dbp->mutex); + TAILQ_FOREACH(dbc, &ldbp->active_queue, links) { cp = (BTREE_CURSOR *)dbc->internal; - if (cp_arg->root != cp->root) + if (cp_arg->root != cp->root || + MVCC_SKIP_CURADJ(dbc, cp->root)) continue; ++found; adjusted = 0; @@ -844,7 +828,7 @@ __ram_ca(dbc_arg, op) * marked undeleted and point to the new * item. */ - DB_ASSERT(CD_ISSET(cp_arg)); + DB_ASSERT(dbenv, CD_ISSET(cp_arg)); if (C_EQUAL(cp_arg, cp)) { CD_CLR(cp); break; @@ -868,11 +852,13 @@ iafter: if (!adjusted && C_LESSTHAN(cp_arg, cp)) { break; } } - MUTEX_THREAD_UNLOCK(dbp->dbenv, dbp->mutexp); + MUTEX_UNLOCK(dbp->dbenv, dbp->mutex); } - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); + MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist); - return (found); + if (foundp != NULL) + *foundp = found; + return (0); } /* @@ -895,7 +881,7 @@ __ram_getno(dbc, key, rep, can_create) /* Check the user's record number. */ if ((recno = *(db_recno_t *)key->data) == 0) { - __db_err(dbp->dbenv, "illegal record number of 0"); + __db_errx(dbp->dbenv, "illegal record number of 0"); return (EINVAL); } if (rep != NULL) @@ -974,17 +960,19 @@ static int __ram_source(dbp) DB *dbp; { + DB_ENV *dbenv; BTREE *t; char *source; int ret; + dbenv = dbp->dbenv; t = dbp->bt_internal; /* Find the real name, and swap out the one we had before. */ - if ((ret = __db_appname(dbp->dbenv, + if ((ret = __db_appname(dbenv, DB_APP_DATA, t->re_source, 0, NULL, &source)) != 0) return (ret); - __os_free(dbp->dbenv, t->re_source); + __os_free(dbenv, t->re_source); t->re_source = source; /* @@ -993,9 +981,9 @@ __ram_source(dbp) * much care other than we'll complain if there are any modifications * when it comes time to write the database back to the source. */ - if ((t->re_fp = fopen(t->re_source, "r")) == NULL) { + if ((t->re_fp = fopen(t->re_source, "rb")) == NULL) { ret = __os_get_errno(); - __db_err(dbp->dbenv, "%s: %s", t->re_source, db_strerror(ret)); + __db_err(dbenv, ret, "%s", t->re_source); return (ret); } @@ -1037,6 +1025,18 @@ __ram_writeback(dbp) return (0); } + /* + * We step through the records, writing each one out. Use the record + * number and the dbp->get() function, instead of a cursor, so we find + * and write out "deleted" or non-existent records. The DB handle may + * be threaded, so allocate memory as we go. + */ + memset(&key, 0, sizeof(key)); + key.size = sizeof(db_recno_t); + key.data = &keyno; + memset(&data, 0, sizeof(data)); + F_SET(&data, DB_DBT_REALLOC); + /* Allocate a cursor. */ if ((ret = __db_cursor(dbp, NULL, &dbc, 0)) != 0) return (ret); @@ -1064,7 +1064,7 @@ __ram_writeback(dbp) */ if ((ret = __ram_update(dbc, DB_MAX_RECORDS, 0)) != 0 && ret != DB_NOTFOUND) - return (ret); + goto err; /* * Close any existing file handle and re-open the file, truncating it. @@ -1072,28 +1072,17 @@ __ram_writeback(dbp) if (t->re_fp != NULL) { if (fclose(t->re_fp) != 0) { ret = __os_get_errno(); + __db_err(dbenv, ret, "%s", t->re_source); goto err; } t->re_fp = NULL; } - if ((fp = fopen(t->re_source, "w")) == NULL) { + if ((fp = fopen(t->re_source, "wb")) == NULL) { ret = __os_get_errno(); - __db_err(dbenv, "%s: %s", t->re_source, db_strerror(ret)); + __db_err(dbenv, ret, "%s", t->re_source); goto err; } - /* - * We step through the records, writing each one out. Use the record - * number and the dbp->get() function, instead of a cursor, so we find - * and write out "deleted" or non-existent records. The DB handle may - * be threaded, so allocate memory as we go. - */ - memset(&key, 0, sizeof(key)); - key.size = sizeof(db_recno_t); - key.data = &keyno; - memset(&data, 0, sizeof(data)); - F_SET(&data, DB_DBT_REALLOC); - /* * We'll need the delimiter if we're doing variable-length records, * and the pad character if we're doing fixed-length records. @@ -1127,9 +1116,8 @@ __ram_writeback(dbp) if (!F_ISSET(dbp, DB_AM_FIXEDLEN) && fwrite(&delim, 1, 1, fp) != 1) { write_err: ret = __os_get_errno(); - __db_err(dbenv, - "%s: write failed to backing file: %s", - t->re_source, strerror(ret)); + __db_err(dbenv, ret, + "%s: write failed to backing file", t->re_source); goto err; } } @@ -1138,9 +1126,9 @@ err: done: /* Close the file descriptor. */ if (fp != NULL && fclose(fp) != 0) { t_ret = __os_get_errno(); + __db_err(dbenv, t_ret, "%s", t->re_source); if (ret == 0) ret = t_ret; - __db_err(dbenv, "%s: %s", t->re_source, db_strerror(t_ret)); } /* Discard the cursor. */ @@ -1205,7 +1193,7 @@ __ram_sread(dbc, top) data.size = 0; if (F_ISSET(dbp, DB_AM_FIXEDLEN)) for (len = t->re_len; len > 0; --len) { - if ((ch = getc(t->re_fp)) == EOF) { + if ((ch = fgetc(t->re_fp)) == EOF) { if (data.size == 0) goto eof; break; @@ -1214,7 +1202,7 @@ __ram_sread(dbc, top) } else for (;;) { - if ((ch = getc(t->re_fp)) == EOF) { + if ((ch = fgetc(t->re_fp)) == EOF) { if (data.size == 0) goto eof; break; @@ -1278,7 +1266,7 @@ __ram_add(dbc, recnop, data, flags, bi_flags) retry: /* Find the slot for insertion. */ if ((ret = __bam_rsearch(dbc, recnop, - S_INSERT | (flags == DB_APPEND ? S_APPEND : 0), 1, &exact)) != 0) + SR_INSERT | (flags == DB_APPEND ? SR_APPEND : 0), 1, &exact)) != 0) return (ret); stack = 1; @@ -1287,6 +1275,12 @@ retry: /* Find the slot for insertion. */ if (ret != 0) goto err; + if (exact && flags == DB_NOOVERWRITE && !CD_ISSET(cp) && + !B_DISSET(GET_BKEYDATA(dbc->dbp, cp->page, cp->indx)->type)) { + ret = DB_KEYEXIST; + goto err; + } + /* * The application may modify the data based on the selected record * number. diff --git a/db/btree/bt_rsearch.c b/db/btree/bt_rsearch.c index 0027ec9e4..8a916c117 100644 --- a/db/btree/bt_rsearch.c +++ b/db/btree/bt_rsearch.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 @@ -36,19 +36,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bt_rsearch.c,v 11.40 2004/07/23 17:21:09 bostic Exp $ + * $Id: bt_rsearch.c,v 12.11 2006/08/24 14:44:44 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/btree.h" -#include "dbinc/db_shash.h" #include "dbinc/lock.h" #include "dbinc/mp.h" @@ -100,44 +95,14 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) * * Retrieve the root page. */ - pg = cp->root; - stack = LF_ISSET(S_STACK) ? 1 : 0; - lock_mode = stack ? DB_LOCK_WRITE : DB_LOCK_READ; - if ((ret = __db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) - return (ret); - if ((ret = __memp_fget(mpf, &pg, 0, &h)) != 0) { - /* Did not read it, so we can release the lock */ - (void)__LPUT(dbc, lock); - return (ret); - } - /* - * Decide if we need to save this page; if we do, write lock it. - * We deliberately don't lock-couple on this call. If the tree - * is tiny, i.e., one page, and two threads are busily updating - * the root page, we're almost guaranteed deadlocks galore, as - * each one gets a read lock and then blocks the other's attempt - * for a write lock. - */ - if (!stack && - ((LF_ISSET(S_PARENT) && (u_int8_t)(stop + 1) >= h->level) || - (LF_ISSET(S_WRITE) && h->level == LEAFLEVEL))) { - ret = __memp_fput(mpf, h, 0); - if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0) - ret = t_ret; - if (ret != 0) - return (ret); - lock_mode = DB_LOCK_WRITE; - if ((ret = __db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) - return (ret); - if ((ret = __memp_fget(mpf, &pg, 0, &h)) != 0) { - /* Did not read it, so we can release the lock */ - (void)__LPUT(dbc, lock); - return (ret); - } - stack = 1; - } + if ((ret = __bam_get_root(dbc, cp->root, stop, flags, &stack)) != 0) + return (ret); + lock_mode = cp->csp->lock_mode; + lock = cp->csp->lock; + h = cp->csp->page; + BT_STK_CLR(cp); /* * If appending to the tree, set the record number now -- we have the * root page locked. @@ -151,7 +116,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) * a fast check now. */ total = RE_NREC(h); - if (LF_ISSET(S_APPEND)) { + if (LF_ISSET(SR_APPEND)) { *exactp = 0; *recnop = recno = total + 1; } else { @@ -160,7 +125,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) *exactp = 1; else { *exactp = 0; - if (!LF_ISSET(S_PAST_EOF) || recno > total + 1) { + if (!LF_ISSET(SR_PAST_EOF) || recno > total + 1) { /* * Keep the page locked for serializability. * @@ -203,7 +168,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) for (t_recno = 0, indx = 0;; indx += adjust) { if (indx >= NUM_ENT(h)) { *exactp = 0; - if (!LF_ISSET(S_PAST_EOF) || + if (!LF_ISSET(SR_PAST_EOF) || recno > t_recno + 1) { ret = __memp_fput(mpf, h, 0); h = NULL; @@ -260,15 +225,15 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) } --indx; + /* Return if this is the lowest page wanted. */ + if (stop == LEVEL(h)) { + BT_STK_ENTER(dbp->dbenv, + cp, h, indx, lock, lock_mode, ret); + if (ret != 0) + goto err; + return (0); + } if (stack) { - /* Return if this is the lowest page wanted. */ - if (LF_ISSET(S_PARENT) && stop == h->level) { - BT_STK_ENTER(dbp->dbenv, - cp, h, indx, lock, lock_mode, ret); - if (ret != 0) - goto err; - return (0); - } BT_STK_PUSH(dbp->dbenv, cp, h, indx, lock, lock_mode, ret); if (ret != 0) @@ -285,9 +250,9 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) * page in the stack. If we do, write lock it and * never unlock it. */ - if ((LF_ISSET(S_PARENT) && - (u_int8_t)(stop + 1) >= (u_int8_t)(h->level - 1)) || - (h->level - 1) == LEAFLEVEL) + if ((LF_ISSET(SR_PARENT) && + (u_int8_t)(stop + 1) >= (u_int8_t)(LEVEL(h) - 1)) || + (LEVEL(h) - 1) == LEAFLEVEL) stack = 1; if ((ret = __memp_fput(mpf, h, 0)) != 0) @@ -295,7 +260,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) h = NULL; lock_mode = stack && - LF_ISSET(S_WRITE) ? DB_LOCK_WRITE : DB_LOCK_READ; + LF_ISSET(SR_WRITE) ? DB_LOCK_WRITE : DB_LOCK_READ; if ((ret = __db_lget(dbc, LCK_COUPLE_ALWAYS, pg, lock_mode, 0, &lock)) != 0) { /* @@ -308,7 +273,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) } } - if ((ret = __memp_fget(mpf, &pg, 0, &h)) != 0) + if ((ret = __memp_fget(mpf, &pg, dbc->txn, 0, &h)) != 0) goto err; } /* NOTREACHED */ @@ -350,6 +315,9 @@ __bam_adjust(dbc, adjust) for (epg = cp->sp; epg <= cp->csp; ++epg) { h = epg->page; if (TYPE(h) == P_IBTREE || TYPE(h) == P_IRECNO) { + if ((ret = __memp_dirty(mpf, &h, dbc->txn, 0)) != 0) + return (ret); + epg->page = h; if (DBC_LOGGING(dbc)) { if ((ret = __bam_cadjust_log(dbp, dbc->txn, &LSN(h), 0, PGNO(h), &LSN(h), @@ -369,9 +337,6 @@ __bam_adjust(dbc, adjust) if (PGNO(h) == root_pgno) RE_NREC_ADJ(h, adjust); - - if ((ret = __memp_fset(mpf, h, DB_MPOOL_DIRTY)) != 0) - return (ret); } } return (0); @@ -401,7 +366,7 @@ __bam_nrecs(dbc, rep) pgno = dbc->internal->root; if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0) return (ret); - if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) + if ((ret = __memp_fget(mpf, &pgno, dbc->txn, 0, &h)) != 0) return (ret); *rep = RE_NREC(h); diff --git a/db/btree/bt_search.c b/db/btree/bt_search.c index 4fb07f446..e125b9f9b 100644 --- a/db/btree/bt_search.c +++ b/db/btree/bt_search.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 @@ -39,70 +39,44 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bt_search.c,v 11.50 2004/07/23 17:21:09 bostic Exp $ + * $Id: bt_search.c,v 12.24 2006/08/24 14:44:45 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" -#include "dbinc/db_shash.h" #include "dbinc/btree.h" #include "dbinc/lock.h" #include "dbinc/mp.h" /* - * __bam_search -- - * Search a btree for a key. + * __bam_get_root -- + * Fetch the root of a tree and see if we want to keep + * it in the stack. * - * PUBLIC: int __bam_search __P((DBC *, db_pgno_t, - * PUBLIC: const DBT *, u_int32_t, int, db_recno_t *, int *)); + * PUBLIC: int __bam_get_root __P((DBC *, db_pgno_t, int, u_int32_t, int *)); */ int -__bam_search(dbc, root_pgno, key, flags, stop, recnop, exactp) +__bam_get_root(dbc, pg, slevel, flags, stack) DBC *dbc; - db_pgno_t root_pgno; - const DBT *key; + db_pgno_t pg; + int slevel; u_int32_t flags; - int stop, *exactp; - db_recno_t *recnop; + int *stack; { - BTREE *t; BTREE_CURSOR *cp; DB *dbp; DB_LOCK lock; DB_MPOOLFILE *mpf; PAGE *h; - db_indx_t base, i, indx, *inp, lim; db_lockmode_t lock_mode; - db_pgno_t pg; - db_recno_t recno; - int adjust, cmp, deloffset, ret, stack, t_ret; - int (*func) __P((DB *, const DBT *, const DBT *)); + int ret, t_ret; dbp = dbc->dbp; mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; - h = NULL; - t = dbp->bt_internal; - recno = 0; - - BT_STK_CLR(cp); - /* - * There are several ways we search a btree tree. The flags argument - * specifies if we're acquiring read or write locks, if we position - * to the first or last item in a set of duplicates, if we return - * deleted items, and if we are locking pairs of pages. In addition, - * if we're modifying record numbers, we have to lock the entire tree - * regardless. See btree.h for more details. - * * If write-locking pages, we need to know whether or not to acquire a * write lock on a page before getting it. This depends on how deep it * is in tree, which we don't know until we acquire the root page. So, @@ -112,12 +86,15 @@ __bam_search(dbc, root_pgno, key, flags, stop, recnop, exactp) * Retrieve the root page. */ try_again: - pg = root_pgno == PGNO_INVALID ? cp->root : root_pgno; - stack = LF_ISSET(S_STACK) && F_ISSET(cp, C_RECNUM); - lock_mode = stack ? DB_LOCK_WRITE : DB_LOCK_READ; + *stack = LF_ISSET(SR_STACK) && + (dbc->dbtype == DB_RECNO || F_ISSET(cp, C_RECNUM)); + lock_mode = DB_LOCK_READ; + if (*stack || + LF_ISSET(SR_DEL) || (LF_ISSET(SR_NEXT) && LF_ISSET(SR_WRITE))) + lock_mode = DB_LOCK_WRITE; if ((ret = __db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) return (ret); - if ((ret = __memp_fget(mpf, &pg, 0, &h)) != 0) { + if ((ret = __memp_fget(mpf, &pg, dbc->txn, 0, &h)) != 0) { /* Did not read it, so we can release the lock */ (void)__LPUT(dbc, lock); return (ret); @@ -131,9 +108,12 @@ try_again: * each one gets a read lock and then blocks the other's attempt * for a write lock. */ - if (!stack && - ((LF_ISSET(S_PARENT) && (u_int8_t)(stop + 1) >= h->level) || - (LF_ISSET(S_WRITE) && h->level == LEAFLEVEL))) { + if (!*stack && + ((LF_ISSET(SR_PARENT) && (u_int8_t)(slevel + 1) >= LEVEL(h)) || + (LF_ISSET(SR_WRITE) && LEVEL(h) == LEAFLEVEL) || + (LF_ISSET(SR_START) && slevel == LEVEL(h)))) { + if (!STD_LOCKING(dbc)) + goto no_relock; ret = __memp_fput(mpf, h, 0); if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0) ret = t_ret; @@ -142,14 +122,15 @@ try_again: lock_mode = DB_LOCK_WRITE; if ((ret = __db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) return (ret); - if ((ret = __memp_fget(mpf, &pg, 0, &h)) != 0) { + if ((ret = __memp_fget(mpf, &pg, dbc->txn, 0, &h)) != 0) { /* Did not read it, so we can release the lock */ (void)__LPUT(dbc, lock); return (ret); } - if (!((LF_ISSET(S_PARENT) && - (u_int8_t)(stop + 1) >= h->level) || - (LF_ISSET(S_WRITE) && h->level == LEAFLEVEL))) { + if (!((LF_ISSET(SR_PARENT) && + (u_int8_t)(slevel + 1) >= LEVEL(h)) || + (LF_ISSET(SR_WRITE) && LEVEL(h) == LEAFLEVEL) || + (LF_ISSET(SR_START) && slevel == LEVEL(h)))) { /* Someone else split the root, start over. */ ret = __memp_fput(mpf, h, 0); if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0) @@ -158,8 +139,71 @@ try_again: return (ret); goto try_again; } - stack = 1; +no_relock: *stack = 1; } + BT_STK_ENTER(dbp->dbenv, cp, h, 0, lock, lock_mode, ret); + + return (ret); +} + +/* + * __bam_search -- + * Search a btree for a key. + * + * PUBLIC: int __bam_search __P((DBC *, db_pgno_t, + * PUBLIC: const DBT *, u_int32_t, int, db_recno_t *, int *)); + */ +int +__bam_search(dbc, root_pgno, key, flags, slevel, recnop, exactp) + DBC *dbc; + db_pgno_t root_pgno; + const DBT *key; + u_int32_t flags; + int slevel, *exactp; + db_recno_t *recnop; +{ + BTREE *t; + BTREE_CURSOR *cp; + DB *dbp; + DB_ENV *dbenv; + DB_LOCK lock; + DB_MPOOLFILE *mpf; + PAGE *h; + db_indx_t base, i, indx, *inp, lim; + db_lockmode_t lock_mode; + db_pgno_t pg; + db_recno_t recno; + int adjust, cmp, deloffset, ret, stack, t_ret; + int (*func) __P((DB *, const DBT *, const DBT *)); + + dbp = dbc->dbp; + dbenv = dbp->dbenv; + mpf = dbp->mpf; + cp = (BTREE_CURSOR *)dbc->internal; + h = NULL; + t = dbp->bt_internal; + recno = 0; + + BT_STK_CLR(cp); + + /* + * There are several ways we search a btree tree. The flags argument + * specifies if we're acquiring read or write locks, if we position + * to the first or last item in a set of duplicates, if we return + * deleted items, and if we are locking pairs of pages. In addition, + * if we're modifying record numbers, we have to lock the entire tree + * regardless. See btree.h for more details. + */ + + if (root_pgno == PGNO_INVALID) + root_pgno = cp->root; + if ((ret = __bam_get_root(dbc, root_pgno, slevel, flags, &stack)) != 0) + return (ret); + lock_mode = cp->csp->lock_mode; + lock = cp->csp->lock; + h = cp->csp->page; + + BT_STK_CLR(cp); /* Choose a comparison function. */ func = F_ISSET(dbc, DBC_OPD) ? @@ -168,6 +212,23 @@ try_again: for (;;) { inp = P_INP(dbp, h); + adjust = TYPE(h) == P_LBTREE ? P_INDX : O_INDX; + if (LF_ISSET(SR_MIN | SR_MAX)) { + if (LF_ISSET(SR_MIN) || NUM_ENT(h) == 0) + indx = 0; + else if (TYPE(h) == P_LBTREE) + indx = NUM_ENT(h) - 2; + else + indx = NUM_ENT(h) - 1; + + if (LEVEL(h) == LEAFLEVEL || + (!LF_ISSET(SR_START) && LEVEL(h) == slevel)) { + if (LF_ISSET(SR_NEXT)) + goto get_next; + goto found; + } + goto next; + } /* * Do a binary search on the current page. If we're searching * a Btree leaf page, we have to walk the indices in groups of @@ -175,16 +236,20 @@ try_again: * page, they're an index per page item. If we find an exact * match on a leaf page, we're done. */ - adjust = TYPE(h) == P_LBTREE ? P_INDX : O_INDX; for (base = 0, lim = NUM_ENT(h) / (db_indx_t)adjust; lim != 0; lim >>= 1) { indx = base + ((lim >> 1) * adjust); - if ((ret = - __bam_cmp(dbp, key, h, indx, func, &cmp)) != 0) + if ((ret = __bam_cmp(dbp, dbc->txn, key, + h, indx, func, &cmp)) != 0) goto err; if (cmp == 0) { - if (TYPE(h) == P_LBTREE || TYPE(h) == P_LDUP) + if (LEVEL(h) == LEAFLEVEL || + (!LF_ISSET(SR_START) && + LEVEL(h) == slevel)) { + if (LF_ISSET(SR_NEXT)) + goto get_next; goto found; + } goto next; } if (cmp > 0) { @@ -197,19 +262,21 @@ try_again: * No match found. Base is the smallest index greater than * key and may be zero or a last + O_INDX index. * - * If it's a leaf page, return base as the "found" value. + * If it's a leaf page or the stopping point, + * return base as the "found" value. * Delete only deletes exact matches. */ - if (TYPE(h) == P_LBTREE || TYPE(h) == P_LDUP) { + if (LEVEL(h) == LEAFLEVEL || + (!LF_ISSET(SR_START) && LEVEL(h) == slevel)) { *exactp = 0; - if (LF_ISSET(S_EXACT)) { + if (LF_ISSET(SR_EXACT)) { ret = DB_NOTFOUND; goto err; } - if (LF_ISSET(S_STK_ONLY)) { - BT_STK_NUM(dbp->dbenv, cp, h, base, ret); + if (LF_ISSET(SR_STK_ONLY)) { + BT_STK_NUM(dbenv, cp, h, base, ret); if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0) ret = t_ret; @@ -218,6 +285,43 @@ try_again: ret = t_ret; return (ret); } + if (LF_ISSET(SR_NEXT)) { +get_next: /* + * The caller could have asked for a NEXT + * at the root if the tree recently collapsed. + */ + if (PGNO(h) == root_pgno) { + ret = DB_NOTFOUND; + goto err; + } + /* + * Save the root of the subtree + * and drop the rest of the subtree + * and search down again starting at + * the next child. + */ + if ((ret = __LPUT(dbc, lock)) != 0) + goto err; + if ((ret = __memp_fput(mpf, h, 0)) != 0) + goto err; + h = NULL; + LF_SET(SR_MIN); + LF_CLR(SR_NEXT); + indx = cp->sp->indx + 1; + if (indx == NUM_ENT(cp->sp->page)) { + ret = DB_NOTFOUND; + cp->csp++; + goto err; + } + h = cp->sp->page; + cp->sp->page = NULL; + lock = cp->sp->lock; + LOCK_INIT(cp->sp->lock); + if ((ret = __bam_stkrel(dbc, STK_NOLOCK)) != 0) + goto err; + stack = 1; + goto next; + } /* * !!! @@ -227,8 +331,9 @@ try_again: * to find an undeleted record. This is handled by the * calling routine. */ - BT_STK_ENTER(dbp->dbenv, - cp, h, base, lock, lock_mode, ret); + if (LF_ISSET(SR_DEL) && cp->csp == cp->sp) + cp->csp++; + BT_STK_ENTER(dbenv, cp, h, base, lock, lock_mode, ret); if (ret != 0) goto err; return (0); @@ -252,9 +357,13 @@ next: if (recnop != NULL) pg = GET_BINTERNAL(dbp, h, indx)->pgno; - if (LF_ISSET(S_STK_ONLY)) { - if (stop == h->level) { - BT_STK_NUM(dbp->dbenv, cp, h, indx, ret); + /* See if we are at the level to start stacking. */ + if (LF_ISSET(SR_START) && slevel == LEVEL(h)) + stack = 1; + + if (LF_ISSET(SR_STK_ONLY)) { + if (slevel == LEVEL(h)) { + BT_STK_NUM(dbenv, cp, h, indx, ret); if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0) ret = t_ret; @@ -263,7 +372,7 @@ next: if (recnop != NULL) ret = t_ret; return (ret); } - BT_STK_NUMPUSH(dbp->dbenv, cp, h, indx, ret); + BT_STK_NUMPUSH(dbenv, cp, h, indx, ret); (void)__memp_fput(mpf, h, 0); h = NULL; if ((ret = __db_lget(dbc, @@ -278,14 +387,25 @@ next: if (recnop != NULL) } } else if (stack) { /* Return if this is the lowest page wanted. */ - if (LF_ISSET(S_PARENT) && stop == h->level) { - BT_STK_ENTER(dbp->dbenv, + if (LF_ISSET(SR_PARENT) && slevel == LEVEL(h)) { + BT_STK_ENTER(dbenv, cp, h, indx, lock, lock_mode, ret); if (ret != 0) goto err; return (0); } - BT_STK_PUSH(dbp->dbenv, + if (LF_ISSET(SR_DEL) && NUM_ENT(h) > 1) { + /* + * There was a page with a singleton pointer + * to a non-empty subtree. + */ + cp->csp--; + if ((ret = __bam_stkrel(dbc, STK_NOLOCK)) != 0) + goto err; + stack = 0; + goto do_del; + } + BT_STK_PUSH(dbenv, cp, h, indx, lock, lock_mode, ret); if (ret != 0) goto err; @@ -301,17 +421,70 @@ next: if (recnop != NULL) * page in the return stack. If so, lock it and never * unlock it. */ - if ((LF_ISSET(S_PARENT) && - (u_int8_t)(stop + 1) >= (u_int8_t)(h->level - 1)) || - (h->level - 1) == LEAFLEVEL) + if ((LF_ISSET(SR_PARENT) && + (u_int8_t)(slevel + 1) >= (LEVEL(h) - 1)) || + (LEVEL(h) - 1) == LEAFLEVEL) stack = 1; - if ((ret = __memp_fput(mpf, h, 0)) != 0) - goto err; - h = NULL; + /* + * Returning a subtree. See if we have hit the start + * point if so save the parent and set stack. + * Otherwise free the parent and temporarily + * save this one. + * For SR_DEL we need to find a page with 1 entry. + * For SR_NEXT we want find the minimal subtree + * that contains the key and the next page. + * We save pages as long as we are at the right + * edge of the subtree. When we leave the right + * edge, then drop the subtree. + */ + if (!LF_ISSET(SR_DEL | SR_NEXT)) { + if ((ret = __memp_fput(mpf, h, 0)) != 0) + goto err; + goto lock_next; + } - lock_mode = stack && - LF_ISSET(S_WRITE) ? DB_LOCK_WRITE : DB_LOCK_READ; + if ((LF_ISSET(SR_DEL) && NUM_ENT(h) == 1)) { + stack = 1; + LF_SET(SR_WRITE); + /* Push the parent. */ + cp->csp++; + /* Push this node. */ + BT_STK_PUSH(dbenv, cp, h, + indx, lock, lock_mode, ret); + if (ret != 0) + goto err; + LOCK_INIT(lock); + } else { + /* + * See if we want to save the tree so far. + * If we are looking for the next key, + * then we must save this node if we are + * at the end of the page. If not then + * discard anything we have saved so far. + * For delete only keep one node until + * we find a singleton. + */ +do_del: if (cp->csp->page != NULL) { + if (LF_ISSET(SR_NEXT) && + indx == NUM_ENT(h) - 1) + cp->csp++; + else if ((ret = + __bam_stkrel(dbc, STK_NOLOCK)) != 0) + goto err; + } + /* Save this node. */ + BT_STK_ENTER(dbenv, cp, + h, indx, lock, lock_mode, ret); + if (ret != 0) + goto err; + LOCK_INIT(lock); + } + +lock_next: h = NULL; + + if (stack && LF_ISSET(SR_WRITE)) + lock_mode = DB_LOCK_WRITE; if ((ret = __db_lget(dbc, LCK_COUPLE_ALWAYS, pg, lock_mode, 0, &lock)) != 0) { /* @@ -320,10 +493,12 @@ next: if (recnop != NULL) * descending the tree holding read-locks. */ (void)__LPUT(dbc, lock); + if (LF_ISSET(SR_DEL | SR_NEXT)) + cp->csp++; goto err; } } - if ((ret = __memp_fget(mpf, &pg, 0, &h)) != 0) + if ((ret = __memp_fget(mpf, &pg, dbc->txn, 0, &h)) != 0) goto err; } /* NOTREACHED */ @@ -340,12 +515,12 @@ found: *exactp = 1; * all duplicate sets that are not on overflow pages exist on a * single leaf page. */ - if (TYPE(h) == P_LBTREE) { - if (LF_ISSET(S_DUPLAST)) + if (TYPE(h) == P_LBTREE && NUM_ENT(h) > P_INDX) { + if (LF_ISSET(SR_DUPLAST)) while (indx < (db_indx_t)(NUM_ENT(h) - P_INDX) && inp[indx] == inp[indx + P_INDX]) indx += P_INDX; - else + else if (LF_ISSET(SR_DUPFIRST)) while (indx > 0 && inp[indx] == inp[indx - P_INDX]) indx -= P_INDX; @@ -354,13 +529,13 @@ found: *exactp = 1; /* * Now check if we are allowed to return deleted items; if not, then * find the next (or previous) non-deleted duplicate entry. (We do - * not move from the original found key on the basis of the S_DELNO + * not move from the original found key on the basis of the SR_DELNO * flag.) */ - DB_ASSERT(recnop == NULL || LF_ISSET(S_DELNO)); - if (LF_ISSET(S_DELNO)) { + DB_ASSERT(dbenv, recnop == NULL || LF_ISSET(SR_DELNO)); + if (LF_ISSET(SR_DELNO)) { deloffset = TYPE(h) == P_LBTREE ? O_INDX : 0; - if (LF_ISSET(S_DUPLAST)) + if (LF_ISSET(SR_DUPLAST)) while (B_DISSET(GET_BKEYDATA(dbp, h, indx + deloffset)->type) && indx > 0 && inp[indx] == inp[indx - adjust]) @@ -388,7 +563,7 @@ found: *exactp = 1; * duplicates and record numbers in the same tree. */ if (recnop != NULL) { - DB_ASSERT(TYPE(h) == P_LBTREE); + DB_ASSERT(dbenv, TYPE(h) == P_LBTREE); for (i = 0; i < indx; i += P_INDX) if (!B_DISSET( @@ -400,14 +575,17 @@ found: *exactp = 1; } } - if (LF_ISSET(S_STK_ONLY)) { - BT_STK_NUM(dbp->dbenv, cp, h, indx, ret); + if (LF_ISSET(SR_STK_ONLY)) { + BT_STK_NUM(dbenv, cp, h, indx, ret); if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0) ret = t_ret; if ((t_ret = __memp_fput(mpf, h, 0)) != 0 && ret == 0) ret = t_ret; - } else - BT_STK_ENTER(dbp->dbenv, cp, h, indx, lock, lock_mode, ret); + } else { + if (LF_ISSET(SR_DEL) && cp->csp == cp->sp) + cp->csp++; + BT_STK_ENTER(dbenv, cp, h, indx, lock, lock_mode, ret); + } if (ret != 0) goto err; @@ -471,6 +649,13 @@ __bam_stkrel(dbc, flags) */ epg->page = NULL; } + /* + * We set this if we need to release our pins, + * but are not logically ready to have the pages + * visible. + */ + if (LF_ISSET(STK_PGONLY)) + continue; if (LF_ISSET(STK_NOLOCK)) { if ((t_ret = __LPUT(dbc, epg->lock)) != 0 && ret == 0) ret = t_ret; @@ -480,7 +665,8 @@ __bam_stkrel(dbc, flags) } /* Clear the stack, all pages have been released. */ - BT_STK_CLR(cp); + if (!LF_ISSET(STK_PGONLY)) + BT_STK_CLR(cp); return (ret); } diff --git a/db/btree/bt_split.c b/db/btree/bt_split.c index 3e2cb4e6d..9c2a12f9f 100644 --- a/db/btree/bt_split.c +++ b/db/btree/bt_split.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 @@ -36,27 +36,19 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bt_split.c,v 11.66 2004/10/01 13:00:21 bostic Exp $ + * $Id: bt_split.c,v 12.16 2006/09/08 18:41:05 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" -#include "dbinc/db_shash.h" #include "dbinc/lock.h" #include "dbinc/mp.h" #include "dbinc/btree.h" static int __bam_broot __P((DBC *, PAGE *, PAGE *, PAGE *)); static int __bam_page __P((DBC *, EPG *, EPG *)); -static int __bam_pinsert __P((DBC *, EPG *, PAGE *, PAGE *, int)); static int __bam_psplit __P((DBC *, EPG *, PAGE *, PAGE *, db_indx_t *)); static int __bam_root __P((DBC *, EPG *)); static int __ram_root __P((DBC *, PAGE *, PAGE *, PAGE *)); @@ -114,9 +106,9 @@ __bam_split(dbc, arg, root_pgnop) */ if ((ret = (dbc->dbtype == DB_BTREE ? __bam_search(dbc, PGNO_INVALID, - arg, S_WRPAIR, level, NULL, &exact) : + arg, SR_WRPAIR, level, NULL, &exact) : __bam_rsearch(dbc, - (db_recno_t *)arg, S_WRPAIR, level, &exact))) != 0) + (db_recno_t *)arg, SR_WRPAIR, level, &exact))) != 0) break; if (root_pgnop != NULL) @@ -192,12 +184,15 @@ __bam_root(dbc, cp) /* Yeah, right. */ if (cp->page->level >= MAXBTREELEVEL) { - __db_err(dbp->dbenv, + __db_errx(dbp->dbenv, "Too many btree levels: %d", cp->page->level); ret = ENOSPC; goto err; } + if ((ret = __memp_dirty(mpf, &cp->page, dbc->txn, 0)) != 0) + goto err; + /* Create new left and right pages for the split. */ if ((ret = __db_new(dbc, TYPE(cp->page), &lp)) != 0 || (ret = __db_new(dbc, TYPE(cp->page), &rp)) != 0) @@ -241,16 +236,13 @@ __bam_root(dbc, cp) ret = __bam_ca_split(dbc, cp->page->pgno, lp->pgno, rp->pgno, split, 1); /* Success or error: release pages and locks. */ -err: if ((t_ret = - __memp_fput(mpf, cp->page, DB_MPOOL_DIRTY)) != 0 && ret == 0) +err: if ((t_ret = __memp_fput(mpf, cp->page, 0)) != 0 && ret == 0) ret = t_ret; if ((t_ret = __TLPUT(dbc, cp->lock)) != 0 && ret == 0) ret = t_ret; - if (lp != NULL && - (t_ret = __memp_fput(mpf, lp, DB_MPOOL_DIRTY)) != 0 && ret == 0) + if (lp != NULL && (t_ret = __memp_fput(mpf, lp, 0)) != 0 && ret == 0) ret = t_ret; - if (rp != NULL && - (t_ret = __memp_fput(mpf, rp, DB_MPOOL_DIRTY)) != 0 && ret == 0) + if (rp != NULL && (t_ret = __memp_fput(mpf, rp, 0)) != 0 && ret == 0) ret = t_ret; return (ret); @@ -338,7 +330,7 @@ __bam_page(dbc, pp, cp) * page can't hold the new keys, and has to be split in turn, in which * case we want to release all the locks we can. */ - if ((ret = __bam_pinsert(dbc, pp, lp, rp, 1)) != 0) + if ((ret = __bam_pinsert(dbc, pp, lp, rp, BPI_SPACEONLY)) != 0) goto err; /* @@ -349,14 +341,15 @@ __bam_page(dbc, pp, cp) * a page that's not in our direct ancestry. Consider a cursor walking * backward through the leaf pages, that has our following page locked, * and is waiting on a lock for the page we're splitting. In that case - * we're going to deadlock here . It's probably OK, stepping backward + * we're going to deadlock here. It's probably OK, stepping backward * through the tree isn't a common operation. */ if (ISLEAF(cp->page) && NEXT_PGNO(cp->page) != PGNO_INVALID) { if ((ret = __db_lget(dbc, 0, NEXT_PGNO(cp->page), DB_LOCK_WRITE, 0, &tplock)) != 0) goto err; - if ((ret = __memp_fget(mpf, &NEXT_PGNO(cp->page), 0, &tp)) != 0) + if ((ret = __memp_fget(mpf, &NEXT_PGNO(cp->page), + dbc->txn, DB_MPOOL_DIRTY, &tp)) != 0) goto err; } @@ -387,8 +380,12 @@ __bam_page(dbc, pp, cp) */ PGNO(rp) = NEXT_PGNO(lp) = PGNO(alloc_rp); + if ((ret = __memp_dirty(mpf, &cp->page, dbc->txn, 0)) != 0) + goto err; + /* Actually update the parent page. */ - if ((ret = __bam_pinsert(dbc, pp, lp, rp, 0)) != 0) + if ((ret = __memp_dirty(mpf, &pp->page, dbc->txn, 0)) != 0 || + (ret = __bam_pinsert(dbc, pp, lp, rp, 0)) != 0) goto err; bc = (BTREE_CURSOR *)dbc->internal; @@ -458,24 +455,20 @@ __bam_page(dbc, pp, cp) * releasing locks on the pages that reference it. We're finished * modifying the page so it's not really necessary, but it's neater. */ - if ((t_ret = - __memp_fput(mpf, alloc_rp, DB_MPOOL_DIRTY)) != 0 && ret == 0) + if ((t_ret = __memp_fput(mpf, alloc_rp, 0)) != 0 && ret == 0) ret = t_ret; if ((t_ret = __TLPUT(dbc, rplock)) != 0 && ret == 0) ret = t_ret; - if ((t_ret = - __memp_fput(mpf, pp->page, DB_MPOOL_DIRTY)) != 0 && ret == 0) + if ((t_ret = __memp_fput(mpf, pp->page, 0)) != 0 && ret == 0) ret = t_ret; if ((t_ret = __TLPUT(dbc, pp->lock)) != 0 && ret == 0) ret = t_ret; - if ((t_ret = - __memp_fput(mpf, cp->page, DB_MPOOL_DIRTY)) != 0 && ret == 0) + if ((t_ret = __memp_fput(mpf, cp->page, 0)) != 0 && ret == 0) ret = t_ret; if ((t_ret = __TLPUT(dbc, cp->lock)) != 0 && ret == 0) ret = t_ret; if (tp != NULL) { - if ((t_ret = - __memp_fput(mpf, tp, DB_MPOOL_DIRTY)) != 0 && ret == 0) + if ((t_ret = __memp_fput(mpf, tp, 0)) != 0 && ret == 0) ret = t_ret; if ((t_ret = __TLPUT(dbc, tplock)) != 0 && ret == 0) ret = t_ret; @@ -521,6 +514,7 @@ __bam_broot(dbc, rootp, lp, rp) { BINTERNAL bi, *child_bi; BKEYDATA *child_bk; + BOVERFLOW bo, *child_bo; BTREE_CURSOR *cp; DB *dbp; DBT hdr, data; @@ -539,9 +533,6 @@ __bam_broot(dbc, rootp, lp, rp) P_INIT(rootp, dbp->pgsize, root_pgno, PGNO_INVALID, PGNO_INVALID, lp->level + 1, P_IBTREE); - memset(&data, 0, sizeof(data)); - memset(&hdr, 0, sizeof(hdr)); - /* * The btree comparison code guarantees that the left-most key on any * internal btree page is never used, so it doesn't need to be filled @@ -549,14 +540,13 @@ __bam_broot(dbc, rootp, lp, rp) */ memset(&bi, 0, sizeof(bi)); bi.len = 0; - B_TSET(bi.type, B_KEYDATA, 0); + B_TSET(bi.type, B_KEYDATA); bi.pgno = lp->pgno; if (F_ISSET(cp, C_RECNUM)) { bi.nrecs = __bam_total(dbp, lp); RE_NREC_SET(rootp, bi.nrecs); } - hdr.data = &bi; - hdr.size = SSZA(BINTERNAL, data); + DB_SET_DBT(hdr, &bi, SSZA(BINTERNAL, data)); if ((ret = __db_pitem(dbc, rootp, 0, BINTERNAL_SIZE(0), &hdr, NULL)) != 0) return (ret); @@ -565,27 +555,28 @@ __bam_broot(dbc, rootp, lp, rp) case P_IBTREE: /* Copy the first key of the child page onto the root page. */ child_bi = GET_BINTERNAL(dbp, rp, 0); - - bi.len = child_bi->len; - B_TSET(bi.type, child_bi->type, 0); - bi.pgno = rp->pgno; - if (F_ISSET(cp, C_RECNUM)) { - bi.nrecs = __bam_total(dbp, rp); - RE_NREC_ADJ(rootp, bi.nrecs); - } - hdr.data = &bi; - hdr.size = SSZA(BINTERNAL, data); - data.data = child_bi->data; - data.size = child_bi->len; - if ((ret = __db_pitem(dbc, rootp, 1, - BINTERNAL_SIZE(child_bi->len), &hdr, &data)) != 0) - return (ret); - - /* Increment the overflow ref count. */ - if (B_TYPE(child_bi->type) == B_OVERFLOW) - if ((ret = __db_ovref(dbc, - ((BOVERFLOW *)(child_bi->data))->pgno, 1)) != 0) + switch (B_TYPE(child_bi->type)) { + case B_KEYDATA: + bi.len = child_bi->len; + B_TSET(bi.type, B_KEYDATA); + bi.pgno = rp->pgno; + if (F_ISSET(cp, C_RECNUM)) { + bi.nrecs = __bam_total(dbp, rp); + RE_NREC_ADJ(rootp, bi.nrecs); + } + DB_SET_DBT(hdr, &bi, SSZA(BINTERNAL, data)); + DB_SET_DBT(data, child_bi->data, child_bi->len); + if ((ret = __db_pitem(dbc, rootp, 1, + BINTERNAL_SIZE(child_bi->len), &hdr, &data)) != 0) return (ret); + break; + case B_OVERFLOW: + child_bo = (BOVERFLOW *)child_bi->data; + goto do_overflow; + case B_DUPLICATE: + default: + goto pgfmt; + } break; case P_LDUP: case P_LBTREE: @@ -594,49 +585,55 @@ __bam_broot(dbc, rootp, lp, rp) switch (B_TYPE(child_bk->type)) { case B_KEYDATA: bi.len = child_bk->len; - B_TSET(bi.type, child_bk->type, 0); + B_TSET(bi.type, B_KEYDATA); bi.pgno = rp->pgno; if (F_ISSET(cp, C_RECNUM)) { bi.nrecs = __bam_total(dbp, rp); RE_NREC_ADJ(rootp, bi.nrecs); } - hdr.data = &bi; - hdr.size = SSZA(BINTERNAL, data); - data.data = child_bk->data; - data.size = child_bk->len; + DB_SET_DBT(hdr, &bi, SSZA(BINTERNAL, data)); + DB_SET_DBT(data, child_bk->data, child_bk->len); if ((ret = __db_pitem(dbc, rootp, 1, BINTERNAL_SIZE(child_bk->len), &hdr, &data)) != 0) return (ret); break; - case B_DUPLICATE: case B_OVERFLOW: + /* Copy the overflow key. */ + child_bo = (BOVERFLOW *)child_bk; +do_overflow: memset(&bo, 0, sizeof(bo)); + bo.type = B_OVERFLOW; + bo.tlen = child_bo->tlen; + memset(&hdr, 0, sizeof(hdr)); + if ((ret = __db_goff(dbp, + dbc->txn, &hdr, child_bo->tlen, + child_bo->pgno, &hdr.data, &hdr.size)) == 0) + ret = __db_poff(dbc, &hdr, &bo.pgno); + + if (hdr.data != NULL) + __os_free(dbp->dbenv, hdr.data); + if (ret != 0) + return (ret); + bi.len = BOVERFLOW_SIZE; - B_TSET(bi.type, child_bk->type, 0); + B_TSET(bi.type, B_OVERFLOW); bi.pgno = rp->pgno; if (F_ISSET(cp, C_RECNUM)) { bi.nrecs = __bam_total(dbp, rp); RE_NREC_ADJ(rootp, bi.nrecs); } - hdr.data = &bi; - hdr.size = SSZA(BINTERNAL, data); - data.data = child_bk; - data.size = BOVERFLOW_SIZE; + DB_SET_DBT(hdr, &bi, SSZA(BINTERNAL, data)); + DB_SET_DBT(data, &bo, BOVERFLOW_SIZE); if ((ret = __db_pitem(dbc, rootp, 1, BINTERNAL_SIZE(BOVERFLOW_SIZE), &hdr, &data)) != 0) return (ret); - - /* Increment the overflow ref count. */ - if (B_TYPE(child_bk->type) == B_OVERFLOW) - if ((ret = __db_ovref(dbc, - ((BOVERFLOW *)child_bk)->pgno, 1)) != 0) - return (ret); break; + case B_DUPLICATE: default: - return (__db_pgfmt(dbp->dbenv, rp->pgno)); + goto pgfmt; } break; default: - return (__db_pgfmt(dbp->dbenv, rp->pgno)); +pgfmt: return (__db_pgfmt(dbp->dbenv, rp->pgno)); } return (0); } @@ -664,9 +661,7 @@ __ram_root(dbc, rootp, lp, rp) root_pgno, PGNO_INVALID, PGNO_INVALID, lp->level + 1, P_IRECNO); /* Initialize the header. */ - memset(&hdr, 0, sizeof(hdr)); - hdr.data = &ri; - hdr.size = RINTERNAL_SIZE; + DB_SET_DBT(hdr, &ri, RINTERNAL_SIZE); /* Insert the left and right keys, set the header information. */ ri.pgno = lp->pgno; @@ -685,16 +680,19 @@ __ram_root(dbc, rootp, lp, rp) /* * __bam_pinsert -- * Insert a new key into a parent page, completing the split. + * + * PUBLIC: int __bam_pinsert __P((DBC *, EPG *, PAGE *, PAGE *, int)); */ -static int -__bam_pinsert(dbc, parent, lchild, rchild, space_check) +int +__bam_pinsert(dbc, parent, lchild, rchild, flags) DBC *dbc; EPG *parent; PAGE *lchild, *rchild; - int space_check; + int flags; { BINTERNAL bi, *child_bi; BKEYDATA *child_bk, *tmp_bk; + BOVERFLOW bo, *child_bo; BTREE *t; BTREE_CURSOR *cp; DB *dbp; @@ -714,7 +712,7 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check) /* If handling record numbers, count records split to the right page. */ nrecs = F_ISSET(cp, C_RECNUM) && - !space_check ? __bam_total(dbp, rchild) : 0; + !LF_ISSET(BPI_SPACEONLY) ? __bam_total(dbp, rchild) : 0; /* * Now we insert the new page's first key into the parent page, which @@ -750,37 +748,41 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check) if (P_FREESPACE(dbp, ppage) < nbytes) return (DB_NEEDSPLIT); - if (space_check) + if (LF_ISSET(BPI_SPACEONLY)) return (0); - /* Add a new record for the right page. */ - memset(&bi, 0, sizeof(bi)); - bi.len = child_bi->len; - B_TSET(bi.type, child_bi->type, 0); - bi.pgno = rchild->pgno; - bi.nrecs = nrecs; - memset(&hdr, 0, sizeof(hdr)); - hdr.data = &bi; - hdr.size = SSZA(BINTERNAL, data); - memset(&data, 0, sizeof(data)); - data.data = child_bi->data; - data.size = child_bi->len; - if ((ret = __db_pitem(dbc, ppage, off, - BINTERNAL_SIZE(child_bi->len), &hdr, &data)) != 0) - return (ret); - - /* Increment the overflow ref count. */ - if (B_TYPE(child_bi->type) == B_OVERFLOW) - if ((ret = __db_ovref(dbc, - ((BOVERFLOW *)(child_bi->data))->pgno, 1)) != 0) + switch (B_TYPE(child_bi->type)) { + case B_KEYDATA: + /* Add a new record for the right page. */ + memset(&bi, 0, sizeof(bi)); + bi.len = child_bi->len; + B_TSET(bi.type, B_KEYDATA); + bi.pgno = rchild->pgno; + bi.nrecs = nrecs; + DB_SET_DBT(hdr, &bi, SSZA(BINTERNAL, data)); + DB_SET_DBT(data, child_bi->data, child_bi->len); + if ((ret = __db_pitem(dbc, ppage, off, + BINTERNAL_SIZE(child_bi->len), &hdr, &data)) != 0) return (ret); + break; + case B_OVERFLOW: + child_bo = (BOVERFLOW *)child_bi->data; + goto do_overflow; + case B_DUPLICATE: + default: + goto pgfmt; + } break; case P_LDUP: case P_LBTREE: child_bk = GET_BKEYDATA(dbp, rchild, 0); switch (B_TYPE(child_bk->type)) { case B_KEYDATA: + nbytes = BINTERNAL_PSIZE(child_bk->len); + nksize = child_bk->len; + /* + * Prefix compression: * We set t->bt_prefix to NULL if we have a comparison * callback but no prefix compression callback. But, * if we're splitting in an off-page duplicates tree, @@ -792,6 +794,14 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check) * as there's no way for an application to specify a * prefix compression callback that corresponds to its * comparison callback. + * + * No prefix compression if we don't have a compression + * function, or the key we'd compress isn't a normal + * key (for example, it references an overflow page). + * + * Generate a parent page key for the right child page + * from a comparison of the last key on the left child + * page and the first key on the right child page. */ if (F_ISSET(dbc, DBC_OPD)) { if (dbp->dup_compare == __bam_defcmp) @@ -800,81 +810,75 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check) func = NULL; } else func = t->bt_prefix; - - nbytes = BINTERNAL_PSIZE(child_bk->len); - nksize = child_bk->len; if (func == NULL) goto noprefix; - if (ppage->prev_pgno == PGNO_INVALID && off <= 1) - goto noprefix; tmp_bk = GET_BKEYDATA(dbp, lchild, NUM_ENT(lchild) - (TYPE(lchild) == P_LDUP ? O_INDX : P_INDX)); if (B_TYPE(tmp_bk->type) != B_KEYDATA) goto noprefix; - memset(&a, 0, sizeof(a)); - a.size = tmp_bk->len; - a.data = tmp_bk->data; - memset(&b, 0, sizeof(b)); - b.size = child_bk->len; - b.data = child_bk->data; + DB_SET_DBT(a, tmp_bk->data, tmp_bk->len); + DB_SET_DBT(b, child_bk->data, child_bk->len); nksize = (u_int32_t)func(dbp, &a, &b); if ((n = BINTERNAL_PSIZE(nksize)) < nbytes) nbytes = n; else -noprefix: nksize = child_bk->len; + nksize = child_bk->len; - if (P_FREESPACE(dbp, ppage) < nbytes) +noprefix: if (P_FREESPACE(dbp, ppage) < nbytes) return (DB_NEEDSPLIT); - if (space_check) + if (LF_ISSET(BPI_SPACEONLY)) return (0); memset(&bi, 0, sizeof(bi)); bi.len = nksize; - B_TSET(bi.type, child_bk->type, 0); + B_TSET(bi.type, B_KEYDATA); bi.pgno = rchild->pgno; bi.nrecs = nrecs; - memset(&hdr, 0, sizeof(hdr)); - hdr.data = &bi; - hdr.size = SSZA(BINTERNAL, data); - memset(&data, 0, sizeof(data)); - data.data = child_bk->data; - data.size = nksize; + DB_SET_DBT(hdr, &bi, SSZA(BINTERNAL, data)); + DB_SET_DBT(data, child_bk->data, nksize); if ((ret = __db_pitem(dbc, ppage, off, BINTERNAL_SIZE(nksize), &hdr, &data)) != 0) return (ret); break; - case B_DUPLICATE: case B_OVERFLOW: nbytes = BINTERNAL_PSIZE(BOVERFLOW_SIZE); if (P_FREESPACE(dbp, ppage) < nbytes) return (DB_NEEDSPLIT); - if (space_check) + if (LF_ISSET(BPI_SPACEONLY)) return (0); + /* Copy the overflow key. */ + child_bo = (BOVERFLOW *)child_bk; +do_overflow: memset(&bo, 0, sizeof(bo)); + bo.type = B_OVERFLOW; + bo.tlen = child_bo->tlen; + memset(&hdr, 0, sizeof(hdr)); + if ((ret = __db_goff(dbp, + dbc->txn, &hdr, child_bo->tlen, + child_bo->pgno, &hdr.data, &hdr.size)) == 0) + ret = __db_poff(dbc, &hdr, &bo.pgno); + + if (hdr.data != NULL) + __os_free(dbp->dbenv, hdr.data); + if (ret != 0) + return (ret); + memset(&bi, 0, sizeof(bi)); bi.len = BOVERFLOW_SIZE; - B_TSET(bi.type, child_bk->type, 0); + B_TSET(bi.type, B_OVERFLOW); bi.pgno = rchild->pgno; bi.nrecs = nrecs; - memset(&hdr, 0, sizeof(hdr)); - hdr.data = &bi; - hdr.size = SSZA(BINTERNAL, data); - memset(&data, 0, sizeof(data)); - data.data = child_bk; - data.size = BOVERFLOW_SIZE; + DB_SET_DBT(hdr, &bi, SSZA(BINTERNAL, data)); + DB_SET_DBT(data, &bo, BOVERFLOW_SIZE); if ((ret = __db_pitem(dbc, ppage, off, BINTERNAL_SIZE(BOVERFLOW_SIZE), &hdr, &data)) != 0) return (ret); - /* Increment the overflow ref count. */ - if (B_TYPE(child_bk->type) == B_OVERFLOW) - if ((ret = __db_ovref(dbc, - ((BOVERFLOW *)child_bk)->pgno, 1)) != 0) - return (ret); break; + case B_DUPLICATE: default: - return (__db_pgfmt(dbp->dbenv, rchild->pgno)); + goto pgfmt; } break; case P_IRECNO: @@ -883,13 +887,11 @@ noprefix: nksize = child_bk->len; if (P_FREESPACE(dbp, ppage) < nbytes) return (DB_NEEDSPLIT); - if (space_check) + if (LF_ISSET(BPI_SPACEONLY)) return (0); /* Add a new record for the right page. */ - memset(&hdr, 0, sizeof(hdr)); - hdr.data = &ri; - hdr.size = RINTERNAL_SIZE; + DB_SET_DBT(hdr, &ri, RINTERNAL_SIZE); ri.pgno = rchild->pgno; ri.nrecs = nrecs; if ((ret = __db_pitem(dbc, @@ -897,20 +899,20 @@ noprefix: nksize = child_bk->len; return (ret); break; default: - return (__db_pgfmt(dbp->dbenv, rchild->pgno)); +pgfmt: return (__db_pgfmt(dbp->dbenv, rchild->pgno)); } /* * If a Recno or Btree with record numbers AM page, or an off-page * duplicates tree, adjust the parent page's left page record count. */ - if (F_ISSET(cp, C_RECNUM)) { + if (F_ISSET(cp, C_RECNUM) && !LF_ISSET(BPI_NORECNUM)) { /* Log the change. */ if (DBC_LOGGING(dbc)) { - if ((ret = __bam_cadjust_log(dbp, dbc->txn, - &LSN(ppage), 0, PGNO(ppage), - &LSN(ppage), parent->indx, -(int32_t)nrecs, 0)) != 0) - return (ret); + if ((ret = __bam_cadjust_log(dbp, dbc->txn, + &LSN(ppage), 0, PGNO(ppage), &LSN(ppage), + parent->indx, -(int32_t)nrecs, 0)) != 0) + return (ret); } else LSN_NOT_LOGGED(LSN(ppage)); @@ -958,7 +960,7 @@ __bam_psplit(dbc, cp, lp, rp, splitret) * will point past the last element on the page. But, in trees with * duplicates, the cursor may point to the last entry on the page -- * in this case, the entry will also be the last element of a duplicate - * set (the last because the search call specified the S_DUPLAST flag). + * set (the last because the search call specified the SR_DUPLAST flag). * The only way to differentiate between an insert immediately before * the last item in a tree or an append after a duplicate set which is * also the last item in the tree is to call the comparison function. diff --git a/db/btree/bt_stat.c b/db/btree/bt_stat.c index 9d99ee2c4..05415eedd 100644 --- a/db/btree/bt_stat.c +++ b/db/btree/bt_stat.c @@ -1,24 +1,16 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_stat.c,v 11.78 2004/09/22 03:31:26 bostic Exp $ + * $Id: bt_stat.c,v 12.12 2006/08/24 14:44:45 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" -#include "dbinc/db_shash.h" #include "dbinc/btree.h" #include "dbinc/lock.h" #include "dbinc/mp.h" @@ -71,11 +63,9 @@ __bam_stat(dbc, spp, flags) pgno = PGNO_BASE_MD; if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &metalock)) != 0) goto err; - if ((ret = __memp_fget(mpf, &pgno, 0, &meta)) != 0) + if ((ret = __memp_fget(mpf, &pgno, dbc->txn, 0, &meta)) != 0) goto err; - if (flags == DB_RECORDCOUNT || flags == DB_CACHED_COUNTS) - flags = DB_FAST_STAT; if (flags == DB_FAST_STAT) goto meta_only; @@ -83,7 +73,7 @@ __bam_stat(dbc, spp, flags) for (sp->bt_free = 0, pgno = meta->dbmeta.free; pgno != PGNO_INVALID;) { ++sp->bt_free; - if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) + if ((ret = __memp_fget(mpf, &pgno, dbc->txn, 0, &h)) != 0) goto err; pgno = h->next_pgno; @@ -96,7 +86,7 @@ __bam_stat(dbc, spp, flags) pgno = cp->root; if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0) goto err; - if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) + if ((ret = __memp_fget(mpf, &pgno, dbc->txn, 0, &h)) != 0) goto err; /* Get the levels from the root page. */ @@ -119,9 +109,10 @@ __bam_stat(dbc, spp, flags) * Get the subdatabase metadata page if it's not the same as the * one we already have. */ - write_meta = !F_ISSET(dbp, DB_AM_RDONLY); + write_meta = !F_ISSET(dbp, DB_AM_RDONLY) && + (!MULTIVERSION(dbp) || dbc->txn != NULL); meta_only: - if (t->bt_meta != PGNO_BASE_MD || write_meta != 0) { + if (t->bt_meta != PGNO_BASE_MD || write_meta) { ret = __memp_fput(mpf, meta, 0); meta = NULL; if ((t_ret = __LPUT(dbc, metalock)) != 0 && ret == 0) @@ -130,10 +121,11 @@ meta_only: goto err; if ((ret = __db_lget(dbc, - 0, t->bt_meta, write_meta == 0 ? - DB_LOCK_READ : DB_LOCK_WRITE, 0, &metalock)) != 0) + 0, t->bt_meta, write_meta ? DB_LOCK_WRITE : DB_LOCK_READ, + 0, &metalock)) != 0) goto err; - if ((ret = __memp_fget(mpf, &t->bt_meta, 0, &meta)) != 0) + if ((ret = __memp_fget(mpf, &t->bt_meta, dbc->txn, + write_meta ? DB_MPOOL_DIRTY : 0, &meta)) != 0) goto err; } if (flags == DB_FAST_STAT) { @@ -142,7 +134,8 @@ meta_only: if ((ret = __db_lget(dbc, 0, cp->root, DB_LOCK_READ, 0, &lock)) != 0) goto err; - if ((ret = __memp_fget(mpf, &cp->root, 0, &h)) != 0) + if ((ret = __memp_fget(mpf, &cp->root, dbc->txn, + 0, &h)) != 0) goto err; sp->bt_nkeys = RE_NREC(h); @@ -155,7 +148,6 @@ meta_only: /* Get metadata page statistics. */ sp->bt_metaflags = meta->dbmeta.flags; - sp->bt_maxkey = meta->maxkey; sp->bt_minkey = meta->minkey; sp->bt_re_len = meta->re_len; sp->bt_re_pad = meta->re_pad; @@ -179,8 +171,8 @@ err: /* Discard the second page. */ /* Discard the metadata page. */ if ((t_ret = __LPUT(dbc, metalock)) != 0 && ret == 0) ret = t_ret; - if (meta != NULL && (t_ret = __memp_fput( - mpf, meta, write_meta == 0 ? 0 : DB_MPOOL_DIRTY)) != 0 && ret == 0) + if (meta != NULL && + (t_ret = __memp_fput(mpf, meta, 0)) != 0 && ret == 0) ret = t_ret; if (ret != 0 && sp != NULL) { @@ -221,7 +213,7 @@ __bam_stat_print(dbc, flags) dbp = dbc->dbp; dbenv = dbp->dbenv; - if ((ret = __bam_stat(dbc, &sp, 0)) != 0) + if ((ret = __bam_stat(dbc, &sp, LF_ISSET(DB_FAST_STAT))) != 0) return (ret); if (LF_ISSET(DB_STAT_ALL)) { @@ -246,20 +238,19 @@ __bam_stat_print(dbc, flags) } __db_msg(dbenv, "%s\tByte order", s); __db_prflags(dbenv, NULL, sp->bt_metaflags, fn, NULL, "\tFlags"); - if (dbp->type == DB_BTREE) { -#ifdef NOT_IMPLEMENTED - __db_dl(dbenv, "Maximum keys per-page", (u_long)sp->bt_maxkey); -#endif + if (dbp->type == DB_BTREE) __db_dl(dbenv, "Minimum keys per-page", (u_long)sp->bt_minkey); - } if (dbp->type == DB_RECNO) { __db_dl(dbenv, "Fixed-length record size", (u_long)sp->bt_re_len); - __db_dl(dbenv, + __db_msg(dbenv, "%#x\tFixed-length record pad", (u_int)sp->bt_re_pad); } __db_dl(dbenv, "Underlying database page size", (u_long)sp->bt_pagesize); + if (dbp->type == DB_BTREE) + __db_dl(dbenv, "Overflow key/data size", + ((BTREE_CURSOR *)dbc->internal)->ovflsize); __db_dl(dbenv, "Number of levels in the tree", (u_long)sp->bt_levels); __db_dl(dbenv, dbp->type == DB_BTREE ? "Number of unique keys in the tree" : @@ -485,7 +476,7 @@ __bam_key_range(dbc, dbt, kp, flags) COMPQUIET(flags, 0); if ((ret = __bam_search(dbc, PGNO_INVALID, - dbt, S_STK_ONLY, 1, NULL, &exact)) != 0) + dbt, SR_STK_ONLY, 1, NULL, &exact)) != 0) return (ret); cp = (BTREE_CURSOR *)dbc->internal; @@ -565,7 +556,7 @@ __bam_traverse(dbc, mode, root_pgno, callback, cookie) if ((ret = __db_lget(dbc, 0, root_pgno, mode, 0, &lock)) != 0) return (ret); - if ((ret = __memp_fget(mpf, &root_pgno, 0, &h)) != 0) { + if ((ret = __memp_fget(mpf, &root_pgno, dbc->txn, 0, &h)) != 0) { (void)__TLPUT(dbc, lock); return (ret); } @@ -576,7 +567,7 @@ __bam_traverse(dbc, mode, root_pgno, callback, cookie) bi = GET_BINTERNAL(dbp, h, indx); if (B_TYPE(bi->type) == B_OVERFLOW && (ret = __db_traverse_big(dbp, - ((BOVERFLOW *)bi->data)->pgno, + ((BOVERFLOW *)bi->data)->pgno, dbc->txn, callback, cookie)) != 0) goto err; if ((ret = __bam_traverse( @@ -601,7 +592,7 @@ __bam_traverse(dbc, mode, root_pgno, callback, cookie) inp[indx] != inp[indx + P_INDX])) { if ((ret = __db_traverse_big(dbp, GET_BOVERFLOW(dbp, h, indx)->pgno, - callback, cookie)) != 0) + dbc->txn, callback, cookie)) != 0) goto err; } bk = GET_BKEYDATA(dbp, h, indx + O_INDX); @@ -613,7 +604,7 @@ __bam_traverse(dbc, mode, root_pgno, callback, cookie) if (B_TYPE(bk->type) == B_OVERFLOW && (ret = __db_traverse_big(dbp, GET_BOVERFLOW(dbp, h, indx + O_INDX)->pgno, - callback, cookie)) != 0) + dbc->txn, callback, cookie)) != 0) goto err; } break; @@ -623,7 +614,7 @@ __bam_traverse(dbc, mode, root_pgno, callback, cookie) bk = GET_BKEYDATA(dbp, h, indx); if (B_TYPE(bk->type) == B_OVERFLOW && (ret = __db_traverse_big(dbp, - GET_BOVERFLOW(dbp, h, indx)->pgno, + GET_BOVERFLOW(dbp, h, indx)->pgno, dbc->txn, callback, cookie)) != 0) goto err; } diff --git a/db/btree/bt_upgrade.c b/db/btree/bt_upgrade.c index f89901789..5c6dcdf33 100644 --- a/db/btree/bt_upgrade.c +++ b/db/btree/bt_upgrade.c @@ -1,18 +1,13 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_upgrade.c,v 11.30 2004/01/28 03:35:49 bostic Exp $ + * $Id: bt_upgrade.c,v 12.4 2006/08/24 14:44:45 bostic Exp $ */ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include -#include -#endif +#include "db_config.h" #include "db_int.h" #include "dbinc/db_page.h" diff --git a/db/btree/bt_verify.c b/db/btree/bt_verify.c index 6b78cbd17..3312dd880 100644 --- a/db/btree/bt_verify.c +++ b/db/btree/bt_verify.c @@ -1,23 +1,16 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1999-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1999-2006 + * Oracle Corporation. All rights reserved. * - * $Id: bt_verify.c,v 1.97 2004/10/11 18:47:46 bostic Exp $ + * $Id: bt_verify.c,v 12.27 2006/09/07 20:05:25 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" -#include "dbinc/db_shash.h" #include "dbinc/db_verify.h" #include "dbinc/btree.h" #include "dbinc/mp.h" @@ -25,7 +18,7 @@ static int __bam_safe_getdata __P((DB *, PAGE *, u_int32_t, int, DBT *, int *)); static int __bam_vrfy_inp __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, db_indx_t *, u_int32_t)); -static int __bam_vrfy_treeorder __P((DB *, db_pgno_t, PAGE *, BINTERNAL *, +static int __bam_vrfy_treeorder __P((DB *, PAGE *, BINTERNAL *, BINTERNAL *, int (*)(DB *, const DBT *, const DBT *), u_int32_t)); static int __ram_vrfy_inp __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, db_indx_t *, u_int32_t)); @@ -89,10 +82,8 @@ __bam_vrfy_meta(dbp, vdp, meta, pgno, flags) } else pip->bt_minkey = meta->minkey; - /* bt_maxkey: unsupported so no constraints. */ - pip->bt_maxkey = meta->maxkey; - /* re_len: no constraints on this (may be zero or huge--we make rope) */ + pip->re_pad = meta->re_pad; pip->re_len = meta->re_len; /* @@ -214,10 +205,7 @@ __ram_vrfy_leaf(dbp, vdp, h, pgno, flags) return (ret); if (TYPE(h) != P_LRECNO) { - /* We should not have been called. */ - TYPE_ERR_PRINT(dbenv, "__ram_vrfy_leaf", pgno, TYPE(h)); - DB_ASSERT(0); - ret = EINVAL; + ret = __db_unknown_path(dbenv, "__ram_vrfy_leaf"); goto err; } @@ -325,9 +313,7 @@ __bam_vrfy(dbp, vdp, h, pgno, flags) case P_LDUP: break; default: - TYPE_ERR_PRINT(dbenv, "__bam_vrfy", pgno, TYPE(h)); - DB_ASSERT(0); - ret = EINVAL; + ret = __db_unknown_path(dbenv, "__bam_vrfy"); goto err; } @@ -420,9 +406,7 @@ __ram_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) return (ret); if (TYPE(h) != P_IRECNO) { - TYPE_ERR_PRINT(dbenv, "__ram_vrfy_inp", pgno, TYPE(h)); - DB_ASSERT(0); - ret = EINVAL; + ret = __db_unknown_path(dbenv, "__ram_vrfy_inp"); goto err; } @@ -554,9 +538,7 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) */ if (LF_ISSET(DB_SALVAGE)) break; - TYPE_ERR_PRINT(dbenv, "__bam_vrfy_inp", pgno, TYPE(h)); - DB_ASSERT(0); - ret = EINVAL; + ret = __db_unknown_path(dbenv, "__bam_vrfy_inp"); goto err; } @@ -587,7 +569,7 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) isbad = 1; goto err; default: - DB_ASSERT(ret != 0); + DB_ASSERT(dbenv, ret != 0); break; } @@ -877,8 +859,8 @@ __bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags) DBT dbta, dbtb, dup_1, dup_2, *p1, *p2, *tmp; DB_ENV *dbenv; VRFY_PAGEINFO *pip; - db_indx_t i; - int cmp, freedup_1, freedup_2, isbad, ret, t_ret; + db_indx_t i, *inp; + int adj, cmp, freedup_1, freedup_2, isbad, ret, t_ret; int (*dupfunc) __P((DB *, const DBT *, const DBT *)); int (*func) __P((DB *, const DBT *, const DBT *)); void *buf1, *buf2, *tmpbuf; @@ -907,7 +889,7 @@ __bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags) buf1 = buf2 = NULL; - DB_ASSERT(!LF_ISSET(DB_NOORDERCHK)); + DB_ASSERT(dbenv, !LF_ISSET(DB_NOORDERCHK)); dupfunc = (dbp->dup_compare == NULL) ? __bam_defcmp : dbp->dup_compare; if (TYPE(h) == P_LDUP) @@ -939,8 +921,9 @@ __bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags) * Note that on IBTREE pages, we start with item 1, since item * 0 doesn't get looked at by __bam_cmp. */ - for (i = (TYPE(h) == P_IBTREE) ? 1 : 0; i < nentries; - i += (TYPE(h) == P_LBTREE) ? P_INDX : O_INDX) { + inp = P_INP(dbp, h); + adj = (TYPE(h) == P_LBTREE) ? P_INDX : O_INDX; + for (i = (TYPE(h) == P_IBTREE) ? 1 : 0; i < nentries; i += adj) { /* * Put key i-1, now in p2, into p1, by swapping DBTs and bufs. */ @@ -1000,10 +983,7 @@ __bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags) * This means our caller screwed up and sent us * an inappropriate page. */ - TYPE_ERR_PRINT(dbenv, - "__bam_vrfy_itemorder", pgno, TYPE(h)) - DB_ASSERT(0); - ret = EINVAL; + ret = __db_unknown_path(dbenv, "__bam_vrfy_itemorder"); goto err; } @@ -1033,7 +1013,7 @@ overflow: if (!ovflok) { * was just pointing at a non-overflow item.) */ p2->data = buf2; - if ((ret = __db_goff(dbp, + if ((ret = __db_goff(dbp, NULL, p2, bo->tlen, bo->pgno, NULL, NULL)) != 0) { isbad = 1; EPRINT((dbenv, @@ -1046,7 +1026,7 @@ overflow: if (!ovflok) { /* Compare with the last key. */ if (p1->data != NULL && p2->data != NULL) { - cmp = func(dbp, p1, p2); + cmp = inp[i] == inp[i - adj] ? 0 : func(dbp, p1, p2); /* comparison succeeded */ if (cmp > 0) { @@ -1056,6 +1036,12 @@ overflow: if (!ovflok) { (u_long)pgno, (u_long)i)); /* proceed */ } else if (cmp == 0) { + if (inp[i] != inp[i - adj]) { + EPRINT((dbenv, + "Page %lu: non-dup dup key at entry %lu", + (u_long)pgno, (u_long)i)); + isbad = 1; + } /* * If they compared equally, this * had better be a (sub)database with dups. @@ -1114,7 +1100,7 @@ overflow: if (!ovflok) { */ if (dup_1.data == NULL || dup_2.data == NULL) { - DB_ASSERT(!ovflok); + DB_ASSERT(dbenv, !ovflok); F_SET(pip, VRFY_INCOMPLETE); goto err; } @@ -1280,7 +1266,7 @@ __bam_vrfy_subtree(dbp, vdp, pgno, l, r, flags, levelp, nrecsp, relenp) void *l, *r; u_int32_t flags, *levelp, *nrecsp, *relenp; { - BINTERNAL *li, *ri, *lp, *rp; + BINTERNAL *li, *ri; DB *pgset; DBC *cc; DB_ENV *dbenv; @@ -1296,16 +1282,19 @@ __bam_vrfy_subtree(dbp, vdp, pgno, l, r, flags, levelp, nrecsp, relenp) int (*func) __P((DB *, const DBT *, const DBT *)); int isbad, p, ret, t_ret, toplevel; + if (levelp != NULL) /* Don't leave uninitialized on error. */ + *levelp = 0; + if (nrecsp != NULL) + *nrecsp = 0; + dbenv = dbp->dbenv; mpf = dbp->mpf; - ret = isbad = 0; - nrecs = 0; h = NULL; + next_pgno = prev_pgno = PGNO_INVALID; + nrecs = 0; relen = 0; leaf_type = P_INVALID; - next_pgno = prev_pgno = PGNO_INVALID; - rp = (BINTERNAL *)r; - lp = (BINTERNAL *)l; + isbad = ret = 0; /* Provide feedback on our progress to the application. */ if (!LF_ISSET(DB_SALVAGE)) @@ -1585,10 +1574,8 @@ bad_prev: isbad = 1; ret = __db_vrfy_ccnext(cc, &child)) if (child->type == V_RECNO) { if (pip->type != P_IRECNO) { - TYPE_ERR_PRINT(dbenv, "__bam_vrfy_subtree", - pgno, pip->type); - DB_ASSERT(0); - ret = EINVAL; + ret = __db_unknown_path( + dbenv, "__bam_vrfy_subtree"); goto err; } if ((ret = __bam_vrfy_subtree(dbp, vdp, child->pgno, @@ -1618,8 +1605,17 @@ bad_prev: isbad = 1; if (relenp) *relenp = relen; } - if (LF_ISSET(ST_RECNUM)) + if (LF_ISSET(ST_RECNUM)) { + if (child->nrecs != child_nrecs) { + isbad = 1; + EPRINT((dbenv, + "Page %lu: record count incorrect: actual %lu, in record %lu", + (u_long)child->pgno, + (u_long)child_nrecs, + (u_long)child->nrecs)); + } nrecs += child_nrecs; + } if (isbad == 0 && level != child_level + 1) { isbad = 1; EPRINT((dbenv, @@ -1647,7 +1643,7 @@ bad_prev: isbad = 1; */ /* Otherwise, __db_vrfy_childput would be broken. */ - DB_ASSERT(child->refcnt >= 1); + DB_ASSERT(dbenv, child->refcnt >= 1); /* * An overflow referenced more than twice here @@ -1688,12 +1684,12 @@ bad_prev: isbad = 1; * itself, which must sort lower than all entries on its child; * ri will be the key to its right, which must sort greater. */ - if (h == NULL && (ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) + if (h == NULL && (ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0) goto err; for (i = 0; i < pip->entries; i += O_INDX) { li = GET_BINTERNAL(dbp, h, i); ri = (i + O_INDX < pip->entries) ? - GET_BINTERNAL(dbp, h, i + O_INDX) : rp; + GET_BINTERNAL(dbp, h, i + O_INDX) : r; /* * The leftmost key is forcibly sorted less than all entries, @@ -1761,7 +1757,8 @@ done: if (F_ISSET(pip, VRFY_INCOMPLETE) && isbad == 0 && ret == 0) { * isbad == 0, though, it's now safe to do so, as we've * traversed any child overflow pages. Do it. */ - if (h == NULL && (ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) + if (h == NULL && + (ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0) goto err; if ((ret = __bam_vrfy_itemorder(dbp, vdp, h, pgno, 0, 1, 0, flags)) != 0) @@ -1780,7 +1777,8 @@ done: if (F_ISSET(pip, VRFY_INCOMPLETE) && isbad == 0 && ret == 0) { * must have children). */ if (isbad == 0 && ret == 0) { - if (h == NULL && (ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) + if (h == NULL && + (ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0) goto err; if (NUM_ENT(h) == 0 && ISINTERNAL(h)) { @@ -1797,8 +1795,10 @@ done: if (F_ISSET(pip, VRFY_INCOMPLETE) && isbad == 0 && ret == 0) { * so that we can verify our place with respect to them. If it's * appropriate--we have a default sort function--verify this. */ - if (isbad == 0 && ret == 0 && !LF_ISSET(DB_NOORDERCHK) && lp != NULL) { - if (h == NULL && (ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) + if (isbad == 0 && ret == 0 && !LF_ISSET(DB_NOORDERCHK) && + pip->type != P_IRECNO && pip->type != P_LRECNO) { + if (h == NULL && + (ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0) goto err; /* @@ -1813,7 +1813,7 @@ done: if (F_ISSET(pip, VRFY_INCOMPLETE) && isbad == 0 && ret == 0) { func = __bam_defcmp; if ((ret = __bam_vrfy_treeorder( - dbp, pgno, h, lp, rp, func, flags)) != 0) { + dbp, h, l, r, func, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else @@ -1889,9 +1889,8 @@ err: if (toplevel) { * no higher key we must sort less than. */ static int -__bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags) +__bam_vrfy_treeorder(dbp, h, lp, rp, func, flags) DB *dbp; - db_pgno_t pgno; PAGE *h; BINTERNAL *lp, *rp; int (*func) __P((DB *, const DBT *, const DBT *)); @@ -1925,9 +1924,7 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags) last = NUM_ENT(h) - P_INDX; break; default: - TYPE_ERR_PRINT(dbenv, "__bam_vrfy_treeorder", pgno, TYPE(h)); - DB_ASSERT(0); - return (EINVAL); + return (__db_unknown_path(dbenv, "__bam_vrfy_treeorder")); } /* @@ -1949,19 +1946,15 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags) dbt.size = lp->len; } else if (lp->type == B_OVERFLOW) { bo = (BOVERFLOW *)lp->data; - if ((ret = __db_goff(dbp, &dbt, bo->tlen, bo->pgno, - NULL, NULL)) != 0) + if ((ret = __db_goff(dbp, NULL, &dbt, + bo->tlen, bo->pgno, NULL, NULL)) != 0) return (ret); - } else { - DB_ASSERT(0); - EPRINT((dbenv, - "Page %lu: unknown type for internal record", - (u_long)PGNO(h))); - return (EINVAL); - } + } else + return ( + __db_unknown_path(dbenv, "__bam_vrfy_treeorder")); /* On error, fall through, free if needed, and return. */ - if ((ret = __bam_cmp(dbp, &dbt, h, 0, func, &cmp)) == 0) { + if ((ret = __bam_cmp(dbp, NULL, &dbt, h, 0, func, &cmp)) == 0) { if (cmp > 0) { EPRINT((dbenv, "Page %lu: first item on page sorted greater than parent entry", @@ -1985,19 +1978,16 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags) dbt.size = rp->len; } else if (rp->type == B_OVERFLOW) { bo = (BOVERFLOW *)rp->data; - if ((ret = __db_goff(dbp, &dbt, bo->tlen, bo->pgno, - NULL, NULL)) != 0) + if ((ret = __db_goff(dbp, NULL, &dbt, + bo->tlen, bo->pgno, NULL, NULL)) != 0) return (ret); - } else { - DB_ASSERT(0); - EPRINT((dbenv, - "Page %lu: unknown type for internal record", - (u_long)PGNO(h))); - return (EINVAL); - } + } else + return ( + __db_unknown_path(dbenv, "__bam_vrfy_treeorder")); /* On error, fall through, free if needed, and return. */ - if ((ret = __bam_cmp(dbp, &dbt, h, last, func, &cmp)) == 0) { + if ((ret = __bam_cmp(dbp, NULL, &dbt, + h, last, func, &cmp)) == 0) { if (cmp < 0) { EPRINT((dbenv, "Page %lu: last item on page sorted greater than parent entry", @@ -2037,38 +2027,32 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) DBT *key; u_int32_t flags; { - DBT dbt, unkdbt; - DB_ENV *dbenv; BKEYDATA *bk; BOVERFLOW *bo; + DBT dbt, unknown_key, unknown_data; + DB_ENV *dbenv; VRFY_ITEM *pgmap; - db_indx_t i, beg, end, *inp; + db_indx_t i, last, beg, end, *inp; u_int32_t himark; void *ovflbuf; - int t_ret, ret, err_ret; + int ret, t_ret, t2_ret; dbenv = dbp->dbenv; - - /* Shut up lint. */ - COMPQUIET(end, 0); - ovflbuf = pgmap = NULL; - err_ret = ret = 0; inp = P_INP(dbp, h); memset(&dbt, 0, sizeof(DBT)); dbt.flags = DB_DBT_REALLOC; - memset(&unkdbt, 0, sizeof(DBT)); - unkdbt.size = (u_int32_t)(strlen("UNKNOWN") + 1); - unkdbt.data = "UNKNOWN"; + DB_INIT_DBT(unknown_key, "UNKNOWN_KEY", sizeof("UNKNOWN_KEY") - 1); + DB_INIT_DBT(unknown_data, "UNKNOWN_DATA", sizeof("UNKNOWN_DATA") - 1); /* * Allocate a buffer for overflow items. Start at one page; * __db_safe_goff will realloc as needed. */ if ((ret = __os_malloc(dbenv, dbp->pgsize, &ovflbuf)) != 0) - return (ret); + goto err; if (LF_ISSET(DB_AGGRESSIVE) && (ret = __os_calloc(dbenv, dbp->pgsize, sizeof(pgmap[0]), &pgmap)) != 0) @@ -2077,161 +2061,185 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) /* * Loop through the inp array, spitting out key/data pairs. * - * If we're salvaging normally, loop from 0 through NUM_ENT(h). - * If we're being aggressive, loop until we hit the end of the page-- + * If we're salvaging normally, loop from 0 through NUM_ENT(h). If + * we're being aggressive, loop until we hit the end of the page -- * NUM_ENT() may be bogus. */ himark = dbp->pgsize; - for (i = 0;; i += O_INDX) { + for (i = 0, last = UINT16_MAX;; i += O_INDX) { /* If we're not aggressive, break when we hit NUM_ENT(h). */ if (!LF_ISSET(DB_AGGRESSIVE) && i >= NUM_ENT(h)) break; /* Verify the current item. */ - ret = __db_vrfy_inpitem(dbp, - h, pgno, i, 1, flags, &himark, NULL); - /* If this returned a fatality, it's time to break. */ - if (ret == DB_VERIFY_FATAL) { + t_ret = + __db_vrfy_inpitem(dbp, h, pgno, i, 1, flags, &himark, NULL); + + if (t_ret != 0) { /* - * Don't return DB_VERIFY_FATAL; it's private - * and means only that we can't go on with this - * page, not with the whole database. It's - * not even an error if we've run into it - * after NUM_ENT(h). + * If this is a btree leaf and we've printed out a key + * but not its associated data item, fix this imbalance + * by printing an "UNKNOWN_DATA". */ - ret = (i < NUM_ENT(h)) ? DB_VERIFY_BAD : 0; - break; + if (pgtype == P_LBTREE && i % P_INDX == 1 && + last == i - 1 && (t2_ret = __db_vrfy_prdbt( + &unknown_data, + 0, " ", handle, callback, 0, vdp)) != 0) { + if (ret == 0) + ret = t2_ret; + goto err; + } + + /* + * Don't return DB_VERIFY_FATAL; it's private and means + * only that we can't go on with this page, not with + * the whole database. It's not even an error if we've + * run into it after NUM_ENT(h). + */ + if (t_ret == DB_VERIFY_FATAL) { + if (i < NUM_ENT(h) && ret == 0) + ret = DB_VERIFY_BAD; + break; + } + continue; } /* * If this returned 0, it's safe to print or (carefully) * try to fetch. + * + * We only print deleted items if DB_AGGRESSIVE is set. */ - if (ret == 0) { - /* - * We only want to print deleted items if - * DB_AGGRESSIVE is set. - */ - bk = GET_BKEYDATA(dbp, h, i); - if (!LF_ISSET(DB_AGGRESSIVE) && B_DISSET(bk->type)) - continue; + bk = GET_BKEYDATA(dbp, h, i); + if (!LF_ISSET(DB_AGGRESSIVE) && B_DISSET(bk->type)) + continue; + + /* + * If this is a btree leaf and we're about to print out a data + * item for which we didn't print out a key, fix this imbalance + * by printing an "UNKNOWN_KEY". + */ + if (pgtype == P_LBTREE && i % P_INDX == 1 && + last != i - 1 && (t_ret = __db_vrfy_prdbt( + &unknown_key, 0, " ", handle, callback, 0, vdp)) != 0) { + if (ret == 0) + ret = t_ret; + goto err; + } + last = i; + + /* + * We're going to go try to print the next item. If key is + * non-NULL, we're a dup page, so we've got to print the key + * first, unless SA_SKIPFIRSTKEY is set and we're on the first + * entry. + */ + if (key != NULL && (i != 0 || !LF_ISSET(SA_SKIPFIRSTKEY))) + if ((t_ret = __db_vrfy_prdbt(key, + 0, " ", handle, callback, 0, vdp)) != 0) { + if (ret == 0) + ret = t_ret; + goto err; + } + beg = inp[i]; + switch (B_TYPE(bk->type)) { + case B_DUPLICATE: + end = beg + BOVERFLOW_SIZE - 1; /* - * We're going to go try to print the next item. If - * key is non-NULL, we're a dup page, so we've got to - * print the key first, unless SA_SKIPFIRSTKEY is set - * and we're on the first entry. + * If we're not on a normal btree leaf page, there + * shouldn't be off-page dup sets. Something's + * confused; just drop it, and the code to pick up + * unlinked offpage dup sets will print it out + * with key "UNKNOWN" later. */ - if (key != NULL && - (i != 0 || !LF_ISSET(SA_SKIPFIRSTKEY))) - if ((ret = __db_vrfy_prdbt(key, - 0, " ", handle, callback, 0, vdp)) != 0) - err_ret = ret; - - beg = inp[i]; - switch (B_TYPE(bk->type)) { - case B_DUPLICATE: - end = beg + BOVERFLOW_SIZE - 1; - /* - * If we're not on a normal btree leaf page, - * there shouldn't be off-page - * dup sets. Something's confused; just - * drop it, and the code to pick up unlinked - * offpage dup sets will print it out - * with key "UNKNOWN" later. - */ - if (pgtype != P_LBTREE) - break; + if (pgtype != P_LBTREE) + break; - bo = (BOVERFLOW *)bk; + bo = (BOVERFLOW *)bk; - /* - * If the page number is unreasonable, or - * if this is supposed to be a key item, - * just spit out "UNKNOWN"--the best we - * can do is run into the data items in the - * unlinked offpage dup pass. - */ - if (!IS_VALID_PGNO(bo->pgno) || - (i % P_INDX == 0)) { - /* Not much to do on failure. */ - if ((ret = - __db_vrfy_prdbt(&unkdbt, 0, " ", - handle, callback, 0, vdp)) != 0) - err_ret = ret; - break; + /* + * If the page number is unreasonable, or if this is + * supposed to be a key item, output "UNKNOWN_KEY" -- + * the best we can do is run into the data items in + * the unlinked offpage dup pass. + */ + if (!IS_VALID_PGNO(bo->pgno) || (i % P_INDX == 0)) { + /* Not much to do on failure. */ + if ((t_ret = __db_vrfy_prdbt(&unknown_key, + 0, " ", handle, callback, 0, vdp)) != 0) { + if (ret == 0) + ret = t_ret; + goto err; } + break; + } - if ((ret = __db_salvage_duptree(dbp, - vdp, bo->pgno, &dbt, handle, callback, - flags | SA_SKIPFIRSTKEY)) != 0) - err_ret = ret; + /* Don't stop on error. */ + if ((t_ret = __db_salvage_duptree(dbp, + vdp, bo->pgno, &dbt, handle, callback, + flags | SA_SKIPFIRSTKEY)) != 0 && ret == 0) + ret = t_ret; - break; - case B_KEYDATA: - end = (db_indx_t)DB_ALIGN( - beg + bk->len, sizeof(u_int32_t)) - 1; - dbt.data = bk->data; - dbt.size = bk->len; - if ((ret = __db_vrfy_prdbt(&dbt, - 0, " ", handle, callback, 0, vdp)) != 0) - err_ret = ret; - break; - case B_OVERFLOW: - end = beg + BOVERFLOW_SIZE - 1; - bo = (BOVERFLOW *)bk; - if ((ret = __db_safe_goff(dbp, vdp, - bo->pgno, &dbt, &ovflbuf, flags)) != 0) { - err_ret = ret; - /* We care about err_ret more. */ - (void)__db_vrfy_prdbt(&unkdbt, 0, " ", - handle, callback, 0, vdp); - break; - } - if ((ret = __db_vrfy_prdbt(&dbt, - 0, " ", handle, callback, 0, vdp)) != 0) - err_ret = ret; - break; - default: - /* - * We should never get here; __db_vrfy_inpitem - * should not be returning 0 if bk->type - * is unrecognizable. - */ - DB_ASSERT(0); - return (EINVAL); + break; + case B_KEYDATA: + end = (db_indx_t)DB_ALIGN( + beg + bk->len, sizeof(u_int32_t)) - 1; + dbt.data = bk->data; + dbt.size = bk->len; + if ((t_ret = __db_vrfy_prdbt(&dbt, + 0, " ", handle, callback, 0, vdp)) != 0) { + if (ret == 0) + ret = t_ret; + goto err; } + break; + case B_OVERFLOW: + end = beg + BOVERFLOW_SIZE - 1; + bo = (BOVERFLOW *)bk; + /* Don't stop on error. */ + if ((t_ret = __db_safe_goff(dbp, vdp, + bo->pgno, &dbt, &ovflbuf, flags)) != 0 && ret == 0) + ret = t_ret; + if ((t_ret = __db_vrfy_prdbt( + t_ret == 0 ? &dbt : &unknown_key, + 0, " ", handle, callback, 0, vdp)) != 0 && ret == 0) + ret = t_ret; + break; + default: /* - * If we're being aggressive, mark the beginning - * and end of the item; we'll come back and print - * whatever "junk" is in the gaps in case we had - * any bogus inp elements and thereby missed stuff. + * We should never get here; __db_vrfy_inpitem should + * not be returning 0 if bk->type is unrecognizable. */ - if (LF_ISSET(DB_AGGRESSIVE)) { - pgmap[beg] = VRFY_ITEM_BEGIN; - pgmap[end] = VRFY_ITEM_END; - } + t_ret = __db_unknown_path(dbenv, "__bam_salvage"); + if (ret == 0) + ret = t_ret; + goto err; } - } - /* - * If i is odd and this is a btree leaf, we've printed out a key but not - * a datum; fix this imbalance by printing an "UNKNOWN". - */ - if (pgtype == P_LBTREE && (i % P_INDX == 1) && ((ret = - __db_vrfy_prdbt(&unkdbt, 0, " ", handle, callback, 0, vdp)) != 0)) - err_ret = ret; + /* + * If we're being aggressive, mark the beginning and end of + * the item; we'll come back and print whatever "junk" is in + * the gaps in case we had any bogus inp elements and thereby + * missed stuff. + */ + if (LF_ISSET(DB_AGGRESSIVE)) { + pgmap[beg] = VRFY_ITEM_BEGIN; + pgmap[end] = VRFY_ITEM_END; + } + } err: if (pgmap != NULL) __os_free(dbenv, pgmap); - __os_free(dbenv, ovflbuf); + if (ovflbuf != NULL) + __os_free(dbenv, ovflbuf); /* Mark this page as done. */ - if ((t_ret = __db_salvage_markdone(vdp, pgno)) != 0) - return (t_ret); + if ((t_ret = __db_salvage_markdone(vdp, pgno)) != 0 && ret == 0) + ret = t_ret; - return ((err_ret != 0) ? err_ret : ret); + return (ret); } /* @@ -2252,12 +2260,15 @@ __bam_salvage_walkdupint(dbp, vdp, h, key, handle, callback, flags) int (*callback) __P((void *, const void *)); u_int32_t flags; { + DB_ENV *dbenv; RINTERNAL *ri; BINTERNAL *bi; int ret, t_ret; db_indx_t i; + dbenv = dbp->dbenv; ret = 0; + for (i = 0; i < NUM_ENT(h); i++) { switch (TYPE(h)) { case P_IBTREE: @@ -2273,10 +2284,8 @@ __bam_salvage_walkdupint(dbp, vdp, h, key, handle, callback, flags) ret = t_ret; break; default: - __db_err(dbp->dbenv, - "__bam_salvage_walkdupint called on non-int. page"); - DB_ASSERT(0); - return (EINVAL); + return (__db_unknown_path( + dbenv, "__bam_salvage_walkdupint")); } /* Pass SA_SKIPFIRSTKEY, if set, on to the 0th child only. */ flags &= ~LF_ISSET(SA_SKIPFIRSTKEY); @@ -2317,16 +2326,18 @@ __bam_meta2pgset(dbp, vdp, btmeta, flags, pgset) db_pgno_t current, p; int err_ret, ret; + DB_ASSERT(dbp->dbenv, pgset != NULL); + mpf = dbp->mpf; h = NULL; ret = err_ret = 0; - DB_ASSERT(pgset != NULL); + for (current = btmeta->root;;) { if (!IS_VALID_PGNO(current) || current == PGNO(btmeta)) { err_ret = DB_VERIFY_BAD; goto err; } - if ((ret = __memp_fget(mpf, ¤t, 0, &h)) != 0) { + if ((ret = __memp_fget(mpf, ¤t, NULL, 0, &h)) != 0) { err_ret = ret; goto err; } @@ -2367,7 +2378,7 @@ __bam_meta2pgset(dbp, vdp, btmeta, flags, pgset) traverse: while (IS_VALID_PGNO(current) && current != PGNO_INVALID) { if (h == NULL && - (ret = __memp_fget(mpf, ¤t, 0, &h)) != 0) { + (ret = __memp_fget(mpf, ¤t, NULL, 0, &h)) != 0) { err_ret = ret; break; } @@ -2430,7 +2441,8 @@ __bam_safe_getdata(dbp, h, i, ovflok, dbt, freedbtp) F_SET(dbt, DB_DBT_MALLOC); *freedbtp = 1; - return (__db_goff(dbp, dbt, bo->tlen, bo->pgno, NULL, NULL)); + return (__db_goff(dbp, NULL, dbt, + bo->tlen, bo->pgno, NULL, NULL)); } else { dbt->data = bk->data; dbt->size = bk->len; diff --git a/db/btree/btree.src b/db/btree/btree.src index c4f761de0..9a35d5adc 100644 --- a/db/btree/btree.src +++ b/db/btree/btree.src @@ -1,22 +1,15 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: btree.src,v 10.42 2004/06/17 17:35:12 bostic Exp $ + * $Id: btree.src,v 12.7 2006/08/24 14:44:46 bostic Exp $ */ PREFIX __bam DBPRIVATE -INCLUDE #ifndef NO_SYSTEM_INCLUDES -INCLUDE #include -INCLUDE -INCLUDE #include -INCLUDE #include -INCLUDE #endif -INCLUDE INCLUDE #include "db_int.h" INCLUDE #include "dbinc/crypto.h" INCLUDE #include "dbinc/db_page.h" @@ -41,7 +34,7 @@ INCLUDE * pg: the split page's contents before the split. * opflags: SPL_NRECS: if splitting a tree that maintains a record count. */ -BEGIN split 62 +BEGIN split 42 62 DB fileid int32_t ld ARG left db_pgno_t lu POINTER llsn DB_LSN * lu @@ -65,7 +58,7 @@ END * rootent: last entry on the root page. * rootlsn: the root page's original lsn. */ -BEGIN rsplit 63 +BEGIN rsplit 42 63 DB fileid int32_t ld ARG pgno db_pgno_t lu PGDBT pgdbt DBT s @@ -84,7 +77,7 @@ END * indx_copy: the index to copy if inserting. * is_insert: 0 if a delete, 1 if an insert. */ -BEGIN adj 55 +BEGIN adj 42 55 DB fileid int32_t ld ARG pgno db_pgno_t lu POINTER lsn DB_LSN * lu @@ -102,7 +95,7 @@ END * adjust: the signed adjustment. * opflags: CAD_UPDATEROOT: if root page count was adjusted. */ -BEGIN cadjust 56 +BEGIN cadjust 42 56 DB fileid int32_t ld ARG pgno db_pgno_t lu POINTER lsn DB_LSN * lu @@ -118,7 +111,7 @@ END * lsn: the page's original lsn. * indx: the index to be deleted. */ -BEGIN cdel 57 +BEGIN cdel 42 57 DB fileid int32_t ld ARG pgno db_pgno_t lu POINTER lsn DB_LSN * lu @@ -137,7 +130,7 @@ END * prefix: the prefix of the replacement that matches the original. * suffix: the suffix of the replacement that matches the original. */ -BEGIN repl 58 +BEGIN repl 42 58 DB fileid int32_t ld ARG pgno db_pgno_t lu POINTER lsn DB_LSN * lu @@ -152,7 +145,7 @@ END /* * BTREE-root: log the assignment of a root btree page. */ -BEGIN root 59 +BEGIN root 42 59 DB fileid int32_t ld ARG meta_pgno db_pgno_t lu ARG root_pgno db_pgno_t lu @@ -166,7 +159,7 @@ END * signed index adjustment in one case. * care should be taken if its size is changed. */ -BEGIN curadj 64 +BEGIN curadj 42 64 /* Fileid of db affected. */ DB fileid int32_t ld /* Which adjustment. */ @@ -190,7 +183,7 @@ END * renumbering recno trees. * Should only be processed during DB_TXN_ABORT. */ -BEGIN rcuradj 65 +BEGIN rcuradj 42 65 /* Fileid of db affected. */ DB fileid int32_t ld /* Which adjustment. */ @@ -207,10 +200,10 @@ END * BTREE-relink -- Handles relinking around a deleted leaf page. * */ -BEGIN relink 147 +BEGIN_COMPAT relink 43 147 /* Fileid of db affected. */ DB fileid int32_t ld -/* The page being changed. */ +/* The page being removed. */ ARG pgno db_pgno_t lu /* The page's original lsn. */ POINTER lsn DB_LSN * lu @@ -223,3 +216,47 @@ ARG next db_pgno_t lu /* The previous page's original lsn. */ POINTER lsn_next DB_LSN * lu END + +BEGIN relink 44 147 +/* Fileid of db affected. */ +DB fileid int32_t ld +/* The page being removed. */ +ARG pgno db_pgno_t lu +/* The new page number, if any. */ +ARG new_pgno db_pgno_t lu +/* The previous page. */ +ARG prev db_pgno_t lu +/* The previous page's original lsn. */ +POINTER lsn_prev DB_LSN * lu +/* The next page. */ +ARG next db_pgno_t lu +/* The previous page's original lsn. */ +POINTER lsn_next DB_LSN * lu +END + +/* + * BTREE-merge -- Handles merging of pages during a compaction. + */ +BEGIN merge 44 148 +DB fileid int32_t ld +ARG pgno db_pgno_t lu +POINTER lsn DB_LSN * lu +ARG npgno db_pgno_t lu +POINTER nlsn DB_LSN * lu +DBT hdr DBT s +DBT data DBT s +DBT ind DBT s +END + +/* + * BTREE-pgno -- Handles replacing a page number in the record + * refernece on pgno by indx. + */ +BEGIN pgno 44 149 +DB fileid int32_t ld +ARG pgno db_pgno_t lu +POINTER lsn DB_LSN * lu +ARG indx u_int32_t lu +ARG opgno db_pgno_t lu +ARG npgno db_pgno_t lu +END diff --git a/db/btree/btree_auto.c b/db/btree/btree_auto.c index 7b2002a4a..3d5b9ed97 100644 --- a/db/btree/btree_auto.c +++ b/db/btree/btree_auto.c @@ -2,13 +2,6 @@ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#endif - #include "db_int.h" #include "dbinc/crypto.h" #include "dbinc/db_page.h" @@ -24,10 +17,10 @@ * PUBLIC: db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, u_int32_t)); */ int -__bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx, +__bam_split_log(dbp, txnp, ret_lsnp, flags, left, llsn, right, rlsn, indx, npgno, nlsn, root_pgno, pg, opflags) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; db_pgno_t left; @@ -61,30 +54,31 @@ __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx, if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -107,7 +101,7 @@ __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx, logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -147,9 +141,15 @@ __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx, memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (llsn != NULL) + if (llsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(llsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, llsn) != 0)) + return (ret); + } memcpy(bp, llsn, sizeof(*llsn)); - else + } else memset(bp, 0, sizeof(*llsn)); bp += sizeof(*llsn); @@ -157,9 +157,15 @@ __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx, memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (rlsn != NULL) + if (rlsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(rlsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, rlsn) != 0)) + return (ret); + } memcpy(bp, rlsn, sizeof(*rlsn)); - else + } else memset(bp, 0, sizeof(*rlsn)); bp += sizeof(*rlsn); @@ -171,9 +177,15 @@ __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx, memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (nlsn != NULL) + if (nlsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(nlsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, nlsn) != 0)) + return (ret); + } memcpy(bp, nlsn, sizeof(*nlsn)); - else + } else memset(bp, 0, sizeof(*nlsn)); bp += sizeof(*nlsn); @@ -196,12 +208,13 @@ __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx, memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -220,20 +233,21 @@ __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx, #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_split_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -257,13 +271,14 @@ __bam_split_read(dbenv, recbuf, argpp) sizeof(__bam_split_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -321,10 +336,10 @@ __bam_split_read(dbenv, recbuf, argpp) * PUBLIC: const DBT *, DB_LSN *)); */ int -__bam_rsplit_log(dbp, txnid, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, rootent, +__bam_rsplit_log(dbp, txnp, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, rootent, rootlsn) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; db_pgno_t pgno; @@ -354,30 +369,31 @@ __bam_rsplit_log(dbp, txnid, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, root if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -396,7 +412,7 @@ __bam_rsplit_log(dbp, txnid, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, root logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -466,18 +482,25 @@ __bam_rsplit_log(dbp, txnid, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, root bp += rootent->size; } - if (rootlsn != NULL) + if (rootlsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(rootlsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, rootlsn) != 0)) + return (ret); + } memcpy(bp, rootlsn, sizeof(*rootlsn)); - else + } else memset(bp, 0, sizeof(*rootlsn)); bp += sizeof(*rootlsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -496,20 +519,21 @@ __bam_rsplit_log(dbp, txnid, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, root #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_rsplit_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -533,13 +557,14 @@ __bam_rsplit_read(dbenv, recbuf, argpp) sizeof(__bam_rsplit_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -585,9 +610,9 @@ __bam_rsplit_read(dbenv, recbuf, argpp) * PUBLIC: u_int32_t)); */ int -__bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert) +__bam_adj_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; db_pgno_t pgno; @@ -616,30 +641,31 @@ __bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -657,7 +683,7 @@ __bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -697,9 +723,15 @@ __bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (lsn != NULL) + if (lsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, lsn) != 0)) + return (ret); + } memcpy(bp, lsn, sizeof(*lsn)); - else + } else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); @@ -715,12 +747,13 @@ __bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -739,20 +772,21 @@ __bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_adj_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -776,13 +810,14 @@ __bam_adj_read(dbenv, recbuf, argpp) sizeof(__bam_adj_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -819,9 +854,9 @@ __bam_adj_read(dbenv, recbuf, argpp) * PUBLIC: u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, int32_t, u_int32_t)); */ int -__bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags) +__bam_cadjust_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; db_pgno_t pgno; @@ -850,30 +885,31 @@ __bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags) if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -891,7 +927,7 @@ __bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags) logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -931,9 +967,15 @@ __bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags) memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (lsn != NULL) + if (lsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, lsn) != 0)) + return (ret); + } memcpy(bp, lsn, sizeof(*lsn)); - else + } else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); @@ -949,12 +991,13 @@ __bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags) memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -973,20 +1016,21 @@ __bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags) #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_cadjust_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -1011,13 +1055,14 @@ __bam_cadjust_read(dbenv, recbuf, argpp) sizeof(__bam_cadjust_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -1054,9 +1099,9 @@ __bam_cadjust_read(dbenv, recbuf, argpp) * PUBLIC: u_int32_t, db_pgno_t, DB_LSN *, u_int32_t)); */ int -__bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx) +__bam_cdel_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; db_pgno_t pgno; @@ -1083,30 +1128,31 @@ __bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx) if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -1122,7 +1168,7 @@ __bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx) logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -1162,9 +1208,15 @@ __bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx) memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (lsn != NULL) + if (lsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, lsn) != 0)) + return (ret); + } memcpy(bp, lsn, sizeof(*lsn)); - else + } else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); @@ -1172,12 +1224,13 @@ __bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx) memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -1196,20 +1249,21 @@ __bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx) #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_cdel_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -1233,13 +1287,14 @@ __bam_cdel_read(dbenv, recbuf, argpp) sizeof(__bam_cdel_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -1269,10 +1324,10 @@ __bam_cdel_read(dbenv, recbuf, argpp) * PUBLIC: const DBT *, const DBT *, u_int32_t, u_int32_t)); */ int -__bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig, +__bam_repl_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig, repl, prefix, suffix) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; db_pgno_t pgno; @@ -1304,30 +1359,31 @@ __bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig, if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -1348,7 +1404,7 @@ __bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig, logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -1388,9 +1444,15 @@ __bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig, memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (lsn != NULL) + if (lsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, lsn) != 0)) + return (ret); + } memcpy(bp, lsn, sizeof(*lsn)); - else + } else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); @@ -1432,12 +1494,13 @@ __bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig, memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -1456,20 +1519,21 @@ __bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig, #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_repl_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -1493,13 +1557,14 @@ __bam_repl_read(dbenv, recbuf, argpp) sizeof(__bam_repl_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -1552,9 +1617,9 @@ __bam_repl_read(dbenv, recbuf, argpp) * PUBLIC: u_int32_t, db_pgno_t, db_pgno_t, DB_LSN *)); */ int -__bam_root_log(dbp, txnid, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn) +__bam_root_log(dbp, txnp, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; db_pgno_t meta_pgno; @@ -1581,30 +1646,31 @@ __bam_root_log(dbp, txnid, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn) if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -1620,7 +1686,7 @@ __bam_root_log(dbp, txnid, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn) logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -1664,18 +1730,25 @@ __bam_root_log(dbp, txnid, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn) memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (meta_lsn != NULL) + if (meta_lsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, meta_lsn) != 0)) + return (ret); + } memcpy(bp, meta_lsn, sizeof(*meta_lsn)); - else + } else memset(bp, 0, sizeof(*meta_lsn)); bp += sizeof(*meta_lsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -1694,20 +1767,21 @@ __bam_root_log(dbp, txnid, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn) #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_root_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -1731,13 +1805,14 @@ __bam_root_read(dbenv, recbuf, argpp) sizeof(__bam_root_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -1767,10 +1842,10 @@ __bam_root_read(dbenv, recbuf, argpp) * PUBLIC: u_int32_t, u_int32_t, u_int32_t)); */ int -__bam_curadj_log(dbp, txnid, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgno, first_indx, +__bam_curadj_log(dbp, txnp, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgno, first_indx, from_indx, to_indx) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; db_ca_mode mode; @@ -1801,30 +1876,31 @@ __bam_curadj_log(dbp, txnid, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgn if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -1844,7 +1920,7 @@ __bam_curadj_log(dbp, txnid, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgn logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -1908,12 +1984,13 @@ __bam_curadj_log(dbp, txnid, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgn memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -1932,20 +2009,21 @@ __bam_curadj_log(dbp, txnid, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgn #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_curadj_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -1969,13 +2047,14 @@ __bam_curadj_read(dbenv, recbuf, argpp) sizeof(__bam_curadj_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -2021,9 +2100,9 @@ __bam_curadj_read(dbenv, recbuf, argpp) * PUBLIC: u_int32_t, ca_recno_arg, db_pgno_t, db_recno_t, u_int32_t)); */ int -__bam_rcuradj_log(dbp, txnid, ret_lsnp, flags, mode, root, recno, order) +__bam_rcuradj_log(dbp, txnp, ret_lsnp, flags, mode, root, recno, order) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; ca_recno_arg mode; @@ -2051,30 +2130,31 @@ __bam_rcuradj_log(dbp, txnid, ret_lsnp, flags, mode, root, recno, order) if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -2091,7 +2171,7 @@ __bam_rcuradj_log(dbp, txnid, ret_lsnp, flags, mode, root, recno, order) logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -2143,12 +2223,13 @@ __bam_rcuradj_log(dbp, txnid, ret_lsnp, flags, mode, root, recno, order) memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -2167,20 +2248,21 @@ __bam_rcuradj_log(dbp, txnid, ret_lsnp, flags, mode, root, recno, order) #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_rcuradj_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -2205,13 +2287,14 @@ __bam_rcuradj_read(dbenv, recbuf, argpp) sizeof(__bam_rcuradj_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -2240,20 +2323,80 @@ __bam_rcuradj_read(dbenv, recbuf, argpp) return (0); } +/* + * PUBLIC: int __bam_relink_43_read __P((DB_ENV *, void *, + * PUBLIC: __bam_relink_43_args **)); + */ +int +__bam_relink_43_read(dbenv, recbuf, argpp) + DB_ENV *dbenv; + void *recbuf; + __bam_relink_43_args **argpp; +{ + __bam_relink_43_args *argp; + u_int32_t uinttmp; + u_int8_t *bp; + int ret; + + if ((ret = __os_malloc(dbenv, + sizeof(__bam_relink_43_args) + sizeof(DB_TXN), &argp)) != 0) + return (ret); + bp = recbuf; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); + + memcpy(&argp->type, bp, sizeof(argp->type)); + bp += sizeof(argp->type); + + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); + + memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); + bp += sizeof(DB_LSN); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->fileid = (int32_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->pgno = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&argp->lsn, bp, sizeof(argp->lsn)); + bp += sizeof(argp->lsn); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->prev = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&argp->lsn_prev, bp, sizeof(argp->lsn_prev)); + bp += sizeof(argp->lsn_prev); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->next = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&argp->lsn_next, bp, sizeof(argp->lsn_next)); + bp += sizeof(argp->lsn_next); + + *argpp = argp; + return (0); +} + /* * PUBLIC: int __bam_relink_log __P((DB *, DB_TXN *, DB_LSN *, - * PUBLIC: u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, + * PUBLIC: u_int32_t, db_pgno_t, db_pgno_t, db_pgno_t, DB_LSN *, db_pgno_t, * PUBLIC: DB_LSN *)); */ int -__bam_relink_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, prev, lsn_prev, next, +__bam_relink_log(dbp, txnp, ret_lsnp, flags, pgno, new_pgno, prev, lsn_prev, next, lsn_next) DB *dbp; - DB_TXN *txnid; + DB_TXN *txnp; DB_LSN *ret_lsnp; u_int32_t flags; db_pgno_t pgno; - DB_LSN * lsn; + db_pgno_t new_pgno; db_pgno_t prev; DB_LSN * lsn_prev; db_pgno_t next; @@ -2279,30 +2422,31 @@ __bam_relink_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, prev, lsn_prev, next, if (LF_ISSET(DB_LOG_NOT_DURABLE) || F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); is_durable = 0; } else is_durable = 1; - if (txnid == NULL) { + if (txnp == NULL) { txn_num = 0; lsnp = &null_lsn; null_lsn.file = null_lsn.offset = 0; } else { - if (TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) return (ret); /* * We need to assign begin_lsn while holding region mutex. * That assignment is done inside the DbEnv->log_put call, * so pass in the appropriate memory location to be filled * in by the log_put code. - */ - DB_SET_BEGIN_LSNP(txnid, &rlsnp); - txn_num = txnid->txnid; - lsnp = &txnid->last_lsn; + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; } - DB_ASSERT(dbp->log_filename != NULL); + DB_ASSERT(dbenv, dbp->log_filename != NULL); if (dbp->log_filename->id == DB_LOGFILEID_INVALID && (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); @@ -2310,7 +2454,7 @@ __bam_relink_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, prev, lsn_prev, next, logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(u_int32_t) + sizeof(u_int32_t) - + sizeof(*lsn) + + sizeof(u_int32_t) + sizeof(u_int32_t) + sizeof(*lsn_prev) + sizeof(u_int32_t) @@ -2321,7 +2465,7 @@ __bam_relink_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, prev, lsn_prev, next, logrec.size += npad; } - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) return (ret); @@ -2361,19 +2505,23 @@ __bam_relink_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, prev, lsn_prev, next, memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); + uinttmp = (u_int32_t)new_pgno; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); uinttmp = (u_int32_t)prev; memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (lsn_prev != NULL) + if (lsn_prev != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(lsn_prev, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, lsn_prev) != 0)) + return (ret); + } memcpy(bp, lsn_prev, sizeof(*lsn_prev)); - else + } else memset(bp, 0, sizeof(*lsn_prev)); bp += sizeof(*lsn_prev); @@ -2381,18 +2529,25 @@ __bam_relink_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, prev, lsn_prev, next, memcpy(bp, &uinttmp, sizeof(uinttmp)); bp += sizeof(uinttmp); - if (lsn_next != NULL) + if (lsn_next != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(lsn_next, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, lsn_next) != 0)) + return (ret); + } memcpy(bp, lsn_next, sizeof(*lsn_next)); - else + } else memset(bp, 0, sizeof(*lsn_next)); bp += sizeof(*lsn_next); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); - if (is_durable || txnid == NULL) { + if (is_durable || txnp == NULL) { if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, - flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) { - txnid->last_lsn = *rlsnp; + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; if (rlsnp != ret_lsnp) *ret_lsnp = *rlsnp; } @@ -2411,20 +2566,21 @@ __bam_relink_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, prev, lsn_prev, next, #else ret = 0; #endif - STAILQ_INSERT_HEAD(&txnid->logs, lr, links); + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); LSN_NOT_LOGGED(*ret_lsnp); } #ifdef LOG_DIAGNOSTIC if (ret != 0) (void)__bam_relink_print(dbenv, - (DBT *)&logrec, ret_lsnp, NULL, NULL); + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); #endif #ifdef DIAGNOSTIC __os_free(dbenv, logrec.data); #else - if (is_durable || txnid == NULL) + if (is_durable || txnp == NULL) __os_free(dbenv, logrec.data); #endif return (ret); @@ -2448,13 +2604,14 @@ __bam_relink_read(dbenv, recbuf, argpp) sizeof(__bam_relink_args) + sizeof(DB_TXN), &argp)) != 0) return (ret); bp = recbuf; - argp->txnid = (DB_TXN *)&argp[1]; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); @@ -2467,8 +2624,9 @@ __bam_relink_read(dbenv, recbuf, argpp) argp->pgno = (db_pgno_t)uinttmp; bp += sizeof(uinttmp); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->new_pgno = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); memcpy(&uinttmp, bp, sizeof(uinttmp)); argp->prev = (db_pgno_t)uinttmp; @@ -2489,46 +2647,597 @@ __bam_relink_read(dbenv, recbuf, argpp) } /* - * PUBLIC: int __bam_init_recover __P((DB_ENV *, int (***)(DB_ENV *, - * PUBLIC: DBT *, DB_LSN *, db_recops, void *), size_t *)); + * PUBLIC: int __bam_merge_log __P((DB *, DB_TXN *, DB_LSN *, + * PUBLIC: u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, const DBT *, + * PUBLIC: const DBT *, const DBT *)); */ int -__bam_init_recover(dbenv, dtabp, dtabsizep) - DB_ENV *dbenv; - int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - size_t *dtabsizep; +__bam_merge_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, npgno, nlsn, hdr, + data, ind) + DB *dbp; + DB_TXN *txnp; + DB_LSN *ret_lsnp; + u_int32_t flags; + db_pgno_t pgno; + DB_LSN * lsn; + db_pgno_t npgno; + DB_LSN * nlsn; + const DBT *hdr; + const DBT *data; + const DBT *ind; { - int ret; + DBT logrec; + DB_ENV *dbenv; + DB_TXNLOGREC *lr; + DB_LSN *lsnp, null_lsn, *rlsnp; + u_int32_t zero, uinttmp, rectype, txn_num; + u_int npad; + u_int8_t *bp; + int is_durable, ret; - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_split_recover, DB___bam_split)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_rsplit_recover, DB___bam_rsplit)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_adj_recover, DB___bam_adj)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_cadjust_recover, DB___bam_cadjust)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_cdel_recover, DB___bam_cdel)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_repl_recover, DB___bam_repl)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_root_recover, DB___bam_root)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_curadj_recover, DB___bam_curadj)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_rcuradj_recover, DB___bam_rcuradj)) != 0) + dbenv = dbp->dbenv; + COMPQUIET(lr, NULL); + + rectype = DB___bam_merge; + npad = 0; + rlsnp = ret_lsnp; + + ret = 0; + + if (LF_ISSET(DB_LOG_NOT_DURABLE) || + F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); + is_durable = 0; + } else + is_durable = 1; + + if (txnp == NULL) { + txn_num = 0; + lsnp = &null_lsn; + null_lsn.file = null_lsn.offset = 0; + } else { + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) + return (ret); + /* + * We need to assign begin_lsn while holding region mutex. + * That assignment is done inside the DbEnv->log_put call, + * so pass in the appropriate memory location to be filled + * in by the log_put code. + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; + } + + DB_ASSERT(dbenv, dbp->log_filename != NULL); + if (dbp->log_filename->id == DB_LOGFILEID_INVALID && + (ret = __dbreg_lazy_id(dbp)) != 0) return (ret); - if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, - __bam_relink_recover, DB___bam_relink)) != 0) + + logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + + sizeof(u_int32_t) + + sizeof(u_int32_t) + + sizeof(*lsn) + + sizeof(u_int32_t) + + sizeof(*nlsn) + + sizeof(u_int32_t) + (hdr == NULL ? 0 : hdr->size) + + sizeof(u_int32_t) + (data == NULL ? 0 : data->size) + + sizeof(u_int32_t) + (ind == NULL ? 0 : ind->size); + if (CRYPTO_ON(dbenv)) { + npad = + ((DB_CIPHER *)dbenv->crypto_handle)->adj_size(logrec.size); + logrec.size += npad; + } + + if (is_durable || txnp == NULL) { + if ((ret = + __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) + return (ret); + } else { + if ((ret = __os_malloc(dbenv, + logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0) + return (ret); +#ifdef DIAGNOSTIC + if ((ret = + __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) { + __os_free(dbenv, lr); + return (ret); + } +#else + logrec.data = lr->data; +#endif + } + if (npad > 0) + memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad); + + bp = logrec.data; + + memcpy(bp, &rectype, sizeof(rectype)); + bp += sizeof(rectype); + + memcpy(bp, &txn_num, sizeof(txn_num)); + bp += sizeof(txn_num); + + memcpy(bp, lsnp, sizeof(DB_LSN)); + bp += sizeof(DB_LSN); + + uinttmp = (u_int32_t)dbp->log_filename->id; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + uinttmp = (u_int32_t)pgno; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + if (lsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, lsn) != 0)) + return (ret); + } + memcpy(bp, lsn, sizeof(*lsn)); + } else + memset(bp, 0, sizeof(*lsn)); + bp += sizeof(*lsn); + + uinttmp = (u_int32_t)npgno; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + if (nlsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(nlsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, nlsn) != 0)) + return (ret); + } + memcpy(bp, nlsn, sizeof(*nlsn)); + } else + memset(bp, 0, sizeof(*nlsn)); + bp += sizeof(*nlsn); + + if (hdr == NULL) { + zero = 0; + memcpy(bp, &zero, sizeof(u_int32_t)); + bp += sizeof(u_int32_t); + } else { + memcpy(bp, &hdr->size, sizeof(hdr->size)); + bp += sizeof(hdr->size); + memcpy(bp, hdr->data, hdr->size); + bp += hdr->size; + } + + if (data == NULL) { + zero = 0; + memcpy(bp, &zero, sizeof(u_int32_t)); + bp += sizeof(u_int32_t); + } else { + memcpy(bp, &data->size, sizeof(data->size)); + bp += sizeof(data->size); + memcpy(bp, data->data, data->size); + bp += data->size; + } + + if (ind == NULL) { + zero = 0; + memcpy(bp, &zero, sizeof(u_int32_t)); + bp += sizeof(u_int32_t); + } else { + memcpy(bp, &ind->size, sizeof(ind->size)); + bp += sizeof(ind->size); + memcpy(bp, ind->data, ind->size); + bp += ind->size; + } + + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + + if (is_durable || txnp == NULL) { + if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; + if (rlsnp != ret_lsnp) + *ret_lsnp = *rlsnp; + } + } else { +#ifdef DIAGNOSTIC + /* + * Set the debug bit if we are going to log non-durable + * transactions so they will be ignored by recovery. + */ + memcpy(lr->data, logrec.data, logrec.size); + rectype |= DB_debug_FLAG; + memcpy(logrec.data, &rectype, sizeof(rectype)); + + ret = __log_put(dbenv, + rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY); +#else + ret = 0; +#endif + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); + LSN_NOT_LOGGED(*ret_lsnp); + } + +#ifdef LOG_DIAGNOSTIC + if (ret != 0) + (void)__bam_merge_print(dbenv, + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); +#endif + +#ifdef DIAGNOSTIC + __os_free(dbenv, logrec.data); +#else + if (is_durable || txnp == NULL) + __os_free(dbenv, logrec.data); +#endif + return (ret); +} + +/* + * PUBLIC: int __bam_merge_read __P((DB_ENV *, void *, __bam_merge_args **)); + */ +int +__bam_merge_read(dbenv, recbuf, argpp) + DB_ENV *dbenv; + void *recbuf; + __bam_merge_args **argpp; +{ + __bam_merge_args *argp; + u_int32_t uinttmp; + u_int8_t *bp; + int ret; + + if ((ret = __os_malloc(dbenv, + sizeof(__bam_merge_args) + sizeof(DB_TXN), &argp)) != 0) + return (ret); + bp = recbuf; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); + + memcpy(&argp->type, bp, sizeof(argp->type)); + bp += sizeof(argp->type); + + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); + + memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); + bp += sizeof(DB_LSN); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->fileid = (int32_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->pgno = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&argp->lsn, bp, sizeof(argp->lsn)); + bp += sizeof(argp->lsn); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->npgno = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&argp->nlsn, bp, sizeof(argp->nlsn)); + bp += sizeof(argp->nlsn); + + memset(&argp->hdr, 0, sizeof(argp->hdr)); + memcpy(&argp->hdr.size, bp, sizeof(u_int32_t)); + bp += sizeof(u_int32_t); + argp->hdr.data = bp; + bp += argp->hdr.size; + + memset(&argp->data, 0, sizeof(argp->data)); + memcpy(&argp->data.size, bp, sizeof(u_int32_t)); + bp += sizeof(u_int32_t); + argp->data.data = bp; + bp += argp->data.size; + + memset(&argp->ind, 0, sizeof(argp->ind)); + memcpy(&argp->ind.size, bp, sizeof(u_int32_t)); + bp += sizeof(u_int32_t); + argp->ind.data = bp; + bp += argp->ind.size; + + *argpp = argp; + return (0); +} + +/* + * PUBLIC: int __bam_pgno_log __P((DB *, DB_TXN *, DB_LSN *, + * PUBLIC: u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t, + * PUBLIC: db_pgno_t)); + */ +int +__bam_pgno_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx, opgno, npgno) + DB *dbp; + DB_TXN *txnp; + DB_LSN *ret_lsnp; + u_int32_t flags; + db_pgno_t pgno; + DB_LSN * lsn; + u_int32_t indx; + db_pgno_t opgno; + db_pgno_t npgno; +{ + DBT logrec; + DB_ENV *dbenv; + DB_TXNLOGREC *lr; + DB_LSN *lsnp, null_lsn, *rlsnp; + u_int32_t uinttmp, rectype, txn_num; + u_int npad; + u_int8_t *bp; + int is_durable, ret; + + dbenv = dbp->dbenv; + COMPQUIET(lr, NULL); + + rectype = DB___bam_pgno; + npad = 0; + rlsnp = ret_lsnp; + + ret = 0; + + if (LF_ISSET(DB_LOG_NOT_DURABLE) || + F_ISSET(dbp, DB_AM_NOT_DURABLE)) { + if (txnp == NULL) + return (0); + is_durable = 0; + } else + is_durable = 1; + + if (txnp == NULL) { + txn_num = 0; + lsnp = &null_lsn; + null_lsn.file = null_lsn.offset = 0; + } else { + if (TAILQ_FIRST(&txnp->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnp)) != 0) + return (ret); + /* + * We need to assign begin_lsn while holding region mutex. + * That assignment is done inside the DbEnv->log_put call, + * so pass in the appropriate memory location to be filled + * in by the log_put code. + */ + DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp); + txn_num = txnp->txnid; + } + + DB_ASSERT(dbenv, dbp->log_filename != NULL); + if (dbp->log_filename->id == DB_LOGFILEID_INVALID && + (ret = __dbreg_lazy_id(dbp)) != 0) + return (ret); + + logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + + sizeof(u_int32_t) + + sizeof(u_int32_t) + + sizeof(*lsn) + + sizeof(u_int32_t) + + sizeof(u_int32_t) + + sizeof(u_int32_t); + if (CRYPTO_ON(dbenv)) { + npad = + ((DB_CIPHER *)dbenv->crypto_handle)->adj_size(logrec.size); + logrec.size += npad; + } + + if (is_durable || txnp == NULL) { + if ((ret = + __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) + return (ret); + } else { + if ((ret = __os_malloc(dbenv, + logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0) + return (ret); +#ifdef DIAGNOSTIC + if ((ret = + __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) { + __os_free(dbenv, lr); + return (ret); + } +#else + logrec.data = lr->data; +#endif + } + if (npad > 0) + memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad); + + bp = logrec.data; + + memcpy(bp, &rectype, sizeof(rectype)); + bp += sizeof(rectype); + + memcpy(bp, &txn_num, sizeof(txn_num)); + bp += sizeof(txn_num); + + memcpy(bp, lsnp, sizeof(DB_LSN)); + bp += sizeof(DB_LSN); + + uinttmp = (u_int32_t)dbp->log_filename->id; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + uinttmp = (u_int32_t)pgno; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + if (lsn != NULL) { + if (txnp != NULL) { + LOG *lp = dbenv->lg_handle->reginfo.primary; + if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret = + __log_check_page_lsn(dbenv, dbp, lsn) != 0)) + return (ret); + } + memcpy(bp, lsn, sizeof(*lsn)); + } else + memset(bp, 0, sizeof(*lsn)); + bp += sizeof(*lsn); + + uinttmp = (u_int32_t)indx; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + uinttmp = (u_int32_t)opgno; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + uinttmp = (u_int32_t)npgno; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + DB_ASSERT(dbenv, + (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + + if (is_durable || txnp == NULL) { + if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec, + flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) { + *lsnp = *rlsnp; + if (rlsnp != ret_lsnp) + *ret_lsnp = *rlsnp; + } + } else { +#ifdef DIAGNOSTIC + /* + * Set the debug bit if we are going to log non-durable + * transactions so they will be ignored by recovery. + */ + memcpy(lr->data, logrec.data, logrec.size); + rectype |= DB_debug_FLAG; + memcpy(logrec.data, &rectype, sizeof(rectype)); + + ret = __log_put(dbenv, + rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY); +#else + ret = 0; +#endif + STAILQ_INSERT_HEAD(&txnp->logs, lr, links); + F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY); + LSN_NOT_LOGGED(*ret_lsnp); + } + +#ifdef LOG_DIAGNOSTIC + if (ret != 0) + (void)__bam_pgno_print(dbenv, + (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL); +#endif + +#ifdef DIAGNOSTIC + __os_free(dbenv, logrec.data); +#else + if (is_durable || txnp == NULL) + __os_free(dbenv, logrec.data); +#endif + return (ret); +} + +/* + * PUBLIC: int __bam_pgno_read __P((DB_ENV *, void *, __bam_pgno_args **)); + */ +int +__bam_pgno_read(dbenv, recbuf, argpp) + DB_ENV *dbenv; + void *recbuf; + __bam_pgno_args **argpp; +{ + __bam_pgno_args *argp; + u_int32_t uinttmp; + u_int8_t *bp; + int ret; + + if ((ret = __os_malloc(dbenv, + sizeof(__bam_pgno_args) + sizeof(DB_TXN), &argp)) != 0) + return (ret); + bp = recbuf; + argp->txnp = (DB_TXN *)&argp[1]; + memset(argp->txnp, 0, sizeof(DB_TXN)); + + memcpy(&argp->type, bp, sizeof(argp->type)); + bp += sizeof(argp->type); + + memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid)); + bp += sizeof(argp->txnp->txnid); + + memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); + bp += sizeof(DB_LSN); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->fileid = (int32_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->pgno = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&argp->lsn, bp, sizeof(argp->lsn)); + bp += sizeof(argp->lsn); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->indx = (u_int32_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->opgno = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->npgno = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); + + *argpp = argp; + return (0); +} + +/* + * PUBLIC: int __bam_init_recover __P((DB_ENV *, int (***)(DB_ENV *, + * PUBLIC: DBT *, DB_LSN *, db_recops, void *), size_t *)); + */ +int +__bam_init_recover(dbenv, dtabp, dtabsizep) + DB_ENV *dbenv; + int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t *dtabsizep; +{ + int ret; + + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_split_recover, DB___bam_split)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_rsplit_recover, DB___bam_rsplit)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_adj_recover, DB___bam_adj)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_cadjust_recover, DB___bam_cadjust)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_cdel_recover, DB___bam_cdel)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_repl_recover, DB___bam_repl)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_root_recover, DB___bam_root)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_curadj_recover, DB___bam_curadj)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_rcuradj_recover, DB___bam_rcuradj)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_relink_recover, DB___bam_relink)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_merge_recover, DB___bam_merge)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_pgno_recover, DB___bam_pgno)) != 0) return (ret); return (0); } diff --git a/db/btree/btree_autop.c b/db/btree/btree_autop.c index 1db8c3be6..88da2d7e5 100644 --- a/db/btree/btree_autop.c +++ b/db/btree/btree_autop.c @@ -2,13 +2,6 @@ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#endif - #include "db_int.h" #include "dbinc/crypto.h" #include "dbinc/db_page.h" @@ -35,20 +28,18 @@ __bam_split_print(dbenv, dbtp, lsnp, notused2, notused3) int ch; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_split_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_split%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_split%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tleft: %lu\n", (u_long)argp->left); (void)printf("\tllsn: [%lu][%lu]\n", @@ -90,20 +81,18 @@ __bam_rsplit_print(dbenv, dbtp, lsnp, notused2, notused3) int ch; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_rsplit_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_rsplit%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_rsplit%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tpgno: %lu\n", (u_long)argp->pgno); (void)printf("\tpgdbt: "); @@ -142,20 +131,18 @@ __bam_adj_print(dbenv, dbtp, lsnp, notused2, notused3) __bam_adj_args *argp; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_adj_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_adj%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_adj%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tpgno: %lu\n", (u_long)argp->pgno); (void)printf("\tlsn: [%lu][%lu]\n", @@ -183,20 +170,18 @@ __bam_cadjust_print(dbenv, dbtp, lsnp, notused2, notused3) __bam_cadjust_args *argp; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_cadjust_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_cadjust%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_cadjust%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tpgno: %lu\n", (u_long)argp->pgno); (void)printf("\tlsn: [%lu][%lu]\n", @@ -224,20 +209,18 @@ __bam_cdel_print(dbenv, dbtp, lsnp, notused2, notused3) __bam_cdel_args *argp; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_cdel_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_cdel%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_cdel%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tpgno: %lu\n", (u_long)argp->pgno); (void)printf("\tlsn: [%lu][%lu]\n", @@ -265,20 +248,18 @@ __bam_repl_print(dbenv, dbtp, lsnp, notused2, notused3) int ch; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_repl_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_repl%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_repl%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tpgno: %lu\n", (u_long)argp->pgno); (void)printf("\tlsn: [%lu][%lu]\n", @@ -319,20 +300,18 @@ __bam_root_print(dbenv, dbtp, lsnp, notused2, notused3) __bam_root_args *argp; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_root_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_root%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_root%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno); (void)printf("\troot_pgno: %lu\n", (u_long)argp->root_pgno); @@ -358,20 +337,18 @@ __bam_curadj_print(dbenv, dbtp, lsnp, notused2, notused3) __bam_curadj_args *argp; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_curadj_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_curadj%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_curadj%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tmode: %ld\n", (long)argp->mode); (void)printf("\tfrom_pgno: %lu\n", (u_long)argp->from_pgno); @@ -400,20 +377,18 @@ __bam_rcuradj_print(dbenv, dbtp, lsnp, notused2, notused3) __bam_rcuradj_args *argp; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_rcuradj_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_rcuradj%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_rcuradj%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tmode: %ld\n", (long)argp->mode); (void)printf("\troot: %ld\n", (long)argp->root); @@ -424,6 +399,48 @@ __bam_rcuradj_print(dbenv, dbtp, lsnp, notused2, notused3) return (0); } +/* + * PUBLIC: int __bam_relink_43_print __P((DB_ENV *, DBT *, DB_LSN *, + * PUBLIC: db_recops, void *)); + */ +int +__bam_relink_43_print(dbenv, dbtp, lsnp, notused2, notused3) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops notused2; + void *notused3; +{ + __bam_relink_43_args *argp; + int ret; + + notused2 = DB_TXN_PRINT; + notused3 = NULL; + + if ((ret = __bam_relink_43_read(dbenv, dbtp->data, &argp)) != 0) + return (ret); + (void)printf( + "[%lu][%lu]__bam_relink_43%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, + (argp->type & DB_debug_FLAG) ? "_debug" : "", + (u_long)argp->type, + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); + (void)printf("\tfileid: %ld\n", (long)argp->fileid); + (void)printf("\tpgno: %lu\n", (u_long)argp->pgno); + (void)printf("\tlsn: [%lu][%lu]\n", + (u_long)argp->lsn.file, (u_long)argp->lsn.offset); + (void)printf("\tprev: %lu\n", (u_long)argp->prev); + (void)printf("\tlsn_prev: [%lu][%lu]\n", + (u_long)argp->lsn_prev.file, (u_long)argp->lsn_prev.offset); + (void)printf("\tnext: %lu\n", (u_long)argp->next); + (void)printf("\tlsn_next: [%lu][%lu]\n", + (u_long)argp->lsn_next.file, (u_long)argp->lsn_next.offset); + (void)printf("\n"); + __os_free(dbenv, argp); + return (0); +} + /* * PUBLIC: int __bam_relink_print __P((DB_ENV *, DBT *, DB_LSN *, * PUBLIC: db_recops, void *)); @@ -439,24 +456,21 @@ __bam_relink_print(dbenv, dbtp, lsnp, notused2, notused3) __bam_relink_args *argp; int ret; - notused2 = DB_TXN_ABORT; + notused2 = DB_TXN_PRINT; notused3 = NULL; if ((ret = __bam_relink_read(dbenv, dbtp->data, &argp)) != 0) return (ret); (void)printf( - "[%lu][%lu]__bam_relink%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, + "[%lu][%lu]__bam_relink%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (argp->type & DB_debug_FLAG) ? "_debug" : "", (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); (void)printf("\tfileid: %ld\n", (long)argp->fileid); (void)printf("\tpgno: %lu\n", (u_long)argp->pgno); - (void)printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); + (void)printf("\tnew_pgno: %lu\n", (u_long)argp->new_pgno); (void)printf("\tprev: %lu\n", (u_long)argp->prev); (void)printf("\tlsn_prev: [%lu][%lu]\n", (u_long)argp->lsn_prev.file, (u_long)argp->lsn_prev.offset); @@ -468,6 +482,104 @@ __bam_relink_print(dbenv, dbtp, lsnp, notused2, notused3) return (0); } +/* + * PUBLIC: int __bam_merge_print __P((DB_ENV *, DBT *, DB_LSN *, + * PUBLIC: db_recops, void *)); + */ +int +__bam_merge_print(dbenv, dbtp, lsnp, notused2, notused3) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops notused2; + void *notused3; +{ + __bam_merge_args *argp; + u_int32_t i; + int ch; + int ret; + + notused2 = DB_TXN_PRINT; + notused3 = NULL; + + if ((ret = __bam_merge_read(dbenv, dbtp->data, &argp)) != 0) + return (ret); + (void)printf( + "[%lu][%lu]__bam_merge%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, + (argp->type & DB_debug_FLAG) ? "_debug" : "", + (u_long)argp->type, + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); + (void)printf("\tfileid: %ld\n", (long)argp->fileid); + (void)printf("\tpgno: %lu\n", (u_long)argp->pgno); + (void)printf("\tlsn: [%lu][%lu]\n", + (u_long)argp->lsn.file, (u_long)argp->lsn.offset); + (void)printf("\tnpgno: %lu\n", (u_long)argp->npgno); + (void)printf("\tnlsn: [%lu][%lu]\n", + (u_long)argp->nlsn.file, (u_long)argp->nlsn.offset); + (void)printf("\thdr: "); + for (i = 0; i < argp->hdr.size; i++) { + ch = ((u_int8_t *)argp->hdr.data)[i]; + printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch); + } + (void)printf("\n"); + (void)printf("\tdata: "); + for (i = 0; i < argp->data.size; i++) { + ch = ((u_int8_t *)argp->data.data)[i]; + printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch); + } + (void)printf("\n"); + (void)printf("\tind: "); + for (i = 0; i < argp->ind.size; i++) { + ch = ((u_int8_t *)argp->ind.data)[i]; + printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch); + } + (void)printf("\n"); + (void)printf("\n"); + __os_free(dbenv, argp); + return (0); +} + +/* + * PUBLIC: int __bam_pgno_print __P((DB_ENV *, DBT *, DB_LSN *, + * PUBLIC: db_recops, void *)); + */ +int +__bam_pgno_print(dbenv, dbtp, lsnp, notused2, notused3) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops notused2; + void *notused3; +{ + __bam_pgno_args *argp; + int ret; + + notused2 = DB_TXN_PRINT; + notused3 = NULL; + + if ((ret = __bam_pgno_read(dbenv, dbtp->data, &argp)) != 0) + return (ret); + (void)printf( + "[%lu][%lu]__bam_pgno%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, (u_long)lsnp->offset, + (argp->type & DB_debug_FLAG) ? "_debug" : "", + (u_long)argp->type, + (u_long)argp->txnp->txnid, + (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); + (void)printf("\tfileid: %ld\n", (long)argp->fileid); + (void)printf("\tpgno: %lu\n", (u_long)argp->pgno); + (void)printf("\tlsn: [%lu][%lu]\n", + (u_long)argp->lsn.file, (u_long)argp->lsn.offset); + (void)printf("\tindx: %lu\n", (u_long)argp->indx); + (void)printf("\topgno: %lu\n", (u_long)argp->opgno); + (void)printf("\tnpgno: %lu\n", (u_long)argp->npgno); + (void)printf("\n"); + __os_free(dbenv, argp); + return (0); +} + /* * PUBLIC: int __bam_init_print __P((DB_ENV *, int (***)(DB_ENV *, * PUBLIC: DBT *, DB_LSN *, db_recops, void *), size_t *)); @@ -510,5 +622,11 @@ __bam_init_print(dbenv, dtabp, dtabsizep) if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, __bam_relink_print, DB___bam_relink)) != 0) return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_merge_print, DB___bam_merge)) != 0) + return (ret); + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_pgno_print, DB___bam_pgno)) != 0) + return (ret); return (0); } diff --git a/db/build_vxworks/BerkeleyDB20.wpj b/db/build_vxworks/BerkeleyDB20.wpj index 428fb6208..83e8aa33a 100755 --- a/db/build_vxworks/BerkeleyDB20.wpj +++ b/db/build_vxworks/BerkeleyDB20.wpj @@ -249,6 +249,24 @@ PENTIUM_release PENTIUM_debug 2.0 + FILE_$(PRJ_DIR)/../btree/bt_compact.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_objects +bt_compact.o + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../btree/bt_compare.c_dependDone TRUE @@ -573,6 +591,24 @@ btree_auto.o C/C++ compiler + FILE_$(PRJ_DIR)/../clib/ctime.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../clib/ctime.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../clib/ctime.c_objects +ctime.o + + + FILE_$(PRJ_DIR)/../clib/ctime.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../clib/getopt.c_dependDone TRUE @@ -645,6 +681,24 @@ strdup.o C/C++ compiler + FILE_$(PRJ_DIR)/../clib/strsep.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../clib/strsep.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../clib/strsep.c_objects +strsep.o + + + FILE_$(PRJ_DIR)/../clib/strsep.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/db_byteorder.c_dependDone TRUE @@ -663,6 +717,24 @@ db_byteorder.o C/C++ compiler + FILE_$(PRJ_DIR)/../common/db_clock.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../common/db_clock.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../common/db_clock.c_objects +db_clock.o + + + FILE_$(PRJ_DIR)/../common/db_clock.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/db_err.c_dependDone TRUE @@ -735,6 +807,24 @@ db_log2.o C/C++ compiler + FILE_$(PRJ_DIR)/../common/mkpath.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../common/mkpath.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../common/mkpath.c_objects +mkpath.o + + + FILE_$(PRJ_DIR)/../common/mkpath.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/util_arg.c_dependDone TRUE @@ -1005,6 +1095,24 @@ db_cam.o C/C++ compiler + FILE_$(PRJ_DIR)/../db/db_cds.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../db/db_cds.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../db/db_cds.c_objects +db_cds.o + + + FILE_$(PRJ_DIR)/../db/db_cds.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../db/db_conv.c_dependDone TRUE @@ -1563,6 +1671,42 @@ db_shash.o C/C++ compiler + FILE_$(PRJ_DIR)/../env/env_config.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_config.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_config.c_objects +env_config.o + + + FILE_$(PRJ_DIR)/../env/env_config.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_objects +env_failchk.o + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../env/env_file.c_dependDone TRUE @@ -1653,6 +1797,24 @@ env_region.o C/C++ compiler + FILE_$(PRJ_DIR)/../env/env_register.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_register.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_register.c_objects +env_register.o + + + FILE_$(PRJ_DIR)/../env/env_register.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../env/env_stat.c_dependDone TRUE @@ -2085,6 +2247,24 @@ lock_deadlock.o C/C++ compiler + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_objects +lock_failchk.o + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../lock/lock_id.c_dependDone TRUE @@ -2265,6 +2445,24 @@ log_compare.o C/C++ compiler + FILE_$(PRJ_DIR)/../log/log_debug.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../log/log_debug.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../log/log_debug.c_objects +log_debug.o + + + FILE_$(PRJ_DIR)/../log/log_debug.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../log/log_get.c_dependDone TRUE @@ -2481,6 +2679,24 @@ mp_method.o C/C++ compiler + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_objects +mp_mvcc.o + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../mp/mp_region.c_dependDone TRUE @@ -2571,39 +2787,111 @@ mp_trickle.o C/C++ compiler - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_dependDone TRUE - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_objects -mut_tas.o + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_objects +mut_alloc.o - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_tool + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_tool C/C++ compiler - FILE_$(PRJ_DIR)/../mutex/mutex.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_dependDone TRUE - FILE_$(PRJ_DIR)/../mutex/mutex.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../mutex/mutex.c_objects -mutex.o + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_objects +mut_failchk.o - FILE_$(PRJ_DIR)/../mutex/mutex.c_tool + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_objects +mut_method.o + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_objects +mut_region.o + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_objects +mut_stat.o + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_objects +mut_tas.o + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_tool C/C++ compiler @@ -2697,6 +2985,24 @@ os_fid.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_flock.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_flock.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_flock.c_objects +os_flock.o + + + FILE_$(PRJ_DIR)/../os/os_flock.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_fsync.c_dependDone TRUE @@ -2715,39 +3021,57 @@ os_fsync.o C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_handle.c_dependDone + FILE_$(PRJ_DIR)/../os/os_fzero.c_dependDone TRUE - FILE_$(PRJ_DIR)/../os/os_handle.c_dependencies + FILE_$(PRJ_DIR)/../os/os_fzero.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../os/os_handle.c_objects -os_handle.o + FILE_$(PRJ_DIR)/../os/os_fzero.c_objects +os_fzero.o - FILE_$(PRJ_DIR)/../os/os_handle.c_tool + FILE_$(PRJ_DIR)/../os/os_fzero.c_tool C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_id.c_dependDone + FILE_$(PRJ_DIR)/../os/os_getenv.c_dependDone TRUE - FILE_$(PRJ_DIR)/../os/os_id.c_dependencies + FILE_$(PRJ_DIR)/../os/os_getenv.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../os/os_id.c_objects -os_id.o + FILE_$(PRJ_DIR)/../os/os_getenv.c_objects +os_getenv.o - FILE_$(PRJ_DIR)/../os/os_id.c_tool + FILE_$(PRJ_DIR)/../os/os_getenv.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../os/os_handle.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_handle.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_handle.c_objects +os_handle.o + + + FILE_$(PRJ_DIR)/../os/os_handle.c_tool C/C++ compiler @@ -2769,6 +3093,24 @@ os_method.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_mkdir.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_objects +os_mkdir.o + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_oflags.c_dependDone TRUE @@ -2805,6 +3147,24 @@ os_open.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_pid.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_pid.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_pid.c_objects +os_pid.o + + + FILE_$(PRJ_DIR)/../os/os_pid.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_region.c_dependDone TRUE @@ -2859,24 +3219,6 @@ os_root.o C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_rpath.c_dependDone -TRUE - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_dependencies -$(PRJ_DIR)/db_config.h \ - $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_objects -os_rpath.o - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_tool -C/C++ compiler - - FILE_$(PRJ_DIR)/../os/os_rw.c_dependDone TRUE @@ -3003,6 +3345,24 @@ os_truncate.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_uid.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_uid.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_uid.c_objects +os_uid.o + + + FILE_$(PRJ_DIR)/../os/os_uid.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_unlink.c_dependDone TRUE @@ -3021,6 +3381,24 @@ os_unlink.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_yield.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_yield.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_yield.c_objects +os_yield.o + + + FILE_$(PRJ_DIR)/../os/os_yield.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_abs.c_dependDone TRUE @@ -3075,6 +3453,24 @@ os_vx_map.o C/C++ compiler + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_objects +os_vx_rpath.o + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../qam/qam.c_dependDone TRUE @@ -3291,6 +3687,42 @@ rep_backup.o C/C++ compiler + FILE_$(PRJ_DIR)/../rep/rep_elect.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rep/rep_elect.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rep/rep_elect.c_objects +rep_elect.o + + + FILE_$(PRJ_DIR)/../rep/rep_elect.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../rep/rep_log.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rep/rep_log.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rep/rep_log.c_objects +rep_log.o + + + FILE_$(PRJ_DIR)/../rep/rep_log.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../rep/rep_method.c_dependDone TRUE @@ -3381,6 +3813,24 @@ rep_util.o C/C++ compiler + FILE_$(PRJ_DIR)/../rep/rep_verify.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rep/rep_verify.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rep/rep_verify.c_objects +rep_verify.o + + + FILE_$(PRJ_DIR)/../rep/rep_verify.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../txn/txn.c_dependDone TRUE @@ -3417,6 +3867,42 @@ txn_auto.o C/C++ compiler + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_objects +txn_chkpt.o + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_objects +txn_failchk.o + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../txn/txn_method.c_dependDone TRUE @@ -3580,7 +4066,8 @@ C/C++ compiler PROJECT_FILES -$(PRJ_DIR)/../btree/bt_compare.c \ +$(PRJ_DIR)/../btree/bt_compact.c \ + $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../btree/bt_conv.c \ $(PRJ_DIR)/../btree/bt_curadj.c \ $(PRJ_DIR)/../btree/bt_cursor.c \ @@ -3598,15 +4085,19 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../btree/bt_upgrade.c \ $(PRJ_DIR)/../btree/bt_verify.c \ $(PRJ_DIR)/../btree/btree_auto.c \ + $(PRJ_DIR)/../clib/ctime.c \ $(PRJ_DIR)/../clib/getopt.c \ $(PRJ_DIR)/../clib/snprintf.c \ $(PRJ_DIR)/../clib/strcasecmp.c \ $(PRJ_DIR)/../clib/strdup.c \ + $(PRJ_DIR)/../clib/strsep.c \ $(PRJ_DIR)/../common/db_byteorder.c \ + $(PRJ_DIR)/../common/db_clock.c \ $(PRJ_DIR)/../common/db_err.c \ $(PRJ_DIR)/../common/db_getlong.c \ $(PRJ_DIR)/../common/db_idspace.c \ $(PRJ_DIR)/../common/db_log2.c \ + $(PRJ_DIR)/../common/mkpath.c \ $(PRJ_DIR)/../common/util_arg.c \ $(PRJ_DIR)/../common/util_cache.c \ $(PRJ_DIR)/../common/util_log.c \ @@ -3622,6 +4113,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../db/db_am.c \ $(PRJ_DIR)/../db/db_auto.c \ $(PRJ_DIR)/../db/db_cam.c \ + $(PRJ_DIR)/../db/db_cds.c \ $(PRJ_DIR)/../db/db_conv.c \ $(PRJ_DIR)/../db/db_dispatch.c \ $(PRJ_DIR)/../db/db_dup.c \ @@ -3653,11 +4145,14 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../dbreg/dbreg_util.c \ $(PRJ_DIR)/../env/db_salloc.c \ $(PRJ_DIR)/../env/db_shash.c \ + $(PRJ_DIR)/../env/env_config.c \ + $(PRJ_DIR)/../env/env_failchk.c \ $(PRJ_DIR)/../env/env_file.c \ $(PRJ_DIR)/../env/env_method.c \ $(PRJ_DIR)/../env/env_open.c \ $(PRJ_DIR)/../env/env_recover.c \ $(PRJ_DIR)/../env/env_region.c \ + $(PRJ_DIR)/../env/env_register.c \ $(PRJ_DIR)/../env/env_stat.c \ $(PRJ_DIR)/../fileops/fileops_auto.c \ $(PRJ_DIR)/../fileops/fop_basic.c \ @@ -3682,6 +4177,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../hsearch/hsearch.c \ $(PRJ_DIR)/../lock/lock.c \ $(PRJ_DIR)/../lock/lock_deadlock.c \ + $(PRJ_DIR)/../lock/lock_failchk.c \ $(PRJ_DIR)/../lock/lock_id.c \ $(PRJ_DIR)/../lock/lock_list.c \ $(PRJ_DIR)/../lock/lock_method.c \ @@ -3692,6 +4188,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../log/log.c \ $(PRJ_DIR)/../log/log_archive.c \ $(PRJ_DIR)/../log/log_compare.c \ + $(PRJ_DIR)/../log/log_debug.c \ $(PRJ_DIR)/../log/log_get.c \ $(PRJ_DIR)/../log/log_method.c \ $(PRJ_DIR)/../log/log_put.c \ @@ -3704,28 +4201,36 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../mp/mp_fput.c \ $(PRJ_DIR)/../mp/mp_fset.c \ $(PRJ_DIR)/../mp/mp_method.c \ + $(PRJ_DIR)/../mp/mp_mvcc.c \ $(PRJ_DIR)/../mp/mp_region.c \ $(PRJ_DIR)/../mp/mp_register.c \ $(PRJ_DIR)/../mp/mp_stat.c \ $(PRJ_DIR)/../mp/mp_sync.c \ $(PRJ_DIR)/../mp/mp_trickle.c \ + $(PRJ_DIR)/../mutex/mut_alloc.c \ + $(PRJ_DIR)/../mutex/mut_failchk.c \ + $(PRJ_DIR)/../mutex/mut_method.c \ + $(PRJ_DIR)/../mutex/mut_region.c \ + $(PRJ_DIR)/../mutex/mut_stat.c \ $(PRJ_DIR)/../mutex/mut_tas.c \ - $(PRJ_DIR)/../mutex/mutex.c \ $(PRJ_DIR)/../os/os_alloc.c \ $(PRJ_DIR)/../os/os_clock.c \ $(PRJ_DIR)/../os/os_dir.c \ $(PRJ_DIR)/../os/os_errno.c \ $(PRJ_DIR)/../os/os_fid.c \ + $(PRJ_DIR)/../os/os_flock.c \ $(PRJ_DIR)/../os/os_fsync.c \ + $(PRJ_DIR)/../os/os_fzero.c \ + $(PRJ_DIR)/../os/os_getenv.c \ $(PRJ_DIR)/../os/os_handle.c \ - $(PRJ_DIR)/../os/os_id.c \ $(PRJ_DIR)/../os/os_method.c \ + $(PRJ_DIR)/../os/os_mkdir.c \ $(PRJ_DIR)/../os/os_oflags.c \ $(PRJ_DIR)/../os/os_open.c \ + $(PRJ_DIR)/../os/os_pid.c \ $(PRJ_DIR)/../os/os_region.c \ $(PRJ_DIR)/../os/os_rename.c \ $(PRJ_DIR)/../os/os_root.c \ - $(PRJ_DIR)/../os/os_rpath.c \ $(PRJ_DIR)/../os/os_rw.c \ $(PRJ_DIR)/../os/os_seek.c \ $(PRJ_DIR)/../os/os_sleep.c \ @@ -3733,10 +4238,13 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../os/os_stat.c \ $(PRJ_DIR)/../os/os_tmpdir.c \ $(PRJ_DIR)/../os/os_truncate.c \ + $(PRJ_DIR)/../os/os_uid.c \ $(PRJ_DIR)/../os/os_unlink.c \ + $(PRJ_DIR)/../os/os_yield.c \ $(PRJ_DIR)/../os_vxworks/os_vx_abs.c \ $(PRJ_DIR)/../os_vxworks/os_vx_config.c \ $(PRJ_DIR)/../os_vxworks/os_vx_map.c \ + $(PRJ_DIR)/../os_vxworks/os_vx_rpath.c \ $(PRJ_DIR)/../qam/qam.c \ $(PRJ_DIR)/../qam/qam_auto.c \ $(PRJ_DIR)/../qam/qam_conv.c \ @@ -3749,13 +4257,18 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../qam/qam_verify.c \ $(PRJ_DIR)/../rep/rep_auto.c \ $(PRJ_DIR)/../rep/rep_backup.c \ + $(PRJ_DIR)/../rep/rep_elect.c \ + $(PRJ_DIR)/../rep/rep_log.c \ $(PRJ_DIR)/../rep/rep_method.c \ $(PRJ_DIR)/../rep/rep_record.c \ $(PRJ_DIR)/../rep/rep_region.c \ $(PRJ_DIR)/../rep/rep_stat.c \ $(PRJ_DIR)/../rep/rep_util.c \ + $(PRJ_DIR)/../rep/rep_verify.c \ $(PRJ_DIR)/../txn/txn.c \ $(PRJ_DIR)/../txn/txn_auto.c \ + $(PRJ_DIR)/../txn/txn_chkpt.c \ + $(PRJ_DIR)/../txn/txn_failchk.c \ $(PRJ_DIR)/../txn/txn_method.c \ $(PRJ_DIR)/../txn/txn_rec.c \ $(PRJ_DIR)/../txn/txn_recover.c \ diff --git a/db/build_vxworks/BerkeleyDB20small.wpj b/db/build_vxworks/BerkeleyDB20small.wpj index 3729dc49d..2e3b8b546 100755 --- a/db/build_vxworks/BerkeleyDB20small.wpj +++ b/db/build_vxworks/BerkeleyDB20small.wpj @@ -249,6 +249,24 @@ PENTIUM_release PENTIUM_debug 2.0 + FILE_$(PRJ_DIR)/../btree/bt_compact.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_objects +bt_compact.o + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../btree/bt_compare.c_dependDone TRUE @@ -555,6 +573,24 @@ btree_auto.o C/C++ compiler + FILE_$(PRJ_DIR)/../clib/ctime.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../clib/ctime.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../clib/ctime.c_objects +ctime.o + + + FILE_$(PRJ_DIR)/../clib/ctime.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../clib/getopt.c_dependDone TRUE @@ -627,6 +663,24 @@ strdup.o C/C++ compiler + FILE_$(PRJ_DIR)/../clib/strsep.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../clib/strsep.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../clib/strsep.c_objects +strsep.o + + + FILE_$(PRJ_DIR)/../clib/strsep.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/crypto_stub.c_dependDone TRUE @@ -735,6 +789,24 @@ db_log2.o C/C++ compiler + FILE_$(PRJ_DIR)/../common/mkpath.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../common/mkpath.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../common/mkpath.c_objects +mkpath.o + + + FILE_$(PRJ_DIR)/../common/mkpath.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/util_arg.c_dependDone TRUE @@ -915,6 +987,24 @@ db_cam.o C/C++ compiler + FILE_$(PRJ_DIR)/../db/db_cds.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../db/db_cds.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../db/db_cds.c_objects +db_cds.o + + + FILE_$(PRJ_DIR)/../db/db_cds.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../db/db_conv.c_dependDone TRUE @@ -1437,6 +1527,42 @@ db_shash.o C/C++ compiler + FILE_$(PRJ_DIR)/../env/env_config.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_config.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_config.c_objects +env_config.o + + + FILE_$(PRJ_DIR)/../env/env_config.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_objects +env_failchk.o + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../env/env_file.c_dependDone TRUE @@ -1527,6 +1653,24 @@ env_region.o C/C++ compiler + FILE_$(PRJ_DIR)/../env/env_register.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_register.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_register.c_objects +env_register.o + + + FILE_$(PRJ_DIR)/../env/env_register.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../env/env_stat.c_dependDone TRUE @@ -1725,6 +1869,24 @@ lock_deadlock.o C/C++ compiler + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_objects +lock_failchk.o + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../lock/lock_id.c_dependDone TRUE @@ -1905,6 +2067,24 @@ log_compare.o C/C++ compiler + FILE_$(PRJ_DIR)/../log/log_debug.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../log/log_debug.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../log/log_debug.c_objects +log_debug.o + + + FILE_$(PRJ_DIR)/../log/log_debug.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../log/log_get.c_dependDone TRUE @@ -2121,6 +2301,24 @@ mp_method.o C/C++ compiler + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_objects +mp_mvcc.o + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../mp/mp_region.c_dependDone TRUE @@ -2211,39 +2409,111 @@ mp_trickle.o C/C++ compiler - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_dependDone TRUE - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_objects -mut_tas.o + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_objects +mut_alloc.o - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_tool + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_tool C/C++ compiler - FILE_$(PRJ_DIR)/../mutex/mutex.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_dependDone TRUE - FILE_$(PRJ_DIR)/../mutex/mutex.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../mutex/mutex.c_objects -mutex.o + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_objects +mut_failchk.o - FILE_$(PRJ_DIR)/../mutex/mutex.c_tool + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_objects +mut_method.o + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_objects +mut_region.o + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_objects +mut_stat.o + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_objects +mut_tas.o + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_tool C/C++ compiler @@ -2337,6 +2607,24 @@ os_fid.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_flock.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_flock.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_flock.c_objects +os_flock.o + + + FILE_$(PRJ_DIR)/../os/os_flock.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_fsync.c_dependDone TRUE @@ -2355,39 +2643,57 @@ os_fsync.o C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_handle.c_dependDone + FILE_$(PRJ_DIR)/../os/os_fzero.c_dependDone TRUE - FILE_$(PRJ_DIR)/../os/os_handle.c_dependencies + FILE_$(PRJ_DIR)/../os/os_fzero.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../os/os_handle.c_objects -os_handle.o + FILE_$(PRJ_DIR)/../os/os_fzero.c_objects +os_fzero.o - FILE_$(PRJ_DIR)/../os/os_handle.c_tool + FILE_$(PRJ_DIR)/../os/os_fzero.c_tool C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_id.c_dependDone + FILE_$(PRJ_DIR)/../os/os_getenv.c_dependDone TRUE - FILE_$(PRJ_DIR)/../os/os_id.c_dependencies + FILE_$(PRJ_DIR)/../os/os_getenv.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../os/os_id.c_objects -os_id.o + FILE_$(PRJ_DIR)/../os/os_getenv.c_objects +os_getenv.o - FILE_$(PRJ_DIR)/../os/os_id.c_tool + FILE_$(PRJ_DIR)/../os/os_getenv.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../os/os_handle.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_handle.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_handle.c_objects +os_handle.o + + + FILE_$(PRJ_DIR)/../os/os_handle.c_tool C/C++ compiler @@ -2409,6 +2715,24 @@ os_method.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_mkdir.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_objects +os_mkdir.o + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_oflags.c_dependDone TRUE @@ -2445,6 +2769,24 @@ os_open.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_pid.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_pid.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_pid.c_objects +os_pid.o + + + FILE_$(PRJ_DIR)/../os/os_pid.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_region.c_dependDone TRUE @@ -2499,24 +2841,6 @@ os_root.o C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_rpath.c_dependDone -TRUE - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_dependencies -$(PRJ_DIR)/db_config.h \ - $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_objects -os_rpath.o - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_tool -C/C++ compiler - - FILE_$(PRJ_DIR)/../os/os_rw.c_dependDone TRUE @@ -2643,6 +2967,24 @@ os_truncate.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_uid.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_uid.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_uid.c_objects +os_uid.o + + + FILE_$(PRJ_DIR)/../os/os_uid.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_unlink.c_dependDone TRUE @@ -2661,6 +3003,24 @@ os_unlink.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_yield.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_yield.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_yield.c_objects +os_yield.o + + + FILE_$(PRJ_DIR)/../os/os_yield.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_abs.c_dependDone TRUE @@ -2715,6 +3075,24 @@ os_vx_map.o C/C++ compiler + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_objects +os_vx_rpath.o + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../qam/qam_stub.c_dependDone TRUE @@ -2787,6 +3165,42 @@ txn_auto.o C/C++ compiler + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_objects +txn_chkpt.o + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_objects +txn_failchk.o + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../txn/txn_method.c_dependDone TRUE @@ -2950,7 +3364,8 @@ C/C++ compiler PROJECT_FILES -$(PRJ_DIR)/../btree/bt_compare.c \ +$(PRJ_DIR)/../btree/bt_compact.c \ + $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../btree/bt_conv.c \ $(PRJ_DIR)/../btree/bt_curadj.c \ $(PRJ_DIR)/../btree/bt_cursor.c \ @@ -2967,16 +3382,19 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../btree/bt_stat.c \ $(PRJ_DIR)/../btree/bt_upgrade.c \ $(PRJ_DIR)/../btree/btree_auto.c \ + $(PRJ_DIR)/../clib/ctime.c \ $(PRJ_DIR)/../clib/getopt.c \ $(PRJ_DIR)/../clib/snprintf.c \ $(PRJ_DIR)/../clib/strcasecmp.c \ $(PRJ_DIR)/../clib/strdup.c \ + $(PRJ_DIR)/../clib/strsep.c \ $(PRJ_DIR)/../common/crypto_stub.c \ $(PRJ_DIR)/../common/db_byteorder.c \ $(PRJ_DIR)/../common/db_err.c \ $(PRJ_DIR)/../common/db_getlong.c \ $(PRJ_DIR)/../common/db_idspace.c \ $(PRJ_DIR)/../common/db_log2.c \ + $(PRJ_DIR)/../common/mkpath.c \ $(PRJ_DIR)/../common/util_arg.c \ $(PRJ_DIR)/../common/util_cache.c \ $(PRJ_DIR)/../common/util_log.c \ @@ -2987,6 +3405,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../db/db_am.c \ $(PRJ_DIR)/../db/db_auto.c \ $(PRJ_DIR)/../db/db_cam.c \ + $(PRJ_DIR)/../db/db_cds.c \ $(PRJ_DIR)/../db/db_conv.c \ $(PRJ_DIR)/../db/db_dispatch.c \ $(PRJ_DIR)/../db/db_dup.c \ @@ -3016,11 +3435,14 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../dbreg/dbreg_util.c \ $(PRJ_DIR)/../env/db_salloc.c \ $(PRJ_DIR)/../env/db_shash.c \ + $(PRJ_DIR)/../env/env_config.c \ + $(PRJ_DIR)/../env/env_failchk.c \ $(PRJ_DIR)/../env/env_file.c \ $(PRJ_DIR)/../env/env_method.c \ $(PRJ_DIR)/../env/env_open.c \ $(PRJ_DIR)/../env/env_recover.c \ $(PRJ_DIR)/../env/env_region.c \ + $(PRJ_DIR)/../env/env_register.c \ $(PRJ_DIR)/../env/env_stat.c \ $(PRJ_DIR)/../fileops/fileops_auto.c \ $(PRJ_DIR)/../fileops/fop_basic.c \ @@ -3032,6 +3454,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../hmac/sha1.c \ $(PRJ_DIR)/../lock/lock.c \ $(PRJ_DIR)/../lock/lock_deadlock.c \ + $(PRJ_DIR)/../lock/lock_failchk.c \ $(PRJ_DIR)/../lock/lock_id.c \ $(PRJ_DIR)/../lock/lock_list.c \ $(PRJ_DIR)/../lock/lock_method.c \ @@ -3042,6 +3465,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../log/log.c \ $(PRJ_DIR)/../log/log_archive.c \ $(PRJ_DIR)/../log/log_compare.c \ + $(PRJ_DIR)/../log/log_debug.c \ $(PRJ_DIR)/../log/log_get.c \ $(PRJ_DIR)/../log/log_method.c \ $(PRJ_DIR)/../log/log_put.c \ @@ -3054,28 +3478,36 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../mp/mp_fput.c \ $(PRJ_DIR)/../mp/mp_fset.c \ $(PRJ_DIR)/../mp/mp_method.c \ + $(PRJ_DIR)/../mp/mp_mvcc.c \ $(PRJ_DIR)/../mp/mp_region.c \ $(PRJ_DIR)/../mp/mp_register.c \ $(PRJ_DIR)/../mp/mp_stat.c \ $(PRJ_DIR)/../mp/mp_sync.c \ $(PRJ_DIR)/../mp/mp_trickle.c \ + $(PRJ_DIR)/../mutex/mut_alloc.c \ + $(PRJ_DIR)/../mutex/mut_failchk.c \ + $(PRJ_DIR)/../mutex/mut_method.c \ + $(PRJ_DIR)/../mutex/mut_region.c \ + $(PRJ_DIR)/../mutex/mut_stat.c \ $(PRJ_DIR)/../mutex/mut_tas.c \ - $(PRJ_DIR)/../mutex/mutex.c \ $(PRJ_DIR)/../os/os_alloc.c \ $(PRJ_DIR)/../os/os_clock.c \ $(PRJ_DIR)/../os/os_dir.c \ $(PRJ_DIR)/../os/os_errno.c \ $(PRJ_DIR)/../os/os_fid.c \ + $(PRJ_DIR)/../os/os_flock.c \ $(PRJ_DIR)/../os/os_fsync.c \ + $(PRJ_DIR)/../os/os_fzero.c \ + $(PRJ_DIR)/../os/os_getenv.c \ $(PRJ_DIR)/../os/os_handle.c \ - $(PRJ_DIR)/../os/os_id.c \ $(PRJ_DIR)/../os/os_method.c \ + $(PRJ_DIR)/../os/os_mkdir.c \ $(PRJ_DIR)/../os/os_oflags.c \ $(PRJ_DIR)/../os/os_open.c \ + $(PRJ_DIR)/../os/os_pid.c \ $(PRJ_DIR)/../os/os_region.c \ $(PRJ_DIR)/../os/os_rename.c \ $(PRJ_DIR)/../os/os_root.c \ - $(PRJ_DIR)/../os/os_rpath.c \ $(PRJ_DIR)/../os/os_rw.c \ $(PRJ_DIR)/../os/os_seek.c \ $(PRJ_DIR)/../os/os_sleep.c \ @@ -3083,14 +3515,19 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../os/os_stat.c \ $(PRJ_DIR)/../os/os_tmpdir.c \ $(PRJ_DIR)/../os/os_truncate.c \ + $(PRJ_DIR)/../os/os_uid.c \ $(PRJ_DIR)/../os/os_unlink.c \ + $(PRJ_DIR)/../os/os_yield.c \ $(PRJ_DIR)/../os_vxworks/os_vx_abs.c \ $(PRJ_DIR)/../os_vxworks/os_vx_config.c \ $(PRJ_DIR)/../os_vxworks/os_vx_map.c \ + $(PRJ_DIR)/../os_vxworks/os_vx_rpath.c \ $(PRJ_DIR)/../qam/qam_stub.c \ $(PRJ_DIR)/../rep/rep_stub.c \ $(PRJ_DIR)/../txn/txn.c \ $(PRJ_DIR)/../txn/txn_auto.c \ + $(PRJ_DIR)/../txn/txn_chkpt.c \ + $(PRJ_DIR)/../txn/txn_failchk.c \ $(PRJ_DIR)/../txn/txn_method.c \ $(PRJ_DIR)/../txn/txn_rec.c \ $(PRJ_DIR)/../txn/txn_recover.c \ diff --git a/db/build_vxworks/BerkeleyDB22.wpj b/db/build_vxworks/BerkeleyDB22.wpj index 36ae3efb4..a130b4833 100755 --- a/db/build_vxworks/BerkeleyDB22.wpj +++ b/db/build_vxworks/BerkeleyDB22.wpj @@ -308,6 +308,24 @@ PENTIUM_release PENTIUM_debug 2.2 + FILE_$(PRJ_DIR)/../btree/bt_compact.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_objects +bt_compact.o + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../btree/bt_compare.c_dependDone TRUE @@ -632,6 +650,24 @@ btree_auto.o C/C++ compiler + FILE_$(PRJ_DIR)/../clib/ctime.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../clib/ctime.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../clib/ctime.c_objects +ctime.o + + + FILE_$(PRJ_DIR)/../clib/ctime.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../clib/getopt.c_dependDone TRUE @@ -704,6 +740,24 @@ strdup.o C/C++ compiler + FILE_$(PRJ_DIR)/../clib/strsep.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../clib/strsep.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../clib/strsep.c_objects +strsep.o + + + FILE_$(PRJ_DIR)/../clib/strsep.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/db_byteorder.c_dependDone TRUE @@ -722,6 +776,24 @@ db_byteorder.o C/C++ compiler + FILE_$(PRJ_DIR)/../common/db_clock.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../common/db_clock.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../common/db_clock.c_objects +db_clock.o + + + FILE_$(PRJ_DIR)/../common/db_clock.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/db_err.c_dependDone TRUE @@ -794,6 +866,24 @@ db_log2.o C/C++ compiler + FILE_$(PRJ_DIR)/../common/mkpath.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../common/mkpath.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../common/mkpath.c_objects +mkpath.o + + + FILE_$(PRJ_DIR)/../common/mkpath.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/util_arg.c_dependDone TRUE @@ -1064,6 +1154,24 @@ db_cam.o C/C++ compiler + FILE_$(PRJ_DIR)/../db/db_cds.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../db/db_cds.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../db/db_cds.c_objects +db_cds.o + + + FILE_$(PRJ_DIR)/../db/db_cds.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../db/db_conv.c_dependDone TRUE @@ -1622,6 +1730,42 @@ db_shash.o C/C++ compiler + FILE_$(PRJ_DIR)/../env/env_config.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_config.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_config.c_objects +env_config.o + + + FILE_$(PRJ_DIR)/../env/env_config.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_objects +env_failchk.o + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../env/env_file.c_dependDone TRUE @@ -1712,6 +1856,24 @@ env_region.o C/C++ compiler + FILE_$(PRJ_DIR)/../env/env_register.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_register.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_register.c_objects +env_register.o + + + FILE_$(PRJ_DIR)/../env/env_register.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../env/env_stat.c_dependDone TRUE @@ -2144,6 +2306,24 @@ lock_deadlock.o C/C++ compiler + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_objects +lock_failchk.o + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../lock/lock_id.c_dependDone TRUE @@ -2324,6 +2504,24 @@ log_compare.o C/C++ compiler + FILE_$(PRJ_DIR)/../log/log_debug.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../log/log_debug.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../log/log_debug.c_objects +log_debug.o + + + FILE_$(PRJ_DIR)/../log/log_debug.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../log/log_get.c_dependDone TRUE @@ -2540,6 +2738,24 @@ mp_method.o C/C++ compiler + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_objects +mp_mvcc.o + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../mp/mp_region.c_dependDone TRUE @@ -2630,39 +2846,111 @@ mp_trickle.o C/C++ compiler - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_dependDone TRUE - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_objects -mut_tas.o + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_objects +mut_alloc.o - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_tool + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_tool C/C++ compiler - FILE_$(PRJ_DIR)/../mutex/mutex.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_dependDone TRUE - FILE_$(PRJ_DIR)/../mutex/mutex.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../mutex/mutex.c_objects -mutex.o + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_objects +mut_failchk.o - FILE_$(PRJ_DIR)/../mutex/mutex.c_tool + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_objects +mut_method.o + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_objects +mut_region.o + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_objects +mut_stat.o + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_objects +mut_tas.o + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_tool C/C++ compiler @@ -2756,6 +3044,24 @@ os_fid.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_flock.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_flock.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_flock.c_objects +os_flock.o + + + FILE_$(PRJ_DIR)/../os/os_flock.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_fsync.c_dependDone TRUE @@ -2774,39 +3080,57 @@ os_fsync.o C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_handle.c_dependDone + FILE_$(PRJ_DIR)/../os/os_fzero.c_dependDone TRUE - FILE_$(PRJ_DIR)/../os/os_handle.c_dependencies + FILE_$(PRJ_DIR)/../os/os_fzero.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../os/os_handle.c_objects -os_handle.o + FILE_$(PRJ_DIR)/../os/os_fzero.c_objects +os_fzero.o - FILE_$(PRJ_DIR)/../os/os_handle.c_tool + FILE_$(PRJ_DIR)/../os/os_fzero.c_tool C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_id.c_dependDone + FILE_$(PRJ_DIR)/../os/os_getenv.c_dependDone TRUE - FILE_$(PRJ_DIR)/../os/os_id.c_dependencies + FILE_$(PRJ_DIR)/../os/os_getenv.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../os/os_id.c_objects -os_id.o + FILE_$(PRJ_DIR)/../os/os_getenv.c_objects +os_getenv.o - FILE_$(PRJ_DIR)/../os/os_id.c_tool + FILE_$(PRJ_DIR)/../os/os_getenv.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../os/os_handle.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_handle.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_handle.c_objects +os_handle.o + + + FILE_$(PRJ_DIR)/../os/os_handle.c_tool C/C++ compiler @@ -2828,6 +3152,24 @@ os_method.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_mkdir.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_objects +os_mkdir.o + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_oflags.c_dependDone TRUE @@ -2864,6 +3206,24 @@ os_open.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_pid.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_pid.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_pid.c_objects +os_pid.o + + + FILE_$(PRJ_DIR)/../os/os_pid.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_region.c_dependDone TRUE @@ -2918,24 +3278,6 @@ os_root.o C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_rpath.c_dependDone -TRUE - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_dependencies -$(PRJ_DIR)/db_config.h \ - $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_objects -os_rpath.o - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_tool -C/C++ compiler - - FILE_$(PRJ_DIR)/../os/os_rw.c_dependDone TRUE @@ -3062,6 +3404,24 @@ os_truncate.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_uid.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_uid.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_uid.c_objects +os_uid.o + + + FILE_$(PRJ_DIR)/../os/os_uid.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_unlink.c_dependDone TRUE @@ -3080,6 +3440,24 @@ os_unlink.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_yield.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_yield.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_yield.c_objects +os_yield.o + + + FILE_$(PRJ_DIR)/../os/os_yield.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_abs.c_dependDone TRUE @@ -3134,6 +3512,24 @@ os_vx_map.o C/C++ compiler + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_objects +os_vx_rpath.o + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../qam/qam.c_dependDone TRUE @@ -3350,6 +3746,42 @@ rep_backup.o C/C++ compiler + FILE_$(PRJ_DIR)/../rep/rep_elect.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rep/rep_elect.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rep/rep_elect.c_objects +rep_elect.o + + + FILE_$(PRJ_DIR)/../rep/rep_elect.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../rep/rep_log.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rep/rep_log.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rep/rep_log.c_objects +rep_log.o + + + FILE_$(PRJ_DIR)/../rep/rep_log.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../rep/rep_method.c_dependDone TRUE @@ -3440,6 +3872,24 @@ rep_util.o C/C++ compiler + FILE_$(PRJ_DIR)/../rep/rep_verify.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rep/rep_verify.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rep/rep_verify.c_objects +rep_verify.o + + + FILE_$(PRJ_DIR)/../rep/rep_verify.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../txn/txn.c_dependDone TRUE @@ -3476,6 +3926,42 @@ txn_auto.o C/C++ compiler + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_objects +txn_chkpt.o + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_objects +txn_failchk.o + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../txn/txn_method.c_dependDone TRUE @@ -3639,7 +4125,8 @@ C/C++ compiler PROJECT_FILES -$(PRJ_DIR)/../btree/bt_compare.c \ +$(PRJ_DIR)/../btree/bt_compact.c \ + $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../btree/bt_conv.c \ $(PRJ_DIR)/../btree/bt_curadj.c \ $(PRJ_DIR)/../btree/bt_cursor.c \ @@ -3657,15 +4144,19 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../btree/bt_upgrade.c \ $(PRJ_DIR)/../btree/bt_verify.c \ $(PRJ_DIR)/../btree/btree_auto.c \ + $(PRJ_DIR)/../clib/ctime.c \ $(PRJ_DIR)/../clib/getopt.c \ $(PRJ_DIR)/../clib/snprintf.c \ $(PRJ_DIR)/../clib/strcasecmp.c \ $(PRJ_DIR)/../clib/strdup.c \ + $(PRJ_DIR)/../clib/strsep.c \ $(PRJ_DIR)/../common/db_byteorder.c \ + $(PRJ_DIR)/../common/db_clock.c \ $(PRJ_DIR)/../common/db_err.c \ $(PRJ_DIR)/../common/db_getlong.c \ $(PRJ_DIR)/../common/db_idspace.c \ $(PRJ_DIR)/../common/db_log2.c \ + $(PRJ_DIR)/../common/mkpath.c \ $(PRJ_DIR)/../common/util_arg.c \ $(PRJ_DIR)/../common/util_cache.c \ $(PRJ_DIR)/../common/util_log.c \ @@ -3681,6 +4172,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../db/db_am.c \ $(PRJ_DIR)/../db/db_auto.c \ $(PRJ_DIR)/../db/db_cam.c \ + $(PRJ_DIR)/../db/db_cds.c \ $(PRJ_DIR)/../db/db_conv.c \ $(PRJ_DIR)/../db/db_dispatch.c \ $(PRJ_DIR)/../db/db_dup.c \ @@ -3712,11 +4204,14 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../dbreg/dbreg_util.c \ $(PRJ_DIR)/../env/db_salloc.c \ $(PRJ_DIR)/../env/db_shash.c \ + $(PRJ_DIR)/../env/env_config.c \ + $(PRJ_DIR)/../env/env_failchk.c \ $(PRJ_DIR)/../env/env_file.c \ $(PRJ_DIR)/../env/env_method.c \ $(PRJ_DIR)/../env/env_open.c \ $(PRJ_DIR)/../env/env_recover.c \ $(PRJ_DIR)/../env/env_region.c \ + $(PRJ_DIR)/../env/env_register.c \ $(PRJ_DIR)/../env/env_stat.c \ $(PRJ_DIR)/../fileops/fileops_auto.c \ $(PRJ_DIR)/../fileops/fop_basic.c \ @@ -3741,6 +4236,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../hsearch/hsearch.c \ $(PRJ_DIR)/../lock/lock.c \ $(PRJ_DIR)/../lock/lock_deadlock.c \ + $(PRJ_DIR)/../lock/lock_failchk.c \ $(PRJ_DIR)/../lock/lock_id.c \ $(PRJ_DIR)/../lock/lock_list.c \ $(PRJ_DIR)/../lock/lock_method.c \ @@ -3751,6 +4247,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../log/log.c \ $(PRJ_DIR)/../log/log_archive.c \ $(PRJ_DIR)/../log/log_compare.c \ + $(PRJ_DIR)/../log/log_debug.c \ $(PRJ_DIR)/../log/log_get.c \ $(PRJ_DIR)/../log/log_method.c \ $(PRJ_DIR)/../log/log_put.c \ @@ -3763,28 +4260,36 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../mp/mp_fput.c \ $(PRJ_DIR)/../mp/mp_fset.c \ $(PRJ_DIR)/../mp/mp_method.c \ + $(PRJ_DIR)/../mp/mp_mvcc.c \ $(PRJ_DIR)/../mp/mp_region.c \ $(PRJ_DIR)/../mp/mp_register.c \ $(PRJ_DIR)/../mp/mp_stat.c \ $(PRJ_DIR)/../mp/mp_sync.c \ $(PRJ_DIR)/../mp/mp_trickle.c \ + $(PRJ_DIR)/../mutex/mut_alloc.c \ + $(PRJ_DIR)/../mutex/mut_failchk.c \ + $(PRJ_DIR)/../mutex/mut_method.c \ + $(PRJ_DIR)/../mutex/mut_region.c \ + $(PRJ_DIR)/../mutex/mut_stat.c \ $(PRJ_DIR)/../mutex/mut_tas.c \ - $(PRJ_DIR)/../mutex/mutex.c \ $(PRJ_DIR)/../os/os_alloc.c \ $(PRJ_DIR)/../os/os_clock.c \ $(PRJ_DIR)/../os/os_dir.c \ $(PRJ_DIR)/../os/os_errno.c \ $(PRJ_DIR)/../os/os_fid.c \ + $(PRJ_DIR)/../os/os_flock.c \ $(PRJ_DIR)/../os/os_fsync.c \ + $(PRJ_DIR)/../os/os_fzero.c \ + $(PRJ_DIR)/../os/os_getenv.c \ $(PRJ_DIR)/../os/os_handle.c \ - $(PRJ_DIR)/../os/os_id.c \ $(PRJ_DIR)/../os/os_method.c \ + $(PRJ_DIR)/../os/os_mkdir.c \ $(PRJ_DIR)/../os/os_oflags.c \ $(PRJ_DIR)/../os/os_open.c \ + $(PRJ_DIR)/../os/os_pid.c \ $(PRJ_DIR)/../os/os_region.c \ $(PRJ_DIR)/../os/os_rename.c \ $(PRJ_DIR)/../os/os_root.c \ - $(PRJ_DIR)/../os/os_rpath.c \ $(PRJ_DIR)/../os/os_rw.c \ $(PRJ_DIR)/../os/os_seek.c \ $(PRJ_DIR)/../os/os_sleep.c \ @@ -3792,10 +4297,13 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../os/os_stat.c \ $(PRJ_DIR)/../os/os_tmpdir.c \ $(PRJ_DIR)/../os/os_truncate.c \ + $(PRJ_DIR)/../os/os_uid.c \ $(PRJ_DIR)/../os/os_unlink.c \ + $(PRJ_DIR)/../os/os_yield.c \ $(PRJ_DIR)/../os_vxworks/os_vx_abs.c \ $(PRJ_DIR)/../os_vxworks/os_vx_config.c \ $(PRJ_DIR)/../os_vxworks/os_vx_map.c \ + $(PRJ_DIR)/../os_vxworks/os_vx_rpath.c \ $(PRJ_DIR)/../qam/qam.c \ $(PRJ_DIR)/../qam/qam_auto.c \ $(PRJ_DIR)/../qam/qam_conv.c \ @@ -3808,13 +4316,18 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../qam/qam_verify.c \ $(PRJ_DIR)/../rep/rep_auto.c \ $(PRJ_DIR)/../rep/rep_backup.c \ + $(PRJ_DIR)/../rep/rep_elect.c \ + $(PRJ_DIR)/../rep/rep_log.c \ $(PRJ_DIR)/../rep/rep_method.c \ $(PRJ_DIR)/../rep/rep_record.c \ $(PRJ_DIR)/../rep/rep_region.c \ $(PRJ_DIR)/../rep/rep_stat.c \ $(PRJ_DIR)/../rep/rep_util.c \ + $(PRJ_DIR)/../rep/rep_verify.c \ $(PRJ_DIR)/../txn/txn.c \ $(PRJ_DIR)/../txn/txn_auto.c \ + $(PRJ_DIR)/../txn/txn_chkpt.c \ + $(PRJ_DIR)/../txn/txn_failchk.c \ $(PRJ_DIR)/../txn/txn_method.c \ $(PRJ_DIR)/../txn/txn_rec.c \ $(PRJ_DIR)/../txn/txn_recover.c \ diff --git a/db/build_vxworks/BerkeleyDB22small.wpj b/db/build_vxworks/BerkeleyDB22small.wpj index dce76777c..622bc9650 100755 --- a/db/build_vxworks/BerkeleyDB22small.wpj +++ b/db/build_vxworks/BerkeleyDB22small.wpj @@ -308,6 +308,24 @@ PENTIUM_release PENTIUM_debug 2.2 + FILE_$(PRJ_DIR)/../btree/bt_compact.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_objects +bt_compact.o + + + FILE_$(PRJ_DIR)/../btree/bt_compact.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../btree/bt_compare.c_dependDone TRUE @@ -614,6 +632,24 @@ btree_auto.o C/C++ compiler + FILE_$(PRJ_DIR)/../clib/ctime.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../clib/ctime.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../clib/ctime.c_objects +ctime.o + + + FILE_$(PRJ_DIR)/../clib/ctime.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../clib/getopt.c_dependDone TRUE @@ -686,6 +722,24 @@ strdup.o C/C++ compiler + FILE_$(PRJ_DIR)/../clib/strsep.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../clib/strsep.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../clib/strsep.c_objects +strsep.o + + + FILE_$(PRJ_DIR)/../clib/strsep.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/crypto_stub.c_dependDone TRUE @@ -794,6 +848,24 @@ db_log2.o C/C++ compiler + FILE_$(PRJ_DIR)/../common/mkpath.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../common/mkpath.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../common/mkpath.c_objects +mkpath.o + + + FILE_$(PRJ_DIR)/../common/mkpath.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../common/util_arg.c_dependDone TRUE @@ -974,6 +1046,24 @@ db_cam.o C/C++ compiler + FILE_$(PRJ_DIR)/../db/db_cds.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../db/db_cds.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../db/db_cds.c_objects +db_cds.o + + + FILE_$(PRJ_DIR)/../db/db_cds.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../db/db_conv.c_dependDone TRUE @@ -1496,6 +1586,42 @@ db_shash.o C/C++ compiler + FILE_$(PRJ_DIR)/../env/env_config.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_config.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_config.c_objects +env_config.o + + + FILE_$(PRJ_DIR)/../env/env_config.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_objects +env_failchk.o + + + FILE_$(PRJ_DIR)/../env/env_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../env/env_file.c_dependDone TRUE @@ -1586,6 +1712,24 @@ env_region.o C/C++ compiler + FILE_$(PRJ_DIR)/../env/env_register.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_register.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_register.c_objects +env_register.o + + + FILE_$(PRJ_DIR)/../env/env_register.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../env/env_stat.c_dependDone TRUE @@ -1784,6 +1928,24 @@ lock_deadlock.o C/C++ compiler + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_objects +lock_failchk.o + + + FILE_$(PRJ_DIR)/../lock/lock_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../lock/lock_id.c_dependDone TRUE @@ -1964,6 +2126,24 @@ log_compare.o C/C++ compiler + FILE_$(PRJ_DIR)/../log/log_debug.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../log/log_debug.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../log/log_debug.c_objects +log_debug.o + + + FILE_$(PRJ_DIR)/../log/log_debug.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../log/log_get.c_dependDone TRUE @@ -2180,6 +2360,24 @@ mp_method.o C/C++ compiler + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_objects +mp_mvcc.o + + + FILE_$(PRJ_DIR)/../mp/mp_mvcc.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../mp/mp_region.c_dependDone TRUE @@ -2270,39 +2468,111 @@ mp_trickle.o C/C++ compiler - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_dependDone TRUE - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_objects -mut_tas.o + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_objects +mut_alloc.o - FILE_$(PRJ_DIR)/../mutex/mut_tas.c_tool + FILE_$(PRJ_DIR)/../mutex/mut_alloc.c_tool C/C++ compiler - FILE_$(PRJ_DIR)/../mutex/mutex.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_dependDone TRUE - FILE_$(PRJ_DIR)/../mutex/mutex.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../mutex/mutex.c_objects -mutex.o + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_objects +mut_failchk.o - FILE_$(PRJ_DIR)/../mutex/mutex.c_tool + FILE_$(PRJ_DIR)/../mutex/mut_failchk.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_objects +mut_method.o + + + FILE_$(PRJ_DIR)/../mutex/mut_method.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_objects +mut_region.o + + + FILE_$(PRJ_DIR)/../mutex/mut_region.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_objects +mut_stat.o + + + FILE_$(PRJ_DIR)/../mutex/mut_stat.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_objects +mut_tas.o + + + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_tool C/C++ compiler @@ -2396,6 +2666,24 @@ os_fid.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_flock.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_flock.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_flock.c_objects +os_flock.o + + + FILE_$(PRJ_DIR)/../os/os_flock.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_fsync.c_dependDone TRUE @@ -2414,39 +2702,57 @@ os_fsync.o C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_handle.c_dependDone + FILE_$(PRJ_DIR)/../os/os_fzero.c_dependDone TRUE - FILE_$(PRJ_DIR)/../os/os_handle.c_dependencies + FILE_$(PRJ_DIR)/../os/os_fzero.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../os/os_handle.c_objects -os_handle.o + FILE_$(PRJ_DIR)/../os/os_fzero.c_objects +os_fzero.o - FILE_$(PRJ_DIR)/../os/os_handle.c_tool + FILE_$(PRJ_DIR)/../os/os_fzero.c_tool C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_id.c_dependDone + FILE_$(PRJ_DIR)/../os/os_getenv.c_dependDone TRUE - FILE_$(PRJ_DIR)/../os/os_id.c_dependencies + FILE_$(PRJ_DIR)/../os/os_getenv.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ $(PRJ_DIR)/db.h - FILE_$(PRJ_DIR)/../os/os_id.c_objects -os_id.o + FILE_$(PRJ_DIR)/../os/os_getenv.c_objects +os_getenv.o - FILE_$(PRJ_DIR)/../os/os_id.c_tool + FILE_$(PRJ_DIR)/../os/os_getenv.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../os/os_handle.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_handle.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_handle.c_objects +os_handle.o + + + FILE_$(PRJ_DIR)/../os/os_handle.c_tool C/C++ compiler @@ -2468,6 +2774,24 @@ os_method.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_mkdir.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_objects +os_mkdir.o + + + FILE_$(PRJ_DIR)/../os/os_mkdir.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_oflags.c_dependDone TRUE @@ -2504,6 +2828,24 @@ os_open.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_pid.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_pid.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_pid.c_objects +os_pid.o + + + FILE_$(PRJ_DIR)/../os/os_pid.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_region.c_dependDone TRUE @@ -2558,24 +2900,6 @@ os_root.o C/C++ compiler - FILE_$(PRJ_DIR)/../os/os_rpath.c_dependDone -TRUE - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_dependencies -$(PRJ_DIR)/db_config.h \ - $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_objects -os_rpath.o - - - FILE_$(PRJ_DIR)/../os/os_rpath.c_tool -C/C++ compiler - - FILE_$(PRJ_DIR)/../os/os_rw.c_dependDone TRUE @@ -2702,6 +3026,24 @@ os_truncate.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_uid.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_uid.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_uid.c_objects +os_uid.o + + + FILE_$(PRJ_DIR)/../os/os_uid.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os/os_unlink.c_dependDone TRUE @@ -2720,6 +3062,24 @@ os_unlink.o C/C++ compiler + FILE_$(PRJ_DIR)/../os/os_yield.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_yield.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_yield.c_objects +os_yield.o + + + FILE_$(PRJ_DIR)/../os/os_yield.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_abs.c_dependDone TRUE @@ -2774,6 +3134,24 @@ os_vx_map.o C/C++ compiler + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_objects +os_vx_rpath.o + + + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_rpath.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../qam/qam_stub.c_dependDone TRUE @@ -2846,6 +3224,42 @@ txn_auto.o C/C++ compiler + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_objects +txn_chkpt.o + + + FILE_$(PRJ_DIR)/../txn/txn_chkpt.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_objects +txn_failchk.o + + + FILE_$(PRJ_DIR)/../txn/txn_failchk.c_tool +C/C++ compiler + + FILE_$(PRJ_DIR)/../txn/txn_method.c_dependDone TRUE @@ -3009,7 +3423,8 @@ C/C++ compiler PROJECT_FILES -$(PRJ_DIR)/../btree/bt_compare.c \ +$(PRJ_DIR)/../btree/bt_compact.c \ + $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../btree/bt_conv.c \ $(PRJ_DIR)/../btree/bt_curadj.c \ $(PRJ_DIR)/../btree/bt_cursor.c \ @@ -3026,16 +3441,19 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../btree/bt_stat.c \ $(PRJ_DIR)/../btree/bt_upgrade.c \ $(PRJ_DIR)/../btree/btree_auto.c \ + $(PRJ_DIR)/../clib/ctime.c \ $(PRJ_DIR)/../clib/getopt.c \ $(PRJ_DIR)/../clib/snprintf.c \ $(PRJ_DIR)/../clib/strcasecmp.c \ $(PRJ_DIR)/../clib/strdup.c \ + $(PRJ_DIR)/../clib/strsep.c \ $(PRJ_DIR)/../common/crypto_stub.c \ $(PRJ_DIR)/../common/db_byteorder.c \ $(PRJ_DIR)/../common/db_err.c \ $(PRJ_DIR)/../common/db_getlong.c \ $(PRJ_DIR)/../common/db_idspace.c \ $(PRJ_DIR)/../common/db_log2.c \ + $(PRJ_DIR)/../common/mkpath.c \ $(PRJ_DIR)/../common/util_arg.c \ $(PRJ_DIR)/../common/util_cache.c \ $(PRJ_DIR)/../common/util_log.c \ @@ -3046,6 +3464,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../db/db_am.c \ $(PRJ_DIR)/../db/db_auto.c \ $(PRJ_DIR)/../db/db_cam.c \ + $(PRJ_DIR)/../db/db_cds.c \ $(PRJ_DIR)/../db/db_conv.c \ $(PRJ_DIR)/../db/db_dispatch.c \ $(PRJ_DIR)/../db/db_dup.c \ @@ -3075,11 +3494,14 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../dbreg/dbreg_util.c \ $(PRJ_DIR)/../env/db_salloc.c \ $(PRJ_DIR)/../env/db_shash.c \ + $(PRJ_DIR)/../env/env_config.c \ + $(PRJ_DIR)/../env/env_failchk.c \ $(PRJ_DIR)/../env/env_file.c \ $(PRJ_DIR)/../env/env_method.c \ $(PRJ_DIR)/../env/env_open.c \ $(PRJ_DIR)/../env/env_recover.c \ $(PRJ_DIR)/../env/env_region.c \ + $(PRJ_DIR)/../env/env_register.c \ $(PRJ_DIR)/../env/env_stat.c \ $(PRJ_DIR)/../fileops/fileops_auto.c \ $(PRJ_DIR)/../fileops/fop_basic.c \ @@ -3091,6 +3513,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../hmac/sha1.c \ $(PRJ_DIR)/../lock/lock.c \ $(PRJ_DIR)/../lock/lock_deadlock.c \ + $(PRJ_DIR)/../lock/lock_failchk.c \ $(PRJ_DIR)/../lock/lock_id.c \ $(PRJ_DIR)/../lock/lock_list.c \ $(PRJ_DIR)/../lock/lock_method.c \ @@ -3101,6 +3524,7 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../log/log.c \ $(PRJ_DIR)/../log/log_archive.c \ $(PRJ_DIR)/../log/log_compare.c \ + $(PRJ_DIR)/../log/log_debug.c \ $(PRJ_DIR)/../log/log_get.c \ $(PRJ_DIR)/../log/log_method.c \ $(PRJ_DIR)/../log/log_put.c \ @@ -3113,28 +3537,36 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../mp/mp_fput.c \ $(PRJ_DIR)/../mp/mp_fset.c \ $(PRJ_DIR)/../mp/mp_method.c \ + $(PRJ_DIR)/../mp/mp_mvcc.c \ $(PRJ_DIR)/../mp/mp_region.c \ $(PRJ_DIR)/../mp/mp_register.c \ $(PRJ_DIR)/../mp/mp_stat.c \ $(PRJ_DIR)/../mp/mp_sync.c \ $(PRJ_DIR)/../mp/mp_trickle.c \ + $(PRJ_DIR)/../mutex/mut_alloc.c \ + $(PRJ_DIR)/../mutex/mut_failchk.c \ + $(PRJ_DIR)/../mutex/mut_method.c \ + $(PRJ_DIR)/../mutex/mut_region.c \ + $(PRJ_DIR)/../mutex/mut_stat.c \ $(PRJ_DIR)/../mutex/mut_tas.c \ - $(PRJ_DIR)/../mutex/mutex.c \ $(PRJ_DIR)/../os/os_alloc.c \ $(PRJ_DIR)/../os/os_clock.c \ $(PRJ_DIR)/../os/os_dir.c \ $(PRJ_DIR)/../os/os_errno.c \ $(PRJ_DIR)/../os/os_fid.c \ + $(PRJ_DIR)/../os/os_flock.c \ $(PRJ_DIR)/../os/os_fsync.c \ + $(PRJ_DIR)/../os/os_fzero.c \ + $(PRJ_DIR)/../os/os_getenv.c \ $(PRJ_DIR)/../os/os_handle.c \ - $(PRJ_DIR)/../os/os_id.c \ $(PRJ_DIR)/../os/os_method.c \ + $(PRJ_DIR)/../os/os_mkdir.c \ $(PRJ_DIR)/../os/os_oflags.c \ $(PRJ_DIR)/../os/os_open.c \ + $(PRJ_DIR)/../os/os_pid.c \ $(PRJ_DIR)/../os/os_region.c \ $(PRJ_DIR)/../os/os_rename.c \ $(PRJ_DIR)/../os/os_root.c \ - $(PRJ_DIR)/../os/os_rpath.c \ $(PRJ_DIR)/../os/os_rw.c \ $(PRJ_DIR)/../os/os_seek.c \ $(PRJ_DIR)/../os/os_sleep.c \ @@ -3142,14 +3574,19 @@ $(PRJ_DIR)/../btree/bt_compare.c \ $(PRJ_DIR)/../os/os_stat.c \ $(PRJ_DIR)/../os/os_tmpdir.c \ $(PRJ_DIR)/../os/os_truncate.c \ + $(PRJ_DIR)/../os/os_uid.c \ $(PRJ_DIR)/../os/os_unlink.c \ + $(PRJ_DIR)/../os/os_yield.c \ $(PRJ_DIR)/../os_vxworks/os_vx_abs.c \ $(PRJ_DIR)/../os_vxworks/os_vx_config.c \ $(PRJ_DIR)/../os_vxworks/os_vx_map.c \ + $(PRJ_DIR)/../os_vxworks/os_vx_rpath.c \ $(PRJ_DIR)/../qam/qam_stub.c \ $(PRJ_DIR)/../rep/rep_stub.c \ $(PRJ_DIR)/../txn/txn.c \ $(PRJ_DIR)/../txn/txn_auto.c \ + $(PRJ_DIR)/../txn/txn_chkpt.c \ + $(PRJ_DIR)/../txn/txn_failchk.c \ $(PRJ_DIR)/../txn/txn_method.c \ $(PRJ_DIR)/../txn/txn_rec.c \ $(PRJ_DIR)/../txn/txn_recover.c \ diff --git a/db/build_vxworks/clib_port.h b/db/build_vxworks/clib_port.h new file mode 100644 index 000000000..cfefbb37d --- /dev/null +++ b/db/build_vxworks/clib_port.h @@ -0,0 +1,97 @@ +/* + * Exit success/failure macros. + */ +#ifndef HAVE_EXIT_SUCCESS +#define EXIT_FAILURE 1 +#define EXIT_SUCCESS 0 +#endif + +/* + * Don't step on the namespace. Other libraries may have their own + * implementations of these functions, we don't want to use their + * implementations or force them to use ours based on the load order. + */ +#ifndef HAVE_ATOI +#define atoi __db_Catoi +#endif +#ifndef HAVE_ATOL +#define atol __db_Catol +#endif +#ifndef HAVE_GETADDRINFO +#define freeaddrinfo(a) __db_Cfreeaddrinfo(a) +#define getaddrinfo(a, b, c, d) __db_Cgetaddrinfo(a, b, c, d) +#endif +#ifndef HAVE_GETCWD +#define getcwd __db_Cgetcwd +#endif +#ifndef HAVE_GETOPT +#define getopt __db_Cgetopt +#define optarg __db_Coptarg +#define opterr __db_Copterr +#define optind __db_Coptind +#define optopt __db_Coptopt +#define optreset __db_Coptreset +#endif +#ifndef HAVE_ISSPACE +#define isspace __db_Cisspace +#endif +#ifndef HAVE_MEMCMP +#define memcmp __db_Cmemcmp +#endif +#ifndef HAVE_MEMCPY +#define memcpy __db_Cmemcpy +#endif +#ifndef HAVE_MEMMOVE +#define memmove __db_Cmemmove +#endif +#ifndef HAVE_PRINTF +#define printf __db_Cprintf +#define fprintf __db_Cfprintf +#endif +#ifndef HAVE_RAISE +#define raise __db_Craise +#endif +#ifndef HAVE_RAND +#define rand __db_Crand +#define srand __db_Csrand +#endif +#ifndef HAVE_SNPRINTF +#define snprintf __db_Csnprintf +#endif +#ifndef HAVE_STRCASECMP +#define strcasecmp __db_Cstrcasecmp +#define strncasecmp __db_Cstrncasecmp +#endif +#ifndef HAVE_STRCAT +#define strcat __db_Cstrcat +#endif +#ifndef HAVE_STRCHR +#define strchr __db_Cstrchr +#endif +#ifndef HAVE_STRDUP +#define strdup __db_Cstrdup +#endif +#ifndef HAVE_STRERROR +#define strerror __db_Cstrerror +#endif +#ifndef HAVE_STRNCAT +#define strncat __db_Cstrncat +#endif +#ifndef HAVE_STRNCMP +#define strncmp __db_Cstrncmp +#endif +#ifndef HAVE_STRRCHR +#define strrchr __db_Cstrrchr +#endif +#ifndef HAVE_STRSEP +#define strsep __db_Cstrsep +#endif +#ifndef HAVE_STRTOL +#define strtol __db_Cstrtol +#endif +#ifndef HAVE_STRTOUL +#define strtoul __db_Cstrtoul +#endif +#ifndef HAVE_VSNPRINTF +#define vsnprintf __db_Cvsnprintf +#endif diff --git a/db/build_vxworks/db.h b/db/build_vxworks/db.h index 5e6b44fe5..e297af6d0 100644 --- a/db/build_vxworks/db.h +++ b/db/build_vxworks/db.h @@ -2,10 +2,10 @@ /* * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db.in,v 11.463 2004/10/11 18:47:50 bostic Exp $ + * $Id: db.in,v 12.108 2006/09/13 14:53:37 mjc Exp $ * * db.h include file layout: * General. @@ -44,9 +44,9 @@ extern "C" { * Berkeley DB version information. */ #define DB_VERSION_MAJOR 4 -#define DB_VERSION_MINOR 3 -#define DB_VERSION_PATCH 27 -#define DB_VERSION_STRING "Sleepycat Software: Berkeley DB 4.3.27: (December 22, 2004)" +#define DB_VERSION_MINOR 5 +#define DB_VERSION_PATCH 20 +#define DB_VERSION_STRING "Berkeley DB 4.5.20: (September 20, 2006)" /* * !!! @@ -67,7 +67,7 @@ typedef unsigned char u_int8_t; typedef unsigned short u_int16_t; typedef unsigned int u_int32_t; - +typedef unsigned long long u_int64_t; #endif @@ -78,9 +78,7 @@ typedef unsigned int u_int32_t; * (and we don't have to worry about systems that store floats in other than * power-of-2 numbers of bytes). Additionally this fixes compilers that rewrite * structure assignments and ANSI C memcpy calls to be in-line instructions - * that happen to require alignment. Note: this alignment isn't sufficient for - * mutexes, which depend on things like cache line alignment. Mutex alignment - * is handled separately, in mutex.h. + * that happen to require alignment. * * uintptr_t -- * Unsigned type that's the same size as a pointer. There are places where @@ -97,6 +95,9 @@ typedef unsigned long uintptr_t; */ typedef int db_seq_t; +/* Thread and process identification. */ +typedef uintmax_t db_threadid_t; + /* Basic types that are exported or quasi-exported. */ typedef u_int32_t db_pgno_t; /* Page number type. */ typedef u_int16_t db_indx_t; /* Page offset type. */ @@ -123,6 +124,7 @@ typedef uintptr_t roff_t; struct __db; typedef struct __db DB; struct __db_bt_stat; typedef struct __db_bt_stat DB_BTREE_STAT; struct __db_cipher; typedef struct __db_cipher DB_CIPHER; +struct __db_compact; typedef struct __db_compact DB_COMPACT; struct __db_dbt; typedef struct __db_dbt DBT; struct __db_env; typedef struct __db_env DB_ENV; struct __db_h_stat; typedef struct __db_h_stat DB_HASH_STAT; @@ -130,6 +132,8 @@ struct __db_ilock; typedef struct __db_ilock DB_LOCK_ILOCK; struct __db_lock_stat; typedef struct __db_lock_stat DB_LOCK_STAT; struct __db_lock_u; typedef struct __db_lock_u DB_LOCK; struct __db_lockreq; typedef struct __db_lockreq DB_LOCKREQ; +struct __db_locktab; typedef struct __db_locktab DB_LOCKTAB; +struct __db_log; typedef struct __db_log DB_LOG; struct __db_log_cursor; typedef struct __db_log_cursor DB_LOGC; struct __db_log_stat; typedef struct __db_log_stat DB_LOG_STAT; struct __db_lsn; typedef struct __db_lsn DB_LSN; @@ -137,13 +141,18 @@ struct __db_mpool; typedef struct __db_mpool DB_MPOOL; struct __db_mpool_fstat;typedef struct __db_mpool_fstat DB_MPOOL_FSTAT; struct __db_mpool_stat; typedef struct __db_mpool_stat DB_MPOOL_STAT; struct __db_mpoolfile; typedef struct __db_mpoolfile DB_MPOOLFILE; +struct __db_mutex_stat; typedef struct __db_mutex_stat DB_MUTEX_STAT; +struct __db_mutex_t; typedef struct __db_mutex_t DB_MUTEX; +struct __db_mutexmgr; typedef struct __db_mutexmgr DB_MUTEXMGR; struct __db_preplist; typedef struct __db_preplist DB_PREPLIST; struct __db_qam_stat; typedef struct __db_qam_stat DB_QUEUE_STAT; struct __db_rep; typedef struct __db_rep DB_REP; struct __db_rep_stat; typedef struct __db_rep_stat DB_REP_STAT; -struct __db_sequence; typedef struct __db_sequence DB_SEQUENCE; +struct __db_repmgr_site; \ + typedef struct __db_repmgr_site DB_REPMGR_SITE; struct __db_seq_record; typedef struct __db_seq_record DB_SEQ_RECORD; struct __db_seq_stat; typedef struct __db_seq_stat DB_SEQUENCE_STAT; +struct __db_sequence; typedef struct __db_sequence DB_SEQUENCE; struct __db_txn; typedef struct __db_txn DB_TXN; struct __db_txn_active; typedef struct __db_txn_active DB_TXN_ACTIVE; struct __db_txn_stat; typedef struct __db_txn_stat DB_TXN_STAT; @@ -154,13 +163,9 @@ struct __fh_t; typedef struct __fh_t DB_FH; struct __fname; typedef struct __fname FNAME; struct __key_range; typedef struct __key_range DB_KEY_RANGE; struct __mpoolfile; typedef struct __mpoolfile MPOOLFILE; -struct __mutex_t; typedef struct __mutex_t DB_MUTEX; /* Key/data structure -- a Data-Base Thang. */ struct __db_dbt { - /* - * data/size must be fields 1 and 2 for DB 1.85 compatibility. - */ void *data; /* Key/data */ u_int32_t size; /* key/data length */ @@ -168,13 +173,16 @@ struct __db_dbt { u_int32_t dlen; /* RO: get/put record length. */ u_int32_t doff; /* RO: get/put record offset. */ + void *app_data; + #define DB_DBT_APPMALLOC 0x001 /* Callback allocated memory. */ #define DB_DBT_ISSET 0x002 /* Lower level calls set value. */ #define DB_DBT_MALLOC 0x004 /* Return in malloc'd memory. */ #define DB_DBT_PARTIAL 0x008 /* Partial put/get. */ #define DB_DBT_REALLOC 0x010 /* Return in realloc'd memory. */ -#define DB_DBT_USERMEM 0x020 /* Return in user's memory. */ -#define DB_DBT_DUPOK 0x040 /* Insert if duplicate. */ +#define DB_DBT_USERCOPY 0x020 /* Use the user-supplied callback. */ +#define DB_DBT_USERMEM 0x040 /* Return in user's memory. */ +#define DB_DBT_DUPOK 0x080 /* Insert if duplicate. */ u_int32_t flags; }; @@ -184,17 +192,19 @@ struct __db_dbt { * interface specific flags in this range. */ #define DB_CREATE 0x0000001 /* Create file as necessary. */ -#define DB_CXX_NO_EXCEPTIONS 0x0000002 /* C++: return error values. */ +#define DB_DURABLE_UNKNOWN 0x0000002 /* Durability on open (internal). */ #define DB_FORCE 0x0000004 /* Force (anything). */ -#define DB_NOMMAP 0x0000008 /* Don't mmap underlying file. */ -#define DB_RDONLY 0x0000010 /* Read-only (O_RDONLY). */ -#define DB_RECOVER 0x0000020 /* Run normal recovery. */ -#define DB_THREAD 0x0000040 /* Applications are threaded. */ -#define DB_TRUNCATE 0x0000080 /* Discard existing DB (O_TRUNC). */ -#define DB_TXN_NOSYNC 0x0000100 /* Do not sync log on commit. */ -#define DB_TXN_NOT_DURABLE 0x0000200 /* Do not log changes. */ -#define DB_USE_ENVIRON 0x0000400 /* Use the environment. */ -#define DB_USE_ENVIRON_ROOT 0x0000800 /* Use the environment if root. */ +#define DB_MULTIVERSION 0x0000008 /* Multiversion concurrency control. */ +#define DB_NOMMAP 0x0000010 /* Don't mmap underlying file. */ +#define DB_RDONLY 0x0000020 /* Read-only (O_RDONLY). */ +#define DB_RECOVER 0x0000040 /* Run normal recovery. */ +#define DB_THREAD 0x0000080 /* Applications are threaded. */ +#define DB_TRUNCATE 0x0000100 /* Discard existing DB (O_TRUNC). */ +#define DB_TXN_NOSYNC 0x0000200 /* Do not sync log on commit. */ +#define DB_TXN_NOT_DURABLE 0x0000400 /* Do not log changes. */ +#define DB_TXN_WRITE_NOSYNC 0x0000800 /* Write the log but don't sync. */ +#define DB_USE_ENVIRON 0x0001000 /* Use the environment. */ +#define DB_USE_ENVIRON_ROOT 0x0002000 /* Use the environment if root. */ /* * Common flags -- @@ -202,66 +212,84 @@ struct __db_dbt { * interface specific flags in this range. * * DB_AUTO_COMMIT: - * DB_ENV->set_flags, DB->associate, DB->del, DB->put, DB->open, - * DB->remove, DB->rename, DB->truncate - * DB_DEGREE_2: + * DB_ENV->set_flags, DB->open + * (Note: until the 4.3 release, legal to DB->associate, DB->del, + * DB->put, DB->remove, DB->rename and DB->truncate, and others.) + * DB_READ_COMMITTED: * DB->cursor, DB->get, DB->join, DBcursor->c_get, DB_ENV->txn_begin - * DB_DIRTY_READ: + * DB_READ_UNCOMMITTED: * DB->cursor, DB->get, DB->join, DB->open, DBcursor->c_get, * DB_ENV->txn_begin - * DB_NOAUTO_COMMIT - * DB->associate, DB->del, DB->put, DB->open, - * DB->remove, DB->rename, DB->truncate + * DB_TXN_SNAPSHOT: + * DB_ENV->set_flags, DB_ENV->txn_begin, DB->cursor * * !!! - * The DB_DIRTY_READ and DB_DEGREE_2 bit masks can't be changed without - * also changing the masks for the flags that can be OR'd into DB + * The DB_READ_COMMITTED and DB_READ_UNCOMMITTED bit masks can't be changed + * without also changing the masks for the flags that can be OR'd into DB * access method and cursor operation values. */ -#define DB_AUTO_COMMIT 0x01000000/* Implied transaction. */ -#define DB_DEGREE_2 0x02000000/* Degree 2. */ -#define DB_DIRTY_READ 0x04000000/* Dirty Read. */ -#define DB_NO_AUTO_COMMIT 0x08000000/* Override env-wide AUTOCOMMIT. */ +#define DB_AUTO_COMMIT 0x02000000/* Implied transaction. */ + +#define DB_READ_COMMITTED 0x04000000/* Degree 2 isolation. */ +#define DB_DEGREE_2 0x04000000/* Historic name. */ + +#define DB_READ_UNCOMMITTED 0x08000000/* Degree 1 isolation. */ +#define DB_DIRTY_READ 0x08000000/* Historic name. */ + +#define DB_TXN_SNAPSHOT 0x10000000/* Snapshot isolation. */ /* - * Flags private to db_env_create. + * Flags common to db_env_create and db_create. */ -#define DB_RPCCLIENT 0x0000001 /* An RPC client environment. */ +#define DB_CXX_NO_EXCEPTIONS 0x0000001 /* C++: return error values. */ + +/* + * Flags private to db_env_create. + * Shared flags up to 0x0000001 */ +#define DB_RPCCLIENT 0x0000002 /* An RPC client environment. */ /* * Flags private to db_create. - */ -#define DB_REP_CREATE 0x0000001 /* Open of an internal rep database. */ + * Shared flags up to 0x0000001 */ #define DB_XA_CREATE 0x0000002 /* Open in an XA environment. */ /* * Flags private to DB_ENV->open. - * Shared flags up to 0x0000800 */ -#define DB_INIT_CDB 0x0001000 /* Concurrent Access Methods. */ -#define DB_INIT_LOCK 0x0002000 /* Initialize locking. */ -#define DB_INIT_LOG 0x0004000 /* Initialize logging. */ -#define DB_INIT_MPOOL 0x0008000 /* Initialize mpool. */ -#define DB_INIT_REP 0x0010000 /* Initialize replication. */ -#define DB_INIT_TXN 0x0020000 /* Initialize transactions. */ -#define DB_JOINENV 0x0040000 /* Initialize all subsystems present. */ -#define DB_LOCKDOWN 0x0080000 /* Lock memory into physical core. */ -#define DB_PRIVATE 0x0100000 /* DB_ENV is process local. */ -#define DB_RECOVER_FATAL 0x0200000 /* Run catastrophic recovery. */ -#define DB_SYSTEM_MEM 0x0400000 /* Use system-backed memory. */ + * Shared flags up to 0x0002000 */ +#define DB_INIT_CDB 0x0004000 /* Concurrent Access Methods. */ +#define DB_INIT_LOCK 0x0008000 /* Initialize locking. */ +#define DB_INIT_LOG 0x0010000 /* Initialize logging. */ +#define DB_INIT_MPOOL 0x0020000 /* Initialize mpool. */ +#define DB_INIT_REP 0x0040000 /* Initialize replication. */ +#define DB_INIT_TXN 0x0080000 /* Initialize transactions. */ +#define DB_LOCKDOWN 0x0100000 /* Lock memory into physical core. */ +#define DB_PRIVATE 0x0200000 /* DB_ENV is process local. */ +#define DB_RECOVER_FATAL 0x0400000 /* Run catastrophic recovery. */ +#define DB_REGISTER 0x0800000 /* Multi-process registry. */ +#define DB_SYSTEM_MEM 0x1000000 /* Use system-backed memory. */ + +#define DB_JOINENV 0x0 /* Compatibility. */ /* * Flags private to DB->open. - * Shared flags up to 0x0000800 */ -#define DB_EXCL 0x0001000 /* Exclusive open (O_EXCL). */ -#define DB_FCNTL_LOCKING 0x0002000 /* UNDOC: fcntl(2) locking. */ -#define DB_RDWRMASTER 0x0004000 /* UNDOC: allow subdb master open R/W */ -#define DB_WRITEOPEN 0x0008000 /* UNDOC: open with write lock. */ + * Shared flags up to 0x0002000 */ +#define DB_EXCL 0x0004000 /* Exclusive open (O_EXCL). */ +#define DB_FCNTL_LOCKING 0x0008000 /* UNDOC: fcntl(2) locking. */ +#define DB_NO_AUTO_COMMIT 0x0010000 /* Override env-wide AUTOCOMMIT. */ +#define DB_RDWRMASTER 0x0020000 /* UNDOC: allow subdb master open R/W */ +#define DB_WRITEOPEN 0x0040000 /* UNDOC: open with write lock. */ + +/* + * Flags private to DB->associate. + * Shared flags up to 0x0002000 */ +#define DB_IMMUTABLE_KEY 0x0004000 /* Secondary key is immutable. */ +/* Shared flags at 0x1000000 */ /* * Flags private to DB_ENV->txn_begin. - * Shared flags up to 0x0000800 */ -#define DB_TXN_NOWAIT 0x0001000 /* Do not wait for locks in this TXN. */ -#define DB_TXN_SYNC 0x0002000 /* Always sync log on commit. */ + * Shared flags up to 0x0002000 */ +#define DB_TXN_NOWAIT 0x0004000 /* Do not wait for locks in this TXN. */ +#define DB_TXN_SYNC 0x0008000 /* Always sync log on commit. */ /* * Flags private to DB_ENV->set_encrypt. @@ -270,25 +298,25 @@ struct __db_dbt { /* * Flags private to DB_ENV->set_flags. - * Shared flags up to 0x00000800 */ -#define DB_CDB_ALLDB 0x00001000/* Set CDB locking per environment. */ -#define DB_DIRECT_DB 0x00002000/* Don't buffer databases in the OS. */ -#define DB_DIRECT_LOG 0x00004000/* Don't buffer log files in the OS. */ -#define DB_DSYNC_LOG 0x00008000/* Set O_DSYNC on the log. */ -#define DB_LOG_AUTOREMOVE 0x00010000/* Automatically remove log files. */ -#define DB_LOG_INMEMORY 0x00020000/* Store logs in buffers in memory. */ -#define DB_NOLOCKING 0x00040000/* Set locking/mutex behavior. */ -#define DB_NOPANIC 0x00080000/* Set panic state per DB_ENV. */ -#define DB_OVERWRITE 0x00100000/* Overwrite unlinked region files. */ -#define DB_PANIC_ENVIRONMENT 0x00200000/* Set panic state per environment. */ -#define DB_REGION_INIT 0x00400000/* Page-fault regions on open. */ -#define DB_TIME_NOTGRANTED 0x00800000/* Return NOTGRANTED on timeout. */ -/* Shared flags at 0x01000000 */ + * Shared flags up to 0x00002000 */ +#define DB_CDB_ALLDB 0x00004000/* Set CDB locking per environment. */ +#define DB_DIRECT_DB 0x00008000/* Don't buffer databases in the OS. */ +#define DB_DIRECT_LOG 0x00010000/* Don't buffer log files in the OS. */ +#define DB_DSYNC_DB 0x00020000/* Set O_DSYNC on the databases. */ +#define DB_DSYNC_LOG 0x00040000/* Set O_DSYNC on the log. */ +#define DB_LOG_AUTOREMOVE 0x00080000/* Automatically remove log files. */ +#define DB_LOG_INMEMORY 0x00100000/* Store logs in buffers in memory. */ +#define DB_NOLOCKING 0x00200000/* Set locking/mutex behavior. */ +#define DB_NOPANIC 0x00400000/* Set panic state per DB_ENV. */ +#define DB_OVERWRITE 0x00800000/* Overwrite unlinked region files. */ +#define DB_PANIC_ENVIRONMENT 0x01000000/* Set panic state per environment. */ /* Shared flags at 0x02000000 */ /* Shared flags at 0x04000000 */ /* Shared flags at 0x08000000 */ -#define DB_TXN_WRITE_NOSYNC 0x10000000/* Write, don't sync, on txn commit. */ -#define DB_YIELDCPU 0x20000000/* Yield the CPU (a lot). */ +/* Shared flags at 0x10000000 */ +#define DB_REGION_INIT 0x20000000/* Page-fault regions on open. */ +#define DB_TIME_NOTGRANTED 0x40000000/* Return NOTGRANTED on timeout. */ +#define DB_YIELDCPU 0x80000000/* Yield the CPU (a lot). */ /* * Flags private to DB->set_feedback's callback. @@ -296,38 +324,48 @@ struct __db_dbt { #define DB_UPGRADE 0x0000001 /* Upgrading. */ #define DB_VERIFY 0x0000002 /* Verifying. */ +/* + * Flags private to DB->compact. + * Shared flags up to 0x00002000 + */ +#define DB_FREELIST_ONLY 0x00004000 /* Just sort and truncate. */ +#define DB_FREE_SPACE 0x00008000 /* Free space . */ +#define DB_COMPACT_FLAGS \ + (DB_FREELIST_ONLY | DB_FREE_SPACE) + /* * Flags private to DB_MPOOLFILE->open. - * Shared flags up to 0x0000800 */ -#define DB_DIRECT 0x0001000 /* Don't buffer the file in the OS. */ -#define DB_DURABLE_UNKNOWN 0x0002000 /* internal: durability on open. */ -#define DB_EXTENT 0x0004000 /* internal: dealing with an extent. */ -#define DB_ODDFILESIZE 0x0008000 /* Truncate file to N * pgsize. */ + * Shared flags up to 0x0002000 */ +#define DB_DIRECT 0x0004000 /* Don't buffer the file in the OS. */ +#define DB_EXTENT 0x0008000 /* internal: dealing with an extent. */ +#define DB_ODDFILESIZE 0x0010000 /* Truncate file to N * pgsize. */ /* * Flags private to DB->set_flags. - */ -#define DB_CHKSUM 0x0000001 /* Do checksumming */ -#define DB_DUP 0x0000002 /* Btree, Hash: duplicate keys. */ -#define DB_DUPSORT 0x0000004 /* Btree, Hash: duplicate keys. */ -#define DB_ENCRYPT 0x0000008 /* Btree, Hash: duplicate keys. */ -#define DB_INORDER 0x0000010 /* Queue: strict ordering on consume. */ -#define DB_RECNUM 0x0000020 /* Btree: record numbers. */ -#define DB_RENUMBER 0x0000040 /* Recno: renumber on insert/delete. */ -#define DB_REVSPLITOFF 0x0000080 /* Btree: turn off reverse splits. */ -#define DB_SNAPSHOT 0x0000100 /* Recno: snapshot the input. */ + * Shared flags up to 0x00002000 */ +#define DB_CHKSUM 0x00004000 /* Do checksumming */ +#define DB_DUP 0x00008000 /* Btree, Hash: duplicate keys. */ +#define DB_DUPSORT 0x00010000 /* Btree, Hash: duplicate keys. */ +#define DB_ENCRYPT 0x00020000 /* Btree, Hash: duplicate keys. */ +#define DB_INORDER 0x00040000 /* Queue: strict ordering on consume */ +#define DB_RECNUM 0x00080000 /* Btree: record numbers. */ +#define DB_RENUMBER 0x00100000 /* Recno: renumber on insert/delete. */ +#define DB_REVSPLITOFF 0x00200000 /* Btree: turn off reverse splits. */ +#define DB_SNAPSHOT 0x00400000 /* Recno: snapshot the input. */ /* * Flags private to the DB_ENV->stat_print, DB->stat and DB->stat_print methods. */ -#define DB_STAT_ALL 0x0000001 /* Print: Everything. */ -#define DB_STAT_CLEAR 0x0000002 /* Clear stat after returning values. */ -#define DB_STAT_LOCK_CONF 0x0000004 /* Print: Lock conflict matrix. */ -#define DB_STAT_LOCK_LOCKERS 0x0000008 /* Print: Lockers. */ -#define DB_STAT_LOCK_OBJECTS 0x0000010 /* Print: Lock objects. */ -#define DB_STAT_LOCK_PARAMS 0x0000020 /* Print: Lock parameters. */ -#define DB_STAT_MEMP_HASH 0x0000040 /* Print: Mpool hash buckets. */ -#define DB_STAT_SUBSYSTEM 0x0000080 /* Print: Subsystems too. */ +#define DB_FAST_STAT 0x0000001 /* Don't traverse the database. */ +#define DB_STAT_ALL 0x0000002 /* Print: Everything. */ +#define DB_STAT_CLEAR 0x0000004 /* Clear stat after returning values. */ +#define DB_STAT_LOCK_CONF 0x0000008 /* Print: Lock conflict matrix. */ +#define DB_STAT_LOCK_LOCKERS 0x0000010 /* Print: Lockers. */ +#define DB_STAT_LOCK_OBJECTS 0x0000020 /* Print: Lock objects. */ +#define DB_STAT_LOCK_PARAMS 0x0000040 /* Print: Lock parameters. */ +#define DB_STAT_MEMP_HASH 0x0000080 /* Print: Mpool hash buckets. */ +#define DB_STAT_NOERROR 0x0000100 /* Internal: continue on error. */ +#define DB_STAT_SUBSYSTEM 0x0000200 /* Print: Subsystems too. */ /* * Flags private to DB->join. @@ -352,10 +390,45 @@ struct __db_dbt { */ /* - * Flags private to DB->set_rep_transport's send callback. + * Flags private to DB->rep_set_transport's send callback. */ -#define DB_REP_NOBUFFER 0x0000001 /* Do not buffer this message. */ -#define DB_REP_PERMANENT 0x0000002 /* Important--app. may want to flush. */ +#define DB_REP_ANYWHERE 0x0000001 /* Message can be serviced anywhere. */ +#define DB_REP_NOBUFFER 0x0000002 /* Do not buffer this message. */ +#define DB_REP_PERMANENT 0x0000004 /* Important--app. may want to flush. */ +#define DB_REP_REREQUEST 0x0000008 /* This msg already been requested. */ + +/******************************************************* + * Mutexes. + *******************************************************/ +typedef u_int32_t db_mutex_t; + +/* + * Flag arguments for DbEnv.mutex_alloc, DbEnv.is_alive and for the + * DB_MUTEX structure. + */ +#define DB_MUTEX_ALLOCATED 0x01 /* Mutex currently allocated. */ +#define DB_MUTEX_LOCKED 0x02 /* Mutex currently locked. */ +#define DB_MUTEX_LOGICAL_LOCK 0x04 /* Mutex backs a database lock. */ +#define DB_MUTEX_PROCESS_ONLY 0x08 /* Mutex private to a process. */ +#define DB_MUTEX_SELF_BLOCK 0x10 /* Must be able to block self. */ + +struct __db_mutex_stat { + /* The following fields are maintained in the region's copy. */ + u_int32_t st_mutex_align; /* Mutex alignment */ + u_int32_t st_mutex_tas_spins; /* Mutex test-and-set spins */ + u_int32_t st_mutex_cnt; /* Mutex count */ + u_int32_t st_mutex_free; /* Available mutexes */ + u_int32_t st_mutex_inuse; /* Mutexes in use */ + u_int32_t st_mutex_inuse_max; /* Maximum mutexes ever in use */ + + /* The following fields are filled-in from other places. */ + u_int32_t st_region_wait; /* Region lock granted after wait. */ + u_int32_t st_region_nowait; /* Region lock granted without wait. */ + roff_t st_regsize; /* Region size. */ +}; + +/* This is the length of the buffer passed to DB_ENV->thread_id_string() */ +#define DB_THREADID_STRLEN 128 /******************************************************* * Locking. @@ -383,10 +456,9 @@ struct __db_dbt { #define DB_LOCK_ABORT 0x001 /* Internal: Lock during abort. */ #define DB_LOCK_NOWAIT 0x002 /* Don't wait on unavailable lock. */ #define DB_LOCK_RECORD 0x004 /* Internal: record lock. */ -#define DB_LOCK_REMOVE 0x008 /* Internal: flag object removed. */ -#define DB_LOCK_SET_TIMEOUT 0x010 /* Internal: set lock timeout. */ -#define DB_LOCK_SWITCH 0x020 /* Internal: switch existing lock. */ -#define DB_LOCK_UPGRADE 0x040 /* Internal: upgrade existing lock. */ +#define DB_LOCK_SET_TIMEOUT 0x008 /* Internal: set lock timeout. */ +#define DB_LOCK_SWITCH 0x010 /* Internal: switch existing lock. */ +#define DB_LOCK_UPGRADE 0x020 /* Internal: upgrade existing lock. */ /* * Simple R/W lock modes and for multi-granularity intention locking. @@ -404,7 +476,7 @@ typedef enum { DB_LOCK_IWRITE=4, /* Intent exclusive/write. */ DB_LOCK_IREAD=5, /* Intent to share/read. */ DB_LOCK_IWR=6, /* Intent to read and write. */ - DB_LOCK_DIRTY=7, /* Dirty Read. */ + DB_LOCK_READ_UNCOMMITTED=7, /* Degree 1 isolation. */ DB_LOCK_WWRITE=8 /* Was Written. */ } db_lockmode_t; @@ -433,12 +505,10 @@ typedef enum { DB_LSTAT_EXPIRED=2, /* Lock has expired. */ DB_LSTAT_FREE=3, /* Lock is unallocated. */ DB_LSTAT_HELD=4, /* Lock is currently held. */ - DB_LSTAT_NOTEXIST=5, /* Object on which lock was waiting - * was removed */ - DB_LSTAT_PENDING=6, /* Lock was waiting and has been + DB_LSTAT_PENDING=5, /* Lock was waiting and has been * promoted; waiting for the owner * to run and upgrade it to held. */ - DB_LSTAT_WAITING=7 /* Lock is on the wait queue. */ + DB_LSTAT_WAITING=6 /* Lock is on the wait queue. */ }db_status_t; /* Lock statistics structure. */ @@ -455,11 +525,12 @@ struct __db_lock_stat { u_int32_t st_maxnlockers; /* Maximum number of lockers so far. */ u_int32_t st_nobjects; /* Current number of objects. */ u_int32_t st_maxnobjects; /* Maximum number of objects so far. */ - u_int32_t st_nconflicts; /* Number of lock conflicts. */ u_int32_t st_nrequests; /* Number of lock gets. */ u_int32_t st_nreleases; /* Number of lock puts. */ - u_int32_t st_nnowaits; /* Number of requests that would have - waited, but NOWAIT was set. */ + u_int32_t st_nupgrade; /* Number of lock upgrades. */ + u_int32_t st_ndowngrade; /* Number of lock downgrades. */ + u_int32_t st_lock_wait; /* Lock conflicts w/ subsequent wait */ + u_int32_t st_lock_nowait; /* Lock conflicts w/o subsequent wait */ u_int32_t st_ndeadlocks; /* Number of lock deadlocks. */ db_timeout_t st_locktimeout; /* Lock timeout. */ u_int32_t st_nlocktimeouts; /* Number of lock timeouts. */ @@ -508,8 +579,8 @@ struct __db_lockreq { /******************************************************* * Logging. *******************************************************/ -#define DB_LOGVERSION 10 /* Current log version. */ -#define DB_LOGOLDVER 10 /* Oldest log version supported. */ +#define DB_LOGVERSION 12 /* Current log version. */ +#define DB_LOGOLDVER 8 /* Oldest log version supported. */ #define DB_LOGMAGIC 0x040988 /* Flag values for DB_ENV->log_archive(). */ @@ -524,9 +595,7 @@ struct __db_lockreq { #define DB_LOG_COMMIT 0x004 /* Flush supports a commit */ #define DB_LOG_NOCOPY 0x008 /* Don't copy data */ #define DB_LOG_NOT_DURABLE 0x010 /* Do not log; keep in memory */ -#define DB_LOG_PERM 0x020 /* Flag record with REP_PERMANENT */ -#define DB_LOG_RESEND 0x040 /* Resent log record */ -#define DB_LOG_WRNOSYNC 0x080 /* Write, don't sync log_put */ +#define DB_LOG_WRNOSYNC 0x020 /* Write, don't sync log_put */ /* * A DB_LSN has two parts, a fileid which identifies a specific file, and an @@ -567,8 +636,9 @@ struct __db_log_cursor { u_int32_t c_prev; /* Cursor: previous record's offset */ DBT c_dbt; /* Return DBT. */ + DB_LSN p_lsn; /* Persist LSN. */ + u_int32_t p_version; /* Persist version. */ -#define DB_LOGC_BUF_SIZE (32 * 1024) u_int8_t *bp; /* Allocated read buffer. */ u_int32_t bp_size; /* Read buffer length in bytes. */ u_int32_t bp_rlen; /* Read buffer valid data length. */ @@ -576,9 +646,11 @@ struct __db_log_cursor { u_int32_t bp_maxrec; /* Max record length in the log file. */ - /* Methods. */ + /* DB_LOGC PUBLIC HANDLE LIST BEGIN */ int (*close) __P((DB_LOGC *, u_int32_t)); int (*get) __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t)); + int (*version) __P((DB_LOGC *, u_int32_t *, u_int32_t)); + /* DB_LOGC PUBLIC HANDLE LIST END */ #define DB_LOG_DISK 0x01 /* Log record came from disk. */ #define DB_LOG_LOCKED 0x02 /* Log region already locked */ @@ -590,15 +662,17 @@ struct __db_log_cursor { struct __db_log_stat { u_int32_t st_magic; /* Log file magic number. */ u_int32_t st_version; /* Log file version number. */ - int st_mode; /* Log file mode. */ + int st_mode; /* Log file permissions mode. */ u_int32_t st_lg_bsize; /* Log buffer size. */ u_int32_t st_lg_size; /* Log file size. */ + u_int32_t st_record; /* Records entered into the log. */ u_int32_t st_w_bytes; /* Bytes to log. */ u_int32_t st_w_mbytes; /* Megabytes to log. */ u_int32_t st_wc_bytes; /* Bytes to log since checkpoint. */ u_int32_t st_wc_mbytes; /* Megabytes to log since checkpoint. */ - u_int32_t st_wcount; /* Total writes to the log. */ + u_int32_t st_wcount; /* Total I/O writes to the log. */ u_int32_t st_wcount_fill; /* Overflow writes to the log. */ + u_int32_t st_rcount; /* Total I/O reads from the log. */ u_int32_t st_scount; /* Total syncs to the log. */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ @@ -612,26 +686,28 @@ struct __db_log_stat { }; /* - * We need to record the first log record of a transaction. - * For user defined logging this macro returns the place to - * put that information, if it is need in rlsnp, otherwise it - * leaves it unchanged. + * We need to record the first log record of a transaction. For user + * defined logging this macro returns the place to put that information, + * if it is need in rlsnp, otherwise it leaves it unchanged. We also + * need to track the last record of the transaction, this returns the + * place to put that info. */ -#define DB_SET_BEGIN_LSNP(txn, rlsnp) ((txn)->set_begin_lsnp(txn, rlsnp)) +#define DB_SET_TXN_LSNP(txn, blsnp, llsnp) \ + ((txn)->set_txn_lsnp(txn, blsnp, llsnp)) /******************************************************* * Shared buffer cache (mpool). *******************************************************/ /* Flag values for DB_MPOOLFILE->get. */ #define DB_MPOOL_CREATE 0x001 /* Create a page. */ -#define DB_MPOOL_LAST 0x002 /* Return the last page. */ -#define DB_MPOOL_NEW 0x004 /* Create a new page. */ +#define DB_MPOOL_DIRTY 0x002 /* Get page for an update. */ +#define DB_MPOOL_EDIT 0x004 /* Modify without copying. */ +#define DB_MPOOL_FREE 0x008 /* Free page if present. */ +#define DB_MPOOL_LAST 0x010 /* Return the last page. */ +#define DB_MPOOL_NEW 0x020 /* Create a new page. */ /* Flag values for DB_MPOOLFILE->put, DB_MPOOLFILE->set. */ -#define DB_MPOOL_CLEAN 0x001 /* Page is not modified. */ -#define DB_MPOOL_DIRTY 0x002 /* Page is modified. */ -#define DB_MPOOL_DISCARD 0x004 /* Don't cache the page. */ -#define DB_MPOOL_FREE 0x008 /* Free page if present. */ +#define DB_MPOOL_DISCARD 0x001 /* Don't cache the page. */ /* Flags values for DB_MPOOLFILE->set_flags. */ #define DB_MPOOL_NOFILE 0x001 /* Never open a backing file. */ @@ -688,17 +764,17 @@ struct __db_mpoolfile { int32_t lsn_offset; /* LSN offset in page. */ u_int32_t gbytes, bytes; /* Maximum file size. */ DBT *pgcookie; /* Byte-string passed to pgin/pgout. */ - DB_CACHE_PRIORITY /* Cache priority. */ - priority; + int32_t priority; /* Cache priority. */ void *addr; /* Address of mmap'd region. */ size_t len; /* Length of mmap'd region. */ u_int32_t config_flags; /* Flags to DB_MPOOLFILE->set_flags. */ - /* Methods. */ + /* DB_MPOOLFILE PUBLIC HANDLE LIST BEGIN */ int (*close) __P((DB_MPOOLFILE *, u_int32_t)); - int (*get) __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *)); + int (*get) + __P((DB_MPOOLFILE *, db_pgno_t *, DB_TXN *, u_int32_t, void *)); int (*open) __P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t)); int (*put) __P((DB_MPOOLFILE *, void *, u_int32_t)); int (*set) __P((DB_MPOOLFILE *, void *, u_int32_t)); @@ -719,6 +795,7 @@ struct __db_mpoolfile { int (*get_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY *)); int (*set_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY)); int (*sync) __P((DB_MPOOLFILE *)); + /* DB_MPOOLFILE PUBLIC HANDLE LIST END */ /* * MP_FILEID_SET, MP_OPEN_CALLED and MP_READONLY do not need to be @@ -730,8 +807,9 @@ struct __db_mpoolfile { */ #define MP_FILEID_SET 0x001 /* Application supplied a file ID. */ #define MP_FLUSH 0x002 /* Was opened to flush a buffer. */ -#define MP_OPEN_CALLED 0x004 /* File opened. */ -#define MP_READONLY 0x008 /* File is readonly. */ +#define MP_MULTIVERSION 0x004 /* Opened for multiversion access. */ +#define MP_OPEN_CALLED 0x008 /* File opened. */ +#define MP_READONLY 0x010 /* File is readonly. */ u_int32_t flags; }; @@ -763,14 +841,19 @@ struct __db_mpool_stat { u_int32_t st_hash_examined; /* Total hash entries searched. */ u_int32_t st_hash_nowait; /* Hash lock granted with nowait. */ u_int32_t st_hash_wait; /* Hash lock granted after wait. */ + u_int32_t st_hash_max_nowait; /* Max hash lock granted with nowait. */ u_int32_t st_hash_max_wait; /* Max hash lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted with nowait. */ u_int32_t st_region_wait; /* Region lock granted after wait. */ + u_int32_t st_mvcc_frozen; /* Buffers frozen. */ + u_int32_t st_mvcc_thawed; /* Buffers thawed. */ + u_int32_t st_mvcc_freed; /* Frozen buffers freed. */ u_int32_t st_alloc; /* Number of page allocations. */ u_int32_t st_alloc_buckets; /* Buckets checked during allocation. */ u_int32_t st_alloc_max_buckets; /* Max checked during allocation. */ u_int32_t st_alloc_pages; /* Pages checked during allocation. */ u_int32_t st_alloc_max_pages; /* Max checked during allocation. */ + u_int32_t st_io_wait; /* Thread waited on buffer I/O. */ }; /* Mpool file statistics structure. */ @@ -814,12 +897,14 @@ typedef enum { struct __db_txn { DB_TXNMGR *mgrp; /* Pointer to transaction manager. */ DB_TXN *parent; /* Pointer to transaction's parent. */ - DB_LSN last_lsn; /* Lsn of last log write. */ + u_int32_t txnid; /* Unique transaction id. */ - u_int32_t tid; /* Thread id for use in MT XA. */ - roff_t off; /* Detail structure within region. */ + char *name; /* Transaction name */ + + db_threadid_t tid; /* Thread id for use in MT XA. */ + void *td; /* Detail structure within region. */ db_timeout_t lock_timeout; /* Timeout for locks for this txn. */ - db_timeout_t expire; /* Time this txn expires. */ + db_timeout_t expire; /* Time transaction expires. */ void *txn_list; /* Undo information for parent. */ /* @@ -837,6 +922,16 @@ struct __db_txn { struct __db_txn **tqe_prev; } xalinks; /* Links active XA transactions. */ + /* + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_HEAD(__kids, __db_txn) kids; + */ + struct __kids { + struct __db_txn *tqh_first; + struct __db_txn **tqh_last; + } kids; + /* * !!! * Explicit representations of structures from queue.h. @@ -857,16 +952,6 @@ struct __db_txn { struct __txn_logrec **stqh_last; } logs; /* Links deferred events. */ - /* - * !!! - * Explicit representations of structures from queue.h. - * TAILQ_HEAD(__kids, __db_txn) kids; - */ - struct __kids { - struct __db_txn *tqh_first; - struct __db_txn **tqh_last; - } kids; - /* * !!! * Explicit representations of structures from queue.h. @@ -882,32 +967,44 @@ struct __db_txn { u_int32_t cursors; /* Number of cursors open for txn */ - /* Methods. */ + /* DB_TXN PUBLIC HANDLE LIST BEGIN */ int (*abort) __P((DB_TXN *)); int (*commit) __P((DB_TXN *, u_int32_t)); int (*discard) __P((DB_TXN *, u_int32_t)); + int (*get_name) __P((DB_TXN *, const char **)); u_int32_t (*id) __P((DB_TXN *)); int (*prepare) __P((DB_TXN *, u_int8_t *)); - void (*set_begin_lsnp) __P((DB_TXN *txn, DB_LSN **)); + int (*set_name) __P((DB_TXN *, const char *)); int (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t)); - -#define TXN_CHILDCOMMIT 0x001 /* Transaction that has committed. */ -#define TXN_COMPENSATE 0x002 /* Compensating transaction. */ -#define TXN_DEADLOCK 0x004 /* Transaction has deadlocked. */ -#define TXN_DEGREE_2 0x008 /* Has degree 2 isolation. */ -#define TXN_DIRTY_READ 0x010 /* Transaction does dirty reads. */ -#define TXN_LOCKTIMEOUT 0x020 /* Transaction has a lock timeout. */ -#define TXN_MALLOC 0x040 /* Structure allocated by TXN system. */ -#define TXN_NOSYNC 0x080 /* Do not sync on prepare and commit. */ -#define TXN_NOWAIT 0x100 /* Do not wait on locks. */ -#define TXN_RESTORED 0x200 /* Transaction has been restored. */ -#define TXN_SYNC 0x400 /* Sync on prepare and commit. */ + /* DB_TXN PUBLIC HANDLE LIST END */ + + /* DB_TXN PRIVATE HANDLE LIST BEGIN */ + void (*set_txn_lsnp) __P((DB_TXN *txn, DB_LSN **, DB_LSN **)); + /* DB_TXN PRIVATE HANDLE LIST END */ + +#define TXN_CHILDCOMMIT 0x0001 /* Txn has committed. */ +#define TXN_CDSGROUP 0x0002 /* CDS group handle. */ +#define TXN_COMPENSATE 0x0004 /* Compensating transaction. */ +#define TXN_DEADLOCK 0x0008 /* Txn has deadlocked. */ +#define TXN_LOCKTIMEOUT 0x0010 /* Txn has a lock timeout. */ +#define TXN_MALLOC 0x0020 /* Structure allocated by TXN system. */ +#define TXN_NOSYNC 0x0040 /* Do not sync on prepare and commit. */ +#define TXN_NOWAIT 0x0080 /* Do not wait on locks. */ +#define TXN_PRIVATE 0x0100 /* Txn owned by cursor.. */ +#define TXN_READ_COMMITTED 0x0200 /* Txn has degree 2 isolation. */ +#define TXN_READ_UNCOMMITTED 0x0400 /* Txn has degree 1 isolation. */ +#define TXN_RESTORED 0x0800 /* Txn has been restored. */ +#define TXN_SNAPSHOT 0x1000 /* Snapshot Isolation. */ +#define TXN_SYNC 0x2000 /* Write and sync on prepare/commit. */ +#define TXN_WRITE_NOSYNC 0x4000 /* Write only on prepare/commit. */ u_int32_t flags; }; +#define TXN_SYNC_FLAGS (TXN_SYNC | TXN_NOSYNC | TXN_WRITE_NOSYNC) + /* * Structure used for two phase commit interface. Berkeley DB support for two - * phase commit is compatible with the X/open XA interface. + * phase commit is compatible with the X/Open XA interface. * * The XA #define XIDDATASIZE defines the size of a global transaction ID. We * have our own version here (for name space reasons) which must have the same @@ -923,9 +1020,30 @@ struct __db_preplist { struct __db_txn_active { u_int32_t txnid; /* Transaction ID */ u_int32_t parentid; /* Transaction ID of parent */ + pid_t pid; /* Process owning txn ID */ + db_threadid_t tid; /* Thread owning txn ID */ + DB_LSN lsn; /* LSN when transaction began */ + + DB_LSN read_lsn; /* Read LSN for MVCC */ + u_int32_t mvcc_ref; /* MVCC reference count */ + +#define TXN_ABORTED 1 +#define TXN_COMMITTED 2 +#define TXN_PREPARED 3 +#define TXN_RUNNING 4 + u_int32_t status; /* Status of the transaction */ + +#define TXN_XA_ABORTED 1 +#define TXN_XA_DEADLOCKED 2 +#define TXN_XA_ENDED 3 +#define TXN_XA_PREPARED 4 +#define TXN_XA_STARTED 5 +#define TXN_XA_SUSPENDED 6 u_int32_t xa_status; /* XA status */ - u_int8_t xid[DB_XIDDATASIZE]; /* XA global transaction ID */ + + u_int8_t xid[DB_XIDDATASIZE]; /* Global transaction ID */ + char name[51]; /* 50 bytes of name, nul termination */ }; struct __db_txn_stat { @@ -937,9 +1055,11 @@ struct __db_txn_stat { u_int32_t st_nbegins; /* number of begun transactions */ u_int32_t st_ncommits; /* number of committed transactions */ u_int32_t st_nactive; /* number of active transactions */ + u_int32_t st_nsnapshot; /* number of snapshot transactions */ u_int32_t st_nrestores; /* number of restored transactions after recovery. */ u_int32_t st_maxnactive; /* maximum active transactions */ + u_int32_t st_maxnsnapshot; /* maximum snapshot transactions */ DB_TXN_ACTIVE *st_txnarray; /* array of active transactions */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ @@ -953,9 +1073,60 @@ struct __db_txn_stat { #define DB_EID_BROADCAST -1 #define DB_EID_INVALID -2 -/* rep_start flags values */ -#define DB_REP_CLIENT 0x001 -#define DB_REP_MASTER 0x002 +/* rep_config flag values. */ +#define DB_REP_CONF_BULK 0x0001 /* Bulk transfer. */ +#define DB_REP_CONF_DELAYCLIENT 0x0002 /* Delay client synchronization. */ +#define DB_REP_CONF_NOAUTOINIT 0x0004 /* No automatic client init. */ +#define DB_REP_CONF_NOWAIT 0x0008 /* Don't wait, return error. */ + +/* + * Operation code values for rep_start and/or repmgr_start. Just one of the + * following values should be passed in the flags parameter. (If we ever need + * additional, independent bit flags for these methods, we can start allocating + * them from the high-order byte of the flags word, as we currently do elsewhere + * for DB_AFTER through DB_WRITELOCK and DB_AUTO_COMMIT, etc.) + */ +#define DB_REP_CLIENT 1 +#define DB_REP_ELECTION 2 +#define DB_REP_FULL_ELECTION 3 +#define DB_REP_MASTER 4 + +/* Acknowledgement policies. */ +#define DB_REPMGR_ACKS_ALL 1 +#define DB_REPMGR_ACKS_ALL_PEERS 2 +#define DB_REPMGR_ACKS_NONE 3 +#define DB_REPMGR_ACKS_ONE 4 +#define DB_REPMGR_ACKS_ONE_PEER 5 +#define DB_REPMGR_ACKS_QUORUM 6 + +/* Replication Framework timeout configuration values. */ +#define DB_REP_ACK_TIMEOUT 1 +#define DB_REP_ELECTION_TIMEOUT 2 +#define DB_REP_ELECTION_RETRY 3 +#define DB_REP_CONNECTION_RETRY 4 + +/* Event notification types. */ +#define DB_EVENT_NO_SUCH_EVENT 0 /* out-of-band sentinel value */ +#define DB_EVENT_PANIC 1 +#define DB_EVENT_REP_CLIENT 2 +#define DB_EVENT_REP_MASTER 3 +#define DB_EVENT_REP_NEWMASTER 4 +#define DB_EVENT_REP_STARTUPDONE 5 +#define DB_EVENT_WRITE_FAILED 6 + +/* Flag value for repmgr_add_remote_site. */ +#define DB_REPMGR_PEER 0x01 + +/* Replication Manager site status. */ +struct __db_repmgr_site { + int eid; + char *host; + u_int port; + +#define DB_REPMGR_CONNECTED 0x01 +#define DB_REPMGR_DISCONNECTED 0x02 + u_int32_t status; +}; /* Replication statistics. */ struct __db_rep_stat { @@ -978,6 +1149,15 @@ struct __db_rep_stat { condition was detected.+ */ int st_env_id; /* Current environment ID. */ int st_env_priority; /* Current environment priority. */ + u_int32_t st_bulk_fills; /* Bulk buffer fills. */ + u_int32_t st_bulk_overflows; /* Bulk buffer overflows. */ + u_int32_t st_bulk_records; /* Bulk records stored. */ + u_int32_t st_bulk_transfers; /* Transfers of bulk buffers. */ + u_int32_t st_client_rerequests; /* Number of forced rerequests. */ + u_int32_t st_client_svc_req; /* Number of client service requests + received by this client. */ + u_int32_t st_client_svc_miss; /* Number of client service requests + missing on this client. */ u_int32_t st_gen; /* Current generation number. */ u_int32_t st_egen; /* Current election gen number. */ u_int32_t st_log_duplicated; /* Log records received multiply.+ */ @@ -1020,7 +1200,13 @@ struct __db_rep_stat { int st_election_status; /* Current election status. */ u_int32_t st_election_tiebreaker;/* Election tiebreaker value. */ int st_election_votes; /* Votes received in this round. */ + u_int32_t st_election_sec; /* Last election time seconds. */ + u_int32_t st_election_usec; /* Last election time useconds. */ }; + +/******************************************************* + * Sequences. + *******************************************************/ /* * The storage record for a sequence. */ @@ -1030,6 +1216,7 @@ struct __db_seq_record { #define DB_SEQ_INC 0x00000002 /* Increment sequence. */ #define DB_SEQ_RANGE_SET 0x00000004 /* Range set (internal). */ #define DB_SEQ_WRAP 0x00000008 /* Wrap sequence at min/max. */ +#define DB_SEQ_WRAPPED 0x00000010 /* Just wrapped (internal). */ u_int32_t flags; /* Flags. */ db_seq_t seq_value; /* Current value. */ db_seq_t seq_max; /* Max permitted. */ @@ -1041,7 +1228,7 @@ struct __db_seq_record { */ struct __db_sequence { DB *seq_dbp; /* DB handle for this sequence. */ - DB_MUTEX *seq_mutexp; /* Mutex if sequence is threaded. */ + db_mutex_t mtx_seq; /* Mutex if sequence is threaded. */ DB_SEQ_RECORD *seq_rp; /* Pointer to current data. */ DB_SEQ_RECORD seq_record; /* Data from DB_SEQUENCE. */ int32_t seq_cache_size; /* Number of values cached. */ @@ -1052,6 +1239,7 @@ struct __db_sequence { /* API-private structure: used by C++ and Java. */ void *api_internal; + /* DB_SEQUENCE PUBLIC HANDLE LIST BEGIN */ int (*close) __P((DB_SEQUENCE *, u_int32_t)); int (*get) __P((DB_SEQUENCE *, DB_TXN *, int32_t, db_seq_t *, u_int32_t)); @@ -1071,18 +1259,19 @@ struct __db_sequence { int (*stat) __P((DB_SEQUENCE *, DB_SEQUENCE_STAT **, u_int32_t)); int (*stat_print) __P((DB_SEQUENCE *, u_int32_t)); + /* DB_SEQUENCE PUBLIC HANDLE LIST END */ }; struct __db_seq_stat { - u_int32_t st_wait; /* Sequence lock granted without wait. */ - u_int32_t st_nowait; /* Sequence lock granted after wait. */ - db_seq_t st_current; /* Current value in db. */ - db_seq_t st_value; /* Current cached value. */ - db_seq_t st_last_value; /* Last cached value. */ - db_seq_t st_min; /* Minimum value. */ - db_seq_t st_max; /* Maximum value. */ - int32_t st_cache_size; /* Cache size. */ - u_int32_t st_flags; /* Flag value. */ + u_int32_t st_wait; /* Sequence lock granted w/o wait. */ + u_int32_t st_nowait; /* Sequence lock granted after wait. */ + db_seq_t st_current; /* Current value in db. */ + db_seq_t st_value; /* Current cached value. */ + db_seq_t st_last_value; /* Last cached value. */ + db_seq_t st_min; /* Minimum value. */ + db_seq_t st_max; /* Maximum value. */ + int32_t st_cache_size; /* Cache size. */ + u_int32_t st_flags; /* Flag value. */ }; /******************************************************* @@ -1110,7 +1299,8 @@ typedef enum { #define DB_QAMOLDVER 3 /* Oldest queue version supported. */ #define DB_QAMMAGIC 0x042253 -#define DB_SEQUENCE_VERSION 1 /* Current sequence version. */ +#define DB_SEQUENCE_VERSION 2 /* Current sequence version. */ +#define DB_SEQUENCE_OLDVER 1 /* Oldest sequence version supported. */ /* * DB access method and cursor operation values. Each value is an operation @@ -1119,62 +1309,56 @@ typedef enum { #define DB_AFTER 1 /* c_put() */ #define DB_APPEND 2 /* put() */ #define DB_BEFORE 3 /* c_put() */ -#define DB_CACHED_COUNTS 4 /* stat() */ -#define DB_CONSUME 5 /* get() */ -#define DB_CONSUME_WAIT 6 /* get() */ -#define DB_CURRENT 7 /* c_get(), c_put(), DB_LOGC->get() */ -#define DB_FAST_STAT 8 /* stat() */ -#define DB_FIRST 9 /* c_get(), DB_LOGC->get() */ -#define DB_GET_BOTH 10 /* get(), c_get() */ -#define DB_GET_BOTHC 11 /* c_get() (internal) */ -#define DB_GET_BOTH_RANGE 12 /* get(), c_get() */ -#define DB_GET_RECNO 13 /* c_get() */ -#define DB_JOIN_ITEM 14 /* c_get(); do not do primary lookup */ -#define DB_KEYFIRST 15 /* c_put() */ -#define DB_KEYLAST 16 /* c_put() */ -#define DB_LAST 17 /* c_get(), DB_LOGC->get() */ -#define DB_NEXT 18 /* c_get(), DB_LOGC->get() */ -#define DB_NEXT_DUP 19 /* c_get() */ -#define DB_NEXT_NODUP 20 /* c_get() */ -#define DB_NODUPDATA 21 /* put(), c_put() */ -#define DB_NOOVERWRITE 22 /* put() */ -#define DB_NOSYNC 23 /* close() */ -#define DB_POSITION 24 /* c_dup() */ -#define DB_PREV 25 /* c_get(), DB_LOGC->get() */ -#define DB_PREV_NODUP 26 /* c_get(), DB_LOGC->get() */ -#define DB_RECORDCOUNT 27 /* stat() */ -#define DB_SET 28 /* c_get(), DB_LOGC->get() */ -#define DB_SET_LOCK_TIMEOUT 29 /* set_timout() */ -#define DB_SET_RANGE 30 /* c_get() */ -#define DB_SET_RECNO 31 /* get(), c_get() */ -#define DB_SET_TXN_NOW 32 /* set_timout() (internal) */ -#define DB_SET_TXN_TIMEOUT 33 /* set_timout() */ -#define DB_UPDATE_SECONDARY 34 /* c_get(), c_del() (internal) */ -#define DB_WRITECURSOR 35 /* cursor() */ -#define DB_WRITELOCK 36 /* cursor() (internal) */ +#define DB_CONSUME 4 /* get() */ +#define DB_CONSUME_WAIT 5 /* get() */ +#define DB_CURRENT 6 /* c_get(), c_put(), DB_LOGC->get() */ +#define DB_FIRST 7 /* c_get(), DB_LOGC->get() */ +#define DB_GET_BOTH 8 /* get(), c_get() */ +#define DB_GET_BOTHC 9 /* c_get() (internal) */ +#define DB_GET_BOTH_RANGE 10 /* get(), c_get() */ +#define DB_GET_RECNO 11 /* c_get() */ +#define DB_JOIN_ITEM 12 /* c_get(); do not do primary lookup */ +#define DB_KEYFIRST 13 /* c_put() */ +#define DB_KEYLAST 14 /* c_put() */ +#define DB_LAST 15 /* c_get(), DB_LOGC->get() */ +#define DB_NEXT 16 /* c_get(), DB_LOGC->get() */ +#define DB_NEXT_DUP 17 /* c_get() */ +#define DB_NEXT_NODUP 18 /* c_get() */ +#define DB_NODUPDATA 19 /* put(), c_put() */ +#define DB_NOOVERWRITE 20 /* put() */ +#define DB_NOSYNC 21 /* close() */ +#define DB_POSITION 22 /* c_dup() */ +#define DB_PREV 23 /* c_get(), DB_LOGC->get() */ +#define DB_PREV_NODUP 24 /* c_get(), DB_LOGC->get() */ +#define DB_SET 25 /* c_get(), DB_LOGC->get() */ +#define DB_SET_LOCK_TIMEOUT 26 /* set_timout() */ +#define DB_SET_RANGE 27 /* c_get() */ +#define DB_SET_RECNO 28 /* get(), c_get() */ +#define DB_SET_TXN_NOW 29 /* set_timout() (internal) */ +#define DB_SET_TXN_TIMEOUT 30 /* set_timout() */ +#define DB_UPDATE_SECONDARY 31 /* c_get(), c_del() (internal) */ +#define DB_WRITECURSOR 32 /* cursor() */ +#define DB_WRITELOCK 33 /* cursor() (internal) */ /* This has to change when the max opcode hits 255. */ #define DB_OPFLAGS_MASK 0x000000ff /* Mask for operations flags. */ /* * Masks for flags that can be OR'd into DB access method and cursor - * operation values. + * operation values. Three top bits have already been taken: * - * DB_DIRTY_READ 0x04000000 Dirty Read. */ -#define DB_MULTIPLE 0x08000000 /* Return multiple data values. */ -#define DB_MULTIPLE_KEY 0x10000000 /* Return multiple data/key pairs. */ -#define DB_RMW 0x20000000 /* Acquire write flag immediately. */ + * DB_AUTO_COMMIT 0x02000000 + * DB_READ_COMMITTED 0x04000000 + * DB_READ_UNCOMMITTED 0x08000000 + */ +#define DB_MULTIPLE 0x10000000 /* Return multiple data values. */ +#define DB_MULTIPLE_KEY 0x20000000 /* Return multiple data/key pairs. */ +#define DB_RMW 0x40000000 /* Acquire write lock immediately. */ /* * DB (user visible) error return codes. * * !!! - * For source compatibility with DB 2.X deadlock return (EAGAIN), use the - * following: - * #include - * #define DB_LOCK_DEADLOCK EAGAIN - * - * !!! * We don't want our error returns to conflict with other packages where * possible, so pick a base error value that's hopefully not common. We * document that we own the error name space from -30,800 to -30,999. @@ -1196,22 +1380,24 @@ typedef enum { #define DB_REP_DUPMASTER (-30986)/* There are two masters. */ #define DB_REP_HANDLE_DEAD (-30985)/* Rolled back a commit. */ #define DB_REP_HOLDELECTION (-30984)/* Time to hold an election. */ -#define DB_REP_ISPERM (-30983)/* Cached not written perm written.*/ -#define DB_REP_NEWMASTER (-30982)/* We have learned of a new master. */ -#define DB_REP_NEWSITE (-30981)/* New site entered system. */ -#define DB_REP_NOTPERM (-30980)/* Permanent log record not written. */ -#define DB_REP_STARTUPDONE (-30979)/* Client startup complete. */ -#define DB_REP_UNAVAIL (-30978)/* Site cannot currently be reached. */ -#define DB_RUNRECOVERY (-30977)/* Panic return. */ -#define DB_SECONDARY_BAD (-30976)/* Secondary index corrupt. */ -#define DB_VERIFY_BAD (-30975)/* Verify failed; bad format. */ -#define DB_VERSION_MISMATCH (-30974)/* Environment version mismatch. */ +#define DB_REP_IGNORE (-30983)/* This msg should be ignored.*/ +#define DB_REP_ISPERM (-30982)/* Cached not written perm written.*/ +#define DB_REP_JOIN_FAILURE (-30981)/* Unable to join replication group. */ +#define DB_REP_LOCKOUT (-30980)/* API/Replication lockout now. */ +#define DB_REP_NEWMASTER (-30979)/* We have learned of a new master. */ +#define DB_REP_NEWSITE (-30978)/* New site entered system. */ +#define DB_REP_NOTPERM (-30977)/* Permanent log record not written. */ +#define DB_REP_UNAVAIL (-30976)/* Site cannot currently be reached. */ +#define DB_RUNRECOVERY (-30975)/* Panic return. */ +#define DB_SECONDARY_BAD (-30974)/* Secondary index corrupt. */ +#define DB_VERIFY_BAD (-30973)/* Verify failed; bad format. */ +#define DB_VERSION_MISMATCH (-30972)/* Environment version mismatch. */ /* DB (private) error return codes. */ #define DB_ALREADY_ABORTED (-30899) #define DB_DELETED (-30898)/* Recovery file marked deleted. */ -#define DB_LOCK_NOTEXIST (-30897)/* Object to lock is gone. */ -#define DB_NEEDSPLIT (-30896)/* Page needs to be split. */ +#define DB_NEEDSPLIT (-30897)/* Page needs to be split. */ +#define DB_REP_BULKOVF (-30896)/* Rep bulk buffer overflow. */ #define DB_REP_EGENCHG (-30895)/* Egen changed while in election. */ #define DB_REP_LOGREADY (-30894)/* Rep log ready for recovery. */ #define DB_REP_PAGEDONE (-30893)/* This page was already done. */ @@ -1245,7 +1431,7 @@ struct __db { DB_MPOOLFILE *mpf; /* Backing buffer pool. */ - DB_MUTEX *mutexp; /* Synchronization for free threading */ + db_mutex_t mutex; /* Synchronization for free threading */ char *fname, *dname; /* File/database passed to DB->open. */ u_int32_t open_flags; /* Flags passed to DB->open. */ @@ -1261,11 +1447,12 @@ struct __db { u_int32_t lid; /* Locker id for handle locking. */ u_int32_t cur_lid; /* Current handle lock holder. */ u_int32_t associate_lid; /* Locker id for DB->associate call. */ - DB_LOCK handle_lock; /* Lock held on this handle. */ + DB_LOCK handle_lock; /* Lock held on this handle. */ u_int cl_id; /* RPC: remote client id. */ time_t timestamp; /* Handle timestamp for replication. */ + u_int32_t fid_gen; /* Rep generation number for fids. */ /* * Returned data memory for DB->get() and friends. @@ -1295,11 +1482,11 @@ struct __db { * * !!! * Explicit representations of structures from queue.h. - * LIST_ENTRY(__db) dblistlinks; + * TAILQ_ENTRY(__db) dblistlinks; */ struct { - struct __db *le_next; - struct __db **le_prev; + struct __db *tqe_next; + struct __db **tqe_prev; } dblistlinks; /* @@ -1361,6 +1548,11 @@ struct __db { /* Reference to primary -- set in the secondary. */ DB *s_primary; +#define DB_ASSOC_IMMUTABLE_KEY 0x00000001 /* Secondary key is immutable. */ + + /* Flags passed to associate -- set in the secondary. */ + u_int32_t s_assoc_flags; + /* API-private structure: used by DB 1.85, C++, Java, Perl and Tcl */ void *api_internal; @@ -1370,19 +1562,19 @@ struct __db { void *q_internal; /* Queue access method. */ void *xa_internal; /* XA. */ - /* Methods. */ - int (*associate) __P((DB *, DB_TXN *, DB *, int (*)(DB *, const DBT *, - const DBT *, DBT *), u_int32_t)); + /* DB PUBLIC HANDLE LIST BEGIN */ + int (*associate) __P((DB *, DB_TXN *, DB *, + int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t)); int (*close) __P((DB *, u_int32_t)); + int (*compact) __P((DB *, + DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *)); int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t)); int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t)); - int (*dump) __P((DB *, - const char *, int (*)(void *, const void *), void *, int, int)); void (*err) __P((DB *, int, const char *, ...)); void (*errx) __P((DB *, const char *, ...)); int (*fd) __P((DB *, int *)); int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); - int (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)); + int (*get_bt_minkey) __P((DB *, u_int32_t *)); int (*get_byteswapped) __P((DB *, int *)); int (*get_cachesize) __P((DB *, u_int32_t *, u_int32_t *, int *)); int (*get_dbname) __P((DB *, const char **, const char **)); @@ -1391,77 +1583,78 @@ struct __db { void (*get_errfile) __P((DB *, FILE **)); void (*get_errpfx) __P((DB *, const char **)); int (*get_flags) __P((DB *, u_int32_t *)); + int (*get_h_ffactor) __P((DB *, u_int32_t *)); + int (*get_h_nelem) __P((DB *, u_int32_t *)); int (*get_lorder) __P((DB *, int *)); + DB_MPOOLFILE *(*get_mpf) __P((DB *)); + void (*get_msgfile) __P((DB *, FILE **)); int (*get_open_flags) __P((DB *, u_int32_t *)); int (*get_pagesize) __P((DB *, u_int32_t *)); + int (*get_q_extentsize) __P((DB *, u_int32_t *)); + int (*get_re_delim) __P((DB *, int *)); + int (*get_re_len) __P((DB *, u_int32_t *)); + int (*get_re_pad) __P((DB *, int *)); + int (*get_re_source) __P((DB *, const char **)); int (*get_transactional) __P((DB *)); int (*get_type) __P((DB *, DBTYPE *)); int (*join) __P((DB *, DBC **, DBC **, u_int32_t)); - int (*key_range) __P((DB *, - DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)); - int (*open) __P((DB *, DB_TXN *, - const char *, const char *, DBTYPE, u_int32_t, int)); + int (*key_range) + __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)); + int (*open) __P((DB *, + DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)); + int (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)); int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int (*remove) __P((DB *, const char *, const char *, u_int32_t)); int (*rename) __P((DB *, - const char *, const char *, const char *, u_int32_t)); - int (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t)); - int (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t))); + const char *, const char *, const char *, u_int32_t)); int (*set_alloc) __P((DB *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *))); + int (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t))); + int (*set_bt_compare) + __P((DB *, int (*)(DB *, const DBT *, const DBT *))); + int (*set_bt_minkey) __P((DB *, u_int32_t)); + int (*set_bt_prefix) + __P((DB *, size_t (*)(DB *, const DBT *, const DBT *))); int (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int)); - int (*set_dup_compare) __P((DB *, - int (*)(DB *, const DBT *, const DBT *))); + int (*set_dup_compare) + __P((DB *, int (*)(DB *, const DBT *, const DBT *))); int (*set_encrypt) __P((DB *, const char *, u_int32_t)); void (*set_errcall) __P((DB *, - void (*)(const DB_ENV *, const char *, const char *))); + void (*)(const DB_ENV *, const char *, const char *))); void (*set_errfile) __P((DB *, FILE *)); void (*set_errpfx) __P((DB *, const char *)); int (*set_feedback) __P((DB *, void (*)(DB *, int, int))); int (*set_flags) __P((DB *, u_int32_t)); + int (*set_h_ffactor) __P((DB *, u_int32_t)); + int (*set_h_hash) + __P((DB *, u_int32_t (*)(DB *, const void *, u_int32_t))); + int (*set_h_nelem) __P((DB *, u_int32_t)); int (*set_lorder) __P((DB *, int)); void (*set_msgcall) __P((DB *, void (*)(const DB_ENV *, const char *))); - void (*get_msgfile) __P((DB *, FILE **)); void (*set_msgfile) __P((DB *, FILE *)); int (*set_pagesize) __P((DB *, u_int32_t)); int (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int))); - int (*stat) __P((DB *, DB_TXN *, void *, u_int32_t)); - int (*stat_print) __P((DB *, u_int32_t)); - int (*sync) __P((DB *, u_int32_t)); - int (*upgrade) __P((DB *, const char *, u_int32_t)); - int (*verify) __P((DB *, - const char *, const char *, FILE *, u_int32_t)); - - int (*get_bt_minkey) __P((DB *, u_int32_t *)); - int (*set_bt_compare) __P((DB *, - int (*)(DB *, const DBT *, const DBT *))); - int (*set_bt_maxkey) __P((DB *, u_int32_t)); - int (*set_bt_minkey) __P((DB *, u_int32_t)); - int (*set_bt_prefix) __P((DB *, - size_t (*)(DB *, const DBT *, const DBT *))); - - int (*get_h_ffactor) __P((DB *, u_int32_t *)); - int (*get_h_nelem) __P((DB *, u_int32_t *)); - int (*set_h_ffactor) __P((DB *, u_int32_t)); - int (*set_h_hash) __P((DB *, - u_int32_t (*)(DB *, const void *, u_int32_t))); - int (*set_h_nelem) __P((DB *, u_int32_t)); - - int (*get_re_delim) __P((DB *, int *)); - int (*get_re_len) __P((DB *, u_int32_t *)); - int (*get_re_pad) __P((DB *, int *)); - int (*get_re_source) __P((DB *, const char **)); + int (*set_q_extentsize) __P((DB *, u_int32_t)); int (*set_re_delim) __P((DB *, int)); int (*set_re_len) __P((DB *, u_int32_t)); int (*set_re_pad) __P((DB *, int)); int (*set_re_source) __P((DB *, const char *)); + int (*stat) __P((DB *, DB_TXN *, void *, u_int32_t)); + int (*stat_print) __P((DB *, u_int32_t)); + int (*sync) __P((DB *, u_int32_t)); + int (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t)); + int (*upgrade) __P((DB *, const char *, u_int32_t)); + int (*verify) + __P((DB *, const char *, const char *, FILE *, u_int32_t)); + /* DB PUBLIC HANDLE LIST END */ - int (*get_q_extentsize) __P((DB *, u_int32_t *)); - int (*set_q_extentsize) __P((DB *, u_int32_t)); - + /* DB PRIVATE HANDLE LIST BEGIN */ + int (*dump) __P((DB *, const char *, + int (*)(void *, const void *), void *, int, int)); int (*db_am_remove) __P((DB *, DB_TXN *, const char *, const char *)); int (*db_am_rename) __P((DB *, DB_TXN *, const char *, const char *, const char *)); + /* DB PRIVATE HANDLE LIST END */ /* * Never called; these are a place to save function pointers @@ -1476,39 +1669,45 @@ struct __db { #define DB_OK_RECNO 0x08 u_int32_t am_ok; /* Legal AM choices. */ -#define DB_AM_CHKSUM 0x00000001 /* Checksumming. */ -#define DB_AM_CL_WRITER 0x00000002 /* Allow writes in client replica. */ -#define DB_AM_COMPENSATE 0x00000004 /* Created by compensating txn. */ -#define DB_AM_CREATED 0x00000008 /* Database was created upon open. */ -#define DB_AM_CREATED_MSTR 0x00000010 /* Encompassing file was created. */ -#define DB_AM_DBM_ERROR 0x00000020 /* Error in DBM/NDBM database. */ -#define DB_AM_DELIMITER 0x00000040 /* Variable length delimiter set. */ -#define DB_AM_DIRTY 0x00000080 /* Support Dirty Reads. */ -#define DB_AM_DISCARD 0x00000100 /* Discard any cached pages. */ -#define DB_AM_DUP 0x00000200 /* DB_DUP. */ -#define DB_AM_DUPSORT 0x00000400 /* DB_DUPSORT. */ -#define DB_AM_ENCRYPT 0x00000800 /* Encryption. */ -#define DB_AM_FIXEDLEN 0x00001000 /* Fixed-length records. */ -#define DB_AM_INMEM 0x00002000 /* In-memory; no sync on close. */ -#define DB_AM_INORDER 0x00004000 /* DB_INORDER. */ -#define DB_AM_IN_RENAME 0x00008000 /* File is being renamed. */ -#define DB_AM_NOT_DURABLE 0x00010000 /* Do not log changes. */ -#define DB_AM_OPEN_CALLED 0x00020000 /* DB->open called. */ -#define DB_AM_PAD 0x00040000 /* Fixed-length record pad. */ -#define DB_AM_PGDEF 0x00080000 /* Page size was defaulted. */ -#define DB_AM_RDONLY 0x00100000 /* Database is readonly. */ -#define DB_AM_RECNUM 0x00200000 /* DB_RECNUM. */ -#define DB_AM_RECOVER 0x00400000 /* DB opened by recovery routine. */ -#define DB_AM_RENUMBER 0x00800000 /* DB_RENUMBER. */ -#define DB_AM_REPLICATION 0x01000000 /* An internal replication file. */ -#define DB_AM_REVSPLITOFF 0x02000000 /* DB_REVSPLITOFF. */ -#define DB_AM_SECONDARY 0x04000000 /* Database is a secondary index. */ -#define DB_AM_SNAPSHOT 0x08000000 /* DB_SNAPSHOT. */ -#define DB_AM_SUBDB 0x10000000 /* Subdatabases supported. */ -#define DB_AM_SWAP 0x20000000 /* Pages need to be byte-swapped. */ -#define DB_AM_TXN 0x40000000 /* Opened in a transaction. */ -#define DB_AM_VERIFYING 0x80000000 /* DB handle is in the verifier. */ - u_int32_t orig_flags; /* Flags at open, for refresh. */ + /* + * This field really ought to be an AM_FLAG, but we have + * have run out of bits. If/when we decide to split up + * the flags, we can incorporate it. + */ + int preserve_fid; /* Do not free fileid on close. */ + +#define DB_AM_CHKSUM 0x00000001 /* Checksumming */ +#define DB_AM_CL_WRITER 0x00000002 /* Allow writes in client replica */ +#define DB_AM_COMPENSATE 0x00000004 /* Created by compensating txn */ +#define DB_AM_CREATED 0x00000008 /* Database was created upon open */ +#define DB_AM_CREATED_MSTR 0x00000010 /* Encompassing file was created */ +#define DB_AM_DBM_ERROR 0x00000020 /* Error in DBM/NDBM database */ +#define DB_AM_DELIMITER 0x00000040 /* Variable length delimiter set */ +#define DB_AM_DISCARD 0x00000080 /* Discard any cached pages */ +#define DB_AM_DUP 0x00000100 /* DB_DUP */ +#define DB_AM_DUPSORT 0x00000200 /* DB_DUPSORT */ +#define DB_AM_ENCRYPT 0x00000400 /* Encryption */ +#define DB_AM_FIXEDLEN 0x00000800 /* Fixed-length records */ +#define DB_AM_INMEM 0x00001000 /* In-memory; no sync on close */ +#define DB_AM_INORDER 0x00002000 /* DB_INORDER */ +#define DB_AM_IN_RENAME 0x00004000 /* File is being renamed */ +#define DB_AM_NOT_DURABLE 0x00008000 /* Do not log changes */ +#define DB_AM_OPEN_CALLED 0x00010000 /* DB->open called */ +#define DB_AM_PAD 0x00020000 /* Fixed-length record pad */ +#define DB_AM_PGDEF 0x00040000 /* Page size was defaulted */ +#define DB_AM_RDONLY 0x00080000 /* Database is readonly */ +#define DB_AM_READ_UNCOMMITTED 0x00100000 /* Support degree 1 isolation */ +#define DB_AM_RECNUM 0x00200000 /* DB_RECNUM */ +#define DB_AM_RECOVER 0x00400000 /* DB opened by recovery routine */ +#define DB_AM_RENUMBER 0x00800000 /* DB_RENUMBER */ +#define DB_AM_REVSPLITOFF 0x01000000 /* DB_REVSPLITOFF */ +#define DB_AM_SECONDARY 0x02000000 /* Database is a secondary index */ +#define DB_AM_SNAPSHOT 0x04000000 /* DB_SNAPSHOT */ +#define DB_AM_SUBDB 0x08000000 /* Subdatabases supported */ +#define DB_AM_SWAP 0x10000000 /* Pages need to be byte-swapped */ +#define DB_AM_TXN 0x20000000 /* Opened in a transaction */ +#define DB_AM_VERIFYING 0x40000000 /* DB handle is in the verifier */ + u_int32_t orig_flags; /* Flags at open, for refresh */ u_int32_t flags; }; @@ -1610,7 +1809,7 @@ struct __dbc { DBT my_rkey; /* Space for returned [primary] key. */ DBT my_rdata; /* Space for returned data. */ - u_int32_t lid; /* Default process' locker id. */ + void *lref; /* Reference to default locker. */ u_int32_t locker; /* Locker for this operation. */ DBT lock_dbt; /* DBT referencing lock. */ DB_LOCK_ILOCK lock; /* Object to be locked. */ @@ -1622,15 +1821,17 @@ struct __dbc { DBC_INTERNAL *internal; /* Access method private. */ - int (*c_close) __P((DBC *)); /* Methods: public. */ + /* DBC PUBLIC HANDLE LIST BEGIN */ + int (*c_close) __P((DBC *)); int (*c_count) __P((DBC *, db_recno_t *, u_int32_t)); int (*c_del) __P((DBC *, u_int32_t)); int (*c_dup) __P((DBC *, DBC **, u_int32_t)); int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t)); int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t)); + /* DBC PUBLIC HANDLE LIST END */ - /* Methods: private. */ + /* DBC PRIVATE HANDLE LIST BEGIN */ int (*c_am_bulk) __P((DBC *, DBT *, u_int32_t)); int (*c_am_close) __P((DBC *, db_pgno_t, int *)); int (*c_am_del) __P((DBC *)); @@ -1638,20 +1839,29 @@ struct __dbc { int (*c_am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); int (*c_am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); int (*c_am_writelock) __P((DBC *)); + /* DBC PRIVATE HANDLE LIST END */ -#define DBC_ACTIVE 0x0001 /* Cursor in use. */ -#define DBC_COMPENSATE 0x0002 /* Cursor compensating, don't lock. */ -#define DBC_DEGREE_2 0x0004 /* Cursor has degree 2 isolation. */ -#define DBC_DIRTY_READ 0x0008 /* Cursor supports dirty reads. */ -#define DBC_OPD 0x0010 /* Cursor references off-page dups. */ -#define DBC_RECOVER 0x0020 /* Recovery cursor; don't log/lock. */ -#define DBC_RMW 0x0040 /* Acquire write flag in read op. */ -#define DBC_TRANSIENT 0x0080 /* Cursor is transient. */ -#define DBC_WRITECURSOR 0x0100 /* Cursor may be used to write (CDB). */ -#define DBC_WRITER 0x0200 /* Cursor immediately writing (CDB). */ -#define DBC_MULTIPLE 0x0400 /* Return Multiple data. */ -#define DBC_MULTIPLE_KEY 0x0800 /* Return Multiple keys and data. */ -#define DBC_OWN_LID 0x1000 /* Free lock id on destroy. */ +/* + * DBC_DONTLOCK and DBC_RECOVER are used during recovery and transaction + * abort. If a transaction is being aborted or recovered then DBC_RECOVER + * will be set and locking and logging will be disabled on this cursor. If + * we are performing a compensating transaction (e.g. free page processing) + * then DB_DONTLOCK will be set to inhibit locking, but logging will still + * be required. DB_DONTLOCK is also used if the whole database is locked. + */ +#define DBC_ACTIVE 0x0001 /* Cursor in use. */ +#define DBC_DONTLOCK 0x0002 /* Don't lock on this cursor. */ +#define DBC_MULTIPLE 0x0004 /* Return Multiple data. */ +#define DBC_MULTIPLE_KEY 0x0008 /* Return Multiple keys and data. */ +#define DBC_OPD 0x0010 /* Cursor references off-page dups. */ +#define DBC_OWN_LID 0x0020 /* Free lock id on destroy. */ +#define DBC_READ_COMMITTED 0x0040 /* Cursor has degree 2 isolation. */ +#define DBC_READ_UNCOMMITTED 0x0080 /* Cursor has degree 1 isolation. */ +#define DBC_RECOVER 0x0100 /* Recovery cursor; don't log/lock. */ +#define DBC_RMW 0x0200 /* Acquire write flag in read op. */ +#define DBC_TRANSIENT 0x0400 /* Cursor is transient. */ +#define DBC_WRITECURSOR 0x0800 /* Cursor may be used to write (CDB). */ +#define DBC_WRITER 0x1000 /* Cursor immediately writing (CDB). */ u_int32_t flags; }; @@ -1670,7 +1880,6 @@ struct __db_bt_stat { u_int32_t bt_nkeys; /* Number of unique keys. */ u_int32_t bt_ndata; /* Number of data items. */ u_int32_t bt_pagesize; /* Page size. */ - u_int32_t bt_maxkey; /* Maxkey value. */ u_int32_t bt_minkey; /* Minkey value. */ u_int32_t bt_re_len; /* Fixed-length record length. */ u_int32_t bt_re_pad; /* Fixed-length record pad. */ @@ -1687,6 +1896,21 @@ struct __db_bt_stat { u_int32_t bt_over_pgfree; /* Bytes free in overflow pages. */ }; +struct __db_compact { + /* Input Parameters. */ + u_int32_t compact_fillpercent; /* Desired fillfactor: 1-100 */ + db_timeout_t compact_timeout; /* Lock timeout. */ + u_int32_t compact_pages; /* Max pages to process. */ + /* Output Stats. */ + u_int32_t compact_pages_free; /* Number of pages freed. */ + u_int32_t compact_pages_examine; /* Number of pages examine. */ + u_int32_t compact_levels; /* Number of levels removed. */ + u_int32_t compact_deadlock; /* Number of deadlocks. */ + db_pgno_t compact_pages_truncated; /* Pages truncated to OS. */ + /* Internal. */ + db_pgno_t compact_truncate; /* Page number for truncation */ +}; + /* Hash statistics structure. */ struct __db_h_stat { u_int32_t hash_magic; /* Magic number. */ @@ -1746,12 +1970,19 @@ struct __db_env { /* Other Callbacks. */ void (*db_feedback) __P((DB_ENV *, int, int)); void (*db_paniccall) __P((DB_ENV *, int)); + void (*db_event_func) __P((DB_ENV *, u_int32_t, void *)); /* App-specified alloc functions. */ void *(*db_malloc) __P((size_t)); void *(*db_realloc) __P((void *, size_t)); void (*db_free) __P((void *)); + /* Application callback to copy data to/from a custom data source. */ +#define DB_USERCOPY_GETDATA 0x0001 +#define DB_USERCOPY_SETDATA 0x0002 + int (*dbt_usercopy) + __P((DBT *, u_int32_t, void *, u_int32_t, u_int32_t)); + /* * Currently, the verbose list is a bit field with room for 32 * entries. There's no reason that it needs to be limited, if @@ -1759,8 +1990,9 @@ struct __db_env { */ #define DB_VERB_DEADLOCK 0x0001 /* Deadlock detection information. */ #define DB_VERB_RECOVERY 0x0002 /* Recovery information. */ -#define DB_VERB_REPLICATION 0x0004 /* Replication information. */ -#define DB_VERB_WAITSFOR 0x0008 /* Dump waits-for table. */ +#define DB_VERB_REGISTER 0x0004 /* Dump waits-for table. */ +#define DB_VERB_REPLICATION 0x0008 /* Replication information. */ +#define DB_VERB_WAITSFOR 0x0010 /* Dump waits-for table. */ u_int32_t verbose; /* Verbose output. */ void *app_private; /* Application-private handle. */ @@ -1768,6 +2000,19 @@ struct __db_env { int (*app_dispatch) /* User-specified recovery dispatch. */ __P((DB_ENV *, DBT *, DB_LSN *, db_recops)); + /* Mutexes. */ + u_int32_t mutex_align; /* Mutex alignment */ + u_int32_t mutex_cnt; /* Number of mutexes to configure */ + u_int32_t mutex_inc; /* Number of mutexes to add */ + u_int32_t mutex_tas_spins;/* Test-and-set spin count */ + + struct { + int alloc_id; /* Allocation ID argument */ + u_int32_t flags; /* Flags argument */ + } *mutex_iq; /* Initial mutexes queue */ + u_int mutex_iq_next; /* Count of initial mutexes */ + u_int mutex_iq_max; /* Maximum initial mutexes */ + /* Locking. */ u_int8_t *lk_conflicts; /* Two dimensional conflict matrix. */ int lk_modes; /* Number of lock modes in table. */ @@ -1781,6 +2026,7 @@ struct __db_env { u_int32_t lg_bsize; /* Buffer size. */ u_int32_t lg_size; /* Log file size. */ u_int32_t lg_regionmax; /* Region size. */ + int lg_filemode; /* Log file permission mode. */ /* Memory pool. */ u_int32_t mp_gbytes; /* Cachesize: GB. */ @@ -1792,20 +2038,21 @@ struct __db_env { int /* Sleep after writing max buffers. */ mp_maxwrite_sleep; - /* Replication */ - int rep_eid; /* environment id. */ - int (*rep_send) /* Send function. */ - __P((DB_ENV *, const DBT *, const DBT *, - const DB_LSN *, int, u_int32_t)); - /* Transactions. */ u_int32_t tx_max; /* Maximum number of transactions. */ time_t tx_timestamp; /* Recover to specific timestamp. */ db_timeout_t tx_timeout; /* Timeout for transactions. */ + /* Thread tracking. */ + u_int32_t thr_nbucket; /* Number of hash buckets. */ + u_int32_t thr_max; /* Max before garbage collection. */ + void *thr_hashtab; /* Hash table of DB_THREAD_INFO. */ + /******************************************************* * Private: owned by DB. *******************************************************/ + pid_t pid_cache; /* Cached process ID. */ + /* User files, paths. */ char *db_home; /* Database home. */ char *db_log_dir; /* Database log file directory. */ @@ -1817,12 +2064,28 @@ struct __db_env { int db_mode; /* Default open permissions. */ int dir_mode; /* Intermediate directory perms. */ - u_int32_t env_lid; /* Locker ID in non-threaded handles. */ + void *env_lref; /* Locker in non-threaded handles. */ u_int32_t open_flags; /* Flags passed to DB_ENV->open. */ void *reginfo; /* REGINFO structure reference. */ DB_FH *lockfhp; /* fcntl(2) locking file handle. */ + DB_FH *registry; /* DB_REGISTER file handle. */ + u_int32_t registry_off; /* + * Offset of our slot. We can't use + * off_t because its size depends on + * build settings. + */ + + /* Return IDs. */ + void (*thread_id) __P((DB_ENV *, pid_t *, db_threadid_t *)); + /* Return if IDs alive. */ + int (*is_alive) + __P((DB_ENV *, pid_t, db_threadid_t, u_int32_t)); + /* Format IDs into a string. */ + char *(*thread_id_string) + __P((DB_ENV *, pid_t, db_threadid_t, char *)); + int (**recover_dtab) /* Dispatch table for recover funcs. */ __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); size_t recover_dtab_size; @@ -1834,7 +2097,6 @@ struct __db_env { int db_ref; /* DB reference count. */ long shm_key; /* shmget(2) key. */ - u_int32_t tas_spins; /* test-and-set spins. */ /* * List of open DB handles for this DB_ENV, used for cursor @@ -1847,11 +2109,12 @@ struct __db_env { * * !!! * Explicit representation of structure in queue.h. - * LIST_HEAD(dblist, __db); + * TAILQ_HEAD(__dblist, __db); */ - DB_MUTEX *dblist_mutexp; /* Mutex. */ - struct { - struct __db *lh_first; + db_mutex_t mtx_dblist; /* Mutex. */ + struct __dblist { + struct __db *tqh_first; + struct __db **tqh_last; } dblist; /* @@ -1872,161 +2135,200 @@ struct __db_env { } xa_txn; int xa_rmid; /* XA Resource Manager ID. */ - /* API-private structure. */ - void *api1_internal; /* C++, Perl API private */ - void *api2_internal; /* Java API private */ - char *passwd; /* Cryptography support. */ size_t passwd_len; void *crypto_handle; /* Primary handle. */ - DB_MUTEX *mt_mutexp; /* Mersenne Twister mutex. */ + db_mutex_t mtx_mt; /* Mersenne Twister mutex. */ int mti; /* Mersenne Twister index. */ u_long *mt; /* Mersenne Twister state vector. */ - /* DB_ENV Methods. */ + /* API-private structure. */ + void *api1_internal; /* C++, Perl API private */ + void *api2_internal; /* Java API private */ + + DB_LOCKTAB *lk_handle; /* Lock handle. */ + DB_LOG *lg_handle; /* Log handle. */ + DB_MPOOL *mp_handle; /* Mpool handle. */ + DB_MUTEXMGR *mutex_handle; /* Mutex handle. */ + DB_REP *rep_handle; /* Replication handle. */ + DB_TXNMGR *tx_handle; /* Txn handle. */ + + /* DB_ENV PUBLIC HANDLE LIST BEGIN */ + int (*cdsgroup_begin) __P((DB_ENV *, DB_TXN **)); int (*close) __P((DB_ENV *, u_int32_t)); int (*dbremove) __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)); - int (*dbrename) __P((DB_ENV *, DB_TXN *, - const char *, const char *, const char *, u_int32_t)); + int (*dbrename) __P((DB_ENV *, + DB_TXN *, const char *, const char *, const char *, u_int32_t)); void (*err) __P((const DB_ENV *, int, const char *, ...)); void (*errx) __P((const DB_ENV *, const char *, ...)); - int (*open) __P((DB_ENV *, const char *, u_int32_t, int)); - int (*remove) __P((DB_ENV *, const char *, u_int32_t)); - int (*stat_print) __P((DB_ENV *, u_int32_t)); - - /* House-keeping. */ - int (*fileid_reset) __P((DB_ENV *, char *, int)); - int (*is_bigendian) __P((void)); - int (*lsn_reset) __P((DB_ENV *, char *, int)); - int (*prdbt) __P((DBT *, - int, const char *, void *, int (*)(void *, const void *), int)); - - /* Setters/getters. */ - int (*set_alloc) __P((DB_ENV *, void *(*)(size_t), - void *(*)(void *, size_t), void (*)(void *))); - int (*set_app_dispatch) __P((DB_ENV *, - int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops))); + int (*failchk) __P((DB_ENV *, u_int32_t)); + int (*fileid_reset) __P((DB_ENV *, const char *, u_int32_t)); + int (*get_cachesize) __P((DB_ENV *, u_int32_t *, u_int32_t *, int *)); int (*get_data_dirs) __P((DB_ENV *, const char ***)); - int (*set_data_dir) __P((DB_ENV *, const char *)); int (*get_encrypt_flags) __P((DB_ENV *, u_int32_t *)); - int (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t)); - void (*set_errcall) __P((DB_ENV *, - void (*)(const DB_ENV *, const char *, const char *))); void (*get_errfile) __P((DB_ENV *, FILE **)); - void (*set_errfile) __P((DB_ENV *, FILE *)); void (*get_errpfx) __P((DB_ENV *, const char **)); - void (*set_errpfx) __P((DB_ENV *, const char *)); - int (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int))); int (*get_flags) __P((DB_ENV *, u_int32_t *)); - int (*set_flags) __P((DB_ENV *, u_int32_t, int)); int (*get_home) __P((DB_ENV *, const char **)); - int (*set_intermediate_dir) __P((DB_ENV *, int, u_int32_t)); - int (*get_open_flags) __P((DB_ENV *, u_int32_t *)); - int (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int))); - int (*set_rpc_server) __P((DB_ENV *, - void *, const char *, long, long, u_int32_t)); - int (*get_shm_key) __P((DB_ENV *, long *)); - int (*set_shm_key) __P((DB_ENV *, long)); - void (*set_msgcall) __P((DB_ENV *, - void (*)(const DB_ENV *, const char *))); - void (*get_msgfile) __P((DB_ENV *, FILE **)); - void (*set_msgfile) __P((DB_ENV *, FILE *)); - int (*get_tas_spins) __P((DB_ENV *, u_int32_t *)); - int (*set_tas_spins) __P((DB_ENV *, u_int32_t)); - int (*get_tmp_dir) __P((DB_ENV *, const char **)); - int (*set_tmp_dir) __P((DB_ENV *, const char *)); - int (*get_verbose) __P((DB_ENV *, u_int32_t, int *)); - int (*set_verbose) __P((DB_ENV *, u_int32_t, int)); - - void *lg_handle; /* Log handle and methods. */ int (*get_lg_bsize) __P((DB_ENV *, u_int32_t *)); - int (*set_lg_bsize) __P((DB_ENV *, u_int32_t)); int (*get_lg_dir) __P((DB_ENV *, const char **)); - int (*set_lg_dir) __P((DB_ENV *, const char *)); + int (*get_lg_filemode) __P((DB_ENV *, int *)); int (*get_lg_max) __P((DB_ENV *, u_int32_t *)); - int (*set_lg_max) __P((DB_ENV *, u_int32_t)); int (*get_lg_regionmax) __P((DB_ENV *, u_int32_t *)); - int (*set_lg_regionmax) __P((DB_ENV *, u_int32_t)); - int (*log_archive) __P((DB_ENV *, char **[], u_int32_t)); - int (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t)); - int (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t)); - int (*log_flush) __P((DB_ENV *, const DB_LSN *)); - int (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t)); - int (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t)); - int (*log_stat_print) __P((DB_ENV *, u_int32_t)); - - void *lk_handle; /* Lock handle and methods. */ int (*get_lk_conflicts) __P((DB_ENV *, const u_int8_t **, int *)); - int (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int)); int (*get_lk_detect) __P((DB_ENV *, u_int32_t *)); - int (*set_lk_detect) __P((DB_ENV *, u_int32_t)); - int (*set_lk_max) __P((DB_ENV *, u_int32_t)); - int (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *)); - int (*set_lk_max_locks) __P((DB_ENV *, u_int32_t)); int (*get_lk_max_lockers) __P((DB_ENV *, u_int32_t *)); - int (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t)); + int (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *)); int (*get_lk_max_objects) __P((DB_ENV *, u_int32_t *)); - int (*set_lk_max_objects) __P((DB_ENV *, u_int32_t)); + int (*get_mp_max_openfd) __P((DB_ENV *, int *)); + int (*get_mp_max_write) __P((DB_ENV *, int *, int *)); + int (*get_mp_mmapsize) __P((DB_ENV *, size_t *)); + void (*get_msgfile) __P((DB_ENV *, FILE **)); + int (*get_open_flags) __P((DB_ENV *, u_int32_t *)); + int (*get_shm_key) __P((DB_ENV *, long *)); + int (*get_timeout) __P((DB_ENV *, db_timeout_t *, u_int32_t)); + int (*get_tmp_dir) __P((DB_ENV *, const char **)); + int (*get_tx_max) __P((DB_ENV *, u_int32_t *)); + int (*get_tx_timestamp) __P((DB_ENV *, time_t *)); + int (*get_verbose) __P((DB_ENV *, u_int32_t, int *)); + int (*is_bigendian) __P((void)); int (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, int *)); int (*lock_get) __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *)); - int (*lock_put) __P((DB_ENV *, DB_LOCK *)); int (*lock_id) __P((DB_ENV *, u_int32_t *)); int (*lock_id_free) __P((DB_ENV *, u_int32_t)); + int (*lock_put) __P((DB_ENV *, DB_LOCK *)); int (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t)); int (*lock_stat_print) __P((DB_ENV *, u_int32_t)); int (*lock_vec) __P((DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **)); - - void *mp_handle; /* Mpool handle and methods. */ - int (*get_cachesize) __P((DB_ENV *, u_int32_t *, u_int32_t *, int *)); - int (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int)); - int (*get_mp_mmapsize) __P((DB_ENV *, size_t *)); - int (*set_mp_mmapsize) __P((DB_ENV *, size_t)); - int (*get_mp_max_openfd) __P((DB_ENV *, int *)); - int (*set_mp_max_openfd) __P((DB_ENV *, int)); - int (*get_mp_max_write) __P((DB_ENV *, int *, int *)); - int (*set_mp_max_write) __P((DB_ENV *, int, int)); + int (*log_archive) __P((DB_ENV *, char **[], u_int32_t)); + int (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t)); + int (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t)); + int (*log_flush) __P((DB_ENV *, const DB_LSN *)); + int (*log_printf) __P((DB_ENV *, DB_TXN *, const char *, ...)); + int (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t)); + int (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t)); + int (*log_stat_print) __P((DB_ENV *, u_int32_t)); + int (*lsn_reset) __P((DB_ENV *, const char *, u_int32_t)); int (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t)); - int (*memp_register) __P((DB_ENV *, int, - int (*)(DB_ENV *, db_pgno_t, void *, DBT *), - int (*)(DB_ENV *, db_pgno_t, void *, DBT *))); + int (*memp_register) __P((DB_ENV *, int, int (*)(DB_ENV *, + db_pgno_t, void *, DBT *), int (*)(DB_ENV *, + db_pgno_t, void *, DBT *))); int (*memp_stat) __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t)); int (*memp_stat_print) __P((DB_ENV *, u_int32_t)); int (*memp_sync) __P((DB_ENV *, DB_LSN *)); int (*memp_trickle) __P((DB_ENV *, int, int *)); - - void *rep_handle; /* Replication handle and methods. */ - int (*rep_elect) __P((DB_ENV *, int, int, int, - u_int32_t, int *, u_int32_t)); + int (*mutex_alloc) __P((DB_ENV *, u_int32_t, db_mutex_t *)); + int (*mutex_free) __P((DB_ENV *, db_mutex_t)); + int (*mutex_get_align) __P((DB_ENV *, u_int32_t *)); + int (*mutex_get_increment) __P((DB_ENV *, u_int32_t *)); + int (*mutex_get_max) __P((DB_ENV *, u_int32_t *)); + int (*mutex_get_tas_spins) __P((DB_ENV *, u_int32_t *)); + int (*mutex_lock) __P((DB_ENV *, db_mutex_t)); + int (*mutex_set_align) __P((DB_ENV *, u_int32_t)); + int (*mutex_set_increment) __P((DB_ENV *, u_int32_t)); + int (*mutex_set_max) __P((DB_ENV *, u_int32_t)); + int (*mutex_set_tas_spins) __P((DB_ENV *, u_int32_t)); + int (*mutex_stat) __P((DB_ENV *, DB_MUTEX_STAT **, u_int32_t)); + int (*mutex_stat_print) __P((DB_ENV *, u_int32_t)); + int (*mutex_unlock) __P((DB_ENV *, db_mutex_t)); + int (*open) __P((DB_ENV *, const char *, u_int32_t, int)); + int (*remove) __P((DB_ENV *, const char *, u_int32_t)); + int (*rep_elect) + __P((DB_ENV *, int, int, int *, u_int32_t)); int (*rep_flush) __P((DB_ENV *)); - int (*rep_process_message) __P((DB_ENV *, DBT *, DBT *, - int *, DB_LSN *)); + int (*rep_get_config) __P((DB_ENV *, u_int32_t, int *)); + int (*rep_get_limit) __P((DB_ENV *, u_int32_t *, u_int32_t *)); + int (*rep_get_nsites) __P((DB_ENV *, int *)); + int (*rep_get_priority) __P((DB_ENV *, int *)); + int (*rep_get_timeout) __P((DB_ENV *, int, u_int32_t *)); + int (*rep_process_message) + __P((DB_ENV *, DBT *, DBT *, int *, DB_LSN *)); + int (*rep_set_config) __P((DB_ENV *, u_int32_t, int)); + int (*rep_set_limit) __P((DB_ENV *, u_int32_t, u_int32_t)); + int (*rep_set_nsites) __P((DB_ENV *, int)); + int (*rep_set_priority) __P((DB_ENV *, int)); + int (*rep_set_timeout) __P((DB_ENV *, int, db_timeout_t)); + int (*rep_set_transport) __P((DB_ENV *, int, int (*)(DB_ENV *, + const DBT *, const DBT *, const DB_LSN *, int, u_int32_t))); int (*rep_start) __P((DB_ENV *, DBT *, u_int32_t)); int (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t)); int (*rep_stat_print) __P((DB_ENV *, u_int32_t)); - int (*get_rep_limit) __P((DB_ENV *, u_int32_t *, u_int32_t *)); - int (*set_rep_limit) __P((DB_ENV *, u_int32_t, u_int32_t)); + int (*rep_sync) __P((DB_ENV *, u_int32_t)); + int (*repmgr_add_remote_site) __P((DB_ENV *, const char *, u_int, + int *, u_int32_t)); + int (*repmgr_get_ack_policy) __P((DB_ENV *, int *)); + int (*repmgr_set_ack_policy) __P((DB_ENV *, int)); + int (*repmgr_set_local_site) __P((DB_ENV *, const char *, u_int, + u_int32_t)); + int (*repmgr_site_list) __P((DB_ENV *, u_int *, + DB_REPMGR_SITE **)); + int (*repmgr_start) __P((DB_ENV *, int, u_int32_t)); + int (*set_alloc) __P((DB_ENV *, void *(*)(size_t), + void *(*)(void *, size_t), void (*)(void *))); + int (*set_app_dispatch) + __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops))); + int (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int)); + int (*set_data_dir) __P((DB_ENV *, const char *)); + int (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t)); + void (*set_errcall) __P((DB_ENV *, + void (*)(const DB_ENV *, const char *, const char *))); + void (*set_errfile) __P((DB_ENV *, FILE *)); + void (*set_errpfx) __P((DB_ENV *, const char *)); + int (*set_event_notify) + __P((DB_ENV *, void (*)(DB_ENV *, u_int32_t, void *))); + int (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int))); + int (*set_flags) __P((DB_ENV *, u_int32_t, int)); + int (*set_intermediate_dir) __P((DB_ENV *, int, u_int32_t)); + int (*set_isalive) __P((DB_ENV *, + int (*)(DB_ENV *, pid_t, db_threadid_t, u_int32_t))); + int (*set_lg_bsize) __P((DB_ENV *, u_int32_t)); + int (*set_lg_dir) __P((DB_ENV *, const char *)); + int (*set_lg_filemode) __P((DB_ENV *, int)); + int (*set_lg_max) __P((DB_ENV *, u_int32_t)); + int (*set_lg_regionmax) __P((DB_ENV *, u_int32_t)); + int (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int)); + int (*set_lk_detect) __P((DB_ENV *, u_int32_t)); + int (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t)); + int (*set_lk_max_locks) __P((DB_ENV *, u_int32_t)); + int (*set_lk_max_objects) __P((DB_ENV *, u_int32_t)); + int (*set_mp_max_openfd) __P((DB_ENV *, int)); + int (*set_mp_max_write) __P((DB_ENV *, int, int)); + int (*set_mp_mmapsize) __P((DB_ENV *, size_t)); + void (*set_msgcall) + __P((DB_ENV *, void (*)(const DB_ENV *, const char *))); + void (*set_msgfile) __P((DB_ENV *, FILE *)); + int (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int))); int (*set_rep_request) __P((DB_ENV *, u_int32_t, u_int32_t)); - int (*set_rep_transport) __P((DB_ENV *, int, - int (*) (DB_ENV *, const DBT *, const DBT *, const DB_LSN *, - int, u_int32_t))); - - void *tx_handle; /* Txn handle and methods. */ - int (*get_tx_max) __P((DB_ENV *, u_int32_t *)); + int (*set_rpc_server) + __P((DB_ENV *, void *, const char *, long, long, u_int32_t)); + int (*set_shm_key) __P((DB_ENV *, long)); + int (*set_thread_count) __P((DB_ENV *, u_int32_t)); + int (*set_thread_id) __P((DB_ENV *, + void (*)(DB_ENV *, pid_t *, db_threadid_t *))); + int (*set_thread_id_string) __P((DB_ENV *, + char *(*)(DB_ENV *, pid_t, db_threadid_t, char *))); + int (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t)); + int (*set_tmp_dir) __P((DB_ENV *, const char *)); int (*set_tx_max) __P((DB_ENV *, u_int32_t)); - int (*get_tx_timestamp) __P((DB_ENV *, time_t *)); int (*set_tx_timestamp) __P((DB_ENV *, time_t *)); + int (*set_verbose) __P((DB_ENV *, u_int32_t, int)); + int (*stat_print) __P((DB_ENV *, u_int32_t)); int (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)); int (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t)); - int (*txn_recover) __P((DB_ENV *, - DB_PREPLIST *, long, long *, u_int32_t)); + int (*txn_recover) + __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t)); int (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t)); int (*txn_stat_print) __P((DB_ENV *, u_int32_t)); - int (*get_timeout) __P((DB_ENV *, db_timeout_t *, u_int32_t)); - int (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t)); + /* DB_ENV PUBLIC HANDLE LIST END */ + + /* DB_ENV PRIVATE HANDLE LIST BEGIN */ + int (*prdbt) __P((DBT *, + int, const char *, void *, int (*)(void *, const void *), int)); + /* DB_ENV PRIVATE HANDLE LIST END */ #define DB_TEST_ELECTINIT 1 /* after __rep_elect_init */ #define DB_TEST_ELECTVOTE1 2 /* after sending VOTE1 */ @@ -2037,38 +2339,42 @@ struct __db_env { #define DB_TEST_POSTSYNC 7 /* after syncing the log */ #define DB_TEST_PREDESTROY 8 /* before destroy op */ #define DB_TEST_PREOPEN 9 /* before __os_open */ -#define DB_TEST_SUBDB_LOCKS 10 /* subdb locking tests */ +#define DB_TEST_RECYCLE 10 /* test rep and txn_recycle */ +#define DB_TEST_SUBDB_LOCKS 11 /* subdb locking tests */ int test_abort; /* Abort value for testing. */ int test_check; /* Checkpoint value for testing. */ int test_copy; /* Copy value for testing. */ -#define DB_ENV_AUTO_COMMIT 0x0000001 /* DB_AUTO_COMMIT. */ -#define DB_ENV_CDB 0x0000002 /* DB_INIT_CDB. */ -#define DB_ENV_CDB_ALLDB 0x0000004 /* CDB environment wide locking. */ -#define DB_ENV_CREATE 0x0000008 /* DB_CREATE set. */ -#define DB_ENV_DBLOCAL 0x0000010 /* DB_ENV allocated for private DB. */ -#define DB_ENV_DIRECT_DB 0x0000020 /* DB_DIRECT_DB set. */ -#define DB_ENV_DIRECT_LOG 0x0000040 /* DB_DIRECT_LOG set. */ -#define DB_ENV_DSYNC_LOG 0x0000080 /* DB_DSYNC_LOG set. */ -#define DB_ENV_FATAL 0x0000100 /* Doing fatal recovery in env. */ -#define DB_ENV_LOCKDOWN 0x0000200 /* DB_LOCKDOWN set. */ -#define DB_ENV_LOG_AUTOREMOVE 0x0000400 /* DB_LOG_AUTOREMOVE set. */ -#define DB_ENV_LOG_INMEMORY 0x0000800 /* DB_LOG_INMEMORY set. */ -#define DB_ENV_NOLOCKING 0x0001000 /* DB_NOLOCKING set. */ -#define DB_ENV_NOMMAP 0x0002000 /* DB_NOMMAP set. */ -#define DB_ENV_NOPANIC 0x0004000 /* Okay if panic set. */ -#define DB_ENV_OPEN_CALLED 0x0008000 /* DB_ENV->open called. */ -#define DB_ENV_OVERWRITE 0x0010000 /* DB_OVERWRITE set. */ -#define DB_ENV_PRIVATE 0x0020000 /* DB_PRIVATE set. */ -#define DB_ENV_REGION_INIT 0x0040000 /* DB_REGION_INIT set. */ -#define DB_ENV_RPCCLIENT 0x0080000 /* DB_RPCCLIENT set. */ -#define DB_ENV_RPCCLIENT_GIVEN 0x0100000 /* User-supplied RPC client struct */ -#define DB_ENV_SYSTEM_MEM 0x0200000 /* DB_SYSTEM_MEM set. */ -#define DB_ENV_THREAD 0x0400000 /* DB_THREAD set. */ -#define DB_ENV_TIME_NOTGRANTED 0x0800000 /* DB_TIME_NOTGRANTED set. */ -#define DB_ENV_TXN_NOSYNC 0x1000000 /* DB_TXN_NOSYNC set. */ -#define DB_ENV_TXN_WRITE_NOSYNC 0x2000000 /* DB_TXN_WRITE_NOSYNC set. */ -#define DB_ENV_YIELDCPU 0x4000000 /* DB_YIELDCPU set. */ +#define DB_ENV_AUTO_COMMIT 0x00000001 /* DB_AUTO_COMMIT. */ +#define DB_ENV_CDB 0x00000002 /* DB_INIT_CDB. */ +#define DB_ENV_CDB_ALLDB 0x00000004 /* CDB environment wide locking. */ +#define DB_ENV_CREATE 0x00000008 /* DB_CREATE set. */ +#define DB_ENV_DBLOCAL 0x00000010 /* Environment for a private DB. */ +#define DB_ENV_DIRECT_DB 0x00000020 /* DB_DIRECT_DB set. */ +#define DB_ENV_DIRECT_LOG 0x00000040 /* DB_DIRECT_LOG set. */ +#define DB_ENV_DSYNC_DB 0x00000080 /* DB_DSYNC_DB set. */ +#define DB_ENV_DSYNC_LOG 0x00000100 /* DB_DSYNC_LOG set. */ +#define DB_ENV_FATAL 0x00000200 /* Doing fatal recovery in env. */ +#define DB_ENV_LOCKDOWN 0x00000400 /* DB_LOCKDOWN set. */ +#define DB_ENV_LOG_AUTOREMOVE 0x00000800 /* DB_LOG_AUTOREMOVE set. */ +#define DB_ENV_LOG_INMEMORY 0x00001000 /* DB_LOG_INMEMORY set. */ +#define DB_ENV_MULTIVERSION 0x00002000 /* DB_MULTIVERSION set. */ +#define DB_ENV_NOLOCKING 0x00004000 /* DB_NOLOCKING set. */ +#define DB_ENV_NOMMAP 0x00008000 /* DB_NOMMAP set. */ +#define DB_ENV_NOPANIC 0x00010000 /* Okay if panic set. */ +#define DB_ENV_OPEN_CALLED 0x00020000 /* DB_ENV->open called. */ +#define DB_ENV_OVERWRITE 0x00040000 /* DB_OVERWRITE set. */ +#define DB_ENV_PRIVATE 0x00080000 /* DB_PRIVATE set. */ +#define DB_ENV_REGION_INIT 0x00100000 /* DB_REGION_INIT set. */ +#define DB_ENV_RPCCLIENT 0x00200000 /* DB_RPCCLIENT set. */ +#define DB_ENV_RPCCLIENT_GIVEN 0x00400000 /* User-supplied RPC client struct */ +#define DB_ENV_SYSTEM_MEM 0x00800000 /* DB_SYSTEM_MEM set. */ +#define DB_ENV_THREAD 0x01000000 /* DB_THREAD set. */ +#define DB_ENV_TIME_NOTGRANTED 0x02000000 /* DB_TIME_NOTGRANTED set. */ +#define DB_ENV_TXN_NOSYNC 0x04000000 /* DB_TXN_NOSYNC set. */ +#define DB_ENV_TXN_SNAPSHOT 0x08000000 /* DB_TXN_SNAPSHOT set. */ +#define DB_ENV_TXN_WRITE_NOSYNC 0x10000000 /* DB_TXN_WRITE_NOSYNC set. */ +#define DB_ENV_YIELDCPU 0x20000000 /* DB_YIELDCPU set. */ u_int32_t flags; }; @@ -2158,6 +2464,7 @@ typedef struct entry { #if defined(__cplusplus) } #endif + #endif /* !_DB_H_ */ /* DO NOT EDIT: automatically built by dist/s_include. */ diff --git a/db/build_vxworks/db_archive/db_archive.c b/db/build_vxworks/db_archive/db_archive.c index 2297111b7..89ee92275 100644 --- a/db/build_vxworks/db_archive/db_archive.c +++ b/db/build_vxworks/db_archive/db_archive.c @@ -1,33 +1,26 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_archive.c,v 11.46 2004/06/10 01:00:08 bostic Exp $ + * $Id: db_archive.c,v 12.9 2006/08/26 09:23:00 bostic Exp $ */ #include "db_config.h" +#include "db_int.h" + #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#include -#include + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; #endif -#include "db_int.h" - int db_archive_main __P((int, char *[])); int db_archive_usage __P((void)); -int db_archive_version_check __P((const char *)); +int db_archive_version_check __P((void)); + +const char *progname; int db_archive(args) @@ -50,13 +43,17 @@ db_archive_main(argc, argv) { extern char *optarg; extern int optind, __db_getopt_reset; - const char *progname = "db_archive"; DB_ENV *dbenv; u_int32_t flags; int ch, exitval, ret, verbose; char **file, *home, **list, *passwd; - if ((ret = db_archive_version_check(progname)) != 0) + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_archive_version_check()) != 0) return (ret); dbenv = NULL; @@ -95,6 +92,12 @@ db_archive_main(argc, argv) printf("%s\n", db_version(NULL, NULL, NULL)); return (EXIT_SUCCESS); case 'v': + /* + * !!! + * The verbose flag no longer actually does anything, + * but it's left rather than adding it back at some + * future date. + */ verbose = 1; break; case '?': @@ -132,8 +135,7 @@ db_archive_main(argc, argv) * If attaching to a pre-existing environment fails, create a * private one and try again. */ - if ((ret = dbenv->open(dbenv, - home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 && + if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && (ret == DB_VERSION_MISMATCH || (ret = dbenv->open(dbenv, home, DB_CREATE | DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) { @@ -176,13 +178,12 @@ int db_archive_usage() { (void)fprintf(stderr, - "usage: db_archive [-adlsVv] [-h home] [-P password]\n"); + "usage: %s [-adlsVv] [-h home] [-P password]\n", progname); return (EXIT_FAILURE); } int -db_archive_version_check(progname) - const char *progname; +db_archive_version_check() { int v_major, v_minor, v_patch; diff --git a/db/build_vxworks/db_archive/db_archive20.wpj b/db/build_vxworks/db_archive/db_archive20.wpj index 9e3568eb5..2ac521035 100755 --- a/db/build_vxworks/db_archive/db_archive20.wpj +++ b/db/build_vxworks/db_archive/db_archive20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_db_archive.c_dependDone FALSE FILE_db_archive.c_dependencies - FILE_db_archive.c_objects diff --git a/db/build_vxworks/db_archive/db_archive22.wpj b/db/build_vxworks/db_archive/db_archive22.wpj index a9c9da3fd..f7a7d048e 100755 --- a/db/build_vxworks/db_archive/db_archive22.wpj +++ b/db/build_vxworks/db_archive/db_archive22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_db_archive.c_dependDone FALSE FILE_db_archive.c_dependencies - FILE_db_archive.c_objects diff --git a/db/build_vxworks/db_checkpoint/db_checkpoint.c b/db/build_vxworks/db_checkpoint/db_checkpoint.c index 6ee299571..861d28adb 100644 --- a/db/build_vxworks/db_checkpoint/db_checkpoint.c +++ b/db/build_vxworks/db_checkpoint/db_checkpoint.c @@ -1,47 +1,26 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_checkpoint.c,v 11.54 2004/03/24 15:13:12 bostic Exp $ + * $Id: db_checkpoint.c,v 12.15 2006/08/26 09:23:25 bostic Exp $ */ #include "db_config.h" +#include "db_int.h" + #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#if TIME_WITH_SYS_TIME -#include -#include -#else -#if HAVE_SYS_TIME_H -#include -#else -#include -#endif + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; #endif -#include -#include -#include -#include -#include -#endif - -#include "db_int.h" -#include "dbinc/db_page.h" -#include "dbinc/db_am.h" - int db_checkpoint_main __P((int, char *[])); int db_checkpoint_usage __P((void)); -int db_checkpoint_version_check __P((const char *)); +int db_checkpoint_version_check __P((void)); + +const char *progname; int db_checkpoint(args) @@ -65,14 +44,18 @@ db_checkpoint_main(argc, argv) extern char *optarg; extern int optind, __db_getopt_reset; DB_ENV *dbenv; - const char *progname = "db_checkpoint"; time_t now; long argval; u_int32_t flags, kbytes, minutes, seconds; int ch, exitval, once, ret, verbose; - char *home, *logfile, *passwd; + char *home, *logfile, *passwd, time_buf[CTIME_BUFLEN]; + + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; - if ((ret = db_checkpoint_version_check(progname)) != 0) + if ((ret = db_checkpoint_version_check()) != 0) return (ret); /* @@ -101,7 +84,7 @@ db_checkpoint_main(argc, argv) if (__db_getlong(NULL, progname, optarg, 1, (long)MAX_UINT32_T, &argval)) return (EXIT_FAILURE); - kbytes = argval; + kbytes = (u_int32_t)argval; break; case 'L': logfile = optarg; @@ -119,7 +102,7 @@ db_checkpoint_main(argc, argv) if (__db_getlong(NULL, progname, optarg, 1, (long)MAX_UINT32_T, &argval)) return (EXIT_FAILURE); - minutes = argval; + minutes = (u_int32_t)argval; break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); @@ -141,7 +124,7 @@ db_checkpoint_main(argc, argv) (void)fprintf(stderr, "%s: at least one of -1, -k and -p must be specified\n", progname); - return (EXIT_FAILURE); + return (db_checkpoint_usage()); } /* Handle possible interruptions. */ @@ -169,18 +152,16 @@ db_checkpoint_main(argc, argv) dbenv->err(dbenv, ret, "set_passwd"); goto shutdown; } - /* Initialize the environment. */ - if ((ret = dbenv->open(dbenv, - home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0) { - dbenv->err(dbenv, ret, "open"); - goto shutdown; - } - /* Register the standard pgin/pgout functions, in case we do I/O. */ - if ((ret = dbenv->memp_register( - dbenv, DB_FTYPE_SET, __db_pgin, __db_pgout)) != 0) { - dbenv->err(dbenv, ret, - "DB_ENV->memp_register: failed to register access method functions"); + /* + * If attaching to a pre-existing environment fails, create a + * private one and try again. + */ + if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && + (!once || ret == DB_VERSION_MISMATCH || + (ret = dbenv->open(dbenv, home, + DB_CREATE | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) { + dbenv->err(dbenv, ret, "DB_ENV->open"); goto shutdown; } @@ -193,7 +174,8 @@ db_checkpoint_main(argc, argv) while (!__db_util_interrupted()) { if (verbose) { (void)time(&now); - dbenv->errx(dbenv, "checkpoint begin: %s", ctime(&now)); + dbenv->errx(dbenv, + "checkpoint begin: %s", __db_ctime(&now, time_buf)); } if ((ret = dbenv->txn_checkpoint(dbenv, @@ -205,7 +187,7 @@ db_checkpoint_main(argc, argv) if (verbose) { (void)time(&now); dbenv->errx(dbenv, - "checkpoint complete: %s", ctime(&now)); + "checkpoint complete: %s", __db_ctime(&now, time_buf)); } if (once) @@ -220,7 +202,7 @@ shutdown: exitval = 1; /* Clean up the logfile. */ if (logfile != NULL) - remove(logfile); + (void)remove(logfile); /* Clean up the environment. */ if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) { @@ -241,15 +223,13 @@ shutdown: exitval = 1; int db_checkpoint_usage() { - (void)fprintf(stderr, "%s\n\t%s\n", - "usage: db_checkpoint [-1Vv]", + (void)fprintf(stderr, "usage: %s [-1Vv]\n\t%s\n", progname, "[-h home] [-k kbytes] [-L file] [-P password] [-p min]"); return (EXIT_FAILURE); } int -db_checkpoint_version_check(progname) - const char *progname; +db_checkpoint_version_check() { int v_major, v_minor, v_patch; diff --git a/db/build_vxworks/db_checkpoint/db_checkpoint20.wpj b/db/build_vxworks/db_checkpoint/db_checkpoint20.wpj index bdac5e7f3..a10a44c8c 100755 --- a/db/build_vxworks/db_checkpoint/db_checkpoint20.wpj +++ b/db/build_vxworks/db_checkpoint/db_checkpoint20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_db_checkpoint.c_dependDone FALSE FILE_db_checkpoint.c_dependencies - FILE_db_checkpoint.c_objects diff --git a/db/build_vxworks/db_checkpoint/db_checkpoint22.wpj b/db/build_vxworks/db_checkpoint/db_checkpoint22.wpj index 21d19cd15..57c46c1b1 100755 --- a/db/build_vxworks/db_checkpoint/db_checkpoint22.wpj +++ b/db/build_vxworks/db_checkpoint/db_checkpoint22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_db_checkpoint.c_dependDone FALSE FILE_db_checkpoint.c_dependencies - FILE_db_checkpoint.c_objects diff --git a/db/build_vxworks/db_config.h b/db/build_vxworks/db_config.h index a025144d8..66eb91283 100644 --- a/db/build_vxworks/db_config.h +++ b/db/build_vxworks/db_config.h @@ -32,12 +32,30 @@ /* Define to 1 if you want a version with run-time diagnostic checking. */ /* #undef DIAGNOSTIC */ +/* Define to 1 if 64-bit types are available. */ +#define HAVE_64BIT_TYPES 1 + +/* Define to 1 if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* Define to 1 if you have the `atoi' function. */ +#define HAVE_ATOI 1 + +/* Define to 1 if you have the `atol' function. */ +#define HAVE_ATOL 1 + /* Define to 1 if you have the `clock_gettime' function. */ #define HAVE_CLOCK_GETTIME 1 /* Define to 1 if Berkeley DB release includes strong cryptography. */ #define HAVE_CRYPTO 1 +/* Define to 1 if you have the `ctime_r' function. */ +#define HAVE_CTIME_R 1 + +/* Define to 1 if ctime_r takes a buffer length as a third argument. */ +#define HAVE_CTIME_R_3ARG 1 + /* Define to 1 if you have the `directio' function. */ /* #undef HAVE_DIRECTIO */ @@ -51,6 +69,12 @@ /* Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines. */ #define HAVE_EXIT_SUCCESS 1 +/* Define to 1 if you have the `fchmod' function. */ +/* #undef HAVE_FCHMOD */ + +/* Define to 1 if you have the `fcntl' function. */ +/* #undef HAVE_FCNTL */ + /* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */ /* #undef HAVE_FCNTL_F_SETFD */ @@ -61,11 +85,17 @@ #define HAVE_FILESYSTEM_NOTZERO 1 /* Define to 1 if you have the `ftruncate' function. */ -/* #undef HAVE_FTRUNCATE */ +#define HAVE_FTRUNCATE 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +/* #undef HAVE_GETADDRINFO */ /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 +/* Define to 1 if you have the `getenv' function. */ +#define HAVE_GETENV 1 + /* Define to 1 if you have the `getopt' function. */ /* #undef HAVE_GETOPT */ @@ -84,11 +114,17 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_INTTYPES_H */ -/* Define to 1 if you have the `nsl' library (-lnsl). */ -/* #undef HAVE_LIBNSL */ +/* Define to 1 if you have the `isalpha' function. */ +#define HAVE_ISALPHA 1 + +/* Define to 1 if you have the `isdigit' function. */ +#define HAVE_ISDIGIT 1 + +/* Define to 1 if you have the `isprint' function. */ +#define HAVE_ISPRINT 1 -/* Define to 1 if the system has the type `long long'. */ -/* #undef HAVE_LONG_LONG */ +/* Define to 1 if you have the `isspace' function. */ +#define HAVE_ISSPACE 1 /* Define to 1 if you have the `memcmp' function. */ #define HAVE_MEMCMP 1 @@ -108,6 +144,9 @@ /* Define to 1 if you have the `mmap' function. */ /* #undef HAVE_MMAP */ +/* Define to 1 if you have the `mprotect' function. */ +/* #undef HAVE_MPROTECT */ + /* Define to 1 if you have the `munlock' function. */ /* #undef HAVE_MUNLOCK */ @@ -142,6 +181,9 @@ /* Define to 1 to use the GCC compiler and IA64 assembly language mutexes. */ /* #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY */ +/* Define to 1 to use the GCC compiler and MIPS assembly language mutexes. */ +/* #undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY */ + /* Define to 1 to use the msem_XXX mutexes on systems other than HP-UX. */ /* #undef HAVE_MUTEX_MSEM_INIT */ @@ -183,9 +225,6 @@ /* Define to 1 if mutexes hold system resources. */ #define HAVE_MUTEX_SYSTEM_RESOURCES 1 -/* Define to 1 if fast mutexes are available. */ -#define HAVE_MUTEX_THREADS 1 - /* Define to 1 to configure mutexes intra-process only. */ /* #undef HAVE_MUTEX_THREAD_ONLY */ @@ -210,6 +249,9 @@ /* Define to 1 to use the GCC compiler and Windows mutexes. */ /* #undef HAVE_MUTEX_WIN32_GCC */ +/* Define to 1 to use the GCC compiler and amd64 assembly language mutexes. */ +/* #undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY */ + /* Define to 1 to use the GCC compiler and x86 assembly language mutexes. */ /* #undef HAVE_MUTEX_X86_GCC_ASSEMBLY */ @@ -222,9 +264,18 @@ /* Define to 1 if you have the `pread' function. */ /* #undef HAVE_PREAD */ +/* Define to 1 if you have the `printf' function. */ +#define HAVE_PRINTF 1 + /* Define to 1 if you have the `pstat_getdynamic' function. */ /* #undef HAVE_PSTAT_GETDYNAMIC */ +/* Define to 1 to configure Berkeley DB for POSIX pthread API. */ +/* #undef HAVE_PTHREAD_API */ + +/* Define to 1 if you have the `pthread_yield' function. */ +#define HAVE_PTHREAD_YIELD 1 + /* Define to 1 if you have the `pwrite' function. */ /* #undef HAVE_PWRITE */ @@ -243,6 +294,9 @@ /* Define to 1 if building replication support. */ #define HAVE_REPLICATION 1 +/* Define to 1 if building the Berkeley DB replication framework. */ +/* #undef HAVE_REPLICATION_THREADS */ + /* Define to 1 if building RPC client/server. */ /* #undef HAVE_RPC */ @@ -252,17 +306,20 @@ /* Define to 1 if you have the `select' function. */ #define HAVE_SELECT 1 -/* Define to 1 if building sequence support. */ -/* #undef HAVE_SEQUENCE */ - /* Define to 1 if you have the `shmget' function. */ /* #undef HAVE_SHMGET */ +/* Define to 1 if you have the `sigaction' function. */ +/* #undef HAVE_SIGACTION */ + +/* Define to 1 if thread identifier type db_threadid_t is integral. */ +#define HAVE_SIMPLE_THREAD_TYPE 1 + /* Define to 1 if you have the `snprintf' function. */ /* #undef HAVE_SNPRINTF */ -/* Define to 1 if you have the `srand' function. */ -#define HAVE_SRAND 1 +/* Define to 1 if you have the `stat' function. */ +#define HAVE_STAT 1 /* Define to 1 if building statistics support. */ #define HAVE_STATISTICS 1 @@ -276,18 +333,39 @@ /* Define to 1 if you have the `strcasecmp' function. */ /* #undef HAVE_STRCASECMP */ +/* Define to 1 if you have the `strcat' function. */ +#define HAVE_STRCAT 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + /* Define to 1 if you have the `strdup' function. */ /* #undef HAVE_STRDUP */ /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 +/* Define to 1 if you have the `strftime' function. */ +#define HAVE_STRFTIME 1 + /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strncat' function. */ +#define HAVE_STRNCAT 1 + +/* Define to 1 if you have the `strncmp' function. */ +#define HAVE_STRNCMP 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 @@ -329,9 +407,6 @@ /* Define to 1 if unlink of file with open file descriptors will fail. */ #define HAVE_UNLINK_WITH_OPEN_FAILURE 1 -/* Define to 1 if the system has the type `unsigned long long'. */ -/* #undef HAVE_UNSIGNED_LONG_LONG */ - /* Define to 1 if building access method verification support. */ #define HAVE_VERIFY 1 @@ -347,23 +422,20 @@ /* Define to 1 if you have the `_fstati64' function. */ /* #undef HAVE__FSTATI64 */ -/* Define to a value if using non-standard mutex alignment. */ -/* #undef MUTEX_ALIGN */ - /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "support@sleepycat.com" +#define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum" /* Define to the full name of this package. */ #define PACKAGE_NAME "Berkeley DB" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "Berkeley DB 4.3.27" +#define PACKAGE_STRING "Berkeley DB 4.5.20" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "db-4.3.27" +#define PACKAGE_TARNAME "db-4.5.20" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.3.27" +#define PACKAGE_VERSION "4.5.20" /* Define to 1 if the `S_IS*' macros in do not work properly. */ /* #undef STAT_MACROS_BROKEN */ @@ -386,58 +458,5 @@ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ -/* - * Exit success/failure macros. - */ -#ifndef HAVE_EXIT_SUCCESS -#define EXIT_FAILURE 1 -#define EXIT_SUCCESS 0 -#endif - -/* - * Don't step on the namespace. Other libraries may have their own - * implementations of these functions, we don't want to use their - * implementations or force them to use ours based on the load order. - */ -#ifndef HAVE_GETCWD -#define getcwd __db_Cgetcwd -#endif -#ifndef HAVE_GETOPT -#define getopt __db_Cgetopt -#define optarg __db_Coptarg -#define opterr __db_Copterr -#define optind __db_Coptind -#define optopt __db_Coptopt -#endif -#ifndef HAVE_MEMCMP -#define memcmp __db_Cmemcmp -#endif -#ifndef HAVE_MEMCPY -#define memcpy __db_Cmemcpy -#endif -#ifndef HAVE_MEMMOVE -#define memmove __db_Cmemmove -#endif -#ifndef HAVE_RAISE -#define raise __db_Craise -#endif -#ifndef HAVE_SNPRINTF -#define snprintf __db_Csnprintf -#endif -#ifndef HAVE_STRCASECMP -#define strcasecmp __db_Cstrcasecmp -#define strncasecmp __db_Cstrncasecmp -#endif -#ifndef HAVE_STRERROR -#define strerror __db_Cstrerror -#endif -#ifndef HAVE_VSNPRINTF -#define vsnprintf __db_Cvsnprintf -#endif - -/* - * !!! - * The following is not part of the automatic configuration setup, but - * provides the information necessary to build Berkeley DB on VxWorks. - */ +#include "clib_port.h" #include "vxWorks.h" diff --git a/db/build_vxworks/db_config_small.h b/db/build_vxworks/db_config_small.h index 9cbe87c83..12caac11c 100644 --- a/db/build_vxworks/db_config_small.h +++ b/db/build_vxworks/db_config_small.h @@ -32,12 +32,30 @@ /* Define to 1 if you want a version with run-time diagnostic checking. */ /* #undef DIAGNOSTIC */ +/* Define to 1 if 64-bit types are available. */ +#define HAVE_64BIT_TYPES 1 + +/* Define to 1 if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* Define to 1 if you have the `atoi' function. */ +#define HAVE_ATOI 1 + +/* Define to 1 if you have the `atol' function. */ +#define HAVE_ATOL 1 + /* Define to 1 if you have the `clock_gettime' function. */ #define HAVE_CLOCK_GETTIME 1 /* Define to 1 if Berkeley DB release includes strong cryptography. */ /* #undef HAVE_CRYPTO */ +/* Define to 1 if you have the `ctime_r' function. */ +#define HAVE_CTIME_R 1 + +/* Define to 1 if ctime_r takes a buffer length as a third argument. */ +#define HAVE_CTIME_R_3ARG 1 + /* Define to 1 if you have the `directio' function. */ /* #undef HAVE_DIRECTIO */ @@ -51,6 +69,12 @@ /* Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines. */ #define HAVE_EXIT_SUCCESS 1 +/* Define to 1 if you have the `fchmod' function. */ +/* #undef HAVE_FCHMOD */ + +/* Define to 1 if you have the `fcntl' function. */ +/* #undef HAVE_FCNTL */ + /* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */ /* #undef HAVE_FCNTL_F_SETFD */ @@ -61,11 +85,17 @@ #define HAVE_FILESYSTEM_NOTZERO 1 /* Define to 1 if you have the `ftruncate' function. */ -/* #undef HAVE_FTRUNCATE */ +#define HAVE_FTRUNCATE 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +/* #undef HAVE_GETADDRINFO */ /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 +/* Define to 1 if you have the `getenv' function. */ +#define HAVE_GETENV 1 + /* Define to 1 if you have the `getopt' function. */ /* #undef HAVE_GETOPT */ @@ -84,11 +114,17 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_INTTYPES_H */ -/* Define to 1 if you have the `nsl' library (-lnsl). */ -/* #undef HAVE_LIBNSL */ +/* Define to 1 if you have the `isalpha' function. */ +#define HAVE_ISALPHA 1 + +/* Define to 1 if you have the `isdigit' function. */ +#define HAVE_ISDIGIT 1 + +/* Define to 1 if you have the `isprint' function. */ +#define HAVE_ISPRINT 1 -/* Define to 1 if the system has the type `long long'. */ -/* #undef HAVE_LONG_LONG */ +/* Define to 1 if you have the `isspace' function. */ +#define HAVE_ISSPACE 1 /* Define to 1 if you have the `memcmp' function. */ #define HAVE_MEMCMP 1 @@ -108,6 +144,9 @@ /* Define to 1 if you have the `mmap' function. */ /* #undef HAVE_MMAP */ +/* Define to 1 if you have the `mprotect' function. */ +/* #undef HAVE_MPROTECT */ + /* Define to 1 if you have the `munlock' function. */ /* #undef HAVE_MUNLOCK */ @@ -142,6 +181,9 @@ /* Define to 1 to use the GCC compiler and IA64 assembly language mutexes. */ /* #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY */ +/* Define to 1 to use the GCC compiler and MIPS assembly language mutexes. */ +/* #undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY */ + /* Define to 1 to use the msem_XXX mutexes on systems other than HP-UX. */ /* #undef HAVE_MUTEX_MSEM_INIT */ @@ -183,9 +225,6 @@ /* Define to 1 if mutexes hold system resources. */ #define HAVE_MUTEX_SYSTEM_RESOURCES 1 -/* Define to 1 if fast mutexes are available. */ -#define HAVE_MUTEX_THREADS 1 - /* Define to 1 to configure mutexes intra-process only. */ /* #undef HAVE_MUTEX_THREAD_ONLY */ @@ -210,6 +249,9 @@ /* Define to 1 to use the GCC compiler and Windows mutexes. */ /* #undef HAVE_MUTEX_WIN32_GCC */ +/* Define to 1 to use the GCC compiler and amd64 assembly language mutexes. */ +/* #undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY */ + /* Define to 1 to use the GCC compiler and x86 assembly language mutexes. */ /* #undef HAVE_MUTEX_X86_GCC_ASSEMBLY */ @@ -222,9 +264,18 @@ /* Define to 1 if you have the `pread' function. */ /* #undef HAVE_PREAD */ +/* Define to 1 if you have the `printf' function. */ +#define HAVE_PRINTF 1 + /* Define to 1 if you have the `pstat_getdynamic' function. */ /* #undef HAVE_PSTAT_GETDYNAMIC */ +/* Define to 1 to configure Berkeley DB for POSIX pthread API. */ +/* #undef HAVE_PTHREAD_API */ + +/* Define to 1 if you have the `pthread_yield' function. */ +#define HAVE_PTHREAD_YIELD 1 + /* Define to 1 if you have the `pwrite' function. */ /* #undef HAVE_PWRITE */ @@ -243,6 +294,9 @@ /* Define to 1 if building replication support. */ /* #undef HAVE_REPLICATION */ +/* Define to 1 if building the Berkeley DB replication framework. */ +/* #undef HAVE_REPLICATION_THREADS */ + /* Define to 1 if building RPC client/server. */ /* #undef HAVE_RPC */ @@ -252,17 +306,20 @@ /* Define to 1 if you have the `select' function. */ #define HAVE_SELECT 1 -/* Define to 1 if building sequence support. */ -/* #undef HAVE_SEQUENCE */ - /* Define to 1 if you have the `shmget' function. */ /* #undef HAVE_SHMGET */ +/* Define to 1 if you have the `sigaction' function. */ +/* #undef HAVE_SIGACTION */ + +/* Define to 1 if thread identifier type db_threadid_t is integral. */ +#define HAVE_SIMPLE_THREAD_TYPE 1 + /* Define to 1 if you have the `snprintf' function. */ /* #undef HAVE_SNPRINTF */ -/* Define to 1 if you have the `srand' function. */ -#define HAVE_SRAND 1 +/* Define to 1 if you have the `stat' function. */ +#define HAVE_STAT 1 /* Define to 1 if building statistics support. */ /* #undef HAVE_STATISTICS */ @@ -276,18 +333,39 @@ /* Define to 1 if you have the `strcasecmp' function. */ /* #undef HAVE_STRCASECMP */ +/* Define to 1 if you have the `strcat' function. */ +#define HAVE_STRCAT 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + /* Define to 1 if you have the `strdup' function. */ /* #undef HAVE_STRDUP */ /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 +/* Define to 1 if you have the `strftime' function. */ +#define HAVE_STRFTIME 1 + /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strncat' function. */ +#define HAVE_STRNCAT 1 + +/* Define to 1 if you have the `strncmp' function. */ +#define HAVE_STRNCMP 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 @@ -329,9 +407,6 @@ /* Define to 1 if unlink of file with open file descriptors will fail. */ #define HAVE_UNLINK_WITH_OPEN_FAILURE 1 -/* Define to 1 if the system has the type `unsigned long long'. */ -/* #undef HAVE_UNSIGNED_LONG_LONG */ - /* Define to 1 if building access method verification support. */ /* #undef HAVE_VERIFY */ @@ -347,23 +422,20 @@ /* Define to 1 if you have the `_fstati64' function. */ /* #undef HAVE__FSTATI64 */ -/* Define to a value if using non-standard mutex alignment. */ -/* #undef MUTEX_ALIGN */ - /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "support@sleepycat.com" +#define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum" /* Define to the full name of this package. */ #define PACKAGE_NAME "Berkeley DB" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "Berkeley DB 4.3.27" +#define PACKAGE_STRING "Berkeley DB 4.5.20" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "db-4.3.27" +#define PACKAGE_TARNAME "db-4.5.20" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.3.27" +#define PACKAGE_VERSION "4.5.20" /* Define to 1 if the `S_IS*' macros in do not work properly. */ /* #undef STAT_MACROS_BROKEN */ @@ -386,58 +458,5 @@ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ -/* - * Exit success/failure macros. - */ -#ifndef HAVE_EXIT_SUCCESS -#define EXIT_FAILURE 1 -#define EXIT_SUCCESS 0 -#endif - -/* - * Don't step on the namespace. Other libraries may have their own - * implementations of these functions, we don't want to use their - * implementations or force them to use ours based on the load order. - */ -#ifndef HAVE_GETCWD -#define getcwd __db_Cgetcwd -#endif -#ifndef HAVE_GETOPT -#define getopt __db_Cgetopt -#define optarg __db_Coptarg -#define opterr __db_Copterr -#define optind __db_Coptind -#define optopt __db_Coptopt -#endif -#ifndef HAVE_MEMCMP -#define memcmp __db_Cmemcmp -#endif -#ifndef HAVE_MEMCPY -#define memcpy __db_Cmemcpy -#endif -#ifndef HAVE_MEMMOVE -#define memmove __db_Cmemmove -#endif -#ifndef HAVE_RAISE -#define raise __db_Craise -#endif -#ifndef HAVE_SNPRINTF -#define snprintf __db_Csnprintf -#endif -#ifndef HAVE_STRCASECMP -#define strcasecmp __db_Cstrcasecmp -#define strncasecmp __db_Cstrncasecmp -#endif -#ifndef HAVE_STRERROR -#define strerror __db_Cstrerror -#endif -#ifndef HAVE_VSNPRINTF -#define vsnprintf __db_Cvsnprintf -#endif - -/* - * !!! - * The following is not part of the automatic configuration setup, but - * provides the information necessary to build Berkeley DB on VxWorks. - */ +#include "clib_port.h" #include "vxWorks.h" diff --git a/db/build_vxworks/db_deadlock/db_deadlock.c b/db/build_vxworks/db_deadlock/db_deadlock.c index 32689d203..3b560d174 100644 --- a/db/build_vxworks/db_deadlock/db_deadlock.c +++ b/db/build_vxworks/db_deadlock/db_deadlock.c @@ -1,45 +1,26 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_deadlock.c,v 11.45 2004/03/24 15:13:12 bostic Exp $ + * $Id: db_deadlock.c,v 12.13 2006/08/26 09:23:00 bostic Exp $ */ #include "db_config.h" +#include "db_int.h" + #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#if TIME_WITH_SYS_TIME -#include -#include -#else -#if HAVE_SYS_TIME_H -#include -#else -#include -#endif + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; #endif -#include -#include -#include -#include -#include -#endif - -#include "db_int.h" - int db_deadlock_main __P((int, char *[])); int db_deadlock_usage __P((void)); -int db_deadlock_version_check __P((const char *)); +int db_deadlock_version_check __P((void)); + +const char *progname; int db_deadlock(args) @@ -62,24 +43,28 @@ db_deadlock_main(argc, argv) { extern char *optarg; extern int optind, __db_getopt_reset; - const char *progname = "db_deadlock"; DB_ENV *dbenv; u_int32_t atype; time_t now; u_long secs, usecs; int ch, exitval, ret, verbose; - char *home, *logfile, *str; + char *home, *logfile, *passwd, *str, time_buf[CTIME_BUFLEN]; - if ((ret = db_deadlock_version_check(progname)) != 0) + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_deadlock_version_check()) != 0) return (ret); dbenv = NULL; atype = DB_LOCK_DEFAULT; - home = logfile = NULL; + home = logfile = passwd = NULL; secs = usecs = 0; exitval = verbose = 0; __db_getopt_reset = 1; - while ((ch = getopt(argc, argv, "a:h:L:t:Vvw")) != EOF) + while ((ch = getopt(argc, argv, "a:h:L:P:t:Vv")) != EOF) switch (ch) { case 'a': switch (optarg[0]) { @@ -117,6 +102,15 @@ db_deadlock_main(argc, argv) case 'L': logfile = optarg; break; + case 'P': + passwd = strdup(optarg); + memset(optarg, 0, strlen(optarg)); + if (passwd == NULL) { + fprintf(stderr, "%s: strdup: %s\n", + progname, strerror(errno)); + return (EXIT_FAILURE); + } + break; case 't': if ((str = strchr(optarg, '.')) != NULL) { *str++ = '\0'; @@ -131,18 +125,12 @@ db_deadlock_main(argc, argv) return (db_deadlock_usage()); break; - case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); return (EXIT_SUCCESS); case 'v': verbose = 1; break; - case 'w': /* Undocumented. */ - /* Detect every 100ms (100000 us) when polling. */ - secs = 0; - usecs = 100000; - break; case '?': default: return (db_deadlock_usage()); @@ -173,14 +161,19 @@ db_deadlock_main(argc, argv) dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto shutdown; + } + if (verbose) { (void)dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, 1); (void)dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR, 1); } /* An environment is required. */ - if ((ret = - dbenv->open(dbenv, home, DB_INIT_LOCK | DB_USE_ENVIRON, 0)) != 0) { + if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0) { dbenv->err(dbenv, ret, "open"); goto shutdown; } @@ -188,7 +181,8 @@ db_deadlock_main(argc, argv) while (!__db_util_interrupted()) { if (verbose) { (void)time(&now); - dbenv->errx(dbenv, "running at %.24s", ctime(&now)); + dbenv->errx(dbenv, + "running at %.24s", __db_ctime(&now, time_buf)); } if ((ret = dbenv->lock_detect(dbenv, 0, atype, NULL)) != 0) { @@ -217,6 +211,9 @@ shutdown: exitval = 1; "%s: dbenv->close: %s\n", progname, db_strerror(ret)); } + if (passwd != NULL) + free(passwd); + /* Resend any caught signal. */ __db_util_sigresend(); @@ -226,15 +223,14 @@ shutdown: exitval = 1; int db_deadlock_usage() { - (void)fprintf(stderr, "%s\n\t%s\n", - "usage: db_deadlock [-Vv]", - "[-a e | m | n | o | W | w | y] [-h home] [-L file] [-t sec.usec]"); + (void)fprintf(stderr, + "usage: %s [-Vv] [-a e | m | n | o | W | w | y]\n\t%s\n", progname, + "[-h home] [-L file] [-P password] [-t sec.usec]"); return (EXIT_FAILURE); } int -db_deadlock_version_check(progname) - const char *progname; +db_deadlock_version_check() { int v_major, v_minor, v_patch; diff --git a/db/build_vxworks/db_deadlock/db_deadlock20.wpj b/db/build_vxworks/db_deadlock/db_deadlock20.wpj index 30dce43c5..ad592d79f 100755 --- a/db/build_vxworks/db_deadlock/db_deadlock20.wpj +++ b/db/build_vxworks/db_deadlock/db_deadlock20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_db_deadlock.c_dependDone FALSE FILE_db_deadlock.c_dependencies - FILE_db_deadlock.c_objects diff --git a/db/build_vxworks/db_deadlock/db_deadlock22.wpj b/db/build_vxworks/db_deadlock/db_deadlock22.wpj index 55c33f9fa..4a8f9fe9e 100755 --- a/db/build_vxworks/db_deadlock/db_deadlock22.wpj +++ b/db/build_vxworks/db_deadlock/db_deadlock22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_db_deadlock.c_dependDone FALSE FILE_db_deadlock.c_dependencies - FILE_db_deadlock.c_objects diff --git a/db/build_vxworks/db_dump/db_dump.c b/db/build_vxworks/db_dump/db_dump.c index 048bed6b9..e8f0f33b5 100644 --- a/db/build_vxworks/db_dump/db_dump.c +++ b/db/build_vxworks/db_dump/db_dump.c @@ -1,39 +1,32 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_dump.c,v 11.99 2004/10/11 18:53:13 bostic Exp $ + * $Id: db_dump.c,v 12.9 2006/08/26 09:23:01 bostic Exp $ */ #include "db_config.h" -#ifndef lint -static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#include -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/db_am.h" +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; +#endif + int db_dump_db_init __P((DB_ENV *, char *, int, u_int32_t, int *)); int db_dump_dump_sub __P((DB_ENV *, DB *, char *, int, int)); int db_dump_is_sub __P((DB *, int *)); int db_dump_main __P((int, char *[])); int db_dump_show_subs __P((DB *)); int db_dump_usage __P((void)); -int db_dump_version_check __P((const char *)); +int db_dump_version_check __P((void)); + +const char *progname; int db_dump(args) @@ -56,7 +49,6 @@ db_dump_main(argc, argv) { extern char *optarg; extern int optind, __db_getopt_reset; - const char *progname = "db_dump"; DB_ENV *dbenv; DB *dbp; u_int32_t cache; @@ -65,7 +57,12 @@ db_dump_main(argc, argv) int ret, Rflag, rflag, resize, subs; char *dopt, *home, *passwd, *subname; - if ((ret = db_dump_version_check(progname)) != 0) + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_dump_version_check()) != 0) return (ret); dbenv = NULL; @@ -238,7 +235,7 @@ retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { } if (dopt != NULL) { - if ((ret = __db_dumptree(dbp, dopt, NULL)) != 0) { + if ((ret = __db_dumptree(dbp, NULL, dopt, NULL)) != 0) { dbp->err(dbp, ret, "__db_dumptree: %s", argv[0]); goto err; } @@ -306,7 +303,7 @@ db_dump_db_init(dbenv, home, is_salvage, cache, is_privatep) * We wish to use the buffer pool so our information is as up-to-date * as possible, even if the mpool cache hasn't been flushed. * - * If we are not doing a salvage, we wish to use the DB_JOINENV flag; + * If we are not doing a salvage, we want to join the environment; * if a locking system is present, this will let us use it and be * safe to run concurrently with other threads of control. (We never * need to use transactions explicitly, as we're read-only.) Note @@ -320,8 +317,8 @@ db_dump_db_init(dbenv, home, is_salvage, cache, is_privatep) * before we create our own. */ *is_privatep = 0; - if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON | - (is_salvage ? DB_INIT_MPOOL : DB_JOINENV), 0)) == 0) + if ((ret = dbenv->open(dbenv, home, + DB_USE_ENVIRON | (is_salvage ? DB_INIT_MPOOL : 0), 0)) == 0) return (0); if (ret == DB_VERSION_MISMATCH) goto err; @@ -505,15 +502,14 @@ db_dump_show_subs(dbp) int db_dump_usage() { - (void)fprintf(stderr, "%s\n\t%s\n", - "usage: db_dump [-klNprRV]", + (void)fprintf(stderr, "usage: %s [-klNprRV]\n\t%s\n", + progname, "[-d ahr] [-f output] [-h home] [-P password] [-s database] db_file"); return (EXIT_FAILURE); } int -db_dump_version_check(progname) - const char *progname; +db_dump_version_check() { int v_major, v_minor, v_patch; diff --git a/db/build_vxworks/db_dump/db_dump20.wpj b/db/build_vxworks/db_dump/db_dump20.wpj index 4916c9275..df7789222 100755 --- a/db/build_vxworks/db_dump/db_dump20.wpj +++ b/db/build_vxworks/db_dump/db_dump20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_db_dump.c_dependDone FALSE FILE_db_dump.c_dependencies - FILE_db_dump.c_objects diff --git a/db/build_vxworks/db_dump/db_dump22.wpj b/db/build_vxworks/db_dump/db_dump22.wpj index 7ab82b18c..c5cc5d80c 100755 --- a/db/build_vxworks/db_dump/db_dump22.wpj +++ b/db/build_vxworks/db_dump/db_dump22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_db_dump.c_dependDone FALSE FILE_db_dump.c_dependencies - FILE_db_dump.c_objects diff --git a/db/build_vxworks/db_hotbackup/db_hotbackup.c b/db/build_vxworks/db_hotbackup/db_hotbackup.c new file mode 100644 index 000000000..0958b2891 --- /dev/null +++ b/db/build_vxworks/db_hotbackup/db_hotbackup.c @@ -0,0 +1,839 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: db_hotbackup.c,v 1.30 2006/08/26 09:23:07 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" +#include "dbinc/log.h" +#include "dbinc/db_page.h" +#include "dbinc/qam.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; +#endif + +enum which_open { OPEN_ORIGINAL, OPEN_HOT_BACKUP }; + +int db_hotbackup_backup_dir_clean __P((DB_ENV *, char *, int *, int, int)); +int db_hotbackup_data_copy __P((DB_ENV *, const char *, const char *, const char *, int)); +int db_hotbackup_env_init __P((DB_ENV **, + char *, const char **, const char ***, char *, enum which_open)); +int db_hotbackup_main __P((int, char *[])); +int db_hotbackup_read_data_dir __P((DB_ENV *, char *, char *, const char *, int, int)); +int db_hotbackup_read_log_dir __P((DB_ENV *, char *, char *, const char *, int *, int, int)); +int db_hotbackup_usage __P((void)); +int db_hotbackup_version_check __P((void)); + +const char *progname; + +int +db_hotbackup(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_hotbackup", args, &argc, &argv); + return (db_hotbackup_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_hotbackup_main(argc, argv) + int argc; + char *argv[]; +{ + extern char *optarg; + extern int optind, __db_getopt_reset; + time_t now; + DB_ENV *dbenv; + u_int data_cnt, data_next; + int ch, checkpoint, copy_min, db_config, exitval; + int remove_max, ret, update, verbose; + char *backup_dir, **data_dir, *home, *passwd; + const char **ddir, **dir, *log_dir; + char home_buf[DB_MAXPATHLEN], time_buf[CTIME_BUFLEN]; + + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_hotbackup_version_check()) != 0) + return (ret); + + checkpoint = db_config = data_cnt = + data_next = exitval = update = verbose = 0; + data_dir = NULL; + backup_dir = home = passwd = NULL; + log_dir = NULL; + copy_min = remove_max = 0; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "b:cDd:h:l:P:uVv")) != EOF) + switch (ch) { + case 'b': + backup_dir = optarg; + break; + case 'c': + checkpoint = 1; + break; + case 'D': + db_config = 1; + break; + case 'd': + /* + * User can specify a list of directories -- keep an + * array, leaving room for the trailing NULL. + */ + if (data_dir == NULL || data_next >= data_cnt - 2) { + data_cnt = data_cnt == 0 ? 20 : data_cnt * 2; + if ((data_dir = realloc(data_dir, + data_cnt * sizeof(*data_dir))) == NULL) { + fprintf(stderr, "%s: %s\n", + progname, strerror(errno)); + return (EXIT_FAILURE); + } + } + data_dir[data_next++] = optarg; + break; + case 'h': + home = optarg; + break; + case 'l': + log_dir = optarg; + break; + case 'P': + passwd = strdup(optarg); + memset(optarg, 0, strlen(optarg)); + if (passwd == NULL) { + fprintf(stderr, "%s: strdup: %s\n", + progname, strerror(errno)); + return (EXIT_FAILURE); + } + break; + case 'u': + update = 1; + break; + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case 'v': + verbose = 1; + break; + case '?': + default: + return (db_hotbackup_usage()); + } + argc -= optind; + argv += optind; + + if (argc != 0) + return (db_hotbackup_usage()); + + if (db_config && (data_dir != NULL || log_dir != NULL)) { + fprintf(stderr, + "%s: cannot specify -D and -d or -l\n", progname); + return (db_hotbackup_usage()); + } + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* + * The home directory defaults to the environment variable DB_HOME. + * The log directory defaults to the home directory. + * + * We require a source database environment directory and a target + * backup directory. + */ + if (home == NULL) { + home = home_buf; + if ((ret = __os_getenv( + NULL, "DB_HOME", &home, sizeof(home_buf))) != 0) { + fprintf(stderr, + "%s failed to get environment variable DB_HOME: %s\n", + progname, db_strerror(ret)); + return (EXIT_FAILURE); + } + /* + * home set to NULL if __os_getenv failed to find DB_HOME. + */ + } + if (home == NULL) { + fprintf(stderr, + "%s: no source database environment specified\n", progname); + return (db_hotbackup_usage()); + } + if (backup_dir == NULL) { + fprintf(stderr, + "%s: no target backup directory specified\n", progname); + return (db_hotbackup_usage()); + } + + /* NULL-terminate any list of data directories. */ + if (data_dir != NULL) + data_dir[data_next] = NULL; + + if (verbose) { + (void)time(&now); + printf("%s: hot backup started at %s", + progname, __db_ctime(&now, time_buf)); + } + + ddir = NULL; + /* Open the source environment. */ + if ((ret = db_hotbackup_env_init(&dbenv, home, + (db_config || log_dir != NULL) ? &log_dir : NULL, + db_config ? &ddir : NULL, passwd, OPEN_ORIGINAL)) != 0) + goto shutdown; + + if (!db_config) + ddir = (const char **)data_dir; + + if (log_dir == NULL) + log_dir = home; + + if (db_config && __os_abspath(log_dir)) { + fprintf(stderr, + "%s: DB_CONFIG must not contain an absolute path for the log directory", + progname); + goto shutdown; + } + + /* + * If the -c option is specified, checkpoint the source home + * database environment, and remove any unnecessary log files. + */ + if (checkpoint) { + if (verbose) + printf("%s: %s: force checkpoint\n", progname, home); + if ((ret = + dbenv->txn_checkpoint(dbenv, 0, 0, DB_FORCE)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->txn_checkpoint"); + goto shutdown; + } + if (!update) { + if (verbose) + printf("%s: %s: remove unnecessary log files\n", + progname, home); + if ((ret = dbenv->log_archive(dbenv, + NULL, DB_ARCH_REMOVE)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->log_archive"); + goto shutdown; + } + } + } + + /* + * If the target directory for the backup does not exist, create it + * with mode read-write-execute for the owner. Ignore errors here, + * it's simpler and more portable to just always try the create. If + * there's a problem, we'll fail with reasonable errors later. + */ + (void)__os_mkdir(NULL, backup_dir, __db_omode("rwx------")); + + /* + * If the target directory for the backup does exist and the -u option + * was specified, all log files in the target directory are removed; + * if the -u option was not specified, all files in the target directory + * are removed. + */ + if ((ret = db_hotbackup_backup_dir_clean( + dbenv, backup_dir, &remove_max, update, verbose)) != 0) + goto shutdown; + + /* + * If the -u option was not specified, copy all database files found in + * the database environment home directory, or any directory specified + * using the -d option, into the target directory for the backup. + */ + if (!update) { + if (db_hotbackup_read_data_dir(dbenv, home, + backup_dir, home, verbose, db_config) != 0) + goto shutdown; + if (ddir != NULL) + for (dir = &ddir[0]; *dir != NULL; ++dir) { + if (__os_abspath(*dir)) { + fprintf(stderr, + "%s: data directory '%s' is absolute path, not permitted with -D option\n", + progname, *dir); + goto shutdown; + } + if (db_hotbackup_read_data_dir(dbenv, home, + backup_dir, *dir, verbose, db_config) != 0) + goto shutdown; + } + } + + /* + * Copy all log files found in the directory specified by the -l option + * (or in the database environment home directory, if no -l option was + * specified), into the target directory for the backup. + * + * The log directory defaults to the home directory. + */ + if (db_hotbackup_read_log_dir(dbenv, db_config ? home : NULL, + backup_dir, log_dir, ©_min, update, verbose) != 0) + goto shutdown; + + /* + * If we're updating a snapshot, the lowest-numbered log file copied + * into the backup directory should be less than, or equal to, the + * highest-numbered log file removed from the backup directory during + * cleanup. + */ + if (update && remove_max < copy_min && + !(remove_max == 0 && copy_min == 1)) { + fprintf(stderr, + "%s: the largest log file removed (%d) must be greater\n", + progname, remove_max); + fprintf(stderr, + "%s: than or equal the smallest log file copied (%d)\n", + progname, copy_min); + goto shutdown; + } + + /* Close the source environment. */ + if ((ret = dbenv->close(dbenv, 0)) != 0) { + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + dbenv = NULL; + goto shutdown; + } + /* Perform catastrophic recovery on the hot backup. */ + if (verbose) + printf("%s: %s: run catastrophic recovery\n", + progname, backup_dir); + if ((ret = db_hotbackup_env_init( + &dbenv, backup_dir, NULL, NULL, passwd, OPEN_HOT_BACKUP)) != 0) + goto shutdown; + + /* + * Remove any unnecessary log files from the hot backup. + */ + if (verbose) + printf("%s: %s: remove unnecessary log files\n", + progname, backup_dir); + if ((ret = + dbenv->log_archive(dbenv, NULL, DB_ARCH_REMOVE)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->log_archive"); + goto shutdown; + } + + if (0) { +shutdown: exitval = 1; + } + if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + if (data_dir != NULL) + free(data_dir); + if (passwd != NULL) + free(passwd); + + if (exitval == 0) { + if (verbose) { + (void)time(&now); + printf("%s: hot backup completed at %s", + progname, __db_ctime(&now, time_buf)); + } + } else { + fprintf(stderr, "%s: HOT BACKUP FAILED!\n", progname); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); + +} + +/* + * env_init -- + * Open a database environment. + */ +int +db_hotbackup_env_init(dbenvp, home, log_dir, data_dir, passwd, which) + DB_ENV **dbenvp; + char *home; + const char **log_dir, ***data_dir; + char *passwd; + enum which_open which; +{ + DB_ENV *dbenv; + int ret; + + *dbenvp = NULL; + + /* + * Create an environment object and initialize it for error reporting. + */ + if ((ret = db_env_create(&dbenv, 0)) != 0) { + fprintf(stderr, + "%s: db_env_create: %s\n", progname, db_strerror(ret)); + return (1); + } + + dbenv->set_errfile(dbenv, stderr); + setbuf(stderr, NULL); + dbenv->set_errpfx(dbenv, progname); + (void)setvbuf(stdout, NULL, _IOLBF, 0); + + /* + * If a log directory has been specified, and it's not the same as the + * home directory, set it for the environment. + */ + if (log_dir != NULL && *log_dir != NULL && *log_dir != home && + (ret = dbenv->set_lg_dir(dbenv, *log_dir)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->set_lg_dir: %s", log_dir); + return (1); + } + + /* Optionally set the password. */ + if (passwd != NULL && + (ret = dbenv->set_encrypt(dbenv, passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->set_encrypt"); + return (1); + } + + switch (which) { + case OPEN_ORIGINAL: + /* + * Opening the database environment we're trying to back up. + * We try to attach to a pre-existing environment; if that + * fails, we create a private environment and try again. + */ + if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && + (ret == DB_VERSION_MISMATCH || + (ret = dbenv->open(dbenv, home, DB_CREATE | + DB_INIT_LOG | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, + 0)) != 0)) { + dbenv->err(dbenv, ret, "DB_ENV->open: %s", home); + return (1); + } + if (log_dir != NULL && *log_dir == NULL) { + (void)dbenv->get_lg_dir(dbenv, log_dir); + if (*log_dir == NULL) + *log_dir = home; + } + if (data_dir != NULL && *data_dir == NULL) + (void)dbenv->get_data_dirs(dbenv, data_dir); + break; + case OPEN_HOT_BACKUP: + /* + * Opening the backup copy of the database environment. We + * better be the only user, we're running recovery. + */ + if ((ret = dbenv->open(dbenv, home, DB_CREATE | + DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_PRIVATE | + DB_RECOVER_FATAL | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->open: %s", home); + return (1); + } + break; + } + + *dbenvp = dbenv; + return (0); +} + +/* + * backup_dir_clean -- + * Clean out the backup directory. + */ +int +db_hotbackup_backup_dir_clean(dbenv, backup_dir, remove_maxp, update, verbose) + DB_ENV *dbenv; + char *backup_dir; + int *remove_maxp, update, verbose; +{ + int cnt, fcnt, ret, v; + char **names, buf[DB_MAXPATHLEN]; + + /* Get a list of file names. */ + if ((ret = __os_dirlist(dbenv, backup_dir, &names, &fcnt)) != 0) { + dbenv->err(dbenv, ret, "%s: directory read", backup_dir); + return (1); + } + for (cnt = fcnt; --cnt >= 0;) { + /* + * Skip log files (if update wasn't specified). + */ + if (strncmp(names[cnt], LFPREFIX, sizeof(LFPREFIX) - 1)) { + if (update) + continue; + } else { + /* Track the highest-numbered log file removed. */ + v = atoi(names[cnt] + sizeof(LFPREFIX) - 1); + if (*remove_maxp < v) + *remove_maxp = v; + } + if ((size_t)snprintf(buf, sizeof(buf), + "%s/%s", backup_dir, names[cnt]) >= sizeof(buf)) { + dbenv->err(dbenv, ret, + "%s/%s: path too long", backup_dir, names[cnt]); + return (1); + } + if (verbose) + printf("%s: removing %s\n", progname, buf); + if ((ret = remove(buf)) != 0) { + dbenv->err(dbenv, ret, "%s: remove", buf); + return (1); + } + } + + __os_dirfree(dbenv, names, fcnt); + + if (verbose && *remove_maxp != 0) + printf("%s: highest numbered log file removed: %d\n", + progname, *remove_maxp); + + return (0); +} + +/* + * read_data_dir -- + * Read a directory looking for databases to copy. + */ +int +db_hotbackup_read_data_dir(dbenv, home, backup_dir, dir, verbose, db_config) + DB_ENV *dbenv; + char *home, *backup_dir; + const char *dir; + int verbose, db_config; +{ + int cnt, fcnt, ret; + char *bd, **names; + char buf[DB_MAXPATHLEN], bbuf[DB_MAXPATHLEN]; + + bd = backup_dir; + if (db_config && dir != home) { + /* Build a path name to the destination. */ + if ((size_t)(cnt = snprintf(bbuf, sizeof(bbuf), + "%s/%s/", backup_dir, dir)) >= sizeof(buf)) { + dbenv->errx(dbenv, + "%s/%s: path too long", backup_dir, dir); + return (1); + } + bd = bbuf; + + /* Create the path. */ + if ((ret = dbenv->set_intermediate_dir( + dbenv, __db_omode("rwx------"), 0)) != 0 || + (ret = __db_mkpath(dbenv, bd)) != 0) { + dbenv->err(dbenv, ret, "%s: cannot create", bd); + return (1); + } + /* step on the trailing '/' */ + bd[cnt] = '\0'; + + /* Build a path name to the source. */ + if ((size_t)snprintf(buf, sizeof(buf), + "%s/%s", home, dir) >= sizeof(buf)) { + dbenv->errx(dbenv, + "%s/%s: path too long", home, dir); + return (1); + } + dir = buf; + } + /* Get a list of file names. */ + if ((ret = __os_dirlist(dbenv, dir, &names, &fcnt)) != 0) { + dbenv->err(dbenv, ret, "%s: directory read", dir); + return (1); + } + for (cnt = fcnt; --cnt >= 0;) { + /* + * Skip files in DB's name space (but not Queue + * extent files, we need them). + */ + if (!strncmp(names[cnt], LFPREFIX, sizeof(LFPREFIX) - 1)) + continue; + if (!strncmp(names[cnt], + DB_REGION_PREFIX, sizeof(DB_REGION_PREFIX) - 1) && + strncmp(names[cnt], + QUEUE_EXTENT_PREFIX, sizeof(QUEUE_EXTENT_PREFIX) - 1)) + continue; + + /* + * Skip DB_CONFIG. + */ + if (!db_config && + !strncmp(names[cnt], "DB_CONFIG", sizeof("DB_CONFIG"))) + continue; + + /* Copy the file. */ + if ((ret = db_hotbackup_data_copy( + dbenv, names[cnt], dir, bd, verbose)) != 0) + return (1); + } + + __os_dirfree(dbenv, names, fcnt); + + return (0); +} + +/* + * read_log_dir -- + * * Read a directory looking for log files to copy. If home + * is passed then we are possibly using a log dir in the destination, + * following DB_CONFIG configuration. + */ +int +db_hotbackup_read_log_dir(dbenv, home, backup_dir, log_dir, copy_minp, update, verbose) + DB_ENV *dbenv; + char *home, *backup_dir; + const char *log_dir; + int *copy_minp, update, verbose; +{ + u_int32_t aflag; + int cnt, ret, v; + char **begin, **names, *backupd; + const char *logd; + char from[DB_MAXPATHLEN], to[DB_MAXPATHLEN]; + + logd = log_dir; + backupd = backup_dir; + if (home != NULL && log_dir != home) { + if ((size_t)snprintf(from, sizeof(from), + "%s/%s", home, log_dir) >= sizeof(from)) { + dbenv->errx(dbenv, + "%s/%s: path too long", home, log_dir); + return (1); + } + logd = strdup(from); + if ((size_t)(cnt = snprintf(to, sizeof(to), + "%s/%s/", backup_dir, log_dir)) >= sizeof(to)) { + dbenv->errx(dbenv, + "%s/%s: path too long", backup_dir, log_dir); + return (1); + } + backupd = strdup(to); + /* Create the path. */ + if ((ret = dbenv->set_intermediate_dir( + dbenv, __db_omode("rwx------"), 0)) != 0 || + (ret = __db_mkpath(dbenv, backupd)) != 0) { + dbenv->err(dbenv, ret, "%s: cannot create", backupd); + return (1); + } + /* step on the trailing '/' */ + backupd[cnt] = '\0'; + } + +again: aflag = DB_ARCH_LOG; + + /* + * If this is an update and we are deleting files, first process + * those files that can be removed, then repeat with the rest. + */ + if (update) + aflag = 0; + /* Get a list of file names to be copied. */ + if ((ret = dbenv->log_archive(dbenv, &names, aflag)) != 0) { + dbenv->err(dbenv, ret, "%s: log_archive", log_dir); + return (1); + } + if (names == NULL) + goto done; + begin = names; + for (; *names != NULL; names++) { + /* Track the lowest-numbered log file copied. */ + v = atoi(*names + sizeof(LFPREFIX) - 1); + if (*copy_minp == 0 || *copy_minp > v) + *copy_minp = v; + + if ((size_t)snprintf(from, sizeof(from), + "%s/%s", logd, *names) >= sizeof(from)) { + dbenv->errx(dbenv, + "%s/%s: path too long", log_dir, *names); + return (1); + } + + /* + * If we're going to remove the file, attempt to rename the + * instead of copying and then removing. The likely failure + * is EXDEV (source and destination are on different volumes). + * Fall back to a copy, regardless of the error. We don't + * worry about partial contents, the copy truncates the file + * on open. + */ + if (update) { + if ((size_t)snprintf(to, sizeof(to), + "%s/%s", backupd, *names) >= sizeof(to)) { + dbenv->errx(dbenv, + "%s/%s: path too long", backupd, *names); + return (1); + } + if (rename(from, to) == 0) { + if (verbose) + printf("%s: moving %s to %s\n", + progname, from, to); + continue; + } + } + + /* Copy the file. */ + if ((ret = db_hotbackup_data_copy(dbenv, + *names, logd, backupd, verbose)) != 0) + return (1); + + if (update) { + if (verbose) + printf("%s: removing %s\n", progname, from); + if ((ret = __os_unlink(dbenv, from)) != 0) { + dbenv->err(dbenv, ret, + "unlink of %s failed", from); + return (1); + } + } + + } + + free(begin); +done: if (update) { + update = 0; + goto again; + } + + if (verbose && *copy_minp != 0) + printf("%s: lowest numbered log file copied: %d\n", + progname, *copy_minp); + if (logd != log_dir) + free((char *)logd); + if (backupd != backup_dir) + free(backupd); + + return (0); +} + +/* + * data_copy -- + * Copy a file into the backup directory. + */ +int +db_hotbackup_data_copy(dbenv, file, from_dir, to_dir, verbose) + DB_ENV *dbenv; + const char *file, *from_dir, *to_dir; + int verbose; +{ + ssize_t nr, nw; + size_t offset; + int ret, rfd, wfd; + char *buf, *taddr; + + ret = 0; + rfd = wfd = -1; + + if (verbose) + printf("%s: copying %s/%s to %s/%s\n", + progname, from_dir, file, to_dir, file); + + /* + * We MUST copy multiples of the page size, atomically, to ensure a + * database page is not updated by another thread of control during + * the copy. + * + * !!! + * The current maximum page size for Berkeley DB is 64KB; we will have + * to increase this value if the maximum page size is ever more than a + * megabyte + */ + if ((buf = malloc(MEGABYTE)) == NULL) { + dbenv->err(dbenv, + errno, "%lu buffer allocation", (u_long)MEGABYTE); + return (1); + } + + /* Open the input file. */ + if ((u_int32_t)snprintf( + buf, MEGABYTE, "%s/%s", from_dir, file) >= MEGABYTE) { + dbenv->errx(dbenv, "%s/%s: path too long", from_dir, file); + goto err; + } + if ((rfd = open(buf, O_RDONLY, 0)) == -1) { + dbenv->err(dbenv, errno, "%s", buf); + goto err; + } + + /* Open the output file. */ + if ((u_int32_t)snprintf( + buf, MEGABYTE, "%s/%s", to_dir, file) >= MEGABYTE) { + dbenv->errx(dbenv, "%s/%s: path too long", to_dir, file); + goto err; + } + if ((wfd = open( + buf, O_CREAT | O_TRUNC | O_WRONLY, __db_omode(OWNER_RW))) == -1) + goto err; + + /* Copy the data. */ + while ((nr = read(rfd, buf, MEGABYTE)) > 0) + for (taddr = buf, offset = 0; + offset < (size_t)nr; taddr += nw, offset += (size_t)nw) { + RETRY_CHK(((nw = write(wfd, + taddr, (u_int)(nr - offset))) < 0 ? 1 : 0), ret); + if (ret != 0) + break; + } + if (nr == -1) { + dbenv->err(dbenv, errno, "%s/%s: read", from_dir, file); + goto err; + } + + if (ret != 0) { + dbenv->err(dbenv, errno, "%s: write %s/%s", to_dir, file); + goto err; + } + + if (0) { +err: ret = 1; + } + if (buf != NULL) + free(buf); + + if (rfd != -1) + (void)close(rfd); + + /* We may be running on a remote filesystem; force the flush. */ + if (wfd != -1 && (fsync(wfd) != 0 || close(wfd) != 0)) { + dbenv->err(dbenv, + errno, "%s: fsync %s/%s", to_dir, file); + ret = 1; + } + return (ret); +} + +int +db_hotbackup_usage() +{ + (void)fprintf(stderr, "usage: %s [-cDuVv]\n\t%s\n", progname, + "[-d data_dir ...] [-h home] [-l log_dir] [-P password] -b backup_dir"); + return (EXIT_FAILURE); +} + +int +db_hotbackup_version_check() +{ + int v_major, v_minor, v_patch; + + /* Make sure we're loaded with the right version of the DB library. */ + (void)db_version(&v_major, &v_minor, &v_patch); + if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) { + fprintf(stderr, + "%s: version %d.%d doesn't match library version %d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + v_major, v_minor); + return (EXIT_FAILURE); + } + return (0); +} diff --git a/db/build_vxworks/db_hotbackup/db_hotbackup20.wpj b/db/build_vxworks/db_hotbackup/db_hotbackup20.wpj new file mode 100755 index 000000000..78e2e3449 --- /dev/null +++ b/db/build_vxworks/db_hotbackup/db_hotbackup20.wpj @@ -0,0 +1,158 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_hotbackup20.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_hotbackup20.a + + + BUILD_PENTIUMgnu_MACRO_AS +cc386 + + + BUILD_PENTIUMgnu_MACRO_CC +cc386 + + + BUILD_PENTIUMgnu_MACRO_CFLAGS +-g \ + -mpentium \ + -ansi \ + -nostdinc \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -fvolatile \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -I$(PRJ_DIR)/.. \ + -I$(PRJ_DIR)/../.. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu_MACRO_CFLAGS_AS +-g \ + -mpentium \ + -ansi \ + -nostdinc \ + -fvolatile \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu_MACRO_CPP +cc386 -E -P -xc + + + BUILD_PENTIUMgnu_MACRO_LD +ld386 + + + BUILD_PENTIUMgnu_MACRO_LDDEPS + + + + BUILD_PENTIUMgnu_MACRO_LDFLAGS +-X -N + + + BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu_MACRO_NM +nm386 -g + + + BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE + + + + BUILD_PENTIUMgnu_MACRO_PRJ_LIBS + + + + BUILD_PENTIUMgnu_MACRO_SIZE +size386 + + + BUILD_PENTIUMgnu_RO_DEPEND_PATH +{$(WIND_BASE)/target/h/} \ + {$(WIND_BASE)/target/src/} \ + {$(WIND_BASE)/target/config/} + + + BUILD_PENTIUMgnu_TC +::tc_PENTIUMgnu + + + BUILD_RULE_archive + + + + BUILD_RULE_db_hotbackup20.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + FILE_db_hotbackup.c_dependDone +FALSE + + + FILE_db_hotbackup.c_dependencies + + + FILE_db_hotbackup.c_objects +db_hotbackup.o + + + FILE_db_hotbackup.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_hotbackup.c + + + userComments +db_hotbackup + diff --git a/db/build_vxworks/db_hotbackup/db_hotbackup22.wpj b/db/build_vxworks/db_hotbackup/db_hotbackup22.wpj new file mode 100755 index 000000000..fcaccb507 --- /dev/null +++ b/db/build_vxworks/db_hotbackup/db_hotbackup22.wpj @@ -0,0 +1,192 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUM2gnu_BUILDRULE +db_hotbackup22.out + + + BUILD_PENTIUM2gnu_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUM2gnu/db_hotbackup22.a + + + BUILD_PENTIUM2gnu_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC +-mcpu=pentiumpro -march=pentiumpro + + + BUILD_PENTIUM2gnu_MACRO_CFLAGS +-g \ + -mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -nostdlib \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -fvolatile \ + -fno-builtin \ + -fno-defer-pop \ + -I$(PRJ_DIR)/.. \ + -I$(PRJ_DIR)/../.. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 \ + -DTOOL_FAMILY=gnu \ + -DTOOL=gnu + + + BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS +-g \ + -mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -xassembler-with-cpp \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 \ + -DTOOL_FAMILY=gnu \ + -DTOOL=gnu + + + BUILD_PENTIUM2gnu_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS + + + + BUILD_PENTIUM2gnu_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu_MACRO_LDFLAGS +-X -N + + + BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL +ccpentium -r -nostdlib -Wl,-X + + + BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND +-M -w + + + BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C +-xc + + + BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO +-U + + + BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE + + + + BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS + + + + BUILD_PENTIUM2gnu_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY +gnu + + + BUILD_PENTIUM2gnu_RO_DEPEND_PATH +{$(WIND_BASE)/target/h/} \ + {$(WIND_BASE)/target/src/} \ + {$(WIND_BASE)/target/config/} + + + BUILD_PENTIUM2gnu_TC +::tc_PENTIUM2gnu + + + BUILD_RULE_archive + + + + BUILD_RULE_db_hotbackup22.out + + + + BUILD_RULE_db_hotbackup22.pl + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUM2gnu + + + BUILD__LIST +PENTIUM2gnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.2 + + FILE_db_hotbackup.c_dependDone +FALSE + + + FILE_db_hotbackup.c_dependencies + + + FILE_db_hotbackup.c_objects +db_hotbackup.o + + + FILE_db_hotbackup.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_hotbackup.c + + + userComments +db_hotbackup + diff --git a/db/build_vxworks/db_int.h b/db/build_vxworks/db_int.h index ccd75bfa1..e76c596cd 100644 --- a/db/build_vxworks/db_int.h +++ b/db/build_vxworks/db_int.h @@ -2,26 +2,74 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_int.in,v 11.155 2004/10/28 16:07:38 ubell Exp $ + * $Id: db_int.in,v 12.41 2006/09/19 15:06:59 bostic Exp $ */ -#ifndef _DB_INTERNAL_H_ -#define _DB_INTERNAL_H_ +#ifndef _DB_INT_H_ +#define _DB_INT_H_ /******************************************************* - * System includes, db.h, a few general DB includes. The DB includes are - * here because it's OK if db_int.h includes queue structure declarations. + * Berkeley DB includes. *******************************************************/ #ifndef NO_SYSTEM_INCLUDES +#include +#ifdef DIAG_MVCC +#include +#endif +#include + +#if defined(__INCLUDE_SELECT_H) +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_VXWORKS +#include +#endif +#endif + +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + +#ifdef HAVE_VXWORKS +#include +#else +#include +#endif + +#if defined(__INCLUDE_NETWORKING) +#include +#include +#include +#include +#endif + #if defined(STDC_HEADERS) || defined(__cplusplus) #include #else #include #endif + +#include #include +#include +#include +#include +#include +#include +#include +#include +#include #endif #include "db.h" @@ -47,7 +95,7 @@ extern "C" { #endif #endif -#if defined(HAVE_LONG_LONG) && defined(HAVE_UNSIGNED_LONG_LONG) +#if defined(HAVE_64BIT_TYPES) #undef INT64_MAX #undef INT64_MIN #undef UINT64_MAX @@ -56,9 +104,6 @@ extern "C" { #define INT64_MAX _I64_MAX #define INT64_MIN _I64_MIN #define UINT64_MAX _UI64_MAX - -#define INT64_FMT "%l64d" -#define UINT64_FMT "%l64u" #else /* * Override the system's 64-bit min/max constants. AIX's 32-bit compiler can @@ -68,11 +113,16 @@ extern "C" { #define INT64_MAX 9223372036854775807LL #define INT64_MIN (-INT64_MAX-1) #define UINT64_MAX 18446744073709551615ULL +#endif /* DB_WIN32 */ #define INT64_FMT "%lld" #define UINT64_FMT "%llu" -#endif /* DB_WIN32 */ -#endif /* HAVE_LONG_LONG && HAVE_UNSIGNED_LONG_LONG */ +#endif /* HAVE_64BIT_TYPES */ + +#undef FALSE +#define FALSE 0 +#undef TRUE +#define TRUE (!FALSE) #define MEGABYTE 1048576 #define GIGABYTE 1073741824 @@ -103,17 +153,17 @@ extern "C" { /* Align an integer to a specific boundary. */ #undef DB_ALIGN #define DB_ALIGN(v, bound) \ - (((v) + (bound) - 1) & ~(((uintmax_t)bound) - 1)) + (((v) + (bound) - 1) & ~(((uintmax_t)(bound)) - 1)) /* Increment a pointer to a specific boundary. */ #undef ALIGNP_INC #define ALIGNP_INC(p, bound) \ - (void *)(((uintptr_t)(p) + (bound) - 1) & ~(((uintptr_t)bound) - 1)) + (void *)(((uintptr_t)(p) + (bound) - 1) & ~(((uintptr_t)(bound)) - 1)) /* Decrement a pointer to a specific boundary. */ #undef ALIGNP_DEC #define ALIGNP_DEC(p, bound) \ - (void *)((uintptr_t)(p) & ~(((uintptr_t)bound) - 1)) + (void *)((uintptr_t)(p) & ~(((uintptr_t)(bound)) - 1)) /* * Print an address as a u_long (a u_long is the largest type we can print @@ -181,7 +231,7 @@ typedef struct __fn { ((int)((total) == 0 ? 0 : ((double)(v) * 100) / (total))) #define DB_PCT_PG(v, total, pgsize) \ ((int)((total) == 0 ? 0 : \ - 100 - ((double)(v) * 100) / ((total) * (pgsize)))) + 100 - ((double)(v) * 100) / (((double)total) * (pgsize)))) /* * Structure used for callback message aggregation. @@ -221,6 +271,8 @@ typedef struct __db_msgbuf { #define STAT_LSN(msg, lsnp) \ __db_msg(dbenv, "%lu/%lu\t%s", \ (u_long)(lsnp)->file, (u_long)(lsnp)->offset, msg) +#define STAT_POINTER(msg, v) \ + __db_msg(dbenv, "%#lx\t%s", P_TO_ULONG(v), msg) #define STAT_STRING(msg, p) do { \ const char *__p = p; /* p may be a function call. */ \ __db_msg(dbenv, "%s\t%s", __p == NULL ? "!Set" : __p, msg); \ @@ -228,6 +280,21 @@ typedef struct __db_msgbuf { #define STAT_ULONG(msg, v) \ __db_msg(dbenv, "%lu\t%s", (u_long)(v), msg) +/* + * There are quite a few places in Berkeley DB where we want to initialize + * a DBT from a string or other random pointer type, using a length typed + * to size_t in most cases. This macro avoids a lot of casting. The macro + * comes in two flavors because we often want to clear the DBT first. + */ +#define DB_SET_DBT(dbt, d, s) do { \ + (dbt).data = (void *)(d); \ + (dbt).size = (u_int32_t)(s); \ +} while (0) +#define DB_INIT_DBT(dbt, d, s) do { \ + memset(&(dbt), 0, sizeof(dbt)); \ + DB_SET_DBT(dbt, d, s); \ +} while (0) + /******************************************************* * API return values *******************************************************/ @@ -249,11 +316,11 @@ typedef struct __db_msgbuf { #define DB_RETOK_LGGET(ret) ((ret) == 0 || (ret) == DB_NOTFOUND) #define DB_RETOK_MPGET(ret) ((ret) == 0 || (ret) == DB_PAGE_NOTFOUND) #define DB_RETOK_REPPMSG(ret) ((ret) == 0 || \ + (ret) == DB_REP_IGNORE || \ (ret) == DB_REP_ISPERM || \ (ret) == DB_REP_NEWMASTER || \ (ret) == DB_REP_NEWSITE || \ - (ret) == DB_REP_NOTPERM || \ - (ret) == DB_REP_STARTUPDONE) + (ret) == DB_REP_NOTPERM) /* Find a reasonable operation-not-supported error. */ #ifdef EOPNOTSUPP @@ -274,8 +341,7 @@ typedef struct __db_msgbuf { * the real path length is, as it was traditionally stored in , * and that file isn't always available. */ -#undef MAXPATHLEN -#define MAXPATHLEN 1024 +#define DB_MAXPATHLEN 1024 #define PATH_DOT "." /* Current working directory. */ /* Path separator character(s). */ @@ -293,21 +359,33 @@ typedef enum { } APPNAME; /* + * A set of macros to check if various functionality has been configured. + * + * ALIVE_ON The is_alive function is configured. * CDB_LOCKING CDB product locking. * CRYPTO_ON Security has been configured. * LOCKING_ON Locking has been configured. * LOGGING_ON Logging has been configured. + * MUTEX_ON Mutexes have been configured. * MPOOL_ON Memory pool has been configured. * REP_ON Replication has been configured. * RPC_ON RPC has been configured. * TXN_ON Transactions have been configured. + * + * REP_ON is more complex than most: if the BDB library was compiled without + * replication support, dbenv->rep_handle will be NULL; if the BDB library + * has replication support, but it was not configured, the region reference + * will be NULL. */ +#define ALIVE_ON(dbenv) ((dbenv)->is_alive != NULL) #define CDB_LOCKING(dbenv) F_ISSET(dbenv, DB_ENV_CDB) #define CRYPTO_ON(dbenv) ((dbenv)->crypto_handle != NULL) #define LOCKING_ON(dbenv) ((dbenv)->lk_handle != NULL) #define LOGGING_ON(dbenv) ((dbenv)->lg_handle != NULL) #define MPOOL_ON(dbenv) ((dbenv)->mp_handle != NULL) -#define REP_ON(dbenv) ((dbenv)->rep_handle != NULL) +#define MUTEX_ON(dbenv) ((dbenv)->mutex_handle != NULL) +#define REP_ON(dbenv) \ + ((dbenv)->rep_handle != NULL && (dbenv)->rep_handle->region != NULL) #define RPC_ON(dbenv) ((dbenv)->cl_handle != NULL) #define TXN_ON(dbenv) ((dbenv)->tx_handle != NULL) @@ -324,8 +402,7 @@ typedef enum { * IS_RECOVERING: The system is running recovery. */ #define IS_RECOVERING(dbenv) \ - (LOGGING_ON(dbenv) && \ - F_ISSET((DB_LOG *)(dbenv)->lg_handle, DBLOG_RECOVER)) + (LOGGING_ON(dbenv) && F_ISSET((dbenv)->lg_handle, DBLOG_RECOVER)) /* Initialization methods are often illegal before/after open is called. */ #define ENV_ILLEGAL_AFTER_OPEN(dbenv, name) \ @@ -339,10 +416,90 @@ typedef enum { #define ENV_REQUIRES_CONFIG(dbenv, handle, i, flags) \ if (handle == NULL) \ return (__db_env_config(dbenv, i, flags)); +#define ENV_REQUIRES_CONFIG_XX(dbenv, handle, i, flags) \ + if ((dbenv)->handle->region == NULL) \ + return (__db_env_config(dbenv, i, flags)); #define ENV_NOT_CONFIGURED(dbenv, handle, i, flags) \ if (F_ISSET((dbenv), DB_ENV_OPEN_CALLED)) \ ENV_REQUIRES_CONFIG(dbenv, handle, i, flags) +#define ENV_ENTER(dbenv, ip) do { \ + int __ret; \ + if ((dbenv)->thr_hashtab == NULL) \ + ip = NULL; \ + else { \ + if ((__ret = \ + __env_set_state(dbenv, &(ip), THREAD_ACTIVE)) != 0) \ + return (__ret); \ + } \ +} while (0) + +#ifdef DIAGNOSTIC +#define ENV_LEAVE(dbenv, ip) do { \ + if ((ip) != NULL) { \ + DB_ASSERT(dbenv, ip->dbth_state == THREAD_ACTIVE); \ + (ip)->dbth_state = THREAD_OUT; \ + } \ +} while (0) +#else +#define ENV_LEAVE(dbenv, ip) do { \ + if ((ip) != NULL) \ + (ip)->dbth_state = THREAD_OUT; \ +} while (0) +#endif +#ifdef DIAGNOSTIC +#define CHECK_THREAD(dbenv) do { \ + DB_THREAD_INFO *__ip; \ + if ((dbenv)->thr_hashtab != NULL) { \ + (void)__env_set_state(dbenv, &__ip, THREAD_DIAGNOSTIC); \ + DB_ASSERT(dbenv, \ + __ip != NULL && __ip->dbth_state != THREAD_OUT); \ + } \ +} while (0) +#ifdef HAVE_STATISTICS +#define CHECK_MTX_THREAD(dbenv, mtx) do { \ + if (mtx->alloc_id != MTX_MUTEX_REGION && \ + mtx->alloc_id != MTX_ENV_REGION && \ + mtx->alloc_id != MTX_APPLICATION) \ + CHECK_THREAD(dbenv); \ +} while (0) +#else +#define CHECK_MTX_THREAD(dbenv, mtx) +#endif +#else +#define CHECK_THREAD(dbenv) +#define CHECK_MTX_THREAD(dbenv, mtx) +#endif + +typedef enum { + THREAD_SLOT_NOT_IN_USE=0, + THREAD_OUT, + THREAD_ACTIVE, + THREAD_BLOCKED +#ifdef DIAGNOSTIC + , THREAD_DIAGNOSTIC +#endif +} DB_THREAD_STATE; + +typedef struct __db_thread_info { + pid_t dbth_pid; + db_threadid_t dbth_tid; + DB_THREAD_STATE dbth_state; + SH_TAILQ_ENTRY dbth_links; +} DB_THREAD_INFO; + +typedef struct __env_thread_info { + u_int32_t thr_count; + u_int32_t thr_max; + u_int32_t thr_nbucket; + roff_t thr_hashoff; +} THREAD_INFO; + +#define DB_EVENT(dbenv, e, einfo) do { \ + if ((dbenv)->db_event_func != NULL) \ + (dbenv)->db_event_func(dbenv, e, einfo); \ +} while (0) + /******************************************************* * Database Access Methods. *******************************************************/ @@ -351,7 +508,7 @@ typedef enum { * The database handle is free-threaded (was opened with DB_THREAD). */ #define DB_IS_THREADED(dbp) \ - ((dbp)->mutexp != NULL) + ((dbp)->mutex != MUTEX_INVALID) /* Initialization methods are often illegal before/after open is called. */ #define DB_ILLEGAL_AFTER_OPEN(dbp, name) \ @@ -399,9 +556,9 @@ typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action; #define IS_INITIALIZED(dbc) ((dbc)->internal->pgno != PGNO_INVALID) /* Free the callback-allocated buffer, if necessary, hanging off of a DBT. */ -#define FREE_IF_NEEDED(sdbp, dbt) \ +#define FREE_IF_NEEDED(dbenv, dbt) \ if (F_ISSET((dbt), DB_DBT_APPMALLOC)) { \ - __os_ufree((sdbp)->dbenv, (dbt)->data); \ + __os_ufree((dbenv), (dbt)->data); \ F_CLR((dbt), DB_DBT_APPMALLOC); \ } @@ -438,8 +595,10 @@ typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action; /* * File types for DB access methods. Negative numbers are reserved to DB. */ -#define DB_FTYPE_SET -1 /* Call pgin/pgout functions. */ -#define DB_FTYPE_NOTSET 0 /* Don't call... */ +#define DB_FTYPE_SET -1 /* Call pgin/pgout functions. */ +#define DB_FTYPE_NOTSET 0 /* Don't call... */ +#define DB_LSN_OFF_NOTSET -1 /* Not yet set. */ +#define DB_CLEARLEN_NOTSET UINT32_MAX /* Not yet set. */ /* Structure used as the DB pgin/pgout pgcookie. */ typedef struct __dbpginfo { @@ -479,12 +638,25 @@ typedef struct __dbpginfo { #define IS_NOT_LOGGED_LSN(LSN) \ ((LSN).file == 0 && (LSN).offset == 1) +/* + * LOG_COMPARE -- compare two LSNs. + */ + +#define LOG_COMPARE(lsn0, lsn1) \ + ((lsn0)->file != (lsn1)->file ? \ + ((lsn0)->file < (lsn1)->file ? -1 : 1) : \ + ((lsn0)->offset != (lsn1)->offset ? \ + ((lsn0)->offset < (lsn1)->offset ? -1 : 1) : 0)) + + /******************************************************* * Txn. *******************************************************/ #define DB_NONBLOCK(C) ((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT)) #define NOWAIT_FLAG(txn) \ ((txn) != NULL && F_ISSET((txn), TXN_NOWAIT) ? DB_LOCK_NOWAIT : 0) +#define IS_REAL_TXN(txn) \ + ((txn) != NULL && !F_ISSET(txn, TXN_CDSGROUP)) #define IS_SUBTRANSACTION(txn) \ ((txn) != NULL && (txn)->parent != NULL) @@ -527,10 +699,12 @@ typedef struct __dbpginfo { struct __db_reginfo_t; typedef struct __db_reginfo_t REGINFO; struct __db_txnhead; typedef struct __db_txnhead DB_TXNHEAD; struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST; -struct __vrfy_childinfo; typedef struct __vrfy_childinfo VRFY_CHILDINFO; +struct __vrfy_childinfo;typedef struct __vrfy_childinfo VRFY_CHILDINFO; struct __vrfy_dbinfo; typedef struct __vrfy_dbinfo VRFY_DBINFO; struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO; +typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB; + #if defined(__cplusplus) } #endif @@ -542,11 +716,13 @@ struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO; #include "dbinc/globals.h" #include "dbinc/debug.h" -#include "dbinc/mutex.h" #include "dbinc/region.h" -#include "dbinc_auto/mutex_ext.h" /* XXX: Include after region.h. */ #include "dbinc_auto/env_ext.h" +#include "dbinc/mutex.h" #include "dbinc/os.h" +#ifdef HAVE_REPLICATION_THREADS +#include "dbinc/repmgr.h" +#endif #include "dbinc/rep.h" #include "dbinc_auto/clib_ext.h" #include "dbinc_auto/common_ext.h" @@ -578,15 +754,18 @@ struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO; * We explicitly use LOGGING_ON/IS_REP_CLIENT here because we don't want to pull * in the log headers, which IS_RECOVERING (and thus DBENV_LOGGING) rely on, and * because DBC_RECOVER should be set anytime IS_RECOVERING would be true. + * + * If we're not in recovery (master - doing an abort a client applying + * a txn), then a client's only path through here is on an internal + * operation, and a master's only path through here is a transactional + * operation. Detect if either is not the case. */ #if defined(DIAGNOSTIC) || defined(DEBUG_ROP) || defined(DEBUG_WOP) -#define DBC_LOGGING(dbc) \ - (LOGGING_ON((dbc)->dbp->dbenv) && \ - !F_ISSET((dbc), DBC_RECOVER) && !IS_REP_CLIENT((dbc)->dbp->dbenv)) +#define DBC_LOGGING(dbc) __dbc_logging(dbc) #else #define DBC_LOGGING(dbc) \ ((dbc)->txn != NULL && LOGGING_ON((dbc)->dbp->dbenv) && \ !F_ISSET((dbc), DBC_RECOVER) && !IS_REP_CLIENT((dbc)->dbp->dbenv)) #endif -#endif /* !_DB_INTERNAL_H_ */ +#endif /* !_DB_INT_H_ */ diff --git a/db/build_vxworks/db_load/db_load.c b/db/build_vxworks/db_load/db_load.c index 1f933efa4..715c4c711 100644 --- a/db/build_vxworks/db_load/db_load.c +++ b/db/build_vxworks/db_load/db_load.c @@ -1,33 +1,23 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_load.c,v 11.100 2004/10/29 17:29:02 bostic Exp $ + * $Id: db_load.c,v 12.18 2006/08/26 09:23:08 bostic Exp $ */ #include "db_config.h" -#ifndef lint -static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#include -#include -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/db_am.h" +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; +#endif + typedef struct { /* XXX: Globals. */ const char *progname; /* Program name. */ char *hdrbuf; /* Input file header. */ @@ -42,7 +32,7 @@ typedef struct { /* XXX: Globals. */ u_int32_t cache; /* Env cache size. */ } LDG; -void db_load_badend __P((DB_ENV *)); +int db_load_badend __P((DB_ENV *)); void db_load_badnum __P((DB_ENV *)); int db_load_configure __P((DB_ENV *, DB *, char **, char **, int *)); int db_load_convprintable __P((DB_ENV *, char *, char **)); @@ -51,13 +41,14 @@ int db_load_dbt_rdump __P((DB_ENV *, DBT *)); int db_load_dbt_rprint __P((DB_ENV *, DBT *)); int db_load_dbt_rrecno __P((DB_ENV *, DBT *, int)); int db_load_dbt_to_recno __P((DB_ENV *, DBT *, db_recno_t *)); -int db_load_digitize __P((DB_ENV *, int, int *)); int db_load_env_create __P((DB_ENV **, LDG *)); int db_load_load __P((DB_ENV *, char *, DBTYPE, char **, u_int, LDG *, int *)); int db_load_main __P((int, char *[])); int db_load_rheader __P((DB_ENV *, DB *, DBTYPE *, char **, int *, int *)); int db_load_usage __P((void)); -int db_load_version_check __P((const char *)); +int db_load_version_check __P((void)); + +const char *progname; #define G(f) ((LDG *)dbenv->app_private)->f @@ -95,7 +86,15 @@ db_load_main(argc, argv) int ch, existed, exitval, ret; char **clist, **clp; - ldg.progname = "db_load"; + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_load_version_check()) != 0) + return (ret); + + ldg.progname = progname; ldg.lineno = 0; ldg.endodata = ldg.endofile = 0; ldg.version = 1; @@ -104,9 +103,6 @@ db_load_main(argc, argv) ldg.home = NULL; ldg.passwd = NULL; - if ((ret = db_load_version_check(ldg.progname)) != 0) - return (ret); - mode = NOTSET; ldf = 0; exitval = existed = 0; @@ -233,11 +229,11 @@ db_load_main(argc, argv) switch (mode) { case FILEID_RESET: exitval = dbenv->fileid_reset( - dbenv, argv[0], ldf & LDF_PASSWORD ? 1 : 0); + dbenv, argv[0], ldf & LDF_PASSWORD ? DB_ENCRYPT : 0); break; case LSN_RESET: exitval = dbenv->lsn_reset( - dbenv, argv[0], ldf & LDF_PASSWORD ? 1 : 0); + dbenv, argv[0], ldf & LDF_PASSWORD ? DB_ENCRYPT : 0); break; case NOTSET: case STANDARD_LOAD: @@ -416,7 +412,7 @@ retry_db: /* Open the DB file. */ if ((ret = dbp->open(dbp, NULL, name, subdb, dbtype, DB_CREATE | (TXN_ON(dbenv) ? DB_AUTO_COMMIT : 0), - __db_omode("rwrwrw"))) != 0) { + __db_omode("rw-rw-rw-"))) != 0) { dbp->err(dbp, ret, "DB->open: %s", name); goto err; } @@ -544,7 +540,7 @@ retry: if (txn != NULL) } } done: rval = 0; - DB_ASSERT(ctxn == NULL); + DB_ASSERT(dbenv, ctxn == NULL); if (txn != NULL && (ret = txn->commit(txn, 0)) != 0) { txn = NULL; goto err; @@ -552,7 +548,7 @@ done: rval = 0; if (0) { err: rval = 1; - DB_ASSERT(ctxn == NULL); + DB_ASSERT(dbenv, ctxn == NULL); if (txn != NULL) (void)txn->abort(txn); } @@ -667,23 +663,22 @@ err: dbenv->err(dbenv, ret, "DB_ENV->open"); if ((ret = dbp->set_flags(dbp, flag)) != 0) { \ dbp->err(dbp, ret, "%s: set_flags: %s", \ G(progname), name); \ - return (1); \ + goto err; \ } \ break; \ case '0': \ break; \ default: \ db_load_badnum(dbenv); \ - return (1); \ + goto err; \ } \ continue; \ } #define NUMBER(name, value, keyword, func, t) \ if (strcmp(name, keyword) == 0) { \ - if (__db_getlong(dbenv, \ - NULL, value, 1, LONG_MAX, &val) != 0) \ - return (1); \ - if ((ret = dbp->func(dbp, (t)val)) != 0) \ + if ((ret = __db_getlong(dbenv, \ + NULL, value, 0, LONG_MAX, &val)) != 0 || \ + (ret = dbp->func(dbp, (t)val)) != 0) \ goto nameerr; \ continue; \ } @@ -694,6 +689,26 @@ err: dbenv->err(dbenv, ret, "DB_ENV->open"); continue; \ } +/* + * The code to check a command-line or input header argument against a list + * of configuration options. It's #defined because it's used in two places + * and the two places have gotten out of sync more than once. + */ +#define CONFIGURATION_LIST_COMPARE \ + NUMBER(name, value, "bt_minkey", set_bt_minkey, u_int32_t); \ + FLAG(name, value, "chksum", DB_CHKSUM); \ + NUMBER(name, value, "db_lorder", set_lorder, int); \ + NUMBER(name, value, "db_pagesize", set_pagesize, u_int32_t); \ + FLAG(name, value, "duplicates", DB_DUP); \ + FLAG(name, value, "dupsort", DB_DUPSORT); \ + NUMBER(name, value, "extentsize", set_q_extentsize, u_int32_t); \ + NUMBER(name, value, "h_ffactor", set_h_ffactor, u_int32_t); \ + NUMBER(name, value, "h_nelem", set_h_nelem, u_int32_t); \ + NUMBER(name, value, "re_len", set_re_len, u_int32_t); \ + STRING(name, value, "re_pad", set_re_pad); \ + FLAG(name, value, "recnum", DB_RECNUM); \ + FLAG(name, value, "renumber", DB_RENUMBER) + /* * configure -- * Handle command-line configuration options. @@ -740,21 +755,7 @@ db_load_configure(dbenv, dbp, clp, subdbp, keysp) continue; } -#ifdef notyet - NUMBER(name, value, "bt_maxkey", set_bt_maxkey, u_int32_t); -#endif - NUMBER(name, value, "bt_minkey", set_bt_minkey, u_int32_t); - NUMBER(name, value, "db_lorder", set_lorder, int); - NUMBER(name, value, "db_pagesize", set_pagesize, u_int32_t); - FLAG(name, value, "chksum", DB_CHKSUM); - FLAG(name, value, "duplicates", DB_DUP); - FLAG(name, value, "dupsort", DB_DUPSORT); - NUMBER(name, value, "h_ffactor", set_h_ffactor, u_int32_t); - NUMBER(name, value, "h_nelem", set_h_nelem, u_int32_t); - NUMBER(name, value, "re_len", set_re_len, u_int32_t); - STRING(name, value, "re_pad", set_re_pad); - FLAG(name, value, "recnum", DB_RECNUM); - FLAG(name, value, "renumber", DB_RENUMBER); + CONFIGURATION_LIST_COMPARE; dbp->errx(dbp, "unknown command-line configuration keyword \"%s\"", name); @@ -764,7 +765,7 @@ db_load_configure(dbenv, dbp, clp, subdbp, keysp) nameerr: dbp->err(dbp, ret, "%s: %s=%s", G(progname), name, value); - return (1); +err: return (1); } /* @@ -786,7 +787,7 @@ db_load_rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp) *dbtypep = DB_UNKNOWN; *checkprintp = 0; - name = p = NULL; + name = NULL; /* * We start with a smallish buffer; most headers are small. @@ -795,10 +796,8 @@ db_load_rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp) buflen = 4096; if (G(hdrbuf) == NULL) { hdr = 0; - if ((buf = malloc(buflen)) == NULL) { -memerr: dbp->errx(dbp, "could not allocate buffer %d", buflen); - return (1); - } + if ((buf = malloc(buflen)) == NULL) + goto memerr; G(hdrbuf) = buf; G(origline) = G(lineno); } else { @@ -847,7 +846,6 @@ memerr: dbp->errx(dbp, "could not allocate buffer %d", buflen); start += linelen; if (name != NULL) { - *p = '='; free(name); name = NULL; } @@ -931,22 +929,7 @@ memerr: dbp->errx(dbp, "could not allocate buffer %d", buflen); continue; } -#ifdef notyet - NUMBER(name, value, "bt_maxkey", set_bt_maxkey, u_int32_t); -#endif - NUMBER(name, value, "bt_minkey", set_bt_minkey, u_int32_t); - NUMBER(name, value, "db_lorder", set_lorder, int); - NUMBER(name, value, "db_pagesize", set_pagesize, u_int32_t); - NUMBER(name, value, "extentsize", set_q_extentsize, u_int32_t); - FLAG(name, value, "chksum", DB_CHKSUM); - FLAG(name, value, "duplicates", DB_DUP); - FLAG(name, value, "dupsort", DB_DUPSORT); - NUMBER(name, value, "h_ffactor", set_h_ffactor, u_int32_t); - NUMBER(name, value, "h_nelem", set_h_nelem, u_int32_t); - NUMBER(name, value, "re_len", set_re_len, u_int32_t); - STRING(name, value, "re_pad", set_re_pad); - FLAG(name, value, "recnum", DB_RECNUM); - FLAG(name, value, "renumber", DB_RENUMBER); + CONFIGURATION_LIST_COMPARE; dbp->errx(dbp, "unknown input-file header configuration keyword \"%s\"", @@ -954,22 +937,70 @@ memerr: dbp->errx(dbp, "could not allocate buffer %d", buflen); goto err; } ret = 0; + if (0) { nameerr: dbp->err(dbp, ret, "%s: %s=%s", G(progname), name, value); -err: ret = 1; + ret = 1; } if (0) { badfmt: dbp->errx(dbp, "line %lu: unexpected format", G(lineno)); ret = 1; } - if (name != NULL) { - if (p != NULL) - *p = '='; - free(name); + if (0) { +memerr: dbp->errx(dbp, "unable to allocate memory"); +err: ret = 1; } + if (name != NULL) + free(name); return (ret); } +/* + * Macro to convert a pair of hex bytes to a decimal value. + * + * !!! + * Note that this macro is side-effect safe. This was done deliberately, + * callers depend on it. + */ +#define DIGITIZE(store, v1, v2) { \ + char _v1, _v2; \ + _v1 = (v1); \ + _v2 = (v2); \ + if ((_v1) > 'f' || (_v2) > 'f') \ + return (db_load_badend(dbenv)); \ + (store) = \ + ((_v1) == '0' ? 0 : \ + ((_v1) == '1' ? 1 : \ + ((_v1) == '2' ? 2 : \ + ((_v1) == '3' ? 3 : \ + ((_v1) == '4' ? 4 : \ + ((_v1) == '5' ? 5 : \ + ((_v1) == '6' ? 6 : \ + ((_v1) == '7' ? 7 : \ + ((_v1) == '8' ? 8 : \ + ((_v1) == '9' ? 9 : \ + ((_v1) == 'a' ? 10 : \ + ((_v1) == 'b' ? 11 : \ + ((_v1) == 'c' ? 12 : \ + ((_v1) == 'd' ? 13 : \ + ((_v1) == 'e' ? 14 : 15))))))))))))))) << 4 | \ + ((_v2) == '0' ? 0 : \ + ((_v2) == '1' ? 1 : \ + ((_v2) == '2' ? 2 : \ + ((_v2) == '3' ? 3 : \ + ((_v2) == '4' ? 4 : \ + ((_v2) == '5' ? 5 : \ + ((_v2) == '6' ? 6 : \ + ((_v2) == '7' ? 7 : \ + ((_v2) == '8' ? 8 : \ + ((_v2) == '9' ? 9 : \ + ((_v2) == 'a' ? 10 : \ + ((_v2) == 'b' ? 11 : \ + ((_v2) == 'c' ? 12 : \ + ((_v2) == 'd' ? 13 : \ + ((_v2) == 'e' ? 14 : 15))))))))))))))); \ +} + /* * convprintable -- * Convert a printable-encoded string into a newly allocated string. @@ -988,8 +1019,7 @@ db_load_convprintable(dbenv, instr, outstrp) DB_ENV *dbenv; char *instr, **outstrp; { - char c, *outstr; - int e1, e2; + char *outstr; /* * Just malloc a string big enough for the whole input string; @@ -1000,21 +1030,13 @@ db_load_convprintable(dbenv, instr, outstrp) *outstrp = outstr; - e1 = e2 = 0; for ( ; *instr != '\0'; instr++) if (*instr == '\\') { if (*++instr == '\\') { *outstr++ = '\\'; continue; } - c = db_load_digitize(dbenv, *instr, &e1) << 4; - c |= db_load_digitize(dbenv, *++instr, &e2); - if (e1 || e2) { - db_load_badend(dbenv); - return (EINVAL); - } - - *outstr++ = c; + DIGITIZE(*outstr++, *instr, *++instr); } else *outstr++ = *instr; @@ -1034,21 +1056,20 @@ db_load_dbt_rprint(dbenv, dbtp) { u_int32_t len; u_int8_t *p; - int c1, c2, e, escape, first; + int c1, c2, escape, first; char buf[32]; ++G(lineno); first = 1; - e = escape = 0; + escape = 0; for (p = dbtp->data, len = 0; (c1 = getchar()) != '\n';) { if (c1 == EOF) { if (len == 0) { G(endofile) = G(endodata) = 1; return (0); } - db_load_badend(dbenv); - return (1); + return (db_load_badend(dbenv)); } if (first) { first = 0; @@ -1057,10 +1078,8 @@ db_load_dbt_rprint(dbenv, dbtp) buf[0] = c1; if (fgets(buf + 1, sizeof(buf) - 1, stdin) == NULL || - strcmp(buf, "DATA=END\n") != 0) { - db_load_badend(dbenv); - return (1); - } + strcmp(buf, "DATA=END\n") != 0) + return (db_load_badend(dbenv)); G(endodata) = 1; return (0); } @@ -1069,14 +1088,9 @@ db_load_dbt_rprint(dbenv, dbtp) } if (escape) { if (c1 != '\\') { - if ((c2 = getchar()) == EOF) { - db_load_badend(dbenv); - return (1); - } - c1 = db_load_digitize(dbenv, - c1, &e) << 4 | db_load_digitize(dbenv, c2, &e); - if (e) - return (1); + if ((c2 = getchar()) == EOF) + return (db_load_badend(dbenv)); + DIGITIZE(c1, c1, c2); } escape = 0; } else @@ -1112,21 +1126,19 @@ db_load_dbt_rdump(dbenv, dbtp) { u_int32_t len; u_int8_t *p; - int c1, c2, e, first; + int c1, c2, first; char buf[32]; ++G(lineno); first = 1; - e = 0; for (p = dbtp->data, len = 0; (c1 = getchar()) != '\n';) { if (c1 == EOF) { if (len == 0) { G(endofile) = G(endodata) = 1; return (0); } - db_load_badend(dbenv); - return (1); + return (db_load_badend(dbenv)); } if (first) { first = 0; @@ -1135,20 +1147,16 @@ db_load_dbt_rdump(dbenv, dbtp) buf[0] = c1; if (fgets(buf + 1, sizeof(buf) - 1, stdin) == NULL || - strcmp(buf, "DATA=END\n") != 0) { - db_load_badend(dbenv); - return (1); - } + strcmp(buf, "DATA=END\n") != 0) + return (db_load_badend(dbenv)); G(endodata) = 1; return (0); } continue; } } - if ((c2 = getchar()) == EOF) { - db_load_badend(dbenv); - return (1); - } + if ((c2 = getchar()) == EOF) + return (db_load_badend(dbenv)); if (len >= dbtp->ulen - 10) { dbtp->ulen *= 2; if ((dbtp->data = @@ -1159,9 +1167,7 @@ db_load_dbt_rdump(dbenv, dbtp) p = (u_int8_t *)dbtp->data + len; } ++len; - *p++ = db_load_digitize(dbenv, c1, &e) << 4 | db_load_digitize(dbenv, c2, &e); - if (e) - return (1); + DIGITIZE(*p++, c1, c2); } dbtp->size = len; @@ -1194,7 +1200,7 @@ db_load_dbt_rrecno(dbenv, dbtp, ishex) } if (buf[0] != ' ') - goto bad; + goto err; /* * If we're expecting a hex key, do an in-place conversion @@ -1210,22 +1216,22 @@ db_load_dbt_rrecno(dbenv, dbtp, ishex) * end-of-string conditions. */ if (*q++ != '3') - goto bad; + goto err; if (*q == '\n' || *q == '\0') - goto bad; + goto err; *p++ = *q++; } *p = '\0'; } - if (__db_getulong(dbenv, G(progname), buf + 1, 0, 0, &recno)) { -bad: db_load_badend(dbenv); - return (1); - } + if (__db_getulong(dbenv, G(progname), buf + 1, 0, 0, &recno)) + goto err; *((db_recno_t *)dbtp->data) = recno; dbtp->size = sizeof(db_recno_t); return (0); + +err: return (db_load_badend(dbenv)); } int @@ -1242,42 +1248,6 @@ db_load_dbt_to_recno(dbenv, dbt, recnop) return (__db_getulong(dbenv, G(progname), buf, 0, 0, (u_long *)recnop)); } -/* - * digitize -- - * Convert a character to an integer. - */ -int -db_load_digitize(dbenv, c, errorp) - DB_ENV *dbenv; - int c, *errorp; -{ - switch (c) { /* Don't depend on ASCII ordering. */ - case '0': return (0); - case '1': return (1); - case '2': return (2); - case '3': return (3); - case '4': return (4); - case '5': return (5); - case '6': return (6); - case '7': return (7); - case '8': return (8); - case '9': return (9); - case 'a': return (10); - case 'b': return (11); - case 'c': return (12); - case 'd': return (13); - case 'e': return (14); - case 'f': return (15); - default: /* Not possible. */ - break; - } - - dbenv->errx(dbenv, "unexpected hexadecimal value"); - *errorp = 1; - - return (0); -} - /* * badnum -- * Display the bad number message. @@ -1294,11 +1264,12 @@ db_load_badnum(dbenv) * badend -- * Display the bad end to input message. */ -void +int db_load_badend(dbenv) DB_ENV *dbenv; { dbenv->errx(dbenv, "unexpected end of input data or key/data pair"); + return (1); } /* @@ -1308,17 +1279,16 @@ db_load_badend(dbenv) int db_load_usage() { - (void)fprintf(stderr, "%s\n\t%s\n", - "usage: db_load [-nTV] [-c name=value] [-f file]", + (void)fprintf(stderr, "usage: %s %s\n\t%s\n", progname, + "[-nTV] [-c name=value] [-f file]", "[-h home] [-P password] [-t btree | hash | recno | queue] db_file"); - (void)fprintf(stderr, "%s\n", - "usage: db_load -r lsn | fileid [-h home] [-P password] db_file"); + (void)fprintf(stderr, "usage: %s %s\n", + progname, "-r lsn | fileid [-h home] [-P password] db_file"); return (EXIT_FAILURE); } int -db_load_version_check(progname) - const char *progname; +db_load_version_check() { int v_major, v_minor, v_patch; diff --git a/db/build_vxworks/db_load/db_load20.wpj b/db/build_vxworks/db_load/db_load20.wpj index f3d4cdf95..964e8734b 100755 --- a/db/build_vxworks/db_load/db_load20.wpj +++ b/db/build_vxworks/db_load/db_load20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_db_load.c_dependDone FALSE FILE_db_load.c_dependencies - FILE_db_load.c_objects diff --git a/db/build_vxworks/db_load/db_load22.wpj b/db/build_vxworks/db_load/db_load22.wpj index c04559c80..4560b786e 100755 --- a/db/build_vxworks/db_load/db_load22.wpj +++ b/db/build_vxworks/db_load/db_load22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_db_load.c_dependDone FALSE FILE_db_load.c_dependencies - FILE_db_load.c_objects diff --git a/db/build_vxworks/db_printlog/db_printlog.c b/db/build_vxworks/db_printlog/db_printlog.c index 3227f2e5e..eef054dac 100644 --- a/db/build_vxworks/db_printlog/db_printlog.c +++ b/db/build_vxworks/db_printlog/db_printlog.c @@ -1,29 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_printlog.c,v 11.64 2004/06/17 17:35:17 bostic Exp $ + * $Id: db_printlog.c,v 12.20 2006/08/26 09:23:10 bostic Exp $ */ #include "db_config.h" -#ifndef lint -static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#include -#include -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/btree.h" @@ -33,12 +18,27 @@ static const char copyright[] = #include "dbinc/qam.h" #include "dbinc/txn.h" -int db_printlog_lsn_arg __P((const char *, char *, DB_LSN *)); +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; +#endif + +int db_printlog_env_init_print __P((DB_ENV *, u_int32_t, + int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int db_printlog_env_init_print_42 __P((DB_ENV *, + int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int db_printlog_env_init_print_43 __P((DB_ENV *, + int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int db_printlog_env_init_print_45 __P((DB_ENV *, + int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int db_printlog_lsn_arg __P((char *, DB_LSN *)); int db_printlog_main __P((int, char *[])); int db_printlog_open_rep_db __P((DB_ENV *, DB **, DBC **)); int db_printlog_print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops)); int db_printlog_usage __P((void)); -int db_printlog_version_check __P((const char *)); +int db_printlog_version_check __P((void)); + +const char *progname; int db_printlog(args) @@ -61,20 +61,24 @@ db_printlog_main(argc, argv) { extern char *optarg; extern int optind, __db_getopt_reset; - const char *progname = "db_printlog"; DB *dbp; DBC *dbc; DBT data, keydbt; DB_ENV *dbenv; DB_LOGC *logc; - DB_LSN key, start, stop; + DB_LSN key, start, stop, verslsn; size_t dtabsize; - u_int32_t logcflag; + u_int32_t logcflag, newversion, version; int ch, cmp, exitval, nflag, rflag, ret, repflag; int (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); char *home, *passwd; - if ((ret = db_printlog_version_check(progname)) != 0) + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_printlog_version_check()) != 0) return (ret); dbp = NULL; @@ -92,11 +96,13 @@ db_printlog_main(argc, argv) while ((ch = getopt(argc, argv, "b:e:h:NP:rRV")) != EOF) switch (ch) { case 'b': - if (db_printlog_lsn_arg(progname, optarg, &start)) + /* Don't use getsubopt(3), not all systems have it. */ + if (db_printlog_lsn_arg(optarg, &start)) return (db_printlog_usage()); break; case 'e': - if (db_printlog_lsn_arg(progname, optarg, &stop)) + /* Don't use getsubopt(3), not all systems have it. */ + if (db_printlog_lsn_arg(optarg, &stop)) return (db_printlog_usage()); break; case 'h': @@ -192,8 +198,7 @@ db_printlog_main(argc, argv) dbenv->err(dbenv, ret, "DB_ENV->open"); goto shutdown; } - } else if ((ret = dbenv->open(dbenv, home, - DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 && + } else if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && (ret == DB_VERSION_MISMATCH || (ret = dbenv->open(dbenv, home, DB_CREATE | DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) { @@ -201,23 +206,6 @@ db_printlog_main(argc, argv) goto shutdown; } - /* Initialize print callbacks. */ - if ((ret = __bam_init_print(dbenv, &dtab, &dtabsize)) != 0 || - (ret = __crdel_init_print(dbenv, &dtab, &dtabsize)) != 0 || - (ret = __db_init_print(dbenv, &dtab, &dtabsize)) != 0 || - (ret = __dbreg_init_print(dbenv, &dtab, &dtabsize)) != 0 || - (ret = __fop_init_print(dbenv, &dtab, &dtabsize)) != 0 || -#ifdef HAVE_HASH - (ret = __ham_init_print(dbenv, &dtab, &dtabsize)) != 0 || -#endif -#ifdef HAVE_QUEUE - (ret = __qam_init_print(dbenv, &dtab, &dtabsize)) != 0 || -#endif - (ret = __txn_init_print(dbenv, &dtab, &dtabsize)) != 0) { - dbenv->err(dbenv, ret, "callback: initialization"); - goto shutdown; - } - /* Allocate a log cursor. */ if (repflag) { if ((ret = db_printlog_open_rep_db(dbenv, &dbp, &dbc)) != 0) @@ -236,6 +224,24 @@ db_printlog_main(argc, argv) } memset(&data, 0, sizeof(data)); + /* + * If we're using the repflag, we're immediately initializing + * the print table. Use the current version. If we're printing + * the log then initialize version to 0 so that we get the + * correct version right away. + */ + if (repflag) + version = DB_LOGVERSION; + else + version = 0; + ZERO_LSN(verslsn); + + /* Initialize print callbacks if repflag. */ + if (repflag && + (ret = db_printlog_env_init_print(dbenv, version, &dtab, &dtabsize)) != 0) { + dbenv->err(dbenv, ret, "callback: initialization"); + goto shutdown; + } for (; !__db_util_interrupted(); logcflag = rflag ? DB_PREV : DB_NEXT) { if (repflag) { ret = dbc->c_get(dbc, &keydbt, &data, logcflag); @@ -247,7 +253,7 @@ db_printlog_main(argc, argv) if (ret == DB_NOTFOUND) break; dbenv->err(dbenv, - ret, repflag ? "DB_LOGC->get" : "DBC->get"); + ret, repflag ? "DBC->get" : "DB_LOGC->get"); goto shutdown; } @@ -255,10 +261,30 @@ db_printlog_main(argc, argv) * We may have reached the end of the range we're displaying. */ if (!IS_ZERO_LSN(stop)) { - cmp = log_compare(&key, &stop); + cmp = LOG_COMPARE(&key, &stop); if ((rflag && cmp < 0) || (!rflag && cmp > 0)) break; } + if (!repflag && key.file != verslsn.file) { + /* + * If our log file changed, we need to see if the + * version of the log file changed as well. + * If it changed, reset the print table. + */ + if ((ret = logc->version(logc, &newversion, 0)) != 0) { + dbenv->err(dbenv, ret, "DB_LOGC->version"); + goto shutdown; + } + if (version != newversion) { + version = newversion; + if ((ret = db_printlog_env_init_print(dbenv, version, + &dtab, &dtabsize)) != 0) { + dbenv->err(dbenv, ret, + "callback: initialization"); + goto shutdown; + } + } + } ret = __db_dispatch(dbenv, dtab, dtabsize, &data, &key, DB_TXN_PRINT, NULL); @@ -309,17 +335,154 @@ shutdown: exitval = 1; return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } +/* + * env_init_print -- + */ +int +db_printlog_env_init_print(dbenv, version, dtabp, dtabsizep) + DB_ENV *dbenv; + u_int32_t version; + int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t *dtabsizep; +{ + int ret; + + /* + * We need to prime the print table with the current print + * functions. Then we overwrite only specific entries based on + * each previous version we support. + */ + if ((ret = db_printlog_env_init_print_45(dbenv, dtabp, dtabsizep)) != 0) + return (ret); + + switch (version) { + /* + * There are no log record/recovery differences between + * 4.4 and 4.5. The log version changed due to checksum. + */ + case DB_LOGVERSION_45: + case DB_LOGVERSION_44: + ret = 0; + break; + case DB_LOGVERSION_43: + ret = db_printlog_env_init_print_43(dbenv, dtabp, dtabsizep); + break; + case DB_LOGVERSION_42: + ret = db_printlog_env_init_print_42(dbenv, dtabp, dtabsizep); + break; + default: + __db_errx(dbenv, "Unknown version %lu", (u_long)version); + ret = EINVAL; + break; + } + return (ret); +} + +int +db_printlog_env_init_print_42(dbenv, dtabp, dtabsizep) + DB_ENV *dbenv; + int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t *dtabsizep; +{ + int ret; + + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __db_relink_42_print, DB___db_relink_42)) != 0) + goto err; + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __db_pg_alloc_42_print, DB___db_pg_alloc_42)) != 0) + goto err; + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __db_pg_free_42_print, DB___db_pg_free_42)) != 0) + goto err; + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __db_pg_freedata_42_print, DB___db_pg_freedata_42)) != 0) + goto err; +#if HAVE_HASH + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __ham_metagroup_42_print, DB___ham_metagroup_42)) != 0) + goto err; + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __ham_groupalloc_42_print, DB___ham_groupalloc_42)) != 0) + goto err; +#endif + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __txn_ckp_42_print, DB___txn_ckp_42)) != 0) + goto err; + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __txn_regop_42_print, DB___txn_regop_42)) != 0) + goto err; +err: + return (ret); +} + +int +db_printlog_env_init_print_43(dbenv, dtabp, dtabsizep) + DB_ENV *dbenv; + int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t *dtabsizep; +{ + int ret; + + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __bam_relink_43_print, DB___bam_relink_43)) != 0) + goto err; + /* + * We want to use the 4.2-based txn_regop record. + */ + if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep, + __txn_regop_42_print, DB___txn_regop_42)) != 0) + goto err; +err: + return (ret); +} + +/* + * env_init_print_45 -- + * + */ +int +db_printlog_env_init_print_45(dbenv, dtabp, dtabsizep) + DB_ENV *dbenv; + int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t *dtabsizep; +{ + int ret; + + if ((ret = __bam_init_print(dbenv, dtabp, dtabsizep)) != 0) + goto err; + if ((ret = __crdel_init_print(dbenv, dtabp, dtabsizep)) != 0) + goto err; + if ((ret = __db_init_print(dbenv, dtabp, dtabsizep)) != 0) + goto err; + if ((ret = __dbreg_init_print(dbenv, dtabp, dtabsizep)) != 0) + goto err; + if ((ret = __fop_init_print(dbenv, dtabp, dtabsizep)) != 0) + goto err; +#ifdef HAVE_HASH + if ((ret = __ham_init_print(dbenv, dtabp, dtabsizep)) != 0) + goto err; +#endif +#ifdef HAVE_QUEUE + if ((ret = __qam_init_print(dbenv, dtabp, dtabsizep)) != 0) + goto err; +#endif + if ((ret = __txn_init_print(dbenv, dtabp, dtabsizep)) != 0) + goto err; +err: + return (ret); +} + int db_printlog_usage() { - fprintf(stderr, "usage: db_printlog %s\n", + fprintf(stderr, "usage: %s %s\n", progname, "[-NrV] [-b file/offset] [-e file/offset] [-h home] [-P password]"); return (EXIT_FAILURE); } int -db_printlog_version_check(progname) - const char *progname; +db_printlog_version_check() { int v_major, v_minor, v_patch; @@ -346,7 +509,7 @@ db_printlog_print_app_record(dbenv, dbt, lsnp, op) int ch; u_int32_t i, rectype; - DB_ASSERT(op == DB_TXN_PRINT); + DB_ASSERT(dbenv, op == DB_TXN_PRINT); COMPQUIET(dbenv, NULL); COMPQUIET(op, DB_TXN_PRINT); @@ -393,7 +556,7 @@ db_printlog_open_rep_db(dbenv, dbpp, dbcp) dbp = *dbpp; if ((ret = - dbp->open(dbp, NULL, "__db.rep.db", NULL, DB_BTREE, 0, 0)) != 0) { + dbp->open(dbp, NULL, REPDBNAME, NULL, DB_BTREE, 0, 0)) != 0) { dbenv->err(dbenv, ret, "DB->open"); goto err; } @@ -415,31 +578,24 @@ err: if (*dbpp != NULL) * Parse a LSN argument. */ int -db_printlog_lsn_arg(progname, optarg, lsnp) - const char *progname; - char *optarg; +db_printlog_lsn_arg(arg, lsnp) + char *arg; DB_LSN *lsnp; { - char *p; u_long uval; + char *p; /* * Expected format is: lsn.file/lsn.offset. - * - * Don't use getsubopt(3), some systems don't have it. */ - if ((p = strchr(optarg, '/')) == NULL) + if ((p = strchr(arg, '/')) == NULL) return (1); *p = '\0'; - if (__db_getulong(NULL, progname, optarg, 0, 0, &uval)) - return (1); - if (uval > UINT32_MAX) + if (__db_getulong(NULL, progname, arg, 0, UINT32_MAX, &uval)) return (1); lsnp->file = uval; - if (__db_getulong(NULL, progname, p + 1, 0, 0, &uval)) - return (1); - if (uval > UINT32_MAX) + if (__db_getulong(NULL, progname, p + 1, 0, UINT32_MAX, &uval)) return (1); lsnp->offset = uval; return (0); diff --git a/db/build_vxworks/db_printlog/db_printlog20.wpj b/db/build_vxworks/db_printlog/db_printlog20.wpj index ba418399f..af88d8f8e 100755 --- a/db/build_vxworks/db_printlog/db_printlog20.wpj +++ b/db/build_vxworks/db_printlog/db_printlog20.wpj @@ -134,13 +134,56 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 + FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../btree/btree_autop.c_objects +btree_autop.o + + + FILE_$(PRJ_DIR)/../../btree/btree_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../db/crdel_autop.c_objects +crdel_autop.o + + + FILE_$(PRJ_DIR)/../../db/crdel_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../db/db_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../db/db_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../db/db_autop.c_objects +db_autop.o + + + FILE_$(PRJ_DIR)/../../db/db_autop.c_tool +C/C++ compiler + FILE_db_printlog.c_dependDone FALSE FILE_db_printlog.c_dependencies - FILE_db_printlog.c_objects @@ -151,8 +194,107 @@ db_printlog.o C/C++ compiler + FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_objects +dbreg_autop.o + + + FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_objects +fileops_autop.o + + + FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../hash/hash_autop.c_objects +hash_autop.o + + + FILE_$(PRJ_DIR)/../../hash/hash_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../qam/qam_autop.c_objects +qam_autop.o + + + FILE_$(PRJ_DIR)/../../qam/qam_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../rep/rep_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../rep/rep_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../rep/rep_autop.c_objects +rep_autop.o + + + FILE_$(PRJ_DIR)/../../rep/rep_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../txn/txn_autop.c_objects +txn_autop.o + + + FILE_$(PRJ_DIR)/../../txn/txn_autop.c_tool +C/C++ compiler + + PROJECT_FILES -$(PRJ_DIR)/db_printlog.c +$(PRJ_DIR)/../../btree/btree_autop.c \ +$(PRJ_DIR)/../../db/crdel_autop.c \ +$(PRJ_DIR)/../../db/db_autop.c \ +$(PRJ_DIR)/db_printlog.c \ +$(PRJ_DIR)/../../dbreg/dbreg_autop.c \ +$(PRJ_DIR)/../../fileops/fileops_autop.c \ +$(PRJ_DIR)/../../hash/hash_autop.c \ +$(PRJ_DIR)/../../qam/qam_autop.c \ +$(PRJ_DIR)/../../rep/rep_autop.c \ +$(PRJ_DIR)/../../txn/txn_autop.c userComments diff --git a/db/build_vxworks/db_printlog/db_printlog22.wpj b/db/build_vxworks/db_printlog/db_printlog22.wpj index b3b31d757..1ef5d5a9f 100755 --- a/db/build_vxworks/db_printlog/db_printlog22.wpj +++ b/db/build_vxworks/db_printlog/db_printlog22.wpj @@ -168,13 +168,56 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 + FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../btree/btree_autop.c_objects +btree_autop.o + + + FILE_$(PRJ_DIR)/../../btree/btree_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../db/crdel_autop.c_objects +crdel_autop.o + + + FILE_$(PRJ_DIR)/../../db/crdel_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../db/db_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../db/db_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../db/db_autop.c_objects +db_autop.o + + + FILE_$(PRJ_DIR)/../../db/db_autop.c_tool +C/C++ compiler + FILE_db_printlog.c_dependDone FALSE FILE_db_printlog.c_dependencies - FILE_db_printlog.c_objects @@ -185,8 +228,107 @@ db_printlog.o C/C++ compiler + FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_objects +dbreg_autop.o + + + FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_objects +fileops_autop.o + + + FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../hash/hash_autop.c_objects +hash_autop.o + + + FILE_$(PRJ_DIR)/../../hash/hash_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../qam/qam_autop.c_objects +qam_autop.o + + + FILE_$(PRJ_DIR)/../../qam/qam_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../rep/rep_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../rep/rep_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../rep/rep_autop.c_objects +rep_autop.o + + + FILE_$(PRJ_DIR)/../../rep/rep_autop.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependDone +FALSE + + + FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependencies + + + FILE_$(PRJ_DIR)/../../txn/txn_autop.c_objects +txn_autop.o + + + FILE_$(PRJ_DIR)/../../txn/txn_autop.c_tool +C/C++ compiler + + PROJECT_FILES -$(PRJ_DIR)/db_printlog.c +$(PRJ_DIR)/../../btree/btree_autop.c \ +$(PRJ_DIR)/../../db/crdel_autop.c \ +$(PRJ_DIR)/../../db/db_autop.c \ +$(PRJ_DIR)/db_printlog.c \ +$(PRJ_DIR)/../../dbreg/dbreg_autop.c \ +$(PRJ_DIR)/../../fileops/fileops_autop.c \ +$(PRJ_DIR)/../../hash/hash_autop.c \ +$(PRJ_DIR)/../../qam/qam_autop.c \ +$(PRJ_DIR)/../../rep/rep_autop.c \ +$(PRJ_DIR)/../../txn/txn_autop.c userComments diff --git a/db/build_vxworks/db_recover/db_recover.c b/db/build_vxworks/db_recover/db_recover.c index cea04a115..874f31209 100644 --- a/db/build_vxworks/db_recover/db_recover.c +++ b/db/build_vxworks/db_recover/db_recover.c @@ -1,44 +1,27 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_recover.c,v 11.41 2004/01/28 03:36:00 bostic Exp $ + * $Id: db_recover.c,v 12.9 2006/08/26 09:23:13 bostic Exp $ */ #include "db_config.h" +#include "db_int.h" + #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#if TIME_WITH_SYS_TIME -#include -#include -#else -#if HAVE_SYS_TIME_H -#include -#else -#include -#endif + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; #endif -#include -#include -#include -#endif - -#include "db_int.h" - int db_recover_main __P((int, char *[])); -int db_recover_read_timestamp __P((const char *, char *, time_t *)); +int db_recover_read_timestamp __P((char *, time_t *)); int db_recover_usage __P((void)); -int db_recover_version_check __P((const char *)); +int db_recover_version_check __P((void)); + +const char *progname; int db_recover(args) @@ -61,14 +44,18 @@ db_recover_main(argc, argv) { extern char *optarg; extern int optind, __db_getopt_reset; - const char *progname = "db_recover"; DB_ENV *dbenv; time_t timestamp; u_int32_t flags; int ch, exitval, fatal_recover, ret, retain_env, verbose; char *home, *passwd; - if ((ret = db_recover_version_check(progname)) != 0) + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_recover_version_check()) != 0) return (ret); home = passwd = NULL; @@ -96,8 +83,7 @@ db_recover_main(argc, argv) } break; case 't': - if ((ret = - db_recover_read_timestamp(progname, optarg, ×tamp)) != 0) + if ((ret = db_recover_read_timestamp(optarg, ×tamp)) != 0) return (ret); break; case 'V': @@ -157,10 +143,10 @@ db_recover_main(argc, argv) * certainly use DB_CONFIG files in the directory. */ flags = 0; - LF_SET(DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | + LF_SET(DB_CREATE | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_USE_ENVIRON); LF_SET(fatal_recover ? DB_RECOVER_FATAL : DB_RECOVER); - LF_SET(retain_env ? 0 : DB_PRIVATE); + LF_SET(retain_env ? DB_INIT_LOCK : DB_PRIVATE); if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0) { dbenv->err(dbenv, ret, "DB_ENV->open"); goto shutdown; @@ -219,8 +205,7 @@ shutdown: exitval = 1; * SUCH DAMAGE. */ int -db_recover_read_timestamp(progname, arg, timep) - const char *progname; +db_recover_read_timestamp(arg, timep) char *arg; time_t *timep; { @@ -291,14 +276,13 @@ terr: fprintf(stderr, int db_recover_usage() { - (void)fprintf(stderr, "%s\n", -"usage: db_recover [-ceVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]"); + (void)fprintf(stderr, "usage: %s %s\n", progname, + "[-ceVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]"); return (EXIT_FAILURE); } int -db_recover_version_check(progname) - const char *progname; +db_recover_version_check() { int v_major, v_minor, v_patch; diff --git a/db/build_vxworks/db_recover/db_recover20.wpj b/db/build_vxworks/db_recover/db_recover20.wpj index d201c8fbe..f3e5ff312 100755 --- a/db/build_vxworks/db_recover/db_recover20.wpj +++ b/db/build_vxworks/db_recover/db_recover20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_db_recover.c_dependDone FALSE FILE_db_recover.c_dependencies - FILE_db_recover.c_objects diff --git a/db/build_vxworks/db_recover/db_recover22.wpj b/db/build_vxworks/db_recover/db_recover22.wpj index 88e2401ff..2f01f5899 100755 --- a/db/build_vxworks/db_recover/db_recover22.wpj +++ b/db/build_vxworks/db_recover/db_recover22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_db_recover.c_dependDone FALSE FILE_db_recover.c_dependencies - FILE_db_recover.c_objects diff --git a/db/build_vxworks/db_stat/db_stat.c b/db/build_vxworks/db_stat/db_stat.c index 3b004fa19..be6256d9c 100644 --- a/db/build_vxworks/db_stat/db_stat.c +++ b/db/build_vxworks/db_stat/db_stat.c @@ -1,50 +1,31 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_stat.c,v 11.158 2004/07/15 18:26:48 ubell Exp $ + * $Id: db_stat.c,v 12.14 2006/08/26 09:23:19 bostic Exp $ */ #include "db_config.h" +#include "db_int.h" +#include "dbinc/db_page.h" + #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#if TIME_WITH_SYS_TIME -#include -#include -#else -#if HAVE_SYS_TIME_H -#include -#else -#include -#endif + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; #endif -#include -#include -#include -#include -#endif - -#include "db_int.h" -#include "dbinc/db_page.h" -#include "dbinc/txn.h" - typedef enum { T_NOTSET, - T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_REP, T_TXN } test_t; + T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_MUTEX, T_REP, T_TXN } test_t; int db_stat_db_init __P((DB_ENV *, char *, test_t, u_int32_t, int *)); int db_stat_main __P((int, char *[])); int db_stat_usage __P((void)); -int db_stat_version_check __P((const char *)); +int db_stat_version_check __P((void)); + +const char *progname; int db_stat(args) @@ -67,29 +48,32 @@ db_stat_main(argc, argv) { extern char *optarg; extern int optind, __db_getopt_reset; - const char *progname = "db_stat"; DB_ENV *dbenv; - DB_BTREE_STAT *sp; - DB *alt_dbp, *dbp; + DB *dbp; test_t ttype; - u_int32_t cache, env_flags, fast, flags; + u_int32_t cache, flags; int ch, exitval; int nflag, private, resize, ret; char *db, *home, *p, *passwd, *subdb; - if ((ret = db_stat_version_check(progname)) != 0) + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_stat_version_check()) != 0) return (ret); dbenv = NULL; dbp = NULL; ttype = T_NOTSET; cache = MEGABYTE; - exitval = fast = flags = nflag = private = 0; + exitval = flags = nflag = private = 0; db = home = passwd = subdb = NULL; - env_flags = 0; __db_getopt_reset = 1; - while ((ch = getopt(argc, argv, "C:cd:Eefh:L:lM:mNP:R:rs:tVZ")) != EOF) + while ((ch = getopt(argc, + argv, "C:cd:Eefh:L:lM:mNP:R:rs:tVxX:Z")) != EOF) switch (ch) { case 'C': case 'c': if (ttype != T_NOTSET && ttype != T_LOCK) @@ -134,7 +118,10 @@ db_stat_main(argc, argv) LF_SET(DB_STAT_ALL); break; case 'f': - fast = DB_FAST_STAT; + if (ttype != T_NOTSET && ttype != T_DB) + goto argcombo; + ttype = T_DB; + LF_SET(DB_FAST_STAT); break; case 'h': home = optarg; @@ -209,13 +196,27 @@ db_stat_main(argc, argv) argcombo: fprintf(stderr, "%s: illegal option combination\n", progname); - return (EXIT_FAILURE); + return (db_stat_usage()); } ttype = T_TXN; break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); return (EXIT_SUCCESS); + case 'X': case 'x': + if (ttype != T_NOTSET && ttype != T_MUTEX) + goto argcombo; + ttype = T_MUTEX; + if (ch != 'x') + for (p = optarg; *p; ++p) + switch (*p) { + case 'A': + LF_SET(DB_STAT_ALL); + break; + default: + return (db_stat_usage()); + } + break; case 'Z': LF_SET(DB_STAT_CLEAR); break; @@ -231,18 +232,16 @@ argcombo: fprintf(stderr, if (db == NULL) return (db_stat_usage()); break; - case T_NOTSET: - return (db_stat_usage()); - /* NOTREACHED */ case T_ENV: case T_LOCK: case T_LOG: case T_MPOOL: + case T_MUTEX: case T_REP: case T_TXN: - if (fast != 0) - return (db_stat_usage()); break; + case T_NOTSET: + return (db_stat_usage()); } /* Handle possible interruptions. */ @@ -252,7 +251,7 @@ argcombo: fprintf(stderr, * Create an environment object and initialize it for error * reporting. */ -retry: if ((ret = db_env_create(&dbenv, env_flags)) != 0) { +retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "%s: db_env_create: %s\n", progname, db_strerror(ret)); goto err; @@ -284,17 +283,26 @@ retry: if ((ret = db_env_create(&dbenv, env_flags)) != 0) { switch (ttype) { case T_DB: - if (flags != 0) - return (db_stat_usage()); - /* Create the DB object and open the file. */ if ((ret = db_create(&dbp, dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "db_create"); goto err; } - if ((ret = dbp->open(dbp, - NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + /* + * We open the database for writing so we can update the cached + * statistics, but it's OK to fail, we can open read-only and + * proceed. + * + * Turn off error messages for now -- we can't open lots of + * databases read-write (for example, master databases and + * hash databases for which we don't know the hash function). + */ + dbenv->set_errfile(dbenv, NULL); + ret = dbp->open(dbp, NULL, db, subdb, DB_UNKNOWN, 0, 0); + dbenv->set_errfile(dbenv, stderr); + if (ret != 0 && (ret = dbp->open( + dbp, NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { dbenv->err(dbenv, ret, "DB->open: %s", db); goto err; } @@ -313,40 +321,6 @@ retry: if ((ret = db_env_create(&dbenv, env_flags)) != 0) { } } - /* - * See if we can open this db read/write to update counts. - * If its a master-db then we cannot. So check to see, - * if its btree then it might be. - */ - if (subdb == NULL && dbp->type == DB_BTREE && - (ret = dbp->stat(dbp, NULL, &sp, DB_FAST_STAT)) != 0) { - dbenv->err(dbenv, ret, "DB->stat"); - goto err; - } - - if (subdb != NULL || - dbp->type != DB_BTREE || - (sp->bt_metaflags & BTM_SUBDB) == 0) { - if ((ret = db_create(&alt_dbp, dbenv, 0)) != 0) { - dbenv->err(dbenv, ret, "db_create"); - goto err; - } - if ((ret = dbp->open(alt_dbp, NULL, - db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { - if (subdb == NULL) - dbenv->err(dbenv, - ret, "DB->open: %s", db); - else - dbenv->err(dbenv, - ret, "DB->open: %s:%s", db, subdb); - (void)alt_dbp->close(alt_dbp, DB_NOSYNC); - goto err; - } - - (void)dbp->close(dbp, DB_NOSYNC); - dbp = alt_dbp; - } - if (dbp->stat_print(dbp, flags)) goto err; break; @@ -366,6 +340,10 @@ retry: if ((ret = db_env_create(&dbenv, env_flags)) != 0) { if (dbenv->memp_stat_print(dbenv, flags)) goto err; break; + case T_MUTEX: + if (dbenv->mutex_stat_print(dbenv, flags)) + goto err; + break; case T_REP: if (dbenv->rep_stat_print(dbenv, flags)) goto err; @@ -427,8 +405,7 @@ db_stat_db_init(dbenv, home, ttype, cache, is_private) * error, I think. */ *is_private = 0; - if ((ret = - dbenv->open(dbenv, home, DB_JOINENV | DB_USE_ENVIRON, 0)) == 0) + if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) == 0) return (0); if (ret == DB_VERSION_MISMATCH) goto err; @@ -471,17 +448,16 @@ err: dbenv->err(dbenv, ret, "DB_ENV->open"); int db_stat_usage() { - fprintf(stderr, "usage: db_stat %s\n", + fprintf(stderr, "usage: %s %s\n", progname, "-d file [-fN] [-h home] [-P password] [-s database]"); - fprintf(stderr, "usage: db_stat %s\n\t%s\n", - "[-cEelmNrtVZ] [-C Aclop]", - "[-h home] [-L A] [-M A] [-P password] [-R A]"); + fprintf(stderr, "usage: %s %s\n\t%s\n", progname, + "[-cEelmNrtVxZ] [-C Aclop]", + "[-h home] [-L A] [-M A] [-P password] [-R A] [-X A]"); return (EXIT_FAILURE); } int -db_stat_version_check(progname) - const char *progname; +db_stat_version_check() { int v_major, v_minor, v_patch; diff --git a/db/build_vxworks/db_stat/db_stat20.wpj b/db/build_vxworks/db_stat/db_stat20.wpj index 323cb1767..e3122f65d 100755 --- a/db/build_vxworks/db_stat/db_stat20.wpj +++ b/db/build_vxworks/db_stat/db_stat20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_db_stat.c_dependDone FALSE FILE_db_stat.c_dependencies - FILE_db_stat.c_objects diff --git a/db/build_vxworks/db_stat/db_stat22.wpj b/db/build_vxworks/db_stat/db_stat22.wpj index 0b941a4b0..c18334646 100755 --- a/db/build_vxworks/db_stat/db_stat22.wpj +++ b/db/build_vxworks/db_stat/db_stat22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_db_stat.c_dependDone FALSE FILE_db_stat.c_dependencies - FILE_db_stat.c_objects diff --git a/db/build_vxworks/db_upgrade/db_upgrade.c b/db/build_vxworks/db_upgrade/db_upgrade.c index cfcb1cffc..e53d571c6 100644 --- a/db/build_vxworks/db_upgrade/db_upgrade.c +++ b/db/build_vxworks/db_upgrade/db_upgrade.c @@ -1,33 +1,26 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_upgrade.c,v 1.37 2004/06/10 01:00:09 bostic Exp $ + * $Id: db_upgrade.c,v 12.9 2006/08/26 09:23:22 bostic Exp $ */ #include "db_config.h" +#include "db_int.h" + #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#include -#include + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; #endif -#include "db_int.h" - int db_upgrade_main __P((int, char *[])); int db_upgrade_usage __P((void)); -int db_upgrade_version_check __P((const char *)); +int db_upgrade_version_check __P((void)); + +const char *progname; int db_upgrade(args) @@ -50,22 +43,26 @@ db_upgrade_main(argc, argv) { extern char *optarg; extern int optind, __db_getopt_reset; - const char *progname = "db_upgrade"; DB *dbp; DB_ENV *dbenv; u_int32_t flags; - int ch, exitval, nflag, ret, t_ret; + int ch, exitval, nflag, ret, t_ret, verbose; char *home, *passwd; - if ((ret = db_upgrade_version_check(progname)) != 0) + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_upgrade_version_check()) != 0) return (ret); dbenv = NULL; - flags = nflag = 0; + flags = nflag = verbose = 0; exitval = 0; home = passwd = NULL; __db_getopt_reset = 1; - while ((ch = getopt(argc, argv, "h:NP:sV")) != EOF) + while ((ch = getopt(argc, argv, "h:NP:sVv")) != EOF) switch (ch) { case 'h': home = optarg; @@ -88,6 +85,9 @@ db_upgrade_main(argc, argv) case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); return (EXIT_SUCCESS); + case 'v': + verbose = 1; + break; case '?': default: return (db_upgrade_usage()); @@ -135,8 +135,7 @@ db_upgrade_main(argc, argv) * If attaching to a pre-existing environment fails, create a * private one and try again. */ - if ((ret = dbenv->open(dbenv, - home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 && + if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && (ret == DB_VERSION_MISMATCH || (ret = dbenv->open(dbenv, home, DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, @@ -161,6 +160,13 @@ db_upgrade_main(argc, argv) } if (ret != 0) goto shutdown; + /* + * People get concerned if they don't see a success message. + * If verbose is set, give them one. + */ + if (verbose) + printf("%s: %s upgraded successfully\n", + progname, argv[0]); } if (0) { @@ -184,14 +190,13 @@ shutdown: exitval = 1; int db_upgrade_usage() { - fprintf(stderr, "%s\n", - "usage: db_upgrade [-NsV] [-h home] [-P password] db_file ..."); + fprintf(stderr, "usage: %s %s\n", progname, + "[-NsVv] [-h home] [-P password] db_file ..."); return (EXIT_FAILURE); } int -db_upgrade_version_check(progname) - const char *progname; +db_upgrade_version_check() { int v_major, v_minor, v_patch; diff --git a/db/build_vxworks/db_upgrade/db_upgrade20.wpj b/db/build_vxworks/db_upgrade/db_upgrade20.wpj index 325910f34..c184e4035 100755 --- a/db/build_vxworks/db_upgrade/db_upgrade20.wpj +++ b/db/build_vxworks/db_upgrade/db_upgrade20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_db_upgrade.c_dependDone FALSE FILE_db_upgrade.c_dependencies - FILE_db_upgrade.c_objects diff --git a/db/build_vxworks/db_upgrade/db_upgrade22.wpj b/db/build_vxworks/db_upgrade/db_upgrade22.wpj index d042b2e0e..700df6980 100755 --- a/db/build_vxworks/db_upgrade/db_upgrade22.wpj +++ b/db/build_vxworks/db_upgrade/db_upgrade22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_db_upgrade.c_dependDone FALSE FILE_db_upgrade.c_dependencies - FILE_db_upgrade.c_objects diff --git a/db/build_vxworks/db_verify/db_verify.c b/db/build_vxworks/db_verify/db_verify.c index f00e658b2..68751ac01 100644 --- a/db/build_vxworks/db_verify/db_verify.c +++ b/db/build_vxworks/db_verify/db_verify.c @@ -1,33 +1,26 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_verify.c,v 1.49 2004/08/01 00:21:58 bostic Exp $ + * $Id: db_verify.c,v 12.8 2006/08/26 09:23:23 bostic Exp $ */ #include "db_config.h" +#include "db_int.h" + #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#include -#include + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; #endif -#include "db_int.h" - int db_verify_main __P((int, char *[])); int db_verify_usage __P((void)); -int db_verify_version_check __P((const char *)); +int db_verify_version_check __P((void)); + +const char *progname; int db_verify(args) @@ -50,7 +43,6 @@ db_verify_main(argc, argv) { extern char *optarg; extern int optind, __db_getopt_reset; - const char *progname = "db_verify"; DB *dbp, *dbp1; DB_ENV *dbenv; u_int32_t flags, cache; @@ -58,7 +50,12 @@ db_verify_main(argc, argv) int quiet, resize, ret; char *home, *passwd; - if ((ret = db_verify_version_check(progname)) != 0) + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = db_verify_version_check()) != 0) return (ret); dbenv = NULL; @@ -165,12 +162,24 @@ retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { } } + /* + * Find out if we have a transactional environment so that we can + * make sure that we don't open the verify database with logging + * enabled. + */ for (; !__db_util_interrupted() && argv[0] != NULL; ++argv) { if ((ret = db_create(&dbp, dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "%s: db_create", progname); goto shutdown; } + if (TXN_ON(dbenv) && + (ret = dbp->set_flags(dbp, DB_TXN_NOT_DURABLE)) != 0) { + dbenv->err( + dbenv, ret, "%s: db_set_flags", progname); + goto shutdown; + } + /* * We create a 2nd dbp to this database to get its pagesize * because the dbp we're using for verify cannot be opened. @@ -186,6 +195,13 @@ retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { goto shutdown; } + if (TXN_ON(dbenv) && (ret = + dbp1->set_flags(dbp1, DB_TXN_NOT_DURABLE)) != 0) { + dbenv->err( + dbenv, ret, "%s: db_set_flags", progname); + goto shutdown; + } + ret = dbp1->open(dbp1, NULL, argv[0], NULL, DB_UNKNOWN, DB_RDONLY, 0); @@ -245,14 +261,13 @@ shutdown: exitval = 1; int db_verify_usage() { - fprintf(stderr, "%s\n", - "usage: db_verify [-NoqV] [-h home] [-P password] db_file ..."); + fprintf(stderr, "usage: %s %s\n", progname, + "[-NoqV] [-h home] [-P password] db_file ..."); return (EXIT_FAILURE); } int -db_verify_version_check(progname) - const char *progname; +db_verify_version_check() { int v_major, v_minor, v_patch; diff --git a/db/build_vxworks/db_verify/db_verify20.wpj b/db/build_vxworks/db_verify/db_verify20.wpj index 14b35c900..fd9737b77 100755 --- a/db/build_vxworks/db_verify/db_verify20.wpj +++ b/db/build_vxworks/db_verify/db_verify20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_db_verify.c_dependDone FALSE FILE_db_verify.c_dependencies - FILE_db_verify.c_objects diff --git a/db/build_vxworks/db_verify/db_verify22.wpj b/db/build_vxworks/db_verify/db_verify22.wpj index 1a440dbee..57ad2106f 100755 --- a/db/build_vxworks/db_verify/db_verify22.wpj +++ b/db/build_vxworks/db_verify/db_verify22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_db_verify.c_dependDone FALSE FILE_db_verify.c_dependencies - FILE_db_verify.c_objects diff --git a/db/build_vxworks/dbdemo/dbdemo.c b/db/build_vxworks/dbdemo/dbdemo.c index 993a51a36..4424b24d6 100644 --- a/db/build_vxworks/dbdemo/dbdemo.c +++ b/db/build_vxworks/dbdemo/dbdemo.c @@ -1,10 +1,10 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1997-2006 + * Oracle Corporation. All rights reserved. * - * $Id: ex_access.c,v 11.25 2004/09/17 22:00:28 mjc Exp $ + * $Id: ex_access.c,v 12.3 2006/08/24 14:45:41 bostic Exp $ */ #include diff --git a/db/build_vxworks/dbdemo/dbdemo20.wpj b/db/build_vxworks/dbdemo/dbdemo20.wpj index 1c996e893..04e5edd5a 100755 --- a/db/build_vxworks/dbdemo/dbdemo20.wpj +++ b/db/build_vxworks/dbdemo/dbdemo20.wpj @@ -134,13 +134,11 @@ PENTIUMgnu CORE_INFO_VERSION 2.0 - FILE_dbdemo.c_dependDone FALSE FILE_dbdemo.c_dependencies - FILE_dbdemo.c_objects diff --git a/db/build_vxworks/dbdemo/dbdemo22.wpj b/db/build_vxworks/dbdemo/dbdemo22.wpj index e482480df..d2b15f85a 100755 --- a/db/build_vxworks/dbdemo/dbdemo22.wpj +++ b/db/build_vxworks/dbdemo/dbdemo22.wpj @@ -168,13 +168,11 @@ PENTIUM2gnu CORE_INFO_VERSION 2.2 - FILE_dbdemo.c_dependDone FALSE FILE_dbdemo.c_dependencies - FILE_dbdemo.c_objects diff --git a/db/build_windows/Berkeley_DB.dsw b/db/build_windows/Berkeley_DB.dsw new file mode 100644 index 000000000..0f2c7777d --- /dev/null +++ b/db/build_windows/Berkeley_DB.dsw @@ -0,0 +1,818 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "build_all"=.\build_all.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_archive + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_checkpoint + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_deadlock + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_dump + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_hotbackup + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_load + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_printlog + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_recover + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_stat + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_upgrade + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_verify + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_static + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_access + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_btrec + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_env + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_lock + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_mpool + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_sequence + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_tpcb + End Project Dependency + Begin Project Dependency + Project_Dep_Name example_database_load + End Project Dependency + Begin Project Dependency + Project_Dep_Name example_database_read + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_access + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_btrec + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_env + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_lock + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_mpool + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_repquote + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_sequence + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_tpcb + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_example_database_load + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_example_database_read + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_rep_base + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_rep_mgr + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_txnguide + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_txnguide_inmem + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_txnguide + End Project Dependency + Begin Project Dependency + Project_Dep_Name excxx_txnguide_inmem + End Project Dependency +}}} + +############################################################################### + +Project: "db_archive"=.\db_archive.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_checkpoint"=.\db_checkpoint.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_deadlock"=.\db_deadlock.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_dll"=.\db_dll.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "db_dump"=.\db_dump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_hotbackup"=.\db_hotbackup.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_java"=.\db_java.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_load"=.\db_load.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_printlog"=.\db_printlog.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_recover"=.\db_recover.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_small"=.\db_small.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "db_stat"=.\db_stat.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_static"=.\db_static.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "db_tcl"=.\db_tcl.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_test"=.\db_test.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name build_all + End Project Dependency + Begin Project Dependency + Project_Dep_Name db_tcl + End Project Dependency +}}} + +############################################################################### + +Project: "db_upgrade"=.\db_upgrade.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "db_verify"=.\db_verify.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_access"=.\ex_access.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_btrec"=.\ex_btrec.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_csvcode"=.\ex_csvcode.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_csvload"=.\ex_csvload.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_csvcode + End Project Dependency +}}} + +############################################################################### + +Project: "ex_csvquery"=.\ex_csvquery.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency + Begin Project Dependency + Project_Dep_Name ex_csvcode + End Project Dependency +}}} + +############################################################################### + +Project: "ex_env"=.\ex_env.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_lock"=.\ex_lock.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_mpool"=.\ex_mpool.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_rep_base"=.\ex_rep_base.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_rep_mgr"=.\ex_rep_mgr.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_sequence"=.\ex_sequence.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_tpcb"=.\ex_tpcb.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_txnguide"=.\ex_txnguide.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "ex_txnguide_inmem"=.\ex_txnguide_inmem.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "example_database_load"=.\example_database_load.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "example_database_read"=.\example_database_read.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_access"=.\excxx_access.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_btrec"=.\excxx_btrec.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_env"=.\excxx_env.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_example_database_load"=.\excxx_example_database_load.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_example_database_read"=.\excxx_example_database_read.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_lock"=.\excxx_lock.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_mpool"=.\excxx_mpool.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_repquote"=.\excxx_repquote.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_sequence"=.\excxx_sequence.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_tpcb"=.\excxx_tpcb.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_txnguide"=.\excxx_txnguide.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Project: "excxx_txnguide_inmem"=.\excxx_txnguide_inmem.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_dll + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/db/build_windows/app_dsp.src b/db/build_windows/app_dsp.src new file mode 100644 index 000000000..0ae7afaa9 --- /dev/null +++ b/db/build_windows/app_dsp.src @@ -0,0 +1,261 @@ +# Microsoft Developer Studio Project File - Name="@project_name@" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=@project_name@ - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "@project_name@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "@project_name@.mak" CFG="@project_name@ - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "@project_name@ - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "@project_name@ - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "@project_name@ - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "@project_name@ - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "@project_name@ - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "@project_name@ - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "@project_name@ - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "@project_name@ - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "@project_name@ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@bin_rel_dest@" +# PROP BASE Intermediate_Dir "Release/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@bin_rel_dest@" +# PROP Intermediate_Dir "Release/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" @extra_cppflags@ /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" @extra_cppflags@ /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @release_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib @release_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"@lib_rel_dest@" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@bin_debug_dest@" +# PROP BASE Intermediate_Dir "Debug/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@bin_debug_dest@" +# PROP Intermediate_Dir "Debug/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" @extra_cppflags@ /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" @extra_cppflags@ /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @debug_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib @debug_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"@lib_debug_dest@" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@bin_debug_dest@_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@bin_debug_dest@_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" @extra_cppflags@ /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" @extra_cppflags@ /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib @debug_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib @debug_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"@lib_debug_dest@_ASCII" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@bin_rel_dest@_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@bin_rel_dest@_ASCII" +# PROP Intermediate_Dir "Release_ASCII/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" @extra_cppflags@ /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" @extra_cppflags@ /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib @release_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib @release_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"@lib_rel_dest@_ASCII" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@bin_debug_dest@_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@bin_debug_dest@_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" @extra_cppflags@ /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib @debug_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib @debug_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"@lib_debug_dest@_AMD64" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@bin_rel_dest@_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@bin_rel_dest@_AMD64" +# PROP Intermediate_Dir "Release_AMD64/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" @extra_cppflags@ /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib @release_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib @release_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"@lib_rel_dest@_AMD64" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@bin_debug_dest@_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@bin_debug_dest@_IA64" +# PROP Intermediate_Dir "Debug_IA64/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" @extra_cppflags@ /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib @debug_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib @debug_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"@lib_debug_dest@_IA64" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@bin_rel_dest@_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@bin_rel_dest@_IA64" +# PROP Intermediate_Dir "Release_IA64/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" @extra_cppflags@ /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib @release_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib @release_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"@lib_rel_dest@_IA64" +@POST_BUILD@ + +!ENDIF + +# Begin Target + +# Name "@project_name@ - Win32 Release" +# Name "@project_name@ - Win32 Debug" +# Name "@project_name@ - Win32 ASCII Debug" +# Name "@project_name@ - Win32 ASCII Release" +# Name "@project_name@ - x64 Debug AMD64" +# Name "@project_name@ - x64 Release AMD64" +# Name "@project_name@ - x64 Debug IA64" +# Name "@project_name@ - x64 Release IA64" +@SOURCE_FILES@ +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/build_all.dsp b/db/build_windows/build_all.dsp new file mode 100644 index 000000000..fdd922c67 --- /dev/null +++ b/db/build_windows/build_all.dsp @@ -0,0 +1,185 @@ +# Microsoft Developer Studio Project File - Name="build_all" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=build_all - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "build_all.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "build_all.mak" CFG="build_all - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "build_all - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "build_all - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE "build_all - Win32 ASCII Debug" (based on "Win32 (x86) External Target") +!MESSAGE "build_all - Win32 ASCII Release" (based on "Win32 (x86) External Target") +!MESSAGE "build_all - x64 Debug AMD64" (based on "Win32 (x86) External Target") +!MESSAGE "build_all - x64 Release AMD64" (based on "Win32 (x86) External Target") +!MESSAGE "build_all - x64 Debug IA64" (based on "Win32 (x86) External Target") +!MESSAGE "build_all - x64 Release IA64" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "build_all - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Cmd_Line "echo DB Release version built." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "build_all - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Cmd_Line "echo DB Debug version built." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "build_all - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII" +# PROP BASE Cmd_Line "echo DB Debug version built." +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII" +# PROP Cmd_Line "echo DB Debug version built." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "build_all - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII" +# PROP BASE Cmd_Line "echo DB Release version built." +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII" +# PROP Cmd_Line "echo DB Release version built." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "build_all - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/build_all" +# PROP BASE Cmd_Line "echo DB Debug version built." +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/build_all" +# PROP Cmd_Line "echo DB Debug version built." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "build_all - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/build_all" +# PROP BASE Cmd_Line "echo DB Release version built." +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/build_all" +# PROP Cmd_Line "echo DB Release version built." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "build_all - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64" +# PROP BASE Cmd_Line "echo DB Debug version built." +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64" +# PROP Cmd_Line "echo DB Debug version built." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "build_all - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64" +# PROP BASE Cmd_Line "echo DB Release version built." +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64" +# PROP Cmd_Line "echo DB Release version built." +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "build_all - Win32 Release" +# Name "build_all - Win32 Debug" +# Name "build_all - Win32 ASCII Debug" +# Name "build_all - Win32 ASCII Release" +# Name "build_all - x64 Debug AMD64" +# Name "build_all - x64 Release AMD64" +# Name "build_all - x64 Debug IA64" +# Name "build_all - x64 Release IA64" + +!IF "$(CFG)" == "build_all - Win32 Release" + +!ELSEIF "$(CFG)" == "build_all - Win32 Debug" + +!ELSEIF "$(CFG)" == "build_all - Win32 ASCII Debug" + +!ELSEIF "$(CFG)" == "build_all - Win32 ASCII Release" + +!ELSEIF "$(CFG)" == "build_all - x64 Debug AMD64" + +!ELSEIF "$(CFG)" == "build_all - x64 Release AMD64" + +!ELSEIF "$(CFG)" == "build_all - x64 Debug IA64" + +!ELSEIF "$(CFG)" == "build_all - x64 Release IA64" + +!ENDIF + +# End Target +# End Project diff --git a/db/build_windows/clib_port.h b/db/build_windows/clib_port.h new file mode 100644 index 000000000..cfefbb37d --- /dev/null +++ b/db/build_windows/clib_port.h @@ -0,0 +1,97 @@ +/* + * Exit success/failure macros. + */ +#ifndef HAVE_EXIT_SUCCESS +#define EXIT_FAILURE 1 +#define EXIT_SUCCESS 0 +#endif + +/* + * Don't step on the namespace. Other libraries may have their own + * implementations of these functions, we don't want to use their + * implementations or force them to use ours based on the load order. + */ +#ifndef HAVE_ATOI +#define atoi __db_Catoi +#endif +#ifndef HAVE_ATOL +#define atol __db_Catol +#endif +#ifndef HAVE_GETADDRINFO +#define freeaddrinfo(a) __db_Cfreeaddrinfo(a) +#define getaddrinfo(a, b, c, d) __db_Cgetaddrinfo(a, b, c, d) +#endif +#ifndef HAVE_GETCWD +#define getcwd __db_Cgetcwd +#endif +#ifndef HAVE_GETOPT +#define getopt __db_Cgetopt +#define optarg __db_Coptarg +#define opterr __db_Copterr +#define optind __db_Coptind +#define optopt __db_Coptopt +#define optreset __db_Coptreset +#endif +#ifndef HAVE_ISSPACE +#define isspace __db_Cisspace +#endif +#ifndef HAVE_MEMCMP +#define memcmp __db_Cmemcmp +#endif +#ifndef HAVE_MEMCPY +#define memcpy __db_Cmemcpy +#endif +#ifndef HAVE_MEMMOVE +#define memmove __db_Cmemmove +#endif +#ifndef HAVE_PRINTF +#define printf __db_Cprintf +#define fprintf __db_Cfprintf +#endif +#ifndef HAVE_RAISE +#define raise __db_Craise +#endif +#ifndef HAVE_RAND +#define rand __db_Crand +#define srand __db_Csrand +#endif +#ifndef HAVE_SNPRINTF +#define snprintf __db_Csnprintf +#endif +#ifndef HAVE_STRCASECMP +#define strcasecmp __db_Cstrcasecmp +#define strncasecmp __db_Cstrncasecmp +#endif +#ifndef HAVE_STRCAT +#define strcat __db_Cstrcat +#endif +#ifndef HAVE_STRCHR +#define strchr __db_Cstrchr +#endif +#ifndef HAVE_STRDUP +#define strdup __db_Cstrdup +#endif +#ifndef HAVE_STRERROR +#define strerror __db_Cstrerror +#endif +#ifndef HAVE_STRNCAT +#define strncat __db_Cstrncat +#endif +#ifndef HAVE_STRNCMP +#define strncmp __db_Cstrncmp +#endif +#ifndef HAVE_STRRCHR +#define strrchr __db_Cstrrchr +#endif +#ifndef HAVE_STRSEP +#define strsep __db_Cstrsep +#endif +#ifndef HAVE_STRTOL +#define strtol __db_Cstrtol +#endif +#ifndef HAVE_STRTOUL +#define strtoul __db_Cstrtoul +#endif +#ifndef HAVE_VSNPRINTF +#define vsnprintf __db_Cvsnprintf +#endif diff --git a/db/build_windows/db.h b/db/build_windows/db.h new file mode 100644 index 000000000..ab0fdf058 --- /dev/null +++ b/db/build_windows/db.h @@ -0,0 +1,2573 @@ +/* DO NOT EDIT: automatically built by dist/s_windows. */ +/* + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: db.in,v 12.108 2006/09/13 14:53:37 mjc Exp $ + * + * db.h include file layout: + * General. + * Database Environment. + * Locking subsystem. + * Logging subsystem. + * Shared buffer cache (mpool) subsystem. + * Transaction subsystem. + * Access methods. + * Access method cursors. + * Dbm/Ndbm, Hsearch historic interfaces. + */ + +#ifndef _DB_H_ +#define _DB_H_ + +#ifndef __NO_SYSTEM_INCLUDES +#include +#include +#include +#endif + +/* + * Turn off inappropriate compiler warnings + */ +#ifdef _MSC_VER +/* + * This warning is explicitly disabled in Visual C++ by default. + * It is necessary to explicitly enable the /Wall flag to generate this + * warning. + * Since this is a shared include file it should compile without warnings + * at the highest warning level, so third party applications can use + * higher warning levels cleanly. + * + * 4820: 'bytes' bytes padding added after member 'member' + * The type and order of elements caused the compiler to + * add padding to the end of a struct. + */ +#pragma warning(push) +#pragma warning(disable: 4820) +#endif /* _MSC_VER */ +#if defined(__cplusplus) +extern "C" { +#endif + + +#undef __P +#define __P(protos) protos + +/* + * Berkeley DB version information. + */ +#define DB_VERSION_MAJOR 4 +#define DB_VERSION_MINOR 5 +#define DB_VERSION_PATCH 20 +#define DB_VERSION_STRING "Berkeley DB 4.5.20: (September 20, 2006)" + +/* + * !!! + * Berkeley DB uses specifically sized types. If they're not provided by + * the system, typedef them here. + * + * We protect them against multiple inclusion using __BIT_TYPES_DEFINED__, + * as does BIND and Kerberos, since we don't know for sure what #include + * files the user is using. + * + * !!! + * We also provide the standard u_int, u_long etc., if they're not provided + * by the system. + */ +#ifndef __BIT_TYPES_DEFINED__ +#define __BIT_TYPES_DEFINED__ +typedef unsigned char u_int8_t; +typedef short int16_t; +typedef unsigned short u_int16_t; +typedef int int32_t; +typedef unsigned int u_int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 u_int64_t; +#endif + +#ifndef _WINSOCKAPI_ +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +typedef unsigned long u_long; +#endif +#ifdef _WIN64 +typedef int64_t ssize_t; +#else +typedef int32_t ssize_t; +#endif + +/* + * uintmax_t -- + * Largest unsigned type, used to align structures in memory. We don't store + * floating point types in structures, so integral types should be sufficient + * (and we don't have to worry about systems that store floats in other than + * power-of-2 numbers of bytes). Additionally this fixes compilers that rewrite + * structure assignments and ANSI C memcpy calls to be in-line instructions + * that happen to require alignment. + * + * uintptr_t -- + * Unsigned type that's the same size as a pointer. There are places where + * DB modifies pointers by discarding the bottom bits to guarantee alignment. + * We can't use uintmax_t, it may be larger than the pointer, and compilers + * get upset about that. So far we haven't run on any machine where there's + * no unsigned type the same size as a pointer -- here's hoping. + */ +typedef u_int64_t uintmax_t; +#ifdef _WIN64 +typedef u_int64_t uintptr_t; +#else +typedef u_int32_t uintptr_t; +#endif + +/* + * Sequences are only available on machines with 64-bit integral types. + */ +typedef int64_t db_seq_t; + +/* Thread and process identification. */ +typedef u_int32_t db_threadid_t; +typedef int pid_t; + +/* Basic types that are exported or quasi-exported. */ +typedef u_int32_t db_pgno_t; /* Page number type. */ +typedef u_int16_t db_indx_t; /* Page offset type. */ +#define DB_MAX_PAGES 0xffffffff /* >= # of pages in a file */ + +typedef u_int32_t db_recno_t; /* Record number type. */ +#define DB_MAX_RECORDS 0xffffffff /* >= # of records in a tree */ + +typedef u_int32_t db_timeout_t; /* Type of a timeout. */ + +/* + * Region offsets are the difference between a pointer in a region and the + * region's base address. With private environments, both addresses are the + * result of calling malloc, and we can't assume anything about what malloc + * will return, so region offsets have to be able to hold differences between + * arbitrary pointers. + */ +typedef uintptr_t roff_t; + +/* + * Forward structure declarations, so we can declare pointers and + * applications can get type checking. + */ +struct __db; typedef struct __db DB; +struct __db_bt_stat; typedef struct __db_bt_stat DB_BTREE_STAT; +struct __db_cipher; typedef struct __db_cipher DB_CIPHER; +struct __db_compact; typedef struct __db_compact DB_COMPACT; +struct __db_dbt; typedef struct __db_dbt DBT; +struct __db_env; typedef struct __db_env DB_ENV; +struct __db_h_stat; typedef struct __db_h_stat DB_HASH_STAT; +struct __db_ilock; typedef struct __db_ilock DB_LOCK_ILOCK; +struct __db_lock_stat; typedef struct __db_lock_stat DB_LOCK_STAT; +struct __db_lock_u; typedef struct __db_lock_u DB_LOCK; +struct __db_lockreq; typedef struct __db_lockreq DB_LOCKREQ; +struct __db_locktab; typedef struct __db_locktab DB_LOCKTAB; +struct __db_log; typedef struct __db_log DB_LOG; +struct __db_log_cursor; typedef struct __db_log_cursor DB_LOGC; +struct __db_log_stat; typedef struct __db_log_stat DB_LOG_STAT; +struct __db_lsn; typedef struct __db_lsn DB_LSN; +struct __db_mpool; typedef struct __db_mpool DB_MPOOL; +struct __db_mpool_fstat;typedef struct __db_mpool_fstat DB_MPOOL_FSTAT; +struct __db_mpool_stat; typedef struct __db_mpool_stat DB_MPOOL_STAT; +struct __db_mpoolfile; typedef struct __db_mpoolfile DB_MPOOLFILE; +struct __db_mutex_stat; typedef struct __db_mutex_stat DB_MUTEX_STAT; +struct __db_mutex_t; typedef struct __db_mutex_t DB_MUTEX; +struct __db_mutexmgr; typedef struct __db_mutexmgr DB_MUTEXMGR; +struct __db_preplist; typedef struct __db_preplist DB_PREPLIST; +struct __db_qam_stat; typedef struct __db_qam_stat DB_QUEUE_STAT; +struct __db_rep; typedef struct __db_rep DB_REP; +struct __db_rep_stat; typedef struct __db_rep_stat DB_REP_STAT; +struct __db_repmgr_site; \ + typedef struct __db_repmgr_site DB_REPMGR_SITE; +struct __db_seq_record; typedef struct __db_seq_record DB_SEQ_RECORD; +struct __db_seq_stat; typedef struct __db_seq_stat DB_SEQUENCE_STAT; +struct __db_sequence; typedef struct __db_sequence DB_SEQUENCE; +struct __db_txn; typedef struct __db_txn DB_TXN; +struct __db_txn_active; typedef struct __db_txn_active DB_TXN_ACTIVE; +struct __db_txn_stat; typedef struct __db_txn_stat DB_TXN_STAT; +struct __db_txnmgr; typedef struct __db_txnmgr DB_TXNMGR; +struct __dbc; typedef struct __dbc DBC; +struct __dbc_internal; typedef struct __dbc_internal DBC_INTERNAL; +struct __fh_t; typedef struct __fh_t DB_FH; +struct __fname; typedef struct __fname FNAME; +struct __key_range; typedef struct __key_range DB_KEY_RANGE; +struct __mpoolfile; typedef struct __mpoolfile MPOOLFILE; + +/* Key/data structure -- a Data-Base Thang. */ +struct __db_dbt { + void *data; /* Key/data */ + u_int32_t size; /* key/data length */ + + u_int32_t ulen; /* RO: length of user buffer. */ + u_int32_t dlen; /* RO: get/put record length. */ + u_int32_t doff; /* RO: get/put record offset. */ + + void *app_data; + +#define DB_DBT_APPMALLOC 0x001 /* Callback allocated memory. */ +#define DB_DBT_ISSET 0x002 /* Lower level calls set value. */ +#define DB_DBT_MALLOC 0x004 /* Return in malloc'd memory. */ +#define DB_DBT_PARTIAL 0x008 /* Partial put/get. */ +#define DB_DBT_REALLOC 0x010 /* Return in realloc'd memory. */ +#define DB_DBT_USERCOPY 0x020 /* Use the user-supplied callback. */ +#define DB_DBT_USERMEM 0x040 /* Return in user's memory. */ +#define DB_DBT_DUPOK 0x080 /* Insert if duplicate. */ + u_int32_t flags; +}; + +/* + * Common flags -- + * Interfaces which use any of these common flags should never have + * interface specific flags in this range. + */ +#define DB_CREATE 0x0000001 /* Create file as necessary. */ +#define DB_DURABLE_UNKNOWN 0x0000002 /* Durability on open (internal). */ +#define DB_FORCE 0x0000004 /* Force (anything). */ +#define DB_MULTIVERSION 0x0000008 /* Multiversion concurrency control. */ +#define DB_NOMMAP 0x0000010 /* Don't mmap underlying file. */ +#define DB_RDONLY 0x0000020 /* Read-only (O_RDONLY). */ +#define DB_RECOVER 0x0000040 /* Run normal recovery. */ +#define DB_THREAD 0x0000080 /* Applications are threaded. */ +#define DB_TRUNCATE 0x0000100 /* Discard existing DB (O_TRUNC). */ +#define DB_TXN_NOSYNC 0x0000200 /* Do not sync log on commit. */ +#define DB_TXN_NOT_DURABLE 0x0000400 /* Do not log changes. */ +#define DB_TXN_WRITE_NOSYNC 0x0000800 /* Write the log but don't sync. */ +#define DB_USE_ENVIRON 0x0001000 /* Use the environment. */ +#define DB_USE_ENVIRON_ROOT 0x0002000 /* Use the environment if root. */ + +/* + * Common flags -- + * Interfaces which use any of these common flags should never have + * interface specific flags in this range. + * + * DB_AUTO_COMMIT: + * DB_ENV->set_flags, DB->open + * (Note: until the 4.3 release, legal to DB->associate, DB->del, + * DB->put, DB->remove, DB->rename and DB->truncate, and others.) + * DB_READ_COMMITTED: + * DB->cursor, DB->get, DB->join, DBcursor->c_get, DB_ENV->txn_begin + * DB_READ_UNCOMMITTED: + * DB->cursor, DB->get, DB->join, DB->open, DBcursor->c_get, + * DB_ENV->txn_begin + * DB_TXN_SNAPSHOT: + * DB_ENV->set_flags, DB_ENV->txn_begin, DB->cursor + * + * !!! + * The DB_READ_COMMITTED and DB_READ_UNCOMMITTED bit masks can't be changed + * without also changing the masks for the flags that can be OR'd into DB + * access method and cursor operation values. + */ +#define DB_AUTO_COMMIT 0x02000000/* Implied transaction. */ + +#define DB_READ_COMMITTED 0x04000000/* Degree 2 isolation. */ +#define DB_DEGREE_2 0x04000000/* Historic name. */ + +#define DB_READ_UNCOMMITTED 0x08000000/* Degree 1 isolation. */ +#define DB_DIRTY_READ 0x08000000/* Historic name. */ + +#define DB_TXN_SNAPSHOT 0x10000000/* Snapshot isolation. */ + +/* + * Flags common to db_env_create and db_create. + */ +#define DB_CXX_NO_EXCEPTIONS 0x0000001 /* C++: return error values. */ + +/* + * Flags private to db_env_create. + * Shared flags up to 0x0000001 */ +#define DB_RPCCLIENT 0x0000002 /* An RPC client environment. */ + +/* + * Flags private to db_create. + * Shared flags up to 0x0000001 */ +#define DB_XA_CREATE 0x0000002 /* Open in an XA environment. */ + +/* + * Flags private to DB_ENV->open. + * Shared flags up to 0x0002000 */ +#define DB_INIT_CDB 0x0004000 /* Concurrent Access Methods. */ +#define DB_INIT_LOCK 0x0008000 /* Initialize locking. */ +#define DB_INIT_LOG 0x0010000 /* Initialize logging. */ +#define DB_INIT_MPOOL 0x0020000 /* Initialize mpool. */ +#define DB_INIT_REP 0x0040000 /* Initialize replication. */ +#define DB_INIT_TXN 0x0080000 /* Initialize transactions. */ +#define DB_LOCKDOWN 0x0100000 /* Lock memory into physical core. */ +#define DB_PRIVATE 0x0200000 /* DB_ENV is process local. */ +#define DB_RECOVER_FATAL 0x0400000 /* Run catastrophic recovery. */ +#define DB_REGISTER 0x0800000 /* Multi-process registry. */ +#define DB_SYSTEM_MEM 0x1000000 /* Use system-backed memory. */ + +#define DB_JOINENV 0x0 /* Compatibility. */ + +/* + * Flags private to DB->open. + * Shared flags up to 0x0002000 */ +#define DB_EXCL 0x0004000 /* Exclusive open (O_EXCL). */ +#define DB_FCNTL_LOCKING 0x0008000 /* UNDOC: fcntl(2) locking. */ +#define DB_NO_AUTO_COMMIT 0x0010000 /* Override env-wide AUTOCOMMIT. */ +#define DB_RDWRMASTER 0x0020000 /* UNDOC: allow subdb master open R/W */ +#define DB_WRITEOPEN 0x0040000 /* UNDOC: open with write lock. */ + +/* + * Flags private to DB->associate. + * Shared flags up to 0x0002000 */ +#define DB_IMMUTABLE_KEY 0x0004000 /* Secondary key is immutable. */ +/* Shared flags at 0x1000000 */ + +/* + * Flags private to DB_ENV->txn_begin. + * Shared flags up to 0x0002000 */ +#define DB_TXN_NOWAIT 0x0004000 /* Do not wait for locks in this TXN. */ +#define DB_TXN_SYNC 0x0008000 /* Always sync log on commit. */ + +/* + * Flags private to DB_ENV->set_encrypt. + */ +#define DB_ENCRYPT_AES 0x0000001 /* AES, assumes SHA1 checksum */ + +/* + * Flags private to DB_ENV->set_flags. + * Shared flags up to 0x00002000 */ +#define DB_CDB_ALLDB 0x00004000/* Set CDB locking per environment. */ +#define DB_DIRECT_DB 0x00008000/* Don't buffer databases in the OS. */ +#define DB_DIRECT_LOG 0x00010000/* Don't buffer log files in the OS. */ +#define DB_DSYNC_DB 0x00020000/* Set O_DSYNC on the databases. */ +#define DB_DSYNC_LOG 0x00040000/* Set O_DSYNC on the log. */ +#define DB_LOG_AUTOREMOVE 0x00080000/* Automatically remove log files. */ +#define DB_LOG_INMEMORY 0x00100000/* Store logs in buffers in memory. */ +#define DB_NOLOCKING 0x00200000/* Set locking/mutex behavior. */ +#define DB_NOPANIC 0x00400000/* Set panic state per DB_ENV. */ +#define DB_OVERWRITE 0x00800000/* Overwrite unlinked region files. */ +#define DB_PANIC_ENVIRONMENT 0x01000000/* Set panic state per environment. */ +/* Shared flags at 0x02000000 */ +/* Shared flags at 0x04000000 */ +/* Shared flags at 0x08000000 */ +/* Shared flags at 0x10000000 */ +#define DB_REGION_INIT 0x20000000/* Page-fault regions on open. */ +#define DB_TIME_NOTGRANTED 0x40000000/* Return NOTGRANTED on timeout. */ +#define DB_YIELDCPU 0x80000000/* Yield the CPU (a lot). */ + +/* + * Flags private to DB->set_feedback's callback. + */ +#define DB_UPGRADE 0x0000001 /* Upgrading. */ +#define DB_VERIFY 0x0000002 /* Verifying. */ + +/* + * Flags private to DB->compact. + * Shared flags up to 0x00002000 + */ +#define DB_FREELIST_ONLY 0x00004000 /* Just sort and truncate. */ +#define DB_FREE_SPACE 0x00008000 /* Free space . */ +#define DB_COMPACT_FLAGS \ + (DB_FREELIST_ONLY | DB_FREE_SPACE) + +/* + * Flags private to DB_MPOOLFILE->open. + * Shared flags up to 0x0002000 */ +#define DB_DIRECT 0x0004000 /* Don't buffer the file in the OS. */ +#define DB_EXTENT 0x0008000 /* internal: dealing with an extent. */ +#define DB_ODDFILESIZE 0x0010000 /* Truncate file to N * pgsize. */ + +/* + * Flags private to DB->set_flags. + * Shared flags up to 0x00002000 */ +#define DB_CHKSUM 0x00004000 /* Do checksumming */ +#define DB_DUP 0x00008000 /* Btree, Hash: duplicate keys. */ +#define DB_DUPSORT 0x00010000 /* Btree, Hash: duplicate keys. */ +#define DB_ENCRYPT 0x00020000 /* Btree, Hash: duplicate keys. */ +#define DB_INORDER 0x00040000 /* Queue: strict ordering on consume */ +#define DB_RECNUM 0x00080000 /* Btree: record numbers. */ +#define DB_RENUMBER 0x00100000 /* Recno: renumber on insert/delete. */ +#define DB_REVSPLITOFF 0x00200000 /* Btree: turn off reverse splits. */ +#define DB_SNAPSHOT 0x00400000 /* Recno: snapshot the input. */ + +/* + * Flags private to the DB_ENV->stat_print, DB->stat and DB->stat_print methods. + */ +#define DB_FAST_STAT 0x0000001 /* Don't traverse the database. */ +#define DB_STAT_ALL 0x0000002 /* Print: Everything. */ +#define DB_STAT_CLEAR 0x0000004 /* Clear stat after returning values. */ +#define DB_STAT_LOCK_CONF 0x0000008 /* Print: Lock conflict matrix. */ +#define DB_STAT_LOCK_LOCKERS 0x0000010 /* Print: Lockers. */ +#define DB_STAT_LOCK_OBJECTS 0x0000020 /* Print: Lock objects. */ +#define DB_STAT_LOCK_PARAMS 0x0000040 /* Print: Lock parameters. */ +#define DB_STAT_MEMP_HASH 0x0000080 /* Print: Mpool hash buckets. */ +#define DB_STAT_NOERROR 0x0000100 /* Internal: continue on error. */ +#define DB_STAT_SUBSYSTEM 0x0000200 /* Print: Subsystems too. */ + +/* + * Flags private to DB->join. + */ +#define DB_JOIN_NOSORT 0x0000001 /* Don't try to optimize join. */ + +/* + * Flags private to DB->verify. + */ +#define DB_AGGRESSIVE 0x0000001 /* Salvage whatever could be data.*/ +#define DB_NOORDERCHK 0x0000002 /* Skip sort order/hashing check. */ +#define DB_ORDERCHKONLY 0x0000004 /* Only perform the order check. */ +#define DB_PR_PAGE 0x0000008 /* Show page contents (-da). */ +#define DB_PR_RECOVERYTEST 0x0000010 /* Recovery test (-dr). */ +#define DB_PRINTABLE 0x0000020 /* Use printable format for salvage. */ +#define DB_SALVAGE 0x0000040 /* Salvage what looks like data. */ +#define DB_UNREF 0x0000080 /* Report unreferenced pages. */ +/* + * !!! + * These must not go over 0x8000, or they will collide with the flags + * used by __bam_vrfy_subtree. + */ + +/* + * Flags private to DB->rep_set_transport's send callback. + */ +#define DB_REP_ANYWHERE 0x0000001 /* Message can be serviced anywhere. */ +#define DB_REP_NOBUFFER 0x0000002 /* Do not buffer this message. */ +#define DB_REP_PERMANENT 0x0000004 /* Important--app. may want to flush. */ +#define DB_REP_REREQUEST 0x0000008 /* This msg already been requested. */ + +/******************************************************* + * Mutexes. + *******************************************************/ +typedef u_int32_t db_mutex_t; + +/* + * Flag arguments for DbEnv.mutex_alloc, DbEnv.is_alive and for the + * DB_MUTEX structure. + */ +#define DB_MUTEX_ALLOCATED 0x01 /* Mutex currently allocated. */ +#define DB_MUTEX_LOCKED 0x02 /* Mutex currently locked. */ +#define DB_MUTEX_LOGICAL_LOCK 0x04 /* Mutex backs a database lock. */ +#define DB_MUTEX_PROCESS_ONLY 0x08 /* Mutex private to a process. */ +#define DB_MUTEX_SELF_BLOCK 0x10 /* Must be able to block self. */ + +struct __db_mutex_stat { + /* The following fields are maintained in the region's copy. */ + u_int32_t st_mutex_align; /* Mutex alignment */ + u_int32_t st_mutex_tas_spins; /* Mutex test-and-set spins */ + u_int32_t st_mutex_cnt; /* Mutex count */ + u_int32_t st_mutex_free; /* Available mutexes */ + u_int32_t st_mutex_inuse; /* Mutexes in use */ + u_int32_t st_mutex_inuse_max; /* Maximum mutexes ever in use */ + + /* The following fields are filled-in from other places. */ + u_int32_t st_region_wait; /* Region lock granted after wait. */ + u_int32_t st_region_nowait; /* Region lock granted without wait. */ + roff_t st_regsize; /* Region size. */ +}; + +/* This is the length of the buffer passed to DB_ENV->thread_id_string() */ +#define DB_THREADID_STRLEN 128 + +/******************************************************* + * Locking. + *******************************************************/ +#define DB_LOCKVERSION 1 + +#define DB_FILE_ID_LEN 20 /* Unique file ID length. */ + +/* + * Deadlock detector modes; used in the DB_ENV structure to configure the + * locking subsystem. + */ +#define DB_LOCK_NORUN 0 +#define DB_LOCK_DEFAULT 1 /* Default policy. */ +#define DB_LOCK_EXPIRE 2 /* Only expire locks, no detection. */ +#define DB_LOCK_MAXLOCKS 3 /* Select locker with max locks. */ +#define DB_LOCK_MAXWRITE 4 /* Select locker with max writelocks. */ +#define DB_LOCK_MINLOCKS 5 /* Select locker with min locks. */ +#define DB_LOCK_MINWRITE 6 /* Select locker with min writelocks. */ +#define DB_LOCK_OLDEST 7 /* Select oldest locker. */ +#define DB_LOCK_RANDOM 8 /* Select random locker. */ +#define DB_LOCK_YOUNGEST 9 /* Select youngest locker. */ + +/* Flag values for lock_vec(), lock_get(). */ +#define DB_LOCK_ABORT 0x001 /* Internal: Lock during abort. */ +#define DB_LOCK_NOWAIT 0x002 /* Don't wait on unavailable lock. */ +#define DB_LOCK_RECORD 0x004 /* Internal: record lock. */ +#define DB_LOCK_SET_TIMEOUT 0x008 /* Internal: set lock timeout. */ +#define DB_LOCK_SWITCH 0x010 /* Internal: switch existing lock. */ +#define DB_LOCK_UPGRADE 0x020 /* Internal: upgrade existing lock. */ + +/* + * Simple R/W lock modes and for multi-granularity intention locking. + * + * !!! + * These values are NOT random, as they are used as an index into the lock + * conflicts arrays, i.e., DB_LOCK_IWRITE must be == 3, and DB_LOCK_IREAD + * must be == 4. + */ +typedef enum { + DB_LOCK_NG=0, /* Not granted. */ + DB_LOCK_READ=1, /* Shared/read. */ + DB_LOCK_WRITE=2, /* Exclusive/write. */ + DB_LOCK_WAIT=3, /* Wait for event */ + DB_LOCK_IWRITE=4, /* Intent exclusive/write. */ + DB_LOCK_IREAD=5, /* Intent to share/read. */ + DB_LOCK_IWR=6, /* Intent to read and write. */ + DB_LOCK_READ_UNCOMMITTED=7, /* Degree 1 isolation. */ + DB_LOCK_WWRITE=8 /* Was Written. */ +} db_lockmode_t; + +/* + * Request types. + */ +typedef enum { + DB_LOCK_DUMP=0, /* Display held locks. */ + DB_LOCK_GET=1, /* Get the lock. */ + DB_LOCK_GET_TIMEOUT=2, /* Get lock with a timeout. */ + DB_LOCK_INHERIT=3, /* Pass locks to parent. */ + DB_LOCK_PUT=4, /* Release the lock. */ + DB_LOCK_PUT_ALL=5, /* Release locker's locks. */ + DB_LOCK_PUT_OBJ=6, /* Release locker's locks on obj. */ + DB_LOCK_PUT_READ=7, /* Release locker's read locks. */ + DB_LOCK_TIMEOUT=8, /* Force a txn to timeout. */ + DB_LOCK_TRADE=9, /* Trade locker ids on a lock. */ + DB_LOCK_UPGRADE_WRITE=10 /* Upgrade writes for dirty reads. */ +} db_lockop_t; + +/* + * Status of a lock. + */ +typedef enum { + DB_LSTAT_ABORTED=1, /* Lock belongs to an aborted txn. */ + DB_LSTAT_EXPIRED=2, /* Lock has expired. */ + DB_LSTAT_FREE=3, /* Lock is unallocated. */ + DB_LSTAT_HELD=4, /* Lock is currently held. */ + DB_LSTAT_PENDING=5, /* Lock was waiting and has been + * promoted; waiting for the owner + * to run and upgrade it to held. */ + DB_LSTAT_WAITING=6 /* Lock is on the wait queue. */ +}db_status_t; + +/* Lock statistics structure. */ +struct __db_lock_stat { + u_int32_t st_id; /* Last allocated locker ID. */ + u_int32_t st_cur_maxid; /* Current maximum unused ID. */ + u_int32_t st_maxlocks; /* Maximum number of locks in table. */ + u_int32_t st_maxlockers; /* Maximum num of lockers in table. */ + u_int32_t st_maxobjects; /* Maximum num of objects in table. */ + int st_nmodes; /* Number of lock modes. */ + u_int32_t st_nlocks; /* Current number of locks. */ + u_int32_t st_maxnlocks; /* Maximum number of locks so far. */ + u_int32_t st_nlockers; /* Current number of lockers. */ + u_int32_t st_maxnlockers; /* Maximum number of lockers so far. */ + u_int32_t st_nobjects; /* Current number of objects. */ + u_int32_t st_maxnobjects; /* Maximum number of objects so far. */ + u_int32_t st_nrequests; /* Number of lock gets. */ + u_int32_t st_nreleases; /* Number of lock puts. */ + u_int32_t st_nupgrade; /* Number of lock upgrades. */ + u_int32_t st_ndowngrade; /* Number of lock downgrades. */ + u_int32_t st_lock_wait; /* Lock conflicts w/ subsequent wait */ + u_int32_t st_lock_nowait; /* Lock conflicts w/o subsequent wait */ + u_int32_t st_ndeadlocks; /* Number of lock deadlocks. */ + db_timeout_t st_locktimeout; /* Lock timeout. */ + u_int32_t st_nlocktimeouts; /* Number of lock timeouts. */ + db_timeout_t st_txntimeout; /* Transaction timeout. */ + u_int32_t st_ntxntimeouts; /* Number of transaction timeouts. */ + u_int32_t st_region_wait; /* Region lock granted after wait. */ + u_int32_t st_region_nowait; /* Region lock granted without wait. */ + roff_t st_regsize; /* Region size. */ +}; + +/* + * DB_LOCK_ILOCK -- + * Internal DB access method lock. + */ +struct __db_ilock { + db_pgno_t pgno; /* Page being locked. */ + u_int8_t fileid[DB_FILE_ID_LEN];/* File id. */ +#define DB_HANDLE_LOCK 1 +#define DB_RECORD_LOCK 2 +#define DB_PAGE_LOCK 3 + u_int32_t type; /* Type of lock. */ +}; + +/* + * DB_LOCK -- + * The structure is allocated by the caller and filled in during a + * lock_get request (or a lock_vec/DB_LOCK_GET). + */ +struct __db_lock_u { + roff_t off; /* Offset of the lock in the region */ + u_int32_t ndx; /* Index of the object referenced by + * this lock; used for locking. */ + u_int32_t gen; /* Generation number of this lock. */ + db_lockmode_t mode; /* mode of this lock. */ +}; + +/* Lock request structure. */ +struct __db_lockreq { + db_lockop_t op; /* Operation. */ + db_lockmode_t mode; /* Requested mode. */ + db_timeout_t timeout; /* Time to expire lock. */ + DBT *obj; /* Object being locked. */ + DB_LOCK lock; /* Lock returned. */ +}; + +/******************************************************* + * Logging. + *******************************************************/ +#define DB_LOGVERSION 12 /* Current log version. */ +#define DB_LOGOLDVER 8 /* Oldest log version supported. */ +#define DB_LOGMAGIC 0x040988 + +/* Flag values for DB_ENV->log_archive(). */ +#define DB_ARCH_ABS 0x001 /* Absolute pathnames. */ +#define DB_ARCH_DATA 0x002 /* Data files. */ +#define DB_ARCH_LOG 0x004 /* Log files. */ +#define DB_ARCH_REMOVE 0x008 /* Remove log files. */ + +/* Flag values for DB_ENV->log_put(). */ +#define DB_FLUSH 0x001 /* Flush data to disk (public). */ +#define DB_LOG_CHKPNT 0x002 /* Flush supports a checkpoint */ +#define DB_LOG_COMMIT 0x004 /* Flush supports a commit */ +#define DB_LOG_NOCOPY 0x008 /* Don't copy data */ +#define DB_LOG_NOT_DURABLE 0x010 /* Do not log; keep in memory */ +#define DB_LOG_WRNOSYNC 0x020 /* Write, don't sync log_put */ + +/* + * A DB_LSN has two parts, a fileid which identifies a specific file, and an + * offset within that file. The fileid is an unsigned 4-byte quantity that + * uniquely identifies a file within the log directory -- currently a simple + * counter inside the log. The offset is also an unsigned 4-byte value. The + * log manager guarantees the offset is never more than 4 bytes by switching + * to a new log file before the maximum length imposed by an unsigned 4-byte + * offset is reached. + */ +struct __db_lsn { + u_int32_t file; /* File ID. */ + u_int32_t offset; /* File offset. */ +}; + +/* + * Application-specified log record types start at DB_user_BEGIN, and must not + * equal or exceed DB_debug_FLAG. + * + * DB_debug_FLAG is the high-bit of the u_int32_t that specifies a log record + * type. If the flag is set, it's a log record that was logged for debugging + * purposes only, even if it reflects a database change -- the change was part + * of a non-durable transaction. + */ +#define DB_user_BEGIN 10000 +#define DB_debug_FLAG 0x80000000 + +/* + * DB_LOGC -- + * Log cursor. + */ +struct __db_log_cursor { + DB_ENV *dbenv; /* Enclosing dbenv. */ + + DB_FH *c_fhp; /* File handle. */ + DB_LSN c_lsn; /* Cursor: LSN */ + u_int32_t c_len; /* Cursor: record length */ + u_int32_t c_prev; /* Cursor: previous record's offset */ + + DBT c_dbt; /* Return DBT. */ + DB_LSN p_lsn; /* Persist LSN. */ + u_int32_t p_version; /* Persist version. */ + + u_int8_t *bp; /* Allocated read buffer. */ + u_int32_t bp_size; /* Read buffer length in bytes. */ + u_int32_t bp_rlen; /* Read buffer valid data length. */ + DB_LSN bp_lsn; /* Read buffer first byte LSN. */ + + u_int32_t bp_maxrec; /* Max record length in the log file. */ + + /* DB_LOGC PUBLIC HANDLE LIST BEGIN */ + int (*close) __P((DB_LOGC *, u_int32_t)); + int (*get) __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t)); + int (*version) __P((DB_LOGC *, u_int32_t *, u_int32_t)); + /* DB_LOGC PUBLIC HANDLE LIST END */ + +#define DB_LOG_DISK 0x01 /* Log record came from disk. */ +#define DB_LOG_LOCKED 0x02 /* Log region already locked */ +#define DB_LOG_SILENT_ERR 0x04 /* Turn-off error messages. */ + u_int32_t flags; +}; + +/* Log statistics structure. */ +struct __db_log_stat { + u_int32_t st_magic; /* Log file magic number. */ + u_int32_t st_version; /* Log file version number. */ + int st_mode; /* Log file permissions mode. */ + u_int32_t st_lg_bsize; /* Log buffer size. */ + u_int32_t st_lg_size; /* Log file size. */ + u_int32_t st_record; /* Records entered into the log. */ + u_int32_t st_w_bytes; /* Bytes to log. */ + u_int32_t st_w_mbytes; /* Megabytes to log. */ + u_int32_t st_wc_bytes; /* Bytes to log since checkpoint. */ + u_int32_t st_wc_mbytes; /* Megabytes to log since checkpoint. */ + u_int32_t st_wcount; /* Total I/O writes to the log. */ + u_int32_t st_wcount_fill; /* Overflow writes to the log. */ + u_int32_t st_rcount; /* Total I/O reads from the log. */ + u_int32_t st_scount; /* Total syncs to the log. */ + u_int32_t st_region_wait; /* Region lock granted after wait. */ + u_int32_t st_region_nowait; /* Region lock granted without wait. */ + u_int32_t st_cur_file; /* Current log file number. */ + u_int32_t st_cur_offset; /* Current log file offset. */ + u_int32_t st_disk_file; /* Known on disk log file number. */ + u_int32_t st_disk_offset; /* Known on disk log file offset. */ + roff_t st_regsize; /* Region size. */ + u_int32_t st_maxcommitperflush; /* Max number of commits in a flush. */ + u_int32_t st_mincommitperflush; /* Min number of commits in a flush. */ +}; + +/* + * We need to record the first log record of a transaction. For user + * defined logging this macro returns the place to put that information, + * if it is need in rlsnp, otherwise it leaves it unchanged. We also + * need to track the last record of the transaction, this returns the + * place to put that info. + */ +#define DB_SET_TXN_LSNP(txn, blsnp, llsnp) \ + ((txn)->set_txn_lsnp(txn, blsnp, llsnp)) + +/******************************************************* + * Shared buffer cache (mpool). + *******************************************************/ +/* Flag values for DB_MPOOLFILE->get. */ +#define DB_MPOOL_CREATE 0x001 /* Create a page. */ +#define DB_MPOOL_DIRTY 0x002 /* Get page for an update. */ +#define DB_MPOOL_EDIT 0x004 /* Modify without copying. */ +#define DB_MPOOL_FREE 0x008 /* Free page if present. */ +#define DB_MPOOL_LAST 0x010 /* Return the last page. */ +#define DB_MPOOL_NEW 0x020 /* Create a new page. */ + +/* Flag values for DB_MPOOLFILE->put, DB_MPOOLFILE->set. */ +#define DB_MPOOL_DISCARD 0x001 /* Don't cache the page. */ + +/* Flags values for DB_MPOOLFILE->set_flags. */ +#define DB_MPOOL_NOFILE 0x001 /* Never open a backing file. */ +#define DB_MPOOL_UNLINK 0x002 /* Unlink the file on last close. */ + +/* Priority values for DB_MPOOLFILE->set_priority. */ +typedef enum { + DB_PRIORITY_VERY_LOW=1, + DB_PRIORITY_LOW=2, + DB_PRIORITY_DEFAULT=3, + DB_PRIORITY_HIGH=4, + DB_PRIORITY_VERY_HIGH=5 +} DB_CACHE_PRIORITY; + +/* Per-process DB_MPOOLFILE information. */ +struct __db_mpoolfile { + DB_FH *fhp; /* Underlying file handle. */ + + /* + * !!! + * The ref, pinref and q fields are protected by the region lock. + */ + u_int32_t ref; /* Reference count. */ + + u_int32_t pinref; /* Pinned block reference count. */ + + /* + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_ENTRY(__db_mpoolfile) q; + */ + struct { + struct __db_mpoolfile *tqe_next; + struct __db_mpoolfile **tqe_prev; + } q; /* Linked list of DB_MPOOLFILE's. */ + + /* + * !!! + * The rest of the fields (with the exception of the MP_FLUSH flag) + * are not thread-protected, even when they may be modified at any + * time by the application. The reason is the DB_MPOOLFILE handle + * is single-threaded from the viewpoint of the application, and so + * the only fields needing to be thread-protected are those accessed + * by checkpoint or sync threads when using DB_MPOOLFILE structures + * to flush buffers from the cache. + */ + DB_ENV *dbenv; /* Overlying DB_ENV. */ + MPOOLFILE *mfp; /* Underlying MPOOLFILE. */ + + u_int32_t clear_len; /* Cleared length on created pages. */ + u_int8_t /* Unique file ID. */ + fileid[DB_FILE_ID_LEN]; + int ftype; /* File type. */ + int32_t lsn_offset; /* LSN offset in page. */ + u_int32_t gbytes, bytes; /* Maximum file size. */ + DBT *pgcookie; /* Byte-string passed to pgin/pgout. */ + int32_t priority; /* Cache priority. */ + + void *addr; /* Address of mmap'd region. */ + size_t len; /* Length of mmap'd region. */ + + u_int32_t config_flags; /* Flags to DB_MPOOLFILE->set_flags. */ + + /* DB_MPOOLFILE PUBLIC HANDLE LIST BEGIN */ + int (*close) __P((DB_MPOOLFILE *, u_int32_t)); + int (*get) + __P((DB_MPOOLFILE *, db_pgno_t *, DB_TXN *, u_int32_t, void *)); + int (*open) __P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t)); + int (*put) __P((DB_MPOOLFILE *, void *, u_int32_t)); + int (*set) __P((DB_MPOOLFILE *, void *, u_int32_t)); + int (*get_clear_len) __P((DB_MPOOLFILE *, u_int32_t *)); + int (*set_clear_len) __P((DB_MPOOLFILE *, u_int32_t)); + int (*get_fileid) __P((DB_MPOOLFILE *, u_int8_t *)); + int (*set_fileid) __P((DB_MPOOLFILE *, u_int8_t *)); + int (*get_flags) __P((DB_MPOOLFILE *, u_int32_t *)); + int (*set_flags) __P((DB_MPOOLFILE *, u_int32_t, int)); + int (*get_ftype) __P((DB_MPOOLFILE *, int *)); + int (*set_ftype) __P((DB_MPOOLFILE *, int)); + int (*get_lsn_offset) __P((DB_MPOOLFILE *, int32_t *)); + int (*set_lsn_offset) __P((DB_MPOOLFILE *, int32_t)); + int (*get_maxsize) __P((DB_MPOOLFILE *, u_int32_t *, u_int32_t *)); + int (*set_maxsize) __P((DB_MPOOLFILE *, u_int32_t, u_int32_t)); + int (*get_pgcookie) __P((DB_MPOOLFILE *, DBT *)); + int (*set_pgcookie) __P((DB_MPOOLFILE *, DBT *)); + int (*get_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY *)); + int (*set_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY)); + int (*sync) __P((DB_MPOOLFILE *)); + /* DB_MPOOLFILE PUBLIC HANDLE LIST END */ + + /* + * MP_FILEID_SET, MP_OPEN_CALLED and MP_READONLY do not need to be + * thread protected because they are initialized before the file is + * linked onto the per-process lists, and never modified. + * + * MP_FLUSH is thread protected because it is potentially read/set by + * multiple threads of control. + */ +#define MP_FILEID_SET 0x001 /* Application supplied a file ID. */ +#define MP_FLUSH 0x002 /* Was opened to flush a buffer. */ +#define MP_MULTIVERSION 0x004 /* Opened for multiversion access. */ +#define MP_OPEN_CALLED 0x008 /* File opened. */ +#define MP_READONLY 0x010 /* File is readonly. */ + u_int32_t flags; +}; + +/* Mpool statistics structure. */ +struct __db_mpool_stat { + u_int32_t st_gbytes; /* Total cache size: GB. */ + u_int32_t st_bytes; /* Total cache size: B. */ + u_int32_t st_ncache; /* Number of caches. */ + roff_t st_regsize; /* Region size. */ + size_t st_mmapsize; /* Maximum file size for mmap. */ + int st_maxopenfd; /* Maximum number of open fd's. */ + int st_maxwrite; /* Maximum buffers to write. */ + int st_maxwrite_sleep; /* Sleep after writing max buffers. */ + u_int32_t st_map; /* Pages from mapped files. */ + u_int32_t st_cache_hit; /* Pages found in the cache. */ + u_int32_t st_cache_miss; /* Pages not found in the cache. */ + u_int32_t st_page_create; /* Pages created in the cache. */ + u_int32_t st_page_in; /* Pages read in. */ + u_int32_t st_page_out; /* Pages written out. */ + u_int32_t st_ro_evict; /* Clean pages forced from the cache. */ + u_int32_t st_rw_evict; /* Dirty pages forced from the cache. */ + u_int32_t st_page_trickle; /* Pages written by memp_trickle. */ + u_int32_t st_pages; /* Total number of pages. */ + u_int32_t st_page_clean; /* Clean pages. */ + u_int32_t st_page_dirty; /* Dirty pages. */ + u_int32_t st_hash_buckets; /* Number of hash buckets. */ + u_int32_t st_hash_searches; /* Total hash chain searches. */ + u_int32_t st_hash_longest; /* Longest hash chain searched. */ + u_int32_t st_hash_examined; /* Total hash entries searched. */ + u_int32_t st_hash_nowait; /* Hash lock granted with nowait. */ + u_int32_t st_hash_wait; /* Hash lock granted after wait. */ + u_int32_t st_hash_max_nowait; /* Max hash lock granted with nowait. */ + u_int32_t st_hash_max_wait; /* Max hash lock granted after wait. */ + u_int32_t st_region_nowait; /* Region lock granted with nowait. */ + u_int32_t st_region_wait; /* Region lock granted after wait. */ + u_int32_t st_mvcc_frozen; /* Buffers frozen. */ + u_int32_t st_mvcc_thawed; /* Buffers thawed. */ + u_int32_t st_mvcc_freed; /* Frozen buffers freed. */ + u_int32_t st_alloc; /* Number of page allocations. */ + u_int32_t st_alloc_buckets; /* Buckets checked during allocation. */ + u_int32_t st_alloc_max_buckets; /* Max checked during allocation. */ + u_int32_t st_alloc_pages; /* Pages checked during allocation. */ + u_int32_t st_alloc_max_pages; /* Max checked during allocation. */ + u_int32_t st_io_wait; /* Thread waited on buffer I/O. */ +}; + +/* Mpool file statistics structure. */ +struct __db_mpool_fstat { + char *file_name; /* File name. */ + u_int32_t st_pagesize; /* Page size. */ + u_int32_t st_map; /* Pages from mapped files. */ + u_int32_t st_cache_hit; /* Pages found in the cache. */ + u_int32_t st_cache_miss; /* Pages not found in the cache. */ + u_int32_t st_page_create; /* Pages created in the cache. */ + u_int32_t st_page_in; /* Pages read in. */ + u_int32_t st_page_out; /* Pages written out. */ +}; + +/******************************************************* + * Transactions and recovery. + *******************************************************/ +#define DB_TXNVERSION 1 + +typedef enum { + DB_TXN_ABORT=0, /* Public. */ + DB_TXN_APPLY=1, /* Public. */ + DB_TXN_BACKWARD_ALLOC=2, /* Internal. */ + DB_TXN_BACKWARD_ROLL=3, /* Public. */ + DB_TXN_FORWARD_ROLL=4, /* Public. */ + DB_TXN_OPENFILES=5, /* Internal. */ + DB_TXN_POPENFILES=6, /* Internal. */ + DB_TXN_PRINT=7 /* Public. */ +} db_recops; + +/* + * BACKWARD_ALLOC is used during the forward pass to pick up any aborted + * allocations for files that were created during the forward pass. + * The main difference between _ALLOC and _ROLL is that the entry for + * the file not exist during the rollforward pass. + */ +#define DB_UNDO(op) ((op) == DB_TXN_ABORT || \ + (op) == DB_TXN_BACKWARD_ROLL || (op) == DB_TXN_BACKWARD_ALLOC) +#define DB_REDO(op) ((op) == DB_TXN_FORWARD_ROLL || (op) == DB_TXN_APPLY) + +struct __db_txn { + DB_TXNMGR *mgrp; /* Pointer to transaction manager. */ + DB_TXN *parent; /* Pointer to transaction's parent. */ + + u_int32_t txnid; /* Unique transaction id. */ + char *name; /* Transaction name */ + + db_threadid_t tid; /* Thread id for use in MT XA. */ + void *td; /* Detail structure within region. */ + db_timeout_t lock_timeout; /* Timeout for locks for this txn. */ + db_timeout_t expire; /* Time transaction expires. */ + void *txn_list; /* Undo information for parent. */ + + /* + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_ENTRY(__db_txn) links; + * TAILQ_ENTRY(__db_txn) xalinks; + */ + struct { + struct __db_txn *tqe_next; + struct __db_txn **tqe_prev; + } links; /* Links transactions off manager. */ + struct { + struct __db_txn *tqe_next; + struct __db_txn **tqe_prev; + } xalinks; /* Links active XA transactions. */ + + /* + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_HEAD(__kids, __db_txn) kids; + */ + struct __kids { + struct __db_txn *tqh_first; + struct __db_txn **tqh_last; + } kids; + + /* + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_HEAD(__events, __txn_event) events; + */ + struct { + struct __txn_event *tqh_first; + struct __txn_event **tqh_last; + } events; + + /* + * !!! + * Explicit representations of structures from queue.h. + * STAILQ_HEAD(__logrec, __txn_logrec) logs; + */ + struct { + struct __txn_logrec *stqh_first; + struct __txn_logrec **stqh_last; + } logs; /* Links deferred events. */ + + /* + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_ENTRY(__db_txn) klinks; + */ + struct { + struct __db_txn *tqe_next; + struct __db_txn **tqe_prev; + } klinks; + + void *api_internal; /* C++ API private. */ + void *xml_internal; /* XML API private. */ + + u_int32_t cursors; /* Number of cursors open for txn */ + + /* DB_TXN PUBLIC HANDLE LIST BEGIN */ + int (*abort) __P((DB_TXN *)); + int (*commit) __P((DB_TXN *, u_int32_t)); + int (*discard) __P((DB_TXN *, u_int32_t)); + int (*get_name) __P((DB_TXN *, const char **)); + u_int32_t (*id) __P((DB_TXN *)); + int (*prepare) __P((DB_TXN *, u_int8_t *)); + int (*set_name) __P((DB_TXN *, const char *)); + int (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t)); + /* DB_TXN PUBLIC HANDLE LIST END */ + + /* DB_TXN PRIVATE HANDLE LIST BEGIN */ + void (*set_txn_lsnp) __P((DB_TXN *txn, DB_LSN **, DB_LSN **)); + /* DB_TXN PRIVATE HANDLE LIST END */ + +#define TXN_CHILDCOMMIT 0x0001 /* Txn has committed. */ +#define TXN_CDSGROUP 0x0002 /* CDS group handle. */ +#define TXN_COMPENSATE 0x0004 /* Compensating transaction. */ +#define TXN_DEADLOCK 0x0008 /* Txn has deadlocked. */ +#define TXN_LOCKTIMEOUT 0x0010 /* Txn has a lock timeout. */ +#define TXN_MALLOC 0x0020 /* Structure allocated by TXN system. */ +#define TXN_NOSYNC 0x0040 /* Do not sync on prepare and commit. */ +#define TXN_NOWAIT 0x0080 /* Do not wait on locks. */ +#define TXN_PRIVATE 0x0100 /* Txn owned by cursor.. */ +#define TXN_READ_COMMITTED 0x0200 /* Txn has degree 2 isolation. */ +#define TXN_READ_UNCOMMITTED 0x0400 /* Txn has degree 1 isolation. */ +#define TXN_RESTORED 0x0800 /* Txn has been restored. */ +#define TXN_SNAPSHOT 0x1000 /* Snapshot Isolation. */ +#define TXN_SYNC 0x2000 /* Write and sync on prepare/commit. */ +#define TXN_WRITE_NOSYNC 0x4000 /* Write only on prepare/commit. */ + u_int32_t flags; +}; + +#define TXN_SYNC_FLAGS (TXN_SYNC | TXN_NOSYNC | TXN_WRITE_NOSYNC) + +/* + * Structure used for two phase commit interface. Berkeley DB support for two + * phase commit is compatible with the X/Open XA interface. + * + * The XA #define XIDDATASIZE defines the size of a global transaction ID. We + * have our own version here (for name space reasons) which must have the same + * value. + */ +#define DB_XIDDATASIZE 128 +struct __db_preplist { + DB_TXN *txn; + u_int8_t gid[DB_XIDDATASIZE]; +}; + +/* Transaction statistics structure. */ +struct __db_txn_active { + u_int32_t txnid; /* Transaction ID */ + u_int32_t parentid; /* Transaction ID of parent */ + pid_t pid; /* Process owning txn ID */ + db_threadid_t tid; /* Thread owning txn ID */ + + DB_LSN lsn; /* LSN when transaction began */ + + DB_LSN read_lsn; /* Read LSN for MVCC */ + u_int32_t mvcc_ref; /* MVCC reference count */ + +#define TXN_ABORTED 1 +#define TXN_COMMITTED 2 +#define TXN_PREPARED 3 +#define TXN_RUNNING 4 + u_int32_t status; /* Status of the transaction */ + +#define TXN_XA_ABORTED 1 +#define TXN_XA_DEADLOCKED 2 +#define TXN_XA_ENDED 3 +#define TXN_XA_PREPARED 4 +#define TXN_XA_STARTED 5 +#define TXN_XA_SUSPENDED 6 + u_int32_t xa_status; /* XA status */ + + u_int8_t xid[DB_XIDDATASIZE]; /* Global transaction ID */ + char name[51]; /* 50 bytes of name, nul termination */ +}; + +struct __db_txn_stat { + DB_LSN st_last_ckp; /* lsn of the last checkpoint */ + time_t st_time_ckp; /* time of last checkpoint */ + u_int32_t st_last_txnid; /* last transaction id given out */ + u_int32_t st_maxtxns; /* maximum txns possible */ + u_int32_t st_naborts; /* number of aborted transactions */ + u_int32_t st_nbegins; /* number of begun transactions */ + u_int32_t st_ncommits; /* number of committed transactions */ + u_int32_t st_nactive; /* number of active transactions */ + u_int32_t st_nsnapshot; /* number of snapshot transactions */ + u_int32_t st_nrestores; /* number of restored transactions + after recovery. */ + u_int32_t st_maxnactive; /* maximum active transactions */ + u_int32_t st_maxnsnapshot; /* maximum snapshot transactions */ + DB_TXN_ACTIVE *st_txnarray; /* array of active transactions */ + u_int32_t st_region_wait; /* Region lock granted after wait. */ + u_int32_t st_region_nowait; /* Region lock granted without wait. */ + roff_t st_regsize; /* Region size. */ +}; + +/******************************************************* + * Replication. + *******************************************************/ +/* Special, out-of-band environment IDs. */ +#define DB_EID_BROADCAST -1 +#define DB_EID_INVALID -2 + +/* rep_config flag values. */ +#define DB_REP_CONF_BULK 0x0001 /* Bulk transfer. */ +#define DB_REP_CONF_DELAYCLIENT 0x0002 /* Delay client synchronization. */ +#define DB_REP_CONF_NOAUTOINIT 0x0004 /* No automatic client init. */ +#define DB_REP_CONF_NOWAIT 0x0008 /* Don't wait, return error. */ + +/* + * Operation code values for rep_start and/or repmgr_start. Just one of the + * following values should be passed in the flags parameter. (If we ever need + * additional, independent bit flags for these methods, we can start allocating + * them from the high-order byte of the flags word, as we currently do elsewhere + * for DB_AFTER through DB_WRITELOCK and DB_AUTO_COMMIT, etc.) + */ +#define DB_REP_CLIENT 1 +#define DB_REP_ELECTION 2 +#define DB_REP_FULL_ELECTION 3 +#define DB_REP_MASTER 4 + +/* Acknowledgement policies. */ +#define DB_REPMGR_ACKS_ALL 1 +#define DB_REPMGR_ACKS_ALL_PEERS 2 +#define DB_REPMGR_ACKS_NONE 3 +#define DB_REPMGR_ACKS_ONE 4 +#define DB_REPMGR_ACKS_ONE_PEER 5 +#define DB_REPMGR_ACKS_QUORUM 6 + +/* Replication Framework timeout configuration values. */ +#define DB_REP_ACK_TIMEOUT 1 +#define DB_REP_ELECTION_TIMEOUT 2 +#define DB_REP_ELECTION_RETRY 3 +#define DB_REP_CONNECTION_RETRY 4 + +/* Event notification types. */ +#define DB_EVENT_NO_SUCH_EVENT 0 /* out-of-band sentinel value */ +#define DB_EVENT_PANIC 1 +#define DB_EVENT_REP_CLIENT 2 +#define DB_EVENT_REP_MASTER 3 +#define DB_EVENT_REP_NEWMASTER 4 +#define DB_EVENT_REP_STARTUPDONE 5 +#define DB_EVENT_WRITE_FAILED 6 + +/* Flag value for repmgr_add_remote_site. */ +#define DB_REPMGR_PEER 0x01 + +/* Replication Manager site status. */ +struct __db_repmgr_site { + int eid; + char *host; + u_int port; + +#define DB_REPMGR_CONNECTED 0x01 +#define DB_REPMGR_DISCONNECTED 0x02 + u_int32_t status; +}; + +/* Replication statistics. */ +struct __db_rep_stat { + /* !!! + * Many replication statistics fields cannot be protected by a mutex + * without an unacceptable performance penalty, since most message + * processing is done without the need to hold a region-wide lock. + * Fields whose comments end with a '+' may be updated without holding + * the replication or log mutexes (as appropriate), and thus may be + * off somewhat (or, on unreasonable architectures under unlucky + * circumstances, garbaged). + */ + u_int32_t st_status; /* Current replication status. */ + DB_LSN st_next_lsn; /* Next LSN to use or expect. */ + DB_LSN st_waiting_lsn; /* LSN we're awaiting, if any. */ + db_pgno_t st_next_pg; /* Next pg we expect. */ + db_pgno_t st_waiting_pg; /* pg we're awaiting, if any. */ + + u_int32_t st_dupmasters; /* # of times a duplicate master + condition was detected.+ */ + int st_env_id; /* Current environment ID. */ + int st_env_priority; /* Current environment priority. */ + u_int32_t st_bulk_fills; /* Bulk buffer fills. */ + u_int32_t st_bulk_overflows; /* Bulk buffer overflows. */ + u_int32_t st_bulk_records; /* Bulk records stored. */ + u_int32_t st_bulk_transfers; /* Transfers of bulk buffers. */ + u_int32_t st_client_rerequests; /* Number of forced rerequests. */ + u_int32_t st_client_svc_req; /* Number of client service requests + received by this client. */ + u_int32_t st_client_svc_miss; /* Number of client service requests + missing on this client. */ + u_int32_t st_gen; /* Current generation number. */ + u_int32_t st_egen; /* Current election gen number. */ + u_int32_t st_log_duplicated; /* Log records received multiply.+ */ + u_int32_t st_log_queued; /* Log records currently queued.+ */ + u_int32_t st_log_queued_max; /* Max. log records queued at once.+ */ + u_int32_t st_log_queued_total; /* Total # of log recs. ever queued.+ */ + u_int32_t st_log_records; /* Log records received and put.+ */ + u_int32_t st_log_requested; /* Log recs. missed and requested.+ */ + int st_master; /* Env. ID of the current master. */ + u_int32_t st_master_changes; /* # of times we've switched masters. */ + u_int32_t st_msgs_badgen; /* Messages with a bad generation #.+ */ + u_int32_t st_msgs_processed; /* Messages received and processed.+ */ + u_int32_t st_msgs_recover; /* Messages ignored because this site + was a client in recovery.+ */ + u_int32_t st_msgs_send_failures;/* # of failed message sends.+ */ + u_int32_t st_msgs_sent; /* # of successful message sends.+ */ + u_int32_t st_newsites; /* # of NEWSITE msgs. received.+ */ + int st_nsites; /* Current number of sites we will + assume during elections. */ + u_int32_t st_nthrottles; /* # of times we were throttled. */ + u_int32_t st_outdated; /* # of times we detected and returned + an OUTDATED condition.+ */ + u_int32_t st_pg_duplicated; /* Pages received multiply.+ */ + u_int32_t st_pg_records; /* Pages received and stored.+ */ + u_int32_t st_pg_requested; /* Pages missed and requested.+ */ + u_int32_t st_startup_complete; /* Site completed client sync-up. */ + u_int32_t st_txns_applied; /* # of transactions applied.+ */ + + /* Elections generally. */ + u_int32_t st_elections; /* # of elections held.+ */ + u_int32_t st_elections_won; /* # of elections won by this site.+ */ + + /* Statistics about an in-progress election. */ + int st_election_cur_winner; /* Current front-runner. */ + u_int32_t st_election_gen; /* Election generation number. */ + DB_LSN st_election_lsn; /* Max. LSN of current winner. */ + int st_election_nsites; /* # of "registered voters". */ + int st_election_nvotes; /* # of "registered voters" needed. */ + int st_election_priority; /* Current election priority. */ + int st_election_status; /* Current election status. */ + u_int32_t st_election_tiebreaker;/* Election tiebreaker value. */ + int st_election_votes; /* Votes received in this round. */ + u_int32_t st_election_sec; /* Last election time seconds. */ + u_int32_t st_election_usec; /* Last election time useconds. */ +}; + +/******************************************************* + * Sequences. + *******************************************************/ +/* + * The storage record for a sequence. + */ +struct __db_seq_record { + u_int32_t seq_version; /* Version size/number. */ +#define DB_SEQ_DEC 0x00000001 /* Decrement sequence. */ +#define DB_SEQ_INC 0x00000002 /* Increment sequence. */ +#define DB_SEQ_RANGE_SET 0x00000004 /* Range set (internal). */ +#define DB_SEQ_WRAP 0x00000008 /* Wrap sequence at min/max. */ +#define DB_SEQ_WRAPPED 0x00000010 /* Just wrapped (internal). */ + u_int32_t flags; /* Flags. */ + db_seq_t seq_value; /* Current value. */ + db_seq_t seq_max; /* Max permitted. */ + db_seq_t seq_min; /* Min permitted. */ +}; + +/* + * Handle for a sequence object. + */ +struct __db_sequence { + DB *seq_dbp; /* DB handle for this sequence. */ + db_mutex_t mtx_seq; /* Mutex if sequence is threaded. */ + DB_SEQ_RECORD *seq_rp; /* Pointer to current data. */ + DB_SEQ_RECORD seq_record; /* Data from DB_SEQUENCE. */ + int32_t seq_cache_size; /* Number of values cached. */ + db_seq_t seq_last_value; /* Last value cached. */ + DBT seq_key; /* DBT pointing to sequence key. */ + DBT seq_data; /* DBT pointing to seq_record. */ + + /* API-private structure: used by C++ and Java. */ + void *api_internal; + + /* DB_SEQUENCE PUBLIC HANDLE LIST BEGIN */ + int (*close) __P((DB_SEQUENCE *, u_int32_t)); + int (*get) __P((DB_SEQUENCE *, + DB_TXN *, int32_t, db_seq_t *, u_int32_t)); + int (*get_cachesize) __P((DB_SEQUENCE *, int32_t *)); + int (*get_db) __P((DB_SEQUENCE *, DB **)); + int (*get_flags) __P((DB_SEQUENCE *, u_int32_t *)); + int (*get_key) __P((DB_SEQUENCE *, DBT *)); + int (*get_range) __P((DB_SEQUENCE *, + db_seq_t *, db_seq_t *)); + int (*initial_value) __P((DB_SEQUENCE *, db_seq_t)); + int (*open) __P((DB_SEQUENCE *, + DB_TXN *, DBT *, u_int32_t)); + int (*remove) __P((DB_SEQUENCE *, DB_TXN *, u_int32_t)); + int (*set_cachesize) __P((DB_SEQUENCE *, int32_t)); + int (*set_flags) __P((DB_SEQUENCE *, u_int32_t)); + int (*set_range) __P((DB_SEQUENCE *, db_seq_t, db_seq_t)); + int (*stat) __P((DB_SEQUENCE *, + DB_SEQUENCE_STAT **, u_int32_t)); + int (*stat_print) __P((DB_SEQUENCE *, u_int32_t)); + /* DB_SEQUENCE PUBLIC HANDLE LIST END */ +}; + +struct __db_seq_stat { + u_int32_t st_wait; /* Sequence lock granted w/o wait. */ + u_int32_t st_nowait; /* Sequence lock granted after wait. */ + db_seq_t st_current; /* Current value in db. */ + db_seq_t st_value; /* Current cached value. */ + db_seq_t st_last_value; /* Last cached value. */ + db_seq_t st_min; /* Minimum value. */ + db_seq_t st_max; /* Maximum value. */ + int32_t st_cache_size; /* Cache size. */ + u_int32_t st_flags; /* Flag value. */ +}; + +/******************************************************* + * Access methods. + *******************************************************/ +typedef enum { + DB_BTREE=1, + DB_HASH=2, + DB_RECNO=3, + DB_QUEUE=4, + DB_UNKNOWN=5 /* Figure it out on open. */ +} DBTYPE; + +#define DB_RENAMEMAGIC 0x030800 /* File has been renamed. */ + +#define DB_BTREEVERSION 9 /* Current btree version. */ +#define DB_BTREEOLDVER 8 /* Oldest btree version supported. */ +#define DB_BTREEMAGIC 0x053162 + +#define DB_HASHVERSION 8 /* Current hash version. */ +#define DB_HASHOLDVER 7 /* Oldest hash version supported. */ +#define DB_HASHMAGIC 0x061561 + +#define DB_QAMVERSION 4 /* Current queue version. */ +#define DB_QAMOLDVER 3 /* Oldest queue version supported. */ +#define DB_QAMMAGIC 0x042253 + +#define DB_SEQUENCE_VERSION 2 /* Current sequence version. */ +#define DB_SEQUENCE_OLDVER 1 /* Oldest sequence version supported. */ + +/* + * DB access method and cursor operation values. Each value is an operation + * code to which additional bit flags are added. + */ +#define DB_AFTER 1 /* c_put() */ +#define DB_APPEND 2 /* put() */ +#define DB_BEFORE 3 /* c_put() */ +#define DB_CONSUME 4 /* get() */ +#define DB_CONSUME_WAIT 5 /* get() */ +#define DB_CURRENT 6 /* c_get(), c_put(), DB_LOGC->get() */ +#define DB_FIRST 7 /* c_get(), DB_LOGC->get() */ +#define DB_GET_BOTH 8 /* get(), c_get() */ +#define DB_GET_BOTHC 9 /* c_get() (internal) */ +#define DB_GET_BOTH_RANGE 10 /* get(), c_get() */ +#define DB_GET_RECNO 11 /* c_get() */ +#define DB_JOIN_ITEM 12 /* c_get(); do not do primary lookup */ +#define DB_KEYFIRST 13 /* c_put() */ +#define DB_KEYLAST 14 /* c_put() */ +#define DB_LAST 15 /* c_get(), DB_LOGC->get() */ +#define DB_NEXT 16 /* c_get(), DB_LOGC->get() */ +#define DB_NEXT_DUP 17 /* c_get() */ +#define DB_NEXT_NODUP 18 /* c_get() */ +#define DB_NODUPDATA 19 /* put(), c_put() */ +#define DB_NOOVERWRITE 20 /* put() */ +#define DB_NOSYNC 21 /* close() */ +#define DB_POSITION 22 /* c_dup() */ +#define DB_PREV 23 /* c_get(), DB_LOGC->get() */ +#define DB_PREV_NODUP 24 /* c_get(), DB_LOGC->get() */ +#define DB_SET 25 /* c_get(), DB_LOGC->get() */ +#define DB_SET_LOCK_TIMEOUT 26 /* set_timout() */ +#define DB_SET_RANGE 27 /* c_get() */ +#define DB_SET_RECNO 28 /* get(), c_get() */ +#define DB_SET_TXN_NOW 29 /* set_timout() (internal) */ +#define DB_SET_TXN_TIMEOUT 30 /* set_timout() */ +#define DB_UPDATE_SECONDARY 31 /* c_get(), c_del() (internal) */ +#define DB_WRITECURSOR 32 /* cursor() */ +#define DB_WRITELOCK 33 /* cursor() (internal) */ + +/* This has to change when the max opcode hits 255. */ +#define DB_OPFLAGS_MASK 0x000000ff /* Mask for operations flags. */ + +/* + * Masks for flags that can be OR'd into DB access method and cursor + * operation values. Three top bits have already been taken: + * + * DB_AUTO_COMMIT 0x02000000 + * DB_READ_COMMITTED 0x04000000 + * DB_READ_UNCOMMITTED 0x08000000 + */ +#define DB_MULTIPLE 0x10000000 /* Return multiple data values. */ +#define DB_MULTIPLE_KEY 0x20000000 /* Return multiple data/key pairs. */ +#define DB_RMW 0x40000000 /* Acquire write lock immediately. */ + +/* + * DB (user visible) error return codes. + * + * !!! + * We don't want our error returns to conflict with other packages where + * possible, so pick a base error value that's hopefully not common. We + * document that we own the error name space from -30,800 to -30,999. + */ +/* DB (public) error return codes. */ +#define DB_BUFFER_SMALL (-30999)/* User memory too small for return. */ +#define DB_DONOTINDEX (-30998)/* "Null" return from 2ndary callbk. */ +#define DB_KEYEMPTY (-30997)/* Key/data deleted or never created. */ +#define DB_KEYEXIST (-30996)/* The key/data pair already exists. */ +#define DB_LOCK_DEADLOCK (-30995)/* Deadlock. */ +#define DB_LOCK_NOTGRANTED (-30994)/* Lock unavailable. */ +#define DB_LOG_BUFFER_FULL (-30993)/* In-memory log buffer full. */ +#define DB_NOSERVER (-30992)/* Server panic return. */ +#define DB_NOSERVER_HOME (-30991)/* Bad home sent to server. */ +#define DB_NOSERVER_ID (-30990)/* Bad ID sent to server. */ +#define DB_NOTFOUND (-30989)/* Key/data pair not found (EOF). */ +#define DB_OLD_VERSION (-30988)/* Out-of-date version. */ +#define DB_PAGE_NOTFOUND (-30987)/* Requested page not found. */ +#define DB_REP_DUPMASTER (-30986)/* There are two masters. */ +#define DB_REP_HANDLE_DEAD (-30985)/* Rolled back a commit. */ +#define DB_REP_HOLDELECTION (-30984)/* Time to hold an election. */ +#define DB_REP_IGNORE (-30983)/* This msg should be ignored.*/ +#define DB_REP_ISPERM (-30982)/* Cached not written perm written.*/ +#define DB_REP_JOIN_FAILURE (-30981)/* Unable to join replication group. */ +#define DB_REP_LOCKOUT (-30980)/* API/Replication lockout now. */ +#define DB_REP_NEWMASTER (-30979)/* We have learned of a new master. */ +#define DB_REP_NEWSITE (-30978)/* New site entered system. */ +#define DB_REP_NOTPERM (-30977)/* Permanent log record not written. */ +#define DB_REP_UNAVAIL (-30976)/* Site cannot currently be reached. */ +#define DB_RUNRECOVERY (-30975)/* Panic return. */ +#define DB_SECONDARY_BAD (-30974)/* Secondary index corrupt. */ +#define DB_VERIFY_BAD (-30973)/* Verify failed; bad format. */ +#define DB_VERSION_MISMATCH (-30972)/* Environment version mismatch. */ + +/* DB (private) error return codes. */ +#define DB_ALREADY_ABORTED (-30899) +#define DB_DELETED (-30898)/* Recovery file marked deleted. */ +#define DB_NEEDSPLIT (-30897)/* Page needs to be split. */ +#define DB_REP_BULKOVF (-30896)/* Rep bulk buffer overflow. */ +#define DB_REP_EGENCHG (-30895)/* Egen changed while in election. */ +#define DB_REP_LOGREADY (-30894)/* Rep log ready for recovery. */ +#define DB_REP_PAGEDONE (-30893)/* This page was already done. */ +#define DB_SURPRISE_KID (-30892)/* Child commit where parent + didn't know it was a parent. */ +#define DB_SWAPBYTES (-30891)/* Database needs byte swapping. */ +#define DB_TIMEOUT (-30890)/* Timed out waiting for election. */ +#define DB_TXN_CKP (-30889)/* Encountered ckp record in log. */ +#define DB_VERIFY_FATAL (-30888)/* DB->verify cannot proceed. */ + +/* Database handle. */ +struct __db { + /******************************************************* + * Public: owned by the application. + *******************************************************/ + u_int32_t pgsize; /* Database logical page size. */ + + /* Callbacks. */ + int (*db_append_recno) __P((DB *, DBT *, db_recno_t)); + void (*db_feedback) __P((DB *, int, int)); + int (*dup_compare) __P((DB *, const DBT *, const DBT *)); + + void *app_private; /* Application-private handle. */ + + /******************************************************* + * Private: owned by DB. + *******************************************************/ + DB_ENV *dbenv; /* Backing environment. */ + + DBTYPE type; /* DB access method type. */ + + DB_MPOOLFILE *mpf; /* Backing buffer pool. */ + + db_mutex_t mutex; /* Synchronization for free threading */ + + char *fname, *dname; /* File/database passed to DB->open. */ + u_int32_t open_flags; /* Flags passed to DB->open. */ + + u_int8_t fileid[DB_FILE_ID_LEN];/* File's unique ID for locking. */ + + u_int32_t adj_fileid; /* File's unique ID for curs. adj. */ + +#define DB_LOGFILEID_INVALID -1 + FNAME *log_filename; /* File's naming info for logging. */ + + db_pgno_t meta_pgno; /* Meta page number */ + u_int32_t lid; /* Locker id for handle locking. */ + u_int32_t cur_lid; /* Current handle lock holder. */ + u_int32_t associate_lid; /* Locker id for DB->associate call. */ + DB_LOCK handle_lock; /* Lock held on this handle. */ + + u_int cl_id; /* RPC: remote client id. */ + + time_t timestamp; /* Handle timestamp for replication. */ + u_int32_t fid_gen; /* Rep generation number for fids. */ + + /* + * Returned data memory for DB->get() and friends. + */ + DBT my_rskey; /* Secondary key. */ + DBT my_rkey; /* [Primary] key. */ + DBT my_rdata; /* Data. */ + + /* + * !!! + * Some applications use DB but implement their own locking outside of + * DB. If they're using fcntl(2) locking on the underlying database + * file, and we open and close a file descriptor for that file, we will + * discard their locks. The DB_FCNTL_LOCKING flag to DB->open is an + * undocumented interface to support this usage which leaves any file + * descriptors we open until DB->close. This will only work with the + * DB->open interface and simple caches, e.g., creating a transaction + * thread may open/close file descriptors this flag doesn't protect. + * Locking with fcntl(2) on a file that you don't own is a very, very + * unsafe thing to do. 'Nuff said. + */ + DB_FH *saved_open_fhp; /* Saved file handle. */ + + /* + * Linked list of DBP's, linked from the DB_ENV, used to keep track + * of all open db handles for cursor adjustment. + * + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_ENTRY(__db) dblistlinks; + */ + struct { + struct __db *tqe_next; + struct __db **tqe_prev; + } dblistlinks; + + /* + * Cursor queues. + * + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_HEAD(__cq_fq, __dbc) free_queue; + * TAILQ_HEAD(__cq_aq, __dbc) active_queue; + * TAILQ_HEAD(__cq_jq, __dbc) join_queue; + */ + struct __cq_fq { + struct __dbc *tqh_first; + struct __dbc **tqh_last; + } free_queue; + struct __cq_aq { + struct __dbc *tqh_first; + struct __dbc **tqh_last; + } active_queue; + struct __cq_jq { + struct __dbc *tqh_first; + struct __dbc **tqh_last; + } join_queue; + + /* + * Secondary index support. + * + * Linked list of secondary indices -- set in the primary. + * + * !!! + * Explicit representations of structures from queue.h. + * LIST_HEAD(s_secondaries, __db); + */ + struct { + struct __db *lh_first; + } s_secondaries; + + /* + * List entries for secondaries, and reference count of how + * many threads are updating this secondary (see __db_c_put). + * + * !!! + * Note that these are synchronized by the primary's mutex, but + * filled in in the secondaries. + * + * !!! + * Explicit representations of structures from queue.h. + * LIST_ENTRY(__db) s_links; + */ + struct { + struct __db *le_next; + struct __db **le_prev; + } s_links; + u_int32_t s_refcnt; + + /* Secondary callback and free functions -- set in the secondary. */ + int (*s_callback) __P((DB *, const DBT *, const DBT *, DBT *)); + + /* Reference to primary -- set in the secondary. */ + DB *s_primary; + +#define DB_ASSOC_IMMUTABLE_KEY 0x00000001 /* Secondary key is immutable. */ + + /* Flags passed to associate -- set in the secondary. */ + u_int32_t s_assoc_flags; + + /* API-private structure: used by DB 1.85, C++, Java, Perl and Tcl */ + void *api_internal; + + /* Subsystem-private structure. */ + void *bt_internal; /* Btree/Recno access method. */ + void *h_internal; /* Hash access method. */ + void *q_internal; /* Queue access method. */ + void *xa_internal; /* XA. */ + + /* DB PUBLIC HANDLE LIST BEGIN */ + int (*associate) __P((DB *, DB_TXN *, DB *, + int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t)); + int (*close) __P((DB *, u_int32_t)); + int (*compact) __P((DB *, + DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *)); + int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t)); + int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t)); + void (*err) __P((DB *, int, const char *, ...)); + void (*errx) __P((DB *, const char *, ...)); + int (*fd) __P((DB *, int *)); + int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); + int (*get_bt_minkey) __P((DB *, u_int32_t *)); + int (*get_byteswapped) __P((DB *, int *)); + int (*get_cachesize) __P((DB *, u_int32_t *, u_int32_t *, int *)); + int (*get_dbname) __P((DB *, const char **, const char **)); + int (*get_encrypt_flags) __P((DB *, u_int32_t *)); + DB_ENV *(*get_env) __P((DB *)); + void (*get_errfile) __P((DB *, FILE **)); + void (*get_errpfx) __P((DB *, const char **)); + int (*get_flags) __P((DB *, u_int32_t *)); + int (*get_h_ffactor) __P((DB *, u_int32_t *)); + int (*get_h_nelem) __P((DB *, u_int32_t *)); + int (*get_lorder) __P((DB *, int *)); + DB_MPOOLFILE *(*get_mpf) __P((DB *)); + void (*get_msgfile) __P((DB *, FILE **)); + int (*get_open_flags) __P((DB *, u_int32_t *)); + int (*get_pagesize) __P((DB *, u_int32_t *)); + int (*get_q_extentsize) __P((DB *, u_int32_t *)); + int (*get_re_delim) __P((DB *, int *)); + int (*get_re_len) __P((DB *, u_int32_t *)); + int (*get_re_pad) __P((DB *, int *)); + int (*get_re_source) __P((DB *, const char **)); + int (*get_transactional) __P((DB *)); + int (*get_type) __P((DB *, DBTYPE *)); + int (*join) __P((DB *, DBC **, DBC **, u_int32_t)); + int (*key_range) + __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)); + int (*open) __P((DB *, + DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)); + int (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)); + int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); + int (*remove) __P((DB *, const char *, const char *, u_int32_t)); + int (*rename) __P((DB *, + const char *, const char *, const char *, u_int32_t)); + int (*set_alloc) __P((DB *, void *(*)(size_t), + void *(*)(void *, size_t), void (*)(void *))); + int (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t))); + int (*set_bt_compare) + __P((DB *, int (*)(DB *, const DBT *, const DBT *))); + int (*set_bt_minkey) __P((DB *, u_int32_t)); + int (*set_bt_prefix) + __P((DB *, size_t (*)(DB *, const DBT *, const DBT *))); + int (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int)); + int (*set_dup_compare) + __P((DB *, int (*)(DB *, const DBT *, const DBT *))); + int (*set_encrypt) __P((DB *, const char *, u_int32_t)); + void (*set_errcall) __P((DB *, + void (*)(const DB_ENV *, const char *, const char *))); + void (*set_errfile) __P((DB *, FILE *)); + void (*set_errpfx) __P((DB *, const char *)); + int (*set_feedback) __P((DB *, void (*)(DB *, int, int))); + int (*set_flags) __P((DB *, u_int32_t)); + int (*set_h_ffactor) __P((DB *, u_int32_t)); + int (*set_h_hash) + __P((DB *, u_int32_t (*)(DB *, const void *, u_int32_t))); + int (*set_h_nelem) __P((DB *, u_int32_t)); + int (*set_lorder) __P((DB *, int)); + void (*set_msgcall) __P((DB *, void (*)(const DB_ENV *, const char *))); + void (*set_msgfile) __P((DB *, FILE *)); + int (*set_pagesize) __P((DB *, u_int32_t)); + int (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int))); + int (*set_q_extentsize) __P((DB *, u_int32_t)); + int (*set_re_delim) __P((DB *, int)); + int (*set_re_len) __P((DB *, u_int32_t)); + int (*set_re_pad) __P((DB *, int)); + int (*set_re_source) __P((DB *, const char *)); + int (*stat) __P((DB *, DB_TXN *, void *, u_int32_t)); + int (*stat_print) __P((DB *, u_int32_t)); + int (*sync) __P((DB *, u_int32_t)); + int (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t)); + int (*upgrade) __P((DB *, const char *, u_int32_t)); + int (*verify) + __P((DB *, const char *, const char *, FILE *, u_int32_t)); + /* DB PUBLIC HANDLE LIST END */ + + /* DB PRIVATE HANDLE LIST BEGIN */ + int (*dump) __P((DB *, const char *, + int (*)(void *, const void *), void *, int, int)); + int (*db_am_remove) __P((DB *, DB_TXN *, const char *, const char *)); + int (*db_am_rename) __P((DB *, DB_TXN *, + const char *, const char *, const char *)); + /* DB PRIVATE HANDLE LIST END */ + + /* + * Never called; these are a place to save function pointers + * so that we can undo an associate. + */ + int (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); + int (*stored_close) __P((DB *, u_int32_t)); + +#define DB_OK_BTREE 0x01 +#define DB_OK_HASH 0x02 +#define DB_OK_QUEUE 0x04 +#define DB_OK_RECNO 0x08 + u_int32_t am_ok; /* Legal AM choices. */ + + /* + * This field really ought to be an AM_FLAG, but we have + * have run out of bits. If/when we decide to split up + * the flags, we can incorporate it. + */ + int preserve_fid; /* Do not free fileid on close. */ + +#define DB_AM_CHKSUM 0x00000001 /* Checksumming */ +#define DB_AM_CL_WRITER 0x00000002 /* Allow writes in client replica */ +#define DB_AM_COMPENSATE 0x00000004 /* Created by compensating txn */ +#define DB_AM_CREATED 0x00000008 /* Database was created upon open */ +#define DB_AM_CREATED_MSTR 0x00000010 /* Encompassing file was created */ +#define DB_AM_DBM_ERROR 0x00000020 /* Error in DBM/NDBM database */ +#define DB_AM_DELIMITER 0x00000040 /* Variable length delimiter set */ +#define DB_AM_DISCARD 0x00000080 /* Discard any cached pages */ +#define DB_AM_DUP 0x00000100 /* DB_DUP */ +#define DB_AM_DUPSORT 0x00000200 /* DB_DUPSORT */ +#define DB_AM_ENCRYPT 0x00000400 /* Encryption */ +#define DB_AM_FIXEDLEN 0x00000800 /* Fixed-length records */ +#define DB_AM_INMEM 0x00001000 /* In-memory; no sync on close */ +#define DB_AM_INORDER 0x00002000 /* DB_INORDER */ +#define DB_AM_IN_RENAME 0x00004000 /* File is being renamed */ +#define DB_AM_NOT_DURABLE 0x00008000 /* Do not log changes */ +#define DB_AM_OPEN_CALLED 0x00010000 /* DB->open called */ +#define DB_AM_PAD 0x00020000 /* Fixed-length record pad */ +#define DB_AM_PGDEF 0x00040000 /* Page size was defaulted */ +#define DB_AM_RDONLY 0x00080000 /* Database is readonly */ +#define DB_AM_READ_UNCOMMITTED 0x00100000 /* Support degree 1 isolation */ +#define DB_AM_RECNUM 0x00200000 /* DB_RECNUM */ +#define DB_AM_RECOVER 0x00400000 /* DB opened by recovery routine */ +#define DB_AM_RENUMBER 0x00800000 /* DB_RENUMBER */ +#define DB_AM_REVSPLITOFF 0x01000000 /* DB_REVSPLITOFF */ +#define DB_AM_SECONDARY 0x02000000 /* Database is a secondary index */ +#define DB_AM_SNAPSHOT 0x04000000 /* DB_SNAPSHOT */ +#define DB_AM_SUBDB 0x08000000 /* Subdatabases supported */ +#define DB_AM_SWAP 0x10000000 /* Pages need to be byte-swapped */ +#define DB_AM_TXN 0x20000000 /* Opened in a transaction */ +#define DB_AM_VERIFYING 0x40000000 /* DB handle is in the verifier */ + u_int32_t orig_flags; /* Flags at open, for refresh */ + u_int32_t flags; +}; + +/* + * Macros for bulk get. These are only intended for the C API. + * For C++, use DbMultiple*Iterator. + */ +#define DB_MULTIPLE_INIT(pointer, dbt) \ + (pointer = (u_int8_t *)(dbt)->data + \ + (dbt)->ulen - sizeof(u_int32_t)) +#define DB_MULTIPLE_NEXT(pointer, dbt, retdata, retdlen) \ + do { \ + if (*((u_int32_t *)(pointer)) == (u_int32_t)-1) { \ + retdata = NULL; \ + pointer = NULL; \ + break; \ + } \ + retdata = (u_int8_t *) \ + (dbt)->data + *(u_int32_t *)(pointer); \ + (pointer) = (u_int32_t *)(pointer) - 1; \ + retdlen = *(u_int32_t *)(pointer); \ + (pointer) = (u_int32_t *)(pointer) - 1; \ + if (retdlen == 0 && \ + retdata == (u_int8_t *)(dbt)->data) \ + retdata = NULL; \ + } while (0) +#define DB_MULTIPLE_KEY_NEXT(pointer, dbt, retkey, retklen, retdata, retdlen) \ + do { \ + if (*((u_int32_t *)(pointer)) == (u_int32_t)-1) { \ + retdata = NULL; \ + retkey = NULL; \ + pointer = NULL; \ + break; \ + } \ + retkey = (u_int8_t *) \ + (dbt)->data + *(u_int32_t *)(pointer); \ + (pointer) = (u_int32_t *)(pointer) - 1; \ + retklen = *(u_int32_t *)(pointer); \ + (pointer) = (u_int32_t *)(pointer) - 1; \ + retdata = (u_int8_t *) \ + (dbt)->data + *(u_int32_t *)(pointer); \ + (pointer) = (u_int32_t *)(pointer) - 1; \ + retdlen = *(u_int32_t *)(pointer); \ + (pointer) = (u_int32_t *)(pointer) - 1; \ + } while (0) + +#define DB_MULTIPLE_RECNO_NEXT(pointer, dbt, recno, retdata, retdlen) \ + do { \ + if (*((u_int32_t *)(pointer)) == (u_int32_t)0) { \ + recno = 0; \ + retdata = NULL; \ + pointer = NULL; \ + break; \ + } \ + recno = *(u_int32_t *)(pointer); \ + (pointer) = (u_int32_t *)(pointer) - 1; \ + retdata = (u_int8_t *) \ + (dbt)->data + *(u_int32_t *)(pointer); \ + (pointer) = (u_int32_t *)(pointer) - 1; \ + retdlen = *(u_int32_t *)(pointer); \ + (pointer) = (u_int32_t *)(pointer) - 1; \ + } while (0) + +/******************************************************* + * Access method cursors. + *******************************************************/ +struct __dbc { + DB *dbp; /* Related DB access method. */ + DB_TXN *txn; /* Associated transaction. */ + + /* + * Active/free cursor queues. + * + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_ENTRY(__dbc) links; + */ + struct { + DBC *tqe_next; + DBC **tqe_prev; + } links; + + /* + * The DBT *'s below are used by the cursor routines to return + * data to the user when DBT flags indicate that DB should manage + * the returned memory. They point at a DBT containing the buffer + * and length that will be used, and "belonging" to the handle that + * should "own" this memory. This may be a "my_*" field of this + * cursor--the default--or it may be the corresponding field of + * another cursor, a DB handle, a join cursor, etc. In general, it + * will be whatever handle the user originally used for the current + * DB interface call. + */ + DBT *rskey; /* Returned secondary key. */ + DBT *rkey; /* Returned [primary] key. */ + DBT *rdata; /* Returned data. */ + + DBT my_rskey; /* Space for returned secondary key. */ + DBT my_rkey; /* Space for returned [primary] key. */ + DBT my_rdata; /* Space for returned data. */ + + void *lref; /* Reference to default locker. */ + u_int32_t locker; /* Locker for this operation. */ + DBT lock_dbt; /* DBT referencing lock. */ + DB_LOCK_ILOCK lock; /* Object to be locked. */ + DB_LOCK mylock; /* CDB lock held on this cursor. */ + + u_int cl_id; /* Remote client id. */ + + DBTYPE dbtype; /* Cursor type. */ + + DBC_INTERNAL *internal; /* Access method private. */ + + /* DBC PUBLIC HANDLE LIST BEGIN */ + int (*c_close) __P((DBC *)); + int (*c_count) __P((DBC *, db_recno_t *, u_int32_t)); + int (*c_del) __P((DBC *, u_int32_t)); + int (*c_dup) __P((DBC *, DBC **, u_int32_t)); + int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t)); + int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t)); + int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t)); + /* DBC PUBLIC HANDLE LIST END */ + + /* DBC PRIVATE HANDLE LIST BEGIN */ + int (*c_am_bulk) __P((DBC *, DBT *, u_int32_t)); + int (*c_am_close) __P((DBC *, db_pgno_t, int *)); + int (*c_am_del) __P((DBC *)); + int (*c_am_destroy) __P((DBC *)); + int (*c_am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); + int (*c_am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); + int (*c_am_writelock) __P((DBC *)); + /* DBC PRIVATE HANDLE LIST END */ + +/* + * DBC_DONTLOCK and DBC_RECOVER are used during recovery and transaction + * abort. If a transaction is being aborted or recovered then DBC_RECOVER + * will be set and locking and logging will be disabled on this cursor. If + * we are performing a compensating transaction (e.g. free page processing) + * then DB_DONTLOCK will be set to inhibit locking, but logging will still + * be required. DB_DONTLOCK is also used if the whole database is locked. + */ +#define DBC_ACTIVE 0x0001 /* Cursor in use. */ +#define DBC_DONTLOCK 0x0002 /* Don't lock on this cursor. */ +#define DBC_MULTIPLE 0x0004 /* Return Multiple data. */ +#define DBC_MULTIPLE_KEY 0x0008 /* Return Multiple keys and data. */ +#define DBC_OPD 0x0010 /* Cursor references off-page dups. */ +#define DBC_OWN_LID 0x0020 /* Free lock id on destroy. */ +#define DBC_READ_COMMITTED 0x0040 /* Cursor has degree 2 isolation. */ +#define DBC_READ_UNCOMMITTED 0x0080 /* Cursor has degree 1 isolation. */ +#define DBC_RECOVER 0x0100 /* Recovery cursor; don't log/lock. */ +#define DBC_RMW 0x0200 /* Acquire write flag in read op. */ +#define DBC_TRANSIENT 0x0400 /* Cursor is transient. */ +#define DBC_WRITECURSOR 0x0800 /* Cursor may be used to write (CDB). */ +#define DBC_WRITER 0x1000 /* Cursor immediately writing (CDB). */ + u_int32_t flags; +}; + +/* Key range statistics structure */ +struct __key_range { + double less; + double equal; + double greater; +}; + +/* Btree/Recno statistics structure. */ +struct __db_bt_stat { + u_int32_t bt_magic; /* Magic number. */ + u_int32_t bt_version; /* Version number. */ + u_int32_t bt_metaflags; /* Metadata flags. */ + u_int32_t bt_nkeys; /* Number of unique keys. */ + u_int32_t bt_ndata; /* Number of data items. */ + u_int32_t bt_pagesize; /* Page size. */ + u_int32_t bt_minkey; /* Minkey value. */ + u_int32_t bt_re_len; /* Fixed-length record length. */ + u_int32_t bt_re_pad; /* Fixed-length record pad. */ + u_int32_t bt_levels; /* Tree levels. */ + u_int32_t bt_int_pg; /* Internal pages. */ + u_int32_t bt_leaf_pg; /* Leaf pages. */ + u_int32_t bt_dup_pg; /* Duplicate pages. */ + u_int32_t bt_over_pg; /* Overflow pages. */ + u_int32_t bt_empty_pg; /* Empty pages. */ + u_int32_t bt_free; /* Pages on the free list. */ + u_int32_t bt_int_pgfree; /* Bytes free in internal pages. */ + u_int32_t bt_leaf_pgfree; /* Bytes free in leaf pages. */ + u_int32_t bt_dup_pgfree; /* Bytes free in duplicate pages. */ + u_int32_t bt_over_pgfree; /* Bytes free in overflow pages. */ +}; + +struct __db_compact { + /* Input Parameters. */ + u_int32_t compact_fillpercent; /* Desired fillfactor: 1-100 */ + db_timeout_t compact_timeout; /* Lock timeout. */ + u_int32_t compact_pages; /* Max pages to process. */ + /* Output Stats. */ + u_int32_t compact_pages_free; /* Number of pages freed. */ + u_int32_t compact_pages_examine; /* Number of pages examine. */ + u_int32_t compact_levels; /* Number of levels removed. */ + u_int32_t compact_deadlock; /* Number of deadlocks. */ + db_pgno_t compact_pages_truncated; /* Pages truncated to OS. */ + /* Internal. */ + db_pgno_t compact_truncate; /* Page number for truncation */ +}; + +/* Hash statistics structure. */ +struct __db_h_stat { + u_int32_t hash_magic; /* Magic number. */ + u_int32_t hash_version; /* Version number. */ + u_int32_t hash_metaflags; /* Metadata flags. */ + u_int32_t hash_nkeys; /* Number of unique keys. */ + u_int32_t hash_ndata; /* Number of data items. */ + u_int32_t hash_pagesize; /* Page size. */ + u_int32_t hash_ffactor; /* Fill factor specified at create. */ + u_int32_t hash_buckets; /* Number of hash buckets. */ + u_int32_t hash_free; /* Pages on the free list. */ + u_int32_t hash_bfree; /* Bytes free on bucket pages. */ + u_int32_t hash_bigpages; /* Number of big key/data pages. */ + u_int32_t hash_big_bfree; /* Bytes free on big item pages. */ + u_int32_t hash_overflows; /* Number of overflow pages. */ + u_int32_t hash_ovfl_free; /* Bytes free on ovfl pages. */ + u_int32_t hash_dup; /* Number of dup pages. */ + u_int32_t hash_dup_free; /* Bytes free on duplicate pages. */ +}; + +/* Queue statistics structure. */ +struct __db_qam_stat { + u_int32_t qs_magic; /* Magic number. */ + u_int32_t qs_version; /* Version number. */ + u_int32_t qs_metaflags; /* Metadata flags. */ + u_int32_t qs_nkeys; /* Number of unique keys. */ + u_int32_t qs_ndata; /* Number of data items. */ + u_int32_t qs_pagesize; /* Page size. */ + u_int32_t qs_extentsize; /* Pages per extent. */ + u_int32_t qs_pages; /* Data pages. */ + u_int32_t qs_re_len; /* Fixed-length record length. */ + u_int32_t qs_re_pad; /* Fixed-length record pad. */ + u_int32_t qs_pgfree; /* Bytes free in data pages. */ + u_int32_t qs_first_recno; /* First not deleted record. */ + u_int32_t qs_cur_recno; /* Next available record number. */ +}; + +/******************************************************* + * Environment. + *******************************************************/ +#define DB_REGION_MAGIC 0x120897 /* Environment magic number. */ + +/* Database Environment handle. */ +struct __db_env { + /******************************************************* + * Public: owned by the application. + *******************************************************/ + /* Error message callback. */ + void (*db_errcall) __P((const DB_ENV *, const char *, const char *)); + FILE *db_errfile; /* Error message file stream. */ + const char *db_errpfx; /* Error message prefix. */ + + FILE *db_msgfile; /* Statistics message file stream. */ + /* Statistics message callback. */ + void (*db_msgcall) __P((const DB_ENV *, const char *)); + + /* Other Callbacks. */ + void (*db_feedback) __P((DB_ENV *, int, int)); + void (*db_paniccall) __P((DB_ENV *, int)); + void (*db_event_func) __P((DB_ENV *, u_int32_t, void *)); + + /* App-specified alloc functions. */ + void *(*db_malloc) __P((size_t)); + void *(*db_realloc) __P((void *, size_t)); + void (*db_free) __P((void *)); + + /* Application callback to copy data to/from a custom data source. */ +#define DB_USERCOPY_GETDATA 0x0001 +#define DB_USERCOPY_SETDATA 0x0002 + int (*dbt_usercopy) + __P((DBT *, u_int32_t, void *, u_int32_t, u_int32_t)); + + /* + * Currently, the verbose list is a bit field with room for 32 + * entries. There's no reason that it needs to be limited, if + * there are ever more than 32 entries, convert to a bit array. + */ +#define DB_VERB_DEADLOCK 0x0001 /* Deadlock detection information. */ +#define DB_VERB_RECOVERY 0x0002 /* Recovery information. */ +#define DB_VERB_REGISTER 0x0004 /* Dump waits-for table. */ +#define DB_VERB_REPLICATION 0x0008 /* Replication information. */ +#define DB_VERB_WAITSFOR 0x0010 /* Dump waits-for table. */ + u_int32_t verbose; /* Verbose output. */ + + void *app_private; /* Application-private handle. */ + + int (*app_dispatch) /* User-specified recovery dispatch. */ + __P((DB_ENV *, DBT *, DB_LSN *, db_recops)); + + /* Mutexes. */ + u_int32_t mutex_align; /* Mutex alignment */ + u_int32_t mutex_cnt; /* Number of mutexes to configure */ + u_int32_t mutex_inc; /* Number of mutexes to add */ + u_int32_t mutex_tas_spins;/* Test-and-set spin count */ + + struct { + int alloc_id; /* Allocation ID argument */ + u_int32_t flags; /* Flags argument */ + } *mutex_iq; /* Initial mutexes queue */ + u_int mutex_iq_next; /* Count of initial mutexes */ + u_int mutex_iq_max; /* Maximum initial mutexes */ + + /* Locking. */ + u_int8_t *lk_conflicts; /* Two dimensional conflict matrix. */ + int lk_modes; /* Number of lock modes in table. */ + u_int32_t lk_max; /* Maximum number of locks. */ + u_int32_t lk_max_lockers;/* Maximum number of lockers. */ + u_int32_t lk_max_objects;/* Maximum number of locked objects. */ + u_int32_t lk_detect; /* Deadlock detect on all conflicts. */ + db_timeout_t lk_timeout; /* Lock timeout period. */ + + /* Logging. */ + u_int32_t lg_bsize; /* Buffer size. */ + u_int32_t lg_size; /* Log file size. */ + u_int32_t lg_regionmax; /* Region size. */ + int lg_filemode; /* Log file permission mode. */ + + /* Memory pool. */ + u_int32_t mp_gbytes; /* Cachesize: GB. */ + u_int32_t mp_bytes; /* Cachesize: Bytes. */ + u_int mp_ncache; /* Number of cache regions. */ + size_t mp_mmapsize; /* Maximum file size for mmap. */ + int mp_maxopenfd; /* Maximum open file descriptors. */ + int mp_maxwrite; /* Maximum buffers to write. */ + int /* Sleep after writing max buffers. */ + mp_maxwrite_sleep; + + /* Transactions. */ + u_int32_t tx_max; /* Maximum number of transactions. */ + time_t tx_timestamp; /* Recover to specific timestamp. */ + db_timeout_t tx_timeout; /* Timeout for transactions. */ + + /* Thread tracking. */ + u_int32_t thr_nbucket; /* Number of hash buckets. */ + u_int32_t thr_max; /* Max before garbage collection. */ + void *thr_hashtab; /* Hash table of DB_THREAD_INFO. */ + + /******************************************************* + * Private: owned by DB. + *******************************************************/ + pid_t pid_cache; /* Cached process ID. */ + + /* User files, paths. */ + char *db_home; /* Database home. */ + char *db_log_dir; /* Database log file directory. */ + char *db_tmp_dir; /* Database tmp file directory. */ + + char **db_data_dir; /* Database data file directories. */ + int data_cnt; /* Database data file slots. */ + int data_next; /* Next Database data file slot. */ + + int db_mode; /* Default open permissions. */ + int dir_mode; /* Intermediate directory perms. */ + void *env_lref; /* Locker in non-threaded handles. */ + u_int32_t open_flags; /* Flags passed to DB_ENV->open. */ + + void *reginfo; /* REGINFO structure reference. */ + DB_FH *lockfhp; /* fcntl(2) locking file handle. */ + + DB_FH *registry; /* DB_REGISTER file handle. */ + u_int32_t registry_off; /* + * Offset of our slot. We can't use + * off_t because its size depends on + * build settings. + */ + + /* Return IDs. */ + void (*thread_id) __P((DB_ENV *, pid_t *, db_threadid_t *)); + /* Return if IDs alive. */ + int (*is_alive) + __P((DB_ENV *, pid_t, db_threadid_t, u_int32_t)); + /* Format IDs into a string. */ + char *(*thread_id_string) + __P((DB_ENV *, pid_t, db_threadid_t, char *)); + + int (**recover_dtab) /* Dispatch table for recover funcs. */ + __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t recover_dtab_size; + /* Slots in the dispatch table. */ + + void *cl_handle; /* RPC: remote client handle. */ + u_int cl_id; /* RPC: remote client env id. */ + + int db_ref; /* DB reference count. */ + + long shm_key; /* shmget(2) key. */ + + /* + * List of open DB handles for this DB_ENV, used for cursor + * adjustment. Must be protected for multi-threaded support. + * + * !!! + * As this structure is allocated in per-process memory, the + * mutex may need to be stored elsewhere on architectures unable + * to support mutexes in heap memory, e.g. HP/UX 9. + * + * !!! + * Explicit representation of structure in queue.h. + * TAILQ_HEAD(__dblist, __db); + */ + db_mutex_t mtx_dblist; /* Mutex. */ + struct __dblist { + struct __db *tqh_first; + struct __db **tqh_last; + } dblist; + + /* + * XA support. + * + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_ENTRY(__db_env) links; + * TAILQ_HEAD(xa_txn, __db_txn); + */ + struct { + struct __db_env *tqe_next; + struct __db_env **tqe_prev; + } links; + struct __xa_txn { /* XA Active Transactions. */ + struct __db_txn *tqh_first; + struct __db_txn **tqh_last; + } xa_txn; + int xa_rmid; /* XA Resource Manager ID. */ + + char *passwd; /* Cryptography support. */ + size_t passwd_len; + void *crypto_handle; /* Primary handle. */ + db_mutex_t mtx_mt; /* Mersenne Twister mutex. */ + int mti; /* Mersenne Twister index. */ + u_long *mt; /* Mersenne Twister state vector. */ + + /* API-private structure. */ + void *api1_internal; /* C++, Perl API private */ + void *api2_internal; /* Java API private */ + + DB_LOCKTAB *lk_handle; /* Lock handle. */ + DB_LOG *lg_handle; /* Log handle. */ + DB_MPOOL *mp_handle; /* Mpool handle. */ + DB_MUTEXMGR *mutex_handle; /* Mutex handle. */ + DB_REP *rep_handle; /* Replication handle. */ + DB_TXNMGR *tx_handle; /* Txn handle. */ + + /* DB_ENV PUBLIC HANDLE LIST BEGIN */ + int (*cdsgroup_begin) __P((DB_ENV *, DB_TXN **)); + int (*close) __P((DB_ENV *, u_int32_t)); + int (*dbremove) __P((DB_ENV *, + DB_TXN *, const char *, const char *, u_int32_t)); + int (*dbrename) __P((DB_ENV *, + DB_TXN *, const char *, const char *, const char *, u_int32_t)); + void (*err) __P((const DB_ENV *, int, const char *, ...)); + void (*errx) __P((const DB_ENV *, const char *, ...)); + int (*failchk) __P((DB_ENV *, u_int32_t)); + int (*fileid_reset) __P((DB_ENV *, const char *, u_int32_t)); + int (*get_cachesize) __P((DB_ENV *, u_int32_t *, u_int32_t *, int *)); + int (*get_data_dirs) __P((DB_ENV *, const char ***)); + int (*get_encrypt_flags) __P((DB_ENV *, u_int32_t *)); + void (*get_errfile) __P((DB_ENV *, FILE **)); + void (*get_errpfx) __P((DB_ENV *, const char **)); + int (*get_flags) __P((DB_ENV *, u_int32_t *)); + int (*get_home) __P((DB_ENV *, const char **)); + int (*get_lg_bsize) __P((DB_ENV *, u_int32_t *)); + int (*get_lg_dir) __P((DB_ENV *, const char **)); + int (*get_lg_filemode) __P((DB_ENV *, int *)); + int (*get_lg_max) __P((DB_ENV *, u_int32_t *)); + int (*get_lg_regionmax) __P((DB_ENV *, u_int32_t *)); + int (*get_lk_conflicts) __P((DB_ENV *, const u_int8_t **, int *)); + int (*get_lk_detect) __P((DB_ENV *, u_int32_t *)); + int (*get_lk_max_lockers) __P((DB_ENV *, u_int32_t *)); + int (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *)); + int (*get_lk_max_objects) __P((DB_ENV *, u_int32_t *)); + int (*get_mp_max_openfd) __P((DB_ENV *, int *)); + int (*get_mp_max_write) __P((DB_ENV *, int *, int *)); + int (*get_mp_mmapsize) __P((DB_ENV *, size_t *)); + void (*get_msgfile) __P((DB_ENV *, FILE **)); + int (*get_open_flags) __P((DB_ENV *, u_int32_t *)); + int (*get_shm_key) __P((DB_ENV *, long *)); + int (*get_timeout) __P((DB_ENV *, db_timeout_t *, u_int32_t)); + int (*get_tmp_dir) __P((DB_ENV *, const char **)); + int (*get_tx_max) __P((DB_ENV *, u_int32_t *)); + int (*get_tx_timestamp) __P((DB_ENV *, time_t *)); + int (*get_verbose) __P((DB_ENV *, u_int32_t, int *)); + int (*is_bigendian) __P((void)); + int (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, int *)); + int (*lock_get) __P((DB_ENV *, + u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *)); + int (*lock_id) __P((DB_ENV *, u_int32_t *)); + int (*lock_id_free) __P((DB_ENV *, u_int32_t)); + int (*lock_put) __P((DB_ENV *, DB_LOCK *)); + int (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t)); + int (*lock_stat_print) __P((DB_ENV *, u_int32_t)); + int (*lock_vec) __P((DB_ENV *, + u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **)); + int (*log_archive) __P((DB_ENV *, char **[], u_int32_t)); + int (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t)); + int (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t)); + int (*log_flush) __P((DB_ENV *, const DB_LSN *)); + int (*log_printf) __P((DB_ENV *, DB_TXN *, const char *, ...)); + int (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t)); + int (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t)); + int (*log_stat_print) __P((DB_ENV *, u_int32_t)); + int (*lsn_reset) __P((DB_ENV *, const char *, u_int32_t)); + int (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t)); + int (*memp_register) __P((DB_ENV *, int, int (*)(DB_ENV *, + db_pgno_t, void *, DBT *), int (*)(DB_ENV *, + db_pgno_t, void *, DBT *))); + int (*memp_stat) __P((DB_ENV *, + DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t)); + int (*memp_stat_print) __P((DB_ENV *, u_int32_t)); + int (*memp_sync) __P((DB_ENV *, DB_LSN *)); + int (*memp_trickle) __P((DB_ENV *, int, int *)); + int (*mutex_alloc) __P((DB_ENV *, u_int32_t, db_mutex_t *)); + int (*mutex_free) __P((DB_ENV *, db_mutex_t)); + int (*mutex_get_align) __P((DB_ENV *, u_int32_t *)); + int (*mutex_get_increment) __P((DB_ENV *, u_int32_t *)); + int (*mutex_get_max) __P((DB_ENV *, u_int32_t *)); + int (*mutex_get_tas_spins) __P((DB_ENV *, u_int32_t *)); + int (*mutex_lock) __P((DB_ENV *, db_mutex_t)); + int (*mutex_set_align) __P((DB_ENV *, u_int32_t)); + int (*mutex_set_increment) __P((DB_ENV *, u_int32_t)); + int (*mutex_set_max) __P((DB_ENV *, u_int32_t)); + int (*mutex_set_tas_spins) __P((DB_ENV *, u_int32_t)); + int (*mutex_stat) __P((DB_ENV *, DB_MUTEX_STAT **, u_int32_t)); + int (*mutex_stat_print) __P((DB_ENV *, u_int32_t)); + int (*mutex_unlock) __P((DB_ENV *, db_mutex_t)); + int (*open) __P((DB_ENV *, const char *, u_int32_t, int)); + int (*remove) __P((DB_ENV *, const char *, u_int32_t)); + int (*rep_elect) + __P((DB_ENV *, int, int, int *, u_int32_t)); + int (*rep_flush) __P((DB_ENV *)); + int (*rep_get_config) __P((DB_ENV *, u_int32_t, int *)); + int (*rep_get_limit) __P((DB_ENV *, u_int32_t *, u_int32_t *)); + int (*rep_get_nsites) __P((DB_ENV *, int *)); + int (*rep_get_priority) __P((DB_ENV *, int *)); + int (*rep_get_timeout) __P((DB_ENV *, int, u_int32_t *)); + int (*rep_process_message) + __P((DB_ENV *, DBT *, DBT *, int *, DB_LSN *)); + int (*rep_set_config) __P((DB_ENV *, u_int32_t, int)); + int (*rep_set_limit) __P((DB_ENV *, u_int32_t, u_int32_t)); + int (*rep_set_nsites) __P((DB_ENV *, int)); + int (*rep_set_priority) __P((DB_ENV *, int)); + int (*rep_set_timeout) __P((DB_ENV *, int, db_timeout_t)); + int (*rep_set_transport) __P((DB_ENV *, int, int (*)(DB_ENV *, + const DBT *, const DBT *, const DB_LSN *, int, u_int32_t))); + int (*rep_start) __P((DB_ENV *, DBT *, u_int32_t)); + int (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t)); + int (*rep_stat_print) __P((DB_ENV *, u_int32_t)); + int (*rep_sync) __P((DB_ENV *, u_int32_t)); + int (*repmgr_add_remote_site) __P((DB_ENV *, const char *, u_int, + int *, u_int32_t)); + int (*repmgr_get_ack_policy) __P((DB_ENV *, int *)); + int (*repmgr_set_ack_policy) __P((DB_ENV *, int)); + int (*repmgr_set_local_site) __P((DB_ENV *, const char *, u_int, + u_int32_t)); + int (*repmgr_site_list) __P((DB_ENV *, u_int *, + DB_REPMGR_SITE **)); + int (*repmgr_start) __P((DB_ENV *, int, u_int32_t)); + int (*set_alloc) __P((DB_ENV *, void *(*)(size_t), + void *(*)(void *, size_t), void (*)(void *))); + int (*set_app_dispatch) + __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops))); + int (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int)); + int (*set_data_dir) __P((DB_ENV *, const char *)); + int (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t)); + void (*set_errcall) __P((DB_ENV *, + void (*)(const DB_ENV *, const char *, const char *))); + void (*set_errfile) __P((DB_ENV *, FILE *)); + void (*set_errpfx) __P((DB_ENV *, const char *)); + int (*set_event_notify) + __P((DB_ENV *, void (*)(DB_ENV *, u_int32_t, void *))); + int (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int))); + int (*set_flags) __P((DB_ENV *, u_int32_t, int)); + int (*set_intermediate_dir) __P((DB_ENV *, int, u_int32_t)); + int (*set_isalive) __P((DB_ENV *, + int (*)(DB_ENV *, pid_t, db_threadid_t, u_int32_t))); + int (*set_lg_bsize) __P((DB_ENV *, u_int32_t)); + int (*set_lg_dir) __P((DB_ENV *, const char *)); + int (*set_lg_filemode) __P((DB_ENV *, int)); + int (*set_lg_max) __P((DB_ENV *, u_int32_t)); + int (*set_lg_regionmax) __P((DB_ENV *, u_int32_t)); + int (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int)); + int (*set_lk_detect) __P((DB_ENV *, u_int32_t)); + int (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t)); + int (*set_lk_max_locks) __P((DB_ENV *, u_int32_t)); + int (*set_lk_max_objects) __P((DB_ENV *, u_int32_t)); + int (*set_mp_max_openfd) __P((DB_ENV *, int)); + int (*set_mp_max_write) __P((DB_ENV *, int, int)); + int (*set_mp_mmapsize) __P((DB_ENV *, size_t)); + void (*set_msgcall) + __P((DB_ENV *, void (*)(const DB_ENV *, const char *))); + void (*set_msgfile) __P((DB_ENV *, FILE *)); + int (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int))); + int (*set_rep_request) __P((DB_ENV *, u_int32_t, u_int32_t)); + int (*set_rpc_server) + __P((DB_ENV *, void *, const char *, long, long, u_int32_t)); + int (*set_shm_key) __P((DB_ENV *, long)); + int (*set_thread_count) __P((DB_ENV *, u_int32_t)); + int (*set_thread_id) __P((DB_ENV *, + void (*)(DB_ENV *, pid_t *, db_threadid_t *))); + int (*set_thread_id_string) __P((DB_ENV *, + char *(*)(DB_ENV *, pid_t, db_threadid_t, char *))); + int (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t)); + int (*set_tmp_dir) __P((DB_ENV *, const char *)); + int (*set_tx_max) __P((DB_ENV *, u_int32_t)); + int (*set_tx_timestamp) __P((DB_ENV *, time_t *)); + int (*set_verbose) __P((DB_ENV *, u_int32_t, int)); + int (*stat_print) __P((DB_ENV *, u_int32_t)); + int (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)); + int (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t)); + int (*txn_recover) + __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t)); + int (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t)); + int (*txn_stat_print) __P((DB_ENV *, u_int32_t)); + /* DB_ENV PUBLIC HANDLE LIST END */ + + /* DB_ENV PRIVATE HANDLE LIST BEGIN */ + int (*prdbt) __P((DBT *, + int, const char *, void *, int (*)(void *, const void *), int)); + /* DB_ENV PRIVATE HANDLE LIST END */ + +#define DB_TEST_ELECTINIT 1 /* after __rep_elect_init */ +#define DB_TEST_ELECTVOTE1 2 /* after sending VOTE1 */ +#define DB_TEST_POSTDESTROY 3 /* after destroy op */ +#define DB_TEST_POSTLOG 4 /* after logging all pages */ +#define DB_TEST_POSTLOGMETA 5 /* after logging meta in btree */ +#define DB_TEST_POSTOPEN 6 /* after __os_open */ +#define DB_TEST_POSTSYNC 7 /* after syncing the log */ +#define DB_TEST_PREDESTROY 8 /* before destroy op */ +#define DB_TEST_PREOPEN 9 /* before __os_open */ +#define DB_TEST_RECYCLE 10 /* test rep and txn_recycle */ +#define DB_TEST_SUBDB_LOCKS 11 /* subdb locking tests */ + int test_abort; /* Abort value for testing. */ + int test_check; /* Checkpoint value for testing. */ + int test_copy; /* Copy value for testing. */ + +#define DB_ENV_AUTO_COMMIT 0x00000001 /* DB_AUTO_COMMIT. */ +#define DB_ENV_CDB 0x00000002 /* DB_INIT_CDB. */ +#define DB_ENV_CDB_ALLDB 0x00000004 /* CDB environment wide locking. */ +#define DB_ENV_CREATE 0x00000008 /* DB_CREATE set. */ +#define DB_ENV_DBLOCAL 0x00000010 /* Environment for a private DB. */ +#define DB_ENV_DIRECT_DB 0x00000020 /* DB_DIRECT_DB set. */ +#define DB_ENV_DIRECT_LOG 0x00000040 /* DB_DIRECT_LOG set. */ +#define DB_ENV_DSYNC_DB 0x00000080 /* DB_DSYNC_DB set. */ +#define DB_ENV_DSYNC_LOG 0x00000100 /* DB_DSYNC_LOG set. */ +#define DB_ENV_FATAL 0x00000200 /* Doing fatal recovery in env. */ +#define DB_ENV_LOCKDOWN 0x00000400 /* DB_LOCKDOWN set. */ +#define DB_ENV_LOG_AUTOREMOVE 0x00000800 /* DB_LOG_AUTOREMOVE set. */ +#define DB_ENV_LOG_INMEMORY 0x00001000 /* DB_LOG_INMEMORY set. */ +#define DB_ENV_MULTIVERSION 0x00002000 /* DB_MULTIVERSION set. */ +#define DB_ENV_NOLOCKING 0x00004000 /* DB_NOLOCKING set. */ +#define DB_ENV_NOMMAP 0x00008000 /* DB_NOMMAP set. */ +#define DB_ENV_NOPANIC 0x00010000 /* Okay if panic set. */ +#define DB_ENV_OPEN_CALLED 0x00020000 /* DB_ENV->open called. */ +#define DB_ENV_OVERWRITE 0x00040000 /* DB_OVERWRITE set. */ +#define DB_ENV_PRIVATE 0x00080000 /* DB_PRIVATE set. */ +#define DB_ENV_REGION_INIT 0x00100000 /* DB_REGION_INIT set. */ +#define DB_ENV_RPCCLIENT 0x00200000 /* DB_RPCCLIENT set. */ +#define DB_ENV_RPCCLIENT_GIVEN 0x00400000 /* User-supplied RPC client struct */ +#define DB_ENV_SYSTEM_MEM 0x00800000 /* DB_SYSTEM_MEM set. */ +#define DB_ENV_THREAD 0x01000000 /* DB_THREAD set. */ +#define DB_ENV_TIME_NOTGRANTED 0x02000000 /* DB_TIME_NOTGRANTED set. */ +#define DB_ENV_TXN_NOSYNC 0x04000000 /* DB_TXN_NOSYNC set. */ +#define DB_ENV_TXN_SNAPSHOT 0x08000000 /* DB_TXN_SNAPSHOT set. */ +#define DB_ENV_TXN_WRITE_NOSYNC 0x10000000 /* DB_TXN_WRITE_NOSYNC set. */ +#define DB_ENV_YIELDCPU 0x20000000 /* DB_YIELDCPU set. */ + u_int32_t flags; +}; + +#ifndef DB_DBM_HSEARCH +#define DB_DBM_HSEARCH 0 /* No historic interfaces by default. */ +#endif +#if DB_DBM_HSEARCH != 0 +/******************************************************* + * Dbm/Ndbm historic interfaces. + *******************************************************/ +typedef struct __db DBM; + +#define DBM_INSERT 0 /* Flags to dbm_store(). */ +#define DBM_REPLACE 1 + +/* + * The DB support for ndbm(3) always appends this suffix to the + * file name to avoid overwriting the user's original database. + */ +#define DBM_SUFFIX ".db" + +#if defined(_XPG4_2) +typedef struct { + char *dptr; + size_t dsize; +} datum; +#else +typedef struct { + char *dptr; + int dsize; +} datum; +#endif + +/* + * Translate NDBM calls into DB calls so that DB doesn't step on the + * application's name space. + */ +#define dbm_clearerr(a) __db_ndbm_clearerr(a) +#define dbm_close(a) __db_ndbm_close(a) +#define dbm_delete(a, b) __db_ndbm_delete(a, b) +#define dbm_dirfno(a) __db_ndbm_dirfno(a) +#define dbm_error(a) __db_ndbm_error(a) +#define dbm_fetch(a, b) __db_ndbm_fetch(a, b) +#define dbm_firstkey(a) __db_ndbm_firstkey(a) +#define dbm_nextkey(a) __db_ndbm_nextkey(a) +#define dbm_open(a, b, c) __db_ndbm_open(a, b, c) +#define dbm_pagfno(a) __db_ndbm_pagfno(a) +#define dbm_rdonly(a) __db_ndbm_rdonly(a) +#define dbm_store(a, b, c, d) \ + __db_ndbm_store(a, b, c, d) + +/* + * Translate DBM calls into DB calls so that DB doesn't step on the + * application's name space. + * + * The global variables dbrdonly, dirf and pagf were not retained when 4BSD + * replaced the dbm interface with ndbm, and are not supported here. + */ +#define dbminit(a) __db_dbm_init(a) +#define dbmclose __db_dbm_close +#if !defined(__cplusplus) +#define delete(a) __db_dbm_delete(a) +#endif +#define fetch(a) __db_dbm_fetch(a) +#define firstkey __db_dbm_firstkey +#define nextkey(a) __db_dbm_nextkey(a) +#define store(a, b) __db_dbm_store(a, b) + +/******************************************************* + * Hsearch historic interface. + *******************************************************/ +typedef enum { + FIND, ENTER +} ACTION; + +typedef struct entry { + char *key; + char *data; +} ENTRY; + +#define hcreate(a) __db_hcreate(a) +#define hdestroy __db_hdestroy +#define hsearch(a, b) __db_hsearch(a, b) + +#endif /* DB_DBM_HSEARCH */ + +#if defined(__cplusplus) +} +#endif + +/* Restore default compiler warnings */ +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif /* !_DB_H_ */ + +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _DB_EXT_PROT_IN_ +#define _DB_EXT_PROT_IN_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int db_create __P((DB **, DB_ENV *, u_int32_t)); +char *db_strerror __P((int)); +int db_env_create __P((DB_ENV **, u_int32_t)); +char *db_version __P((int *, int *, int *)); +int log_compare __P((const DB_LSN *, const DB_LSN *)); +int db_env_set_func_close __P((int (*)(int))); +int db_env_set_func_dirfree __P((void (*)(char **, int))); +int db_env_set_func_dirlist __P((int (*)(const char *, char ***, int *))); +int db_env_set_func_exists __P((int (*)(const char *, int *))); +int db_env_set_func_free __P((void (*)(void *))); +int db_env_set_func_fsync __P((int (*)(int))); +int db_env_set_func_ftruncate __P((int (*)(int, off_t))); +int db_env_set_func_ioinfo __P((int (*)(const char *, int, u_int32_t *, u_int32_t *, u_int32_t *))); +int db_env_set_func_malloc __P((void *(*)(size_t))); +int db_env_set_func_map __P((int (*)(char *, size_t, int, int, void **))); +int db_env_set_func_pread __P((ssize_t (*)(int, void *, size_t, off_t))); +int db_env_set_func_pwrite __P((ssize_t (*)(int, const void *, size_t, off_t))); +int db_env_set_func_open __P((int (*)(const char *, int, ...))); +int db_env_set_func_read __P((ssize_t (*)(int, void *, size_t))); +int db_env_set_func_realloc __P((void *(*)(void *, size_t))); +int db_env_set_func_rename __P((int (*)(const char *, const char *))); +int db_env_set_func_seek __P((int (*)(int, off_t, int))); +int db_env_set_func_sleep __P((int (*)(u_long, u_long))); +int db_env_set_func_unlink __P((int (*)(const char *))); +int db_env_set_func_unmap __P((int (*)(void *, size_t))); +int db_env_set_func_write __P((ssize_t (*)(int, const void *, size_t))); +int db_env_set_func_yield __P((int (*)(void))); +int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t)); +#if DB_DBM_HSEARCH != 0 +int __db_ndbm_clearerr __P((DBM *)); +void __db_ndbm_close __P((DBM *)); +int __db_ndbm_delete __P((DBM *, datum)); +int __db_ndbm_dirfno __P((DBM *)); +int __db_ndbm_error __P((DBM *)); +datum __db_ndbm_fetch __P((DBM *, datum)); +datum __db_ndbm_firstkey __P((DBM *)); +datum __db_ndbm_nextkey __P((DBM *)); +DBM *__db_ndbm_open __P((const char *, int, int)); +int __db_ndbm_pagfno __P((DBM *)); +int __db_ndbm_rdonly __P((DBM *)); +int __db_ndbm_store __P((DBM *, datum, datum, int)); +int __db_dbm_close __P((void)); +int __db_dbm_delete __P((datum)); +datum __db_dbm_fetch __P((datum)); +datum __db_dbm_firstkey __P((void)); +int __db_dbm_init __P((char *)); +datum __db_dbm_nextkey __P((datum)); +int __db_dbm_store __P((datum, datum)); +#endif +#if DB_DBM_HSEARCH != 0 +int __db_hcreate __P((size_t)); +ENTRY *__db_hsearch __P((ENTRY, ACTION)); +void __db_hdestroy __P((void)); +#endif + +#if defined(__cplusplus) +} +#endif +#endif /* !_DB_EXT_PROT_IN_ */ diff --git a/db/build_windows/db_archive.dsp b/db/build_windows/db_archive.dsp new file mode 100644 index 000000000..4e9dc7633 --- /dev/null +++ b/db/build_windows/db_archive.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_archive" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_archive - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_archive.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_archive.mak" CFG="db_archive - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_archive - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_archive - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_archive - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_archive - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_archive - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_archive - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_archive - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_archive - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_archive - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_archive" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_archive" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_archive - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_archive" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_archive" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_archive - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_archive" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_archive" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_archive - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_archive" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_archive" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_archive - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_archive" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_archive" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_archive - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_archive" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_archive" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_archive - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_archive" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_archive" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_archive - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_archive" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_archive" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_archive - Win32 Release" +# Name "db_archive - Win32 Debug" +# Name "db_archive - Win32 ASCII Debug" +# Name "db_archive - Win32 ASCII Release" +# Name "db_archive - x64 Debug AMD64" +# Name "db_archive - x64 Release AMD64" +# Name "db_archive - x64 Debug IA64" +# Name "db_archive - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_archive\db_archive.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_checkpoint.dsp b/db/build_windows/db_checkpoint.dsp new file mode 100644 index 000000000..83bec7d2f --- /dev/null +++ b/db/build_windows/db_checkpoint.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_checkpoint" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_checkpoint - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_checkpoint.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_checkpoint.mak" CFG="db_checkpoint - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_checkpoint - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_checkpoint - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_checkpoint - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_checkpoint - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_checkpoint - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_checkpoint - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_checkpoint - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_checkpoint - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_checkpoint - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_checkpoint" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_checkpoint" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_checkpoint - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_checkpoint" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_checkpoint" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_checkpoint - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_checkpoint" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_checkpoint" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_checkpoint - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_checkpoint" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_checkpoint" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_checkpoint - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_checkpoint" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_checkpoint" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_checkpoint - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_checkpoint" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_checkpoint" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_checkpoint - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_checkpoint" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_checkpoint" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_checkpoint - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_checkpoint" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_checkpoint" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_checkpoint - Win32 Release" +# Name "db_checkpoint - Win32 Debug" +# Name "db_checkpoint - Win32 ASCII Debug" +# Name "db_checkpoint - Win32 ASCII Release" +# Name "db_checkpoint - x64 Debug AMD64" +# Name "db_checkpoint - x64 Release AMD64" +# Name "db_checkpoint - x64 Debug IA64" +# Name "db_checkpoint - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_checkpoint\db_checkpoint.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_config.h b/db/build_windows/db_config.h new file mode 100644 index 000000000..8e182ce63 --- /dev/null +++ b/db/build_windows/db_config.h @@ -0,0 +1,479 @@ +/* DO NOT EDIT: automatically built by dist/s_windows. */ +/* Define to 1 if you want to build a version for running the test suite. */ +/* #undef CONFIG_TEST */ + +/* We use DB_WIN32 much as one would use _WIN32 -- to specify that we're using + an operating system environment that supports Win32 calls and semantics. We + don't use _WIN32 because Cygwin/GCC also defines _WIN32, even though + Cygwin/GCC closely emulates the Unix environment. */ +#define DB_WIN32 1 + +/* Define to 1 if you want a debugging version. */ +#if defined(_DEBUG) +#if !defined(DEBUG) +#define DEBUG 1 +#endif +#endif + +/* Define to 1 if you want a version that logs read operations. */ +/* #undef DEBUG_ROP */ + +/* Define to 1 if you want a version that logs write operations. */ +/* #undef DEBUG_WOP */ + +/* Define to 1 if you want a version with run-time diagnostic checking. */ +/* #undef DIAGNOSTIC */ + +/* Define to 1 if 64-bit types are available. */ +#define HAVE_64BIT_TYPES 1 + +/* Define to 1 if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* Define to 1 if you have the `atoi' function. */ +#define HAVE_ATOI 1 + +/* Define to 1 if you have the `atol' function. */ +#define HAVE_ATOL 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +/* #undef HAVE_CLOCK_GETTIME */ + +/* Define to 1 if Berkeley DB release includes strong cryptography. */ +#ifndef HAVE_SMALLBUILD +#define HAVE_CRYPTO 1 +#endif + +/* Define to 1 if you have the `ctime_r' function. */ +/* #undef HAVE_CTIME_R */ + +/* Define to 1 if ctime_r takes a buffer length as a third argument. */ +/* #undef HAVE_CTIME_R_3ARG */ + +/* Define to 1 if you have the `directio' function. */ +/* #undef HAVE_DIRECTIO */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_DIRENT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines. */ +#define HAVE_EXIT_SUCCESS 1 + +/* Define to 1 if you have the `fchmod' function. */ +/* #undef HAVE_FCHMOD */ + +/* Define to 1 if you have the `fcntl' function. */ +/* #undef HAVE_FCNTL */ + +/* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */ +/* #undef HAVE_FCNTL_F_SETFD */ + +/* Define to 1 if you have the `fdatasync' function. */ +/* #undef HAVE_FDATASYNC */ + +/* Define to 1 if allocated filesystem blocks are not zeroed. */ +#define HAVE_FILESYSTEM_NOTZERO 1 + +/* Define to 1 if you have the `ftruncate' function. */ +#define HAVE_FTRUNCATE 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +/* #undef HAVE_GETADDRINFO */ + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getenv' function. */ +#define HAVE_GETENV 1 + +/* Define to 1 if you have the `getopt' function. */ +/* + * Windows does not have the getopt function, but as Berkeley DB example + * programs require getopt, we handle it outside of this configuration. + */ +#define HAVE_GETOPT 1 + +/* Define to 1 if you have the `getrusage' function. */ +/* #undef HAVE_GETRUSAGE */ + +/* Define to 1 if you have the `gettimeofday' function. */ +/* #undef HAVE_GETTIMEOFDAY */ + +/* Define to 1 if you have the `getuid' function. */ +/* #undef HAVE_GETUID */ + +/* Define to 1 if building Hash access method. */ +#ifndef HAVE_SMALLBUILD +#define HAVE_HASH 1 +#endif + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the `isalpha' function. */ +#define HAVE_ISALPHA 1 + +/* Define to 1 if you have the `isdigit' function. */ +#define HAVE_ISDIGIT 1 + +/* Define to 1 if you have the `isprint' function. */ +#define HAVE_ISPRINT 1 + +/* Define to 1 if you have the `isspace' function. */ +#define HAVE_ISSPACE 1 + +/* Define to 1 if you have the `memcmp' function. */ +#define HAVE_MEMCMP 1 + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mlock' function. */ +/* #undef HAVE_MLOCK */ + +/* Define to 1 if you have the `mmap' function. */ +/* #undef HAVE_MMAP */ + +/* Define to 1 if you have the `mprotect' function. */ +/* #undef HAVE_MPROTECT */ + +/* Define to 1 if you have the `munlock' function. */ +/* #undef HAVE_MUNLOCK */ + +/* Define to 1 if you have the `munmap' function. */ +/* #undef HAVE_MUNMAP */ + +/* Define to 1 to use the GCC compiler and 68K assembly language mutexes. */ +/* #undef HAVE_MUTEX_68K_GCC_ASSEMBLY */ + +/* Define to 1 to use the AIX _check_lock mutexes. */ +/* #undef HAVE_MUTEX_AIX_CHECK_LOCK */ + +/* Define to 1 to use the GCC compiler and Alpha assembly language mutexes. */ +/* #undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY */ + +/* Define to 1 to use the GCC compiler and ARM assembly language mutexes. */ +/* #undef HAVE_MUTEX_ARM_GCC_ASSEMBLY */ + +/* Define to 1 to use the Apple/Darwin _spin_lock_try mutexes. */ +/* #undef HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY */ + +/* Define to 1 to use the UNIX fcntl system call mutexes. */ +/* #undef HAVE_MUTEX_FCNTL */ + +/* Define to 1 to use the GCC compiler and PaRisc assembly language mutexes. + */ +/* #undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY */ + +/* Define to 1 to use the msem_XXX mutexes on HP-UX. */ +/* #undef HAVE_MUTEX_HPPA_MSEM_INIT */ + +/* Define to 1 to use the GCC compiler and IA64 assembly language mutexes. */ +/* #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY */ + +/* Define to 1 to use the GCC compiler and MIPS assembly language mutexes. */ +/* #undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY */ + +/* Define to 1 to use the msem_XXX mutexes on systems other than HP-UX. */ +/* #undef HAVE_MUTEX_MSEM_INIT */ + +/* Define to 1 to use the GCC compiler and PowerPC assembly language mutexes. + */ +/* #undef HAVE_MUTEX_PPC_GCC_ASSEMBLY */ + +/* Define to 1 to use POSIX 1003.1 pthread_XXX mutexes. */ +/* #undef HAVE_MUTEX_PTHREADS */ + +/* Define to 1 to use Reliant UNIX initspin mutexes. */ +/* #undef HAVE_MUTEX_RELIANTUNIX_INITSPIN */ + +/* Define to 1 to use the IBM C compiler and S/390 assembly language mutexes. + */ +/* #undef HAVE_MUTEX_S390_CC_ASSEMBLY */ + +/* Define to 1 to use the GCC compiler and S/390 assembly language mutexes. */ +/* #undef HAVE_MUTEX_S390_GCC_ASSEMBLY */ + +/* Define to 1 to use the SCO compiler and x86 assembly language mutexes. */ +/* #undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY */ + +/* Define to 1 to use the obsolete POSIX 1003.1 sema_XXX mutexes. */ +/* #undef HAVE_MUTEX_SEMA_INIT */ + +/* Define to 1 to use the SGI XXX_lock mutexes. */ +/* #undef HAVE_MUTEX_SGI_INIT_LOCK */ + +/* Define to 1 to use the Solaris _lock_XXX mutexes. */ +/* #undef HAVE_MUTEX_SOLARIS_LOCK_TRY */ + +/* Define to 1 to use the Solaris lwp threads mutexes. */ +/* #undef HAVE_MUTEX_SOLARIS_LWP */ + +/* Define to 1 to use the GCC compiler and Sparc assembly language mutexes. */ +/* #undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY */ + +/* Define to 1 if mutexes hold system resources. */ +/* #undef HAVE_MUTEX_SYSTEM_RESOURCES */ + +/* Define to 1 to configure mutexes intra-process only. */ +/* #undef HAVE_MUTEX_THREAD_ONLY */ + +/* Define to 1 to use the CC compiler and Tru64 assembly language mutexes. */ +/* #undef HAVE_MUTEX_TRU64_CC_ASSEMBLY */ + +/* Define to 1 to use the UNIX International mutexes. */ +/* #undef HAVE_MUTEX_UI_THREADS */ + +/* Define to 1 to use the UTS compiler and assembly language mutexes. */ +/* #undef HAVE_MUTEX_UTS_CC_ASSEMBLY */ + +/* Define to 1 to use VMS mutexes. */ +/* #undef HAVE_MUTEX_VMS */ + +/* Define to 1 to use VxWorks mutexes. */ +/* #undef HAVE_MUTEX_VXWORKS */ + +/* Define to 1 to use the MSVC compiler and Windows mutexes. */ +#define HAVE_MUTEX_WIN32 1 + +/* Define to 1 to use the GCC compiler and Windows mutexes. */ +/* #undef HAVE_MUTEX_WIN32_GCC */ + +/* Define to 1 to use the GCC compiler and amd64 assembly language mutexes. */ +/* #undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY */ + +/* Define to 1 to use the GCC compiler and x86 assembly language mutexes. */ +/* #undef HAVE_MUTEX_X86_GCC_ASSEMBLY */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the O_DIRECT flag. */ +/* #undef HAVE_O_DIRECT */ + +/* Define to 1 if you have the `pread' function. */ +/* #undef HAVE_PREAD */ + +/* Define to 1 if you have the `printf' function. */ +#define HAVE_PRINTF 1 + +/* Define to 1 if you have the `pstat_getdynamic' function. */ +/* #undef HAVE_PSTAT_GETDYNAMIC */ + +/* Define to 1 to configure Berkeley DB for POSIX pthread API. */ +/* #undef HAVE_PTHREAD_API */ + +/* Define to 1 if you have the `pthread_yield' function. */ +/* #undef HAVE_PTHREAD_YIELD */ + +/* Define to 1 if you have the `pwrite' function. */ +/* #undef HAVE_PWRITE */ + +/* Define to 1 if building on QNX. */ +/* #undef HAVE_QNX */ + +/* Define to 1 if building Queue access method. */ +#ifndef HAVE_SMALLBUILD +#define HAVE_QUEUE 1 +#endif + +/* Define to 1 if you have the `raise' function. */ +#define HAVE_RAISE 1 + +/* Define to 1 if you have the `rand' function. */ +#define HAVE_RAND 1 + +/* Define to 1 if building replication support. */ +#ifndef HAVE_SMALLBUILD +#define HAVE_REPLICATION 1 +#endif + +/* Define to 1 if building the Berkeley DB replication framework. */ +#ifndef HAVE_SMALLBUILD +#define HAVE_REPLICATION_THREADS 1 +#endif + +/* Define to 1 if building RPC client/server. */ +/* #undef HAVE_RPC */ + +/* Define to 1 if you have the `sched_yield' function. */ +/* #undef HAVE_SCHED_YIELD */ + +/* Define to 1 if you have the `select' function. */ +/* #undef HAVE_SELECT */ + +/* Define to 1 if you have the `shmget' function. */ +/* #undef HAVE_SHMGET */ + +/* Define to 1 if you have the `sigaction' function. */ +/* #undef HAVE_SIGACTION */ + +/* Define to 1 if thread identifier type db_threadid_t is integral. */ +#define HAVE_SIMPLE_THREAD_TYPE 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `stat' function. */ +#define HAVE_STAT 1 + +/* Define to 1 if building statistics support. */ +#define HAVE_STATISTICS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define to 1 if you have the `strcat' function. */ +#define HAVE_STRCAT 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the `strftime' function. */ +#define HAVE_STRFTIME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncat' function. */ +#define HAVE_STRNCAT 1 + +/* Define to 1 if you have the `strncmp' function. */ +#define HAVE_STRNCMP 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if `st_blksize' is member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_BLKSIZE */ + +/* Define to 1 if you have the `sysconf' function. */ +/* #undef HAVE_SYSCONF */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_FCNTL_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SELECT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TIME_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if unlink of file with open file descriptors will fail. */ +/* #undef HAVE_UNLINK_WITH_OPEN_FAILURE */ + +/* Define to 1 if building access method verification support. */ +#ifndef HAVE_SMALLBUILD +#define HAVE_VERIFY 1 +#endif + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define to 1 if building VxWorks. */ +/* #undef HAVE_VXWORKS */ + +/* Define to 1 if you have the `yield' function. */ +/* #undef HAVE_YIELD */ + +/* Define to 1 if you have the `_fstati64' function. */ +#define HAVE__FSTATI64 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "Berkeley DB" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "Berkeley DB 4.5.20" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "db-4.5.20" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "4.5.20" + +/* Define to 1 if the `S_IS*' macros in do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +/* #undef TIME_WITH_SYS_TIME */ + +/* Define to 1 to mask harmless uninitialized memory read/writes. */ +/* #undef UMRW */ + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +#include "clib_port.h" +#include "win_db.h" + +/* + * Microsoft's compiler _doesn't_ define __STDC__ unless you invoke it with + * arguments turning OFF all vendor extensions. Even more unfortunately, if + * we do that, it fails to parse windows.h!!!!! So, we define __STDC__ here, + * after windows.h comes in. Note: the compiler knows we've defined it, and + * starts enforcing strict ANSI compliance from this point on. + */ +#define __STDC__ 1 diff --git a/db/build_windows/db_cxx.h b/db/build_windows/db_cxx.h new file mode 100644 index 000000000..23d5dfc7f --- /dev/null +++ b/db/build_windows/db_cxx.h @@ -0,0 +1,1182 @@ +/* DO NOT EDIT: automatically built by dist/s_windows. */ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: db_cxx.in,v 12.28 2006/09/13 14:53:37 mjc Exp $ + */ + +#ifndef _DB_CXX_H_ +#define _DB_CXX_H_ +// +// C++ assumptions: +// +// To ensure portability to many platforms, both new and old, we make +// few assumptions about the C++ compiler and library. For example, +// we do not expect STL, templates or namespaces to be available. The +// "newest" C++ feature used is exceptions, which are used liberally +// to transmit error information. Even the use of exceptions can be +// disabled at runtime, to do so, use the DB_CXX_NO_EXCEPTIONS flags +// with the DbEnv or Db constructor. +// +// C++ naming conventions: +// +// - All top level class names start with Db. +// - All class members start with lower case letter. +// - All private data members are suffixed with underscore. +// - Use underscores to divide names into multiple words. +// - Simple data accessors are named with get_ or set_ prefix. +// - All method names are taken from names of functions in the C +// layer of db (usually by dropping a prefix like "db_"). +// These methods have the same argument types and order, +// other than dropping the explicit arg that acts as "this". +// +// As a rule, each DbFoo object has exactly one underlying DB_FOO struct +// (defined in db.h) associated with it. In some cases, we inherit directly +// from the DB_FOO structure to make this relationship explicit. Often, +// the underlying C layer allocates and deallocates these structures, so +// there is no easy way to add any data to the DbFoo class. When you see +// a comment about whether data is permitted to be added, this is what +// is going on. Of course, if we need to add data to such C++ classes +// in the future, we will arrange to have an indirect pointer to the +// DB_FOO struct (as some of the classes already have). +// + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Forward declarations +// + +#include + +#define HAVE_CXX_STDHEADERS 1 +#ifdef HAVE_CXX_STDHEADERS +#include +#include +#define __DB_STD(x) std::x +#else +#include +#include +#define __DB_STD(x) x +#endif + +#include "db.h" + +class Db; // forward +class Dbc; // forward +class DbEnv; // forward +class DbInfo; // forward +class DbLock; // forward +class DbLogc; // forward +class DbLsn; // forward +class DbMpoolFile; // forward +class DbPreplist; // forward +class DbSequence; // forward +class Dbt; // forward +class DbTxn; // forward + +class DbMultipleIterator; // forward +class DbMultipleKeyDataIterator; // forward +class DbMultipleRecnoDataIterator; // forward +class DbMultipleDataIterator; // forward + +class DbException; // forward +class DbDeadlockException; // forward +class DbLockNotGrantedException; // forward +class DbMemoryException; // forward +class DbRepHandleDeadException; // forward +class DbRunRecoveryException; // forward + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Turn off inappropriate compiler warnings +// + +#ifdef _MSC_VER + +// These are level 4 warnings that are explicitly disabled. +// With Visual C++, by default you do not see above level 3 unless +// you use /W4. But we like to compile with the highest level +// warnings to catch other errors. +// +// 4201: nameless struct/union +// triggered by standard include file +// +// 4514: unreferenced inline function has been removed +// certain include files in MSVC define methods that are not called +// +#pragma warning(push) +#pragma warning(disable: 4201 4514) + +#endif + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Mechanisms for declaring classes +// + +// +// Every class defined in this file has an _exported next to the class name. +// This is needed for WinTel machines so that the class methods can +// be exported or imported in a DLL as appropriate. Users of the DLL +// use the define DB_USE_DLL. When the DLL is built, DB_CREATE_DLL +// must be defined. +// +#if defined(_MSC_VER) + +# if defined(DB_CREATE_DLL) +# define _exported __declspec(dllexport) // creator of dll +# elif defined(DB_USE_DLL) +# define _exported __declspec(dllimport) // user of dll +# else +# define _exported // static lib creator or user +# endif + +#else /* _MSC_VER */ + +# define _exported + +#endif /* _MSC_VER */ + +// Some interfaces can be customized by allowing users to define +// callback functions. For performance and logistical reasons, some +// callback functions must be declared in extern "C" blocks. For others, +// we allow you to declare the callbacks in C++ or C (or an extern "C" +// block) as you wish. See the set methods for the callbacks for +// the choices. +// +extern "C" { + typedef void * (*db_malloc_fcn_type) + (size_t); + typedef void * (*db_realloc_fcn_type) + (void *, size_t); + typedef void (*db_free_fcn_type) + (void *); + typedef int (*bt_compare_fcn_type) /*C++ version available*/ + (DB *, const DBT *, const DBT *); + typedef size_t (*bt_prefix_fcn_type) /*C++ version available*/ + (DB *, const DBT *, const DBT *); + typedef int (*dup_compare_fcn_type) /*C++ version available*/ + (DB *, const DBT *, const DBT *); + typedef u_int32_t (*h_hash_fcn_type) /*C++ version available*/ + (DB *, const void *, u_int32_t); + typedef int (*pgin_fcn_type) + (DB_ENV *dbenv, db_pgno_t pgno, void *pgaddr, DBT *pgcookie); + typedef int (*pgout_fcn_type) + (DB_ENV *dbenv, db_pgno_t pgno, void *pgaddr, DBT *pgcookie); +} + +// +// Represents a database table = a set of keys with associated values. +// +class _exported Db +{ + friend class DbEnv; + +public: + Db(DbEnv*, u_int32_t); // Create a Db object. + virtual ~Db(); // Calls close() if the user hasn't. + + // These methods exactly match those in the C interface. + // + virtual int associate(DbTxn *txn, Db *secondary, + int (*callback)(Db *, const Dbt *, const Dbt *, Dbt *), + u_int32_t flags); + virtual int close(u_int32_t flags); + virtual int compact(DbTxn *txnid, Dbt *start, Dbt *stop, + DB_COMPACT *c_data, u_int32_t flags, Dbt *end); + virtual int cursor(DbTxn *txnid, Dbc **cursorp, u_int32_t flags); + virtual int del(DbTxn *txnid, Dbt *key, u_int32_t flags); + virtual void err(int, const char *, ...); + virtual void errx(const char *, ...); + virtual int fd(int *fdp); + virtual int get(DbTxn *txnid, Dbt *key, Dbt *data, u_int32_t flags); + virtual void *get_app_private() const; + virtual int get_byteswapped(int *); + virtual int get_dbname(const char **, const char **); + virtual int get_open_flags(u_int32_t *); + virtual int get_type(DBTYPE *); + virtual int get_transactional(); + virtual int join(Dbc **curslist, Dbc **dbcp, u_int32_t flags); + virtual int key_range(DbTxn *, Dbt *, DB_KEY_RANGE *, u_int32_t); + virtual int open(DbTxn *txnid, + const char *, const char *subname, DBTYPE, u_int32_t, int); + virtual int pget(DbTxn *txnid, Dbt *key, Dbt *pkey, Dbt *data, + u_int32_t flags); + virtual int put(DbTxn *, Dbt *, Dbt *, u_int32_t); + virtual int remove(const char *, const char *, u_int32_t); + virtual int rename(const char *, const char *, const char *, u_int32_t); + virtual int set_alloc(db_malloc_fcn_type, db_realloc_fcn_type, + db_free_fcn_type); + virtual void set_app_private(void *); + virtual int set_append_recno(int (*)(Db *, Dbt *, db_recno_t)); + virtual int set_bt_compare(bt_compare_fcn_type); /*deprecated*/ + virtual int set_bt_compare(int (*)(Db *, const Dbt *, const Dbt *)); + virtual int get_bt_minkey(u_int32_t *); + virtual int set_bt_minkey(u_int32_t); + virtual int set_bt_prefix(bt_prefix_fcn_type); /*deprecated*/ + virtual int set_bt_prefix(size_t (*)(Db *, const Dbt *, const Dbt *)); + virtual int get_cachesize(u_int32_t *, u_int32_t *, int *); + virtual int set_cachesize(u_int32_t, u_int32_t, int); + virtual int set_dup_compare(dup_compare_fcn_type); /*deprecated*/ + virtual int set_dup_compare(int (*)(Db *, const Dbt *, const Dbt *)); + virtual int get_encrypt_flags(u_int32_t *); + virtual int set_encrypt(const char *, u_int32_t); + virtual void set_errcall( + void (*)(const DbEnv *, const char *, const char *)); + virtual void get_errfile(FILE **); + virtual void set_errfile(FILE *); + virtual void get_errpfx(const char **); + virtual void set_errpfx(const char *); + virtual int set_feedback(void (*)(Db *, int, int)); + virtual int get_flags(u_int32_t *); + virtual int set_flags(u_int32_t); + virtual int get_h_ffactor(u_int32_t *); + virtual int set_h_ffactor(u_int32_t); + virtual int set_h_hash(h_hash_fcn_type); /*deprecated*/ + virtual int set_h_hash(u_int32_t (*)(Db *, const void *, u_int32_t)); + virtual int get_h_nelem(u_int32_t *); + virtual int set_h_nelem(u_int32_t); + virtual int get_lorder(int *); + virtual int set_lorder(int); + virtual void set_msgcall(void (*)(const DbEnv *, const char *)); + virtual void get_msgfile(FILE **); + virtual void set_msgfile(FILE *); + virtual int get_pagesize(u_int32_t *); + virtual int set_pagesize(u_int32_t); + virtual int set_paniccall(void (*)(DbEnv *, int)); + virtual int get_re_delim(int *); + virtual int set_re_delim(int); + virtual int get_re_len(u_int32_t *); + virtual int set_re_len(u_int32_t); + virtual int get_re_pad(int *); + virtual int set_re_pad(int); + virtual int get_re_source(const char **); + virtual int set_re_source(const char *); + virtual int get_q_extentsize(u_int32_t *); + virtual int set_q_extentsize(u_int32_t); + virtual int stat(DbTxn *, void *sp, u_int32_t flags); + virtual int stat_print(u_int32_t flags); + virtual int sync(u_int32_t flags); + virtual int truncate(DbTxn *, u_int32_t *, u_int32_t); + virtual int upgrade(const char *name, u_int32_t flags); + virtual int verify(const char *, const char *, __DB_STD(ostream) *, + u_int32_t); + + // These additional methods are not in the C interface, and + // are only available for C++. + // + virtual __DB_STD(ostream) *get_error_stream(); + virtual void set_error_stream(__DB_STD(ostream) *); + virtual __DB_STD(ostream) *get_message_stream(); + virtual void set_message_stream(__DB_STD(ostream) *); + + virtual DbEnv *get_env(); + virtual DbMpoolFile *get_mpf(); + + virtual DB *get_DB() + { + return imp_; + } + + virtual const DB *get_const_DB() const + { + return imp_; + } + + static Db* get_Db(DB *db) + { + return (Db *)db->api_internal; + } + + static const Db* get_const_Db(const DB *db) + { + return (const Db *)db->api_internal; + } + +private: + // no copying + Db(const Db &); + Db &operator = (const Db &); + + void cleanup(); + int initialize(); + int error_policy(); + + // instance data + DB *imp_; + DbEnv *env_; + DbMpoolFile *mpf_; + int construct_error_; + u_int32_t flags_; + u_int32_t construct_flags_; + +public: + // These are public only because they need to be called + // via C callback functions. They should never be used by + // external users of this class. + // + int (*append_recno_callback_)(Db *, Dbt *, db_recno_t); + int (*associate_callback_)(Db *, const Dbt *, const Dbt *, Dbt *); + int (*bt_compare_callback_)(Db *, const Dbt *, const Dbt *); + size_t (*bt_prefix_callback_)(Db *, const Dbt *, const Dbt *); + int (*dup_compare_callback_)(Db *, const Dbt *, const Dbt *); + void (*feedback_callback_)(Db *, int, int); + u_int32_t (*h_hash_callback_)(Db *, const void *, u_int32_t); +}; + +// +// Cursor +// +class _exported Dbc : protected DBC +{ + friend class Db; + +public: + int close(); + int count(db_recno_t *countp, u_int32_t flags); + int del(u_int32_t flags); + int dup(Dbc** cursorp, u_int32_t flags); + int get(Dbt* key, Dbt *data, u_int32_t flags); + int pget(Dbt* key, Dbt* pkey, Dbt *data, u_int32_t flags); + int put(Dbt* key, Dbt *data, u_int32_t flags); + +private: + // No data is permitted in this class (see comment at top) + + // Note: use Db::cursor() to get pointers to a Dbc, + // and call Dbc::close() rather than delete to release them. + // + Dbc(); + ~Dbc(); + + // no copying + Dbc(const Dbc &); + Dbc &operator = (const Dbc &); +}; + +// +// Berkeley DB environment class. Provides functions for opening databases. +// User of this library can use this class as a starting point for +// developing a DB application - derive their application class from +// this one, add application control logic. +// +// Note that if you use the default constructor, you must explicitly +// call appinit() before any other db activity (e.g. opening files) +// +class _exported DbEnv +{ + friend class Db; + friend class DbLock; + friend class DbMpoolFile; + +public: + // After using this constructor, you can set any needed + // parameters for the environment using the set_* methods. + // Then call open() to finish initializing the environment + // and attaching it to underlying files. + // + DbEnv(u_int32_t flags); + + virtual ~DbEnv(); + + // These methods match those in the C interface. + // + virtual int cdsgroup_begin(DbTxn **tid); + virtual int close(u_int32_t); + virtual int dbremove(DbTxn *txn, const char *name, const char *subdb, + u_int32_t flags); + virtual int dbrename(DbTxn *txn, const char *name, const char *subdb, + const char *newname, u_int32_t flags); + virtual void err(int, const char *, ...); + virtual void errx(const char *, ...); + virtual int failchk(u_int32_t); + virtual int fileid_reset(const char *, u_int32_t); + virtual void *get_app_private() const; + virtual int get_home(const char **); + virtual int get_open_flags(u_int32_t *); + virtual int open(const char *, u_int32_t, int); + virtual int remove(const char *, u_int32_t); + virtual int stat_print(u_int32_t flags); + + virtual int set_alloc(db_malloc_fcn_type, db_realloc_fcn_type, + db_free_fcn_type); + virtual void set_app_private(void *); + virtual int get_cachesize(u_int32_t *, u_int32_t *, int *); + virtual int set_cachesize(u_int32_t, u_int32_t, int); + virtual int get_data_dirs(const char ***); + virtual int set_data_dir(const char *); + virtual int get_encrypt_flags(u_int32_t *); + virtual int set_intermediate_dir(int, u_int32_t); + virtual int set_isalive( + int (*)(DbEnv *, pid_t, db_threadid_t, u_int32_t)); + virtual int set_encrypt(const char *, u_int32_t); + virtual void set_errcall( + void (*)(const DbEnv *, const char *, const char *)); + virtual void get_errfile(FILE **); + virtual void set_errfile(FILE *); + virtual void get_errpfx(const char **); + virtual void set_errpfx(const char *); + virtual int set_event_notify(void (*)(DbEnv *, u_int32_t, void *)); + virtual int get_flags(u_int32_t *); + virtual int set_flags(u_int32_t, int); + virtual bool is_bigendian(); + virtual int lsn_reset(const char *, u_int32_t); + virtual int set_feedback(void (*)(DbEnv *, int, int)); + virtual int get_lg_bsize(u_int32_t *); + virtual int set_lg_bsize(u_int32_t); + virtual int get_lg_dir(const char **); + virtual int set_lg_dir(const char *); + virtual int get_lg_filemode(int *); + virtual int set_lg_filemode(int); + virtual int get_lg_max(u_int32_t *); + virtual int set_lg_max(u_int32_t); + virtual int get_lg_regionmax(u_int32_t *); + virtual int set_lg_regionmax(u_int32_t); + virtual int get_lk_conflicts(const u_int8_t **, int *); + virtual int set_lk_conflicts(u_int8_t *, int); + virtual int get_lk_detect(u_int32_t *); + virtual int set_lk_detect(u_int32_t); + virtual int get_lk_max_lockers(u_int32_t *); + virtual int set_lk_max_lockers(u_int32_t); + virtual int get_lk_max_locks(u_int32_t *); + virtual int set_lk_max_locks(u_int32_t); + virtual int get_lk_max_objects(u_int32_t *); + virtual int set_lk_max_objects(u_int32_t); + virtual int get_mp_mmapsize(size_t *); + virtual int set_mp_mmapsize(size_t); + virtual int get_mp_max_openfd(int *); + virtual int set_mp_max_openfd(int); + virtual int get_mp_max_write(int *, int *); + virtual int set_mp_max_write(int, int); + virtual void set_msgcall(void (*)(const DbEnv *, const char *)); + virtual void get_msgfile(FILE **); + virtual void set_msgfile(FILE *); + virtual int set_paniccall(void (*)(DbEnv *, int)); + virtual int set_rpc_server(void *, char *, long, long, u_int32_t); + virtual int get_shm_key(long *); + virtual int set_shm_key(long); + virtual int get_timeout(db_timeout_t *, u_int32_t); + virtual int set_timeout(db_timeout_t, u_int32_t); + virtual int get_tmp_dir(const char **); + virtual int set_tmp_dir(const char *); + virtual int get_tx_max(u_int32_t *); + virtual int set_tx_max(u_int32_t); + virtual int set_app_dispatch(int (*)(DbEnv *, + Dbt *, DbLsn *, db_recops)); + virtual int get_tx_timestamp(time_t *); + virtual int set_tx_timestamp(time_t *); + virtual int get_verbose(u_int32_t which, int *); + virtual int set_verbose(u_int32_t which, int); + + // Version information. A static method so it can be obtained anytime. + // + static char *version(int *major, int *minor, int *patch); + + // Convert DB errors to strings + static char *strerror(int); + + // If an error is detected and the error call function + // or stream is set, a message is dispatched or printed. + // If a prefix is set, each message is prefixed. + // + // You can use set_errcall() or set_errfile() above to control + // error functionality. Alternatively, you can call + // set_error_stream() to force all errors to a C++ stream. + // It is unwise to mix these approaches. + // + virtual __DB_STD(ostream) *get_error_stream(); + virtual void set_error_stream(__DB_STD(ostream) *); + virtual __DB_STD(ostream) *get_message_stream(); + virtual void set_message_stream(__DB_STD(ostream) *); + + // used internally + static void runtime_error(DbEnv *env, const char *caller, int err, + int error_policy); + static void runtime_error_dbt(DbEnv *env, const char *caller, Dbt *dbt, + int error_policy); + static void runtime_error_lock_get(DbEnv *env, const char *caller, + int err, db_lockop_t op, db_lockmode_t mode, + const Dbt *obj, DbLock lock, int index, + int error_policy); + + // Lock functions + // + virtual int lock_detect(u_int32_t flags, u_int32_t atype, int *aborted); + virtual int lock_get(u_int32_t locker, u_int32_t flags, const Dbt *obj, + db_lockmode_t lock_mode, DbLock *lock); + virtual int lock_id(u_int32_t *idp); + virtual int lock_id_free(u_int32_t id); + virtual int lock_put(DbLock *lock); + virtual int lock_stat(DB_LOCK_STAT **statp, u_int32_t flags); + virtual int lock_stat_print(u_int32_t flags); + virtual int lock_vec(u_int32_t locker, u_int32_t flags, + DB_LOCKREQ list[], int nlist, DB_LOCKREQ **elistp); + + // Log functions + // + virtual int log_archive(char **list[], u_int32_t flags); + static int log_compare(const DbLsn *lsn0, const DbLsn *lsn1); + virtual int log_cursor(DbLogc **cursorp, u_int32_t flags); + virtual int log_file(DbLsn *lsn, char *namep, size_t len); + virtual int log_flush(const DbLsn *lsn); + virtual int log_put(DbLsn *lsn, const Dbt *data, u_int32_t flags); + virtual int log_printf(DbTxn *, const char *, ...); + + virtual int log_stat(DB_LOG_STAT **spp, u_int32_t flags); + virtual int log_stat_print(u_int32_t flags); + + // Mpool functions + // + virtual int memp_fcreate(DbMpoolFile **dbmfp, u_int32_t flags); + virtual int memp_register(int ftype, + pgin_fcn_type pgin_fcn, + pgout_fcn_type pgout_fcn); + virtual int memp_stat(DB_MPOOL_STAT + **gsp, DB_MPOOL_FSTAT ***fsp, u_int32_t flags); + virtual int memp_stat_print(u_int32_t flags); + virtual int memp_sync(DbLsn *lsn); + virtual int memp_trickle(int pct, int *nwrotep); + + // Mpool functions + // + virtual int mutex_alloc(u_int32_t, db_mutex_t *); + virtual int mutex_free(db_mutex_t); + virtual int mutex_get_align(u_int32_t *); + virtual int mutex_get_increment(u_int32_t *); + virtual int mutex_get_max(u_int32_t *); + virtual int mutex_get_tas_spins(u_int32_t *); + virtual int mutex_lock(db_mutex_t); + virtual int mutex_set_align(u_int32_t); + virtual int mutex_set_increment(u_int32_t); + virtual int mutex_set_max(u_int32_t); + virtual int mutex_set_tas_spins(u_int32_t); + virtual int mutex_stat(DB_MUTEX_STAT **, u_int32_t); + virtual int mutex_stat_print(u_int32_t); + virtual int mutex_unlock(db_mutex_t); + + // Transaction functions + // + virtual int txn_begin(DbTxn *pid, DbTxn **tid, u_int32_t flags); + virtual int txn_checkpoint(u_int32_t kbyte, u_int32_t min, + u_int32_t flags); + virtual int txn_recover(DbPreplist *preplist, long count, + long *retp, u_int32_t flags); + virtual int txn_stat(DB_TXN_STAT **statp, u_int32_t flags); + virtual int txn_stat_print(u_int32_t flags); + + // Replication functions + // + virtual int rep_elect(int, int, int *, u_int32_t); + virtual int rep_flush(); + virtual int rep_process_message(Dbt *, Dbt *, int *, DbLsn *); + virtual int rep_start(Dbt *, u_int32_t); + virtual int rep_stat(DB_REP_STAT **statp, u_int32_t flags); + virtual int rep_stat_print(u_int32_t flags); + virtual int rep_get_limit(u_int32_t *, u_int32_t *); + virtual int rep_set_limit(u_int32_t, u_int32_t); + virtual int rep_set_transport(int, int (*)(DbEnv *, + const Dbt *, const Dbt *, const DbLsn *, int, u_int32_t)); + virtual int set_rep_request(u_int32_t, u_int32_t); + virtual int set_thread_count(u_int32_t); + virtual int set_thread_id(void (*)(DbEnv *, pid_t *, db_threadid_t *)); + virtual int set_thread_id_string(char *(*)(DbEnv *, + pid_t, db_threadid_t, char *)); + virtual int rep_set_config(u_int32_t which, int onoff); + virtual int rep_get_config(u_int32_t which, int *onoffp); + virtual int rep_sync(u_int32_t flags); + + // Advanced replication functions + // + virtual int rep_get_nsites(int *n); + virtual int rep_set_nsites(int n); + virtual int rep_get_priority(int *priority); + virtual int rep_set_priority(int priority); + virtual int rep_get_timeout(int which, db_timeout_t *timeout); + virtual int rep_set_timeout(int which, db_timeout_t timeout); + virtual int repmgr_add_remote_site(const char * host, u_int16_t port, + int *eidp, u_int32_t flags); + virtual int repmgr_get_ack_policy(int *policy); + virtual int repmgr_set_ack_policy(int policy); + virtual int repmgr_set_local_site(const char * host, u_int16_t port, + u_int32_t flags); + virtual int repmgr_site_list(u_int *countp, DB_REPMGR_SITE **listp); + virtual int repmgr_start(int nthreads, u_int32_t flags); + + // Conversion functions + // + virtual DB_ENV *get_DB_ENV() + { + return imp_; + } + + virtual const DB_ENV *get_const_DB_ENV() const + { + return imp_; + } + + static DbEnv* get_DbEnv(DB_ENV *dbenv) + { + return dbenv ? (DbEnv *)dbenv->api1_internal : 0; + } + + static const DbEnv* get_const_DbEnv(const DB_ENV *dbenv) + { + return dbenv ? (const DbEnv *)dbenv->api1_internal : 0; + } + + // For internal use only. + static DbEnv* wrap_DB_ENV(DB_ENV *dbenv); + + // These are public only because they need to be called + // via C functions. They should never be called by users + // of this class. + // + static int _app_dispatch_intercept(DB_ENV *env, DBT *dbt, DB_LSN *lsn, + db_recops op); + static void _paniccall_intercept(DB_ENV *env, int errval); + static void _feedback_intercept(DB_ENV *env, int opcode, int pct); + static void _event_func_intercept(DB_ENV *env, u_int32_t, void *); + static int _isalive_intercept(DB_ENV *env, pid_t pid, + db_threadid_t thrid, u_int32_t flags); + static int _rep_send_intercept(DB_ENV *env, const DBT *cntrl, + const DBT *data, const DB_LSN *lsn, int id, u_int32_t flags); + static void _stream_error_function(const DB_ENV *env, + const char *prefix, const char *message); + static void _stream_message_function(const DB_ENV *env, + const char *message); + static void _thread_id_intercept(DB_ENV *env, pid_t *pidp, + db_threadid_t *thridp); + static char *_thread_id_string_intercept(DB_ENV *env, pid_t pid, + db_threadid_t thrid, char *buf); + +private: + void cleanup(); + int initialize(DB_ENV *env); + int error_policy(); + + // For internal use only. + DbEnv(DB_ENV *, u_int32_t flags); + + // no copying + DbEnv(const DbEnv &); + void operator = (const DbEnv &); + + // instance data + DB_ENV *imp_; + int construct_error_; + u_int32_t construct_flags_; + __DB_STD(ostream) *error_stream_; + __DB_STD(ostream) *message_stream_; + + int (*app_dispatch_callback_)(DbEnv *, Dbt *, DbLsn *, db_recops); + int (*isalive_callback_)(DbEnv *, pid_t, db_threadid_t, u_int32_t); + void (*error_callback_)(const DbEnv *, const char *, const char *); + void (*feedback_callback_)(DbEnv *, int, int); + void (*message_callback_)(const DbEnv *, const char *); + void (*paniccall_callback_)(DbEnv *, int); + void (*event_func_callback_)(DbEnv *, u_int32_t, void *); + int (*rep_send_callback_)(DbEnv *, const Dbt *, const Dbt *, + const DbLsn *, int, u_int32_t); + void (*thread_id_callback_)(DbEnv *, pid_t *, db_threadid_t *); + char *(*thread_id_string_callback_)(DbEnv *, pid_t, db_threadid_t, + char *); +}; + +// +// Lock +// +class _exported DbLock +{ + friend class DbEnv; + +public: + DbLock(); + DbLock(const DbLock &); + DbLock &operator = (const DbLock &); + +protected: + // We can add data to this class if needed + // since its contained class is not allocated by db. + // (see comment at top) + + DbLock(DB_LOCK); + DB_LOCK lock_; +}; + +// +// Log cursor +// +class _exported DbLogc : protected DB_LOGC +{ + friend class DbEnv; + +public: + int close(u_int32_t _flags); + int get(DbLsn *lsn, Dbt *data, u_int32_t _flags); + +private: + // No data is permitted in this class (see comment at top) + + // Note: use Db::cursor() to get pointers to a Dbc, + // and call Dbc::close() rather than delete to release them. + // + DbLogc(); + ~DbLogc(); + + // no copying + DbLogc(const Dbc &); + DbLogc &operator = (const Dbc &); +}; + +// +// Log sequence number +// +class _exported DbLsn : public DB_LSN +{ + friend class DbEnv; // friendship needed to cast to base class + friend class DbLogc; // friendship needed to cast to base class +}; + +// +// Memory pool file +// +class _exported DbMpoolFile +{ + friend class DbEnv; + friend class Db; + +public: + int close(u_int32_t flags); + int get(db_pgno_t *pgnoaddr, DbTxn *txn, u_int32_t flags, void *pagep); + int open(const char *file, u_int32_t flags, int mode, size_t pagesize); + int get_transactional(void); + int put(void *pgaddr, u_int32_t flags); + int set(void *pgaddr, u_int32_t flags); + int get_clear_len(u_int32_t *len); + int set_clear_len(u_int32_t len); + int get_fileid(u_int8_t *fileid); + int set_fileid(u_int8_t *fileid); + int get_flags(u_int32_t *flagsp); + int set_flags(u_int32_t flags, int onoff); + int get_ftype(int *ftype); + int set_ftype(int ftype); + int get_lsn_offset(int32_t *offsetp); + int set_lsn_offset(int32_t offset); + int get_maxsize(u_int32_t *gbytes, u_int32_t *bytes); + int set_maxsize(u_int32_t gbytes, u_int32_t bytes); + int get_pgcookie(DBT *dbt); + int set_pgcookie(DBT *dbt); + int get_priority(DB_CACHE_PRIORITY *priorityp); + int set_priority(DB_CACHE_PRIORITY priority); + int sync(); + + virtual DB_MPOOLFILE *get_DB_MPOOLFILE() + { + return imp_; + } + + virtual const DB_MPOOLFILE *get_const_DB_MPOOLFILE() const + { + return imp_; + } + +private: + DB_MPOOLFILE *imp_; + + // We can add data to this class if needed + // since it is implemented via a pointer. + // (see comment at top) + + // Note: use DbEnv::memp_fcreate() to get pointers to a DbMpoolFile, + // and call DbMpoolFile::close() rather than delete to release them. + // + DbMpoolFile(); + + // Shut g++ up. +protected: + virtual ~DbMpoolFile(); + +private: + // no copying + DbMpoolFile(const DbMpoolFile &); + void operator = (const DbMpoolFile &); +}; + +// +// This is filled in and returned by the DbEnv::txn_recover() method. +// +class _exported DbPreplist +{ +public: + DbTxn *txn; + u_int8_t gid[DB_XIDDATASIZE]; +}; + +// +// A sequence record in a database +// +class _exported DbSequence +{ +public: + DbSequence(Db *db, u_int32_t flags); + virtual ~DbSequence(); + + int open(DbTxn *txnid, Dbt *key, u_int32_t flags); + int initial_value(db_seq_t value); + int close(u_int32_t flags); + int remove(DbTxn *txnid, u_int32_t flags); + int stat(DB_SEQUENCE_STAT **sp, u_int32_t flags); + int stat_print(u_int32_t flags); + + int get(DbTxn *txnid, int32_t delta, db_seq_t *retp, u_int32_t flags); + int get_cachesize(int32_t *sizep); + int set_cachesize(int32_t size); + int get_flags(u_int32_t *flagsp); + int set_flags(u_int32_t flags); + int get_range(db_seq_t *minp, db_seq_t *maxp); + int set_range(db_seq_t min, db_seq_t max); + + Db *get_db(); + Dbt *get_key(); + + virtual DB_SEQUENCE *get_DB_SEQUENCE() + { + return imp_; + } + + virtual const DB_SEQUENCE *get_const_DB_SEQUENCE() const + { + return imp_; + } + + static DbSequence* get_DbSequence(DB_SEQUENCE *seq) + { + return (DbSequence *)seq->api_internal; + } + + static const DbSequence* get_const_DbSequence(const DB_SEQUENCE *seq) + { + return (const DbSequence *)seq->api_internal; + } + + // For internal use only. + static DbSequence* wrap_DB_SEQUENCE(DB_SEQUENCE *seq); + +private: + DbSequence(DB_SEQUENCE *seq); + // no copying + DbSequence(const DbSequence &); + DbSequence &operator = (const DbSequence &); + + DB_SEQUENCE *imp_; + DBT key_; +}; + +// +// Transaction +// +class _exported DbTxn +{ + friend class DbEnv; + +public: + int abort(); + int commit(u_int32_t flags); + int discard(u_int32_t flags); + u_int32_t id(); + int get_name(const char **namep); + int prepare(u_int8_t *gid); + int set_name(const char *name); + int set_timeout(db_timeout_t timeout, u_int32_t flags); + + virtual DB_TXN *get_DB_TXN() + { + return imp_; + } + + virtual const DB_TXN *get_const_DB_TXN() const + { + return imp_; + } + + static DbTxn* get_DbTxn(DB_TXN *txn) + { + return (DbTxn *)txn->api_internal; + } + + static const DbTxn* get_const_DbTxn(const DB_TXN *txn) + { + return (const DbTxn *)txn->api_internal; + } + + // For internal use only. + static DbTxn* wrap_DB_TXN(DB_TXN *txn); + +private: + DB_TXN *imp_; + + // We can add data to this class if needed + // since it is implemented via a pointer. + // (see comment at top) + + // Note: use DbEnv::txn_begin() to get pointers to a DbTxn, + // and call DbTxn::abort() or DbTxn::commit rather than + // delete to release them. + // + DbTxn(); + // For internal use only. + DbTxn(DB_TXN *txn); + virtual ~DbTxn(); + + // no copying + DbTxn(const DbTxn &); + void operator = (const DbTxn &); +}; + +// +// A chunk of data, maybe a key or value. +// +class _exported Dbt : private DBT +{ + friend class Db; + friend class Dbc; + friend class DbEnv; + friend class DbLogc; + friend class DbSequence; + +public: + // key/data + void *get_data() const { return data; } + void set_data(void *value) { data = value; } + + // key/data length + u_int32_t get_size() const { return size; } + void set_size(u_int32_t value) { size = value; } + + // RO: length of user buffer. + u_int32_t get_ulen() const { return ulen; } + void set_ulen(u_int32_t value) { ulen = value; } + + // RO: get/put record length. + u_int32_t get_dlen() const { return dlen; } + void set_dlen(u_int32_t value) { dlen = value; } + + // RO: get/put record offset. + u_int32_t get_doff() const { return doff; } + void set_doff(u_int32_t value) { doff = value; } + + // flags + u_int32_t get_flags() const { return flags; } + void set_flags(u_int32_t value) { flags = value; } + + // Conversion functions + DBT *get_DBT() { return (DBT *)this; } + const DBT *get_const_DBT() const { return (const DBT *)this; } + + static Dbt* get_Dbt(DBT *dbt) { return (Dbt *)dbt; } + static const Dbt* get_const_Dbt(const DBT *dbt) + { return (const Dbt *)dbt; } + + Dbt(void *data, u_int32_t size); + Dbt(); + ~Dbt(); + Dbt(const Dbt &); + Dbt &operator = (const Dbt &); + +private: + // Note: no extra data appears in this class (other than + // inherited from DBT) since we need DBT and Dbt objects + // to have interchangable pointers. + // + // When subclassing this class, remember that callback + // methods like bt_compare, bt_prefix, dup_compare may + // internally manufacture DBT objects (which later are + // cast to Dbt), so such callbacks might receive objects + // not of your subclassed type. +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// multiple key/data/reco iterator classes +// + +// DbMultipleIterator is a shared private base class for the three types +// of bulk-return Iterator; it should never be instantiated directly, +// but it handles the functionality shared by its subclasses. +class _exported DbMultipleIterator +{ +public: + DbMultipleIterator(const Dbt &dbt); +protected: + u_int8_t *data_; + u_int32_t *p_; +}; + +class _exported DbMultipleKeyDataIterator : private DbMultipleIterator +{ +public: + DbMultipleKeyDataIterator(const Dbt &dbt) : DbMultipleIterator(dbt) {} + bool next(Dbt &key, Dbt &data); +}; + +class _exported DbMultipleRecnoDataIterator : private DbMultipleIterator +{ +public: + DbMultipleRecnoDataIterator(const Dbt &dbt) : DbMultipleIterator(dbt) {} + bool next(db_recno_t &recno, Dbt &data); +}; + +class _exported DbMultipleDataIterator : private DbMultipleIterator +{ +public: + DbMultipleDataIterator(const Dbt &dbt) : DbMultipleIterator(dbt) {} + bool next(Dbt &data); +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Exception classes +// + +// Almost any error in the DB library throws a DbException. +// Every exception should be considered an abnormality +// (e.g. bug, misuse of DB, file system error). +// +class _exported DbException : public __DB_STD(exception) +{ +public: + virtual ~DbException() throw(); + DbException(int err); + DbException(const char *description); + DbException(const char *description, int err); + DbException(const char *prefix, const char *description, int err); + int get_errno() const; + virtual const char *what() const throw(); + DbEnv *get_env() const; + void set_env(DbEnv *env); + + DbException(const DbException &); + DbException &operator = (const DbException &); + +private: + void describe(const char *prefix, const char *description); + + char *what_; + int err_; // errno + DbEnv *env_; +}; + +// +// A specific sort of exception that occurs when +// an operation is aborted to resolve a deadlock. +// +class _exported DbDeadlockException : public DbException +{ +public: + virtual ~DbDeadlockException() throw(); + DbDeadlockException(const char *description); + + DbDeadlockException(const DbDeadlockException &); + DbDeadlockException &operator = (const DbDeadlockException &); +}; + +// +// A specific sort of exception that occurs when +// a lock is not granted, e.g. by lock_get or lock_vec. +// Note that the Dbt is only live as long as the Dbt used +// in the offending call. +// +class _exported DbLockNotGrantedException : public DbException +{ +public: + virtual ~DbLockNotGrantedException() throw(); + DbLockNotGrantedException(const char *prefix, db_lockop_t op, + db_lockmode_t mode, const Dbt *obj, const DbLock lock, int index); + DbLockNotGrantedException(const char *description); + + DbLockNotGrantedException(const DbLockNotGrantedException &); + DbLockNotGrantedException &operator = + (const DbLockNotGrantedException &); + + db_lockop_t get_op() const; + db_lockmode_t get_mode() const; + const Dbt* get_obj() const; + DbLock *get_lock() const; + int get_index() const; + +private: + db_lockop_t op_; + db_lockmode_t mode_; + const Dbt *obj_; + DbLock *lock_; + int index_; +}; + +// +// A specific sort of exception that occurs when +// user declared memory is insufficient in a Dbt. +// +class _exported DbMemoryException : public DbException +{ +public: + virtual ~DbMemoryException() throw(); + DbMemoryException(Dbt *dbt); + DbMemoryException(const char *prefix, Dbt *dbt); + + DbMemoryException(const DbMemoryException &); + DbMemoryException &operator = (const DbMemoryException &); + + Dbt *get_dbt() const; +private: + Dbt *dbt_; +}; + +// +// A specific sort of exception that occurs when a change of replication +// master requires that all handles be re-opened. +// +class _exported DbRepHandleDeadException : public DbException +{ +public: + virtual ~DbRepHandleDeadException() throw(); + DbRepHandleDeadException(const char *description); + + DbRepHandleDeadException(const DbRepHandleDeadException &); + DbRepHandleDeadException &operator = (const DbRepHandleDeadException &); +}; + +// +// A specific sort of exception that occurs when +// recovery is required before continuing DB activity. +// +class _exported DbRunRecoveryException : public DbException +{ +public: + virtual ~DbRunRecoveryException() throw(); + DbRunRecoveryException(const char *description); + + DbRunRecoveryException(const DbRunRecoveryException &); + DbRunRecoveryException &operator = (const DbRunRecoveryException &); +}; + +// +// A specific sort of exception that occurs when + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Restore default compiler warnings +// +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif /* !_DB_CXX_H_ */ diff --git a/db/build_windows/db_deadlock.dsp b/db/build_windows/db_deadlock.dsp new file mode 100644 index 000000000..c6b4f5c3d --- /dev/null +++ b/db/build_windows/db_deadlock.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_deadlock" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_deadlock - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_deadlock.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_deadlock.mak" CFG="db_deadlock - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_deadlock - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_deadlock - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_deadlock - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_deadlock - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_deadlock - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_deadlock - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_deadlock - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_deadlock - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_deadlock - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_deadlock" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_deadlock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_deadlock - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_deadlock" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_deadlock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_deadlock - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_deadlock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_deadlock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_deadlock - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_deadlock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_deadlock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_deadlock - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_deadlock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_deadlock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_deadlock - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_deadlock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_deadlock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_deadlock - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_deadlock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_deadlock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_deadlock - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_deadlock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_deadlock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_deadlock - Win32 Release" +# Name "db_deadlock - Win32 Debug" +# Name "db_deadlock - Win32 ASCII Debug" +# Name "db_deadlock - Win32 ASCII Release" +# Name "db_deadlock - x64 Debug AMD64" +# Name "db_deadlock - x64 Release AMD64" +# Name "db_deadlock - x64 Debug IA64" +# Name "db_deadlock - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_deadlock\db_deadlock.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_dll.dsp b/db/build_windows/db_dll.dsp new file mode 100644 index 000000000..9c15ce57a --- /dev/null +++ b/db/build_windows/db_dll.dsp @@ -0,0 +1,1204 @@ +# Microsoft Developer Studio Project File - Name="db_dll" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=db_dll - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_dll.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_dll.mak" CFG="db_dll - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_dll - Win32 ASCII Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_dll - Win32 ASCII Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_dll - x64 Debug AMD64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_dll - x64 Release AMD64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_dll - x64 Debug IA64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_dll - x64 Release IA64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_dll - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_dll" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb45.dll" /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_dll - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_dll" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /pdb:none /debug /machine:I386 /out:"Debug/libdb45d.dll" /fixed:no /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_dll - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_dll" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug_ASCII/libdb45d.dll" /fixed:no +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /pdb:none /debug /machine:I386 /out:"Debug_ASCII/libdb45d.dll" /fixed:no /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_dll - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_dll" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release_ASCII/libdb45.dll" +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release_ASCII/libdb45.dll" /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_dll - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_dll" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /Wp64 /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /debug /machine:AMD64 /out:"Debug_AMD64/libdb45d.dll" /fixed:no +# ADD LINK32 ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /debug /machine:AMD64 /out:"Debug_AMD64/libdb45d.dll" /fixed:no /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_dll - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_dll" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:AMD64 /out:"Release_AMD64/libdb45.dll" +# ADD LINK32 ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:AMD64 /out:"Release_AMD64/libdb45.dll" /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_dll - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_dll" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Wp64 /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Wp64 /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /debug /machine:IA64 /out:"Debug_IA64/libdb45d.dll" /fixed:no +# ADD LINK32 ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /debug /machine:IA64 /out:"Debug_IA64/libdb45d.dll" /fixed:no /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_dll - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_dll" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:IA64 /out:"Release_IA64/libdb45.dll" +# ADD LINK32 ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:IA64 /out:"Release_IA64/libdb45.dll" /libpath:"$(OUTDIR)" + +!ENDIF + +# Begin Target + +# Name "db_dll - Win32 Release" +# Name "db_dll - Win32 Debug" +# Name "db_dll - Win32 ASCII Debug" +# Name "db_dll - Win32 ASCII Release" +# Name "db_dll - x64 Debug AMD64" +# Name "db_dll - x64 Release AMD64" +# Name "db_dll - x64 Debug IA64" +# Name "db_dll - x64 Release IA64" +# Begin Source File + +SOURCE=..\btree\bt_compact.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_compare.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_conv.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_curadj.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_cursor.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_delete.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_method.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_open.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_put.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_rec.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_reclaim.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_recno.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_rsearch.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_search.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_split.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_stat.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_upgrade.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_verify.c +# End Source File +# Begin Source File + +SOURCE=..\btree\btree_auto.c +# End Source File +# Begin Source File + +SOURCE=.\libdb.def +# End Source File +# Begin Source File + +SOURCE=.\libdb.rc +# End Source File +# Begin Source File + +SOURCE=..\clib\ctime.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getaddrinfo.c +# End Source File +# Begin Source File + +SOURCE=..\clib\strcasecmp.c +# End Source File +# Begin Source File + +SOURCE=..\clib\strsep.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_byteorder.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_clock.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_err.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_getlong.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_idspace.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_log2.c +# End Source File +# Begin Source File + +SOURCE=..\common\mkpath.c +# End Source File +# Begin Source File + +SOURCE=..\common\util_cache.c +# End Source File +# Begin Source File + +SOURCE=..\common\util_log.c +# End Source File +# Begin Source File + +SOURCE=..\common\util_sig.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\aes_method.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\crypto.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\mersenne\mt19937db.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\rijndael\rijndael-alg-fst.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\rijndael\rijndael-api-fst.c +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_db.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_dbc.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_dbt.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_env.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_except.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_lock.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_logc.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_mpool.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_multi.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_seq.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_txn.cpp +# End Source File +# Begin Source File + +SOURCE=..\db\crdel_auto.c +# End Source File +# Begin Source File + +SOURCE=..\db\crdel_rec.c +# End Source File +# Begin Source File + +SOURCE=..\db\db.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_am.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_auto.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_cam.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_cds.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_conv.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_dispatch.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_dup.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_iface.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_join.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_meta.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_method.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_open.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_overflow.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_ovfl_vrfy.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_pr.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_rec.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_reclaim.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_remove.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_rename.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_ret.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_setid.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_setlsn.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_stati.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_truncate.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_upg.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_upg_opd.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_vrfy.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_vrfyutil.c +# End Source File +# Begin Source File + +SOURCE=..\dbm\dbm.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_auto.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_rec.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_stat.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_util.c +# End Source File +# Begin Source File + +SOURCE=..\env\db_salloc.c +# End Source File +# Begin Source File + +SOURCE=..\env\db_shash.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_config.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_file.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_method.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_open.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_recover.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_region.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_register.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_stat.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fileops_auto.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fop_basic.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fop_rec.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fop_util.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_auto.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_conv.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_dup.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_func.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_meta.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_method.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_open.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_page.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_rec.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_reclaim.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_stat.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_upgrade.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_verify.c +# End Source File +# Begin Source File + +SOURCE=..\hmac\hmac.c +# End Source File +# Begin Source File + +SOURCE=..\hmac\sha1.c +# End Source File +# Begin Source File + +SOURCE=..\hsearch\hsearch.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_deadlock.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_id.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_list.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_method.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_region.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_stat.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_timer.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_util.c +# End Source File +# Begin Source File + +SOURCE=..\log\log.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_archive.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_compare.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_debug.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_get.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_method.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_put.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_stat.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_alloc.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_bh.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fget.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fmethod.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fopen.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fput.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fset.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_method.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_mvcc.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_region.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_register.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_stat.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_sync.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_trickle.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_alloc.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_method.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_region.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_stat.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_win32.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_alloc.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_fzero.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_mkdir.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_oflags.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_pid.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_region.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_root.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_rpath.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_tmpdir.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_uid.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_abs.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_clock.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_config.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_dir.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_errno.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_fid.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_flock.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_fsync.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_getenv.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_handle.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_map.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_open.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_rename.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_rw.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_seek.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_sleep.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_spin.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_stat.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_truncate.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_unlink.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_yield.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_auto.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_conv.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_files.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_method.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_open.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_rec.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_stat.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_upgrade.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_verify.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_auto.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_backup.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_elect.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_log.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_method.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_record.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_region.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_stat.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_util.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_verify.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_elect.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_method.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_msg.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_net.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_queue.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_sel.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_stat.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_util.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_windows.c +# End Source File +# Begin Source File + +SOURCE=..\sequence\seq_stat.c +# End Source File +# Begin Source File + +SOURCE=..\sequence\sequence.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_auto.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_chkpt.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_method.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_rec.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_recover.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_region.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_stat.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_util.c +# End Source File +# Begin Source File + +SOURCE=..\xa\xa.c +# End Source File +# Begin Source File + +SOURCE=..\xa\xa_db.c +# End Source File +# Begin Source File + +SOURCE=..\xa\xa_map.c +# End Source File + +# End Target +# End Project diff --git a/db/build_windows/db_dump.dsp b/db/build_windows/db_dump.dsp new file mode 100644 index 000000000..10a681499 --- /dev/null +++ b/db/build_windows/db_dump.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_dump" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_dump - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_dump.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_dump.mak" CFG="db_dump - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_dump - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_dump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_dump - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_dump - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_dump - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_dump - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_dump - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_dump - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_dump - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_dump" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_dump" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_dump - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_dump" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_dump" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_dump - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_dump" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_dump" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_dump - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_dump" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_dump" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_dump - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_dump" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_dump" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_dump - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_dump" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_dump" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_dump - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_dump" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_dump" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_dump - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_dump" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_dump" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_dump - Win32 Release" +# Name "db_dump - Win32 Debug" +# Name "db_dump - Win32 ASCII Debug" +# Name "db_dump - Win32 ASCII Release" +# Name "db_dump - x64 Debug AMD64" +# Name "db_dump - x64 Release AMD64" +# Name "db_dump - x64 Debug IA64" +# Name "db_dump - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_dump\db_dump.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_hotbackup.dsp b/db/build_windows/db_hotbackup.dsp new file mode 100644 index 000000000..aa6a270bb --- /dev/null +++ b/db/build_windows/db_hotbackup.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_hotbackup" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_hotbackup - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_hotbackup.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_hotbackup.mak" CFG="db_hotbackup - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_hotbackup - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_hotbackup - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_hotbackup - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_hotbackup - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_hotbackup - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_hotbackup - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_hotbackup - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_hotbackup - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_hotbackup - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_hotbackup" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_hotbackup" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_hotbackup - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_hotbackup" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_hotbackup" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_hotbackup - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_hotbackup" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_hotbackup" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_hotbackup - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_hotbackup" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_hotbackup" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_hotbackup - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_hotbackup" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_hotbackup" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_hotbackup - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_hotbackup" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_hotbackup" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_hotbackup - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_hotbackup" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_hotbackup" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_hotbackup - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_hotbackup" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_hotbackup" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_hotbackup - Win32 Release" +# Name "db_hotbackup - Win32 Debug" +# Name "db_hotbackup - Win32 ASCII Debug" +# Name "db_hotbackup - Win32 ASCII Release" +# Name "db_hotbackup - x64 Debug AMD64" +# Name "db_hotbackup - x64 Release AMD64" +# Name "db_hotbackup - x64 Debug IA64" +# Name "db_hotbackup - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_hotbackup\db_hotbackup.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_int.h b/db/build_windows/db_int.h new file mode 100644 index 000000000..02aa4e86e --- /dev/null +++ b/db/build_windows/db_int.h @@ -0,0 +1,771 @@ +/* DO NOT EDIT: automatically built by dist/s_windows. */ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: db_int.in,v 12.41 2006/09/19 15:06:59 bostic Exp $ + */ + +#ifndef _DB_INT_H_ +#define _DB_INT_H_ + +/******************************************************* + * Berkeley DB includes. + *******************************************************/ +#ifndef NO_SYSTEM_INCLUDES +#include +#ifdef DIAG_MVCC +#include +#endif +#include + +#if defined(__INCLUDE_SELECT_H) +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_VXWORKS +#include +#endif +#endif + +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + +#ifdef HAVE_VXWORKS +#include +#else +#include +#endif + +#if defined(__INCLUDE_NETWORKING) +#include +#include +#include +#include +#endif + +#if defined(STDC_HEADERS) || defined(__cplusplus) +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include "db.h" + +#include "dbinc/queue.h" +#include "dbinc/shqueue.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +/******************************************************* + * General purpose constants and macros. + *******************************************************/ +#ifndef UINT16_MAX +#define UINT16_MAX 65535 /* Maximum 16-bit unsigned. */ +#endif +#ifndef UINT32_MAX +#ifdef __STDC__ +#define UINT32_MAX 4294967295U /* Maximum 32-bit unsigned. */ +#else +#define UINT32_MAX 0xffffffff /* Maximum 32-bit unsigned. */ +#endif +#endif + +#if defined(HAVE_64BIT_TYPES) +#undef INT64_MAX +#undef INT64_MIN +#undef UINT64_MAX + +#ifdef DB_WIN32 +#define INT64_MAX _I64_MAX +#define INT64_MIN _I64_MIN +#define UINT64_MAX _UI64_MAX +#else +/* + * Override the system's 64-bit min/max constants. AIX's 32-bit compiler can + * handle 64-bit values, but the system's constants don't include the LL/ULL + * suffix, and so can't be compiled using the 32-bit compiler. + */ +#define INT64_MAX 9223372036854775807LL +#define INT64_MIN (-INT64_MAX-1) +#define UINT64_MAX 18446744073709551615ULL +#endif /* DB_WIN32 */ + +#define INT64_FMT "%I64d" +#define UINT64_FMT "%I64u" +#endif /* HAVE_64BIT_TYPES */ + +#undef FALSE +#define FALSE 0 +#undef TRUE +#define TRUE (!FALSE) + +#define MEGABYTE 1048576 +#define GIGABYTE 1073741824 + +#define MS_PER_SEC 1000 /* Milliseconds in a second. */ +#define USEC_PER_MS 1000 /* Microseconds in a millisecond. */ + +#define RECNO_OOB 0 /* Illegal record number. */ + +/* Test for a power-of-two (tests true for zero, which doesn't matter here). */ +#define POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0) + +/* Test for valid page sizes. */ +#define DB_MIN_PGSIZE 0x000200 /* Minimum page size (512). */ +#define DB_MAX_PGSIZE 0x010000 /* Maximum page size (65536). */ +#define IS_VALID_PAGESIZE(x) \ + (POWER_OF_TWO(x) && (x) >= DB_MIN_PGSIZE && ((x) <= DB_MAX_PGSIZE)) + +/* Minimum number of pages cached, by default. */ +#define DB_MINPAGECACHE 16 + +/* + * If we are unable to determine the underlying filesystem block size, use + * 8K on the grounds that most OS's use less than 8K for a VM page size. + */ +#define DB_DEF_IOSIZE (8 * 1024) + +/* Align an integer to a specific boundary. */ +#undef DB_ALIGN +#define DB_ALIGN(v, bound) \ + (((v) + (bound) - 1) & ~(((uintmax_t)(bound)) - 1)) + +/* Increment a pointer to a specific boundary. */ +#undef ALIGNP_INC +#define ALIGNP_INC(p, bound) \ + (void *)(((uintptr_t)(p) + (bound) - 1) & ~(((uintptr_t)(bound)) - 1)) + +/* Decrement a pointer to a specific boundary. */ +#undef ALIGNP_DEC +#define ALIGNP_DEC(p, bound) \ + (void *)((uintptr_t)(p) & ~(((uintptr_t)(bound)) - 1)) + +/* + * Print an address as a u_long (a u_long is the largest type we can print + * portably). Most 64-bit systems have made longs 64-bits, so this should + * work. + */ +#define P_TO_ULONG(p) ((u_long)(uintptr_t)(p)) + +/* + * Convert a pointer to a small integral value. + * + * The (u_int16_t)(uintptr_t) cast avoids warnings: the (uintptr_t) cast + * converts the value to an integral type, and the (u_int16_t) cast converts + * it to a small integral type so we don't get complaints when we assign the + * final result to an integral type smaller than uintptr_t. + */ +#define P_TO_UINT32(p) ((u_int32_t)(uintptr_t)(p)) +#define P_TO_UINT16(p) ((u_int16_t)(uintptr_t)(p)) + +/* + * There are several on-page structures that are declared to have a number of + * fields followed by a variable length array of items. The structure size + * without including the variable length array or the address of the first of + * those elements can be found using SSZ. + * + * This macro can also be used to find the offset of a structure element in a + * structure. This is used in various places to copy structure elements from + * unaligned memory references, e.g., pointers into a packed page. + * + * There are two versions because compilers object if you take the address of + * an array. + */ +#undef SSZ +#define SSZ(name, field) P_TO_UINT16(&(((name *)0)->field)) + +#undef SSZA +#define SSZA(name, field) P_TO_UINT16(&(((name *)0)->field[0])) + +/* Structure used to print flag values. */ +typedef struct __fn { + u_int32_t mask; /* Flag value. */ + const char *name; /* Flag name. */ +} FN; + +/* Set, clear and test flags. */ +#define FLD_CLR(fld, f) (fld) &= ~(f) +#define FLD_ISSET(fld, f) ((fld) & (f)) +#define FLD_SET(fld, f) (fld) |= (f) +#define F_CLR(p, f) (p)->flags &= ~(f) +#define F_ISSET(p, f) ((p)->flags & (f)) +#define F_SET(p, f) (p)->flags |= (f) +#define LF_CLR(f) ((flags) &= ~(f)) +#define LF_ISSET(f) ((flags) & (f)) +#define LF_SET(f) ((flags) |= (f)) + +/* + * Calculate a percentage. The values can overflow 32-bit integer arithmetic + * so we use floating point. + * + * When calculating a bytes-vs-page size percentage, we're getting the inverse + * of the percentage in all cases, that is, we want 100 minus the percentage we + * calculate. + */ +#define DB_PCT(v, total) \ + ((int)((total) == 0 ? 0 : ((double)(v) * 100) / (total))) +#define DB_PCT_PG(v, total, pgsize) \ + ((int)((total) == 0 ? 0 : \ + 100 - ((double)(v) * 100) / (((double)total) * (pgsize)))) + +/* + * Structure used for callback message aggregation. + * + * Display values in XXX_stat_print calls. + */ +typedef struct __db_msgbuf { + char *buf; /* Heap allocated buffer. */ + char *cur; /* Current end of message. */ + size_t len; /* Allocated length of buffer. */ +} DB_MSGBUF; +#define DB_MSGBUF_INIT(a) do { \ + (a)->buf = (a)->cur = NULL; \ + (a)->len = 0; \ +} while (0) +#define DB_MSGBUF_FLUSH(dbenv, a) do { \ + if ((a)->buf != NULL) { \ + if ((a)->cur != (a)->buf) \ + __db_msg(dbenv, "%s", (a)->buf); \ + __os_free(dbenv, (a)->buf); \ + DB_MSGBUF_INIT(a); \ + } \ +} while (0) +#define STAT_FMT(msg, fmt, type, v) do { \ + DB_MSGBUF __mb; \ + DB_MSGBUF_INIT(&__mb); \ + __db_msgadd(dbenv, &__mb, fmt, (type)(v)); \ + __db_msgadd(dbenv, &__mb, "\t%s", msg); \ + DB_MSGBUF_FLUSH(dbenv, &__mb); \ +} while (0) +#define STAT_HEX(msg, v) \ + __db_msg(dbenv, "%#lx\t%s", (u_long)(v), msg) +#define STAT_ISSET(msg, p) \ + __db_msg(dbenv, "%sSet\t%s", (p) == NULL ? "!" : " ", msg) +#define STAT_LONG(msg, v) \ + __db_msg(dbenv, "%ld\t%s", (long)(v), msg) +#define STAT_LSN(msg, lsnp) \ + __db_msg(dbenv, "%lu/%lu\t%s", \ + (u_long)(lsnp)->file, (u_long)(lsnp)->offset, msg) +#define STAT_POINTER(msg, v) \ + __db_msg(dbenv, "%#lx\t%s", P_TO_ULONG(v), msg) +#define STAT_STRING(msg, p) do { \ + const char *__p = p; /* p may be a function call. */ \ + __db_msg(dbenv, "%s\t%s", __p == NULL ? "!Set" : __p, msg); \ +} while (0) +#define STAT_ULONG(msg, v) \ + __db_msg(dbenv, "%lu\t%s", (u_long)(v), msg) + +/* + * There are quite a few places in Berkeley DB where we want to initialize + * a DBT from a string or other random pointer type, using a length typed + * to size_t in most cases. This macro avoids a lot of casting. The macro + * comes in two flavors because we often want to clear the DBT first. + */ +#define DB_SET_DBT(dbt, d, s) do { \ + (dbt).data = (void *)(d); \ + (dbt).size = (u_int32_t)(s); \ +} while (0) +#define DB_INIT_DBT(dbt, d, s) do { \ + memset(&(dbt), 0, sizeof(dbt)); \ + DB_SET_DBT(dbt, d, s); \ +} while (0) + +/******************************************************* + * API return values + *******************************************************/ +/* + * Return values that are OK for each different call. Most calls have a + * standard 'return of 0 is only OK value', but some, like db->get have + * DB_NOTFOUND as a return value, but it really isn't an error. + */ +#define DB_RETOK_STD(ret) ((ret) == 0) +#define DB_RETOK_DBCDEL(ret) ((ret) == 0 || (ret) == DB_KEYEMPTY || \ + (ret) == DB_NOTFOUND) +#define DB_RETOK_DBCGET(ret) ((ret) == 0 || (ret) == DB_KEYEMPTY || \ + (ret) == DB_NOTFOUND) +#define DB_RETOK_DBCPUT(ret) ((ret) == 0 || (ret) == DB_KEYEXIST || \ + (ret) == DB_NOTFOUND) +#define DB_RETOK_DBDEL(ret) DB_RETOK_DBCDEL(ret) +#define DB_RETOK_DBGET(ret) DB_RETOK_DBCGET(ret) +#define DB_RETOK_DBPUT(ret) ((ret) == 0 || (ret) == DB_KEYEXIST) +#define DB_RETOK_LGGET(ret) ((ret) == 0 || (ret) == DB_NOTFOUND) +#define DB_RETOK_MPGET(ret) ((ret) == 0 || (ret) == DB_PAGE_NOTFOUND) +#define DB_RETOK_REPPMSG(ret) ((ret) == 0 || \ + (ret) == DB_REP_IGNORE || \ + (ret) == DB_REP_ISPERM || \ + (ret) == DB_REP_NEWMASTER || \ + (ret) == DB_REP_NEWSITE || \ + (ret) == DB_REP_NOTPERM) + +/* Find a reasonable operation-not-supported error. */ +#ifdef EOPNOTSUPP +#define DB_OPNOTSUP EOPNOTSUPP +#else +#ifdef ENOTSUP +#define DB_OPNOTSUP ENOTSUP +#else +#define DB_OPNOTSUP EINVAL +#endif +#endif + +/******************************************************* + * Files. + *******************************************************/ +/* + * We use 1024 as the maximum path length. It's too hard to figure out what + * the real path length is, as it was traditionally stored in , + * and that file isn't always available. + */ +#define DB_MAXPATHLEN 1024 + +#define PATH_DOT "." /* Current working directory. */ + /* Path separator character(s). */ +#define PATH_SEPARATOR "\\/:" + +/******************************************************* + * Environment. + *******************************************************/ +/* Type passed to __db_appname(). */ +typedef enum { + DB_APP_NONE=0, /* No type (region). */ + DB_APP_DATA, /* Data file. */ + DB_APP_LOG, /* Log file. */ + DB_APP_TMP /* Temporary file. */ +} APPNAME; + +/* + * A set of macros to check if various functionality has been configured. + * + * ALIVE_ON The is_alive function is configured. + * CDB_LOCKING CDB product locking. + * CRYPTO_ON Security has been configured. + * LOCKING_ON Locking has been configured. + * LOGGING_ON Logging has been configured. + * MUTEX_ON Mutexes have been configured. + * MPOOL_ON Memory pool has been configured. + * REP_ON Replication has been configured. + * RPC_ON RPC has been configured. + * TXN_ON Transactions have been configured. + * + * REP_ON is more complex than most: if the BDB library was compiled without + * replication support, dbenv->rep_handle will be NULL; if the BDB library + * has replication support, but it was not configured, the region reference + * will be NULL. + */ +#define ALIVE_ON(dbenv) ((dbenv)->is_alive != NULL) +#define CDB_LOCKING(dbenv) F_ISSET(dbenv, DB_ENV_CDB) +#define CRYPTO_ON(dbenv) ((dbenv)->crypto_handle != NULL) +#define LOCKING_ON(dbenv) ((dbenv)->lk_handle != NULL) +#define LOGGING_ON(dbenv) ((dbenv)->lg_handle != NULL) +#define MPOOL_ON(dbenv) ((dbenv)->mp_handle != NULL) +#define MUTEX_ON(dbenv) ((dbenv)->mutex_handle != NULL) +#define REP_ON(dbenv) \ + ((dbenv)->rep_handle != NULL && (dbenv)->rep_handle->region != NULL) +#define RPC_ON(dbenv) ((dbenv)->cl_handle != NULL) +#define TXN_ON(dbenv) ((dbenv)->tx_handle != NULL) + +/* + * STD_LOCKING Standard locking, that is, locking was configured and CDB + * was not. We do not do locking in off-page duplicate trees, + * so we check for that in the cursor first. + */ +#define STD_LOCKING(dbc) \ + (!F_ISSET(dbc, DBC_OPD) && \ + !CDB_LOCKING((dbc)->dbp->dbenv) && LOCKING_ON((dbc)->dbp->dbenv)) + +/* + * IS_RECOVERING: The system is running recovery. + */ +#define IS_RECOVERING(dbenv) \ + (LOGGING_ON(dbenv) && F_ISSET((dbenv)->lg_handle, DBLOG_RECOVER)) + +/* Initialization methods are often illegal before/after open is called. */ +#define ENV_ILLEGAL_AFTER_OPEN(dbenv, name) \ + if (F_ISSET((dbenv), DB_ENV_OPEN_CALLED)) \ + return (__db_mi_open(dbenv, name, 1)); +#define ENV_ILLEGAL_BEFORE_OPEN(dbenv, name) \ + if (!F_ISSET((dbenv), DB_ENV_OPEN_CALLED)) \ + return (__db_mi_open(dbenv, name, 0)); + +/* We're not actually user hostile, honest. */ +#define ENV_REQUIRES_CONFIG(dbenv, handle, i, flags) \ + if (handle == NULL) \ + return (__db_env_config(dbenv, i, flags)); +#define ENV_REQUIRES_CONFIG_XX(dbenv, handle, i, flags) \ + if ((dbenv)->handle->region == NULL) \ + return (__db_env_config(dbenv, i, flags)); +#define ENV_NOT_CONFIGURED(dbenv, handle, i, flags) \ + if (F_ISSET((dbenv), DB_ENV_OPEN_CALLED)) \ + ENV_REQUIRES_CONFIG(dbenv, handle, i, flags) + +#define ENV_ENTER(dbenv, ip) do { \ + int __ret; \ + if ((dbenv)->thr_hashtab == NULL) \ + ip = NULL; \ + else { \ + if ((__ret = \ + __env_set_state(dbenv, &(ip), THREAD_ACTIVE)) != 0) \ + return (__ret); \ + } \ +} while (0) + +#ifdef DIAGNOSTIC +#define ENV_LEAVE(dbenv, ip) do { \ + if ((ip) != NULL) { \ + DB_ASSERT(dbenv, ip->dbth_state == THREAD_ACTIVE); \ + (ip)->dbth_state = THREAD_OUT; \ + } \ +} while (0) +#else +#define ENV_LEAVE(dbenv, ip) do { \ + if ((ip) != NULL) \ + (ip)->dbth_state = THREAD_OUT; \ +} while (0) +#endif +#ifdef DIAGNOSTIC +#define CHECK_THREAD(dbenv) do { \ + DB_THREAD_INFO *__ip; \ + if ((dbenv)->thr_hashtab != NULL) { \ + (void)__env_set_state(dbenv, &__ip, THREAD_DIAGNOSTIC); \ + DB_ASSERT(dbenv, \ + __ip != NULL && __ip->dbth_state != THREAD_OUT); \ + } \ +} while (0) +#ifdef HAVE_STATISTICS +#define CHECK_MTX_THREAD(dbenv, mtx) do { \ + if (mtx->alloc_id != MTX_MUTEX_REGION && \ + mtx->alloc_id != MTX_ENV_REGION && \ + mtx->alloc_id != MTX_APPLICATION) \ + CHECK_THREAD(dbenv); \ +} while (0) +#else +#define CHECK_MTX_THREAD(dbenv, mtx) +#endif +#else +#define CHECK_THREAD(dbenv) +#define CHECK_MTX_THREAD(dbenv, mtx) +#endif + +typedef enum { + THREAD_SLOT_NOT_IN_USE=0, + THREAD_OUT, + THREAD_ACTIVE, + THREAD_BLOCKED +#ifdef DIAGNOSTIC + , THREAD_DIAGNOSTIC +#endif +} DB_THREAD_STATE; + +typedef struct __db_thread_info { + pid_t dbth_pid; + db_threadid_t dbth_tid; + DB_THREAD_STATE dbth_state; + SH_TAILQ_ENTRY dbth_links; +} DB_THREAD_INFO; + +typedef struct __env_thread_info { + u_int32_t thr_count; + u_int32_t thr_max; + u_int32_t thr_nbucket; + roff_t thr_hashoff; +} THREAD_INFO; + +#define DB_EVENT(dbenv, e, einfo) do { \ + if ((dbenv)->db_event_func != NULL) \ + (dbenv)->db_event_func(dbenv, e, einfo); \ +} while (0) + +/******************************************************* + * Database Access Methods. + *******************************************************/ +/* + * DB_IS_THREADED -- + * The database handle is free-threaded (was opened with DB_THREAD). + */ +#define DB_IS_THREADED(dbp) \ + ((dbp)->mutex != MUTEX_INVALID) + +/* Initialization methods are often illegal before/after open is called. */ +#define DB_ILLEGAL_AFTER_OPEN(dbp, name) \ + if (F_ISSET((dbp), DB_AM_OPEN_CALLED)) \ + return (__db_mi_open((dbp)->dbenv, name, 1)); +#define DB_ILLEGAL_BEFORE_OPEN(dbp, name) \ + if (!F_ISSET((dbp), DB_AM_OPEN_CALLED)) \ + return (__db_mi_open((dbp)->dbenv, name, 0)); +/* Some initialization methods are illegal if environment isn't local. */ +#define DB_ILLEGAL_IN_ENV(dbp, name) \ + if (!F_ISSET((dbp)->dbenv, DB_ENV_DBLOCAL)) \ + return (__db_mi_env((dbp)->dbenv, name)); +#define DB_ILLEGAL_METHOD(dbp, flags) { \ + int __ret; \ + if ((__ret = __dbh_am_chk(dbp, flags)) != 0) \ + return (__ret); \ +} + +/* + * Common DBC->internal fields. Each access method adds additional fields + * to this list, but the initial fields are common. + */ +#define __DBC_INTERNAL \ + DBC *opd; /* Off-page duplicate cursor. */\ + \ + void *page; /* Referenced page. */ \ + db_pgno_t root; /* Tree root. */ \ + db_pgno_t pgno; /* Referenced page number. */ \ + db_indx_t indx; /* Referenced key item index. */\ + \ + DB_LOCK lock; /* Cursor lock. */ \ + db_lockmode_t lock_mode; /* Lock mode. */ + +struct __dbc_internal { + __DBC_INTERNAL +}; + +/* Actions that __db_master_update can take. */ +typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action; + +/* + * Access-method-common macro for determining whether a cursor + * has been initialized. + */ +#define IS_INITIALIZED(dbc) ((dbc)->internal->pgno != PGNO_INVALID) + +/* Free the callback-allocated buffer, if necessary, hanging off of a DBT. */ +#define FREE_IF_NEEDED(dbenv, dbt) \ + if (F_ISSET((dbt), DB_DBT_APPMALLOC)) { \ + __os_ufree((dbenv), (dbt)->data); \ + F_CLR((dbt), DB_DBT_APPMALLOC); \ + } + +/* + * Use memory belonging to object "owner" to return the results of + * any no-DBT-flag get ops on cursor "dbc". + */ +#define SET_RET_MEM(dbc, owner) \ + do { \ + (dbc)->rskey = &(owner)->my_rskey; \ + (dbc)->rkey = &(owner)->my_rkey; \ + (dbc)->rdata = &(owner)->my_rdata; \ + } while (0) + +/* Use the return-data memory src is currently set to use in dest as well. */ +#define COPY_RET_MEM(src, dest) \ + do { \ + (dest)->rskey = (src)->rskey; \ + (dest)->rkey = (src)->rkey; \ + (dest)->rdata = (src)->rdata; \ + } while (0) + +/* Reset the returned-memory pointers to their defaults. */ +#define RESET_RET_MEM(dbc) \ + do { \ + (dbc)->rskey = &(dbc)->my_rskey; \ + (dbc)->rkey = &(dbc)->my_rkey; \ + (dbc)->rdata = &(dbc)->my_rdata; \ + } while (0) + +/******************************************************* + * Mpool. + *******************************************************/ +/* + * File types for DB access methods. Negative numbers are reserved to DB. + */ +#define DB_FTYPE_SET -1 /* Call pgin/pgout functions. */ +#define DB_FTYPE_NOTSET 0 /* Don't call... */ +#define DB_LSN_OFF_NOTSET -1 /* Not yet set. */ +#define DB_CLEARLEN_NOTSET UINT32_MAX /* Not yet set. */ + +/* Structure used as the DB pgin/pgout pgcookie. */ +typedef struct __dbpginfo { + size_t db_pagesize; /* Underlying page size. */ + u_int32_t flags; /* Some DB_AM flags needed. */ + DBTYPE type; /* DB type */ +} DB_PGINFO; + +/******************************************************* + * Log. + *******************************************************/ +/* Initialize an LSN to 'zero'. */ +#define ZERO_LSN(LSN) do { \ + (LSN).file = 0; \ + (LSN).offset = 0; \ +} while (0) +#define IS_ZERO_LSN(LSN) ((LSN).file == 0 && (LSN).offset == 0) + +#define IS_INIT_LSN(LSN) ((LSN).file == 1 && (LSN).offset == 0) +#define INIT_LSN(LSN) do { \ + (LSN).file = 1; \ + (LSN).offset = 0; \ +} while (0) + +#define MAX_LSN(LSN) do { \ + (LSN).file = UINT32_MAX; \ + (LSN).offset = UINT32_MAX; \ +} while (0) +#define IS_MAX_LSN(LSN) \ + ((LSN).file == UINT32_MAX && (LSN).offset == UINT32_MAX) + +/* If logging is turned off, smash the lsn. */ +#define LSN_NOT_LOGGED(LSN) do { \ + (LSN).file = 0; \ + (LSN).offset = 1; \ +} while (0) +#define IS_NOT_LOGGED_LSN(LSN) \ + ((LSN).file == 0 && (LSN).offset == 1) + +/* + * LOG_COMPARE -- compare two LSNs. + */ + +#define LOG_COMPARE(lsn0, lsn1) \ + ((lsn0)->file != (lsn1)->file ? \ + ((lsn0)->file < (lsn1)->file ? -1 : 1) : \ + ((lsn0)->offset != (lsn1)->offset ? \ + ((lsn0)->offset < (lsn1)->offset ? -1 : 1) : 0)) + + +/******************************************************* + * Txn. + *******************************************************/ +#define DB_NONBLOCK(C) ((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT)) +#define NOWAIT_FLAG(txn) \ + ((txn) != NULL && F_ISSET((txn), TXN_NOWAIT) ? DB_LOCK_NOWAIT : 0) +#define IS_REAL_TXN(txn) \ + ((txn) != NULL && !F_ISSET(txn, TXN_CDSGROUP)) +#define IS_SUBTRANSACTION(txn) \ + ((txn) != NULL && (txn)->parent != NULL) + +/******************************************************* + * Crypto. + *******************************************************/ +#define DB_IV_BYTES 16 /* Bytes per IV */ +#define DB_MAC_KEY 20 /* Bytes per MAC checksum */ + +/******************************************************* + * Secondaries over RPC. + *******************************************************/ +#ifdef CONFIG_TEST +/* + * These are flags passed to DB->associate calls by the Tcl API if running + * over RPC. The RPC server will mask out these flags before making the real + * DB->associate call. + * + * These flags must coexist with the valid flags to DB->associate (currently + * DB_AUTO_COMMIT and DB_CREATE). DB_AUTO_COMMIT is in the group of + * high-order shared flags (0xff000000), and DB_CREATE is in the low-order + * group (0x00000fff), so we pick a range in between. + */ +#define DB_RPC2ND_MASK 0x00f00000 /* Reserved bits. */ + +#define DB_RPC2ND_REVERSEDATA 0x00100000 /* callback_n(0) _s_reversedata. */ +#define DB_RPC2ND_NOOP 0x00200000 /* callback_n(1) _s_noop */ +#define DB_RPC2ND_CONCATKEYDATA 0x00300000 /* callback_n(2) _s_concatkeydata */ +#define DB_RPC2ND_CONCATDATAKEY 0x00400000 /* callback_n(3) _s_concatdatakey */ +#define DB_RPC2ND_REVERSECONCAT 0x00500000 /* callback_n(4) _s_reverseconcat */ +#define DB_RPC2ND_TRUNCDATA 0x00600000 /* callback_n(5) _s_truncdata */ +#define DB_RPC2ND_CONSTANT 0x00700000 /* callback_n(6) _s_constant */ +#define DB_RPC2ND_GETZIP 0x00800000 /* sj_getzip */ +#define DB_RPC2ND_GETNAME 0x00900000 /* sj_getname */ +#endif + +/******************************************************* + * Forward structure declarations. + *******************************************************/ +struct __db_reginfo_t; typedef struct __db_reginfo_t REGINFO; +struct __db_txnhead; typedef struct __db_txnhead DB_TXNHEAD; +struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST; +struct __vrfy_childinfo;typedef struct __vrfy_childinfo VRFY_CHILDINFO; +struct __vrfy_dbinfo; typedef struct __vrfy_dbinfo VRFY_DBINFO; +struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO; + +typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB; + +#if defined(__cplusplus) +} +#endif + +/******************************************************* + * Remaining general DB includes. + *******************************************************/ + + +#include "dbinc/globals.h" +#include "dbinc/debug.h" +#include "dbinc/region.h" +#include "dbinc_auto/env_ext.h" +#include "dbinc/mutex.h" +#include "dbinc/os.h" +#ifdef HAVE_REPLICATION_THREADS +#include "dbinc/repmgr.h" +#endif +#include "dbinc/rep.h" +#include "dbinc_auto/clib_ext.h" +#include "dbinc_auto/common_ext.h" + +/******************************************************* + * Remaining Log. + * These need to be defined after the general includes + * because they need rep.h from above. + *******************************************************/ +/* + * Test if the environment is currently logging changes. If we're in recovery + * or we're a replication client, we don't need to log changes because they're + * already in the log, even though we have a fully functional log system. + */ +#define DBENV_LOGGING(dbenv) \ + (LOGGING_ON(dbenv) && !IS_REP_CLIENT(dbenv) && \ + (!IS_RECOVERING(dbenv))) + +/* + * Test if we need to log a change. By default, we don't log operations without + * associated transactions, unless DIAGNOSTIC, DEBUG_ROP or DEBUG_WOP are on. + * This is because we want to get log records for read/write operations, and, if + * we trying to debug something, more information is always better. + * + * The DBC_RECOVER flag is set when we're in abort, as well as during recovery; + * thus DBC_LOGGING may be false for a particular dbc even when DBENV_LOGGING + * is true. + * + * We explicitly use LOGGING_ON/IS_REP_CLIENT here because we don't want to pull + * in the log headers, which IS_RECOVERING (and thus DBENV_LOGGING) rely on, and + * because DBC_RECOVER should be set anytime IS_RECOVERING would be true. + * + * If we're not in recovery (master - doing an abort a client applying + * a txn), then a client's only path through here is on an internal + * operation, and a master's only path through here is a transactional + * operation. Detect if either is not the case. + */ +#if defined(DIAGNOSTIC) || defined(DEBUG_ROP) || defined(DEBUG_WOP) +#define DBC_LOGGING(dbc) __dbc_logging(dbc) +#else +#define DBC_LOGGING(dbc) \ + ((dbc)->txn != NULL && LOGGING_ON((dbc)->dbp->dbenv) && \ + !F_ISSET((dbc), DBC_RECOVER) && !IS_REP_CLIENT((dbc)->dbp->dbenv)) +#endif + +#endif /* !_DB_INT_H_ */ diff --git a/db/build_windows/db_java.dsp b/db/build_windows/db_java.dsp new file mode 100644 index 000000000..996cfc9e3 --- /dev/null +++ b/db/build_windows/db_java.dsp @@ -0,0 +1,412 @@ +# Microsoft Developer Studio Project File - Name="db_java" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=db_java - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_java.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_java.mak" CFG="db_java - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_java - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_java - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_java - Win32 ASCII Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_java - Win32 ASCII Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_java - x64 Debug AMD64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_java - x64 Release AMD64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_java - x64 Debug IA64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_java - x64 Release IA64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_java - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_java" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_java" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb_java45.dll" /libpath:"$(OUTDIR)" +# Begin Custom Build - Compiling java files using javac +ProjDir=. +InputPath=$(OUTDIR)/libdb_java44d.dll +SOURCE="$(InputPath)" + +"force_compilation.txt" : $(SOURCE) "$(INTDIR)" + echo compiling Berkeley DB classes + mkdir "$(INTDIR)\classes" + javac -g -d "$(INTDIR)\classes" -classpath "$(INTDIR)\classes" ..\java\src\com\sleepycat\db\*.java ..\java\src\com\sleepycat\db\internal\*.java ..\java\src\com\sleepycat\bind\*.java ..\java\src\com\sleepycat\bind\serial\*.java ..\java\src\com\sleepycat\bind\tuple\*.java ..\java\src\com\sleepycat\collections\*.java ..\java\src\com\sleepycat\compat\*.java ..\java\src\com\sleepycat\util\*.java ..\java\src\com\sleepycat\util\keyrange\*.java + echo compiling examples + mkdir "$(INTDIR)\classes.ex" + javac -g -d "$(INTDIR)\classes.ex" -classpath "$(INTDIR)\classes;$(INTDIR)\classes.ex" ..\examples_java\src\db\*.java ..\examples_java\src\db\GettingStarted\*.java ..\examples_java\src\db\repquote\*.java ..\examples_java\src\collections\access\*.java ..\examples_java\src\collections\hello\*.java ..\examples_java\src\collections\ship\basic\*.java ..\examples_java\src\collections\ship\entity\*.java ..\examples_java\src\collections\ship\tuple\*.java ..\examples_java\src\collections\ship\sentity\*.java ..\examples_java\src\collections\ship\marshal\*.java ..\examples_java\src\collections\ship\factory\*.java + echo creating jar files + jar cf "$(OUTDIR)/db.jar" -C "$(INTDIR)\classes" . + jar cf "$(OUTDIR)/dbexamples.jar" -C "$(INTDIR)\classes.ex" . + echo Java build finished +# End Custom Build + +!ELSEIF "$(CFG)" == "db_java - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_java" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_java" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /pdb:none /debug /machine:I386 /out:"Debug/libdb_java45d.dll" /fixed:no /libpath:"$(OUTDIR)" +# Begin Custom Build - Compiling java files using javac +ProjDir=. +InputPath=$(OUTDIR)/libdb_java44d.dll +SOURCE="$(InputPath)" + +"force_compilation.txt" : $(SOURCE) "$(INTDIR)" + echo compiling Berkeley DB classes + mkdir "$(INTDIR)\classes" + javac -g -d "$(INTDIR)\classes" -classpath "$(INTDIR)\classes" ..\java\src\com\sleepycat\db\*.java ..\java\src\com\sleepycat\db\internal\*.java ..\java\src\com\sleepycat\bind\*.java ..\java\src\com\sleepycat\bind\serial\*.java ..\java\src\com\sleepycat\bind\tuple\*.java ..\java\src\com\sleepycat\collections\*.java ..\java\src\com\sleepycat\compat\*.java ..\java\src\com\sleepycat\util\*.java ..\java\src\com\sleepycat\util\keyrange\*.java + echo compiling examples + mkdir "$(INTDIR)\classes.ex" + javac -g -d "$(INTDIR)\classes.ex" -classpath "$(INTDIR)\classes;$(INTDIR)\classes.ex" ..\examples_java\src\db\*.java ..\examples_java\src\db\GettingStarted\*.java ..\examples_java\src\db\repquote\*.java ..\examples_java\src\collections\access\*.java ..\examples_java\src\collections\hello\*.java ..\examples_java\src\collections\ship\basic\*.java ..\examples_java\src\collections\ship\entity\*.java ..\examples_java\src\collections\ship\tuple\*.java ..\examples_java\src\collections\ship\sentity\*.java ..\examples_java\src\collections\ship\marshal\*.java ..\examples_java\src\collections\ship\factory\*.java + echo creating jar files + jar cf "$(OUTDIR)/db.jar" -C "$(INTDIR)\classes" . + jar cf "$(OUTDIR)/dbexamples.jar" -C "$(INTDIR)\classes.ex" . + echo Java build finished +# End Custom Build + +!ELSEIF "$(CFG)" == "db_java - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_java" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_java" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug_ASCII/libdb_java45d.dll" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /pdb:none /debug /machine:I386 /out:"Debug_ASCII/libdb_java45d.dll" /fixed:no /libpath:"$(OUTDIR)" +# Begin Custom Build - Compiling java files using javac +ProjDir=. +InputPath=$(OUTDIR)/libdb_java44d.dll +SOURCE="$(InputPath)" + +"force_compilation.txt" : $(SOURCE) "$(INTDIR)" + echo compiling Berkeley DB classes + mkdir "$(INTDIR)\classes" + javac -g -d "$(INTDIR)\classes" -classpath "$(INTDIR)\classes" ..\java\src\com\sleepycat\db\*.java ..\java\src\com\sleepycat\db\internal\*.java ..\java\src\com\sleepycat\bind\*.java ..\java\src\com\sleepycat\bind\serial\*.java ..\java\src\com\sleepycat\bind\tuple\*.java ..\java\src\com\sleepycat\collections\*.java ..\java\src\com\sleepycat\compat\*.java ..\java\src\com\sleepycat\util\*.java ..\java\src\com\sleepycat\util\keyrange\*.java + echo compiling examples + mkdir "$(INTDIR)\classes.ex" + javac -g -d "$(INTDIR)\classes.ex" -classpath "$(INTDIR)\classes;$(INTDIR)\classes.ex" ..\examples_java\src\db\*.java ..\examples_java\src\db\GettingStarted\*.java ..\examples_java\src\db\repquote\*.java ..\examples_java\src\collections\access\*.java ..\examples_java\src\collections\hello\*.java ..\examples_java\src\collections\ship\basic\*.java ..\examples_java\src\collections\ship\entity\*.java ..\examples_java\src\collections\ship\tuple\*.java ..\examples_java\src\collections\ship\sentity\*.java ..\examples_java\src\collections\ship\marshal\*.java ..\examples_java\src\collections\ship\factory\*.java + echo creating jar files + jar cf "$(OUTDIR)/db.jar" -C "$(INTDIR)\classes" . + jar cf "$(OUTDIR)/dbexamples.jar" -C "$(INTDIR)\classes.ex" . + echo Java build finished +# End Custom Build + +!ELSEIF "$(CFG)" == "db_java - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_java" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_java" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release_ASCII/libdb_java45.dll" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release_ASCII/libdb_java45.dll" /libpath:"$(OUTDIR)" +# Begin Custom Build - Compiling java files using javac +ProjDir=. +InputPath=$(OUTDIR)/libdb_java44d.dll +SOURCE="$(InputPath)" + +"force_compilation.txt" : $(SOURCE) "$(INTDIR)" + echo compiling Berkeley DB classes + mkdir "$(INTDIR)\classes" + javac -g -d "$(INTDIR)\classes" -classpath "$(INTDIR)\classes" ..\java\src\com\sleepycat\db\*.java ..\java\src\com\sleepycat\db\internal\*.java ..\java\src\com\sleepycat\bind\*.java ..\java\src\com\sleepycat\bind\serial\*.java ..\java\src\com\sleepycat\bind\tuple\*.java ..\java\src\com\sleepycat\collections\*.java ..\java\src\com\sleepycat\compat\*.java ..\java\src\com\sleepycat\util\*.java ..\java\src\com\sleepycat\util\keyrange\*.java + echo compiling examples + mkdir "$(INTDIR)\classes.ex" + javac -g -d "$(INTDIR)\classes.ex" -classpath "$(INTDIR)\classes;$(INTDIR)\classes.ex" ..\examples_java\src\db\*.java ..\examples_java\src\db\GettingStarted\*.java ..\examples_java\src\db\repquote\*.java ..\examples_java\src\collections\access\*.java ..\examples_java\src\collections\hello\*.java ..\examples_java\src\collections\ship\basic\*.java ..\examples_java\src\collections\ship\entity\*.java ..\examples_java\src\collections\ship\tuple\*.java ..\examples_java\src\collections\ship\sentity\*.java ..\examples_java\src\collections\ship\marshal\*.java ..\examples_java\src\collections\ship\factory\*.java + echo creating jar files + jar cf "$(OUTDIR)/db.jar" -C "$(INTDIR)\classes" . + jar cf "$(OUTDIR)/dbexamples.jar" -C "$(INTDIR)\classes.ex" . + echo Java build finished +# End Custom Build + +!ELSEIF "$(CFG)" == "db_java - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_java" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_java" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /Wp64 /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /debug /machine:AMD64 /out:"Debug_AMD64/libdb_java45d.dll" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /debug /machine:AMD64 /out:"Debug_AMD64/libdb_java45d.dll" /fixed:no /libpath:"$(OUTDIR)" +# Begin Custom Build - Compiling java files using javac +ProjDir=. +InputPath=$(OUTDIR)/libdb_java44d.dll +SOURCE="$(InputPath)" + +"force_compilation.txt" : $(SOURCE) "$(INTDIR)" + echo compiling Berkeley DB classes + mkdir "$(INTDIR)\classes" + javac -g -d "$(INTDIR)\classes" -classpath "$(INTDIR)\classes" ..\java\src\com\sleepycat\db\*.java ..\java\src\com\sleepycat\db\internal\*.java ..\java\src\com\sleepycat\bind\*.java ..\java\src\com\sleepycat\bind\serial\*.java ..\java\src\com\sleepycat\bind\tuple\*.java ..\java\src\com\sleepycat\collections\*.java ..\java\src\com\sleepycat\compat\*.java ..\java\src\com\sleepycat\util\*.java ..\java\src\com\sleepycat\util\keyrange\*.java + echo compiling examples + mkdir "$(INTDIR)\classes.ex" + javac -g -d "$(INTDIR)\classes.ex" -classpath "$(INTDIR)\classes;$(INTDIR)\classes.ex" ..\examples_java\src\db\*.java ..\examples_java\src\db\GettingStarted\*.java ..\examples_java\src\db\repquote\*.java ..\examples_java\src\collections\access\*.java ..\examples_java\src\collections\hello\*.java ..\examples_java\src\collections\ship\basic\*.java ..\examples_java\src\collections\ship\entity\*.java ..\examples_java\src\collections\ship\tuple\*.java ..\examples_java\src\collections\ship\sentity\*.java ..\examples_java\src\collections\ship\marshal\*.java ..\examples_java\src\collections\ship\factory\*.java + echo creating jar files + jar cf "$(OUTDIR)/db.jar" -C "$(INTDIR)\classes" . + jar cf "$(OUTDIR)/dbexamples.jar" -C "$(INTDIR)\classes.ex" . + echo Java build finished +# End Custom Build + +!ELSEIF "$(CFG)" == "db_java - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_java" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_java" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:AMD64 /out:"Release_AMD64/libdb_java45.dll" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:AMD64 /out:"Release_AMD64/libdb_java45.dll" /libpath:"$(OUTDIR)" +# Begin Custom Build - Compiling java files using javac +ProjDir=. +InputPath=$(OUTDIR)/libdb_java44d.dll +SOURCE="$(InputPath)" + +"force_compilation.txt" : $(SOURCE) "$(INTDIR)" + echo compiling Berkeley DB classes + mkdir "$(INTDIR)\classes" + javac -g -d "$(INTDIR)\classes" -classpath "$(INTDIR)\classes" ..\java\src\com\sleepycat\db\*.java ..\java\src\com\sleepycat\db\internal\*.java ..\java\src\com\sleepycat\bind\*.java ..\java\src\com\sleepycat\bind\serial\*.java ..\java\src\com\sleepycat\bind\tuple\*.java ..\java\src\com\sleepycat\collections\*.java ..\java\src\com\sleepycat\compat\*.java ..\java\src\com\sleepycat\util\*.java ..\java\src\com\sleepycat\util\keyrange\*.java + echo compiling examples + mkdir "$(INTDIR)\classes.ex" + javac -g -d "$(INTDIR)\classes.ex" -classpath "$(INTDIR)\classes;$(INTDIR)\classes.ex" ..\examples_java\src\db\*.java ..\examples_java\src\db\GettingStarted\*.java ..\examples_java\src\db\repquote\*.java ..\examples_java\src\collections\access\*.java ..\examples_java\src\collections\hello\*.java ..\examples_java\src\collections\ship\basic\*.java ..\examples_java\src\collections\ship\entity\*.java ..\examples_java\src\collections\ship\tuple\*.java ..\examples_java\src\collections\ship\sentity\*.java ..\examples_java\src\collections\ship\marshal\*.java ..\examples_java\src\collections\ship\factory\*.java + echo creating jar files + jar cf "$(OUTDIR)/db.jar" -C "$(INTDIR)\classes" . + jar cf "$(OUTDIR)/dbexamples.jar" -C "$(INTDIR)\classes.ex" . + echo Java build finished +# End Custom Build + +!ELSEIF "$(CFG)" == "db_java - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_java" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_java" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Wp64 /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Wp64 /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /debug /machine:IA64 /out:"Debug_IA64/libdb_java45d.dll" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /debug /machine:IA64 /out:"Debug_IA64/libdb_java45d.dll" /fixed:no /libpath:"$(OUTDIR)" +# Begin Custom Build - Compiling java files using javac +ProjDir=. +InputPath=$(OUTDIR)/libdb_java44d.dll +SOURCE="$(InputPath)" + +"force_compilation.txt" : $(SOURCE) "$(INTDIR)" + echo compiling Berkeley DB classes + mkdir "$(INTDIR)\classes" + javac -g -d "$(INTDIR)\classes" -classpath "$(INTDIR)\classes" ..\java\src\com\sleepycat\db\*.java ..\java\src\com\sleepycat\db\internal\*.java ..\java\src\com\sleepycat\bind\*.java ..\java\src\com\sleepycat\bind\serial\*.java ..\java\src\com\sleepycat\bind\tuple\*.java ..\java\src\com\sleepycat\collections\*.java ..\java\src\com\sleepycat\compat\*.java ..\java\src\com\sleepycat\util\*.java ..\java\src\com\sleepycat\util\keyrange\*.java + echo compiling examples + mkdir "$(INTDIR)\classes.ex" + javac -g -d "$(INTDIR)\classes.ex" -classpath "$(INTDIR)\classes;$(INTDIR)\classes.ex" ..\examples_java\src\db\*.java ..\examples_java\src\db\GettingStarted\*.java ..\examples_java\src\db\repquote\*.java ..\examples_java\src\collections\access\*.java ..\examples_java\src\collections\hello\*.java ..\examples_java\src\collections\ship\basic\*.java ..\examples_java\src\collections\ship\entity\*.java ..\examples_java\src\collections\ship\tuple\*.java ..\examples_java\src\collections\ship\sentity\*.java ..\examples_java\src\collections\ship\marshal\*.java ..\examples_java\src\collections\ship\factory\*.java + echo creating jar files + jar cf "$(OUTDIR)/db.jar" -C "$(INTDIR)\classes" . + jar cf "$(OUTDIR)/dbexamples.jar" -C "$(INTDIR)\classes.ex" . + echo Java build finished +# End Custom Build + +!ELSEIF "$(CFG)" == "db_java - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_java" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_java" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:IA64 /out:"Release_IA64/libdb_java45.dll" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:IA64 /out:"Release_IA64/libdb_java45.dll" /libpath:"$(OUTDIR)" +# Begin Custom Build - Compiling java files using javac +ProjDir=. +InputPath=$(OUTDIR)/libdb_java44d.dll +SOURCE="$(InputPath)" + +"force_compilation.txt" : $(SOURCE) "$(INTDIR)" + echo compiling Berkeley DB classes + mkdir "$(INTDIR)\classes" + javac -g -d "$(INTDIR)\classes" -classpath "$(INTDIR)\classes" ..\java\src\com\sleepycat\db\*.java ..\java\src\com\sleepycat\db\internal\*.java ..\java\src\com\sleepycat\bind\*.java ..\java\src\com\sleepycat\bind\serial\*.java ..\java\src\com\sleepycat\bind\tuple\*.java ..\java\src\com\sleepycat\collections\*.java ..\java\src\com\sleepycat\compat\*.java ..\java\src\com\sleepycat\util\*.java ..\java\src\com\sleepycat\util\keyrange\*.java + echo compiling examples + mkdir "$(INTDIR)\classes.ex" + javac -g -d "$(INTDIR)\classes.ex" -classpath "$(INTDIR)\classes;$(INTDIR)\classes.ex" ..\examples_java\src\db\*.java ..\examples_java\src\db\GettingStarted\*.java ..\examples_java\src\db\repquote\*.java ..\examples_java\src\collections\access\*.java ..\examples_java\src\collections\hello\*.java ..\examples_java\src\collections\ship\basic\*.java ..\examples_java\src\collections\ship\entity\*.java ..\examples_java\src\collections\ship\tuple\*.java ..\examples_java\src\collections\ship\sentity\*.java ..\examples_java\src\collections\ship\marshal\*.java ..\examples_java\src\collections\ship\factory\*.java + echo creating jar files + jar cf "$(OUTDIR)/db.jar" -C "$(INTDIR)\classes" . + jar cf "$(OUTDIR)/dbexamples.jar" -C "$(INTDIR)\classes.ex" . + echo Java build finished +# End Custom Build + +!ENDIF + +# Begin Target + +# Name "db_java - Win32 Release" +# Name "db_java - Win32 Debug" +# Name "db_java - Win32 ASCII Debug" +# Name "db_java - Win32 ASCII Release" +# Name "db_java - x64 Debug AMD64" +# Name "db_java - x64 Release AMD64" +# Name "db_java - x64 Debug IA64" +# Name "db_java - x64 Release IA64" +# Begin Source File + +SOURCE=..\libdb_java\db_java_wrap.c +# End Source File + +# End Target +# End Project diff --git a/db/build_windows/db_java.dsp.postbuild b/db/build_windows/db_java.dsp.postbuild new file mode 100644 index 000000000..9b244fbee --- /dev/null +++ b/db/build_windows/db_java.dsp.postbuild @@ -0,0 +1,17 @@ +# Begin Custom Build - Compiling java files using javac +ProjDir=. +InputPath=$(OUTDIR)/libdb_java44d.dll +SOURCE="$(InputPath)" + +"force_compilation.txt" : $(SOURCE) "$(INTDIR)" + echo compiling Berkeley DB classes + mkdir "$(INTDIR)\classes" + javac -g -d "$(INTDIR)\classes" -classpath "$(INTDIR)\classes" ..\java\src\com\sleepycat\db\*.java ..\java\src\com\sleepycat\db\internal\*.java ..\java\src\com\sleepycat\bind\*.java ..\java\src\com\sleepycat\bind\serial\*.java ..\java\src\com\sleepycat\bind\tuple\*.java ..\java\src\com\sleepycat\collections\*.java ..\java\src\com\sleepycat\compat\*.java ..\java\src\com\sleepycat\util\*.java ..\java\src\com\sleepycat\util\keyrange\*.java + echo compiling examples + mkdir "$(INTDIR)\classes.ex" + javac -g -d "$(INTDIR)\classes.ex" -classpath "$(INTDIR)\classes;$(INTDIR)\classes.ex" ..\examples_java\src\db\*.java ..\examples_java\src\db\GettingStarted\*.java ..\examples_java\src\db\repquote\*.java ..\examples_java\src\collections\access\*.java ..\examples_java\src\collections\hello\*.java ..\examples_java\src\collections\ship\basic\*.java ..\examples_java\src\collections\ship\entity\*.java ..\examples_java\src\collections\ship\tuple\*.java ..\examples_java\src\collections\ship\sentity\*.java ..\examples_java\src\collections\ship\marshal\*.java ..\examples_java\src\collections\ship\factory\*.java + echo creating jar files + jar cf "$(OUTDIR)/db.jar" -C "$(INTDIR)\classes" . + jar cf "$(OUTDIR)/dbexamples.jar" -C "$(INTDIR)\classes.ex" . + echo Java build finished +# End Custom Build diff --git a/db/build_windows/db_java_xa.dsp b/db/build_windows/db_java_xa.dsp new file mode 100644 index 000000000..9c700ffee --- /dev/null +++ b/db/build_windows/db_java_xa.dsp @@ -0,0 +1,85 @@ +# Microsoft Developer Studio Project File - Name="db_java_xa" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=db_java_xa - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_java_xa.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_java_xa.mak" CFG="db_java_xa - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_java_xa - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "db_java_xa - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "db_java_xa - Win32 Release" + +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Cmd_Line "NMAKE /f db_java_xaj.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "db_java_xaj.exe" +# PROP BASE Bsc_Name "db_java_xaj.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Cmd_Line "NMAKE /f db_java_xaj.mak Release/dbxa.jar" +# PROP Rebuild_Opt "/a" +# PROP Target_File "Release/dbxa.jar" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "db_java_xa - Win32 Debug" + +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Cmd_Line "NMAKE /f db_java_xaj.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "db_java_xaj.exe" +# PROP BASE Bsc_Name "db_java_xaj.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Cmd_Line "NMAKE /f db_java_xaj.mak Debug/dbxa.jar" +# PROP Rebuild_Opt "/a" +# PROP Target_File "Debug/dbxa.jar" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "db_java_xa - Win32 Release" +# Name "db_java_xa - Win32 Debug" + +!IF "$(CFG)" == "db_java_xa - Win32 Release" + +!ELSEIF "$(CFG)" == "db_java_xa - Win32 Debug" + +!ENDIF + +# Begin Source File + +SOURCE=.\db_java_xaj.mak +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_java_xaj.mak b/db/build_windows/db_java_xaj.mak new file mode 100644 index 000000000..c2dbc920d --- /dev/null +++ b/db/build_windows/db_java_xaj.mak @@ -0,0 +1,21 @@ +JAVA_XADIR=../java/src/com/sleepycat/db/xa + +JAVA_XASRCS=\ + $(JAVA_XADIR)/DbXAResource.java \ + $(JAVA_XADIR)/DbXid.java + +Release/dbxa.jar : $(JAVA_XASRCS) + @echo compiling Berkeley DB XA classes + @javac -g -d ./Release/classes -classpath "$(CLASSPATH);./Release/classes" $(JAVA_XASRCS) + @echo creating jar file + @cd .\Release\classes + @jar cf ../dbxa.jar com\sleepycat\db\xa\*.class + @echo Java XA build finished + +Debug/dbxa.jar : $(JAVA_XASRCS) + @echo compiling Berkeley DB XA classes + @javac -g -d ./Debug/classes -classpath "$(CLASSPATH);./Debug/classes" $(JAVA_XASRCS) + @echo creating jar file + @cd .\Debug\classes + @jar cf ../dbxa.jar com\sleepycat\db\xa\*.class + @echo Java XA build finished diff --git a/db/build_windows/db_load.dsp b/db/build_windows/db_load.dsp new file mode 100644 index 000000000..b75c2f83a --- /dev/null +++ b/db/build_windows/db_load.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_load" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_load - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_load.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_load.mak" CFG="db_load - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_load - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_load - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_load - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_load - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_load - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_load - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_load - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_load - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_load - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_load" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_load - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_load" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_load - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_load - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_load - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_load - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_load - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_load - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_load - Win32 Release" +# Name "db_load - Win32 Debug" +# Name "db_load - Win32 ASCII Debug" +# Name "db_load - Win32 ASCII Release" +# Name "db_load - x64 Debug AMD64" +# Name "db_load - x64 Release AMD64" +# Name "db_load - x64 Debug IA64" +# Name "db_load - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_load\db_load.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_perf.dsp b/db/build_windows/db_perf.dsp new file mode 100644 index 000000000..de5dee7af --- /dev/null +++ b/db/build_windows/db_perf.dsp @@ -0,0 +1,332 @@ +# Microsoft Developer Studio Project File - Name="db_perf" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_perf - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_perf.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_perf.mak" CFG="db_perf - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_perf - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_perf - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_perf - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_perf - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_perf - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_perf - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_perf - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_perf - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_perf - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_perf" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_perf" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_perf - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_perf" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_perf" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_perf - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_perf" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_perf" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_perf - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_perf" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_perf" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_perf - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_perf" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_perf" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_perf - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_perf" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_perf" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_perf - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_perf" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_perf" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_perf - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_perf" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_perf" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_perf - Win32 Release" +# Name "db_perf - Win32 Debug" +# Name "db_perf - Win32 ASCII Debug" +# Name "db_perf - Win32 ASCII Release" +# Name "db_perf - x64 Debug AMD64" +# Name "db_perf - x64 Release AMD64" +# Name "db_perf - x64 Debug IA64" +# Name "db_perf - x64 Release IA64" +# Begin Source File + +SOURCE=..\test_perf\db_perf.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_checkpoint.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_config.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_dbs.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_dead.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_debug.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_file.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_key.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_log.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_misc.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_op.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_parse.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_rand.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_spawn.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_stat.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_sync.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_thread.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_trickle.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_txn.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_util.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_printlog.dsp b/db/build_windows/db_printlog.dsp new file mode 100644 index 000000000..d166f676a --- /dev/null +++ b/db/build_windows/db_printlog.dsp @@ -0,0 +1,292 @@ +# Microsoft Developer Studio Project File - Name="db_printlog" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_printlog - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_printlog.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_printlog.mak" CFG="db_printlog - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_printlog - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_printlog - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_printlog - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_printlog - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_printlog - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_printlog - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_printlog - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_printlog - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_printlog - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_printlog" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_printlog" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_printlog - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_printlog" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_printlog" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_printlog - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_printlog" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_printlog" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_printlog - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_printlog" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_printlog" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_printlog - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_printlog" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_printlog" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_printlog - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_printlog" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_printlog" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_printlog - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_printlog" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_printlog" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_printlog - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_printlog" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_printlog" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_printlog - Win32 Release" +# Name "db_printlog - Win32 Debug" +# Name "db_printlog - Win32 ASCII Debug" +# Name "db_printlog - Win32 ASCII Release" +# Name "db_printlog - x64 Debug AMD64" +# Name "db_printlog - x64 Release AMD64" +# Name "db_printlog - x64 Debug IA64" +# Name "db_printlog - x64 Release IA64" +# Begin Source File + +SOURCE=..\btree\btree_autop.c +# End Source File +# Begin Source File + +SOURCE=..\db\crdel_autop.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_autop.c +# End Source File +# Begin Source File + +SOURCE=..\db_printlog\db_printlog.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_autop.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fileops_autop.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_autop.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_autop.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_autop.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_autop.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_recover.dsp b/db/build_windows/db_recover.dsp new file mode 100644 index 000000000..de11c70f0 --- /dev/null +++ b/db/build_windows/db_recover.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_recover" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_recover - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_recover.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_recover.mak" CFG="db_recover - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_recover - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_recover - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_recover - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_recover - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_recover - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_recover - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_recover - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_recover - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_recover - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_recover" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_recover" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_recover - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_recover" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_recover" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_recover - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_recover" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_recover" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_recover - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_recover" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_recover" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_recover - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_recover" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_recover" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_recover - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_recover" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_recover" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_recover - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_recover" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_recover" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_recover - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_recover" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_recover" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_recover - Win32 Release" +# Name "db_recover - Win32 Debug" +# Name "db_recover - Win32 ASCII Debug" +# Name "db_recover - Win32 ASCII Release" +# Name "db_recover - x64 Debug AMD64" +# Name "db_recover - x64 Release AMD64" +# Name "db_recover - x64 Debug IA64" +# Name "db_recover - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_recover\db_recover.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_reptest.dsp b/db/build_windows/db_reptest.dsp new file mode 100644 index 000000000..6b2ecbf89 --- /dev/null +++ b/db/build_windows/db_reptest.dsp @@ -0,0 +1,348 @@ +# Microsoft Developer Studio Project File - Name="db_reptest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_reptest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_reptest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_reptest.mak" CFG="db_reptest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_reptest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_reptest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_reptest - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_reptest - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_reptest - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_reptest - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_reptest - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_reptest - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_reptest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_reptest" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_reptest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_reptest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_reptest" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_reptest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_reptest - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_reptest" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_reptest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_reptest - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_reptest" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_reptest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_reptest - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_reptest" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_reptest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_reptest - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_reptest" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_reptest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_reptest - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_reptest" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_reptest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_reptest - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_reptest" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_reptest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_reptest - Win32 Release" +# Name "db_reptest - Win32 Debug" +# Name "db_reptest - Win32 ASCII Debug" +# Name "db_reptest - Win32 ASCII Release" +# Name "db_reptest - x64 Debug AMD64" +# Name "db_reptest - x64 Release AMD64" +# Name "db_reptest - x64 Debug IA64" +# Name "db_reptest - x64 Release IA64" +# Begin Source File + +SOURCE=..\test_perf\perf_rand.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\db_reptest.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_accept.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_client.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_config.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_dbs.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_debug.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_elect.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_env.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_exec.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_file.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_key.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_master.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_misc.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_msg_thread.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_op.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_parse.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_send.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_site.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_socket.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_spawn.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_thread.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_txn.c +# End Source File +# Begin Source File + +SOURCE=..\test_rep\reptest_util.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_small.dsp b/db/build_windows/db_small.dsp new file mode 100644 index 000000000..d6cdc1e77 --- /dev/null +++ b/db/build_windows/db_small.dsp @@ -0,0 +1,958 @@ +# Microsoft Developer Studio Project File - Name="db_small" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=db_small - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_small.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_small.mak" CFG="db_small - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_small - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "db_small - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "db_small - Win32 ASCII Release" (based on "Win32 (x86) Static Library") +!MESSAGE "db_small - Win32 ASCII Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "db_small - x64 Debug AMD64" (based on "Win32 (x86) Static Library") +!MESSAGE "db_small - x64 Release AMD64" (based on "Win32 (x86) Static Library") +!MESSAGE "db_small - x64 Debug IA64" (based on "Win32 (x86) Static Library") +!MESSAGE "db_small - x64 Release IA64" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_small - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_small" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_small" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Release/libdb_small45s.lib" +# ADD LIB32 /nologo /out:"Release/libdb_small45s.lib" + +!ELSEIF "$(CFG)" == "db_small - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_small" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_small" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Debug/libdb_small45sd.lib" +# ADD LIB32 /nologo /out:"Debug/libdb_small45sd.lib" + +!ELSEIF "$(CFG)" == "db_small - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_small" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_small" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_SMALLBUILD" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Release_ASCII/libdb_small45s.lib" +# ADD LIB32 /nologo /out:"Release_ASCII/libdb_small45s.lib" + +!ELSEIF "$(CFG)" == "db_small - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_small" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_small" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_SMALLBUILD" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Debug_ASCII/libdb_small45sd.lib" +# ADD LIB32 /nologo /out:"Debug_ASCII/libdb_small45sd.lib" + +!ELSEIF "$(CFG)" == "db_small - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug/db_small" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_small" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /Wp64 /FD /Wp64 /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Debug_AMD64/libdb_small45sd.lib" +# ADD LIB32 /nologo /out:"Debug_AMD64/libdb_small45sd.lib" + +!ELSEIF "$(CFG)" == "db_small - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_small" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_small" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /Wp64 /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Release_AMD64/libdb_small45s.lib" +# ADD LIB32 /nologo /out:"Release_AMD64/libdb_small45s.lib" + +!ELSEIF "$(CFG)" == "db_small - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_small" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_small" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /Wp64 /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Debug_IA64/libdb_small45sd.lib" +# ADD LIB32 /nologo /out:"Debug_IA64/libdb_small45sd.lib" + +!ELSEIF "$(CFG)" == "db_small - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_small" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_small" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "HAVE_SMALLBUILD" /Wp64 /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Release_IA64/libdb_small45s.lib" +# ADD LIB32 /nologo /out:"Release_IA64/libdb_small45s.lib" + +!ENDIF + +# Begin Target + +# Name "db_small - Win32 Release" +# Name "db_small - Win32 Debug" +# Name "db_small - Win32 ASCII Release" +# Name "db_small - Win32 ASCII Debug" +# Name "db_small - x64 Debug AMD64" +# Name "db_small - x64 Release AMD64" +# Name "db_small - x64 Debug IA64" +# Name "db_small - x64 Release IA64" +# Begin Source File + +SOURCE=..\btree\bt_compact.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_compare.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_conv.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_curadj.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_cursor.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_delete.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_method.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_open.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_put.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_rec.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_reclaim.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_recno.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_rsearch.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_search.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_split.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_stat.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_upgrade.c +# End Source File +# Begin Source File + +SOURCE=..\btree\btree_auto.c +# End Source File +# Begin Source File + +SOURCE=..\clib\ctime.c +# End Source File +# Begin Source File + +SOURCE=..\clib\strcasecmp.c +# End Source File +# Begin Source File + +SOURCE=..\clib\strsep.c +# End Source File +# Begin Source File + +SOURCE=..\common\crypto_stub.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_byteorder.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_err.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_getlong.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_idspace.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_log2.c +# End Source File +# Begin Source File + +SOURCE=..\common\mkpath.c +# End Source File +# Begin Source File + +SOURCE=..\common\util_cache.c +# End Source File +# Begin Source File + +SOURCE=..\common\util_log.c +# End Source File +# Begin Source File + +SOURCE=..\common\util_sig.c +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_db.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_dbc.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_dbt.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_env.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_except.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_lock.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_logc.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_mpool.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_multi.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_seq.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_txn.cpp +# End Source File +# Begin Source File + +SOURCE=..\db\crdel_auto.c +# End Source File +# Begin Source File + +SOURCE=..\db\crdel_rec.c +# End Source File +# Begin Source File + +SOURCE=..\db\db.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_am.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_auto.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_cam.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_cds.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_conv.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_dispatch.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_dup.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_iface.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_join.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_meta.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_method.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_open.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_overflow.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_pr.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_rec.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_reclaim.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_remove.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_rename.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_ret.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_setid.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_setlsn.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_stati.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_truncate.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_upg.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_upg_opd.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_vrfy_stub.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_auto.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_rec.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_stat.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_util.c +# End Source File +# Begin Source File + +SOURCE=..\env\db_salloc.c +# End Source File +# Begin Source File + +SOURCE=..\env\db_shash.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_config.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_file.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_method.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_open.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_recover.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_region.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_register.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_stat.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fileops_auto.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fop_basic.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fop_rec.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fop_util.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_func.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_stub.c +# End Source File +# Begin Source File + +SOURCE=..\hmac\hmac.c +# End Source File +# Begin Source File + +SOURCE=..\hmac\sha1.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_deadlock.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_id.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_list.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_method.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_region.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_stat.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_timer.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_util.c +# End Source File +# Begin Source File + +SOURCE=..\log\log.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_archive.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_compare.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_debug.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_get.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_method.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_put.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_stat.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_alloc.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_bh.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fget.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fmethod.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fopen.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fput.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fset.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_method.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_mvcc.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_region.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_register.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_stat.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_sync.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_trickle.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_alloc.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_method.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_region.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_stat.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_win32.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_alloc.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_fzero.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_mkdir.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_oflags.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_pid.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_region.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_root.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_rpath.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_tmpdir.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_uid.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_abs.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_clock.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_config.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_dir.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_errno.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_fid.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_flock.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_fsync.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_getenv.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_handle.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_map.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_open.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_rename.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_rw.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_seek.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_sleep.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_spin.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_stat.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_truncate.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_unlink.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_yield.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_stub.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_stub.c +# End Source File +# Begin Source File + +SOURCE=..\sequence\seq_stat.c +# End Source File +# Begin Source File + +SOURCE=..\sequence\sequence.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_auto.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_chkpt.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_method.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_rec.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_recover.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_region.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_stat.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_util.c +# End Source File +# Begin Source File + +SOURCE=..\xa\xa.c +# End Source File +# Begin Source File + +SOURCE=..\xa\xa_db.c +# End Source File +# Begin Source File + +SOURCE=..\xa\xa_map.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_stat.dsp b/db/build_windows/db_stat.dsp new file mode 100644 index 000000000..fc806e9ed --- /dev/null +++ b/db/build_windows/db_stat.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_stat" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_stat - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_stat.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_stat.mak" CFG="db_stat - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_stat - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_stat - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_stat - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_stat - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_stat - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_stat - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_stat - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_stat - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_stat - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_stat" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_stat" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_stat - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_stat" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_stat" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_stat - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_stat" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_stat" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_stat - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_stat" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_stat" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_stat - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_stat" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_stat" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_stat - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_stat" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_stat" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_stat - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_stat" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_stat" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_stat - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_stat" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_stat" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_stat - Win32 Release" +# Name "db_stat - Win32 Debug" +# Name "db_stat - Win32 ASCII Debug" +# Name "db_stat - Win32 ASCII Release" +# Name "db_stat - x64 Debug AMD64" +# Name "db_stat - x64 Release AMD64" +# Name "db_stat - x64 Debug IA64" +# Name "db_stat - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_stat\db_stat.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_static.dsp b/db/build_windows/db_static.dsp new file mode 100644 index 000000000..df640f47c --- /dev/null +++ b/db/build_windows/db_static.dsp @@ -0,0 +1,1158 @@ +# Microsoft Developer Studio Project File - Name="db_static" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=db_static - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_static.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_static.mak" CFG="db_static - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_static - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "db_static - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "db_static - Win32 ASCII Release" (based on "Win32 (x86) Static Library") +!MESSAGE "db_static - Win32 ASCII Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "db_static - x64 Debug AMD64" (based on "Win32 (x86) Static Library") +!MESSAGE "db_static - x64 Release AMD64" (based on "Win32 (x86) Static Library") +!MESSAGE "db_static - x64 Debug IA64" (based on "Win32 (x86) Static Library") +!MESSAGE "db_static - x64 Release IA64" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_static - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_static" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Release/libdb45s.lib" +# ADD LIB32 /nologo /out:"Release/libdb45s.lib" + +!ELSEIF "$(CFG)" == "db_static - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_static" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Debug/libdb45sd.lib" +# ADD LIB32 /nologo /out:"Debug/libdb45sd.lib" + +!ELSEIF "$(CFG)" == "db_static - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_static" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Release_ASCII/libdb45s.lib" +# ADD LIB32 /nologo /out:"Release_ASCII/libdb45s.lib" + +!ELSEIF "$(CFG)" == "db_static - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_static" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Debug_ASCII/libdb45sd.lib" +# ADD LIB32 /nologo /out:"Debug_ASCII/libdb45sd.lib" + +!ELSEIF "$(CFG)" == "db_static - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug/db_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_static" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Wp64 /FD /Wp64 /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Debug_AMD64/libdb45sd.lib" +# ADD LIB32 /nologo /out:"Debug_AMD64/libdb45sd.lib" + +!ELSEIF "$(CFG)" == "db_static - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_static" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Release_AMD64/libdb45s.lib" +# ADD LIB32 /nologo /out:"Release_AMD64/libdb45s.lib" + +!ELSEIF "$(CFG)" == "db_static - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_static" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Debug_IA64/libdb45sd.lib" +# ADD LIB32 /nologo /out:"Debug_IA64/libdb45sd.lib" + +!ELSEIF "$(CFG)" == "db_static - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_static" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Wp64 /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"Release_IA64/libdb45s.lib" +# ADD LIB32 /nologo /out:"Release_IA64/libdb45s.lib" + +!ENDIF + +# Begin Target + +# Name "db_static - Win32 Release" +# Name "db_static - Win32 Debug" +# Name "db_static - Win32 ASCII Release" +# Name "db_static - Win32 ASCII Debug" +# Name "db_static - x64 Debug AMD64" +# Name "db_static - x64 Release AMD64" +# Name "db_static - x64 Debug IA64" +# Name "db_static - x64 Release IA64" +# Begin Source File + +SOURCE=..\btree\bt_compact.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_compare.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_conv.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_curadj.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_cursor.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_delete.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_method.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_open.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_put.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_rec.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_reclaim.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_recno.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_rsearch.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_search.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_split.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_stat.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_upgrade.c +# End Source File +# Begin Source File + +SOURCE=..\btree\bt_verify.c +# End Source File +# Begin Source File + +SOURCE=..\btree\btree_auto.c +# End Source File +# Begin Source File + +SOURCE=..\clib\ctime.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getaddrinfo.c +# End Source File +# Begin Source File + +SOURCE=..\clib\strcasecmp.c +# End Source File +# Begin Source File + +SOURCE=..\clib\strsep.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_byteorder.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_clock.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_err.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_getlong.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_idspace.c +# End Source File +# Begin Source File + +SOURCE=..\common\db_log2.c +# End Source File +# Begin Source File + +SOURCE=..\common\mkpath.c +# End Source File +# Begin Source File + +SOURCE=..\common\util_cache.c +# End Source File +# Begin Source File + +SOURCE=..\common\util_log.c +# End Source File +# Begin Source File + +SOURCE=..\common\util_sig.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\aes_method.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\crypto.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\mersenne\mt19937db.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\rijndael\rijndael-alg-fst.c +# End Source File +# Begin Source File + +SOURCE=..\crypto\rijndael\rijndael-api-fst.c +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_db.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_dbc.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_dbt.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_env.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_except.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_lock.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_logc.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_mpool.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_multi.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_seq.cpp +# End Source File +# Begin Source File + +SOURCE=..\cxx\cxx_txn.cpp +# End Source File +# Begin Source File + +SOURCE=..\db\crdel_auto.c +# End Source File +# Begin Source File + +SOURCE=..\db\crdel_rec.c +# End Source File +# Begin Source File + +SOURCE=..\db\db.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_am.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_auto.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_cam.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_cds.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_conv.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_dispatch.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_dup.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_iface.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_join.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_meta.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_method.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_open.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_overflow.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_ovfl_vrfy.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_pr.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_rec.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_reclaim.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_remove.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_rename.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_ret.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_setid.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_setlsn.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_stati.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_truncate.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_upg.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_upg_opd.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_vrfy.c +# End Source File +# Begin Source File + +SOURCE=..\db\db_vrfyutil.c +# End Source File +# Begin Source File + +SOURCE=..\dbm\dbm.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_auto.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_rec.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_stat.c +# End Source File +# Begin Source File + +SOURCE=..\dbreg\dbreg_util.c +# End Source File +# Begin Source File + +SOURCE=..\env\db_salloc.c +# End Source File +# Begin Source File + +SOURCE=..\env\db_shash.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_config.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_file.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_method.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_open.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_recover.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_region.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_register.c +# End Source File +# Begin Source File + +SOURCE=..\env\env_stat.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fileops_auto.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fop_basic.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fop_rec.c +# End Source File +# Begin Source File + +SOURCE=..\fileops\fop_util.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_auto.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_conv.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_dup.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_func.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_meta.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_method.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_open.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_page.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_rec.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_reclaim.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_stat.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_upgrade.c +# End Source File +# Begin Source File + +SOURCE=..\hash\hash_verify.c +# End Source File +# Begin Source File + +SOURCE=..\hmac\hmac.c +# End Source File +# Begin Source File + +SOURCE=..\hmac\sha1.c +# End Source File +# Begin Source File + +SOURCE=..\hsearch\hsearch.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_deadlock.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_id.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_list.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_method.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_region.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_stat.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_timer.c +# End Source File +# Begin Source File + +SOURCE=..\lock\lock_util.c +# End Source File +# Begin Source File + +SOURCE=..\log\log.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_archive.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_compare.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_debug.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_get.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_method.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_put.c +# End Source File +# Begin Source File + +SOURCE=..\log\log_stat.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_alloc.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_bh.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fget.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fmethod.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fopen.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fput.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_fset.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_method.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_mvcc.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_region.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_register.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_stat.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_sync.c +# End Source File +# Begin Source File + +SOURCE=..\mp\mp_trickle.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_alloc.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_method.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_region.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_stat.c +# End Source File +# Begin Source File + +SOURCE=..\mutex\mut_win32.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_alloc.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_fzero.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_mkdir.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_oflags.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_pid.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_region.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_root.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_rpath.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_tmpdir.c +# End Source File +# Begin Source File + +SOURCE=..\os\os_uid.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_abs.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_clock.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_config.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_dir.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_errno.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_fid.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_flock.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_fsync.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_getenv.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_handle.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_map.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_open.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_rename.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_rw.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_seek.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_sleep.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_spin.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_stat.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_truncate.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_unlink.c +# End Source File +# Begin Source File + +SOURCE=..\os_windows\os_yield.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_auto.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_conv.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_files.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_method.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_open.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_rec.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_stat.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_upgrade.c +# End Source File +# Begin Source File + +SOURCE=..\qam\qam_verify.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_auto.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_backup.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_elect.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_log.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_method.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_record.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_region.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_stat.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_util.c +# End Source File +# Begin Source File + +SOURCE=..\rep\rep_verify.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_elect.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_method.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_msg.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_net.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_queue.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_sel.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_stat.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_util.c +# End Source File +# Begin Source File + +SOURCE=..\repmgr\repmgr_windows.c +# End Source File +# Begin Source File + +SOURCE=..\sequence\seq_stat.c +# End Source File +# Begin Source File + +SOURCE=..\sequence\sequence.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_auto.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_chkpt.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_failchk.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_method.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_rec.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_recover.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_region.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_stat.c +# End Source File +# Begin Source File + +SOURCE=..\txn\txn_util.c +# End Source File +# Begin Source File + +SOURCE=..\xa\xa.c +# End Source File +# Begin Source File + +SOURCE=..\xa\xa_db.c +# End Source File +# Begin Source File + +SOURCE=..\xa\xa_map.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_tcl.dsp b/db/build_windows/db_tcl.dsp new file mode 100644 index 000000000..82c02fffe --- /dev/null +++ b/db/build_windows/db_tcl.dsp @@ -0,0 +1,328 @@ +# Microsoft Developer Studio Project File - Name="db_tcl" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=db_tcl - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_tcl.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_tcl.mak" CFG="db_tcl - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_tcl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_tcl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_tcl - Win32 ASCII Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_tcl - Win32 ASCII Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_tcl - x64 Debug AMD64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_tcl - x64 Release AMD64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_tcl - x64 Debug IA64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db_tcl - x64 Release IA64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_tcl - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_tcl" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_tcl" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib tcl84.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 libdb45.lib tcl84.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb_tcl45.dll" /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_tcl - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_tcl" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_tcl" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib tcl84g.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib tcl84g.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /pdb:none /debug /machine:I386 /out:"Debug/libdb_tcl45d.dll" /fixed:no /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_tcl - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_tcl" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_tcl" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DB_TCL_SUPPORT" /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DB_TCL_SUPPORT" /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib tcl84g.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug_ASCII/libdb_tcl45d.dll" /fixed:no +# ADD LINK32 libdb45d.lib tcl84g.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /pdb:none /debug /machine:I386 /out:"Debug_ASCII/libdb_tcl45d.dll" /fixed:no /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_tcl - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_tcl" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_tcl" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "DB_TCL_SUPPORT" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "DB_TCL_SUPPORT" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib tcl84.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release_ASCII/libdb_tcl45.dll" +# ADD LINK32 libdb45.lib tcl84.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release_ASCII/libdb_tcl45.dll" /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_tcl - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_tcl" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_tcl" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /FD /Wp64 /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib tcl84g.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /debug /machine:AMD64 /out:"Debug_AMD64/libdb_tcl45d.dll" /fixed:no +# ADD LINK32 libdb45d.lib tcl84g.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /debug /machine:AMD64 /out:"Debug_AMD64/libdb_tcl45d.dll" /fixed:no /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_tcl - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_tcl" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_tcl" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /Wp64 /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib tcl84.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:AMD64 /out:"Release_AMD64/libdb_tcl45.dll" +# ADD LINK32 libdb45.lib tcl84.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:AMD64 /out:"Release_AMD64/libdb_tcl45.dll" /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_tcl - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_tcl" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_tcl" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /Wp64 /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /Wp64 /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib tcl84g.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /debug /machine:IA64 /out:"Debug_IA64/libdb_tcl45d.dll" /fixed:no +# ADD LINK32 libdb45d.lib tcl84g.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /debug /machine:IA64 /out:"Debug_IA64/libdb_tcl45d.dll" /fixed:no /libpath:"$(OUTDIR)" + +!ELSEIF "$(CFG)" == "db_tcl - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_tcl" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_tcl" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_TCL_SUPPORT" /Wp64 /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib tcl84.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:IA64 /out:"Release_IA64/libdb_tcl45.dll" +# ADD LINK32 libdb45.lib tcl84.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:IA64 /out:"Release_IA64/libdb_tcl45.dll" /libpath:"$(OUTDIR)" + +!ENDIF + +# Begin Target + +# Name "db_tcl - Win32 Release" +# Name "db_tcl - Win32 Debug" +# Name "db_tcl - Win32 ASCII Debug" +# Name "db_tcl - Win32 ASCII Release" +# Name "db_tcl - x64 Debug AMD64" +# Name "db_tcl - x64 Release AMD64" +# Name "db_tcl - x64 Debug IA64" +# Name "db_tcl - x64 Release IA64" +# Begin Source File + +SOURCE=.\libdb_tcl.def +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_compat.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_db.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_db_pkg.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_dbcursor.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_env.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_internal.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_lock.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_log.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_mp.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_rep.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_seq.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_txn.c +# End Source File +# Begin Source File + +SOURCE=..\tcl\tcl_util.c +# End Source File + +# End Target +# End Project diff --git a/db/build_windows/db_test.dsp b/db/build_windows/db_test.dsp new file mode 100644 index 000000000..eff4cf7e5 --- /dev/null +++ b/db/build_windows/db_test.dsp @@ -0,0 +1,296 @@ +# Microsoft Developer Studio Project File - Name="db_test" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_test - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_test.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_test.mak" CFG="db_test - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_test - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_test - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_test - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_test - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_test - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_test - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_test - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_test - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_test - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_test" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_test" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /out:"dbkill.exe" kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib /out:"dbkill.exe" kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy $(OUTDIR)\*.exe . copy $(OUTDIR)\*.dll . +# End Special Build Tool + +!ELSEIF "$(CFG)" == "db_test - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_test" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_test" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /out:"dbkill.exe" kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib /out:"dbkill.exe" kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy $(OUTDIR)\*.exe . copy $(OUTDIR)\*.dll . +# End Special Build Tool + +!ELSEIF "$(CFG)" == "db_test - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_test" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_test" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib /out:"dbkill.exe" kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib /out:"dbkill.exe" kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy $(OUTDIR)\*.exe . copy $(OUTDIR)\*.dll . +# End Special Build Tool + +!ELSEIF "$(CFG)" == "db_test - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_test" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_test" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib /out:"dbkill.exe" kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib /out:"dbkill.exe" kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy $(OUTDIR)\*.exe . copy $(OUTDIR)\*.dll . +# End Special Build Tool + +!ELSEIF "$(CFG)" == "db_test - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_test" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_test" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib /out:"dbkill.exe" bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib /out:"dbkill.exe" bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy $(OUTDIR)\*.exe . copy $(OUTDIR)\*.dll . +# End Special Build Tool + +!ELSEIF "$(CFG)" == "db_test - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_test" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_test" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib /out:"dbkill.exe" bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib /out:"dbkill.exe" bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy $(OUTDIR)\*.exe . copy $(OUTDIR)\*.dll . +# End Special Build Tool + +!ELSEIF "$(CFG)" == "db_test - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_test" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_test" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib /out:"dbkill.exe" bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib /out:"dbkill.exe" bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy $(OUTDIR)\*.exe . copy $(OUTDIR)\*.dll . +# End Special Build Tool + +!ELSEIF "$(CFG)" == "db_test - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_test" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_test" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib /out:"dbkill.exe" bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib /out:"dbkill.exe" bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy $(OUTDIR)\*.exe . copy $(OUTDIR)\*.dll . +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "db_test - Win32 Release" +# Name "db_test - Win32 Debug" +# Name "db_test - Win32 ASCII Debug" +# Name "db_test - Win32 ASCII Release" +# Name "db_test - x64 Debug AMD64" +# Name "db_test - x64 Release AMD64" +# Name "db_test - x64 Debug IA64" +# Name "db_test - x64 Release IA64" +# Begin Source File + +SOURCE=.\dbkill.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_test.dsp.postbuild b/db/build_windows/db_test.dsp.postbuild new file mode 100644 index 000000000..fafaa1825 --- /dev/null +++ b/db/build_windows/db_test.dsp.postbuild @@ -0,0 +1,5 @@ +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy $(OUTDIR)\*.exe . copy $(OUTDIR)\*.dll . +# End Special Build Tool diff --git a/db/build_windows/db_upgrade.dsp b/db/build_windows/db_upgrade.dsp new file mode 100644 index 000000000..e2cd5ac4e --- /dev/null +++ b/db/build_windows/db_upgrade.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_upgrade" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_upgrade - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_upgrade.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_upgrade.mak" CFG="db_upgrade - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_upgrade - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_upgrade - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_upgrade - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_upgrade - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_upgrade - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_upgrade - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_upgrade - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_upgrade - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_upgrade - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_upgrade" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_upgrade" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_upgrade - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_upgrade" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_upgrade" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_upgrade - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_upgrade" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_upgrade" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_upgrade - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_upgrade" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_upgrade" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_upgrade - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_upgrade" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_upgrade" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_upgrade - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_upgrade" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_upgrade" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_upgrade - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_upgrade" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_upgrade" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_upgrade - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_upgrade" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_upgrade" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_upgrade - Win32 Release" +# Name "db_upgrade - Win32 Debug" +# Name "db_upgrade - Win32 ASCII Debug" +# Name "db_upgrade - Win32 ASCII Release" +# Name "db_upgrade - x64 Debug AMD64" +# Name "db_upgrade - x64 Release AMD64" +# Name "db_upgrade - x64 Debug IA64" +# Name "db_upgrade - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_upgrade\db_upgrade.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/db_verify.dsp b/db/build_windows/db_verify.dsp new file mode 100644 index 000000000..f084bc9a2 --- /dev/null +++ b/db/build_windows/db_verify.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="db_verify" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=db_verify - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db_verify.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db_verify.mak" CFG="db_verify - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_verify - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_verify - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_verify - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "db_verify - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "db_verify - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_verify - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_verify - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "db_verify - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db_verify - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/db_verify" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/db_verify" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "db_verify - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/db_verify" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/db_verify" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "db_verify - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/db_verify" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/db_verify" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "db_verify - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/db_verify" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/db_verify" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "db_verify - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/db_verify" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/db_verify" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "db_verify - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/db_verify" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/db_verify" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "db_verify - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/db_verify" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/db_verify" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "db_verify - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/db_verify" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/db_verify" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "db_verify - Win32 Release" +# Name "db_verify - Win32 Debug" +# Name "db_verify - Win32 ASCII Debug" +# Name "db_verify - Win32 ASCII Release" +# Name "db_verify - x64 Debug AMD64" +# Name "db_verify - x64 Release AMD64" +# Name "db_verify - x64 Debug IA64" +# Name "db_verify - x64 Release IA64" +# Begin Source File + +SOURCE=..\db_verify\db_verify.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/dbkill.cpp b/db/build_windows/dbkill.cpp new file mode 100644 index 000000000..b186bde42 --- /dev/null +++ b/db/build_windows/dbkill.cpp @@ -0,0 +1,131 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1999-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: dbkill.cpp,v 12.4 2006/08/24 14:45:08 bostic Exp $ + */ +/* + * Kill - + * Simulate Unix kill on Windows/NT and Windows/9X. + * This good enough to support the Berkeley DB test suite, + * but may be missing some favorite features. + * + * Would have used MKS kill, but it didn't seem to work well + * on Win/9X. Cygnus kill works within the Gnu/Cygnus environment + * (where processes are given small pids, with presumably a translation + * table between small pids and actual process handles), but our test + * environment, via Tcl, does not use the Cygnus environment. + * + * Compile this and install it as c:/tools/kill.exe (or as indicated + * by build_windows/include.tcl ). + */ + +#include +#include +#include +#include + +/* + * Like atol, with specified base. Would use stdlib, but + * strtol("0xFFFF1234", NULL, 16) returns 0x7FFFFFFF and + * strtol("4294712487", NULL, 16) returns 0x7FFFFFFF w/ VC++ + */ +long +myatol(char *s, int base) +{ + long result = 0; + char ch; + int sign = 1; /* + */ + if (base == 0) + base = 10; + if (base != 10 && base != 16) + return LONG_MAX; + while ((ch = *s++) != '\0') { + if (ch == '-') { + sign = -sign; + } + else if (ch >= '0' && ch <= '9') { + result = result * base + (ch - '0'); + } + else if (ch == 'x' || ch == 'X') { + /* Allow leading 0x..., and switch to base 16 */ + base = 16; + } + else if (base == 16 && ch >= 'a' && ch <= 'f') { + result = result * base + (ch - 'a' + 10); + } + else if (base == 16 && ch >= 'A' && ch <= 'F') { + result = result * base + (ch - 'A' + 10); + } + else { + if (sign > 1) + return LONG_MAX; + else + return LONG_MIN; + } + } + return sign * result; +} + +void +usage_exit() +{ + fprintf(stderr, "Usage: kill [ -sig ] pid\n"); + fprintf(stderr, " for win32, sig must be or 0, 15 (TERM)\n"); + exit(EXIT_FAILURE); +} + +int +main(int argc, char **argv) +{ + HANDLE hProcess ; + DWORD accessflag; + long pid; + int sig = 15; + + if (argc > 2) { + if (argv[1][0] != '-') + usage_exit(); + + if (strcmp(argv[1], "-TERM") == 0) + sig = 15; + else { + /* currently sig is more or less ignored, + * we only care if it is zero or not + */ + sig = atoi(&argv[1][1]); + if (sig < 0) + usage_exit(); + } + argc--; + argv++; + } + if (argc < 2) + usage_exit(); + + pid = myatol(argv[1], 10); + /*printf("pid = %ld (0x%lx) (command line %s)\n", pid, pid, argv[1]);*/ + if (pid == LONG_MAX || pid == LONG_MIN) + usage_exit(); + + if (sig == 0) + accessflag = PROCESS_QUERY_INFORMATION | PROCESS_VM_READ; + else + accessflag = STANDARD_RIGHTS_REQUIRED | PROCESS_TERMINATE; + hProcess = OpenProcess(accessflag, FALSE, pid); + if (hProcess == NULL) { + fprintf(stderr, "dbkill: %s: no such process\n", argv[1]); + exit(EXIT_FAILURE); + } + if (sig == 0) + exit(EXIT_SUCCESS); + if (!TerminateProcess(hProcess, 99)) { + DWORD err = GetLastError(); + fprintf(stderr, + "dbkill: cannot kill process: error %d (0x%lx)\n", err, err); + exit(EXIT_FAILURE); + } + return EXIT_SUCCESS; +} diff --git a/db/build_windows/dynamic_dsp.src b/db/build_windows/dynamic_dsp.src new file mode 100644 index 000000000..fb6862cb7 --- /dev/null +++ b/db/build_windows/dynamic_dsp.src @@ -0,0 +1,281 @@ +# Microsoft Developer Studio Project File - Name="@project_name@" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=@project_name@ - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "@project_name@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "@project_name@.mak" CFG="@project_name@ - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "@project_name@ - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "@project_name@ - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "@project_name@ - Win32 ASCII Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "@project_name@ - Win32 ASCII Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "@project_name@ - x64 Debug AMD64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "@project_name@ - x64 Release AMD64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "@project_name@ - x64 Debug IA64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "@project_name@ - x64 Release IA64" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "@project_name@ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@lib_rel_dest@" +# PROP BASE Intermediate_Dir "Release/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@lib_rel_dest@" +# PROP Intermediate_Dir "Release/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @release_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 @release_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"@bin_rel_dest@/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" /libpath:"$(OUTDIR)" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@lib_debug_dest@" +# PROP BASE Intermediate_Dir "Debug/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@lib_debug_dest@" +# PROP Intermediate_Dir "Debug/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @debug_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 @debug_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /pdb:none /debug /machine:I386 /out:"@bin_debug_dest@/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no /libpath:"$(OUTDIR)" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@lib_debug_dest@_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@lib_debug_dest@_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" @extra_cppflags@ /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" @extra_cppflags@ /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @debug_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"@bin_debug_dest@_ASCII/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no +# ADD LINK32 @debug_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /pdb:none /debug /machine:I386 /out:"@bin_debug_dest@_ASCII/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no /libpath:"$(OUTDIR)" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@lib_rel_dest@_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@lib_rel_dest@_ASCII" +# PROP Intermediate_Dir "Release_ASCII/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" @extra_cppflags@ /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" @extra_cppflags@ /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @release_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"@bin_rel_dest@_ASCII/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" +# ADD LINK32 @release_libs@ kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"@bin_rel_dest@_ASCII/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" /libpath:"$(OUTDIR)" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@lib_debug_dest@_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@lib_debug_dest@_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /Wp64 /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @debug_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /debug /machine:AMD64 /out:"@bin_debug_dest@_AMD64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no +# ADD LINK32 @debug_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /debug /machine:AMD64 /out:"@bin_debug_dest@_AMD64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no /libpath:"$(OUTDIR)" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@lib_rel_dest@_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@lib_rel_dest@_AMD64" +# PROP Intermediate_Dir "Release_AMD64/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @release_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:AMD64 /out:"@bin_rel_dest@_AMD64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" +# ADD LINK32 @release_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:AMD64 /out:"@bin_rel_dest@_AMD64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" /libpath:"$(OUTDIR)" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@lib_debug_dest@_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@lib_debug_dest@_IA64" +# PROP Intermediate_Dir "Debug_IA64/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "DIAGNOSTIC" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @debug_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /debug /machine:IA64 /out:"@bin_debug_dest@_IA64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no +# ADD LINK32 @debug_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /export:__db_assert /debug /machine:IA64 /out:"@bin_debug_dest@_IA64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no /libpath:"$(OUTDIR)" +@POST_BUILD@ + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@lib_rel_dest@_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/@project_name@" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@lib_rel_dest@_IA64" +# PROP Intermediate_Dir "Release_IA64/@project_name@" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /Ob2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 @release_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:IA64 /out:"@bin_rel_dest@_IA64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" +# ADD LINK32 @release_libs@ bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:IA64 /out:"@bin_rel_dest@_IA64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" /libpath:"$(OUTDIR)" +@POST_BUILD@ + +!ENDIF + +# Begin Target + +# Name "@project_name@ - Win32 Release" +# Name "@project_name@ - Win32 Debug" +# Name "@project_name@ - Win32 ASCII Debug" +# Name "@project_name@ - Win32 ASCII Release" +# Name "@project_name@ - x64 Debug AMD64" +# Name "@project_name@ - x64 Release AMD64" +# Name "@project_name@ - x64 Debug IA64" +# Name "@project_name@ - x64 Release IA64" +@SOURCE_FILES@ + +# End Target +# End Project diff --git a/db/build_windows/ex_access.dsp b/db/build_windows/ex_access.dsp new file mode 100644 index 000000000..b6fa3cd77 --- /dev/null +++ b/db/build_windows/ex_access.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="ex_access" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_access - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_access.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_access.mak" CFG="ex_access - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_access - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_access - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_access - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_access - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_access - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_access - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_access - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_access - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_access - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_access" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_access - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_access" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_access - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_access - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_access - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_access - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_access - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_access - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_access - Win32 Release" +# Name "ex_access - Win32 Debug" +# Name "ex_access - Win32 ASCII Debug" +# Name "ex_access - Win32 ASCII Release" +# Name "ex_access - x64 Debug AMD64" +# Name "ex_access - x64 Release AMD64" +# Name "ex_access - x64 Debug IA64" +# Name "ex_access - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\ex_access.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_btrec.dsp b/db/build_windows/ex_btrec.dsp new file mode 100644 index 000000000..7d31080f9 --- /dev/null +++ b/db/build_windows/ex_btrec.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="ex_btrec" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_btrec - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_btrec.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_btrec.mak" CFG="ex_btrec - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_btrec - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_btrec - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_btrec - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_btrec - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_btrec - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_btrec - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_btrec - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_btrec - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_btrec - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_btrec" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_btrec - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_btrec" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_btrec - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_btrec - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_btrec - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_btrec - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_btrec - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_btrec - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_btrec - Win32 Release" +# Name "ex_btrec - Win32 Debug" +# Name "ex_btrec - Win32 ASCII Debug" +# Name "ex_btrec - Win32 ASCII Release" +# Name "ex_btrec - x64 Debug AMD64" +# Name "ex_btrec - x64 Release AMD64" +# Name "ex_btrec - x64 Debug IA64" +# Name "ex_btrec - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\ex_btrec.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_csvcode.dsp b/db/build_windows/ex_csvcode.dsp new file mode 100644 index 000000000..43b083696 --- /dev/null +++ b/db/build_windows/ex_csvcode.dsp @@ -0,0 +1,296 @@ +# Microsoft Developer Studio Project File - Name="ex_csvcode" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_csvcode - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_csvcode.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_csvcode.mak" CFG="ex_csvcode - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_csvcode - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvcode - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvcode - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvcode - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvcode - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvcode - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvcode - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvcode - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_csvcode - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_csvcode" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_csvcode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Generate csv_local.c +PostBuild_Cmds=$(OUTDIR)\ex_csvcode.exe -c ../examples_c/csv/csv_local.c -h ../examples_c/csv/csv_local.h -f ../examples_c/csv/sample.desc +# End Special Build Tool + +!ELSEIF "$(CFG)" == "ex_csvcode - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_csvcode" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_csvcode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Generate csv_local.c +PostBuild_Cmds=$(OUTDIR)\ex_csvcode.exe -c ../examples_c/csv/csv_local.c -h ../examples_c/csv/csv_local.h -f ../examples_c/csv/sample.desc +# End Special Build Tool + +!ELSEIF "$(CFG)" == "ex_csvcode - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_csvcode" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_csvcode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Generate csv_local.c +PostBuild_Cmds=$(OUTDIR)\ex_csvcode.exe -c ../examples_c/csv/csv_local.c -h ../examples_c/csv/csv_local.h -f ../examples_c/csv/sample.desc +# End Special Build Tool + +!ELSEIF "$(CFG)" == "ex_csvcode - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_csvcode" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_csvcode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Generate csv_local.c +PostBuild_Cmds=$(OUTDIR)\ex_csvcode.exe -c ../examples_c/csv/csv_local.c -h ../examples_c/csv/csv_local.h -f ../examples_c/csv/sample.desc +# End Special Build Tool + +!ELSEIF "$(CFG)" == "ex_csvcode - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_csvcode" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_csvcode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Generate csv_local.c +PostBuild_Cmds=$(OUTDIR)\ex_csvcode.exe -c ../examples_c/csv/csv_local.c -h ../examples_c/csv/csv_local.h -f ../examples_c/csv/sample.desc +# End Special Build Tool + +!ELSEIF "$(CFG)" == "ex_csvcode - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_csvcode" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_csvcode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Generate csv_local.c +PostBuild_Cmds=$(OUTDIR)\ex_csvcode.exe -c ../examples_c/csv/csv_local.c -h ../examples_c/csv/csv_local.h -f ../examples_c/csv/sample.desc +# End Special Build Tool + +!ELSEIF "$(CFG)" == "ex_csvcode - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_csvcode" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_csvcode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Generate csv_local.c +PostBuild_Cmds=$(OUTDIR)\ex_csvcode.exe -c ../examples_c/csv/csv_local.c -h ../examples_c/csv/csv_local.h -f ../examples_c/csv/sample.desc +# End Special Build Tool + +!ELSEIF "$(CFG)" == "ex_csvcode - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_csvcode" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_csvcode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Generate csv_local.c +PostBuild_Cmds=$(OUTDIR)\ex_csvcode.exe -c ../examples_c/csv/csv_local.c -h ../examples_c/csv/csv_local.h -f ../examples_c/csv/sample.desc +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "ex_csvcode - Win32 Release" +# Name "ex_csvcode - Win32 Debug" +# Name "ex_csvcode - Win32 ASCII Debug" +# Name "ex_csvcode - Win32 ASCII Release" +# Name "ex_csvcode - x64 Debug AMD64" +# Name "ex_csvcode - x64 Release AMD64" +# Name "ex_csvcode - x64 Debug IA64" +# Name "ex_csvcode - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\csv\code.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_csvcode.dsp.postbuild b/db/build_windows/ex_csvcode.dsp.postbuild new file mode 100644 index 000000000..d9c9877ca --- /dev/null +++ b/db/build_windows/ex_csvcode.dsp.postbuild @@ -0,0 +1,5 @@ +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Generate csv_local.c +PostBuild_Cmds=$(OUTDIR)\ex_csvcode.exe -c ../examples_c/csv/csv_local.c -h ../examples_c/csv/csv_local.h -f ../examples_c/csv/sample.desc +# End Special Build Tool diff --git a/db/build_windows/ex_csvload.dsp b/db/build_windows/ex_csvload.dsp new file mode 100644 index 000000000..a7a99e2f4 --- /dev/null +++ b/db/build_windows/ex_csvload.dsp @@ -0,0 +1,276 @@ +# Microsoft Developer Studio Project File - Name="ex_csvload" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_csvload - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_csvload.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_csvload.mak" CFG="ex_csvload - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_csvload - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvload - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvload - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvload - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvload - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvload - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvload - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvload - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_csvload - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_csvload" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_csvload" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_csvload - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_csvload" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_csvload" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_csvload - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_csvload" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_csvload" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_csvload - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_csvload" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_csvload" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_csvload - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_csvload" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_csvload" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_csvload - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_csvload" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_csvload" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_csvload - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_csvload" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_csvload" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_csvload - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_csvload" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_csvload" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_csvload - Win32 Release" +# Name "ex_csvload - Win32 Debug" +# Name "ex_csvload - Win32 ASCII Debug" +# Name "ex_csvload - Win32 ASCII Release" +# Name "ex_csvload - x64 Debug AMD64" +# Name "ex_csvload - x64 Release AMD64" +# Name "ex_csvload - x64 Debug IA64" +# Name "ex_csvload - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\csv\DbRecord.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\csv_local.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\db.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\load.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\load_main.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\util.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_csvquery.dsp b/db/build_windows/ex_csvquery.dsp new file mode 100644 index 000000000..8c0197043 --- /dev/null +++ b/db/build_windows/ex_csvquery.dsp @@ -0,0 +1,276 @@ +# Microsoft Developer Studio Project File - Name="ex_csvquery" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_csvquery - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_csvquery.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_csvquery.mak" CFG="ex_csvquery - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_csvquery - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvquery - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvquery - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvquery - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvquery - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvquery - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvquery - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_csvquery - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_csvquery - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_csvquery" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_csvquery" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_csvquery - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_csvquery" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_csvquery" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_csvquery - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_csvquery" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_csvquery" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_csvquery - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_csvquery" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_csvquery" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_csvquery - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_csvquery" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_csvquery" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_csvquery - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_csvquery" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_csvquery" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_csvquery - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_csvquery" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_csvquery" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_csvquery - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_csvquery" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_csvquery" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_csvquery - Win32 Release" +# Name "ex_csvquery - Win32 Debug" +# Name "ex_csvquery - Win32 ASCII Debug" +# Name "ex_csvquery - Win32 ASCII Release" +# Name "ex_csvquery - x64 Debug AMD64" +# Name "ex_csvquery - x64 Release AMD64" +# Name "ex_csvquery - x64 Debug IA64" +# Name "ex_csvquery - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\csv\DbRecord.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\csv_local.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\db.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\query.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\query_main.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\csv\util.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_env.dsp b/db/build_windows/ex_env.dsp new file mode 100644 index 000000000..0fdfd4cc4 --- /dev/null +++ b/db/build_windows/ex_env.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="ex_env" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_env - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_env.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_env.mak" CFG="ex_env - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_env - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_env - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_env - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_env - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_env - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_env - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_env - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_env - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_env - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_env" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_env - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_env" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_env - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_env - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_env - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_env - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_env - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_env - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_env - Win32 Release" +# Name "ex_env - Win32 Debug" +# Name "ex_env - Win32 ASCII Debug" +# Name "ex_env - Win32 ASCII Release" +# Name "ex_env - x64 Debug AMD64" +# Name "ex_env - x64 Release AMD64" +# Name "ex_env - x64 Debug IA64" +# Name "ex_env - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\ex_env.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_lock.dsp b/db/build_windows/ex_lock.dsp new file mode 100644 index 000000000..24a34975c --- /dev/null +++ b/db/build_windows/ex_lock.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="ex_lock" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_lock - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_lock.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_lock.mak" CFG="ex_lock - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_lock - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_lock - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_lock - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_lock - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_lock - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_lock - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_lock - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_lock - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_lock - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_lock" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_lock - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_lock" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_lock - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_lock - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_lock - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_lock - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_lock - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_lock - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_lock - Win32 Release" +# Name "ex_lock - Win32 Debug" +# Name "ex_lock - Win32 ASCII Debug" +# Name "ex_lock - Win32 ASCII Release" +# Name "ex_lock - x64 Debug AMD64" +# Name "ex_lock - x64 Release AMD64" +# Name "ex_lock - x64 Debug IA64" +# Name "ex_lock - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\ex_lock.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_mpool.dsp b/db/build_windows/ex_mpool.dsp new file mode 100644 index 000000000..f4434c4d5 --- /dev/null +++ b/db/build_windows/ex_mpool.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="ex_mpool" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_mpool - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_mpool.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_mpool.mak" CFG="ex_mpool - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_mpool - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_mpool - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_mpool - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_mpool - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_mpool - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_mpool - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_mpool - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_mpool - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_mpool - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_mpool" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_mpool - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_mpool" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_mpool - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_mpool - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_mpool - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_mpool - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_mpool - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_mpool - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_mpool - Win32 Release" +# Name "ex_mpool - Win32 Debug" +# Name "ex_mpool - Win32 ASCII Debug" +# Name "ex_mpool - Win32 ASCII Release" +# Name "ex_mpool - x64 Debug AMD64" +# Name "ex_mpool - x64 Release AMD64" +# Name "ex_mpool - x64 Debug IA64" +# Name "ex_mpool - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\ex_mpool.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_rep_base.dsp b/db/build_windows/ex_rep_base.dsp new file mode 100644 index 000000000..759ccbaa5 --- /dev/null +++ b/db/build_windows/ex_rep_base.dsp @@ -0,0 +1,268 @@ +# Microsoft Developer Studio Project File - Name="ex_rep_base" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_rep_base - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_rep_base.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_rep_base.mak" CFG="ex_rep_base - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_rep_base - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_base - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_base - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_base - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_base - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_base - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_base - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_base - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_rep_base - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_rep_base" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_rep_base" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_rep_base - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_rep_base" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_rep_base" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_rep_base - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_rep_base" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_rep_base" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_rep_base - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_rep_base" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_rep_base" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib ws2_32.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_rep_base - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_rep_base" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_rep_base" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_rep_base - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_rep_base" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_rep_base" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_rep_base - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_rep_base" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_rep_base" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_rep_base - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_rep_base" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_rep_base" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib ws2_32.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_rep_base - Win32 Release" +# Name "ex_rep_base - Win32 Debug" +# Name "ex_rep_base - Win32 ASCII Debug" +# Name "ex_rep_base - Win32 ASCII Release" +# Name "ex_rep_base - x64 Debug AMD64" +# Name "ex_rep_base - x64 Release AMD64" +# Name "ex_rep_base - x64 Debug IA64" +# Name "ex_rep_base - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\ex_rep\base\rep_base.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\ex_rep\base\rep_msg.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\ex_rep\base\rep_net.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\ex_rep\common\rep_common.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_rep_mgr.dsp b/db/build_windows/ex_rep_mgr.dsp new file mode 100644 index 000000000..e7a814f88 --- /dev/null +++ b/db/build_windows/ex_rep_mgr.dsp @@ -0,0 +1,260 @@ +# Microsoft Developer Studio Project File - Name="ex_rep_mgr" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_rep_mgr - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_rep_mgr.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_rep_mgr.mak" CFG="ex_rep_mgr - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_rep_mgr - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_mgr - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_mgr - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_mgr - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_mgr - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_mgr - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_mgr - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_rep_mgr - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_rep_mgr - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_rep_mgr" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_rep_mgr" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_rep_mgr - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_rep_mgr" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_rep_mgr" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_rep_mgr - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_rep_mgr" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_rep_mgr" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_rep_mgr - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_rep_mgr" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_rep_mgr" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_rep_mgr - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_rep_mgr" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_rep_mgr" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_rep_mgr - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_rep_mgr" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_rep_mgr" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_rep_mgr - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_rep_mgr" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_rep_mgr" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_rep_mgr - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_rep_mgr" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_rep_mgr" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_rep_mgr - Win32 Release" +# Name "ex_rep_mgr - Win32 Debug" +# Name "ex_rep_mgr - Win32 ASCII Debug" +# Name "ex_rep_mgr - Win32 ASCII Release" +# Name "ex_rep_mgr - x64 Debug AMD64" +# Name "ex_rep_mgr - x64 Release AMD64" +# Name "ex_rep_mgr - x64 Debug IA64" +# Name "ex_rep_mgr - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\ex_rep\common\rep_common.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\ex_rep\mgr\rep_mgr.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_sequence.dsp b/db/build_windows/ex_sequence.dsp new file mode 100644 index 000000000..1da0885dd --- /dev/null +++ b/db/build_windows/ex_sequence.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="ex_sequence" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_sequence - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_sequence.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_sequence.mak" CFG="ex_sequence - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_sequence - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_sequence - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_sequence - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_sequence - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_sequence - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_sequence - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_sequence - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_sequence - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_sequence - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_sequence" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_sequence - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_sequence" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_sequence - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_sequence - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_sequence - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_sequence - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_sequence - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_sequence - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_sequence - Win32 Release" +# Name "ex_sequence - Win32 Debug" +# Name "ex_sequence - Win32 ASCII Debug" +# Name "ex_sequence - Win32 ASCII Release" +# Name "ex_sequence - x64 Debug AMD64" +# Name "ex_sequence - x64 Release AMD64" +# Name "ex_sequence - x64 Debug IA64" +# Name "ex_sequence - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\ex_sequence.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_tpcb.dsp b/db/build_windows/ex_tpcb.dsp new file mode 100644 index 000000000..889533e3d --- /dev/null +++ b/db/build_windows/ex_tpcb.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="ex_tpcb" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_tpcb - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_tpcb.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_tpcb.mak" CFG="ex_tpcb - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_tpcb - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_tpcb - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_tpcb - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_tpcb - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_tpcb - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_tpcb - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_tpcb - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_tpcb - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_tpcb - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_tpcb" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_tpcb - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_tpcb" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_tpcb - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_tpcb - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_tpcb - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_tpcb - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_tpcb - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_tpcb - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_tpcb - Win32 Release" +# Name "ex_tpcb - Win32 Debug" +# Name "ex_tpcb - Win32 ASCII Debug" +# Name "ex_tpcb - Win32 ASCII Release" +# Name "ex_tpcb - x64 Debug AMD64" +# Name "ex_tpcb - x64 Release AMD64" +# Name "ex_tpcb - x64 Debug IA64" +# Name "ex_tpcb - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\ex_tpcb.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_txnguide.dsp b/db/build_windows/ex_txnguide.dsp new file mode 100644 index 000000000..a33327620 --- /dev/null +++ b/db/build_windows/ex_txnguide.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="ex_txnguide" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_txnguide - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_txnguide.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_txnguide.mak" CFG="ex_txnguide - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_txnguide - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_txnguide - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_txnguide" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_txnguide - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_txnguide" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_txnguide - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_txnguide - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_txnguide - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_txnguide - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_txnguide - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_txnguide - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_txnguide - Win32 Release" +# Name "ex_txnguide - Win32 Debug" +# Name "ex_txnguide - Win32 ASCII Debug" +# Name "ex_txnguide - Win32 ASCII Release" +# Name "ex_txnguide - x64 Debug AMD64" +# Name "ex_txnguide - x64 Release AMD64" +# Name "ex_txnguide - x64 Debug IA64" +# Name "ex_txnguide - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\txn_guide\txn_guide.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/ex_txnguide_inmem.dsp b/db/build_windows/ex_txnguide_inmem.dsp new file mode 100644 index 000000000..7b0dc40a9 --- /dev/null +++ b/db/build_windows/ex_txnguide_inmem.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="ex_txnguide_inmem" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ex_txnguide_inmem - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ex_txnguide_inmem.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ex_txnguide_inmem.mak" CFG="ex_txnguide_inmem - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ex_txnguide_inmem - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide_inmem - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide_inmem - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide_inmem - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide_inmem - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide_inmem - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide_inmem - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "ex_txnguide_inmem - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ex_txnguide_inmem - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/ex_txnguide_inmem" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/ex_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "ex_txnguide_inmem - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/ex_txnguide_inmem" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/ex_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "ex_txnguide_inmem - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/ex_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/ex_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "ex_txnguide_inmem - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/ex_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/ex_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "ex_txnguide_inmem - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/ex_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/ex_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "ex_txnguide_inmem - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/ex_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/ex_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "ex_txnguide_inmem - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/ex_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/ex_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "ex_txnguide_inmem - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/ex_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/ex_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "ex_txnguide_inmem - Win32 Release" +# Name "ex_txnguide_inmem - Win32 Debug" +# Name "ex_txnguide_inmem - Win32 ASCII Debug" +# Name "ex_txnguide_inmem - Win32 ASCII Release" +# Name "ex_txnguide_inmem - x64 Debug AMD64" +# Name "ex_txnguide_inmem - x64 Release AMD64" +# Name "ex_txnguide_inmem - x64 Debug IA64" +# Name "ex_txnguide_inmem - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\txn_guide\txn_guide_inmemory.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/example_database_load.dsp b/db/build_windows/example_database_load.dsp new file mode 100644 index 000000000..3eed16250 --- /dev/null +++ b/db/build_windows/example_database_load.dsp @@ -0,0 +1,260 @@ +# Microsoft Developer Studio Project File - Name="example_database_load" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=example_database_load - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "example_database_load.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "example_database_load.mak" CFG="example_database_load - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "example_database_load - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_load - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_load - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_load - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_load - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_load - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_load - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_load - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "example_database_load - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/example_database_load" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "example_database_load - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/example_database_load" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "example_database_load - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "example_database_load - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "example_database_load - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "example_database_load - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "example_database_load - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "example_database_load - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "example_database_load - Win32 Release" +# Name "example_database_load - Win32 Debug" +# Name "example_database_load - Win32 ASCII Debug" +# Name "example_database_load - Win32 ASCII Release" +# Name "example_database_load - x64 Debug AMD64" +# Name "example_database_load - x64 Release AMD64" +# Name "example_database_load - x64 Debug IA64" +# Name "example_database_load - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\getting_started\example_database_load.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\getting_started\gettingstarted_common.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/example_database_read.dsp b/db/build_windows/example_database_read.dsp new file mode 100644 index 000000000..65d241b8f --- /dev/null +++ b/db/build_windows/example_database_read.dsp @@ -0,0 +1,260 @@ +# Microsoft Developer Studio Project File - Name="example_database_read" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=example_database_read - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "example_database_read.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "example_database_read.mak" CFG="example_database_read - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "example_database_read - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_read - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_read - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_read - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_read - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_read - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_read - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "example_database_read - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "example_database_read - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/example_database_read" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "example_database_read - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/example_database_read" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "example_database_read - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "example_database_read - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "example_database_read - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "example_database_read - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "example_database_read - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "example_database_read - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "example_database_read - Win32 Release" +# Name "example_database_read - Win32 Debug" +# Name "example_database_read - Win32 ASCII Debug" +# Name "example_database_read - Win32 ASCII Release" +# Name "example_database_read - x64 Debug AMD64" +# Name "example_database_read - x64 Release AMD64" +# Name "example_database_read - x64 Debug IA64" +# Name "example_database_read - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_c\getting_started\example_database_read.c +# End Source File +# Begin Source File + +SOURCE=..\examples_c\getting_started\gettingstarted_common.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_access.dsp b/db/build_windows/excxx_access.dsp new file mode 100644 index 000000000..9e18187da --- /dev/null +++ b/db/build_windows/excxx_access.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="excxx_access" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_access - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_access.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_access.mak" CFG="excxx_access - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_access - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_access - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_access - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_access - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_access - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_access - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_access - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_access - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_access - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_access" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_access - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_access" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_access - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_access - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_access - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_access - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_access - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_access - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_access" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_access" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_access - Win32 Release" +# Name "excxx_access - Win32 Debug" +# Name "excxx_access - Win32 ASCII Debug" +# Name "excxx_access - Win32 ASCII Release" +# Name "excxx_access - x64 Debug AMD64" +# Name "excxx_access - x64 Release AMD64" +# Name "excxx_access - x64 Debug IA64" +# Name "excxx_access - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\AccessExample.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_btrec.dsp b/db/build_windows/excxx_btrec.dsp new file mode 100644 index 000000000..568a8be64 --- /dev/null +++ b/db/build_windows/excxx_btrec.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="excxx_btrec" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_btrec - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_btrec.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_btrec.mak" CFG="excxx_btrec - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_btrec - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_btrec - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_btrec - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_btrec - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_btrec - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_btrec - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_btrec - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_btrec - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_btrec - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_btrec" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_btrec - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_btrec" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_btrec - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_btrec - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_btrec - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_btrec - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_btrec - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_btrec - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_btrec" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_btrec" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_btrec - Win32 Release" +# Name "excxx_btrec - Win32 Debug" +# Name "excxx_btrec - Win32 ASCII Debug" +# Name "excxx_btrec - Win32 ASCII Release" +# Name "excxx_btrec - x64 Debug AMD64" +# Name "excxx_btrec - x64 Release AMD64" +# Name "excxx_btrec - x64 Debug IA64" +# Name "excxx_btrec - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\BtRecExample.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_env.dsp b/db/build_windows/excxx_env.dsp new file mode 100644 index 000000000..75ed4f88c --- /dev/null +++ b/db/build_windows/excxx_env.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="excxx_env" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_env - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_env.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_env.mak" CFG="excxx_env - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_env - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_env - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_env - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_env - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_env - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_env - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_env - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_env - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_env - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_env" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_env - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_env" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_env - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_env - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_env - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_env - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_env - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_env - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_env" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_env" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_env - Win32 Release" +# Name "excxx_env - Win32 Debug" +# Name "excxx_env - Win32 ASCII Debug" +# Name "excxx_env - Win32 ASCII Release" +# Name "excxx_env - x64 Debug AMD64" +# Name "excxx_env - x64 Release AMD64" +# Name "excxx_env - x64 Debug IA64" +# Name "excxx_env - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\EnvExample.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_example_database_load.dsp b/db/build_windows/excxx_example_database_load.dsp new file mode 100644 index 000000000..a25bf56ae --- /dev/null +++ b/db/build_windows/excxx_example_database_load.dsp @@ -0,0 +1,260 @@ +# Microsoft Developer Studio Project File - Name="excxx_example_database_load" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_example_database_load - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_example_database_load.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_example_database_load.mak" CFG="excxx_example_database_load - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_example_database_load - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_load - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_load - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_load - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_load - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_load - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_load - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_load - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_example_database_load - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_example_database_load" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_example_database_load - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_example_database_load" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_example_database_load - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_example_database_load - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_example_database_load - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_example_database_load - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_example_database_load - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_example_database_load - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_example_database_load" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_example_database_load" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_example_database_load - Win32 Release" +# Name "excxx_example_database_load - Win32 Debug" +# Name "excxx_example_database_load - Win32 ASCII Debug" +# Name "excxx_example_database_load - Win32 ASCII Release" +# Name "excxx_example_database_load - x64 Debug AMD64" +# Name "excxx_example_database_load - x64 Release AMD64" +# Name "excxx_example_database_load - x64 Debug IA64" +# Name "excxx_example_database_load - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\getting_started\MyDb.cpp +# End Source File +# Begin Source File + +SOURCE=..\examples_cxx\getting_started\excxx_example_database_load.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_example_database_read.dsp b/db/build_windows/excxx_example_database_read.dsp new file mode 100644 index 000000000..804bf70c6 --- /dev/null +++ b/db/build_windows/excxx_example_database_read.dsp @@ -0,0 +1,260 @@ +# Microsoft Developer Studio Project File - Name="excxx_example_database_read" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_example_database_read - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_example_database_read.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_example_database_read.mak" CFG="excxx_example_database_read - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_example_database_read - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_read - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_read - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_read - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_read - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_read - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_read - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_example_database_read - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_example_database_read - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_example_database_read" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_example_database_read - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_example_database_read" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_example_database_read - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_example_database_read - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_example_database_read - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_example_database_read - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_example_database_read - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_example_database_read - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_example_database_read" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_example_database_read" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_example_database_read - Win32 Release" +# Name "excxx_example_database_read - Win32 Debug" +# Name "excxx_example_database_read - Win32 ASCII Debug" +# Name "excxx_example_database_read - Win32 ASCII Release" +# Name "excxx_example_database_read - x64 Debug AMD64" +# Name "excxx_example_database_read - x64 Release AMD64" +# Name "excxx_example_database_read - x64 Debug IA64" +# Name "excxx_example_database_read - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\getting_started\MyDb.cpp +# End Source File +# Begin Source File + +SOURCE=..\examples_cxx\getting_started\excxx_example_database_read.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_lock.dsp b/db/build_windows/excxx_lock.dsp new file mode 100644 index 000000000..51845a1dc --- /dev/null +++ b/db/build_windows/excxx_lock.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="excxx_lock" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_lock - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_lock.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_lock.mak" CFG="excxx_lock - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_lock - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_lock - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_lock - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_lock - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_lock - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_lock - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_lock - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_lock - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_lock - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_lock" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_lock - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_lock" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_lock - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_lock - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_lock - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_lock - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_lock - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_lock - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_lock" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_lock" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_lock - Win32 Release" +# Name "excxx_lock - Win32 Debug" +# Name "excxx_lock - Win32 ASCII Debug" +# Name "excxx_lock - Win32 ASCII Release" +# Name "excxx_lock - x64 Debug AMD64" +# Name "excxx_lock - x64 Release AMD64" +# Name "excxx_lock - x64 Debug IA64" +# Name "excxx_lock - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\LockExample.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_mpool.dsp b/db/build_windows/excxx_mpool.dsp new file mode 100644 index 000000000..140d56a4a --- /dev/null +++ b/db/build_windows/excxx_mpool.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="excxx_mpool" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_mpool - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_mpool.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_mpool.mak" CFG="excxx_mpool - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_mpool - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_mpool - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_mpool - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_mpool - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_mpool - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_mpool - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_mpool - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_mpool - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_mpool - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_mpool" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_mpool - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_mpool" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_mpool - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_mpool - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_mpool - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_mpool - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_mpool - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_mpool - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_mpool" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_mpool" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_mpool - Win32 Release" +# Name "excxx_mpool - Win32 Debug" +# Name "excxx_mpool - Win32 ASCII Debug" +# Name "excxx_mpool - Win32 ASCII Release" +# Name "excxx_mpool - x64 Debug AMD64" +# Name "excxx_mpool - x64 Release AMD64" +# Name "excxx_mpool - x64 Debug IA64" +# Name "excxx_mpool - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\MpoolExample.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_repquote.dsp b/db/build_windows/excxx_repquote.dsp new file mode 100644 index 000000000..34b8a996a --- /dev/null +++ b/db/build_windows/excxx_repquote.dsp @@ -0,0 +1,260 @@ +# Microsoft Developer Studio Project File - Name="excxx_repquote" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_repquote - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_repquote.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_repquote.mak" CFG="excxx_repquote - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_repquote - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_repquote - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_repquote - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_repquote - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_repquote - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_repquote - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_repquote - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_repquote - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_repquote - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_repquote" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_repquote" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_repquote - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_repquote" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_repquote" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_repquote - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_repquote" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_repquote" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_repquote - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_repquote" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_repquote" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_repquote - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_repquote" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_repquote" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_repquote - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_repquote" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_repquote" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_repquote - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_repquote" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_repquote" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_repquote - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_repquote" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_repquote" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_repquote - Win32 Release" +# Name "excxx_repquote - Win32 Debug" +# Name "excxx_repquote - Win32 ASCII Debug" +# Name "excxx_repquote - Win32 ASCII Release" +# Name "excxx_repquote - x64 Debug AMD64" +# Name "excxx_repquote - x64 Release AMD64" +# Name "excxx_repquote - x64 Debug IA64" +# Name "excxx_repquote - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\excxx_repquote\RepConfigInfo.cpp +# End Source File +# Begin Source File + +SOURCE=..\examples_cxx\excxx_repquote\RepQuoteExample.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_sequence.dsp b/db/build_windows/excxx_sequence.dsp new file mode 100644 index 000000000..be5b1f002 --- /dev/null +++ b/db/build_windows/excxx_sequence.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="excxx_sequence" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_sequence - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_sequence.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_sequence.mak" CFG="excxx_sequence - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_sequence - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_sequence - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_sequence - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_sequence - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_sequence - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_sequence - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_sequence - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_sequence - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_sequence - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_sequence" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_sequence - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_sequence" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_sequence - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_sequence - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_sequence - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_sequence - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_sequence - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_sequence - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_sequence" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_sequence" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_sequence - Win32 Release" +# Name "excxx_sequence - Win32 Debug" +# Name "excxx_sequence - Win32 ASCII Debug" +# Name "excxx_sequence - Win32 ASCII Release" +# Name "excxx_sequence - x64 Debug AMD64" +# Name "excxx_sequence - x64 Release AMD64" +# Name "excxx_sequence - x64 Debug IA64" +# Name "excxx_sequence - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\SequenceExample.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_tpcb.dsp b/db/build_windows/excxx_tpcb.dsp new file mode 100644 index 000000000..26032d795 --- /dev/null +++ b/db/build_windows/excxx_tpcb.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="excxx_tpcb" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_tpcb - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_tpcb.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_tpcb.mak" CFG="excxx_tpcb - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_tpcb - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_tpcb - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_tpcb - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_tpcb - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_tpcb - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_tpcb - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_tpcb - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_tpcb - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_tpcb - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_tpcb" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_tpcb - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_tpcb" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_tpcb - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_tpcb - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_tpcb - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_tpcb - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_tpcb - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_tpcb - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_tpcb" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_tpcb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_tpcb - Win32 Release" +# Name "excxx_tpcb - Win32 Debug" +# Name "excxx_tpcb - Win32 ASCII Debug" +# Name "excxx_tpcb - Win32 ASCII Release" +# Name "excxx_tpcb - x64 Debug AMD64" +# Name "excxx_tpcb - x64 Release AMD64" +# Name "excxx_tpcb - x64 Debug IA64" +# Name "excxx_tpcb - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\TpcbExample.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_txnguide.dsp b/db/build_windows/excxx_txnguide.dsp new file mode 100644 index 000000000..d22ded8f2 --- /dev/null +++ b/db/build_windows/excxx_txnguide.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="excxx_txnguide" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_txnguide - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_txnguide.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_txnguide.mak" CFG="excxx_txnguide - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_txnguide - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_txnguide - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_txnguide" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_txnguide - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_txnguide" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_txnguide - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_txnguide - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_txnguide - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_txnguide - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_txnguide - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_txnguide - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_txnguide" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_txnguide" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_txnguide - Win32 Release" +# Name "excxx_txnguide - Win32 Debug" +# Name "excxx_txnguide - Win32 ASCII Debug" +# Name "excxx_txnguide - Win32 ASCII Release" +# Name "excxx_txnguide - x64 Debug AMD64" +# Name "excxx_txnguide - x64 Release AMD64" +# Name "excxx_txnguide - x64 Debug IA64" +# Name "excxx_txnguide - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\txn_guide\TxnGuide.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/excxx_txnguide_inmem.dsp b/db/build_windows/excxx_txnguide_inmem.dsp new file mode 100644 index 000000000..c54be9030 --- /dev/null +++ b/db/build_windows/excxx_txnguide_inmem.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="excxx_txnguide_inmem" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=excxx_txnguide_inmem - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "excxx_txnguide_inmem.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "excxx_txnguide_inmem.mak" CFG="excxx_txnguide_inmem - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "excxx_txnguide_inmem - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide_inmem - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide_inmem - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide_inmem - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide_inmem - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide_inmem - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide_inmem - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "excxx_txnguide_inmem - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "excxx_txnguide_inmem - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/excxx_txnguide_inmem" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/excxx_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "excxx_txnguide_inmem - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/excxx_txnguide_inmem" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/excxx_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "excxx_txnguide_inmem - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/excxx_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/excxx_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "excxx_txnguide_inmem - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/excxx_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/excxx_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "excxx_txnguide_inmem - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/excxx_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/excxx_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "excxx_txnguide_inmem - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/excxx_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/excxx_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "excxx_txnguide_inmem - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/excxx_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/excxx_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "excxx_txnguide_inmem - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/excxx_txnguide_inmem" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/excxx_txnguide_inmem" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "excxx_txnguide_inmem - Win32 Release" +# Name "excxx_txnguide_inmem - Win32 Debug" +# Name "excxx_txnguide_inmem - Win32 ASCII Debug" +# Name "excxx_txnguide_inmem - Win32 ASCII Release" +# Name "excxx_txnguide_inmem - x64 Debug AMD64" +# Name "excxx_txnguide_inmem - x64 Release AMD64" +# Name "excxx_txnguide_inmem - x64 Debug IA64" +# Name "excxx_txnguide_inmem - x64 Release IA64" +# Begin Source File + +SOURCE=..\examples_cxx\txn_guide\TxnGuideInMemory.cpp +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/include.tcl b/db/build_windows/include.tcl new file mode 100644 index 000000000..e82d66dab --- /dev/null +++ b/db/build_windows/include.tcl @@ -0,0 +1,28 @@ +# Automatically built by dist/s_test; may require local editing. + +set tclsh_path SET_YOUR_TCLSH_PATH +set tcllib ./Debug/libdb_tcl45d.dll + +set src_root .. +set test_path ../test +set je_root ../../je + +global testdir +set testdir ./TESTDIR + +global dict +global util_path + +global is_freebsd_test +global is_hp_test +global is_linux_test +global is_qnx_test +global is_sunos_test +global is_windows_test +global is_windows9x_test + +global valid_methods +global checking_valid_methods +global test_recopts + +set KILL ./dbkill.exe diff --git a/db/build_windows/libdb.def b/db/build_windows/libdb.def new file mode 100644 index 000000000..ac3379f9e --- /dev/null +++ b/db/build_windows/libdb.def @@ -0,0 +1,177 @@ +; DO NOT EDIT: automatically built by dist/s_windows. + +EXPORTS + db_create @1 + db_env_create @2 + db_sequence_create @3 + db_strerror @4 + db_version @5 + db_xa_switch @6 + log_compare @7 + __db_add_recovery @8 + __db_dbm_close @9 + __db_dbm_delete @10 + __db_dbm_fetch @11 + __db_dbm_firstkey @12 + __db_dbm_init @13 + __db_dbm_nextkey @14 + __db_dbm_store @15 + __db_get_flags_fn @16 + __db_get_seq_flags_fn @17 + __db_hcreate @18 + __db_hdestroy @19 + __db_hsearch @20 + __db_loadme @21 + __db_ndbm_clearerr @22 + __db_ndbm_close @23 + __db_ndbm_delete @24 + __db_ndbm_dirfno @25 + __db_ndbm_error @26 + __db_ndbm_fetch @27 + __db_ndbm_firstkey @28 + __db_ndbm_nextkey @29 + __db_ndbm_open @30 + __db_ndbm_pagfno @31 + __db_ndbm_rdonly @32 + __db_ndbm_store @33 + __db_panic @34 + __db_r_attach @35 + __db_r_detach @36 + __ham_func2 @37 + __ham_func3 @38 + __ham_func4 @39 + __ham_func5 @40 + __ham_test @41 + __lock_id_set @42 + __os_calloc @43 + __os_closehandle @44 + __os_dirfree @45 + __os_dirlist @46 + __os_free @47 + __os_get_syserr @48 + __os_getenv @49 + __os_ioinfo @50 + __os_malloc @51 + __os_mkdir @52 + __os_open @53 + __os_openhandle @54 + __os_posix_err @55 + __os_read @56 + __os_realloc @57 + __os_strdup @58 + __os_umalloc @59 + __os_unlink @60 + __os_write @61 + __txn_id_set @62 + __bam_adj_read @63 + __bam_cadjust_read @64 + __bam_cdel_read @65 + __bam_curadj_read @66 + __bam_merge_read @67 + __bam_pgin @68 + __bam_pgno_read @69 + __bam_pgout @70 + __bam_rcuradj_read @71 + __bam_relink_43_read @72 + __bam_relink_read @73 + __bam_repl_read @74 + __bam_root_read @75 + __bam_rsplit_read @76 + __bam_split_read @77 + __crdel_inmem_create_read @78 + __crdel_inmem_remove_read @79 + __crdel_inmem_rename_read @80 + __crdel_metasub_read @81 + __db_addrem_read @82 + __db_big_read @83 + __db_cksum_read @84 + __db_ctime @85 + __db_debug_read @86 + __db_dispatch @87 + __db_dl @88 + __db_dumptree @89 + __db_err @90 + __db_errx @91 + __db_getlong @92 + __db_getulong @93 + __db_global_values @94 + __db_isbigendian @95 + __db_mkpath @96 + __db_msg @97 + __db_noop_read @98 + __db_omode @99 + __db_ovref_read @100 + __db_pg_alloc_42_read @101 + __db_pg_alloc_read @102 + __db_pg_free_42_read @103 + __db_pg_free_read @104 + __db_pg_freedata_42_read @105 + __db_pg_freedata_read @106 + __db_pg_init_read @107 + __db_pg_new_read @108 + __db_pg_prepare_read @109 + __db_pg_sort_read @110 + __db_pgin @111 + __db_pgout @112 + __db_pr_callback @113 + __db_relink_42_read @114 + __db_rpath @115 + __db_stat_pp @116 + __db_stat_print_pp @117 + __db_util_cache @118 + __db_util_interrupted @119 + __db_util_logset @120 + __db_util_siginit @121 + __db_util_sigresend @122 + __db_verify_internal @123 + __dbreg_register_read @124 + __fop_create_read @125 + __fop_file_remove_read @126 + __fop_remove_read @127 + __fop_rename_read @128 + __fop_write_read @129 + __ham_chgpg_read @130 + __ham_copypage_read @131 + __ham_curadj_read @132 + __ham_get_meta @133 + __ham_groupalloc_42_read @134 + __ham_groupalloc_read @135 + __ham_insdel_read @136 + __ham_metagroup_42_read @137 + __ham_metagroup_read @138 + __ham_newpage_read @139 + __ham_pgin @140 + __ham_pgout @141 + __ham_release_meta @142 + __ham_replace_read @143 + __ham_splitdata_read @144 + __lock_list_print @145 + __log_stat_pp @146 + __mutex_set_wait_info @147 + __os_abspath @148 + __os_clock @149 + __os_exists @150 + __os_get_errno @151 + __os_id @152 + __os_mapfile @153 + __os_seek @154 + __os_set_errno @155 + __os_sleep @156 + __os_spin @157 + __os_ufree @158 + __os_unmapfile @159 + __os_yield @160 + __qam_add_read @161 + __qam_del_read @162 + __qam_delext_read @163 + __qam_incfirst_read @164 + __qam_mvptr_read @165 + __qam_pgin_out @166 + __rep_stat_print @167 + __txn_child_read @168 + __txn_ckp_42_read @169 + __txn_ckp_read @170 + __txn_recycle_read @171 + __txn_regop_42_read @172 + __txn_regop_read @173 + __txn_xa_regop_read @174 diff --git a/db/build_windows/libdb.rc b/db/build_windows/libdb.rc new file mode 100644 index 000000000..4b0666cc5 --- /dev/null +++ b/db/build_windows/libdb.rc @@ -0,0 +1,33 @@ +1 VERSIONINFO + FILEVERSION 4,0,5,20 + PRODUCTVERSION 4,0,5,20 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Oracle Corporation\0" + VALUE "FileDescription", "Berkeley DB 4.5 DLL\0" + VALUE "FileVersion", "4.5.20\0" + VALUE "InternalName", "libdb45.dll\0" + VALUE "LegalCopyright", "Copyright © Oracle Corporation 1997-2006\0" + VALUE "OriginalFilename", "libdb45.dll\0" + VALUE "ProductName", "Oracle Corporation libdb\0" + VALUE "ProductVersion", "4.5.20\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/db/build_windows/libdb_tcl.def b/db/build_windows/libdb_tcl.def new file mode 100644 index 000000000..01a89e44d --- /dev/null +++ b/db/build_windows/libdb_tcl.def @@ -0,0 +1,7 @@ +; $Id: libdb_tcl.def,v 12.0 2004/11/17 03:48:15 bostic Exp $ + +DESCRIPTION 'Berkeley DB TCL interface Library' +EXPORTS + Db_tcl_Init + _NameToPtr + diff --git a/db/build_windows/libdbrc.src b/db/build_windows/libdbrc.src new file mode 100644 index 000000000..e624e77a1 --- /dev/null +++ b/db/build_windows/libdbrc.src @@ -0,0 +1,33 @@ +1 VERSIONINFO + FILEVERSION %MAJOR%,0,%MINOR%,%PATCH% + PRODUCTVERSION %MAJOR%,0,%MINOR%,%PATCH% + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Oracle Corporation\0" + VALUE "FileDescription", "Berkeley DB %MAJOR%.%MINOR% DLL\0" + VALUE "FileVersion", "%MAJOR%.%MINOR%.%PATCH%\0" + VALUE "InternalName", "libdb%MAJOR%%MINOR%.dll\0" + VALUE "LegalCopyright", "Copyright © Oracle Corporation 1997-2006\0" + VALUE "OriginalFilename", "libdb%MAJOR%%MINOR%.dll\0" + VALUE "ProductName", "Oracle Corporation libdb\0" + VALUE "ProductVersion", "%MAJOR%.%MINOR%.%PATCH%\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/db/build_windows/srcfile_dsp.src b/db/build_windows/srcfile_dsp.src new file mode 100644 index 000000000..408a55e2a --- /dev/null +++ b/db/build_windows/srcfile_dsp.src @@ -0,0 +1,4 @@ +# Begin Source File + +SOURCE=@srcdir@\@srcfile@ +# End Source File diff --git a/db/build_windows/static_dsp.src b/db/build_windows/static_dsp.src new file mode 100644 index 000000000..aba9c79cc --- /dev/null +++ b/db/build_windows/static_dsp.src @@ -0,0 +1,235 @@ +# Microsoft Developer Studio Project File - Name="@project_name@" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=@project_name@ - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "@project_name@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "@project_name@.mak" CFG="@project_name@ - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "@project_name@ - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "@project_name@ - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "@project_name@ - Win32 ASCII Release" (based on "Win32 (x86) Static Library") +!MESSAGE "@project_name@ - Win32 ASCII Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "@project_name@ - x64 Debug AMD64" (based on "Win32 (x86) Static Library") +!MESSAGE "@project_name@ - x64 Release AMD64" (based on "Win32 (x86) Static Library") +!MESSAGE "@project_name@ - x64 Debug IA64" (based on "Win32 (x86) Static Library") +!MESSAGE "@project_name@ - x64 Release IA64" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "@project_name@ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@lib_rel_dest@" +# PROP BASE Intermediate_Dir "Release/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@lib_rel_dest@" +# PROP Intermediate_Dir "Release/@project_name@" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"@lib_rel_dest@/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@s.lib" +# ADD LIB32 /nologo /out:"@lib_rel_dest@/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@s.lib" + +!ELSEIF "$(CFG)" == "@project_name@ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@lib_debug_dest@" +# PROP BASE Intermediate_Dir "Debug/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@lib_debug_dest@" +# PROP Intermediate_Dir "Debug/@project_name@" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"@lib_debug_dest@/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@sd.lib" +# ADD LIB32 /nologo /out:"@lib_debug_dest@/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@sd.lib" + +!ELSEIF "$(CFG)" == "@project_name@ - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@lib_rel_dest@_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@lib_rel_dest@_ASCII" +# PROP Intermediate_Dir "Release_ASCII/@project_name@" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" @extra_cppflags@ /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"@lib_rel_dest@_ASCII/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@s.lib" +# ADD LIB32 /nologo /out:"@lib_rel_dest@_ASCII/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@s.lib" + +!ELSEIF "$(CFG)" == "@project_name@ - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@lib_debug_dest@_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@lib_debug_dest@_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/@project_name@" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" @extra_cppflags@ /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"@lib_debug_dest@_ASCII/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@sd.lib" +# ADD LIB32 /nologo /out:"@lib_debug_dest@_ASCII/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@sd.lib" + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@lib_debug_dest@_AMD64" +# PROP BASE Intermediate_Dir "Debug/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@lib_debug_dest@_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/@project_name@" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /Wp64 /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"@lib_debug_dest@_AMD64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@sd.lib" +# ADD LIB32 /nologo /out:"@lib_debug_dest@_AMD64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@sd.lib" + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@lib_rel_dest@_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@lib_rel_dest@_AMD64" +# PROP Intermediate_Dir "Release_AMD64/@project_name@" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"@lib_rel_dest@_AMD64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@s.lib" +# ADD LIB32 /nologo /out:"@lib_rel_dest@_AMD64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@s.lib" + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@lib_debug_dest@_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@lib_debug_dest@_IA64" +# PROP Intermediate_Dir "Debug_IA64/@project_name@" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "DIAGNOSTIC" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"@lib_debug_dest@_IA64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@sd.lib" +# ADD LIB32 /nologo /out:"@lib_debug_dest@_IA64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@sd.lib" + +!ELSEIF "$(CFG)" == "@project_name@ - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@lib_rel_dest@_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/@project_name@" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@lib_rel_dest@_IA64" +# PROP Intermediate_Dir "Release_IA64/@project_name@" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" @extra_cppflags@ /Wp64 /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"@lib_rel_dest@_IA64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@s.lib" +# ADD LIB32 /nologo /out:"@lib_rel_dest@_IA64/libdb@lib_suffix@@DB_VERSION_MAJOR@@DB_VERSION_MINOR@s.lib" + +!ENDIF + +# Begin Target + +# Name "@project_name@ - Win32 Release" +# Name "@project_name@ - Win32 Debug" +# Name "@project_name@ - Win32 ASCII Release" +# Name "@project_name@ - Win32 ASCII Debug" +# Name "@project_name@ - x64 Debug AMD64" +# Name "@project_name@ - x64 Release AMD64" +# Name "@project_name@ - x64 Debug IA64" +# Name "@project_name@ - x64 Release IA64" +@SOURCE_FILES@ +# End Target +# End Project diff --git a/db/build_windows/tm.dsp b/db/build_windows/tm.dsp new file mode 100644 index 000000000..5917fc796 --- /dev/null +++ b/db/build_windows/tm.dsp @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="tm" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=tm - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "tm.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "tm.mak" CFG="tm - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "tm - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "tm - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "tm - Win32 ASCII Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "tm - Win32 ASCII Release" (based on "Win32 (x86) Console Application") +!MESSAGE "tm - x64 Debug AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "tm - x64 Release AMD64" (based on "Win32 (x86) Console Application") +!MESSAGE "tm - x64 Debug IA64" (based on "Win32 (x86) Console Application") +!MESSAGE "tm - x64 Release IA64" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "tm - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release/tm" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release/tm" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release" + +!ELSEIF "$(CFG)" == "tm - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug/tm" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug/tm" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug" + +!ELSEIF "$(CFG)" == "tm - Win32 ASCII Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_ASCII" +# PROP BASE Intermediate_Dir "Debug_ASCII/tm" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_ASCII" +# PROP Intermediate_Dir "Debug_ASCII/tm" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_ASCII" + +!ELSEIF "$(CFG)" == "tm - Win32 ASCII Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_ASCII" +# PROP BASE Intermediate_Dir "Release_ASCII/tm" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_ASCII" +# PROP Intermediate_Dir "Release_ASCII/tm" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" /libpath:"Release_ASCII" + +!ELSEIF "$(CFG)" == "tm - x64 Debug AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_AMD64" +# PROP BASE Intermediate_Dir "Debug_AMD64/tm" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_AMD64" +# PROP Intermediate_Dir "Debug_AMD64/tm" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:AMD64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_AMD64" + +!ELSEIF "$(CFG)" == "tm - x64 Release AMD64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_AMD64" +# PROP BASE Intermediate_Dir "Release_AMD64/tm" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_AMD64" +# PROP Intermediate_Dir "Release_AMD64/tm" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:AMD64 /nodefaultlib:"libcmt" /libpath:"Release_AMD64" + +!ELSEIF "$(CFG)" == "tm - x64 Debug IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_IA64" +# PROP BASE Intermediate_Dir "Debug_IA64/tm" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_IA64" +# PROP Intermediate_Dir "Debug_IA64/tm" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Z7 /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no +# ADD LINK32 libdb45d.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:IA64 /nodefaultlib:"libcmtd" /fixed:no /libpath:"Debug_IA64" + +!ELSEIF "$(CFG)" == "tm - x64 Release IA64" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_IA64" +# PROP BASE Intermediate_Dir "Release_IA64/tm" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_IA64" +# PROP Intermediate_Dir "Release_IA64/tm" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD CPP /nologo /MD /W3 /EHsc /O2 /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Wp64 /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" +# ADD LINK32 libdb45.lib bufferoverflowU.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:IA64 /nodefaultlib:"libcmt" /libpath:"Release_IA64" + +!ENDIF + +# Begin Target + +# Name "tm - Win32 Release" +# Name "tm - Win32 Debug" +# Name "tm - Win32 ASCII Debug" +# Name "tm - Win32 ASCII Release" +# Name "tm - x64 Debug AMD64" +# Name "tm - x64 Release AMD64" +# Name "tm - x64 Debug IA64" +# Name "tm - x64 Release IA64" +# Begin Source File + +SOURCE=..\mutex\tm.c +# End Source File +# Begin Source File + +SOURCE=..\clib\getopt.c +# End Source File +# End Target +# End Project diff --git a/db/build_windows/win_db.h b/db/build_windows/win_db.h new file mode 100644 index 000000000..88d3b15b4 --- /dev/null +++ b/db/build_windows/win_db.h @@ -0,0 +1,143 @@ +/*- + * $Id: win_db.h,v 12.188 2006/09/20 20:08:48 bostic Exp $ + * + * The following provides the information necessary to build Berkeley + * DB on native Windows, and other Windows environments such as MinGW. + */ + +/* + * Avoid warnings with Visual Studio 8. + */ +#define _CRT_SECURE_NO_DEPRECATE 1 + +/* + * Windows NT 4.0 and later required for the replication manager. + */ +#ifdef HAVE_REPLICATION_THREADS +#define _WIN32_WINNT 0x0400 +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * To build Tcl interface libraries, the include path must be configured to + * use the directory containing , usually the include directory in + * the Tcl distribution. + */ +#ifdef DB_TCL_SUPPORT +#include +#endif + +#define WIN32_LEAN_AND_MEAN +#include +#include + +#ifdef HAVE_GETADDRINFO +/* + * Need explicit includes for IPv6 support on Windows. Both are necessary to + * ensure that pre WinXP versions have an implementation of the getaddrinfo API. + */ +#include +#include +#endif + +/* + * All of the necessary includes have been included, ignore the #includes + * in the Berkeley DB source files. + */ +#define NO_SYSTEM_INCLUDES + +/* + * Microsoft's C runtime library has fsync, getcwd, getpid, snprintf and + * vsnprintf, but under different names. + */ +#define fsync _commit +#define getcwd(buf, size) _getcwd(buf, size) +#define getpid _getpid +#define snprintf _snprintf +#define vsnprintf _vsnprintf + +#define h_errno WSAGetLastError() + +/* + * Windows defines off_t to long (i.e., 32 bits). We need to pass 64-bit + * file offsets, so we declare our own. + */ +#define off_t __db_off_t +typedef __int64 off_t; + +/* + * Win32 does not have getopt. + * + * The externs are here (instead of using db_config.h and clib_port.h), + * because Berkeley DB example programs use getopt and they can't #include + * those files. + */ +#if defined(__cplusplus) +extern "C" { +#endif +extern int getopt(int, char * const *, const char *); +#if defined(__cplusplus) +} +#endif + +#ifdef _UNICODE +#define TO_TSTRING(dbenv, s, ts, ret) do { \ + int __len = (int)strlen(s) + 1; \ + ts = NULL; \ + if ((ret = __os_malloc((dbenv), \ + __len * sizeof(_TCHAR), &(ts))) == 0 && \ + MultiByteToWideChar(CP_UTF8, 0, \ + (s), -1, (ts), __len) == 0) \ + ret = __os_posix_err(__os_get_syserr()); \ + } while (0) + +#define FROM_TSTRING(dbenv, ts, s, ret) { \ + int __len = WideCharToMultiByte(CP_UTF8, 0, ts, -1, \ + NULL, 0, NULL, NULL); \ + s = NULL; \ + if ((ret = __os_malloc((dbenv), __len, &(s))) == 0 && \ + WideCharToMultiByte(CP_UTF8, 0, \ + (ts), -1, (s), __len, NULL, NULL) == 0) \ + ret = __os_posix_err(__os_get_syserr()); \ + } while (0) + +#define FREE_STRING(dbenv, s) do { \ + if ((s) != NULL) { \ + __os_free((dbenv), (s)); \ + (s) = NULL; \ + } \ + } while (0) + +#else +#define TO_TSTRING(dbenv, s, ts, ret) (ret) = 0, (ts) = (_TCHAR *)(s) +#define FROM_TSTRING(dbenv, ts, s, ret) (ret) = 0, (s) = (char *)(ts) +#define FREE_STRING(dbenv, ts) +#endif + +#ifndef INVALID_HANDLE_VALUE +#define INVALID_HANDLE_VALUE ((HANDLE)-1) +#endif + +#ifndef INVALID_FILE_ATTRIBUTES +#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) +#endif + +#ifndef INVALID_SET_FILE_POINTER +#define INVALID_SET_FILE_POINTER ((DWORD)-1) +#endif diff --git a/db/clib/abort.c b/db/clib/abort.c new file mode 100644 index 000000000..d3069a442 --- /dev/null +++ b/db/clib/abort.c @@ -0,0 +1,29 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2005-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: abort.c,v 1.3 2006/09/07 14:12:59 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * abort -- + * + * PUBLIC: #ifndef HAVE_ABORT + * PUBLIC: void abort __P((void)); + * PUBLIC: #endif + */ +void +abort() +{ +#ifdef SIGABRT + raise(SIGABRT); /* Try and drop core. */ +#endif + exit(1); + /* NOTREACHED */ +} diff --git a/db/clib/atoi.c b/db/clib/atoi.c new file mode 100644 index 000000000..d064ffb0e --- /dev/null +++ b/db/clib/atoi.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * atoi -- + * + * PUBLIC: #ifndef HAVE_ATOI + * PUBLIC: int atoi __P((const char *)); + * PUBLIC: #endif + */ +int +atoi(str) + const char *str; +{ + return (int)strtol(str, (char **)NULL, 10); +} diff --git a/db/clib/atol.c b/db/clib/atol.c new file mode 100644 index 000000000..9aefcd5a2 --- /dev/null +++ b/db/clib/atol.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * atol -- + * + * PUBLIC: #ifndef HAVE_ATOL + * PUBLIC: long atol __P((const char *)); + * PUBLIC: #endif + */ +long +atol(str) + const char *str; +{ + return strtol(str, (char **)NULL, 10); +} diff --git a/db/clib/ctime.c b/db/clib/ctime.c new file mode 100644 index 000000000..49375d5da --- /dev/null +++ b/db/clib/ctime.c @@ -0,0 +1,41 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2001-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: ctime.c,v 12.10 2006/08/24 14:45:09 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * __db_ctime -- + * Format a time-stamp. + * + * PUBLIC: char *__db_ctime __P((const time_t *, char *)); + */ +char * +__db_ctime(tod, time_buf) + const time_t *tod; + char *time_buf; +{ + time_buf[CTIME_BUFLEN - 1] = '\0'; + + /* + * The ctime_r interface is the POSIX standard, thread-safe version of + * ctime. However, it was implemented in two different ways (with and + * without a buffer length argument), and you can't depend on a return + * value of (char *), the version in HPUX 10.XX returned an int. + */ +#if defined(HAVE_CTIME_R_3ARG) + (void)ctime_r(tod, time_buf, CTIME_BUFLEN); +#elif defined(HAVE_CTIME_R) + (void)ctime_r(tod, time_buf); +#else + (void)strncpy(time_buf, ctime(tod), CTIME_BUFLEN - 1); +#endif + return (time_buf); +} diff --git a/db/clib/getaddrinfo.c b/db/clib/getaddrinfo.c new file mode 100644 index 000000000..769dda67d --- /dev/null +++ b/db/clib/getaddrinfo.c @@ -0,0 +1,161 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2006 + * Oracle Corporation. All rights reserved. + * + * $Id: getaddrinfo.c,v 1.5 2006/08/24 14:45:09 bostic Exp $ + */ + +#include "db_config.h" + +#define __INCLUDE_NETWORKING 1 +#include "db_int.h" + +/* + * __db_getaddrinfo and __db_freeaddrinfo wrap the getaddrinfo and freeaddrinfo + * calls, as well as the associated platform dependent error handling, mapping + * the error return to a ANSI C/POSIX error return. + */ + +/* + * __db_getaddrinfo -- + * + * PUBLIC: #if defined(HAVE_REPLICATION_THREADS) + * PUBLIC: int __db_getaddrinfo __P((DB_ENV *, const char *, u_int, + * PUBLIC: const char *, const ADDRINFO *, ADDRINFO **)); + * PUBLIC: #endif + */ +int +__db_getaddrinfo(dbenv, nodename, port, servname, hints, res) + DB_ENV *dbenv; + const char *nodename, *servname; + u_int port; + const ADDRINFO *hints; + ADDRINFO **res; +{ +#ifdef HAVE_GETADDRINFO + int ret; + + if ((ret = getaddrinfo(nodename, servname, hints, res)) == 0) + return (0); + + __db_errx(dbenv, "%s(%u): host lookup failed: %s", + nodename == NULL ? "" : nodename, port, +#ifdef DB_WIN32 + gai_strerrorA(ret)); +#else + gai_strerror(ret)); +#endif + return (__os_posix_err(ret)); +#else + ADDRINFO *answer; + struct hostent *hostaddr; + struct sockaddr_in sin; + u_int32_t tmpaddr; + int ret; + + COMPQUIET(hints, NULL); + COMPQUIET(servname, NULL); + + /* + * Basic implementation of IPv4 component of getaddrinfo. + * Limited to the functionality used by repmgr. + */ + memset(&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + if (nodename) { + if (nodename[0] == '\0') + sin.sin_addr.s_addr = htonl(INADDR_ANY); + else if ((tmpaddr = inet_addr(nodename)) != INADDR_NONE) { + sin.sin_addr.s_addr = tmpaddr; + } else { + hostaddr = gethostbyname(nodename); + if (hostaddr == NULL) { +#ifdef DB_WIN32 + ret = __os_get_neterr(); + __db_syserr(dbenv, ret, + "%s(%u): host lookup failed", + nodename == NULL ? "" : nodename, port); + return (__os_posix_err(ret)); +#else + /* + * Historic UNIX systems used the h_errno + * global variable to return gethostbyname + * errors. The only function we currently + * use that needs h_errno is gethostbyname, + * so we deal with it here. + */ + __db_errx(dbenv, + "%s(%u): host lookup failed: %s", + nodename == NULL ? "" : nodename, port, + hstrerror(h_errno)); + switch (h_errno) { + case HOST_NOT_FOUND: + case NO_DATA: + return (EHOSTUNREACH); + case TRY_AGAIN: + return (EAGAIN); + case NO_RECOVERY: + default: + return (EFAULT); + } + /* NOTREACHED */ +#endif + } + memcpy(&(sin.sin_addr), + hostaddr->h_addr, (size_t)hostaddr->h_length); + } + } else /* No host specified. */ + sin.sin_addr.s_addr = htonl(INADDR_ANY); + sin.sin_port = htons((u_int16_t)port); + + if ((ret = __os_calloc(dbenv, 1, sizeof(ADDRINFO), &answer)) != 0) + return (ret); + if ((ret = __os_malloc(dbenv, sizeof(sin), &answer->ai_addr)) != 0) { + __os_free(dbenv, answer); + return (ret); + } + + answer->ai_family = AF_INET; + answer->ai_protocol = IPPROTO_TCP; + answer->ai_socktype = SOCK_STREAM; + answer->ai_addrlen = sizeof(sin); + memcpy(answer->ai_addr, &sin, sizeof(sin)); + *res = answer; + + return (0); +#endif /* HAVE_GETADDRINFO */ +} + +/* + * __db_freeaddrinfo -- + * + * PUBLIC: #if defined(HAVE_REPLICATION_THREADS) + * PUBLIC: void __db_freeaddrinfo __P((DB_ENV *, ADDRINFO *)); + * PUBLIC: #endif + */ +void +__db_freeaddrinfo(dbenv, ai) + DB_ENV *dbenv; + ADDRINFO *ai; +{ +#ifdef HAVE_GETADDRINFO + COMPQUIET(dbenv, NULL); + + freeaddrinfo(ai); +#else + ADDRINFO *next, *tmpaddr; + + for (next = ai; next != NULL; next = tmpaddr) { + if (next->ai_canonname != NULL) + __os_free(dbenv, next->ai_canonname); + + if (next->ai_addr != NULL) + __os_free(dbenv, next->ai_addr); + + tmpaddr = next->ai_next; + __os_free(dbenv, next); + } +#endif +} diff --git a/db/clib/getcwd.c b/db/clib/getcwd.c index ec28f1fb6..7a2ce2d7d 100644 --- a/db/clib/getcwd.c +++ b/db/clib/getcwd.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1989, 1991, 1993 @@ -32,15 +32,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: getcwd.c,v 11.15 2004/01/28 03:35:52 bostic Exp $ + * $Id: getcwd.c,v 12.5 2006/08/24 14:45:09 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#include +#include "db_int.h" +#ifndef NO_SYSTEM_INCLUDES #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) @@ -57,15 +56,8 @@ # include # endif #endif - -#include -#include -#include -#include #endif -#include "db_int.h" - #define ISDOT(dp) \ (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) diff --git a/db/clib/getopt.c b/db/clib/getopt.c index 527ee6967..86b436809 100644 --- a/db/clib/getopt.c +++ b/db/clib/getopt.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1987, 1993, 1994 @@ -32,17 +32,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: getopt.c,v 11.9 2004/01/28 03:35:52 bostic Exp $ + * $Id: getopt.c,v 12.4 2006/08/24 14:45:10 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#include -#include -#endif - #include "db_int.h" int __db_getopt_reset; /* global reset for VxWorks. */ diff --git a/db/clib/isalpha.c b/db/clib/isalpha.c new file mode 100644 index 000000000..7d77d8dad --- /dev/null +++ b/db/clib/isalpha.c @@ -0,0 +1,29 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2005-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: isalpha.c,v 1.2 2006/08/24 14:45:10 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * isalpha -- + * + * PUBLIC: #ifndef HAVE_ISALPHA + * PUBLIC: int isalpha __P((int)); + * PUBLIC: #endif + */ +int +isalpha(c) + int c; +{ + /* + * Depends on ASCII-like character ordering. + */ + return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ? 1 : 0); +} diff --git a/db/clib/isdigit.c b/db/clib/isdigit.c new file mode 100644 index 000000000..95c490f84 --- /dev/null +++ b/db/clib/isdigit.c @@ -0,0 +1,29 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2005-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: isdigit.c,v 1.2 2006/08/24 14:45:10 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * isdigit -- + * + * PUBLIC: #ifndef HAVE_ISDIGIT + * PUBLIC: int isdigit __P((int)); + * PUBLIC: #endif + */ +int +isdigit(c) + int c; +{ + /* + * Depends on ASCII-like character ordering. + */ + return (c >= '0' && c <= '9' ? 1 : 0); +} diff --git a/db/clib/isprint.c b/db/clib/isprint.c new file mode 100644 index 000000000..481b64772 --- /dev/null +++ b/db/clib/isprint.c @@ -0,0 +1,29 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2005-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: isprint.c,v 1.2 2006/08/24 14:45:10 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * isprint -- + * + * PUBLIC: #ifndef HAVE_ISPRINT + * PUBLIC: int isprint __P((int)); + * PUBLIC: #endif + */ +int +isprint(c) + int c; +{ + /* + * Depends on ASCII character values. + */ + return ((c >= ' ' && c <= '~') ? 1 : 0); +} diff --git a/db/clib/isspace.c b/db/clib/isspace.c new file mode 100644 index 000000000..18ed4dcfc --- /dev/null +++ b/db/clib/isspace.c @@ -0,0 +1,27 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2005-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: isspace.c,v 1.2 2006/08/24 14:45:10 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * isspace -- + * + * PUBLIC: #ifndef HAVE_ISSPACE + * PUBLIC: int isspace __P((int)); + * PUBLIC: #endif + */ +int +isspace(c) + int c; +{ + return (c == '\t' || c == '\n' || + c == '\v' || c == '\f' || c == '\r' || c == ' ' ? 1 : 0); +} diff --git a/db/clib/memcmp.c b/db/clib/memcmp.c index 055a2f5fa..8b4f4c347 100644 --- a/db/clib/memcmp.c +++ b/db/clib/memcmp.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993 @@ -32,14 +32,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: memcmp.c,v 11.9 2004/01/28 03:35:52 bostic Exp $ + * $Id: memcmp.c,v 12.4 2006/08/24 14:45:10 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif +#include "db_int.h" /* * memcmp -- @@ -50,7 +48,7 @@ */ int memcmp(s1, s2, n) - char *s1, *s2; + const void *s1, *s2; size_t n; { if (n != 0) { diff --git a/db/clib/memmove.c b/db/clib/memmove.c index 60ece571d..b52ffbea0 100644 --- a/db/clib/memmove.c +++ b/db/clib/memmove.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993 @@ -32,14 +32,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: memmove.c,v 11.8 2004/01/28 03:35:52 bostic Exp $ + * $Id: memmove.c,v 12.5 2006/08/24 14:45:10 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif +#include "db_int.h" /* * sizeof(word) MUST BE A POWER OF TWO @@ -102,13 +100,13 @@ bcopy(src0, dst0, length) /* * Copy forward. */ - t = (int)src; /* only need low bits */ - if ((t | (int)dst) & wmask) { + t = (size_t)src; /* only need low bits */ + if ((t | (size_t)dst) & wmask) { /* * Try to align operands. This cannot be done * unless the low bits match. */ - if ((t ^ (int)dst) & wmask || length < wsize) + if ((t ^ (size_t)dst) & wmask || length < wsize) t = length; else t = wsize - (t & wmask); @@ -130,9 +128,9 @@ bcopy(src0, dst0, length) */ src += length; dst += length; - t = (int)src; - if ((t | (int)dst) & wmask) { - if ((t ^ (int)dst) & wmask || length <= wsize) + t = (size_t)src; + if ((t | (size_t)dst) & wmask) { + if ((t ^ (size_t)dst) & wmask || length <= wsize) t = length; else t &= wmask; diff --git a/db/clib/printf.c b/db/clib/printf.c new file mode 100644 index 000000000..62c1daf0f --- /dev/null +++ b/db/clib/printf.c @@ -0,0 +1,143 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2005-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: printf.c,v 1.5 2006/09/13 19:10:57 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * printf -- + * + * PUBLIC: #ifndef HAVE_PRINTF + * PUBLIC: int printf __P((const char *, ...)); + * PUBLIC: #endif + */ +#ifndef HAVE_PRINTF +int +#ifdef STDC_HEADERS +printf(const char *fmt, ...) +#else +printf(fmt, va_alist) + const char *fmt; + va_dcl +#endif +{ + va_list ap; + size_t len; + char buf[2048]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ + +#ifdef STDC_HEADERS + va_start(ap, fmt); +#else + va_start(ap); +#endif + len = (size_t)vsnprintf(buf, sizeof(buf), fmt, ap); +#ifdef HAVE_BREW + /* + * The BREW vsnprintf function return count includes the trailing + * nul-termination character. + */ + if (len > 0 && len <= sizeof(buf) && buf[len - 1] == '\0') + --len; +#endif + + va_end(ap); + + /* + * We implement printf/fprintf with fwrite, because Berkeley DB uses + * fwrite in other places. + */ + return (fwrite( + buf, sizeof(char), (size_t)len, stdout) == len ? (int)len: -1); +} +#endif /* HAVE_PRINTF */ + +/* + * fprintf -- + * + * PUBLIC: #ifndef HAVE_PRINTF + * PUBLIC: int fprintf __P((FILE *, const char *, ...)); + * PUBLIC: #endif + */ +#ifndef HAVE_PRINTF +int +#ifdef STDC_HEADERS +fprintf(FILE *fp, const char *fmt, ...) +#else +fprintf(fp, fmt, va_alist) + FILE *fp; + const char *fmt; + va_dcl +#endif +{ + va_list ap; + size_t len; + char buf[2048]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ + +#ifdef STDC_HEADERS + va_start(ap, fmt); +#else + va_start(ap); +#endif + len = vsnprintf(buf, sizeof(buf), fmt, ap); +#ifdef HAVE_BREW + /* + * The BREW vsnprintf function return count includes the trailing + * nul-termination character. + */ + if (len > 0 && len <= sizeof(buf) && buf[len - 1] == '\0') + --len; +#endif + + va_end(ap); + + /* + * We implement printf/fprintf with fwrite, because Berkeley DB uses + * fwrite in other places. + */ + return (fwrite( + buf, sizeof(char), (size_t)len, fp) == len ? (int)len: -1); +} +#endif /* HAVE_PRINTF */ + +/* + * vfprintf -- + * + * PUBLIC: #ifndef HAVE_PRINTF + * PUBLIC: int vfprintf __P((FILE *, const char *, va_list)); + * PUBLIC: #endif + */ +#ifndef HAVE_PRINTF +int +vfprintf(fp, fmt, ap) + FILE *fp; + const char *fmt; + va_list ap; +{ + size_t len; + char buf[2048]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ + + len = vsnprintf(buf, sizeof(buf), fmt, ap); +#ifdef HAVE_BREW + /* + * The BREW vsnprintf function return count includes the trailing + * nul-termination character. + */ + if (len > 0 && len <= sizeof(buf) && buf[len - 1] == '\0') + --len; +#endif + + /* + * We implement printf/fprintf with fwrite, because Berkeley DB uses + * fwrite in other places. + */ + return (fwrite( + buf, sizeof(char), (size_t)len, fp) == len ? (int)len: -1); +} +#endif /* HAVE_PRINTF */ diff --git a/db/clib/raise.c b/db/clib/raise.c index 2f9e8cb80..1c5b87589 100644 --- a/db/clib/raise.c +++ b/db/clib/raise.c @@ -1,18 +1,15 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1997-2006 + * Oracle Corporation. All rights reserved. * - * $Id: raise.c,v 11.8 2004/01/28 03:35:52 bostic Exp $ + * $Id: raise.c,v 12.5 2006/08/24 14:45:10 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#include -#endif +#include "db_int.h" /* * raise -- @@ -26,9 +23,5 @@ int raise(s) int s; { - /* - * Do not use __os_id(), as it may not return the process ID -- any - * system with kill(3) probably has getpid(3). - */ return (kill(getpid(), s)); } diff --git a/db/clib/rand.c b/db/clib/rand.c new file mode 100644 index 000000000..f46248b91 --- /dev/null +++ b/db/clib/rand.c @@ -0,0 +1,27 @@ +/* + * Copied from the ANSI C standard 4.10.2.2. + */ +#include "db_config.h" + +#include "db_int.h" + +/* + * rand, srand -- + * + * PUBLIC: #ifndef HAVE_RAND + * PUBLIC: int rand __P((void)); + * PUBLIC: void srand __P((unsigned int)); + * PUBLIC: #endif + */ +static unsigned long int next = 1; + +int rand(void) /* RAND_MAX assumed to be 32767 */ +{ + next = next * 1103515245 + 12345; + return (unsigned int) (next/65536) % 32768; +} + +void srand(unsigned int seed) +{ + next = seed; +} diff --git a/db/clib/snprintf.c b/db/clib/snprintf.c index e1bc5d112..f568713c0 100644 --- a/db/clib/snprintf.c +++ b/db/clib/snprintf.c @@ -1,23 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: snprintf.c,v 11.18 2004/09/22 03:32:43 bostic Exp $ + * $Id: snprintf.c,v 12.4 2006/08/24 14:45:10 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#include -#include /* Declare STDERR_FILENO. */ -#endif - #include "db_int.h" #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) diff --git a/db/clib/strcasecmp.c b/db/clib/strcasecmp.c index e8365c451..7510f2385 100644 --- a/db/clib/strcasecmp.c +++ b/db/clib/strcasecmp.c @@ -30,14 +30,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: strcasecmp.c,v 1.8 2004/01/28 03:35:52 bostic Exp $ + * $Id: strcasecmp.c,v 12.1 2006/05/05 14:53:08 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif +#include "db_int.h" /* * This array is designed for mapping upper and lower case letter diff --git a/db/clib/strcat.c b/db/clib/strcat.c new file mode 100644 index 000000000..65ca40d6a --- /dev/null +++ b/db/clib/strcat.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * strcat -- + * + * PUBLIC: #ifndef HAVE_STRCAT + * PUBLIC: char *strcat __P((char *, const char *)); + * PUBLIC: #endif + */ +char * +strcat(char *s, const char *append) +{ + char *save = s; + + for (; *s; ++s); + while ((*s++ = *append++)); + return(save); +} diff --git a/db/clib/strchr.c b/db/clib/strchr.c new file mode 100644 index 000000000..a8ac4ce05 --- /dev/null +++ b/db/clib/strchr.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * strchr -- + * + * PUBLIC: #ifndef HAVE_STRCHR + * PUBLIC: char *strchr __P((const char *, int)); + * PUBLIC: #endif + */ +char *strchr(const char *p, int ch) +{ + char c; + + c = ch; + for (;; ++p) { + if (*p == c) + return ((char *)p); + if (*p == '\0') + return (NULL); + } + /* NOTREACHED */ +} diff --git a/db/clib/strdup.c b/db/clib/strdup.c index 9c451d328..b15d3b3ca 100644 --- a/db/clib/strdup.c +++ b/db/clib/strdup.c @@ -30,18 +30,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: strdup.c,v 1.6 2004/01/28 03:35:52 bostic Exp $ + * $Id: strdup.c,v 12.1 2006/05/05 14:53:08 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#include -#endif +#include "db_int.h" /* * strdup -- diff --git a/db/clib/strerror.c b/db/clib/strerror.c index e0710add2..f5c303988 100644 --- a/db/clib/strerror.c +++ b/db/clib/strerror.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1997-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1988, 1993 @@ -32,13 +32,168 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: strerror.c,v 11.8 2004/01/28 03:35:52 bostic Exp $ + * $Id: strerror.c,v 12.7 2006/08/24 14:45:10 bostic Exp $ + */ + +/* + * Copyright (c) 1982, 1985, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * __FBSDID("FreeBSD: /repoman/r/ncvs/src/lib/libc/gen/errlst.c,v 1.8 2005/04/02 12:33:28 das Exp $"); */ #include "db_config.h" +#include "db_int.h" + +static const char *__db_errlist[] = { + "Undefined error: 0", /* 0 - ENOERROR */ + "Operation not permitted", /* 1 - EPERM */ + "No such file or directory", /* 2 - ENOENT */ + "No such process", /* 3 - ESRCH */ + "Interrupted system call", /* 4 - EINTR */ + "Input/output error", /* 5 - EIO */ + "Device not configured", /* 6 - ENXIO */ + "Argument list too long", /* 7 - E2BIG */ + "Exec format error", /* 8 - ENOEXEC */ + "Bad file descriptor", /* 9 - EBADF */ + "No child processes", /* 10 - ECHILD */ + "Resource deadlock avoided", /* 11 - EDEADLK */ + "Cannot allocate memory", /* 12 - ENOMEM */ + "Permission denied", /* 13 - EACCES */ + "Bad address", /* 14 - EFAULT */ + "Block device required", /* 15 - ENOTBLK */ + "Device busy", /* 16 - EBUSY */ + "File exists", /* 17 - EEXIST */ + "Cross-device link", /* 18 - EXDEV */ + "Operation not supported by device", /* 19 - ENODEV */ + "Not a directory", /* 20 - ENOTDIR */ + "Is a directory", /* 21 - EISDIR */ + "Invalid argument", /* 22 - EINVAL */ + "Too many open files in system", /* 23 - ENFILE */ + "Too many open files", /* 24 - EMFILE */ + "Inappropriate ioctl for device", /* 25 - ENOTTY */ + "Text file busy", /* 26 - ETXTBSY */ + "File too large", /* 27 - EFBIG */ + "No space left on device", /* 28 - ENOSPC */ + "Illegal seek", /* 29 - ESPIPE */ + "Read-only file system", /* 30 - EROFS */ + "Too many links", /* 31 - EMLINK */ + "Broken pipe", /* 32 - EPIPE */ + +/* math software */ + "Numerical argument out of domain", /* 33 - EDOM */ + "Result too large", /* 34 - ERANGE */ + +/* non-blocking and interrupt i/o */ + "Resource temporarily unavailable", /* 35 - EAGAIN */ + /* 35 - EWOULDBLOCK */ + "Operation now in progress", /* 36 - EINPROGRESS */ + "Operation already in progress", /* 37 - EALREADY */ + +/* ipc/network software -- argument errors */ + "Socket operation on non-socket", /* 38 - ENOTSOCK */ + "Destination address required", /* 39 - EDESTADDRREQ */ + "Message too long", /* 40 - EMSGSIZE */ + "Protocol wrong type for socket", /* 41 - EPROTOTYPE */ + "Protocol not available", /* 42 - ENOPROTOOPT */ + "Protocol not supported", /* 43 - EPROTONOSUPPORT */ + "Socket type not supported", /* 44 - ESOCKTNOSUPPORT */ + "Operation not supported", /* 45 - EOPNOTSUPP */ + "Protocol family not supported", /* 46 - EPFNOSUPPORT */ + /* 47 - EAFNOSUPPORT */ + "Address family not supported by protocol family", + "Address already in use", /* 48 - EADDRINUSE */ + "Can't assign requested address", /* 49 - EADDRNOTAVAIL */ + +/* ipc/network software -- operational errors */ + "Network is down", /* 50 - ENETDOWN */ + "Network is unreachable", /* 51 - ENETUNREACH */ + "Network dropped connection on reset", /* 52 - ENETRESET */ + "Software caused connection abort", /* 53 - ECONNABORTED */ + "Connection reset by peer", /* 54 - ECONNRESET */ + "No buffer space available", /* 55 - ENOBUFS */ + "Socket is already connected", /* 56 - EISCONN */ + "Socket is not connected", /* 57 - ENOTCONN */ + "Can't send after socket shutdown", /* 58 - ESHUTDOWN */ + "Too many references: can't splice", /* 59 - ETOOMANYREFS */ + "Operation timed out", /* 60 - ETIMEDOUT */ + "Connection refused", /* 61 - ECONNREFUSED */ + + "Too many levels of symbolic links", /* 62 - ELOOP */ + "File name too long", /* 63 - ENAMETOOLONG */ + +/* should be rearranged */ + "Host is down", /* 64 - EHOSTDOWN */ + "No route to host", /* 65 - EHOSTUNREACH */ + "Directory not empty", /* 66 - ENOTEMPTY */ + +/* quotas & mush */ + "Too many processes", /* 67 - EPROCLIM */ + "Too many users", /* 68 - EUSERS */ + "Disc quota exceeded", /* 69 - EDQUOT */ + +/* Network File System */ + "Stale NFS file handle", /* 70 - ESTALE */ + "Too many levels of remote in path", /* 71 - EREMOTE */ + "RPC struct is bad", /* 72 - EBADRPC */ + "RPC version wrong", /* 73 - ERPCMISMATCH */ + "RPC prog. not avail", /* 74 - EPROGUNAVAIL */ + "Program version wrong", /* 75 - EPROGMISMATCH */ + "Bad procedure for program", /* 76 - EPROCUNAVAIL */ + + "No locks available", /* 77 - ENOLCK */ + "Function not implemented", /* 78 - ENOSYS */ + "Inappropriate file type or format", /* 79 - EFTYPE */ + "Authentication error", /* 80 - EAUTH */ + "Need authenticator", /* 81 - ENEEDAUTH */ + "Identifier removed", /* 82 - EIDRM */ + "No message of desired type", /* 83 - ENOMSG */ + "Value too large to be stored in data type", /* 84 - EOVERFLOW */ + "Operation canceled", /* 85 - ECANCELED */ + "Illegal byte sequence", /* 86 - EILSEQ */ + "Attribute not found", /* 87 - ENOATTR */ + +/* General */ + "Programming error", /* 88 - EDOOFUS */ + + "Bad message", /* 89 - EBADMSG */ + "Multihop attempted", /* 90 - EMULTIHOP */ + "Link has been severed", /* 91 - ENOLINK */ + "Protocol error", /* 92 - EPROTO */ +}; +static int __db_nerr = sizeof(__db_errlist) / sizeof(__db_errlist[0]); + /* - * strerror -- + * __db_strerror -- * Return the string associated with an errno. * * PUBLIC: #ifndef HAVE_STRERROR @@ -49,27 +204,8 @@ char * strerror(num) int num; { - extern int sys_nerr; - extern char *sys_errlist[]; -#undef UPREFIX -#define UPREFIX "Unknown error: " - static char ebuf[40] = UPREFIX; /* 64-bit number + slop */ - int errnum; - char *p, *t, tmp[40]; - - errnum = num; /* convert to unsigned */ - if (errnum < sys_nerr) - return(sys_errlist[errnum]); - - /* Do this by hand, so we don't include stdio(3). */ - t = tmp; - do { - *t++ = "0123456789"[errnum % 10]; - } while (errnum /= 10); - for (p = ebuf + sizeof(UPREFIX) - 1;;) { - *p++ = *--t; - if (t <= tmp) - break; - } - return(ebuf); + if (num >= 0 && num < __db_nerr) + return ((char *)__db_errlist[num]); + + return (__db_unknown_error(num)); } diff --git a/db/clib/strncat.c b/db/clib/strncat.c new file mode 100644 index 000000000..ce8273a45 --- /dev/null +++ b/db/clib/strncat.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * strncat -- + * + * PUBLIC: #ifndef HAVE_STRNCAT + * PUBLIC: char *strncat __P((char *, const char *, size_t)); + * PUBLIC: #endif + */ +/* + * Concatenate src on the end of dst. At most strlen(dst)+n+1 bytes + * are written at dst (at most n+1 bytes being appended). Return dst. + */ +char * +strncat(char *dst, const char *src, size_t n) +{ + if (n != 0) { + char *d = dst; + const char *s = src; + + while (*d != 0) + d++; + do { + if ((*d = *s++) == 0) + break; + d++; + } while (--n != 0); + *d = 0; + } + return (dst); +} diff --git a/db/clib/strncmp.c b/db/clib/strncmp.c new file mode 100644 index 000000000..9738b5b2b --- /dev/null +++ b/db/clib/strncmp.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * strncmp -- + * + * PUBLIC: #ifndef HAVE_STRNCMP + * PUBLIC: int strncmp __P((const char *, const char *, size_t)); + * PUBLIC: #endif + */ +int +strncmp(s1, s2, n) + const char *s1, *s2; + size_t n; +{ + + if (n == 0) + return (0); + do { + if (*s1 != *s2++) + return (*(const unsigned char *)s1 - + *(const unsigned char *)(s2 - 1)); + if (*s1++ == 0) + break; + } while (--n != 0); + return (0); +} diff --git a/db/clib/strrchr.c b/db/clib/strrchr.c new file mode 100644 index 000000000..8753e943c --- /dev/null +++ b/db/clib/strrchr.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * strrchr -- + * + * PUBLIC: #ifndef HAVE_STRRCHR + * PUBLIC: char *strrchr __P((const char *, int)); + * PUBLIC: #endif + */ +char *strrchr(const char *p, int ch) +{ + char *save; + char c; + + c = ch; + for (save = NULL;; ++p) { + if (*p == c) + save = (char *)p; + if (*p == '\0') + return (save); + } + /* NOTREACHED */ +} diff --git a/db/clib/strsep.c b/db/clib/strsep.c new file mode 100644 index 000000000..f79d0f5c5 --- /dev/null +++ b/db/clib/strsep.c @@ -0,0 +1,80 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * Get next token from string *stringp, where tokens are possibly-empty + * strings separated by characters from delim. + * + * Writes NULs into the string at *stringp to end tokens. + * delim need not remain constant from call to call. + * On return, *stringp points past the last NUL written (if there might + * be further tokens), or is NULL (if there are definitely no more tokens). + * + * If *stringp is NULL, strsep returns NULL. + * + * PUBLIC: #ifndef HAVE_STRSEP + * PUBLIC: char *strsep __P((char **, const char *)); + * PUBLIC: #endif + */ +char * +strsep(stringp, delim) + char **stringp; + const char *delim; +{ + char *s; + const char *spanp; + int c, sc; + char *tok; + + if ((s = *stringp) == NULL) + return (NULL); + for (tok = s;;) { + c = *s++; + spanp = delim; + do { + if ((sc = *spanp++) == c) { + if (c == 0) + s = NULL; + else + s[-1] = 0; + *stringp = s; + return (tok); + } + } while (sc != 0); + } + /* NOTREACHED */ +} diff --git a/db/clib/strtol.c b/db/clib/strtol.c index 09e952dc5..fa8e6250c 100644 --- a/db/clib/strtol.c +++ b/db/clib/strtol.c @@ -30,24 +30,22 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: strtol.c,v 1.3 2004/10/28 19:27:19 bostic Exp $ + * $Id: strtol.c,v 12.3 2006/05/28 14:04:59 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#include -#include -#include -#include -#endif +#include "db_int.h" /* * Convert a string to a long integer. * * Assumes that the upper and lower case * alphabets and digits are each contiguous. + * + * PUBLIC: #ifndef HAVE_STRTOL + * PUBLIC: long strtol __P((const char *, char **, int)); + * PUBLIC: #endif */ long strtol(nptr, endptr, base) @@ -137,7 +135,7 @@ strtol(nptr, endptr, base) noconv: errno = EINVAL; } else if (neg) - acc = -acc; + acc = -(long)acc; if (endptr != NULL) *endptr = (char *)(any ? s - 1 : nptr); return (acc); diff --git a/db/clib/strtoul.c b/db/clib/strtoul.c index e4356963b..a4b4117a4 100644 --- a/db/clib/strtoul.c +++ b/db/clib/strtoul.c @@ -30,24 +30,22 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: strtoul.c,v 1.3 2004/10/28 19:27:19 bostic Exp $ + * $Id: strtoul.c,v 12.2 2006/05/28 14:04:59 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#include -#include -#include -#include -#endif +#include "db_int.h" /* * Convert a string to an unsigned long integer. * * Assumes that the upper and lower case * alphabets and digits are each contiguous. + * + * PUBLIC: #ifndef HAVE_STRTOUL + * PUBLIC: unsigned long strtoul __P((const char *, char **, int)); + * PUBLIC: #endif */ unsigned long strtoul(nptr, endptr, base) diff --git a/db/common/crypto_stub.c b/db/common/crypto_stub.c index 68f06b4c8..991622b91 100644 --- a/db/common/crypto_stub.c +++ b/db/common/crypto_stub.c @@ -1,10 +1,10 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: crypto_stub.c,v 1.4 2004/01/28 03:35:52 bostic Exp $ + * $Id: crypto_stub.c,v 12.5 2006/08/24 14:45:10 bostic Exp $ */ #include "db_config.h" @@ -32,14 +32,14 @@ __crypto_region_init(dbenv) infop = dbenv->reginfo; renv = infop->primary; - MUTEX_LOCK(dbenv, &renv->mutex); + MUTEX_LOCK(dbenv, renv->mtx_regenv); ret = !(renv->cipher_off == INVALID_ROFF); - MUTEX_UNLOCK(dbenv, &renv->mutex); + MUTEX_UNLOCK(dbenv, renv->mtx_regenv); if (ret == 0) return (0); - __db_err(dbenv, + __db_errx(dbenv, "Encrypted environment: library build did not include cryptography support"); return (DB_OPNOTSUP); } diff --git a/db/common/db_byteorder.c b/db/common/db_byteorder.c index 0a48055c8..2aa85dfc9 100644 --- a/db/common/db_byteorder.c +++ b/db/common/db_byteorder.c @@ -1,18 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_byteorder.c,v 11.10 2004/01/28 03:35:52 bostic Exp $ + * $Id: db_byteorder.c,v 12.5 2006/08/24 14:45:10 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" /* @@ -64,7 +60,7 @@ __db_byteorder(dbenv, lorder) return (DB_SWAPBYTES); break; default: - __db_err(dbenv, + __db_errx(dbenv, "unsupported byte order, only big and little-endian supported"); return (EINVAL); } diff --git a/db/common/db_clock.c b/db/common/db_clock.c new file mode 100644 index 000000000..190ee5924 --- /dev/null +++ b/db/common/db_clock.c @@ -0,0 +1,31 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2005-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: db_clock.c,v 1.5 2006/08/24 14:45:11 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * __db_difftime -- + * + * Compute the difference in seconds and microseconds of two timers. + * + * PUBLIC: void __db_difftime __P((u_int32_t, u_int32_t, u_int32_t, u_int32_t, + * PUBLIC: u_int32_t *, u_int32_t *)); + */ +void +__db_difftime(ssec, esec, susec, eusec, secp, usecp) + u_int32_t ssec, esec, susec, eusec, *secp, *usecp; +{ + if ((*secp = esec - ssec) != 0 && eusec < susec) { + (*secp)--; + eusec += 1000000; + } + *usecp = eusec - susec; +} diff --git a/db/common/db_err.c b/db/common/db_err.c index 6e49e7941..0c11148b9 100644 --- a/db/common/db_err.c +++ b/db/common/db_err.c @@ -1,27 +1,20 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_err.c,v 11.123 2004/09/22 03:07:50 bostic Exp $ + * $Id: db_err.c,v 12.44 2006/09/13 14:53:34 mjc Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/db_am.h" -#include "dbinc/db_shash.h" #include "dbinc/lock.h" #include "dbinc/log.h" +#include "dbinc/mp.h" #include "dbinc/txn.h" static void __db_msgcall __P((const DB_ENV *, const char *, va_list)); @@ -71,7 +64,7 @@ __db_ferr(dbenv, name, iscombo) const char *name; int iscombo; { - __db_err(dbenv, "illegal flag %sspecified to %s", + __db_errx(dbenv, "illegal flag %sspecified to %s", iscombo ? "combination " : "", name); return (EINVAL); } @@ -87,8 +80,8 @@ __db_fnl(dbenv, name) const DB_ENV *dbenv; const char *name; { - __db_err(dbenv, - "%s: the DB_DIRTY_READ, DB_DEGREE_2 and DB_RMW flags require locking", + __db_errx(dbenv, + "%s: DB_READ_COMMITTED, DB_READ_UNCOMMITTED and DB_RMW require locking", name); return (EINVAL); } @@ -110,7 +103,7 @@ __db_pgerr(dbp, pgno, errval) * Death, taxes, and lost data. * Guess which has occurred. */ - __db_err(dbp->dbenv, + __db_errx(dbp->dbenv, "unable to create/retrieve page %lu", (u_long)pgno); return (__db_panic(dbp->dbenv, errval)); } @@ -126,7 +119,7 @@ __db_pgfmt(dbenv, pgno) DB_ENV *dbenv; db_pgno_t pgno; { - __db_err(dbenv, "page %lu: illegal page type or format", (u_long)pgno); + __db_errx(dbenv, "page %lu: illegal page type or format", (u_long)pgno); return (__db_panic(dbenv, EINVAL)); } @@ -136,22 +129,18 @@ __db_pgfmt(dbenv, pgno) * Error when an assertion fails. Only checked if #DIAGNOSTIC defined. * * PUBLIC: #ifdef DIAGNOSTIC - * PUBLIC: void __db_assert __P((const char *, const char *, int)); + * PUBLIC: void __db_assert __P((DB_ENV *, const char *, const char *, int)); * PUBLIC: #endif */ void -__db_assert(failedexpr, file, line) - const char *failedexpr, *file; +__db_assert(dbenv, e, file, line) + DB_ENV *dbenv; + const char *e, *file; int line; { - (void)fprintf(stderr, - "__db_assert: \"%s\" failed: file \"%s\", line %d\n", - failedexpr, file, line); - (void)fflush(stderr); + __db_errx(dbenv, "assert failure: %s/%d: \"%s\"", file, line, e); - /* We want a stack trace of how this could possibly happen. */ abort(); - /* NOTREACHED */ } #endif @@ -166,12 +155,17 @@ int __db_panic_msg(dbenv) DB_ENV *dbenv; { - __db_err(dbenv, "PANIC: fatal region error detected; run recovery"); + int ret; - if (dbenv->db_paniccall != NULL) - dbenv->db_paniccall(dbenv, DB_RUNRECOVERY); + ret = DB_RUNRECOVERY; - return (DB_RUNRECOVERY); + __db_errx(dbenv, "PANIC: fatal region error detected; run recovery"); + + if (dbenv->db_paniccall != NULL) /* Deprecated */ + dbenv->db_paniccall(dbenv, ret); + DB_EVENT(dbenv, DB_EVENT_PANIC, &ret); + + return (ret); } /* @@ -186,12 +180,13 @@ __db_panic(dbenv, errval) int errval; { if (dbenv != NULL) { - PANIC_SET(dbenv, 1); + __db_panic_set(dbenv, 1); - __db_err(dbenv, "PANIC: %s", db_strerror(errval)); + __db_err(dbenv, errval, "PANIC"); - if (dbenv->db_paniccall != NULL) + if (dbenv->db_paniccall != NULL) /* Deprecated */ dbenv->db_paniccall(dbenv, errval); + DB_EVENT(dbenv, DB_EVENT_PANIC, &errval); } #if defined(DIAGNOSTIC) && !defined(CONFIG_TEST) @@ -203,6 +198,7 @@ __db_panic(dbenv, errval) * under certain conditions. */ abort(); + /* NOTREACHED */ #endif /* @@ -213,6 +209,22 @@ __db_panic(dbenv, errval) return (DB_RUNRECOVERY); } +/* + * __db_panic_set -- + * Set/clear unrecoverable error. + * + * PUBLIC: void __db_panic_set __P((DB_ENV *, int)); + */ +void +__db_panic_set(dbenv, on) + DB_ENV *dbenv; + int on; +{ + if (dbenv != NULL && dbenv->reginfo != NULL) + ((REGENV *) + ((REGINFO *)dbenv->reginfo)->primary)->panic = on ? 1 : 0; +} + /* * db_strerror -- * ANSI C strerror(3) for DB. @@ -230,7 +242,7 @@ db_strerror(error) if (error > 0) { if ((p = strerror(error)) != NULL) return (p); - goto unknown_err; + return (__db_unknown_error(error)); } /* @@ -275,17 +287,22 @@ db_strerror(error) return ("DB_REP_HANDLE_DEAD: Handle is no longer valid"); case DB_REP_HOLDELECTION: return ("DB_REP_HOLDELECTION: Need to hold an election"); + case DB_REP_IGNORE: + return ("DB_REP_IGNORE: Replication record ignored"); case DB_REP_ISPERM: return ("DB_REP_ISPERM: Permanent record written"); + case DB_REP_JOIN_FAILURE: + return + ("DB_REP_JOIN_FAILURE: Unable to join replication group"); + case DB_REP_LOCKOUT: + return + ("DB_REP_LOCKOUT: Waiting for replication recovery to complete"); case DB_REP_NEWMASTER: return ("DB_REP_NEWMASTER: A new master has declared itself"); case DB_REP_NEWSITE: return ("DB_REP_NEWSITE: A new site has entered the system"); case DB_REP_NOTPERM: return ("DB_REP_NOTPERM: Permanent log record not written"); - case DB_REP_STARTUPDONE: - return - ("DB_REP_STARTUPDONE: Client completed startup synchronization."); case DB_REP_UNAVAIL: return ("DB_REP_UNAVAIL: Unable to elect a master"); case DB_RUNRECOVERY: @@ -302,39 +319,99 @@ db_strerror(error) break; } -unknown_err: { - /* - * !!! - * Room for a 64-bit number + slop. This buffer is only used - * if we're given an unknown error, which should never happen. - * Note, however, we're no longer thread-safe if it does. - */ - static char ebuf[40]; + return (__db_unknown_error(error)); +} - (void)snprintf(ebuf, sizeof(ebuf), "Unknown error: %d", error); - return (ebuf); - } +/* + * __db_unknown_error -- + * Format an unknown error value into a static buffer. + * + * PUBLIC: char *__db_unknown_error __P((int)); + */ +char * +__db_unknown_error(error) + int error; +{ + /* + * !!! + * Room for a 64-bit number + slop. This buffer is only used + * if we're given an unknown error number, which should never + * happen. + * + * We're no longer thread-safe if it does happen, but the worst + * result is a corrupted error string because there will always + * be a trailing nul byte since the error buffer is nul filled + * and longer than any error message. + */ + static char ebuf[40]; + + (void)snprintf(ebuf, sizeof(ebuf), "Unknown error: %d", error); + return (ebuf); +} + +/* + * __db_syserr -- + * Standard DB system-specific error routine. The same as __db_err except + * we use a system-specific function to translate errors to strings. + * + * PUBLIC: void __db_syserr __P((const DB_ENV *, int, const char *, ...)) + * PUBLIC: __attribute__ ((__format__ (__printf__, 3, 4))); + */ +void +#ifdef STDC_HEADERS +__db_syserr(const DB_ENV *dbenv, int error, const char *fmt, ...) +#else +__db_syserr(dbenv, error fmt, va_alist) + const DB_ENV *dbenv; + int error; + const char *fmt; + va_dcl +#endif +{ + DB_REAL_ERR(dbenv, error, DB_ERROR_SYSTEM, 0, fmt); } /* * __db_err -- - * Standard DB error routine. The same as errx, except we don't write + * Standard DB error routine. The same as DB->err, except we don't write * to stderr if no output mechanism was specified. * - * PUBLIC: void __db_err __P((const DB_ENV *, const char *, ...)) + * PUBLIC: void __db_err __P((const DB_ENV *, int, const char *, ...)) + * PUBLIC: __attribute__ ((__format__ (__printf__, 3, 4))); + */ +void +#ifdef STDC_HEADERS +__db_err(const DB_ENV *dbenv, int error, const char *fmt, ...) +#else +__db_err(dbenv, error fmt, va_alist) + const DB_ENV *dbenv; + int error; + const char *fmt; + va_dcl +#endif +{ + DB_REAL_ERR(dbenv, error, DB_ERROR_SET, 0, fmt); +} + +/* + * __db_errx -- + * Standard DB error routine. The same as DB->errx, except we don't write + * to stderr if no output mechanism was specified. + * + * PUBLIC: void __db_errx __P((const DB_ENV *, const char *, ...)) * PUBLIC: __attribute__ ((__format__ (__printf__, 2, 3))); */ void #ifdef STDC_HEADERS -__db_err(const DB_ENV *dbenv, const char *fmt, ...) +__db_errx(const DB_ENV *dbenv, const char *fmt, ...) #else -__db_err(dbenv, fmt, va_alist) +__db_errx(dbenv, fmt, va_alist) const DB_ENV *dbenv; const char *fmt; va_dcl #endif { - DB_REAL_ERR(dbenv, 0, 0, 0, fmt); + DB_REAL_ERR(dbenv, 0, DB_ERROR_NOT_SET, 0, fmt); } /* @@ -342,25 +419,28 @@ __db_err(dbenv, fmt, va_alist) * Do the error message work for callback functions. * * PUBLIC: void __db_errcall - * PUBLIC: __P((const DB_ENV *, int, int, const char *, va_list)); + * PUBLIC: __P((const DB_ENV *, int, db_error_set_t, const char *, va_list)); */ void __db_errcall(dbenv, error, error_set, fmt, ap) const DB_ENV *dbenv; - int error, error_set; + int error; + db_error_set_t error_set; const char *fmt; va_list ap; { char *p; char buf[2048]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ + char sysbuf[1024]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ p = buf; if (fmt != NULL) p += vsnprintf(buf, sizeof(buf), fmt, ap); - if (error_set) + if (error_set != DB_ERROR_NOT_SET) p += snprintf(p, sizeof(buf) - (size_t)(p - buf), ": %s", - db_strerror(error)); + error_set == DB_ERROR_SET ? db_strerror(error) : + __os_strerror(error, sysbuf, sizeof(sysbuf))); dbenv->db_errcall(dbenv, dbenv->db_errpfx, buf); } @@ -370,16 +450,18 @@ __db_errcall(dbenv, error, error_set, fmt, ap) * Do the error message work for FILE *s. * * PUBLIC: void __db_errfile - * PUBLIC: __P((const DB_ENV *, int, int, const char *, va_list)); + * PUBLIC: __P((const DB_ENV *, int, db_error_set_t, const char *, va_list)); */ void __db_errfile(dbenv, error, error_set, fmt, ap) const DB_ENV *dbenv; - int error, error_set; + int error; + db_error_set_t error_set; const char *fmt; va_list ap; { FILE *fp; + char sysbuf[1024]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ fp = dbenv == NULL || dbenv->db_errfile == NULL ? stderr : dbenv->db_errfile; @@ -388,11 +470,13 @@ __db_errfile(dbenv, error, error_set, fmt, ap) (void)fprintf(fp, "%s: ", dbenv->db_errpfx); if (fmt != NULL) { (void)vfprintf(fp, fmt, ap); - if (error_set) + if (error_set != DB_ERROR_NOT_SET) (void)fprintf(fp, ": "); } - if (error_set) - (void)fprintf(fp, "%s", db_strerror(error)); + if (error_set != DB_ERROR_NOT_SET) + (void)fprintf(fp, "%s", + error_set == DB_ERROR_SET ? db_strerror(error) : + __os_strerror(error, sysbuf, sizeof(sysbuf))); (void)fprintf(fp, "\n"); (void)fflush(fp); } @@ -503,89 +587,63 @@ __db_msgfile(dbenv, fmt, ap) } /* - * __db_logmsg -- - * Write information into the DB log. + * __db_unknown_flag -- report internal error * - * PUBLIC: void __db_logmsg __P((const DB_ENV *, - * PUBLIC: DB_TXN *, const char *, u_int32_t, const char *, ...)) - * PUBLIC: __attribute__ ((__format__ (__printf__, 5, 6))); + * PUBLIC: int __db_unknown_flag __P((DB_ENV *, char *, u_int32_t)); */ -void -#ifdef STDC_HEADERS -__db_logmsg(const DB_ENV *dbenv, - DB_TXN *txnid, const char *opname, u_int32_t flags, const char *fmt, ...) -#else -__db_logmsg(dbenv, txnid, opname, flags, fmt, va_alist) - const DB_ENV *dbenv; - DB_TXN *txnid; - const char *opname, *fmt; - u_int32_t flags; - va_dcl -#endif +int +__db_unknown_flag(dbenv, routine, flag) + DB_ENV *dbenv; + char *routine; + u_int32_t flag; { - DBT opdbt, msgdbt; - DB_LSN lsn; - va_list ap; - char __logbuf[2048]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ - - if (!LOGGING_ON(dbenv)) - return; + __db_errx(dbenv, "%s: Unknown flag: %#x", routine, (u_int)flag); -#ifdef STDC_HEADERS - va_start(ap, fmt); -#else - va_start(ap); +#ifdef DIAGNOSTIC + abort(); + /* NOTREACHED */ #endif - memset(&opdbt, 0, sizeof(opdbt)); - opdbt.data = (void *)opname; - opdbt.size = (u_int32_t)(strlen(opname) + 1); - - memset(&msgdbt, 0, sizeof(msgdbt)); - msgdbt.data = __logbuf; - msgdbt.size = (u_int32_t)vsnprintf(__logbuf, sizeof(__logbuf), fmt, ap); - - va_end(ap); - - /* - * XXX - * Explicitly discard the const. Otherwise, we have to const DB_ENV - * references throughout the logging subsystem. - */ - (void)__db_debug_log( - (DB_ENV *)dbenv, txnid, &lsn, flags, &opdbt, -1, &msgdbt, NULL, 0); + return (EINVAL); } /* - * __db_unknown_flag -- report internal error + * __db_unknown_type -- report internal database type error * - * PUBLIC: int __db_unknown_flag __P((DB_ENV *, char *, u_int32_t)); + * PUBLIC: int __db_unknown_type __P((DB_ENV *, char *, DBTYPE)); */ int -__db_unknown_flag(dbenv, routine, flag) +__db_unknown_type(dbenv, routine, type) DB_ENV *dbenv; char *routine; - u_int32_t flag; + DBTYPE type; { - __db_err(dbenv, "%s: Unknown flag: %#x", routine, (u_int)flag); - DB_ASSERT(0); + __db_errx(dbenv, + "%s: Unexpected database type: %s", + routine, __db_dbtype_to_string(type)); + +#ifdef DIAGNOSTIC + abort(); + /* NOTREACHED */ +#endif return (EINVAL); } /* - * __db_unknown_type -- report internal error + * __db_unknown_path -- report unexpected database code path error. * - * PUBLIC: int __db_unknown_type __P((DB_ENV *, char *, DBTYPE)); + * PUBLIC: int __db_unknown_path __P((DB_ENV *, char *)); */ int -__db_unknown_type(dbenv, routine, type) +__db_unknown_path(dbenv, routine) DB_ENV *dbenv; char *routine; - DBTYPE type; { - __db_err(dbenv, - "%s: Unexpected DB type: %s", routine, __db_dbtype_to_string(type)); + __db_errx(dbenv, "%s: Unexpected code path error", routine); - DB_ASSERT(0); +#ifdef DIAGNOSTIC + abort(); + /* NOTREACHED */ +#endif return (EINVAL); } @@ -620,46 +678,49 @@ __db_check_txn(dbp, txn, assoc_lid, read_op) /* * Check for common transaction errors: - * Failure to pass a transaction handle to a DB operation - * Failure to configure the DB handle in a proper environment - * Operation on a handle whose open commit hasn't completed. - * - * Read operations don't require a txn even if we've used one before - * with this handle, although if they do have a txn, we'd better be - * prepared for it. + * an operation on a handle whose open commit hasn't completed. + * a transaction handle in a non-transactional environment + * a transaction handle for a non-transactional database */ - if (txn == NULL) { + if (txn == NULL || F_ISSET(txn, TXN_PRIVATE)) { + if (dbp->cur_lid >= TXN_MINIMUM) + goto open_err; + if (!read_op && F_ISSET(dbp, DB_AM_TXN)) { - __db_err(dbenv, - "DB handle previously used in transaction, missing transaction handle"); + __db_errx(dbenv, + "Transaction not specified for a transactional database"); return (EINVAL); } - - if (dbp->cur_lid >= TXN_MINIMUM) - goto open_err; + } else if (F_ISSET(txn, TXN_CDSGROUP)) { + if (!CDB_LOCKING(dbenv)) { + __db_errx(dbenv, + "CDS groups can only be used in a CDS environment"); + return (EINVAL); + } + /* + * CDS group handles can be passed to any method, since they + * only determine locker IDs. + */ + return (0); } else { - if (F_ISSET(txn, TXN_DEADLOCK)) { - __db_err(dbenv, - "Previous deadlock return not resolved"); + if (!TXN_ON(dbenv)) + return (__db_not_txn_env(dbenv)); + + if (!F_ISSET(dbp, DB_AM_TXN)) { + __db_errx(dbenv, + "Transaction specified for a non-transactional database"); return (EINVAL); } - if (dbp->cur_lid >= TXN_MINIMUM && - dbp->cur_lid != txn->txnid) { + + if (F_ISSET(txn, TXN_DEADLOCK)) + return (__db_txn_deadlock_err(dbenv)); + if (dbp->cur_lid >= TXN_MINIMUM && dbp->cur_lid != txn->txnid) { if ((ret = __lock_locker_is_parent(dbenv, dbp->cur_lid, txn->txnid, &isp)) != 0) return (ret); if (!isp) goto open_err; } - - if (!TXN_ON(dbenv)) - return (__db_not_txn_env(dbenv)); - - if (!F_ISSET(dbp, DB_AM_TXN)) { - __db_err(dbenv, - "Transaction specified for a DB handle opened outside a transaction"); - return (EINVAL); - } } /* @@ -679,18 +740,41 @@ __db_check_txn(dbp, txn, assoc_lid, read_op) */ if (!read_op && dbp->associate_lid != DB_LOCK_INVALIDID && txn != NULL && dbp->associate_lid != assoc_lid) { - __db_err(dbenv, + __db_errx(dbenv, "Operation forbidden while secondary index is being created"); return (EINVAL); } + /* + * Check the txn and dbp are from the same env. + */ + if (txn != NULL && dbenv != txn->mgrp->dbenv) { + __db_errx(dbenv, + "Transaction and database from different environments"); + return (EINVAL); + } + return (0); open_err: - __db_err(dbenv, + __db_errx(dbenv, "Transaction that opened the DB handle is still active"); return (EINVAL); } +/* + * __db_txn_deadlock_err -- + * Transaction has allready been deadlocked. + * + * PUBLIC: int __db_txn_deadlock_err __P((DB_ENV *)); + */ +int +__db_txn_deadlock_err(dbenv) + DB_ENV *dbenv; +{ + __db_errx(dbenv, "Previous deadlock return not resolved"); + return (EINVAL); +} + /* * __db_not_txn_env -- * DB handle must be in an environment that supports transactions. @@ -701,7 +785,7 @@ int __db_not_txn_env(dbenv) DB_ENV *dbenv; { - __db_err(dbenv, "DB environment not configured for transactions"); + __db_errx(dbenv, "DB environment not configured for transactions"); return (EINVAL); } @@ -716,8 +800,9 @@ __db_rec_toobig(dbenv, data_len, fixed_rec_len) DB_ENV *dbenv; u_int32_t data_len, fixed_rec_len; { - __db_err(dbenv, "%s: length of %lu larger than database's value of %lu", - "Record length error", (u_long)data_len, (u_long)fixed_rec_len); + __db_errx(dbenv, + "%lu larger than database's maximum record length %lu", + (u_long)data_len, (u_long)fixed_rec_len); return (EINVAL); } @@ -732,12 +817,87 @@ __db_rec_repl(dbenv, data_size, data_dlen) DB_ENV *dbenv; u_int32_t data_size, data_dlen; { - __db_err(dbenv, + __db_errx(dbenv, "%s: replacement length %lu differs from replaced length %lu", "Record length error", (u_long)data_size, (u_long)data_dlen); return (EINVAL); } +#if defined(DIAGNOSTIC) || defined(DEBUG_ROP) || defined(DEBUG_WOP) +/* + * __dbc_logging -- + * In DIAGNOSTIC mode, check for bad replication combinations. + * + * PUBLIC: int __dbc_logging __P((DBC *)); + */ +int +__dbc_logging(dbc) + DBC *dbc; +{ + DB_ENV *dbenv; + DB_REP *db_rep; + int ret; + + dbenv = dbc->dbp->dbenv; + db_rep = dbenv->rep_handle; + + ret = LOGGING_ON(dbenv) && + !F_ISSET(dbc, DBC_RECOVER) && !IS_REP_CLIENT(dbenv); + + /* + * If we're not using replication or running recovery, return. + */ + if (db_rep == NULL || F_ISSET(dbc, DBC_RECOVER)) + return (ret); + +#ifndef DEBUG_ROP + /* + * Only check when DEBUG_ROP is not configured. People often do + * non-transactional reads, and debug_rop is going to write + * a log record. + */ + { + REP *rep; + + rep = db_rep->region; + + /* + * If we're a client and not running recovery or internally, error. + */ + if (IS_REP_CLIENT(dbenv) && + !F_ISSET(dbc->dbp, DB_AM_CL_WRITER) && + !F_ISSET(dbc->dbp, DB_AM_NOT_DURABLE)) { + __db_errx(dbenv, "Dbc_logging: Client update"); + goto err; + } + +#ifndef DEBUG_WOP + /* + * If DEBUG_WOP is enabled, then we'll generate debugging log records + * that are non-transactional. This is OK. + */ + if (IS_REP_MASTER(dbenv) && + dbc->txn == NULL && !F_ISSET(dbc->dbp, DB_AM_NOT_DURABLE)) { + __db_errx(dbenv, "Dbc_logging: Master non-txn update"); + goto err; + } +#endif + + if (0) { +err: __db_errx(dbenv, "Rep: flags 0x%lx msg_th %lu, lockout_th %d", + (u_long)rep->flags, (u_long)rep->msg_th, rep->lockout_th); + __db_errx(dbenv, "Rep: handle %lu, opcnt %lu, in_rec %d", + (u_long)rep->handle_cnt, (u_long)rep->op_cnt, + rep->in_recovery); + abort(); + /* NOTREACHED */ + } + } +#endif + return (ret); +} +#endif + /* * __db_check_lsn -- * Display the log sequence error message. @@ -749,9 +909,59 @@ __db_check_lsn(dbenv, lsn, prev) DB_ENV *dbenv; DB_LSN *lsn, *prev; { - __db_err(dbenv, + __db_errx(dbenv, "Log sequence error: page LSN %lu %lu; previous LSN %lu %lu", (u_long)(lsn)->file, (u_long)(lsn)->offset, (u_long)(prev)->file, (u_long)(prev)->offset); return (EINVAL); } + +/* + * __db_rdonly -- + * Common readonly message. + * PUBLIC: int __db_rdonly __P((const DB_ENV *, const char *)); + */ +int +__db_rdonly(dbenv, name) + const DB_ENV *dbenv; + const char *name; +{ + __db_errx(dbenv, "%s: attempt to modify a read-only database", name); + return (EACCES); +} + +/* + * __db_space_err -- + * Common out of space message. + * PUBLIC: int __db_space_err __P((const DB *)); + */ +int +__db_space_err(dbp) + const DB *dbp; +{ + __db_errx(dbp->dbenv, + "%s: file limited to %lu pages", + dbp->fname, (u_long)dbp->mpf->mfp->maxpgno); + return (ENOSPC); +} + +/* + * __db_failed -- + * Common failed thread message. + * + * PUBLIC: int __db_failed __P((const DB_ENV *, + * PUBLIC: const char *, pid_t, db_threadid_t)); + */ +int +__db_failed(dbenv, msg, pid, tid) + const DB_ENV *dbenv; + const char *msg; + pid_t pid; + db_threadid_t tid; +{ + char buf[DB_THREADID_STRLEN]; + + __db_errx(dbenv, "Thread/process %s failed: %s", + dbenv->thread_id_string((DB_ENV*)dbenv, pid, tid, buf), msg); + return (DB_RUNRECOVERY); +} diff --git a/db/common/db_getlong.c b/db/common/db_getlong.c index be70f0d4a..7285c50a7 100644 --- a/db/common/db_getlong.c +++ b/db/common/db_getlong.c @@ -1,22 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_getlong.c,v 11.22 2004/10/28 14:43:26 bostic Exp $ + * $Id: db_getlong.c,v 12.5 2006/08/24 14:45:11 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#include -#include -#endif - #include "db_int.h" /* @@ -45,7 +37,7 @@ __db_getlong(dbenv, progname, p, min, max, storep) "%s: %s: %s\n", progname, p, strerror(ERANGE)); else dbenv->err(dbenv, ERANGE, "%s", p); - return (1); + return (ERANGE); } if (p[0] == '\0' || (end[0] != '\0' && end[0] != '\n')) { if (dbenv == NULL) @@ -53,7 +45,7 @@ __db_getlong(dbenv, progname, p, min, max, storep) "%s: %s: Invalid numeric argument\n", progname, p); else dbenv->errx(dbenv, "%s: Invalid numeric argument", p); - return (1); + return (EINVAL); } if (val < min) { if (dbenv == NULL) @@ -63,7 +55,7 @@ __db_getlong(dbenv, progname, p, min, max, storep) else dbenv->errx(dbenv, "%s: Less than minimum value (%ld)", p, min); - return (1); + return (ERANGE); } if (val > max) { if (dbenv == NULL) @@ -73,7 +65,7 @@ __db_getlong(dbenv, progname, p, min, max, storep) else dbenv->errx(dbenv, "%s: Greater than maximum value (%ld)", p, max); - return (1); + return (ERANGE); } *storep = val; return (0); @@ -104,7 +96,7 @@ __db_getulong(dbenv, progname, p, min, max, storep) "%s: %s: %s\n", progname, p, strerror(ERANGE)); else dbenv->err(dbenv, ERANGE, "%s", p); - return (1); + return (ERANGE); } if (p[0] == '\0' || (end[0] != '\0' && end[0] != '\n')) { if (dbenv == NULL) @@ -112,7 +104,7 @@ __db_getulong(dbenv, progname, p, min, max, storep) "%s: %s: Invalid numeric argument\n", progname, p); else dbenv->errx(dbenv, "%s: Invalid numeric argument", p); - return (1); + return (EINVAL); } if (val < min) { if (dbenv == NULL) @@ -122,7 +114,7 @@ __db_getulong(dbenv, progname, p, min, max, storep) else dbenv->errx(dbenv, "%s: Less than minimum value (%lu)", p, min); - return (1); + return (ERANGE); } /* @@ -139,7 +131,7 @@ __db_getulong(dbenv, progname, p, min, max, storep) else dbenv->errx(dbenv, "%s: Greater than maximum value (%lu)", p, max); - return (1); + return (ERANGE); } *storep = val; return (0); diff --git a/db/common/db_idspace.c b/db/common/db_idspace.c index 49f2e9137..777ced7f1 100644 --- a/db/common/db_idspace.c +++ b/db/common/db_idspace.c @@ -1,20 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2001-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 2001-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_idspace.c,v 1.9 2004/01/28 03:35:52 bostic Exp $ + * $Id: db_idspace.c,v 12.4 2006/08/24 14:45:11 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" static int __db_idcmp __P((const void *, const void *)); diff --git a/db/common/db_log2.c b/db/common/db_log2.c index fcc1a6035..9adc5d9a5 100644 --- a/db/common/db_log2.c +++ b/db/common/db_log2.c @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1995, 1996 @@ -35,15 +35,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: db_log2.c,v 11.9 2004/01/28 03:35:52 bostic Exp $ + * $Id: db_log2.c,v 12.4 2006/08/24 14:45:11 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" /* diff --git a/db/common/mkpath.c b/db/common/mkpath.c new file mode 100644 index 000000000..3f2cbf73b --- /dev/null +++ b/db/common/mkpath.c @@ -0,0 +1,69 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2006 + * Oracle Corporation. All rights reserved. + * + * $Id: mkpath.c,v 12.16 2006/08/24 14:45:11 bostic Exp $ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * __db_mkpath -- -- + * Create intermediate directories. + * + * PUBLIC: int __db_mkpath __P((DB_ENV *, const char *)); + */ +int +__db_mkpath(dbenv, name) + DB_ENV *dbenv; + const char *name; +{ + size_t len; + int ret; + char *p, *t, savech; + + /* + * Get a copy so we can modify the string. It's a path and potentially + * quite long, so don't allocate the space on the stack. + */ + len = strlen(name) + 1; + if ((ret = __os_malloc(dbenv, len, &t)) != 0) + return (ret); + memcpy(t, name, len); + + /* + * Cycle through the path, creating intermediate directories. + * + * Skip the first byte if it's a path separator, it's the start of an + * absolute pathname. + */ + if (PATH_SEPARATOR[1] == '\0') { + for (p = t + 1; p[0] != '\0'; ++p) + if (p[0] == PATH_SEPARATOR[0]) { + savech = *p; + *p = '\0'; + if (__os_exists(dbenv, t, NULL) && + (ret = __os_mkdir( + dbenv, t, dbenv->dir_mode)) != 0) + break; + *p = savech; + } + } else + for (p = t + 1; p[0] != '\0'; ++p) + if (strchr(PATH_SEPARATOR, p[0]) != NULL) { + savech = *p; + *p = '\0'; + if (__os_exists(dbenv, t, NULL) && + (ret = __os_mkdir( + dbenv, t, dbenv->dir_mode)) != 0) + break; + *p = savech; + } + + __os_free(dbenv, t); + return (ret); +} diff --git a/db/common/util_arg.c b/db/common/util_arg.c index 16a17ee28..e7cb68cd8 100644 --- a/db/common/util_arg.c +++ b/db/common/util_arg.c @@ -1,18 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2001-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 2001-2006 + * Oracle Corporation. All rights reserved. * - * $Id: util_arg.c,v 1.6 2004/01/28 03:35:52 bostic Exp $ + * $Id: util_arg.c,v 12.4 2006/08/24 14:45:11 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" static char *__db_strsep __P((char **, const char *)); diff --git a/db/common/util_cache.c b/db/common/util_cache.c index 006c34557..b9098cb1e 100644 --- a/db/common/util_cache.c +++ b/db/common/util_cache.c @@ -1,22 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2000-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 2000-2006 + * Oracle Corporation. All rights reserved. * - * $Id: util_cache.c,v 1.8 2004/02/17 16:03:05 bostic Exp $ + * $Id: util_cache.c,v 12.4 2006/08/24 14:45:11 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include - -#include -#endif - #include "db_int.h" /* diff --git a/db/common/util_log.c b/db/common/util_log.c index 98fd1951c..f1888b8ac 100644 --- a/db/common/util_log.c +++ b/db/common/util_log.c @@ -1,32 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2000-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 2000-2006 + * Oracle Corporation. All rights reserved. * - * $Id: util_log.c,v 1.14 2004/01/28 03:35:52 bostic Exp $ + * $Id: util_log.c,v 12.11 2006/08/24 14:45:11 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#if TIME_WITH_SYS_TIME -#include -#include -#else -#if HAVE_SYS_TIME_H -#include -#else -#include -#endif -#endif - -#include -#endif - #include "db_int.h" /* @@ -40,16 +22,19 @@ __db_util_logset(progname, fname) const char *progname; char *fname; { + pid_t pid; FILE *fp; time_t now; - u_int32_t id; + char time_buf[CTIME_BUFLEN]; if ((fp = fopen(fname, "w")) == NULL) goto err; (void)time(&now); - __os_id(&id); - fprintf(fp, "%s: %lu %s", progname, (u_long)id, ctime(&now)); + + __os_id(NULL, &pid, NULL); + fprintf(fp, + "%s: %lu %s", progname, (u_long)pid, __db_ctime(&now, time_buf)); if (fclose(fp) == EOF) goto err; diff --git a/db/common/util_sig.c b/db/common/util_sig.c index 53087360e..821253b77 100644 --- a/db/common/util_sig.c +++ b/db/common/util_sig.c @@ -1,37 +1,59 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2000-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 2000-2006 + * Oracle Corporation. All rights reserved. * - * $Id: util_sig.c,v 1.9 2004/01/28 03:35:54 bostic Exp $ + * $Id: util_sig.c,v 12.5 2006/08/24 14:45:11 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include - -#include -#endif - #include "db_int.h" static int interrupt; -static void onint __P((int)); +static void set_signal __P((int, int)); +static void signal_handler __P((int)); /* - * onint -- + * signal_handler -- * Interrupt signal handler. */ static void -onint(signo) +signal_handler(signo) int signo; { +#ifndef HAVE_SIGACTION + /* Assume signal() is unreliable and reset it, first thing. */ + set_signal(signo, 0); +#endif + /* Some systems don't pass in the correct signal value -- check. */ if ((interrupt = signo) == 0) interrupt = SIGINT; } +/* + * set_signal + */ +static void +set_signal(s, is_dflt) + int s, is_dflt; +{ + /* + * Use sigaction if it's available, otherwise use signal(). + */ +#ifdef HAVE_SIGACTION + struct sigaction sa, osa; + + sa.sa_handler = is_dflt ? SIG_DFL : signal_handler; + (void)sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + (void)sigaction(s, &sa, &osa); +#else + (void)signal(s, is_dflt ? SIG_DFL : signal_handler); +#endif +} + /* * __db_util_siginit -- * @@ -46,13 +68,17 @@ __db_util_siginit() * we can. */ #ifdef SIGHUP - (void)signal(SIGHUP, onint); + set_signal(SIGHUP, 0); +#endif +#ifdef SIGINT + set_signal(SIGINT, 0); #endif - (void)signal(SIGINT, onint); #ifdef SIGPIPE - (void)signal(SIGPIPE, onint); + set_signal(SIGPIPE, 0); +#endif +#ifdef SIGTERM + set_signal(SIGTERM, 0); #endif - (void)signal(SIGTERM, onint); } /* @@ -77,7 +103,8 @@ __db_util_sigresend() { /* Resend any caught signal. */ if (interrupt != 0) { - (void)signal(interrupt, SIG_DFL); + set_signal(interrupt, 1); + (void)raise(interrupt); /* NOTREACHED */ } diff --git a/db/crypto/aes_method.c b/db/crypto/aes_method.c index 567e67456..cd4370b3a 100644 --- a/db/crypto/aes_method.c +++ b/db/crypto/aes_method.c @@ -1,21 +1,17 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2001-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 2001-2006 + * Oracle Corporation. All rights reserved. * * Some parts of this code originally written by Adam Stubblefield, * -- astubble@rice.edu. * - * $Id: aes_method.c,v 1.20 2004/09/17 22:00:25 mjc Exp $ + * $Id: aes_method.c,v 12.5 2006/08/24 14:45:12 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" #include "dbinc/crypto.h" #include "dbinc/hmac.h" @@ -268,6 +264,6 @@ __aes_err(dbenv, err) errstr = "AES error unrecognized"; break; } - __db_err(dbenv, errstr); + __db_errx(dbenv, errstr); return; } diff --git a/db/crypto/crypto.c b/db/crypto/crypto.c index f753ec3f0..72a8444e0 100644 --- a/db/crypto/crypto.c +++ b/db/crypto/crypto.c @@ -1,21 +1,17 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * * Some parts of this code originally written by Adam Stubblefield * -- astubble@rice.edu * - * $Id: crypto.c,v 1.31 2004/10/15 16:59:38 bostic Exp $ + * $Id: crypto.c,v 12.10 2006/08/24 14:45:12 bostic Exp $ */ #include "db_config.h" -#ifndef NO_SYSTEM_INCLUDES -#include -#endif - #include "db_int.h" #include "dbinc/db_page.h" #include "dbinc/crypto.h" @@ -40,35 +36,31 @@ __crypto_region_init(dbenv) ret = 0; infop = dbenv->reginfo; renv = infop->primary; - MUTEX_LOCK(dbenv, &renv->mutex); if (renv->cipher_off == INVALID_ROFF) { if (!CRYPTO_ON(dbenv)) - goto err; + return (0); if (!F_ISSET(infop, REGION_CREATE)) { - __db_err(dbenv, + __db_errx(dbenv, "Joining non-encrypted environment with encryption key"); - ret = EINVAL; - goto err; + return (EINVAL); } if (F_ISSET(db_cipher, CIPHER_ANY)) { - __db_err(dbenv, "Encryption algorithm not supplied"); - ret = EINVAL; - goto err; + __db_errx(dbenv, "Encryption algorithm not supplied"); + return (EINVAL); } /* - * Must create the shared information. We need: - * Shared cipher information that contains the passwd. - * After we copy the passwd, we smash and free the one in the - * dbenv. + * Must create the shared information. We need: Shared cipher + * information that contains the passwd. After we copy the + * passwd, we smash and free the one in the dbenv. */ - if ((ret = __db_shalloc( - infop, sizeof(CIPHER), MUTEX_ALIGN, &cipher)) != 0) - goto err; + if ((ret = + __db_shalloc(infop, sizeof(CIPHER), 0, &cipher)) != 0) + return (ret); memset(cipher, 0, sizeof(*cipher)); if ((ret = __db_shalloc( infop, dbenv->passwd_len, 0, &sh_passwd)) != 0) { __db_shalloc_free(infop, cipher); - goto err; + return (ret); } memset(sh_passwd, 0, dbenv->passwd_len); cipher->passwd = R_OFFSET(infop, sh_passwd); @@ -78,52 +70,45 @@ __crypto_region_init(dbenv) renv->cipher_off = R_OFFSET(infop, cipher); } else { if (!CRYPTO_ON(dbenv)) { - __db_err(dbenv, - "Encrypted environment: no encryption key supplied"); - ret = EINVAL; - goto err; + __db_errx(dbenv, + "Encrypted environment: no encryption key supplied"); + return (EINVAL); } cipher = R_ADDR(infop, renv->cipher_off); sh_passwd = R_ADDR(infop, cipher->passwd); if ((cipher->passwd_len != dbenv->passwd_len) || memcmp(dbenv->passwd, sh_passwd, cipher->passwd_len) != 0) { - __db_err(dbenv, "Invalid password"); - ret = EPERM; - goto err; + __db_errx(dbenv, "Invalid password"); + return (EPERM); } if (!F_ISSET(db_cipher, CIPHER_ANY) && db_cipher->alg != cipher->flags) { - __db_err(dbenv, + __db_errx(dbenv, "Environment encrypted using a different algorithm"); - ret = EINVAL; - goto err; + return (EINVAL); } if (F_ISSET(db_cipher, CIPHER_ANY)) /* - * We have CIPHER_ANY and we are joining the - * existing env. Setup our cipher structure - * for whatever algorithm this env has. + * We have CIPHER_ANY and we are joining the existing + * env. Setup our cipher structure for whatever + * algorithm this env has. */ if ((ret = __crypto_algsetup(dbenv, db_cipher, cipher->flags, 0)) != 0) - goto err; + return (ret); } - MUTEX_UNLOCK(dbenv, &renv->mutex); ret = db_cipher->init(dbenv, db_cipher); /* - * On success, no matter if we allocated it or are using the - * already existing one, we are done with the passwd in the dbenv. - * We smash N-1 bytes so that we don't overwrite the nul. + * On success, no matter if we allocated it or are using the already + * existing one, we are done with the passwd in the dbenv. We smash + * N-1 bytes so that we don't overwrite the nul. */ memset(dbenv->passwd, 0xff, dbenv->passwd_len-1); __os_free(dbenv, dbenv->passwd); dbenv->passwd = NULL; dbenv->passwd_len = 0; - if (0) { -err: MUTEX_UNLOCK(dbenv, &renv->mutex); - } return (ret); } @@ -197,7 +182,7 @@ __crypto_algsetup(dbenv, db_cipher, alg, do_init) ret = 0; if (!CRYPTO_ON(dbenv)) { - __db_err(dbenv, "No cipher structure given"); + __db_errx(dbenv, "No cipher structure given"); return (EINVAL); } F_CLR(db_cipher, CIPHER_ANY); @@ -236,47 +221,67 @@ __crypto_decrypt_meta(dbenv, dbp, mbuf, do_metachk) u_int8_t *iv; /* - * If we weren't given a dbp, we just want to decrypt the page - * on behalf of some internal subsystem, not on behalf of a user - * with a dbp. Therefore, set up a dummy dbp so that the call - * to P_OVERHEAD below works. + * If we weren't given a dbp, we just want to decrypt the page on + * behalf of some internal subsystem, not on behalf of a user with + * a dbp. Therefore, set up a dummy dbp so that the call to + * P_OVERHEAD below works. */ if (dbp == NULL) { memset(&dummydb, 0, sizeof(DB)); dbp = &dummydb; } + + ret = 0; + meta = (DBMETA *)mbuf; + /* - * Meta-pages may be encrypted for DBMETASIZE bytes. If - * we have a non-zero IV (that is written after encryption) - * then we decrypt (or error if the user isn't set up for - * security). We guarantee that the IV space on non-encrypted - * pages will be zero and a zero-IV is illegal for encryption. - * Therefore any non-zero IV means an encrypted database. - * This basically checks the passwd on the file - * if we cannot find a good magic number. - * We walk through all the algorithms we know about attempting - * to decrypt (and possibly byteswap). + * !!! + * We used an "unused" field in the meta-data page to flag whether or + * not the database is encrypted. Unfortunately, that unused field + * was used in Berkeley DB releases before 3.0 (for example, 2.7.7). + * It would have been OK, except encryption doesn't follow the usual + * rules of "upgrade before doing anything else", we check encryption + * before checking for old versions of the database. + * + * We don't have to check Btree databases -- before 3.0, the field of + * interest was the bt_maxkey field (which was never supported and has + * since been removed). + * + * Ugly check to jump out if this format is older than what we support. + * It assumes no encrypted page will have an unencrypted magic number, + * but that seems relatively safe. [#10920] + */ + if (meta->magic == DB_HASHMAGIC && meta->version <= 5) + return (0); + + /* + * Meta-pages may be encrypted for DBMETASIZE bytes. If we have a + * non-zero IV (that is written after encryption) then we decrypt (or + * error if the user isn't set up for security). We guarantee that + * the IV space on non-encrypted pages will be zero and a zero-IV is + * illegal for encryption. Therefore any non-zero IV means an + * encrypted database. This basically checks the passwd on the file + * if we cannot find a good magic number. We walk through all the + * algorithms we know about attempting to decrypt (and possibly + * byteswap). * * !!! - * All method meta pages have the IV and checksum at the - * exact same location, but not in DBMETA, use BTMETA. + * All method meta pages have the IV and checksum at the exact same + * location, but not in DBMETA, use BTMETA. */ - ret = 0; - meta = (DBMETA *)mbuf; if (meta->encrypt_alg != 0) { db_cipher = (DB_CIPHER *)dbenv->crypto_handle; if (!F_ISSET(dbp, DB_AM_ENCRYPT)) { if (!CRYPTO_ON(dbenv)) { - __db_err(dbenv, + __db_errx(dbenv, "Encrypted database: no encryption flag specified"); return (EINVAL); } /* - * User has a correct, secure env, but has - * encountered a database in that env that is - * secure, but user didn't dbp->set_flags. Since - * it is existing, use encryption if it is that - * way already. + * User has a correct, secure env, but has encountered + * a database in that env that is secure, but user + * didn't dbp->set_flags. Since it is existing, use + * encryption if it is that way already. */ F_SET(dbp, DB_AM_ENCRYPT|DB_AM_CHKSUM); } @@ -284,19 +289,19 @@ __crypto_decrypt_meta(dbenv, dbp, mbuf, do_metachk) * This was checked in set_flags when DB_AM_ENCRYPT was set. * So it better still be true here. */ - DB_ASSERT(CRYPTO_ON(dbenv)); + DB_ASSERT(dbenv, CRYPTO_ON(dbenv)); if (!F_ISSET(db_cipher, CIPHER_ANY) && meta->encrypt_alg != db_cipher->alg) { - __db_err(dbenv, + __db_errx(dbenv, "Database encrypted using a different algorithm"); return (EINVAL); } - DB_ASSERT(F_ISSET(dbp, DB_AM_CHKSUM)); + DB_ASSERT(dbenv, F_ISSET(dbp, DB_AM_CHKSUM)); iv = ((BTMETA *)mbuf)->iv; /* - * For ALL pages, we do not encrypt the beginning - * of the page that contains overhead information. - * This is true of meta and all other pages. + * For ALL pages, we do not encrypt the beginning of the page + * that contains overhead information. This is true of meta + * and all other pages. */ pg_off = P_OVERHEAD(dbp); alg_retry: @@ -311,7 +316,7 @@ alg_retry: return (ret); if (((BTMETA *)meta)->crypto_magic != meta->magic) { - __db_err(dbenv, "Invalid password"); + __db_errx(dbenv, "Invalid password"); return (EINVAL); } /* @@ -330,10 +335,10 @@ alg_retry: goto alg_retry; } else if (F_ISSET(dbp, DB_AM_ENCRYPT)) { /* - * They gave us a passwd, but the database is not - * encrypted. This is an error. We do NOT want to - * silently allow them to write data in the clear when - * the user set up and expects encrypted data. + * They gave us a passwd, but the database is not encrypted. + * This is an error. We do NOT want to silently allow them + * to write data in the clear when the user set up and expects + * encrypted data. * * This covers at least the following scenario. * 1. User creates and sets up an encrypted database. @@ -349,7 +354,7 @@ alg_retry: * Therefore, asking for encryption with a database that * was not encrypted is an error. */ - __db_err(dbenv, + __db_errx(dbenv, "Unencrypted database with a supplied encryption key"); return (EINVAL); } @@ -377,9 +382,9 @@ __crypto_set_passwd(dbenv_src, dbenv_dest) infop = dbenv_src->reginfo; renv = infop->primary; - DB_ASSERT(CRYPTO_ON(dbenv_src)); + DB_ASSERT(dbenv_src, CRYPTO_ON(dbenv_src)); cipher = R_ADDR(infop, renv->cipher_off); sh_passwd = R_ADDR(infop, cipher->passwd); - return (__dbenv_set_encrypt(dbenv_dest, sh_passwd, DB_ENCRYPT_AES)); + return (__env_set_encrypt(dbenv_dest, sh_passwd, DB_ENCRYPT_AES)); } diff --git a/db/crypto/crypto.html b/db/crypto/crypto.html index 9475beb2a..129a7f4f3 100644 --- a/db/crypto/crypto.html +++ b/db/crypto/crypto.html @@ -11,7 +11,6 @@  Security Interface for Berkeley DB
Susan LoVerso -
sue@sleepycat.com
Rev 1.6
2002 Feb 26
@@ -108,7 +107,7 @@ The setup of the security subsystem will be similar to replication initializatio since it is a sort of subsystem, but it does not have its own region.  When the environment handle is created via db_env_create, we initialize our set_encrypt method to be the RPC or local version.  Therefore -the __dbenv structure needs a new pointer: +the DB_ENV structure needs a new pointer:
    void    *crypto_handle;   /* Security handle */
The crypto handle will really point to a new __db_cipher structure that will contain a set of functions and a pointer to the in-memory information @@ -134,21 +133,21 @@ this is set up, it is read-only forever.

During dbenv->set_encrypt, we set the encryption, decryption and checksumming methods to the appropriate functions based on the flags.  This function will allocate us a crypto -handle that we store in the __dbenv structure just like all the +handle that we store in the DB_ENV structure just like all the other subsystems.  For now, only AES ciphering functions and SHA1 checksumming functions are supported.  Also we will copy the password -into the __dbenv structure.  We ultimately need to keep the +into the DB_ENV structure.  We ultimately need to keep the password in the environment's shared memory region or compare this one against the one that is there, if we are joining an existing environment, but we do not have it yet because open has not yet been called.  We will allocate a structure that will be used in initialization and set up the function pointers to point to the algorithm-specific functions. -

In the  __dbenv_open path, in __db_e_attach, if we +

In the  __env_open path, in __db_e_attach, if we are creating the region and the dbenv->passwd field is set, we need to use the length of the password in the initial computation of the environment's size.  This guarantees sufficient space for storing the password in shared memory.  Then we will call a new function to initialize the -security region, __crypto_region_init in __dbenv_open.  +security region, __crypto_region_init in __env_open.  If we are the creator, we will allocate space in the shared region to store the password and copy the password into that space.  Or, if we are not the creator we will compare the password stored in the dbenv with the @@ -304,7 +303,7 @@ We will have per-process state vectors that are set up when a process begins.&nb That way we minimize the contention and only multi-threaded processes need acquire locks for the IV.  We will have the state vector in the environment handle in heap memory, as well as the index and there will be a mutex protecting -it for threaded access.  This will be added to the __dbenv +it for threaded access.  This will be added to the DB_ENV structure:

    DB_MUTEX    *mt_mutexp;   /* Mersenne Twister mutex */
     int         *mti;         /* MT index */
diff --git a/db/crypto/mersenne/mt19937db.c b/db/crypto/mersenne/mt19937db.c
index 1c1699db5..6cd259932 100644
--- a/db/crypto/mersenne/mt19937db.c
+++ b/db/crypto/mersenne/mt19937db.c
@@ -1,5 +1,5 @@
 /*
- * $Id: mt19937db.c,v 1.12 2004/06/14 16:54:27 mjc Exp $
+ * $Id: mt19937db.c,v 12.4 2006/09/08 20:32:02 bostic Exp $
  */
 #include "db_config.h"
 
@@ -33,14 +33,14 @@
 /* ACM Transactions on Modeling and Computer Simulation,           */
 /* Vol. 8, No. 1, January 1998, pp 3--30.                          */
 
-/* Period parameters */  
+/* Period parameters */
 #define N 624
 #define M 397
 #define MATRIX_A 0x9908b0df   /* constant vector a */
 #define UPPER_MASK 0x80000000 /* most significant w-r bits */
 #define LOWER_MASK 0x7fffffff /* least significant r bits */
 
-/* Tempering parameters */   
+/* Tempering parameters */
 #define TEMPERING_MASK_B 0x9d2c5680
 #define TEMPERING_MASK_C 0xefc60000
 #define TEMPERING_SHIFT_U(y)  (y >> 11)
@@ -69,7 +69,7 @@ __db_generate_iv(dbenv, iv)
 
 	ret = 0;
 	n = DB_IV_BYTES / sizeof(u_int32_t);
-	MUTEX_THREAD_LOCK(dbenv, dbenv->mt_mutexp);
+	MUTEX_LOCK(dbenv, dbenv->mtx_mt);
 	if (dbenv->mt == NULL) {
 		if ((ret = __os_calloc(dbenv, 1, N*sizeof(unsigned long),
 		    &dbenv->mt)) != 0)
@@ -77,30 +77,29 @@ __db_generate_iv(dbenv, iv)
 		/* mti==N+1 means mt[N] is not initialized */
 		dbenv->mti = N + 1;
 	}
-	for (i = 0; i < n; i++)
-{
+	for (i = 0; i < n; i++) {
 		/*
 		 * We do not allow 0.  If we get one just try again.
 		 */
 		do {
 			iv[i] = (u_int32_t)__db_genrand(dbenv);
 		} while (iv[i] == 0);
-}
+	}
 
-	MUTEX_THREAD_UNLOCK(dbenv, dbenv->mt_mutexp);
+	MUTEX_UNLOCK(dbenv, dbenv->mtx_mt);
 	return (0);
 }
 
 /* Initializing the array with a seed */
 static void
 __db_sgenrand(seed, mt, mtip)
-	unsigned long seed;	
+	unsigned long seed;
 	unsigned long mt[];
 	int *mtip;
 {
     int i;
 
-    DB_ASSERT(seed != 0);
+    DB_ASSERT(NULL, seed != 0);
     for (i=0;imtx_mt locked.
      */
     if (dbenv->mti >= N) { /* generate N words at one time */
         int kk;
@@ -157,10 +156,10 @@ __db_genrand(dbenv)
 		 */
 		do {
 			__os_clock(dbenv, &secs, &usecs);
-			__db_chksum((u_int8_t *)&secs, sizeof(secs), NULL,
+			__db_chksum(NULL, (u_int8_t *)&secs, sizeof(secs), NULL,
 			    (u_int8_t *)&seed);
 		} while (seed == 0);
-        	__db_sgenrand((long)seed, dbenv->mt, &dbenv->mti); 
+        	__db_sgenrand((long)seed, dbenv->mt, &dbenv->mti);
 	}
 
         for (kk=0;kkmti = 0;
     }
-  
+
     y = dbenv->mt[dbenv->mti++];
     y ^= TEMPERING_SHIFT_U(y);
     y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B;
     y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C;
     y ^= TEMPERING_SHIFT_L(y);
 
-    return y; 
+    return y;
 }
diff --git a/db/crypto/rijndael/rijndael-alg-fst.c b/db/crypto/rijndael/rijndael-alg-fst.c
index 4a251606d..f37b953ac 100644
--- a/db/crypto/rijndael/rijndael-alg-fst.c
+++ b/db/crypto/rijndael/rijndael-alg-fst.c
@@ -1350,7 +1350,7 @@ __db_rijndaelEncryptRound(rk, Nr, pt, ct)
     		(Te4[(s1 >>  8) & 0xff] & 0x0000ff00) ^
     		(Te4[(s2      ) & 0xff] & 0x000000ff) ^
     		rk[3];
-		
+
 		s0 = t0;
 		s1 = t1;
 		s2 = t2;
diff --git a/db/crypto/rijndael/rijndael-alg-fst.h b/db/crypto/rijndael/rijndael-alg-fst.h
index fe9ce3814..2b9d6a03c 100644
--- a/db/crypto/rijndael/rijndael-alg-fst.h
+++ b/db/crypto/rijndael/rijndael-alg-fst.h
@@ -1,5 +1,5 @@
 /*
- * $Id: rijndael-alg-fst.h,v 1.2 2002/01/08 18:53:37 sue Exp $
+ * $Id: rijndael-alg-fst.h,v 12.1 2006/09/08 20:32:03 bostic Exp $
  */
 /**
  * rijndael-alg-fst.h
@@ -33,8 +33,8 @@
 #define MAXKB	(256/8)
 #define MAXNR	14
 
-typedef u_int8_t	u8;	
-typedef u_int16_t	u16;	
+typedef u_int8_t	u8;
+typedef u_int16_t	u16;
 typedef u_int32_t	u32;
 
 #endif /* __RIJNDAEL_ALG_FST_H */
diff --git a/db/crypto/rijndael/rijndael-api-fst.c b/db/crypto/rijndael/rijndael-api-fst.c
index 09475370f..e570de810 100644
--- a/db/crypto/rijndael/rijndael-api-fst.c
+++ b/db/crypto/rijndael/rijndael-api-fst.c
@@ -34,13 +34,8 @@
  * Markus Friedl 
  * John Skodon 
  */
-
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/crypto.h"
 
@@ -60,7 +55,7 @@ __db_makeKey(key, direction, keyLen, keyMaterial)
 	char *keyMaterial;
 {
 	u8 cipherKey[MAXKB];
-	
+
 	if (key == NULL) {
 		return BAD_KEY_INSTANCE;
 	}
@@ -140,7 +135,7 @@ __db_blockEncrypt(cipher, key, input, inputLen, outBuffer)
 	}
 
 	numBlocks = (int)(inputLen/128);
-	
+
 	switch (cipher->mode) {
 	case MODE_ECB:
 		for (i = numBlocks; i > 0; i--) {
@@ -149,7 +144,7 @@ __db_blockEncrypt(cipher, key, input, inputLen, outBuffer)
 			outBuffer += 16;
 		}
 		break;
-		
+
 	case MODE_CBC:
 		iv = cipher->IV;
 		for (i = numBlocks; i > 0; i--) {
@@ -185,7 +180,7 @@ __db_blockEncrypt(cipher, key, input, inputLen, outBuffer)
 	default:
 		return BAD_CIPHER_STATE;
 	}
-	
+
 	return 128*numBlocks;
 }
 
@@ -235,7 +230,7 @@ __db_padEncrypt(cipher, key, input, inputOctets, outBuffer)
 			outBuffer += 16;
 		}
 		padLen = 16 - (inputOctets - 16*numBlocks);
-		DB_ASSERT(padLen > 0 && padLen <= 16);
+		DB_ASSERT(NULL, padLen > 0 && padLen <= 16);
 		memcpy(block, input, 16 - padLen);
 		memset(block + 16 - padLen, padLen, padLen);
 		__db_rijndaelEncrypt(key->rk, key->Nr, block, outBuffer);
@@ -255,7 +250,7 @@ __db_padEncrypt(cipher, key, input, inputOctets, outBuffer)
 			outBuffer += 16;
 		}
 		padLen = 16 - (inputOctets - 16*numBlocks);
-		DB_ASSERT(padLen > 0 && padLen <= 16);
+		DB_ASSERT(NULL, padLen > 0 && padLen <= 16);
 		for (i = 0; i < 16 - padLen; i++) {
 			block[i] = input[i] ^ iv[i];
 		}
@@ -309,7 +304,7 @@ __db_blockDecrypt(cipher, key, input, inputLen, outBuffer)
 			outBuffer += 16;
 		}
 		break;
-		
+
 	case MODE_CBC:
 		memcpy(tmpiv, cipher->IV, MAX_IV_SIZE);
 		for (i = numBlocks; i > 0; i--) {
@@ -345,7 +340,7 @@ __db_blockDecrypt(cipher, key, input, inputLen, outBuffer)
 	default:
 		return BAD_CIPHER_STATE;
 	}
-	
+
 	return 128*numBlocks;
 }
 
@@ -402,7 +397,7 @@ __db_padDecrypt(cipher, key, input, inputOctets, outBuffer)
 		}
 		memcpy(outBuffer, block, 16 - padLen);
 		break;
-		
+
 	case MODE_CBC:
 		/* all blocks but last */
 		memcpy(tmpiv, cipher->IV, MAX_IV_SIZE);
@@ -434,11 +429,11 @@ __db_padDecrypt(cipher, key, input, inputOctets, outBuffer)
 		}
 		memcpy(outBuffer, block, 16 - padLen);
 		break;
-	
+
 	default:
 		return BAD_CIPHER_STATE;
 	}
-	
+
 	return 16*numBlocks - padLen;
 }
 
@@ -447,7 +442,7 @@ __db_padDecrypt(cipher, key, input, inputOctets, outBuffer)
  *	cipherUpdateRounds:
  *
  *	Encrypts/Decrypts exactly one full block a specified number of rounds.
- *	Only used in the Intermediate Value Known Answer Test.	
+ *	Only used in the Intermediate Value Known Answer Test.
  *
  *	Returns:
  *		TRUE - on success
@@ -480,17 +475,17 @@ __db_cipherUpdateRounds(cipher, key, input, inputLen, outBuffer, rounds)
 	case DIR_ENCRYPT:
 		__db_rijndaelEncryptRound(key->rk, key->Nr, block, rounds);
 		break;
-		
+
 	case DIR_DECRYPT:
 		__db_rijndaelDecryptRound(key->rk, key->Nr, block, rounds);
 		break;
-		
+
 	default:
 		return BAD_KEY_DIR;
-	} 
+	}
 
 	memcpy(outBuffer, block, 16);
-	
+
 	return TRUE;
 }
 #endif /* INTERMEDIATE_VALUE_KAT */
diff --git a/db/crypto/rijndael/rijndael-api-fst.h b/db/crypto/rijndael/rijndael-api-fst.h
index 4137aa25e..caf0abc4a 100644
--- a/db/crypto/rijndael/rijndael-api-fst.h
+++ b/db/crypto/rijndael/rijndael-api-fst.h
@@ -1,5 +1,5 @@
 /*
- * $Id: rijndael-api-fst.h,v 1.5 2003/03/17 19:42:18 bostic Exp $
+ * $Id: rijndael-api-fst.h,v 12.0 2004/11/17 03:43:17 bostic Exp $
  */
 /**
  * rijndael-api-fst.h
diff --git a/db/cxx/cxx_db.cpp b/db/cxx/cxx_db.cpp
index 22f1b135d..0ecc2fe5e 100644
--- a/db/cxx/cxx_db.cpp
+++ b/db/cxx/cxx_db.cpp
@@ -1,21 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_db.cpp,v 11.87 2004/07/15 18:26:48 ubell Exp $
+ * $Id: cxx_db.cpp,v 12.13 2006/08/24 14:45:13 bostic Exp $
  */
 
 #include "db_config.h"
 
-#include 
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
 
-#include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc_auto/db_auto.h"
 #include "dbinc_auto/crdel_auto.h"
@@ -51,8 +49,8 @@ int Db::_name _argspec							\
 		DB_ERROR(env_, "Db::" # _name, EINVAL, error_policy());	\
 		return (EINVAL);					\
 	}								\
-	cleanup();							\
 	ret = db->_name _arglist;					\
+	cleanup();							\
 	if (!_retok(ret))						\
 		DB_ERROR(env_, "Db::" # _name, ret, error_policy());	\
 	return (ret);							\
@@ -121,8 +119,8 @@ Db::~Db()
 
 	db = unwrap(this);
 	if (db != NULL) {
-		cleanup();
 		(void)db->close(db, 0);
+		cleanup();
 	}
 }
 
@@ -165,16 +163,11 @@ int Db::initialize()
 }
 
 // private method to cleanup after destructor or during close.
-// If the environment was created by this Db object, we optionally
-// delete it, or return it so the caller can delete it after
-// last use.
+// If the environment was created by this Db object, we need to delete it.
 //
 void Db::cleanup()
 {
-	DB *db = unwrap(this);
-
-	if (db != NULL) {
-		// extra safety
+	if (imp_ != 0) {
 		imp_ = 0;
 
 		// we must dispose of the DbEnv object if
@@ -219,6 +212,9 @@ int Db::error_policy()
 }
 
 DB_DESTRUCTOR(close, (u_int32_t flags), (db, flags), DB_RETOK_STD)
+DB_METHOD(compact, (DbTxn *txnid, Dbt *start, Dbt *stop,
+    DB_COMPACT *c_data, u_int32_t flags, Dbt *end),
+    (db, unwrap(txnid), start, stop, c_data, flags, end), DB_RETOK_STD)
 
 // The following cast implies that Dbc can be no larger than DBC
 DB_METHOD(cursor, (DbTxn *txnid, Dbc **cursorp, u_int32_t flags),
@@ -233,14 +229,14 @@ void Db::err(int error, const char *format, ...)
 {
 	DB *db = unwrap(this);
 
-	DB_REAL_ERR(db->dbenv, error, 1, 1, format);
+	DB_REAL_ERR(db->dbenv, error, DB_ERROR_SET, 1, format);
 }
 
 void Db::errx(const char *format, ...)
 {
 	DB *db = unwrap(this);
 
-	DB_REAL_ERR(db->dbenv, 0, 0, 1, format);
+	DB_REAL_ERR(db->dbenv, 0, DB_ERROR_NOT_SET, 1, format);
 }
 
 DB_METHOD(fd, (int *fdp), (db, fdp), DB_RETOK_STD)
@@ -331,7 +327,7 @@ int Db::pget(DbTxn *txnid, Dbt *key, Dbt *pkey, Dbt *value, u_int32_t flags)
 
 	/* The logic here is identical to Db::get - reuse the macro. */
 	if (!DB_RETOK_DBGET(ret)) {
-		if (ret == ENOMEM && DB_OVERFLOWED_DBT(value))
+		if (ret == DB_BUFFER_SMALL && DB_OVERFLOWED_DBT(value))
 			DB_ERROR_DBT(env_, "Db::pget", value, error_policy());
 		else
 			DB_ERROR(env_, "Db::pget", ret, error_policy());
@@ -405,10 +401,11 @@ extern "C" _rettype _db_##_name##_intercept_c _cargspec			\
 {									\
 	Db *cxxthis;							\
 									\
-	DB_ASSERT(cthis != NULL);					\
+	/* We don't have a dbenv handle at this point. */		\
+	DB_ASSERT(NULL, cthis != NULL);					\
 	cxxthis = Db::get_Db(cthis);					\
-	DB_ASSERT(cxxthis != NULL);					\
-	DB_ASSERT(cxxthis->_name##_callback_ != 0);			\
+	DB_ASSERT(cthis->dbenv, cxxthis != NULL);			\
+	DB_ASSERT(cthis->dbenv, cxxthis->_name##_callback_ != 0);	\
 									\
 	_return (*cxxthis->_name##_callback_) _cxxargs;			\
 }
@@ -518,14 +515,13 @@ int Db::verify(const char *name, const char *subdb,
 	if (!db)
 		ret = EINVAL;
 	else {
-		// after a DB->verify (no matter if success or failure),
-		// the underlying DB object must not be accessed,
-		// so we clean up in advance.
-		//
-		cleanup();
-
 		ret = __db_verify_internal(db, name, subdb, ostr,
 		    _verify_callback_c, flags);
+
+		// After a DB->verify (no matter if success or failure),
+		// the underlying DB object must not be accessed.
+		//
+		cleanup();
 	}
 
 	if (!DB_RETOK_STD(ret))
@@ -536,8 +532,6 @@ int Db::verify(const char *name, const char *subdb,
 
 DB_METHOD(set_bt_compare, (bt_compare_fcn_type func),
     (db, func), DB_RETOK_STD)
-DB_METHOD(set_bt_maxkey, (u_int32_t bt_maxkey),
-    (db, bt_maxkey), DB_RETOK_STD)
 DB_METHOD(get_bt_minkey, (u_int32_t *bt_minkeyp),
     (db, bt_minkeyp), DB_RETOK_STD)
 DB_METHOD(set_bt_minkey, (u_int32_t bt_minkey),
diff --git a/db/cxx/cxx_dbc.cpp b/db/cxx/cxx_dbc.cpp
index 0ca59735f..4ab337c54 100644
--- a/db/cxx/cxx_dbc.cpp
+++ b/db/cxx/cxx_dbc.cpp
@@ -1,21 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_dbc.cpp,v 11.59 2004/01/28 03:35:56 bostic Exp $
+ * $Id: cxx_dbc.cpp,v 12.5 2006/08/24 14:45:13 bostic Exp $
  */
 
 #include "db_config.h"
 
-#include 
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
 
-#include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc_auto/db_auto.h"
 #include "dbinc_auto/crdel_auto.h"
@@ -80,10 +78,10 @@ int Dbc::get(Dbt* key, Dbt *data, u_int32_t _flags)
 	ret = dbc->c_get(dbc, key, data, _flags);
 
 	if (!DB_RETOK_DBCGET(ret)) {
-		if (ret == ENOMEM && DB_OVERFLOWED_DBT(key))
+		if (ret == DB_BUFFER_SMALL && DB_OVERFLOWED_DBT(key))
 			DB_ERROR_DBT(DbEnv::get_DbEnv(dbc->dbp->dbenv),
 				"Dbc::get", key, ON_ERROR_UNKNOWN);
-		else if (ret == ENOMEM && DB_OVERFLOWED_DBT(data))
+		else if (ret == DB_BUFFER_SMALL && DB_OVERFLOWED_DBT(data))
 			DB_ERROR_DBT(DbEnv::get_DbEnv(dbc->dbp->dbenv),
 				"Dbc::get", data, ON_ERROR_UNKNOWN);
 		else
@@ -103,10 +101,10 @@ int Dbc::pget(Dbt* key, Dbt *pkey, Dbt *data, u_int32_t _flags)
 
 	/* Logic is the same as for Dbc::get - reusing macro. */
 	if (!DB_RETOK_DBCGET(ret)) {
-		if (ret == ENOMEM && DB_OVERFLOWED_DBT(key))
+		if (ret == DB_BUFFER_SMALL && DB_OVERFLOWED_DBT(key))
 			DB_ERROR_DBT(DbEnv::get_DbEnv(dbc->dbp->dbenv),
 				"Dbc::pget", key, ON_ERROR_UNKNOWN);
-		else if (ret == ENOMEM && DB_OVERFLOWED_DBT(data))
+		else if (ret == DB_BUFFER_SMALL && DB_OVERFLOWED_DBT(data))
 			DB_ERROR_DBT(DbEnv::get_DbEnv(dbc->dbp->dbenv),
 				"Dbc::pget", data, ON_ERROR_UNKNOWN);
 		else
diff --git a/db/cxx/cxx_dbt.cpp b/db/cxx/cxx_dbt.cpp
index ab8942495..cb203e18d 100644
--- a/db/cxx/cxx_dbt.cpp
+++ b/db/cxx/cxx_dbt.cpp
@@ -1,21 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_dbt.cpp,v 11.55 2004/01/28 03:35:56 bostic Exp $
+ * $Id: cxx_dbt.cpp,v 12.4 2006/08/24 14:45:13 bostic Exp $
  */
 
 #include "db_config.h"
 
-#include 
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
 
-#include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc_auto/db_auto.h"
 #include "dbinc_auto/crdel_auto.h"
diff --git a/db/cxx/cxx_env.cpp b/db/cxx/cxx_env.cpp
index 92067ab1f..ef6dd5678 100644
--- a/db/cxx/cxx_env.cpp
+++ b/db/cxx/cxx_env.cpp
@@ -1,23 +1,24 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_env.cpp,v 11.105 2004/09/22 22:20:31 mjc Exp $
+ * $Id: cxx_env.cpp,v 12.32 2006/09/13 14:53:36 mjc Exp $
  */
 
 #include "db_config.h"
 
-#include 
-#include               // needed for set_error_stream
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
 
-#include "db_int.h"
+#include "dbinc/db_page.h"
+#include "dbinc/db_am.h"
+#include "dbinc/log.h"
 #include "dbinc_auto/common_ext.h"
+#include "dbinc_auto/log_ext.h"
 
 #ifdef HAVE_CXX_STDHEADERS
 using std::cerr;
@@ -89,9 +90,15 @@ void _paniccall_intercept_c(DB_ENV *env, int errval)
 	DbEnv::_paniccall_intercept(env, errval);
 }
 
+extern "C"
+void _event_func_intercept_c(DB_ENV *env, u_int32_t event, void *event_info)
+{
+	DbEnv::_event_func_intercept(env, event, event_info);
+}
+
 extern "C"
 void _stream_error_function_c(const DB_ENV *env,
-			      const char *prefix, const char *message)
+    const char *prefix, const char *message)
 {
 	DbEnv::_stream_error_function(env, prefix, message);
 }
@@ -103,21 +110,39 @@ void _stream_message_function_c(const DB_ENV *env, const char *message)
 }
 
 extern "C"
-int _app_dispatch_intercept_c(DB_ENV *env, DBT *dbt,
-			      DB_LSN *lsn, db_recops op)
+int _app_dispatch_intercept_c(DB_ENV *env, DBT *dbt, DB_LSN *lsn, db_recops op)
 {
 	return (DbEnv::_app_dispatch_intercept(env, dbt, lsn, op));
 }
 
 extern "C"
-int _rep_send_intercept_c(DB_ENV *env, const DBT *cntrl,
-			  const DBT *data, const DB_LSN *lsn, int id,
-			  u_int32_t flags)
+int _rep_send_intercept_c(DB_ENV *env, const DBT *cntrl, const DBT *data,
+    const DB_LSN *lsn, int id, u_int32_t flags)
 {
 	return (DbEnv::_rep_send_intercept(env,
 	    cntrl, data, lsn, id, flags));
 }
 
+extern "C"
+int _isalive_intercept_c(
+    DB_ENV *env, pid_t pid, db_threadid_t thrid, u_int32_t flags)
+{
+	return (DbEnv::_isalive_intercept(env, pid, thrid, flags));
+}
+
+extern "C"
+void _thread_id_intercept_c(DB_ENV *env, pid_t *pidp, db_threadid_t *thridp)
+{
+	DbEnv::_thread_id_intercept(env, pidp, thridp);
+}
+
+extern "C"
+char *_thread_id_string_intercept_c(DB_ENV *env, pid_t pid,
+    db_threadid_t thrid, char *buf)
+{
+	return (DbEnv::_thread_id_string_intercept(env, pid, thrid, buf));
+}
+
 void DbEnv::_feedback_intercept(DB_ENV *env, int opcode, int pct)
 {
 	DbEnv *cxxenv = DbEnv::get_DbEnv(env);
@@ -150,8 +175,25 @@ void DbEnv::_paniccall_intercept(DB_ENV *env, int errval)
 	(*cxxenv->paniccall_callback_)(cxxenv, errval);
 }
 
-int DbEnv::_app_dispatch_intercept(DB_ENV *env, DBT *dbt,
-				   DB_LSN *lsn, db_recops op)
+void DbEnv::_event_func_intercept(
+    DB_ENV *env, u_int32_t event, void *event_info)
+{
+	DbEnv *cxxenv = DbEnv::get_DbEnv(env);
+	if (cxxenv == 0) {
+		DB_ERROR(0,
+		    "DbEnv::event_func_callback", EINVAL, ON_ERROR_UNKNOWN);
+		return;
+	}
+	if (cxxenv->event_func_callback_ == 0) {
+		DB_ERROR(cxxenv, "DbEnv::event_func_callback", EINVAL,
+		    cxxenv->error_policy());
+		return;
+	}
+	(*cxxenv->event_func_callback_)(cxxenv, event, event_info);
+}
+
+int DbEnv::_app_dispatch_intercept(DB_ENV *env, DBT *dbt, DB_LSN *lsn,
+    db_recops op)
 {
 	DbEnv *cxxenv = DbEnv::get_DbEnv(env);
 	if (cxxenv == 0) {
@@ -170,9 +212,20 @@ int DbEnv::_app_dispatch_intercept(DB_ENV *env, DBT *dbt,
 	return ((*cxxenv->app_dispatch_callback_)(cxxenv, cxxdbt, cxxlsn, op));
 }
 
-int DbEnv::_rep_send_intercept(DB_ENV *env, const DBT *cntrl,
-			       const DBT *data, const DB_LSN *lsn,
-			       int id, u_int32_t flags)
+int DbEnv::_isalive_intercept(
+    DB_ENV *env, pid_t pid, db_threadid_t thrid, u_int32_t flags)
+{
+	DbEnv *cxxenv = DbEnv::get_DbEnv(env);
+	if (cxxenv == 0) {
+		DB_ERROR(DbEnv::get_DbEnv(env),
+			"DbEnv::isalive_callback", EINVAL, ON_ERROR_UNKNOWN);
+		return (0);
+	}
+	return ((*cxxenv->isalive_callback_)(cxxenv, pid, thrid, flags));
+}
+
+int DbEnv::_rep_send_intercept(DB_ENV *env, const DBT *cntrl, const DBT *data,
+    const DB_LSN *lsn, int id, u_int32_t flags)
 {
 	DbEnv *cxxenv = DbEnv::get_DbEnv(env);
 	if (cxxenv == 0) {
@@ -187,6 +240,30 @@ int DbEnv::_rep_send_intercept(DB_ENV *env, const DBT *cntrl,
 	    cxxcntrl, cxxdata, cxxlsn, id, flags));
 }
 
+void DbEnv::_thread_id_intercept(DB_ENV *env,
+    pid_t *pidp, db_threadid_t *thridp)
+{
+	DbEnv *cxxenv = DbEnv::get_DbEnv(env);
+	if (cxxenv == 0) {
+		DB_ERROR(DbEnv::get_DbEnv(env),
+			"DbEnv::thread_id_callback", EINVAL, ON_ERROR_UNKNOWN);
+	} else
+		cxxenv->thread_id_callback_(cxxenv, pidp, thridp);
+}
+
+char *DbEnv::_thread_id_string_intercept(DB_ENV *env,
+    pid_t pid, db_threadid_t thrid, char *buf)
+{
+	DbEnv *cxxenv = DbEnv::get_DbEnv(env);
+	if (cxxenv == 0) {
+		DB_ERROR(DbEnv::get_DbEnv(env),
+		    "DbEnv::thread_id_string_callback", EINVAL,
+		    ON_ERROR_UNKNOWN);
+		return (NULL);
+	}
+	return (cxxenv->thread_id_string_callback_(cxxenv, pid, thrid, buf));
+}
+
 // A truism for the DbEnv object is that there is a valid
 // DB_ENV handle from the constructor until close().
 // After the close, the DB_ENV handle is invalid and
@@ -208,8 +285,7 @@ DbEnv::DbEnv(u_int32_t flags)
 ,	app_dispatch_callback_(0)
 ,	feedback_callback_(0)
 ,	paniccall_callback_(0)
-,	pgin_callback_(0)
-,	pgout_callback_(0)
+,	event_func_callback_(0)
 ,	rep_send_callback_(0)
 {
 	if ((construct_error_ = initialize(0)) != 0)
@@ -226,8 +302,7 @@ DbEnv::DbEnv(DB_ENV *env, u_int32_t flags)
 ,	app_dispatch_callback_(0)
 ,	feedback_callback_(0)
 ,	paniccall_callback_(0)
-,	pgin_callback_(0)
-,	pgout_callback_(0)
+,	event_func_callback_(0)
 ,	rep_send_callback_(0)
 {
 	if ((construct_error_ = initialize(env)) != 0)
@@ -247,20 +322,15 @@ DbEnv::~DbEnv()
 	DB_ENV *env = unwrap(this);
 
 	if (env != NULL) {
-		cleanup();
 		(void)env->close(env, 0);
+		cleanup();
 	}
 }
 
 // called by destructors before the DB_ENV is destroyed.
 void DbEnv::cleanup()
 {
-	DB_ENV *env = unwrap(this);
-
-	if (env != NULL) {
-		env->api1_internal = 0;
-		imp_ = 0;
-	}
+	imp_ = 0;
 }
 
 int DbEnv::close(u_int32_t flags)
@@ -268,17 +338,17 @@ int DbEnv::close(u_int32_t flags)
 	int ret;
 	DB_ENV *env = unwrap(this);
 
+	ret = env->close(env, flags);
+
 	// after a close (no matter if success or failure),
-	// the underlying DB_ENV object must not be accessed,
-	// so we clean up in advance.
-	//
+	// the underlying DB_ENV object must not be accessed.
 	cleanup();
 
 	// It's safe to throw an error after the close,
 	// since our error mechanism does not peer into
 	// the DB* structures.
 	//
-	if ((ret = env->close(env, flags)) != 0)
+	if (ret != 0)
 		DB_ERROR(this, "DbEnv::close", ret, error_policy());
 
 	return (ret);
@@ -295,7 +365,7 @@ void DbEnv::err(int error, const char *format, ...)
 {
 	DB_ENV *env = unwrap(this);
 
-	DB_REAL_ERR(env, error, 1, 1, format);
+	DB_REAL_ERR(env, error, DB_ERROR_SET, 1, format);
 }
 
 // Return a tristate value corresponding to whether we should
@@ -318,7 +388,7 @@ void DbEnv::errx(const char *format, ...)
 {
 	DB_ENV *env = unwrap(this);
 
-	DB_REAL_ERR(env, 0, 0, 1, format);
+	DB_REAL_ERR(env, 0, DB_ERROR_NOT_SET, 1, format);
 }
 
 void *DbEnv::get_app_private() const
@@ -326,10 +396,20 @@ void *DbEnv::get_app_private() const
 	return unwrapConst(this)->app_private;
 }
 
+DBENV_METHOD(failchk, (u_int32_t flags), (dbenv, flags))
+DBENV_METHOD(fileid_reset, (const char *file, u_int32_t flags),
+    (dbenv, file, flags))
 DBENV_METHOD(get_home, (const char **homep), (dbenv, homep))
 DBENV_METHOD(get_open_flags, (u_int32_t *flagsp), (dbenv, flagsp))
 DBENV_METHOD(get_data_dirs, (const char ***dirspp), (dbenv, dirspp))
 
+bool DbEnv::is_bigendian()
+{
+	return unwrap(this)->is_bigendian() ? true : false;
+}
+
+DBENV_METHOD(set_thread_count, (u_int32_t count), (dbenv, count))
+
 // used internally during constructor
 // to associate an existing DB_ENV with this DbEnv,
 // or create a new one.
@@ -392,10 +472,27 @@ DBENV_METHOD(log_file, (DbLsn *lsn, char *namep, size_t len),
 DBENV_METHOD(log_flush, (const DbLsn *lsn), (dbenv, lsn))
 DBENV_METHOD(log_put, (DbLsn *lsn, const Dbt *data, u_int32_t flags),
     (dbenv, lsn, data, flags))
+
+int DbEnv::log_printf(DbTxn *txn, const char *fmt, ...)
+{
+	DB_ENV *env = unwrap(this);
+	va_list ap;
+	int ret;
+
+	va_start(ap, fmt);
+	ret = __log_printf_pp(env, unwrap(txn), fmt, ap);
+	va_end(ap);
+
+	return (ret);
+}
+
 DBENV_METHOD(log_stat, (DB_LOG_STAT **spp, u_int32_t flags),
     (dbenv, spp, flags))
 DBENV_METHOD(log_stat_print, (u_int32_t flags), (dbenv, flags))
 
+DBENV_METHOD(lsn_reset, (const char *file, u_int32_t flags),
+    (dbenv, file, flags))
+
 int DbEnv::memp_fcreate(DbMpoolFile **dbmfp, u_int32_t flags)
 {
 	DB_ENV *env = unwrap(this);
@@ -452,13 +549,15 @@ int DbEnv::remove(const char *db_home, u_int32_t flags)
 	int ret;
 	DB_ENV *env = unwrap(this);
 
+	ret = env->remove(env, db_home, flags);
+
 	// after a remove (no matter if success or failure),
 	// the underlying DB_ENV object must not be accessed,
 	// so we clean up in advance.
 	//
 	cleanup();
 
-	if ((ret = env->remove(env, db_home, flags)) != 0)
+	if (ret != 0)
 		DB_ERROR(this, "DbEnv::remove", ret, error_policy());
 
 	return (ret);
@@ -485,28 +584,30 @@ void DbEnv::runtime_error(DbEnv *env,
 				dl_except.set_env(env);
 				throw dl_except;
 			}
-			break;
-		case DB_RUNRECOVERY:
-			{
-				DbRunRecoveryException rr_except(caller);
-				rr_except.set_env(env);
-				throw rr_except;
-			}
-			break;
 		case DB_LOCK_NOTGRANTED:
 			{
 				DbLockNotGrantedException lng_except(caller);
 				lng_except.set_env(env);
 				throw lng_except;
 			}
-			break;
+		case DB_REP_HANDLE_DEAD:
+			{
+				DbRepHandleDeadException hd_except(caller);
+				hd_except.set_env(env);
+				throw hd_except;
+			}
+		case DB_RUNRECOVERY:
+			{
+				DbRunRecoveryException rr_except(caller);
+				rr_except.set_env(env);
+				throw rr_except;
+			}
 		default:
 			{
 				DbException except(caller, error);
 				except.set_env(env);
 				throw except;
 			}
-			break;
 		}
 	}
 }
@@ -612,10 +713,14 @@ DBENV_METHOD_VOID(get_errfile, (FILE **errfilep), (dbenv, errfilep))
 DBENV_METHOD_VOID(set_errfile, (FILE *errfile), (dbenv, errfile))
 DBENV_METHOD_VOID(get_errpfx, (const char **errpfxp), (dbenv, errpfxp))
 DBENV_METHOD_VOID(set_errpfx, (const char *errpfx), (dbenv, errpfx))
+DBENV_METHOD(set_intermediate_dir, (int mode, u_int32_t flags),
+    (dbenv, mode, flags))
 DBENV_METHOD(get_lg_bsize, (u_int32_t *bsizep), (dbenv, bsizep))
 DBENV_METHOD(set_lg_bsize, (u_int32_t bsize), (dbenv, bsize))
 DBENV_METHOD(get_lg_dir, (const char **dirp), (dbenv, dirp))
 DBENV_METHOD(set_lg_dir, (const char *dir), (dbenv, dir))
+DBENV_METHOD(get_lg_filemode, (int *modep), (dbenv, modep))
+DBENV_METHOD(set_lg_filemode, (int mode), (dbenv, mode))
 DBENV_METHOD(get_lg_max, (u_int32_t *maxp), (dbenv, maxp))
 DBENV_METHOD(set_lg_max, (u_int32_t max), (dbenv, max))
 DBENV_METHOD(get_lg_regionmax, (u_int32_t *regionmaxp), (dbenv, regionmaxp))
@@ -626,7 +731,6 @@ DBENV_METHOD(set_lk_conflicts, (u_int8_t *lk_conflicts, int lk_max),
     (dbenv, lk_conflicts, lk_max))
 DBENV_METHOD(get_lk_detect, (u_int32_t *detectp), (dbenv, detectp))
 DBENV_METHOD(set_lk_detect, (u_int32_t detect), (dbenv, detect))
-DBENV_METHOD(set_lk_max, (u_int32_t max), (dbenv, max))
 DBENV_METHOD(get_lk_max_lockers, (u_int32_t *max_lockersp),
     (dbenv, max_lockersp))
 DBENV_METHOD(set_lk_max_lockers, (u_int32_t max_lockers), (dbenv, max_lockers))
@@ -635,6 +739,12 @@ DBENV_METHOD(set_lk_max_locks, (u_int32_t max_locks), (dbenv, max_locks))
 DBENV_METHOD(get_lk_max_objects, (u_int32_t *max_objectsp),
     (dbenv, max_objectsp))
 DBENV_METHOD(set_lk_max_objects, (u_int32_t max_objects), (dbenv, max_objects))
+DBENV_METHOD(get_mp_max_openfd, (int *maxopenfdp), (dbenv, maxopenfdp))
+DBENV_METHOD(set_mp_max_openfd, (int maxopenfd), (dbenv, maxopenfd))
+DBENV_METHOD(get_mp_max_write, (int *maxwritep, int *maxwrite_sleepp),
+    (dbenv, maxwritep, maxwrite_sleepp))
+DBENV_METHOD(set_mp_max_write, (int maxwrite, int maxwrite_sleep),
+    (dbenv, maxwrite, maxwrite_sleep))
 DBENV_METHOD(get_mp_mmapsize, (size_t *mmapsizep), (dbenv, mmapsizep))
 DBENV_METHOD(set_mp_mmapsize, (size_t mmapsize), (dbenv, mmapsize))
 DBENV_METHOD_VOID(get_msgfile, (FILE **msgfilep), (dbenv, msgfilep))
@@ -644,6 +754,8 @@ DBENV_METHOD(set_tmp_dir, (const char *tmp_dir), (dbenv, tmp_dir))
 DBENV_METHOD(get_tx_max, (u_int32_t *tx_maxp), (dbenv, tx_maxp))
 DBENV_METHOD(set_tx_max, (u_int32_t tx_max), (dbenv, tx_max))
 
+DBENV_METHOD(stat_print, (u_int32_t flags), (dbenv, flags))
+
 DBENV_METHOD_QUIET(set_alloc,
     (db_malloc_fcn_type malloc_fcn, db_realloc_fcn_type realloc_fcn,
     db_free_fcn_type free_fcn),
@@ -694,7 +806,8 @@ int DbEnv::set_feedback(void (*arg)(DbEnv *, int, int))
 
 	feedback_callback_ = arg;
 
-	return (dbenv->set_feedback(dbenv, _feedback_intercept_c));
+	return (dbenv->set_feedback(dbenv,
+	    arg == 0 ? 0 : _feedback_intercept_c));
 }
 
 DBENV_METHOD(get_flags, (u_int32_t *flagsp), (dbenv, flagsp))
@@ -708,7 +821,7 @@ void DbEnv::set_msgcall(void (*arg)(const DbEnv *, const char *))
 	message_stream_ = 0;
 
 	dbenv->set_msgcall(dbenv, (arg == 0) ? 0 :
-			   _stream_message_function_c);
+	    _stream_message_function_c);
 }
 
 __DB_STD(ostream) *DbEnv::get_message_stream()
@@ -733,7 +846,18 @@ int DbEnv::set_paniccall(void (*arg)(DbEnv *, int))
 
 	paniccall_callback_ = arg;
 
-	return (dbenv->set_paniccall(dbenv, _paniccall_intercept_c));
+	return (dbenv->set_paniccall(dbenv,
+	    arg == 0 ? 0 : _paniccall_intercept_c));
+}
+
+int DbEnv::set_event_notify(void (*arg)(DbEnv *, u_int32_t, void *))
+{
+	DB_ENV *dbenv = unwrap(this);
+
+	event_func_callback_ = arg;
+
+	return (dbenv->set_event_notify(dbenv,
+	    arg == 0 ? 0 : _event_func_intercept_c));
 }
 
 DBENV_METHOD(set_rpc_server,
@@ -741,9 +865,6 @@ DBENV_METHOD(set_rpc_server,
     (dbenv, cl, host, tsec, ssec, flags))
 DBENV_METHOD(get_shm_key, (long *shm_keyp), (dbenv, shm_keyp))
 DBENV_METHOD(set_shm_key, (long shm_key), (dbenv, shm_key))
-// Note: this changes from last_known_error_policy to error_policy()
-DBENV_METHOD(get_tas_spins, (u_int32_t *argp), (dbenv, argp))
-DBENV_METHOD(set_tas_spins, (u_int32_t arg), (dbenv, arg))
 
 int DbEnv::set_app_dispatch
     (int (*arg)(DbEnv *, Dbt *, DbLsn *, db_recops))
@@ -753,18 +874,92 @@ int DbEnv::set_app_dispatch
 
 	app_dispatch_callback_ = arg;
 	if ((ret = dbenv->set_app_dispatch(dbenv,
-	    _app_dispatch_intercept_c)) != 0)
+	    arg == 0 ? 0 : _app_dispatch_intercept_c)) != 0)
 		DB_ERROR(this, "DbEnv::set_app_dispatch", ret, error_policy());
 
 	return (ret);
 }
 
+int DbEnv::set_isalive
+    (int (*arg)(DbEnv *, pid_t, db_threadid_t, u_int32_t))
+{
+	DB_ENV *dbenv = unwrap(this);
+	int ret;
+
+	isalive_callback_ = arg;
+	if ((ret = dbenv->set_isalive(dbenv,
+	    arg == 0 ? 0 : _isalive_intercept_c)) != 0)
+		DB_ERROR(this, "DbEnv::set_isalive", ret, error_policy());
+
+	return (ret);
+}
+
 DBENV_METHOD(get_tx_timestamp, (time_t *timestamp), (dbenv, timestamp))
 DBENV_METHOD(set_tx_timestamp, (time_t *timestamp), (dbenv, timestamp))
 DBENV_METHOD(get_verbose, (u_int32_t which, int *onoffp),
     (dbenv, which, onoffp))
 DBENV_METHOD(set_verbose, (u_int32_t which, int onoff), (dbenv, which, onoff))
 
+DBENV_METHOD(mutex_alloc,
+    (u_int32_t flags, db_mutex_t *mutexp), (dbenv, flags, mutexp))
+DBENV_METHOD(mutex_free, (db_mutex_t mutex), (dbenv, mutex))
+DBENV_METHOD(mutex_get_align, (u_int32_t *argp), (dbenv, argp))
+DBENV_METHOD(mutex_get_increment, (u_int32_t *argp), (dbenv, argp))
+DBENV_METHOD(mutex_get_max, (u_int32_t *argp), (dbenv, argp))
+DBENV_METHOD(mutex_get_tas_spins, (u_int32_t *argp), (dbenv, argp))
+DBENV_METHOD(mutex_lock, (db_mutex_t mutex), (dbenv, mutex))
+DBENV_METHOD(mutex_set_align, (u_int32_t arg), (dbenv, arg))
+DBENV_METHOD(mutex_set_increment, (u_int32_t arg), (dbenv, arg))
+DBENV_METHOD(mutex_set_max, (u_int32_t arg), (dbenv, arg))
+DBENV_METHOD(mutex_set_tas_spins, (u_int32_t arg), (dbenv, arg))
+DBENV_METHOD(mutex_stat,
+    (DB_MUTEX_STAT **statp, u_int32_t flags), (dbenv, statp, flags))
+DBENV_METHOD(mutex_stat_print, (u_int32_t flags), (dbenv, flags))
+DBENV_METHOD(mutex_unlock, (db_mutex_t mutex), (dbenv, mutex))
+
+int DbEnv::set_thread_id(void (*arg)(DbEnv *, pid_t *, db_threadid_t *))
+{
+	DB_ENV *dbenv = unwrap(this);
+	int ret;
+
+	thread_id_callback_ = arg;
+	if ((ret = dbenv->set_thread_id(dbenv,
+	    arg == 0 ? 0 : _thread_id_intercept_c)) != 0)
+		DB_ERROR(this, "DbEnv::set_thread_id", ret, error_policy());
+
+	return (ret);
+}
+
+int DbEnv::set_thread_id_string(
+    char *(*arg)(DbEnv *, pid_t, db_threadid_t, char *))
+{
+	DB_ENV *dbenv = unwrap(this);
+	int ret;
+
+	thread_id_string_callback_ = arg;
+	if ((ret = dbenv->set_thread_id_string(dbenv,
+	    arg == 0 ? 0 : _thread_id_string_intercept_c)) != 0)
+		DB_ERROR(this, "DbEnv::set_thread_id_string", ret,
+		    error_policy());
+
+	return (ret);
+}
+
+int DbEnv::cdsgroup_begin(DbTxn **tid)
+{
+	DB_ENV *env = unwrap(this);
+	DB_TXN *txn;
+	int ret;
+
+	ret = env->cdsgroup_begin(env, &txn);
+	if (DB_RETOK_STD(ret))
+		*tid = new DbTxn(txn);
+	else
+		DB_ERROR(this, "DbEnv::cdsgroup_begin", ret, error_policy());
+
+	return (ret);
+}
+
 int DbEnv::txn_begin(DbTxn *pid, DbTxn **tid, u_int32_t flags)
 {
 	DB_ENV *env = unwrap(this);
@@ -830,25 +1025,26 @@ DBENV_METHOD(txn_stat, (DB_TXN_STAT **statp, u_int32_t flags),
     (dbenv, statp, flags))
 DBENV_METHOD(txn_stat_print, (u_int32_t flags), (dbenv, flags))
 
-int DbEnv::set_rep_transport(int myid,
-    int (*f_send)(DbEnv *, const Dbt *, const Dbt *, const DbLsn *, int,
-		  u_int32_t))
+int DbEnv::rep_set_transport(int myid, int (*arg)(DbEnv *,
+    const Dbt *, const Dbt *, const DbLsn *, int, u_int32_t))
 {
 	DB_ENV *dbenv = unwrap(this);
 	int ret;
 
-	rep_send_callback_ = f_send;
-	if ((ret = dbenv->set_rep_transport(dbenv,
-	    myid, _rep_send_intercept_c)) != 0)
-		DB_ERROR(this, "DbEnv::set_rep_transport", ret, error_policy());
+	rep_send_callback_ = arg;
+	if ((ret = dbenv->rep_set_transport(dbenv, myid,
+	    arg == 0 ? 0 : _rep_send_intercept_c)) != 0)
+		DB_ERROR(this, "DbEnv::rep_set_transport", ret, error_policy());
 
 	return (ret);
 }
 
-DBENV_METHOD(rep_elect,
-    (int nsites,
-    int nvotes, int priority, u_int32_t timeout, int *eidp, u_int32_t flags),
-    (dbenv, nvotes, nsites, priority, timeout, eidp, flags))
+DBENV_METHOD(rep_elect, (int nsites, int nvotes, int *eidp, u_int32_t flags),
+    (dbenv, nsites, nvotes, eidp, flags))
+DBENV_METHOD(rep_flush, (), (dbenv))
+DBENV_METHOD(rep_get_config, (u_int32_t which, int *onoffp),
+    (dbenv, which, onoffp))
+DBENV_METHOD(set_rep_request, (u_int32_t min, u_int32_t max), (dbenv, min, max))
 
 int DbEnv::rep_process_message(Dbt *control,
     Dbt *rec, int *idp, DbLsn *ret_lsnp)
@@ -864,6 +1060,8 @@ int DbEnv::rep_process_message(Dbt *control,
 	return (ret);
 }
 
+DBENV_METHOD(rep_set_config,
+    (u_int32_t which, int onoff), (dbenv, which, onoff))
 DBENV_METHOD(rep_start,
     (Dbt *cookie, u_int32_t flags),
     (dbenv, (DBT *)cookie, flags))
@@ -871,12 +1069,38 @@ DBENV_METHOD(rep_start,
 DBENV_METHOD(rep_stat, (DB_REP_STAT **statp, u_int32_t flags),
     (dbenv, statp, flags))
 DBENV_METHOD(rep_stat_print, (u_int32_t flags), (dbenv, flags))
+DBENV_METHOD(rep_sync, (u_int32_t flags), (dbenv, flags))
 
-DBENV_METHOD(get_rep_limit, (u_int32_t *gbytesp, u_int32_t *bytesp),
+DBENV_METHOD(rep_get_limit, (u_int32_t *gbytesp, u_int32_t *bytesp),
     (dbenv, gbytesp, bytesp))
-DBENV_METHOD(set_rep_limit, (u_int32_t gbytes, u_int32_t bytes),
+DBENV_METHOD(rep_set_limit, (u_int32_t gbytes, u_int32_t bytes),
     (dbenv, gbytes, bytes))
 
+//
+// Begin advanced replication API method implementations
+DBENV_METHOD(rep_get_nsites, (int *n), (dbenv, n))
+DBENV_METHOD(rep_set_nsites, (int n), (dbenv, n))
+DBENV_METHOD(rep_get_priority, (int *priority),
+    (dbenv, priority))
+DBENV_METHOD(rep_set_priority, (int priority),
+    (dbenv, priority))
+DBENV_METHOD(rep_get_timeout, (int which, db_timeout_t * timeout),
+    (dbenv, which, timeout))
+DBENV_METHOD(rep_set_timeout, (int which, db_timeout_t timeout),
+    (dbenv, which, timeout))
+DBENV_METHOD(repmgr_add_remote_site, (const char* host, u_int16_t port,
+    int * eidp, u_int32_t flags), (dbenv, host, port, eidp, flags))
+DBENV_METHOD(repmgr_get_ack_policy, (int *policy), (dbenv, policy))
+DBENV_METHOD(repmgr_set_ack_policy, (int policy), (dbenv, policy))
+DBENV_METHOD(repmgr_set_local_site, (const char* host, u_int16_t port,
+    u_int32_t flags), (dbenv, host, port, flags))
+DBENV_METHOD(repmgr_site_list, (u_int *countp, DB_REPMGR_SITE **listp),
+    (dbenv, countp, listp))
+DBENV_METHOD(repmgr_start, (int nthreads, u_int32_t flags),
+    (dbenv, nthreads, flags))
+
+// End advanced replication API method implementations.
+
 DBENV_METHOD(get_timeout,
     (db_timeout_t *timeoutp, u_int32_t flags),
     (dbenv, timeoutp, flags))
diff --git a/db/cxx/cxx_except.cpp b/db/cxx/cxx_except.cpp
index 22eb0eae9..3a58f6bec 100644
--- a/db/cxx/cxx_except.cpp
+++ b/db/cxx/cxx_except.cpp
@@ -1,20 +1,21 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_except.cpp,v 11.28 2004/09/22 03:34:48 bostic Exp $
+ * $Id: cxx_except.cpp,v 12.10 2006/09/13 14:53:37 mjc Exp $
  */
 
 #include "db_config.h"
 
-#include 
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
 
+static const int MAX_DESCRIPTION_LENGTH = 1024;
+
 // Note: would not be needed if we can inherit from exception
 // It does not appear to be possible to inherit from exception
 // with the current Microsoft library (VC5.0).
@@ -85,10 +86,11 @@ DbException &DbException::operator = (const DbException &that)
 
 void DbException::describe(const char *prefix, const char *description)
 {
-	char msgbuf[1024], *p, *end;
+	char *msgbuf, *p, *end;
 
+	msgbuf = new char[MAX_DESCRIPTION_LENGTH];
 	p = msgbuf;
-	end = msgbuf + sizeof(msgbuf) - 1;
+	end = msgbuf + MAX_DESCRIPTION_LENGTH - 1;
 
 	if (prefix != NULL) {
 		strncpy(p, prefix, (p < end) ? end - p: 0);
@@ -117,6 +119,7 @@ void DbException::describe(const char *prefix, const char *description)
 		*end = '\0';
 
 	what_ = dupString(msgbuf);
+	delete [] msgbuf;
 }
 
 int DbException::get_errno() const
@@ -151,13 +154,13 @@ DbMemoryException::~DbMemoryException() throw()
 }
 
 DbMemoryException::DbMemoryException(Dbt *dbt)
-:	DbException(memory_err_desc, ENOMEM)
+:	DbException(memory_err_desc, DB_BUFFER_SMALL)
 ,	dbt_(dbt)
 {
 }
 
 DbMemoryException::DbMemoryException(const char *prefix, Dbt *dbt)
-:	DbException(prefix, memory_err_desc, ENOMEM)
+:	DbException(prefix, memory_err_desc, DB_BUFFER_SMALL)
 ,	dbt_(dbt)
 {
 }
@@ -295,6 +298,35 @@ int DbLockNotGrantedException::get_index() const
 	return index_;
 }
 
+////////////////////////////////////////////////////////////////////////
+//                                                                    //
+//                            DbRepHandleDeadException                //
+//                                                                    //
+////////////////////////////////////////////////////////////////////////
+
+DbRepHandleDeadException::~DbRepHandleDeadException() throw()
+{
+}
+
+DbRepHandleDeadException::DbRepHandleDeadException(const char *description)
+:	DbException(description, DB_REP_HANDLE_DEAD)
+{
+}
+
+DbRepHandleDeadException::DbRepHandleDeadException
+    (const DbRepHandleDeadException &that)
+:	DbException(that)
+{
+}
+
+DbRepHandleDeadException
+&DbRepHandleDeadException::operator =(const DbRepHandleDeadException &that)
+{
+	if (this != &that)
+		DbException::operator=(that);
+	return (*this);
+}
+
 ////////////////////////////////////////////////////////////////////////
 //                                                                    //
 //                            DbRunRecoveryException                  //
diff --git a/db/cxx/cxx_lock.cpp b/db/cxx/cxx_lock.cpp
index d22cf662b..8c5a537a2 100644
--- a/db/cxx/cxx_lock.cpp
+++ b/db/cxx/cxx_lock.cpp
@@ -1,16 +1,15 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_lock.cpp,v 11.19 2004/01/28 03:35:56 bostic Exp $
+ * $Id: cxx_lock.cpp,v 12.4 2006/08/24 14:45:13 bostic Exp $
  */
 
 #include "db_config.h"
 
-#include 
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
diff --git a/db/cxx/cxx_logc.cpp b/db/cxx/cxx_logc.cpp
index c5399b531..1e3c4ef70 100644
--- a/db/cxx/cxx_logc.cpp
+++ b/db/cxx/cxx_logc.cpp
@@ -1,21 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_logc.cpp,v 11.13 2004/02/05 02:25:12 mjc Exp $
+ * $Id: cxx_logc.cpp,v 12.4 2006/08/24 14:45:13 bostic Exp $
  */
 
 #include "db_config.h"
 
-#include 
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
 
-#include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc_auto/db_auto.h"
 #include "dbinc_auto/crdel_auto.h"
diff --git a/db/cxx/cxx_mpool.cpp b/db/cxx/cxx_mpool.cpp
index 54747b092..1085f0390 100644
--- a/db/cxx/cxx_mpool.cpp
+++ b/db/cxx/cxx_mpool.cpp
@@ -1,21 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_mpool.cpp,v 11.28 2004/01/28 03:35:56 bostic Exp $
+ * $Id: cxx_mpool.cpp,v 12.5 2006/08/24 14:45:13 bostic Exp $
  */
 
 #include "db_config.h"
 
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
 
-#include "db_int.h"
-
 // Helper macros for simple methods that pass through to the
 // underlying C method. It may return an error or raise an exception.
 // Note this macro expects that input _argspec is an argument
@@ -84,8 +82,9 @@ int DbMpoolFile::close(u_int32_t flags)
 	return (ret);
 }
 
-DB_MPOOLFILE_METHOD(get, (db_pgno_t *pgnoaddr, u_int32_t flags, void *pagep),
-    (mpf, pgnoaddr, flags, pagep), DB_RETOK_MPGET)
+DB_MPOOLFILE_METHOD(get,
+    (db_pgno_t *pgnoaddr, DbTxn *txn, u_int32_t flags, void *pagep),
+    (mpf, pgnoaddr, unwrap(txn), flags, pagep), DB_RETOK_MPGET)
 DB_MPOOLFILE_METHOD(open,
     (const char *file, u_int32_t flags, int mode, size_t pagesize),
     (mpf, file, flags, mode, pagesize), DB_RETOK_STD)
diff --git a/db/cxx/cxx_multi.cpp b/db/cxx/cxx_multi.cpp
index 0961f2921..a53f09b34 100644
--- a/db/cxx/cxx_multi.cpp
+++ b/db/cxx/cxx_multi.cpp
@@ -1,19 +1,21 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_multi.cpp,v 1.4 2004/01/28 03:35:56 bostic Exp $
+ * $Id: cxx_multi.cpp,v 12.7 2006/08/24 14:45:13 bostic Exp $
  */
 
 #include "db_config.h"
 
+#include "db_int.h"
+
 #include "db_cxx.h"
 
 DbMultipleIterator::DbMultipleIterator(const Dbt &dbt)
  : data_((u_int8_t*)dbt.get_data()),
-   p_((u_int32_t*)(data_ + dbt.get_size() - sizeof(u_int32_t)))
+   p_((u_int32_t*)(data_ + dbt.get_ulen() - sizeof(u_int32_t)))
 {
 }
 
@@ -29,7 +31,7 @@ bool DbMultipleDataIterator::next(Dbt &data)
 		if (data.get_size() == 0 && data.get_data() == data_)
 			data.set_data(0);
 	}
-	return (data.get_data() != 0);
+	return (p_ != 0);
 }
 
 bool DbMultipleKeyDataIterator::next(Dbt &key, Dbt &data)
@@ -46,7 +48,7 @@ bool DbMultipleKeyDataIterator::next(Dbt &key, Dbt &data)
 		data.set_data(data_ + *p_--);
 		data.set_size(*p_--);
 	}
-	return (data.get_data() != 0);
+	return (p_ != 0);
 }
 
 bool DbMultipleRecnoDataIterator::next(db_recno_t &recno, Dbt &data)
@@ -61,5 +63,5 @@ bool DbMultipleRecnoDataIterator::next(db_recno_t &recno, Dbt &data)
 		data.set_data(data_ + *p_--);
 		data.set_size(*p_--);
 	}
-	return (recno != 0);
+	return (p_ != 0);
 }
diff --git a/db/cxx/cxx_seq.cpp b/db/cxx/cxx_seq.cpp
index 60bc7455b..d3a4bd0ad 100644
--- a/db/cxx/cxx_seq.cpp
+++ b/db/cxx/cxx_seq.cpp
@@ -1,22 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_seq.cpp,v 11.3 2004/09/23 20:05:08 mjc Exp $
+ * $Id: cxx_seq.cpp,v 12.6 2006/08/24 14:45:13 bostic Exp $
  */
 
 #include "db_config.h"
 
-#include 
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
 
-#include "db_int.h"
-
 // Helper macro for simple methods that pass through to the
 // underlying C method. It may return an error or raise an exception.
 // Note this macro expects that input _argspec is an argument
@@ -90,20 +87,20 @@ DBSEQ_METHOD(get_range, (db_seq_t *minp, db_seq_t *maxp), (seq, minp, maxp), 0)
 DBSEQ_METHOD(set_range, (db_seq_t min, db_seq_t max), (seq, min, max), 0)
 
 Db *DbSequence::get_db()
-{       
+{
 	DB_SEQUENCE *seq = unwrap(this);
 	DB *db;
 	(void)seq->get_db(seq, &db);
 	return Db::get_Db(db);
-}   
+}
 
 Dbt *DbSequence::get_key()
-{       
+{
 	DB_SEQUENCE *seq = unwrap(this);
 	memset(&key_, 0, sizeof (DBT));
 	(void)seq->get_key(seq, &key_);
 	return Dbt::get_Dbt(&key_);
-}   
+}
 
 // static method
 DbSequence *DbSequence::wrap_DB_SEQUENCE(DB_SEQUENCE *seq)
diff --git a/db/cxx/cxx_txn.cpp b/db/cxx/cxx_txn.cpp
index 89ad7f02b..6456e3461 100644
--- a/db/cxx/cxx_txn.cpp
+++ b/db/cxx/cxx_txn.cpp
@@ -1,20 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_txn.cpp,v 11.33 2004/09/22 22:20:31 mjc Exp $
+ * $Id: cxx_txn.cpp,v 12.5 2006/08/24 14:45:13 bostic Exp $
  */
 
 #include "db_config.h"
 
-#include 
+#include "db_int.h"
 
 #include "db_cxx.h"
 #include "dbinc/cxx_int.h"
 
-#include "db_int.h"
 #include "dbinc/txn.h"
 
 // Helper macro for simple methods that pass through to the
@@ -67,7 +66,9 @@ u_int32_t DbTxn::id()
 	return (txn->id(txn));		// no error
 }
 
+DBTXN_METHOD(get_name, 0, (const char **namep), (txn, namep))
 DBTXN_METHOD(prepare, 0, (u_int8_t *gid), (txn, gid))
+DBTXN_METHOD(set_name, 0, (const char *name), (txn, name))
 DBTXN_METHOD(set_timeout, 0, (db_timeout_t timeout, u_int32_t flags),
     (txn, timeout, flags))
 
diff --git a/db/db/crdel.src b/db/db/crdel.src
index 034e7b82f..1992dd152 100644
--- a/db/db/crdel.src
+++ b/db/db/crdel.src
@@ -1,22 +1,15 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: crdel.src,v 11.29 2004/06/17 17:35:15 bostic Exp $
+ * $Id: crdel.src,v 12.6 2006/08/24 14:45:15 bostic Exp $
  */
 
 PREFIX	__crdel
 DBPRIVATE
 
-INCLUDE #ifndef NO_SYSTEM_INCLUDES
-INCLUDE #include 
-INCLUDE
-INCLUDE #include 
-INCLUDE #include 
-INCLUDE #endif
-INCLUDE
 INCLUDE #include "db_int.h"
 INCLUDE #include "dbinc/crypto.h"
 INCLUDE #include "dbinc/db_page.h"
@@ -34,10 +27,47 @@ INCLUDE
  * page: the actual meta-data page
  * lsn: lsn of the page.
  */
-BEGIN metasub		142
+BEGIN metasub		42	142
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
 PGDBT	page		DBT		s
 POINTER	lsn		DB_LSN *	lu
 END
 
+/*
+ * Inmem_create: Log the creation of an in-memory database.
+ *
+ * name: Name of the database
+ * fid: File id of the database
+ */
+BEGIN	inmem_create	44	138
+ARG	fileid	int32_t		ld
+DBT	name	DBT		s
+DBT	fid	DBT		s
+ARG	pgsize	u_int32_t	lu
+END
+
+/*
+ * Inmem_rename: Log the renaming of an in-memory only database.
+ *
+ * oldname: database's starting name
+ * newname: database's ending name
+ * fid: fileid
+ */
+BEGIN	inmem_rename	44	139
+DBT	oldname		DBT		s
+DBT	newname		DBT		s
+DBT	fid		DBT		s
+END
+
+/*
+ * Inmem_remove: Log the removal of an in-memory only database.
+ *
+ * name: database's ending name
+ * fid: fileid
+ */
+BEGIN	inmem_remove	44	140
+DBT	name		DBT		s
+DBT	fid		DBT		s
+END
+
diff --git a/db/db/crdel_auto.c b/db/db/crdel_auto.c
index 48823dde6..ab7f528a9 100644
--- a/db/db/crdel_auto.c
+++ b/db/db/crdel_auto.c
@@ -2,13 +2,6 @@
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/crypto.h"
 #include "dbinc/db_page.h"
@@ -22,9 +15,9 @@
  * PUBLIC:     u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
  */
 int
-__crdel_metasub_log(dbp, txnid, ret_lsnp, flags, pgno, page, lsn)
+__crdel_metasub_log(dbp, txnp, ret_lsnp, flags, pgno, page, lsn)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	db_pgno_t pgno;
@@ -51,30 +44,31 @@ __crdel_metasub_log(dbp, txnid, ret_lsnp, flags, pgno, page, lsn)
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -90,7 +84,7 @@ __crdel_metasub_log(dbp, txnid, ret_lsnp, flags, pgno, page, lsn)
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -141,18 +135,25 @@ __crdel_metasub_log(dbp, txnid, ret_lsnp, flags, pgno, page, lsn)
 		bp += page->size;
 	}
 
-	if (lsn != NULL)
+	if (lsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, lsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, lsn, sizeof(*lsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*lsn));
 	bp += sizeof(*lsn);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -171,20 +172,21 @@ __crdel_metasub_log(dbp, txnid, ret_lsnp, flags, pgno, page, lsn)
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__crdel_metasub_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -209,13 +211,14 @@ __crdel_metasub_read(dbenv, recbuf, argpp)
 	    sizeof(__crdel_metasub_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -241,6 +244,680 @@ __crdel_metasub_read(dbenv, recbuf, argpp)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __crdel_inmem_create_log __P((DB_ENV *, DB_TXN *,
+ * PUBLIC:     DB_LSN *, u_int32_t, int32_t, const DBT *, const DBT *,
+ * PUBLIC:     u_int32_t));
+ */
+int
+__crdel_inmem_create_log(dbenv, txnp, ret_lsnp, flags,
+    fileid, name, fid, pgsize)
+	DB_ENV *dbenv;
+	DB_TXN *txnp;
+	DB_LSN *ret_lsnp;
+	u_int32_t flags;
+	int32_t fileid;
+	const DBT *name;
+	const DBT *fid;
+	u_int32_t pgsize;
+{
+	DBT logrec;
+	DB_TXNLOGREC *lr;
+	DB_LSN *lsnp, null_lsn, *rlsnp;
+	u_int32_t zero, uinttmp, rectype, txn_num;
+	u_int npad;
+	u_int8_t *bp;
+	int is_durable, ret;
+
+	COMPQUIET(lr, NULL);
+
+	rectype = DB___crdel_inmem_create;
+	npad = 0;
+	rlsnp = ret_lsnp;
+
+	ret = 0;
+
+	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
+		if (txnp == NULL)
+			return (0);
+		is_durable = 0;
+	} else
+		is_durable = 1;
+
+	if (txnp == NULL) {
+		txn_num = 0;
+		lsnp = &null_lsn;
+		null_lsn.file = null_lsn.offset = 0;
+	} else {
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
+			return (ret);
+		/*
+		 * We need to assign begin_lsn while holding region mutex.
+		 * That assignment is done inside the DbEnv->log_put call,
+		 * so pass in the appropriate memory location to be filled
+		 * in by the log_put code.
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
+	}
+
+	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
+	    + sizeof(u_int32_t)
+	    + sizeof(u_int32_t) + (name == NULL ? 0 : name->size)
+	    + sizeof(u_int32_t) + (fid == NULL ? 0 : fid->size)
+	    + sizeof(u_int32_t);
+	if (CRYPTO_ON(dbenv)) {
+		npad =
+		    ((DB_CIPHER *)dbenv->crypto_handle)->adj_size(logrec.size);
+		logrec.size += npad;
+	}
+
+	if (is_durable || txnp == NULL) {
+		if ((ret =
+		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
+			return (ret);
+	} else {
+		if ((ret = __os_malloc(dbenv,
+		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
+			return (ret);
+#ifdef DIAGNOSTIC
+		if ((ret =
+		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) {
+			__os_free(dbenv, lr);
+			return (ret);
+		}
+#else
+		logrec.data = lr->data;
+#endif
+	}
+	if (npad > 0)
+		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
+
+	bp = logrec.data;
+
+	memcpy(bp, &rectype, sizeof(rectype));
+	bp += sizeof(rectype);
+
+	memcpy(bp, &txn_num, sizeof(txn_num));
+	bp += sizeof(txn_num);
+
+	memcpy(bp, lsnp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	uinttmp = (u_int32_t)fileid;
+	memcpy(bp, &uinttmp, sizeof(uinttmp));
+	bp += sizeof(uinttmp);
+
+	if (name == NULL) {
+		zero = 0;
+		memcpy(bp, &zero, sizeof(u_int32_t));
+		bp += sizeof(u_int32_t);
+	} else {
+		memcpy(bp, &name->size, sizeof(name->size));
+		bp += sizeof(name->size);
+		memcpy(bp, name->data, name->size);
+		bp += name->size;
+	}
+
+	if (fid == NULL) {
+		zero = 0;
+		memcpy(bp, &zero, sizeof(u_int32_t));
+		bp += sizeof(u_int32_t);
+	} else {
+		memcpy(bp, &fid->size, sizeof(fid->size));
+		bp += sizeof(fid->size);
+		memcpy(bp, fid->data, fid->size);
+		bp += fid->size;
+	}
+
+	uinttmp = (u_int32_t)pgsize;
+	memcpy(bp, &uinttmp, sizeof(uinttmp));
+	bp += sizeof(uinttmp);
+
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+
+	if (is_durable || txnp == NULL) {
+		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
+			if (rlsnp != ret_lsnp)
+				 *ret_lsnp = *rlsnp;
+		}
+	} else {
+#ifdef DIAGNOSTIC
+		/*
+		 * Set the debug bit if we are going to log non-durable
+		 * transactions so they will be ignored by recovery.
+		 */
+		memcpy(lr->data, logrec.data, logrec.size);
+		rectype |= DB_debug_FLAG;
+		memcpy(logrec.data, &rectype, sizeof(rectype));
+
+		ret = __log_put(dbenv,
+		    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
+#else
+		ret = 0;
+#endif
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
+		LSN_NOT_LOGGED(*ret_lsnp);
+	}
+
+#ifdef LOG_DIAGNOSTIC
+	if (ret != 0)
+		(void)__crdel_inmem_create_print(dbenv,
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
+#endif
+
+#ifdef DIAGNOSTIC
+	__os_free(dbenv, logrec.data);
+#else
+	if (is_durable || txnp == NULL)
+		__os_free(dbenv, logrec.data);
+#endif
+	return (ret);
+}
+
+/*
+ * PUBLIC: int __crdel_inmem_create_read __P((DB_ENV *, void *,
+ * PUBLIC:     __crdel_inmem_create_args **));
+ */
+int
+__crdel_inmem_create_read(dbenv, recbuf, argpp)
+	DB_ENV *dbenv;
+	void *recbuf;
+	__crdel_inmem_create_args **argpp;
+{
+	__crdel_inmem_create_args *argp;
+	u_int32_t uinttmp;
+	u_int8_t *bp;
+	int ret;
+
+	if ((ret = __os_malloc(dbenv,
+	    sizeof(__crdel_inmem_create_args) + sizeof(DB_TXN), &argp)) != 0)
+		return (ret);
+	bp = recbuf;
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
+
+	memcpy(&argp->type, bp, sizeof(argp->type));
+	bp += sizeof(argp->type);
+
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
+
+	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->fileid = (int32_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memset(&argp->name, 0, sizeof(argp->name));
+	memcpy(&argp->name.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->name.data = bp;
+	bp += argp->name.size;
+
+	memset(&argp->fid, 0, sizeof(argp->fid));
+	memcpy(&argp->fid.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->fid.data = bp;
+	bp += argp->fid.size;
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->pgsize = (u_int32_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	*argpp = argp;
+	return (0);
+}
+
+/*
+ * PUBLIC: int __crdel_inmem_rename_log __P((DB_ENV *, DB_TXN *,
+ * PUBLIC:     DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *));
+ */
+int
+__crdel_inmem_rename_log(dbenv, txnp, ret_lsnp, flags,
+    oldname, newname, fid)
+	DB_ENV *dbenv;
+	DB_TXN *txnp;
+	DB_LSN *ret_lsnp;
+	u_int32_t flags;
+	const DBT *oldname;
+	const DBT *newname;
+	const DBT *fid;
+{
+	DBT logrec;
+	DB_TXNLOGREC *lr;
+	DB_LSN *lsnp, null_lsn, *rlsnp;
+	u_int32_t zero, rectype, txn_num;
+	u_int npad;
+	u_int8_t *bp;
+	int is_durable, ret;
+
+	COMPQUIET(lr, NULL);
+
+	rectype = DB___crdel_inmem_rename;
+	npad = 0;
+	rlsnp = ret_lsnp;
+
+	ret = 0;
+
+	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
+		if (txnp == NULL)
+			return (0);
+		is_durable = 0;
+	} else
+		is_durable = 1;
+
+	if (txnp == NULL) {
+		txn_num = 0;
+		lsnp = &null_lsn;
+		null_lsn.file = null_lsn.offset = 0;
+	} else {
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
+			return (ret);
+		/*
+		 * We need to assign begin_lsn while holding region mutex.
+		 * That assignment is done inside the DbEnv->log_put call,
+		 * so pass in the appropriate memory location to be filled
+		 * in by the log_put code.
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
+	}
+
+	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
+	    + sizeof(u_int32_t) + (oldname == NULL ? 0 : oldname->size)
+	    + sizeof(u_int32_t) + (newname == NULL ? 0 : newname->size)
+	    + sizeof(u_int32_t) + (fid == NULL ? 0 : fid->size);
+	if (CRYPTO_ON(dbenv)) {
+		npad =
+		    ((DB_CIPHER *)dbenv->crypto_handle)->adj_size(logrec.size);
+		logrec.size += npad;
+	}
+
+	if (is_durable || txnp == NULL) {
+		if ((ret =
+		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
+			return (ret);
+	} else {
+		if ((ret = __os_malloc(dbenv,
+		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
+			return (ret);
+#ifdef DIAGNOSTIC
+		if ((ret =
+		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) {
+			__os_free(dbenv, lr);
+			return (ret);
+		}
+#else
+		logrec.data = lr->data;
+#endif
+	}
+	if (npad > 0)
+		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
+
+	bp = logrec.data;
+
+	memcpy(bp, &rectype, sizeof(rectype));
+	bp += sizeof(rectype);
+
+	memcpy(bp, &txn_num, sizeof(txn_num));
+	bp += sizeof(txn_num);
+
+	memcpy(bp, lsnp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	if (oldname == NULL) {
+		zero = 0;
+		memcpy(bp, &zero, sizeof(u_int32_t));
+		bp += sizeof(u_int32_t);
+	} else {
+		memcpy(bp, &oldname->size, sizeof(oldname->size));
+		bp += sizeof(oldname->size);
+		memcpy(bp, oldname->data, oldname->size);
+		bp += oldname->size;
+	}
+
+	if (newname == NULL) {
+		zero = 0;
+		memcpy(bp, &zero, sizeof(u_int32_t));
+		bp += sizeof(u_int32_t);
+	} else {
+		memcpy(bp, &newname->size, sizeof(newname->size));
+		bp += sizeof(newname->size);
+		memcpy(bp, newname->data, newname->size);
+		bp += newname->size;
+	}
+
+	if (fid == NULL) {
+		zero = 0;
+		memcpy(bp, &zero, sizeof(u_int32_t));
+		bp += sizeof(u_int32_t);
+	} else {
+		memcpy(bp, &fid->size, sizeof(fid->size));
+		bp += sizeof(fid->size);
+		memcpy(bp, fid->data, fid->size);
+		bp += fid->size;
+	}
+
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+
+	if (is_durable || txnp == NULL) {
+		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
+			if (rlsnp != ret_lsnp)
+				 *ret_lsnp = *rlsnp;
+		}
+	} else {
+#ifdef DIAGNOSTIC
+		/*
+		 * Set the debug bit if we are going to log non-durable
+		 * transactions so they will be ignored by recovery.
+		 */
+		memcpy(lr->data, logrec.data, logrec.size);
+		rectype |= DB_debug_FLAG;
+		memcpy(logrec.data, &rectype, sizeof(rectype));
+
+		ret = __log_put(dbenv,
+		    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
+#else
+		ret = 0;
+#endif
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
+		LSN_NOT_LOGGED(*ret_lsnp);
+	}
+
+#ifdef LOG_DIAGNOSTIC
+	if (ret != 0)
+		(void)__crdel_inmem_rename_print(dbenv,
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
+#endif
+
+#ifdef DIAGNOSTIC
+	__os_free(dbenv, logrec.data);
+#else
+	if (is_durable || txnp == NULL)
+		__os_free(dbenv, logrec.data);
+#endif
+	return (ret);
+}
+
+/*
+ * PUBLIC: int __crdel_inmem_rename_read __P((DB_ENV *, void *,
+ * PUBLIC:     __crdel_inmem_rename_args **));
+ */
+int
+__crdel_inmem_rename_read(dbenv, recbuf, argpp)
+	DB_ENV *dbenv;
+	void *recbuf;
+	__crdel_inmem_rename_args **argpp;
+{
+	__crdel_inmem_rename_args *argp;
+	u_int8_t *bp;
+	int ret;
+
+	if ((ret = __os_malloc(dbenv,
+	    sizeof(__crdel_inmem_rename_args) + sizeof(DB_TXN), &argp)) != 0)
+		return (ret);
+	bp = recbuf;
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
+
+	memcpy(&argp->type, bp, sizeof(argp->type));
+	bp += sizeof(argp->type);
+
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
+
+	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	memset(&argp->oldname, 0, sizeof(argp->oldname));
+	memcpy(&argp->oldname.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->oldname.data = bp;
+	bp += argp->oldname.size;
+
+	memset(&argp->newname, 0, sizeof(argp->newname));
+	memcpy(&argp->newname.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->newname.data = bp;
+	bp += argp->newname.size;
+
+	memset(&argp->fid, 0, sizeof(argp->fid));
+	memcpy(&argp->fid.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->fid.data = bp;
+	bp += argp->fid.size;
+
+	*argpp = argp;
+	return (0);
+}
+
+/*
+ * PUBLIC: int __crdel_inmem_remove_log __P((DB_ENV *, DB_TXN *,
+ * PUBLIC:     DB_LSN *, u_int32_t, const DBT *, const DBT *));
+ */
+int
+__crdel_inmem_remove_log(dbenv, txnp, ret_lsnp, flags,
+    name, fid)
+	DB_ENV *dbenv;
+	DB_TXN *txnp;
+	DB_LSN *ret_lsnp;
+	u_int32_t flags;
+	const DBT *name;
+	const DBT *fid;
+{
+	DBT logrec;
+	DB_TXNLOGREC *lr;
+	DB_LSN *lsnp, null_lsn, *rlsnp;
+	u_int32_t zero, rectype, txn_num;
+	u_int npad;
+	u_int8_t *bp;
+	int is_durable, ret;
+
+	COMPQUIET(lr, NULL);
+
+	rectype = DB___crdel_inmem_remove;
+	npad = 0;
+	rlsnp = ret_lsnp;
+
+	ret = 0;
+
+	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
+		if (txnp == NULL)
+			return (0);
+		is_durable = 0;
+	} else
+		is_durable = 1;
+
+	if (txnp == NULL) {
+		txn_num = 0;
+		lsnp = &null_lsn;
+		null_lsn.file = null_lsn.offset = 0;
+	} else {
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
+			return (ret);
+		/*
+		 * We need to assign begin_lsn while holding region mutex.
+		 * That assignment is done inside the DbEnv->log_put call,
+		 * so pass in the appropriate memory location to be filled
+		 * in by the log_put code.
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
+	}
+
+	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
+	    + sizeof(u_int32_t) + (name == NULL ? 0 : name->size)
+	    + sizeof(u_int32_t) + (fid == NULL ? 0 : fid->size);
+	if (CRYPTO_ON(dbenv)) {
+		npad =
+		    ((DB_CIPHER *)dbenv->crypto_handle)->adj_size(logrec.size);
+		logrec.size += npad;
+	}
+
+	if (is_durable || txnp == NULL) {
+		if ((ret =
+		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
+			return (ret);
+	} else {
+		if ((ret = __os_malloc(dbenv,
+		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
+			return (ret);
+#ifdef DIAGNOSTIC
+		if ((ret =
+		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) {
+			__os_free(dbenv, lr);
+			return (ret);
+		}
+#else
+		logrec.data = lr->data;
+#endif
+	}
+	if (npad > 0)
+		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
+
+	bp = logrec.data;
+
+	memcpy(bp, &rectype, sizeof(rectype));
+	bp += sizeof(rectype);
+
+	memcpy(bp, &txn_num, sizeof(txn_num));
+	bp += sizeof(txn_num);
+
+	memcpy(bp, lsnp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	if (name == NULL) {
+		zero = 0;
+		memcpy(bp, &zero, sizeof(u_int32_t));
+		bp += sizeof(u_int32_t);
+	} else {
+		memcpy(bp, &name->size, sizeof(name->size));
+		bp += sizeof(name->size);
+		memcpy(bp, name->data, name->size);
+		bp += name->size;
+	}
+
+	if (fid == NULL) {
+		zero = 0;
+		memcpy(bp, &zero, sizeof(u_int32_t));
+		bp += sizeof(u_int32_t);
+	} else {
+		memcpy(bp, &fid->size, sizeof(fid->size));
+		bp += sizeof(fid->size);
+		memcpy(bp, fid->data, fid->size);
+		bp += fid->size;
+	}
+
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+
+	if (is_durable || txnp == NULL) {
+		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
+			if (rlsnp != ret_lsnp)
+				 *ret_lsnp = *rlsnp;
+		}
+	} else {
+#ifdef DIAGNOSTIC
+		/*
+		 * Set the debug bit if we are going to log non-durable
+		 * transactions so they will be ignored by recovery.
+		 */
+		memcpy(lr->data, logrec.data, logrec.size);
+		rectype |= DB_debug_FLAG;
+		memcpy(logrec.data, &rectype, sizeof(rectype));
+
+		ret = __log_put(dbenv,
+		    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
+#else
+		ret = 0;
+#endif
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
+		LSN_NOT_LOGGED(*ret_lsnp);
+	}
+
+#ifdef LOG_DIAGNOSTIC
+	if (ret != 0)
+		(void)__crdel_inmem_remove_print(dbenv,
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
+#endif
+
+#ifdef DIAGNOSTIC
+	__os_free(dbenv, logrec.data);
+#else
+	if (is_durable || txnp == NULL)
+		__os_free(dbenv, logrec.data);
+#endif
+	return (ret);
+}
+
+/*
+ * PUBLIC: int __crdel_inmem_remove_read __P((DB_ENV *, void *,
+ * PUBLIC:     __crdel_inmem_remove_args **));
+ */
+int
+__crdel_inmem_remove_read(dbenv, recbuf, argpp)
+	DB_ENV *dbenv;
+	void *recbuf;
+	__crdel_inmem_remove_args **argpp;
+{
+	__crdel_inmem_remove_args *argp;
+	u_int8_t *bp;
+	int ret;
+
+	if ((ret = __os_malloc(dbenv,
+	    sizeof(__crdel_inmem_remove_args) + sizeof(DB_TXN), &argp)) != 0)
+		return (ret);
+	bp = recbuf;
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
+
+	memcpy(&argp->type, bp, sizeof(argp->type));
+	bp += sizeof(argp->type);
+
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
+
+	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	memset(&argp->name, 0, sizeof(argp->name));
+	memcpy(&argp->name.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->name.data = bp;
+	bp += argp->name.size;
+
+	memset(&argp->fid, 0, sizeof(argp->fid));
+	memcpy(&argp->fid.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->fid.data = bp;
+	bp += argp->fid.size;
+
+	*argpp = argp;
+	return (0);
+}
+
 /*
  * PUBLIC: int __crdel_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
  * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
@@ -256,5 +933,14 @@ __crdel_init_recover(dbenv, dtabp, dtabsizep)
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __crdel_metasub_recover, DB___crdel_metasub)) != 0)
 		return (ret);
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __crdel_inmem_create_recover, DB___crdel_inmem_create)) != 0)
+		return (ret);
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __crdel_inmem_rename_recover, DB___crdel_inmem_rename)) != 0)
+		return (ret);
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __crdel_inmem_remove_recover, DB___crdel_inmem_remove)) != 0)
+		return (ret);
 	return (0);
 }
diff --git a/db/db/crdel_autop.c b/db/db/crdel_autop.c
index e57a5c714..d8ec66053 100644
--- a/db/db/crdel_autop.c
+++ b/db/db/crdel_autop.c
@@ -2,13 +2,6 @@
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/crypto.h"
 #include "dbinc/db_page.h"
@@ -34,20 +27,18 @@ __crdel_metasub_print(dbenv, dbtp, lsnp, notused2, notused3)
 	int ch;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __crdel_metasub_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__crdel_metasub%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__crdel_metasub%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
 	(void)printf("\tpage: ");
@@ -63,6 +54,152 @@ __crdel_metasub_print(dbenv, dbtp, lsnp, notused2, notused3)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __crdel_inmem_create_print __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, void *));
+ */
+int
+__crdel_inmem_create_print(dbenv, dbtp, lsnp, notused2, notused3)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops notused2;
+	void *notused3;
+{
+	__crdel_inmem_create_args *argp;
+	u_int32_t i;
+	int ch;
+	int ret;
+
+	notused2 = DB_TXN_PRINT;
+	notused3 = NULL;
+
+	if ((ret = __crdel_inmem_create_read(dbenv, dbtp->data, &argp)) != 0)
+		return (ret);
+	(void)printf(
+    "[%lu][%lu]__crdel_inmem_create%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
+	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
+	    (u_long)argp->type,
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
+	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
+	(void)printf("\tname: ");
+	for (i = 0; i < argp->name.size; i++) {
+		ch = ((u_int8_t *)argp->name.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\tfid: ");
+	for (i = 0; i < argp->fid.size; i++) {
+		ch = ((u_int8_t *)argp->fid.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\tpgsize: %lu\n", (u_long)argp->pgsize);
+	(void)printf("\n");
+	__os_free(dbenv, argp);
+	return (0);
+}
+
+/*
+ * PUBLIC: int __crdel_inmem_rename_print __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, void *));
+ */
+int
+__crdel_inmem_rename_print(dbenv, dbtp, lsnp, notused2, notused3)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops notused2;
+	void *notused3;
+{
+	__crdel_inmem_rename_args *argp;
+	u_int32_t i;
+	int ch;
+	int ret;
+
+	notused2 = DB_TXN_PRINT;
+	notused3 = NULL;
+
+	if ((ret = __crdel_inmem_rename_read(dbenv, dbtp->data, &argp)) != 0)
+		return (ret);
+	(void)printf(
+    "[%lu][%lu]__crdel_inmem_rename%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
+	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
+	    (u_long)argp->type,
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
+	(void)printf("\toldname: ");
+	for (i = 0; i < argp->oldname.size; i++) {
+		ch = ((u_int8_t *)argp->oldname.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\tnewname: ");
+	for (i = 0; i < argp->newname.size; i++) {
+		ch = ((u_int8_t *)argp->newname.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\tfid: ");
+	for (i = 0; i < argp->fid.size; i++) {
+		ch = ((u_int8_t *)argp->fid.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\n");
+	__os_free(dbenv, argp);
+	return (0);
+}
+
+/*
+ * PUBLIC: int __crdel_inmem_remove_print __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, void *));
+ */
+int
+__crdel_inmem_remove_print(dbenv, dbtp, lsnp, notused2, notused3)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops notused2;
+	void *notused3;
+{
+	__crdel_inmem_remove_args *argp;
+	u_int32_t i;
+	int ch;
+	int ret;
+
+	notused2 = DB_TXN_PRINT;
+	notused3 = NULL;
+
+	if ((ret = __crdel_inmem_remove_read(dbenv, dbtp->data, &argp)) != 0)
+		return (ret);
+	(void)printf(
+    "[%lu][%lu]__crdel_inmem_remove%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
+	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
+	    (u_long)argp->type,
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
+	(void)printf("\tname: ");
+	for (i = 0; i < argp->name.size; i++) {
+		ch = ((u_int8_t *)argp->name.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\tfid: ");
+	for (i = 0; i < argp->fid.size; i++) {
+		ch = ((u_int8_t *)argp->fid.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\n");
+	__os_free(dbenv, argp);
+	return (0);
+}
+
 /*
  * PUBLIC: int __crdel_init_print __P((DB_ENV *, int (***)(DB_ENV *,
  * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
@@ -78,5 +215,14 @@ __crdel_init_print(dbenv, dtabp, dtabsizep)
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __crdel_metasub_print, DB___crdel_metasub)) != 0)
 		return (ret);
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __crdel_inmem_create_print, DB___crdel_inmem_create)) != 0)
+		return (ret);
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __crdel_inmem_rename_print, DB___crdel_inmem_rename)) != 0)
+		return (ret);
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __crdel_inmem_remove_print, DB___crdel_inmem_remove)) != 0)
+		return (ret);
 	return (0);
 }
diff --git a/db/db/crdel_rec.c b/db/db/crdel_rec.c
index 7ff4fbd06..43f9c4f2c 100644
--- a/db/db/crdel_rec.c
+++ b/db/db/crdel_rec.c
@@ -1,26 +1,21 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: crdel_rec.c,v 11.68 2004/04/29 00:07:55 ubell Exp $
+ * $Id: crdel_rec.c,v 12.13 2006/08/24 14:45:15 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
+#include "dbinc/fop.h"
 #include "dbinc/hash.h"
 #include "dbinc/log.h"
 #include "dbinc/mp.h"
+#include "dbinc/txn.h"
 
 /*
  * __crdel_metasub_recover --
@@ -42,27 +37,45 @@ __crdel_metasub_recover(dbenv, dbtp, lsnp, op, info)
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	int cmp_p, modified, ret;
+	int cmp_p, ret, t_ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
 	REC_PRINT(__crdel_metasub_print);
-	REC_INTRO(__crdel_metasub_read, 0);
+	REC_INTRO(__crdel_metasub_read, 0, 0);
 
-	if ((ret = __memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) {
-		*lsnp = argp->prev_lsn;
-		ret = 0;
-		goto out;
+	if ((ret = __memp_fget(mpf, &argp->pgno, NULL,
+	    0, &pagep)) != 0) {
+		/* If this is an in-memory file, this might be OK. */
+		if (F_ISSET(file_dbp, DB_AM_INMEM) &&
+		    (ret = __memp_fget(mpf, &argp->pgno, NULL,
+		    DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &pagep)) == 0) {
+			LSN_NOT_LOGGED(LSN(pagep));
+		} else {
+			*lsnp = argp->prev_lsn;
+			ret = 0;
+			goto out;
+		}
 	}
 
-	modified = 0;
-	cmp_p = log_compare(&LSN(pagep), &argp->lsn);
-	CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->lsn);
+	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn);
 
 	if (cmp_p == 0 && DB_REDO(op)) {
+		REC_DIRTY(mpf, &pagep);
 		memcpy(pagep, argp->page.data, argp->page.size);
 		LSN(pagep) = *lsnp;
-		modified = 1;
+
+		/*
+		 * If this was an in-memory database and we are re-creating
+		 * and this is the meta-data page, then we need to set up a
+		 * bunch of fields in the dbo as well.
+		 */
+		if (F_ISSET(file_dbp, DB_AM_INMEM) &&
+		    argp->pgno == PGNO_BASE_MD &&
+		    (ret = __db_meta_setup(file_dbp->dbenv,
+		    file_dbp, file_dbp->dname, (DBMETA *)pagep, 0, 1)) != 0)
+			goto out;
 	} else if (DB_UNDO(op)) {
 		/*
 		 * We want to undo this page creation.  The page creation
@@ -70,22 +83,205 @@ __crdel_metasub_recover(dbenv, dbtp, lsnp, op, info)
 		 * was logged separately. Then we wrote the meta-data onto
 		 * the page.  So long as we restore the LSN, then the recovery
 		 * for __bam_new will do everything else.
-		 * Don't bother checking the lsn on the page.  If we
-		 * are rolling back the next thing is that this page
-		 * will get freed.  Opening the subdb will have reinitialized
-		 * the page, but not the lsn.
+		 *
+		 * Don't bother checking the lsn on the page.  If we are
+		 * rolling back the next thing is that this page will get
+		 * freed.  Opening the subdb will have reinitialized the
+		 * page, but not the lsn.
 		 */
+		REC_DIRTY(mpf, &pagep);
 		LSN(pagep) = argp->lsn;
-		modified = 1;
 	}
-	if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0)
-		goto out;
-	pagep = NULL;
 
 done:	*lsnp = argp->prev_lsn;
 	ret = 0;
 
-out:	if (pagep != NULL)
-		(void)__memp_fput(mpf, pagep, 0);
+out:	if (pagep != NULL && (t_ret = __memp_fput(mpf, pagep, 0)) != 0 &&
+	    ret == 0)
+		ret = t_ret;
+
 	REC_CLOSE;
 }
+
+/*
+ * __crdel_inmem_create_recover --
+ *	Recovery function for inmem_create.
+ *
+ * PUBLIC: int __crdel_inmem_create_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__crdel_inmem_create_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	DB *dbp;
+	__crdel_inmem_create_args *argp;
+	int do_close, ret, t_ret;
+
+	COMPQUIET(info, NULL);
+	dbp = NULL;
+	do_close = 0;
+	REC_PRINT(__crdel_inmem_create_print);
+	REC_NOOP_INTRO(__crdel_inmem_create_read);
+
+	/* First, see if the DB handle already exists. */
+	if (argp->fileid == DB_LOGFILEID_INVALID) {
+		if (DB_REDO(op))
+			ret = ENOENT;
+		else
+			ret = 0;
+	} else
+		ret = __dbreg_id_to_db_int(dbenv,
+		    argp->txnp, &dbp, argp->fileid, 0, 0);
+
+	if (DB_REDO(op)) {
+		/*
+		 * If the dbreg failed, that means that we're creating a
+		 * tmp file.
+		 */
+		if (ret != 0) {
+			if ((ret = db_create(&dbp, dbenv, 0)) != 0)
+				goto out;
+
+			F_SET(dbp, DB_AM_RECOVER | DB_AM_INMEM);
+			memcpy(dbp->fileid, argp->fid.data, DB_FILE_ID_LEN);
+			if (((ret = __os_strdup(dbenv,
+			    argp->name.data, &dbp->dname)) != 0))
+				goto out;
+
+			/*
+			 * This DBP is never going to be entered into the
+			 * dbentry table, so if we leave it open here,
+			 * then we're going to lose it.
+			 */
+			do_close = 1;
+		}
+
+		/* Now, set the fileid. */
+		memcpy(dbp->fileid, argp->fid.data, argp->fid.size);
+		if ((ret = __memp_set_fileid(dbp->mpf, dbp->fileid)) != 0)
+			goto out;
+		dbp->preserve_fid = 1;
+		MAKE_INMEM(dbp);
+		if ((ret = __db_dbenv_setup(dbp,
+		    NULL, NULL, argp->name.data, TXN_INVALID, 0)) != 0)
+			goto out;
+		ret = __db_dbenv_mpool(dbp, argp->name.data, 0);
+
+		if (ret == ENOENT) {
+			dbp->pgsize = argp->pgsize;
+			if ((ret = __db_dbenv_mpool(dbp,
+			    argp->name.data, DB_CREATE)) != 0)
+				goto out;
+		} else if (ret != 0)
+			goto out;
+	}
+
+	if (DB_UNDO(op)) {
+		if (ret == 0)
+			ret = __memp_nameop(dbenv, argp->fid.data, NULL,
+			    (const char *)argp->name.data,  NULL, 1);
+
+		if (ret == ENOENT || ret == DB_DELETED)
+			ret = 0;
+		else
+			goto out;
+	}
+
+	*lsnp = argp->prev_lsn;
+
+out:	if (dbp != NULL) {
+		t_ret = 0;
+		if (DB_UNDO(op))
+			t_ret = __db_refresh(dbp, NULL, DB_NOSYNC, NULL, 0);
+		else if (do_close || ret != 0)
+			t_ret = __db_close(dbp, NULL, DB_NOSYNC);
+		if (t_ret != 0 && ret == 0)
+			ret = t_ret;
+	}
+	REC_NOOP_CLOSE;
+}
+
+/*
+ * __crdel_inmem_rename_recover --
+ *	Recovery function for inmem_rename.
+ *
+ * PUBLIC: int __crdel_inmem_rename_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__crdel_inmem_rename_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__crdel_inmem_rename_args *argp;
+	u_int8_t *fileid;
+	int ret;
+
+	COMPQUIET(info, NULL);
+	REC_PRINT(__crdel_inmem_rename_print);
+	REC_NOOP_INTRO(__crdel_inmem_rename_read);
+	fileid = argp->fid.data;
+
+	/* Void out errors because the files may or may not still exist. */
+	if (DB_REDO(op))
+		(void)__memp_nameop(dbenv, fileid,
+		    (const char *)argp->newname.data,
+		    (const char *)argp->oldname.data,
+		    (const char *)argp->newname.data, 1);
+
+	if (DB_UNDO(op))
+		(void)__memp_nameop(dbenv, fileid,
+		    (const char *)argp->oldname.data,
+		    (const char *)argp->newname.data,
+		    (const char *)argp->oldname.data, 1);
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+	REC_NOOP_CLOSE;
+}
+
+/*
+ * __crdel_inmem_remove_recover --
+ *	Recovery function for inmem_remove.
+ *
+ * PUBLIC: int __crdel_inmem_remove_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__crdel_inmem_remove_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__crdel_inmem_remove_args *argp;
+	int ret;
+
+	COMPQUIET(info, NULL);
+	REC_PRINT(__crdel_inmem_remove_print);
+	REC_NOOP_INTRO(__crdel_inmem_remove_read);
+
+	/*
+	 * Since removes are delayed; there is no undo for a remove; only redo.
+	 * The remove may fail, which is OK.
+	 */
+	if (DB_REDO(op)) {
+		(void)__memp_nameop(dbenv,
+		    argp->fid.data, NULL, argp->name.data, NULL, 1);
+	}
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+	REC_NOOP_CLOSE;
+}
diff --git a/db/db/db.c b/db/db/db.c
index 28aecc09c..e7975687a 100644
--- a/db/db/db.c
+++ b/db/db/db.c
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994, 1995, 1996
@@ -36,22 +36,16 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db.c,v 11.300 2004/10/26 17:38:41 bostic Exp $
+ * $Id: db.c,v 12.42 2006/09/19 15:06:58 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/db_swap.h"
 #include "dbinc/btree.h"
+#include "dbinc/fop.h"
 #include "dbinc/hash.h"
 #include "dbinc/lock.h"
 #include "dbinc/log.h"
@@ -121,27 +115,27 @@ __db_master_open(subdbp, txn, name, flags, mode, dbpp)
 		goto err;
 
 	/*
-	 * Verify that pagesize is the same on both.  The items in dbp were now
-	 * initialized from the meta page.  The items in dbp were set in
-	 * __db_dbopen when we either read or created the master file.  Other
-	 * items such as checksum and encryption are checked when we read the
-	 * meta-page.  So we do not check those here.  However, if the
-	 * meta-page caused checksumming to be turned on and it wasn't already,
-	 * set it here.
+	 * The items in dbp are initialized from the master file's meta page.
+	 * Other items such as checksum and encryption are checked when we
+	 * read the meta-page, so we do not check those here.  However, if
+	 * the meta-page caused checksumming to be turned on and it wasn't
+	 * already, set it here.
 	 */
 	if (F_ISSET(dbp, DB_AM_CHKSUM))
 		F_SET(subdbp, DB_AM_CHKSUM);
-	if (subdbp->pgsize != 0 && dbp->pgsize != subdbp->pgsize) {
-		ret = EINVAL;
-		__db_err(dbp->dbenv,
-		    "Different pagesize specified on existent file");
-		goto err;
+
+	/*
+	 * The user may have specified a page size for an existing file,
+	 * which we want to ignore.
+	 */
+	subdbp->pgsize = dbp->pgsize;
+	*dbpp = dbp;
+
+	if (0) {
+err:		if (!F_ISSET(dbp, DB_AM_DISCARD))
+			(void)__db_close(dbp, txn, 0);
 	}
-err:
-	if (ret != 0 && !F_ISSET(dbp, DB_AM_DISCARD))
-		(void)__db_close(dbp, txn, 0);
-	else
-		*dbpp = dbp;
+
 	return (ret);
 }
 
@@ -173,19 +167,17 @@ __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
 	dbc = ndbc = NULL;
 	p = NULL;
 
-	memset(&key, 0, sizeof(key));
-	memset(&data, 0, sizeof(data));
-
-	/* Might we modify the master database?  If so, we'll need to lock. */
-	modify = (action != MU_OPEN || LF_ISSET(DB_CREATE)) ? 1 : 0;
-
 	/*
 	 * Open up a cursor.  If this is CDB and we're creating the database,
 	 * make it an update cursor.
+	 *
+	 * Might we modify the master database?  If so, we'll need to lock.
 	 */
+	modify = (action != MU_OPEN || LF_ISSET(DB_CREATE)) ? 1 : 0;
+
 	if ((ret = __db_cursor(mdbp, txn, &dbc,
 	    (CDB_LOCKING(dbenv) && modify) ? DB_WRITECURSOR : 0)) != 0)
-		goto err;
+		return (ret);
 
 	/*
 	 * Point the cursor at the record.
@@ -200,8 +192,8 @@ __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
 	 * !!!
 	 * We don't include the name's nul termination in the database.
 	 */
-	key.data = (void *)subdb;
-	key.size = (u_int32_t)strlen(subdb);
+	DB_INIT_DBT(key, subdb, strlen(subdb));
+	memset(&data, 0, sizeof(data));
 	F_SET(&data, DB_DBT_MALLOC);
 
 	ret = __db_c_get(dbc, &key, &data,
@@ -237,14 +229,16 @@ __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
 		 */
 		memcpy(&sdbp->meta_pgno, data.data, sizeof(db_pgno_t));
 		DB_NTOHL(&sdbp->meta_pgno);
-		if ((ret =
-		    __memp_fget(mdbp->mpf, &sdbp->meta_pgno, 0, &p)) != 0)
+		if ((ret = __memp_fget(mdbp->mpf, &sdbp->meta_pgno,
+		    dbc->txn, DB_MPOOL_DIRTY, &p)) != 0)
 			goto err;
 
-		/* Free the root on the master db. */
-		if (TYPE(p) == P_BTREEMETA) {
+		/* Free the root on the master db if it was created. */
+		if (TYPE(p) == P_BTREEMETA &&
+		    ((BTMETA *)p)->root != PGNO_INVALID) {
 			if ((ret = __memp_fget(mdbp->mpf,
-			     &((BTMETA *)p)->root, 0, &r)) != 0)
+			    &((BTMETA *)p)->root, dbc->txn,
+			    DB_MPOOL_DIRTY, &r)) != 0)
 				goto err;
 
 			/* Free and put the page. */
@@ -272,10 +266,10 @@ __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
 		 * for the existence of newname;  it shouldn't appear under
 		 * us since we hold the metadata lock.
 		 */
-		if ((ret = __db_cursor(mdbp, txn, &ndbc, 0)) != 0)
+		if ((ret = __db_cursor(mdbp, txn, &ndbc,
+		    CDB_LOCKING(dbenv) ? DB_WRITECURSOR : 0)) != 0)
 			goto err;
-		key.data = (void *)newname;
-		key.size = (u_int32_t)strlen(newname);
+		DB_SET_DBT(key, newname, strlen(newname));
 
 		/*
 		 * We don't actually care what the meta page of the potentially-
@@ -287,7 +281,7 @@ __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
 		if ((ret = __db_c_get(ndbc, &key, &ndata, DB_SET)) == 0) {
 			/* A subdb called newname exists.  Bail. */
 			ret = EEXIST;
-			__db_err(dbenv, "rename: database %s exists", newname);
+			__db_errx(dbenv, "rename: database %s exists", newname);
 			goto err;
 		} else if (ret != DB_NOTFOUND)
 			goto err;
@@ -364,14 +358,9 @@ done:	/*
 	 * If we allocated a page: if we're successful, mark the page dirty
 	 * and return it to the cache, otherwise, discard/free it.
 	 */
-	if (p != NULL) {
-		if (ret == 0) {
-			if ((t_ret =
-			    __memp_fput(mdbp->mpf, p, DB_MPOOL_DIRTY)) != 0)
-				ret = t_ret;
-		} else
-			(void)__memp_fput(mdbp->mpf, p, 0);
-	}
+	if (p != NULL &&
+	    (t_ret = __memp_fput(mdbp->mpf, p, 0)) != 0 && ret == 0)
+		ret = t_ret;
 
 	/* Discard the cursor(s) and data. */
 	if (data.data != NULL)
@@ -389,18 +378,17 @@ done:	/*
  *	Set up the underlying environment during a db_open.
  *
  * PUBLIC: int __db_dbenv_setup __P((DB *,
- * PUBLIC:     DB_TXN *, const char *, u_int32_t, u_int32_t));
+ * PUBLIC:     DB_TXN *, const char *, const char *, u_int32_t, u_int32_t));
  */
 int
-__db_dbenv_setup(dbp, txn, fname, id, flags)
+__db_dbenv_setup(dbp, txn, fname, dname, id, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *fname;
+	const char *fname, *dname;
 	u_int32_t id, flags;
 {
 	DB *ldbp;
 	DB_ENV *dbenv;
-	DB_MPOOL *dbmp;
 	u_int32_t maxid;
 	int ret;
 
@@ -415,25 +403,20 @@ __db_dbenv_setup(dbp, txn, fname, id, flags)
 		    dbenv, 0, dbp->pgsize * DB_MINPAGECACHE, 0)) != 0)
 			return (ret);
 
-		if ((ret = __dbenv_open(dbenv, NULL, DB_CREATE |
+		if ((ret = __env_open(dbenv, NULL, DB_CREATE |
 		    DB_INIT_MPOOL | DB_PRIVATE | LF_ISSET(DB_THREAD), 0)) != 0)
 			return (ret);
 	}
 
 	/* Join the underlying cache. */
-	if ((ret = __db_dbenv_mpool(dbp, fname, flags)) != 0)
+	if ((!F_ISSET(dbp, DB_AM_INMEM) || dname == NULL) &&
+	    (ret = __db_dbenv_mpool(dbp, fname, flags)) != 0)
 		return (ret);
 
-	/*
-	 * We may need a per-thread mutex.  Allocate it from the mpool
-	 * region, there's supposed to be extra space there for that purpose.
-	 */
-	if (LF_ISSET(DB_THREAD)) {
-		dbmp = dbenv->mp_handle;
-		if ((ret = __db_mutex_setup(dbenv, dbmp->reginfo, &dbp->mutexp,
-		    MUTEX_ALLOC | MUTEX_THREAD)) != 0)
-			return (ret);
-	}
+	/* We may need a per-thread mutex. */
+	if (LF_ISSET(DB_THREAD) && (ret = __mutex_alloc(
+	    dbenv, MTX_DB_HANDLE, DB_MUTEX_PROCESS_ONLY, &dbp->mutex)) != 0)
+		return (ret);
 
 	/*
 	 * Set up a bookkeeping entry for this database in the log region,
@@ -441,13 +424,14 @@ __db_dbenv_setup(dbp, txn, fname, id, flags)
 	 * or a replication client, where we won't log registries, we'll
 	 * still need an FNAME struct, so LOGGING_ON is the correct macro.
 	 */
-	if (LOGGING_ON(dbenv) &&
-	    (ret = __dbreg_setup(dbp, fname, id)) != 0)
+	if (LOGGING_ON(dbenv) && dbp->log_filename == NULL &&
+	    (ret = __dbreg_setup(dbp,
+	    F_ISSET(dbp, DB_AM_INMEM) ? dname : fname, id)) != 0)
 		return (ret);
 
 	/*
 	 * If we're actively logging and our caller isn't a recovery function
-	 * that already did so, assign this dbp a log fileid.
+	 * that already did so, then assign this dbp a log fileid.
 	 */
 	if (DBENV_LOGGING(dbenv) && !F_ISSET(dbp, DB_AM_RECOVER) &&
 #if !defined(DEBUG_ROP)
@@ -465,20 +449,30 @@ __db_dbenv_setup(dbp, txn, fname, id, flags)
 	 * routines, where we don't want to do a lot of ugly and
 	 * expensive memcmps.
 	 */
-	MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp);
-	for (maxid = 0, ldbp = LIST_FIRST(&dbenv->dblist);
-	    ldbp != NULL; ldbp = LIST_NEXT(ldbp, dblistlinks)) {
-		if (fname != NULL &&
-		    memcmp(ldbp->fileid, dbp->fileid, DB_FILE_ID_LEN) == 0 &&
-		    ldbp->meta_pgno == dbp->meta_pgno)
-			break;
+	MUTEX_LOCK(dbenv, dbenv->mtx_dblist);
+	maxid = 0;
+	TAILQ_FOREACH(ldbp, &dbenv->dblist, dblistlinks) {
+		/*
+		 * There are three cases: on-disk database (first clause),
+		 * named in-memory database (second clause), temporary database
+		 * (never matches; no clause).
+		 */
+		if (!F_ISSET(dbp, DB_AM_INMEM)) {
+			if (memcmp(ldbp->fileid, dbp->fileid, DB_FILE_ID_LEN)
+			    == 0 && ldbp->meta_pgno == dbp->meta_pgno)
+				break;
+		} else if (dname != NULL) {
+			if (F_ISSET(ldbp, DB_AM_INMEM) &&
+			    ldbp->dname != NULL &&
+			    strcmp(ldbp->dname, dname) == 0)
+				break;
+		}
 		if (ldbp->adj_fileid > maxid)
 			maxid = ldbp->adj_fileid;
 	}
 
 	/*
-	 * If ldbp is NULL, we didn't find a match, or we weren't
-	 * really looking because fname is NULL.  Assign the dbp an
+	 * If ldbp is NULL, we didn't find a match. Assign the dbp an
 	 * adj_fileid one higher than the largest we found, and
 	 * insert it at the head of the master dbp list.
 	 *
@@ -488,12 +482,12 @@ __db_dbenv_setup(dbp, txn, fname, id, flags)
 	 */
 	if (ldbp == NULL) {
 		dbp->adj_fileid = maxid + 1;
-		LIST_INSERT_HEAD(&dbenv->dblist, dbp, dblistlinks);
+		TAILQ_INSERT_HEAD(&dbenv->dblist, dbp, dblistlinks);
 	} else {
 		dbp->adj_fileid = ldbp->adj_fileid;
-		LIST_INSERT_AFTER(ldbp, dbp, dblistlinks);
+		TAILQ_INSERT_AFTER(&dbenv->dblist, ldbp, dbp, dblistlinks);
 	}
-	MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp);
+	MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist);
 
 	return (0);
 }
@@ -514,12 +508,17 @@ __db_dbenv_mpool(dbp, fname, flags)
 	DBT pgcookie;
 	DB_MPOOLFILE *mpf;
 	DB_PGINFO pginfo;
+	int fidset, ftype, ret;
+	int32_t lsn_off;
+	u_int8_t nullfid[DB_FILE_ID_LEN];
 	u_int32_t clear_len;
-	int ftype, ret;
-
-	COMPQUIET(mpf, NULL);
 
 	dbenv = dbp->dbenv;
+	lsn_off = 0;
+
+	/* It's possible that this database is already open. */
+	if (F_ISSET(dbp, DB_AM_OPEN_CALLED))
+		return (0);
 
 	/*
 	 * If we need to pre- or post-process a file's pages on I/O, set the
@@ -534,17 +533,28 @@ __db_dbenv_mpool(dbp, fname, flags)
 	case DB_RECNO:
 		ftype = F_ISSET(dbp, DB_AM_SWAP | DB_AM_ENCRYPT | DB_AM_CHKSUM)
 		    ? DB_FTYPE_SET : DB_FTYPE_NOTSET;
-		clear_len = CRYPTO_ON(dbenv) ? dbp->pgsize : DB_PAGE_DB_LEN;
+		clear_len = CRYPTO_ON(dbenv) ?
+		    (dbp->pgsize != 0 ? dbp->pgsize : DB_CLEARLEN_NOTSET) :
+		    DB_PAGE_DB_LEN;
 		break;
 	case DB_HASH:
 		ftype = DB_FTYPE_SET;
-		clear_len = CRYPTO_ON(dbenv) ? dbp->pgsize : DB_PAGE_DB_LEN;
+		clear_len = CRYPTO_ON(dbenv) ?
+		    (dbp->pgsize != 0 ? dbp->pgsize : DB_CLEARLEN_NOTSET) :
+		    DB_PAGE_DB_LEN;
 		break;
 	case DB_QUEUE:
 		ftype = F_ISSET(dbp,
 		    DB_AM_SWAP | DB_AM_ENCRYPT | DB_AM_CHKSUM) ?
 		    DB_FTYPE_SET : DB_FTYPE_NOTSET;
-		clear_len = CRYPTO_ON(dbenv) ? dbp->pgsize : DB_PAGE_QUEUE_LEN;
+
+		/*
+		 * If we came in here without a pagesize set, then we need
+		 * to mark the in-memory handle as having clear_len not
+		 * set, because we don't really know the clear length or
+		 * the page size yet (since the file doesn't yet exist).
+		 */
+		clear_len = dbp->pgsize != 0 ? dbp->pgsize : DB_CLEARLEN_NOTSET;
 		break;
 	case DB_UNKNOWN:
 		/*
@@ -564,6 +574,18 @@ __db_dbenv_mpool(dbp, fname, flags)
 			clear_len = DB_PAGE_DB_LEN;
 			break;
 		}
+
+		/*
+		 * This might be an in-memory file and we won't know its
+		 * file type until after we open it and read the meta-data
+		 * page.
+		 */
+		if (F_ISSET(dbp, DB_AM_INMEM)) {
+			clear_len = DB_CLEARLEN_NOTSET;
+			ftype = DB_FTYPE_NOTSET;
+			lsn_off = DB_LSN_OFF_NOTSET;
+			break;
+		}
 		/* FALLTHROUGH */
 	default:
 		return (__db_unknown_type(dbenv, "DB->open", dbp->type));
@@ -571,10 +593,14 @@ __db_dbenv_mpool(dbp, fname, flags)
 
 	mpf = dbp->mpf;
 
+	memset(nullfid, 0, DB_FILE_ID_LEN);
+	fidset = memcmp(nullfid, dbp->fileid, DB_FILE_ID_LEN);
+	if (fidset)
+		(void)__memp_set_fileid(mpf, dbp->fileid);
+
 	(void)__memp_set_clear_len(mpf, clear_len);
-	(void)__memp_set_fileid(mpf, dbp->fileid);
 	(void)__memp_set_ftype(mpf, ftype);
-	(void)__memp_set_lsn_offset(mpf, 0);
+	(void)__memp_set_lsn_offset(mpf, lsn_off);
 
 	pginfo.db_pagesize = dbp->pgsize;
 	pginfo.flags =
@@ -584,13 +610,42 @@ __db_dbenv_mpool(dbp, fname, flags)
 	pgcookie.size = sizeof(DB_PGINFO);
 	(void)__memp_set_pgcookie(mpf, &pgcookie);
 
+#ifndef DIAG_MVCC
+	if (F_ISSET(dbenv, DB_ENV_MULTIVERSION))
+#endif
+		if (F_ISSET(dbp, DB_AM_TXN) &&
+		    dbp->type != DB_QUEUE && dbp->type != DB_UNKNOWN)
+			LF_SET(DB_MULTIVERSION);
+
 	if ((ret = __memp_fopen(mpf, NULL, fname,
-	    LF_ISSET(DB_RDONLY | DB_NOMMAP |
-	    DB_ODDFILESIZE | DB_TRUNCATE) |
+	    LF_ISSET(DB_CREATE | DB_DURABLE_UNKNOWN | DB_MULTIVERSION |
+		DB_NOMMAP | DB_ODDFILESIZE | DB_RDONLY | DB_TRUNCATE) |
 	    (F_ISSET(dbenv, DB_ENV_DIRECT_DB) ? DB_DIRECT : 0) |
 	    (F_ISSET(dbp, DB_AM_NOT_DURABLE) ? DB_TXN_NOT_DURABLE : 0),
-	    0, dbp->pgsize)) != 0)
+	    0, dbp->pgsize)) != 0) {
+		/*
+		 * The open didn't work; we need to reset the mpf,
+		 * retaining the in-memory semantics (if any).
+		 */
+		(void)__memp_fclose(dbp->mpf, 0);
+		(void)__memp_fcreate(dbenv, &dbp->mpf);
+		if (F_ISSET(dbp, DB_AM_INMEM))
+			MAKE_INMEM(dbp);
 		return (ret);
+	}
+
+	/*
+	 * Set the open flag.  We use it to mean that the dbp has gone
+	 * through mpf setup, including dbreg_register.  Also, below,
+	 * the underlying access method open functions may want to do
+	 * things like acquire cursors, so the open flag has to be set
+	 * before calling them.
+	 */
+	F_SET(dbp, DB_AM_OPEN_CALLED);
+	if (!fidset && fname != NULL) {
+		(void)__memp_get_fileid(dbp->mpf, dbp->fileid);
+		dbp->preserve_fid = 1;
+	}
 
 	return (0);
 }
@@ -624,7 +679,7 @@ __db_close(dbp, txn, flags)
 		(void)__db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0);
 
 	/* Refresh the structure and close any underlying resources. */
-	ret = __db_refresh(dbp, txn, flags, &deferred_close);
+	ret = __db_refresh(dbp, txn, flags, &deferred_close, 0);
 
 	/*
 	 * If we've deferred the close because the logging of the close failed,
@@ -644,11 +699,11 @@ __db_close(dbp, txn, flags)
 	 * dbenv, someone's already badly screwed up, so there's no reason
 	 * to bother engineering around this possibility.
 	 */
-	MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp);
+	MUTEX_LOCK(dbenv, dbenv->mtx_dblist);
 	db_ref = --dbenv->db_ref;
-	MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp);
+	MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist);
 	if (F_ISSET(dbenv, DB_ENV_DBLOCAL) && db_ref == 0 &&
-	    (t_ret = __dbenv_close(dbenv, 0)) != 0 && ret == 0)
+	    (t_ret = __env_close(dbenv, 0)) != 0 && ret == 0)
 		ret = t_ret;
 
 	/* Free the database handle. */
@@ -666,25 +721,32 @@ __db_close(dbp, txn, flags)
  * the actual handle) and during abort processing, we may have a
  * fully opened handle.
  *
- * PUBLIC: int __db_refresh __P((DB *, DB_TXN *, u_int32_t, int *));
+ * PUBLIC: int __db_refresh __P((DB *, DB_TXN *, u_int32_t, int *, int));
  */
 int
-__db_refresh(dbp, txn, flags, deferred_closep)
+__db_refresh(dbp, txn, flags, deferred_closep, reuse)
 	DB *dbp;
 	DB_TXN *txn;
 	u_int32_t flags;
-	int *deferred_closep;
+	int *deferred_closep, reuse;
 {
 	DB *sdbp;
 	DBC *dbc;
 	DB_ENV *dbenv;
 	DB_LOCKREQ lreq;
-	DB_MPOOL *dbmp;
+	REGENV *renv;
+	REGINFO *infop;
+	u_int32_t save_flags;
 	int resync, ret, t_ret;
 
 	ret = 0;
 
 	dbenv = dbp->dbenv;
+	infop = dbenv->reginfo;
+	if (infop != NULL)
+		renv = infop->primary;
+	else
+		renv = NULL;
 
 	/* If never opened, or not currently open, it's easy. */
 	if (!F_ISSET(dbp, DB_AM_OPEN_CALLED))
@@ -699,8 +761,7 @@ __db_refresh(dbp, txn, flags, deferred_closep)
 	 * is mostly done just so we can close primaries and secondaries in
 	 * any order--but within one thread of control.
 	 */
-	for (sdbp = LIST_FIRST(&dbp->s_secondaries);
-	    sdbp != NULL; sdbp = LIST_NEXT(sdbp, s_links)) {
+	LIST_FOREACH(sdbp, &dbp->s_secondaries, s_links) {
 		LIST_REMOVE(sdbp, s_links);
 		if ((t_ret = __db_disassociate(sdbp)) != 0 && ret == 0)
 			ret = t_ret;
@@ -768,6 +829,7 @@ __db_refresh(dbp, txn, flags, deferred_closep)
 	    (t_ret = __memp_fsync(dbp->mpf)) != 0 && ret == 0)
 		ret = t_ret;
 
+never_opened:
 	/*
 	 * At this point, we haven't done anything to render the DB
 	 * handle unusable, at least by a transaction abort.  Take the
@@ -779,12 +841,15 @@ __db_refresh(dbp, txn, flags, deferred_closep)
 	 * In this case, we put off actually closing the dbp until we've
 	 * performed the abort.
 	 */
-	if (LOGGING_ON(dbp->dbenv)) {
+	if (!reuse && LOGGING_ON(dbp->dbenv)) {
 		/*
 		 * Discard the log file id, if any.  We want to log the close
-		 * if and only if this is not a recovery dbp.
+		 * if and only if this is not a recovery dbp or a client dbp,
+		 * or a dead dbp handle.
 		 */
-		if (F_ISSET(dbp, DB_AM_RECOVER))
+		DB_ASSERT(dbenv, renv != NULL);
+		if (F_ISSET(dbp, DB_AM_RECOVER) || IS_REP_CLIENT(dbenv) ||
+		    dbp->timestamp != renv->rep_timestamp)
 			t_ret = __dbreg_revoke_id(dbp, 0, DB_LOGFILEID_INVALID);
 		else {
 			if ((t_ret = __dbreg_close_id(dbp,
@@ -808,6 +873,17 @@ __db_refresh(dbp, txn, flags, deferred_closep)
 					*deferred_closep = 1;
 				return (t_ret);
 			}
+			/*
+			 * If dbreg_close_id failed and we were not in a
+			 * transaction, then we need to finish this close
+			 * because the caller can't do anything with the
+			 * handle after we return an error.  We rely on
+			 * dbreg_close_id to mark the entry in some manner
+			 * so that we do not do a clean shutdown of this
+			 * environment.  If shutdown isn't clean, then the
+			 * application *must* run recovery and that will
+			 * generate the RCLOSE record.
+			 */
 		}
 
 		if (ret == 0)
@@ -824,18 +900,24 @@ __db_refresh(dbp, txn, flags, deferred_closep)
 	    ret == 0)
 		ret = t_ret;
 
-never_opened:
 	/*
 	 * Remove this DB handle from the DB_ENV's dblist, if it's been added.
 	 *
 	 * Close our reference to the underlying cache while locked, we don't
 	 * want to race with a thread searching for our underlying cache link
 	 * while opening a DB handle.
+	 *
+	 * The DB handle may not yet have been added to the DB_ENV list, don't
+	 * blindly call the underlying TAILQ_REMOVE macro.  Explicitly reset
+	 * the field values to NULL so that we can't call TAILQ_REMOVE twice.
 	 */
-	MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp);
-	if (dbp->dblistlinks.le_prev != NULL) {
-		LIST_REMOVE(dbp, dblistlinks);
-		dbp->dblistlinks.le_prev = NULL;
+	MUTEX_LOCK(dbenv, dbenv->mtx_dblist);
+	if (!reuse &&
+	    (dbp->dblistlinks.tqe_next != NULL ||
+	    dbp->dblistlinks.tqe_prev != NULL)) {
+		TAILQ_REMOVE(&dbenv->dblist, dbp, dblistlinks);
+		dbp->dblistlinks.tqe_next = NULL;
+		dbp->dblistlinks.tqe_prev = NULL;
 	}
 
 	/* Close the memory pool file handle. */
@@ -845,9 +927,13 @@ never_opened:
 		    ret == 0)
 			ret = t_ret;
 		dbp->mpf = NULL;
+		if (reuse &&
+		    (t_ret = __memp_fcreate(dbenv, &dbp->mpf)) != 0 &&
+		    ret == 0)
+			ret = t_ret;
 	}
 
-	MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp);
+	MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist);
 
 	/*
 	 * Call the access specific close function.
@@ -883,9 +969,9 @@ never_opened:
 	 * access-method specific data.
 	 */
 
-	if (dbp->lid != DB_LOCK_INVALIDID) {
+	if (!reuse && dbp->lid != DB_LOCK_INVALIDID) {
 		/* We may have pending trade operations on this dbp. */
-		if (txn != NULL)
+		if (IS_REAL_TXN(txn))
 			__txn_remlock(dbenv, txn, &dbp->handle_lock, dbp->lid);
 
 		/* We may be holding the handle lock; release it. */
@@ -901,20 +987,57 @@ never_opened:
 		LOCK_INIT(dbp->handle_lock);
 	}
 
-	/* Discard the locker ID allocated as the fileid. */
-	if (F_ISSET(dbp, DB_AM_INMEM) && LOCKING_ON(dbenv) &&
+	/*
+	 * If this is a temporary file (un-named in-memory file), then
+	 * discard the locker ID allocated as the fileid.
+	 */
+	if (LOCKING_ON(dbenv) &&
+	    F_ISSET(dbp, DB_AM_INMEM) && !dbp->preserve_fid &&
+	    *(u_int32_t *)dbp->fileid != DB_LOCK_INVALIDID &&
 	    (t_ret = __lock_id_free(dbenv, *(u_int32_t *)dbp->fileid)) != 0 &&
 	    ret == 0)
 		ret = t_ret;
 
+	if (reuse) {
+		/*
+		 * If we are reusing this dbp, then we're done now. Re-init
+		 * the handle, preserving important flags, and then return.
+		 * This code is borrowed from __db_init, which does more
+		 * than we can do here.
+		 */
+		save_flags = F_ISSET(dbp, DB_AM_INMEM | DB_AM_TXN);
+
+		/*
+		 * XXX If this is an XA handle, we'll want to specify
+		 * DB_XA_CREATE.
+		 */
+		if ((ret = __bam_db_create(dbp)) != 0)
+			return (ret);
+		if ((ret = __ham_db_create(dbp)) != 0)
+			return (ret);
+		if ((ret = __qam_db_create(dbp)) != 0)
+			return (ret);
+
+		/* Restore flags */
+		dbp->flags = dbp->orig_flags | save_flags;
+
+		if (FLD_ISSET(save_flags, DB_AM_INMEM)) {
+			/*
+			 * If this is inmem, then it may have a fileid
+			 * even if it was never opened, and we need to
+			 * clear out that fileid.
+			 */
+			memset(dbp->fileid, 0, sizeof(dbp->fileid));
+			MAKE_INMEM(dbp);
+		}
+		return (ret);
+	}
+
 	dbp->type = DB_UNKNOWN;
 
 	/* Discard the thread mutex. */
-	if (dbp->mutexp != NULL) {
-		dbmp = dbenv->mp_handle;
-		__db_mutex_free(dbenv, dbmp->reginfo, dbp->mutexp);
-		dbp->mutexp = NULL;
-	}
+	if ((t_ret = __mutex_free(dbenv, &dbp->mutex)) != 0 && ret == 0)
+		ret = t_ret;
 
 	/* Discard any memory allocated for the file and database names. */
 	if (dbp->fname != NULL) {
@@ -1004,7 +1127,7 @@ __db_log_page(dbp, txn, lsn, pgno, page)
  * PUBLIC:     const char *, DB_TXN *, char **));
  */
 #undef	BACKUP_PREFIX
-#define	BACKUP_PREFIX	"__db."
+#define	BACKUP_PREFIX	"__db"
 
 #undef	MAX_LSN_TO_TEXT
 #define	MAX_LSN_TO_TEXT	17
@@ -1026,16 +1149,18 @@ __db_backup_name(dbenv, name, txn, backup)
 	 * we allocate enough space for it, even in the case where we don't
 	 * use the entire filename for the backup name.
 	 */
-	len = strlen(name) + strlen(BACKUP_PREFIX) + MAX_LSN_TO_TEXT;
+	len = strlen(name) + strlen(BACKUP_PREFIX) + 1 + MAX_LSN_TO_TEXT;
 	if ((ret = __os_malloc(dbenv, len, &retp)) != 0)
 		return (ret);
 
 	/*
-	 * Create the name.  Backup file names are in one of two forms:
+	 * Create the name.  Backup file names are in one of three forms:
 	 *
 	 *	In a transactional env: __db.LSN(8).LSN(8)
 	 * and
-	 *	in a non-transactional env: __db.FILENAME
+	 *	In VXWORKS (where we want 8.3 support)
+	 * and
+	 *	in any other non-transactional env: __db.FILENAME
 	 *
 	 * If the transaction doesn't have a current LSN, we write a dummy
 	 * log record to force it, so we ensure all tmp names are unique.
@@ -1051,14 +1176,37 @@ __db_backup_name(dbenv, name, txn, backup)
 	 *	4. multi-component path + transaction
 	 */
 	p = __db_rpath(name);
-	if (txn == NULL)
+	if (!IS_REAL_TXN(txn)) {
+#ifdef HAVE_VXWORKS
+	    { int i, n;
+		/* On VxWorks we must support 8.3 names. */
+		if (p == NULL)				/* Case 1. */
+			n = snprintf(retp,
+			    len, "%s%.4s.tmp", BACKUP_PREFIX, name);
+		else				/* Case 3. */
+			n = snprintf(retp, len, "%.*s%s%.4s.tmp",
+			    (int)(p - name) + 1, name, BACKUP_PREFIX, p + 1);
+
+		/*
+		 * Overwrite "." in the characters copied from the name.
+		 * If we backup 8 characters from the end, we're guaranteed
+		 * to a) include the four bytes we copied from the name
+		 * and b) not run off the beginning of the string.
+		 */
+		for (i = 0, p = (retp + n) - 8; i < 4; p++, i++)
+			if (*p == '.')
+				*p = '_';
+	    }
+#else
 		if (p == NULL)				/* Case 1. */
-			snprintf(retp, len, "%s%s", BACKUP_PREFIX, name);
+			snprintf(retp, len, "%s.%s", BACKUP_PREFIX, name);
 		else					/* Case 3. */
-			snprintf(retp, len, "%.*s%s%s",
+			snprintf(retp, len, "%.*s%s.%s",
 			    (int)(p - name) + 1, name, BACKUP_PREFIX, p + 1);
-	else {
-		if (IS_ZERO_LSN(txn->last_lsn)) {
+#endif
+	} else {
+		lsn = ((TXN_DETAIL *)txn->td)->last_lsn;
+		if (IS_ZERO_LSN(lsn)) {
 			/*
 			 * Write dummy log record.   The two choices for dummy
 			 * log records are __db_noop_log and __db_debug_log;
@@ -1071,12 +1219,11 @@ __db_backup_name(dbenv, name, txn, backup)
 				__os_free(dbenv, retp);
 				return (ret);
 			}
-		} else
-			lsn = txn->last_lsn;
+		}
 
 		if (p == NULL)				/* Case 2. */
 			snprintf(retp, len,
-			    "%s%x.%x", BACKUP_PREFIX, lsn.file, lsn.offset);
+			    "%s.%x.%x", BACKUP_PREFIX, lsn.file, lsn.offset);
 		else					/* Case 4. */
 			snprintf(retp, len, "%.*s%x.%x",
 			    (int)(p - name) + 1, name, lsn.file, lsn.offset);
@@ -1086,28 +1233,6 @@ __db_backup_name(dbenv, name, txn, backup)
 	return (0);
 }
 
-/*
- * __dblist_get --
- *	Get the first element of dbenv->dblist with
- *	dbp->adj_fileid matching adjid.
- *
- * PUBLIC: DB *__dblist_get __P((DB_ENV *, u_int32_t));
- */
-DB *
-__dblist_get(dbenv, adjid)
-	DB_ENV *dbenv;
-	u_int32_t adjid;
-{
-	DB *dbp;
-
-	for (dbp = LIST_FIRST(&dbenv->dblist);
-	    dbp != NULL && dbp->adj_fileid != adjid;
-	    dbp = LIST_NEXT(dbp, dblistlinks))
-		;
-
-	return (dbp);
-}
-
 /*
  * __db_disassociate --
  *	Destroy the association between a given secondary and its primary.
@@ -1133,7 +1258,7 @@ __db_disassociate(sdbp)
 	if (sdbp->s_refcnt != 1 ||
 	    TAILQ_FIRST(&sdbp->active_queue) != NULL ||
 	    TAILQ_FIRST(&sdbp->join_queue) != NULL) {
-		__db_err(sdbp->dbenv,
+		__db_errx(sdbp->dbenv,
     "Closing a primary DB while a secondary DB has active cursors is unsafe");
 		ret = EINVAL;
 	}
@@ -1165,7 +1290,7 @@ __db_testcopy(dbenv, dbp, name)
 	DB_MPOOL *dbmp;
 	DB_MPOOLFILE *mpf;
 
-	DB_ASSERT(dbp != NULL || name != NULL);
+	DB_ASSERT(dbenv, dbp != NULL || name != NULL);
 
 	if (name == NULL) {
 		dbmp = dbenv->mp_handle;
@@ -1185,8 +1310,8 @@ __qam_testdocopy(dbp, name)
 	const char *name;
 {
 	QUEUE_FILELIST *filelist, *fp;
-	char buf[256], *dir;
 	int ret;
+	char buf[DB_MAXPATHLEN], *dir;
 
 	filelist = NULL;
 	if ((ret = __db_testdocopy(dbp->dbenv, name)) != 0)
@@ -1235,7 +1360,8 @@ __db_testdocopy(dbenv, name)
 	/*
 	 * Maximum size of file, including adding a ".afterop".
 	 */
-	len = strlen(real_name) + strlen(BACKUP_PREFIX) + MAX_LSN_TO_TEXT + 9;
+	len = strlen(real_name) +
+	    strlen(BACKUP_PREFIX) + 1 + MAX_LSN_TO_TEXT + 9;
 
 	if ((ret = __os_malloc(dbenv, len, ©)) != 0)
 		goto err;
@@ -1264,7 +1390,7 @@ __db_testdocopy(dbenv, name)
 	 * files named, say, 'a' and 'abc' we won't match 'abc' when
 	 * looking for 'a'.
 	 */
-	snprintf(backup, len, "%s%s.0x", BACKUP_PREFIX, name);
+	snprintf(backup, len, "%s.%s.0x", BACKUP_PREFIX, name);
 
 	/*
 	 * We need the directory path to do the __os_dirlist.
@@ -1343,10 +1469,10 @@ __db_makecopy(dbenv, src, dest)
 		return;
 
 	if (__os_open(dbenv,
-	    src, DB_OSO_RDONLY, __db_omode("rw----"), &rfhp) != 0)
+	    src, DB_OSO_RDONLY, __db_omode(OWNER_RW), &rfhp) != 0)
 		goto err;
 	if (__os_open(dbenv, dest,
-	    DB_OSO_CREATE | DB_OSO_TRUNC, __db_omode("rw----"), &wfhp) != 0)
+	    DB_OSO_CREATE | DB_OSO_TRUNC, __db_omode(OWNER_RW), &wfhp) != 0)
 		goto err;
 
 	for (;;)
diff --git a/db/db/db.src b/db/db/db.src
index 2cac31a4f..40ce88677 100644
--- a/db/db/db.src
+++ b/db/db/db.src
@@ -1,22 +1,15 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db.src,v 11.28 2004/06/17 17:35:15 bostic Exp $
+ * $Id: db.src,v 12.6 2006/08/24 14:45:15 bostic Exp $
  */
 
 PREFIX	__db
 DBPRIVATE
 
-INCLUDE #ifndef NO_SYSTEM_INCLUDES
-INCLUDE #include 
-INCLUDE
-INCLUDE #include 
-INCLUDE #include 
-INCLUDE #endif
-INCLUDE
 INCLUDE #include "db_int.h"
 INCLUDE #include "dbinc/crypto.h"
 INCLUDE #include "dbinc/db_page.h"
@@ -42,7 +35,7 @@ INCLUDE
  * If the dbt was NULL then the hdr is a complete item to be
  * pasted on the page.
  */
-BEGIN addrem		41
+BEGIN addrem		42	41
 ARG	opcode		u_int32_t	lu
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
@@ -68,7 +61,7 @@ END
  *		may be used later if we actually do overwrites of big key/
  *		data items in place.
  */
-BEGIN big		43
+BEGIN big		42	43
 ARG	opcode		u_int32_t	lu
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
@@ -88,13 +81,35 @@ END
  * adjust:	the adjustment being made.
  * lsn:		the page's original lsn.
  */
-BEGIN ovref		44
+BEGIN ovref		42	44
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
 ARG	adjust		int32_t		ld
 POINTER	lsn		DB_LSN *	lu
 END
 
+/*
+ * relink -- Handles relinking around a page.
+ *
+ * opcode:	indicates if this is an addpage or delete page
+ * pgno:	the page being changed.
+ * lsn		the page's original lsn.
+ * prev:	the previous page.
+ * lsn_prev:	the previous page's original lsn.
+ * next:	the next page.
+ * lsn_next:	the previous page's original lsn.
+ */
+BEGIN_COMPAT relink		42	45
+ARG	opcode		u_int32_t	lu
+DB	fileid		int32_t		ld
+ARG	pgno		db_pgno_t	lu
+POINTER	lsn		DB_LSN *	lu
+ARG	prev		db_pgno_t	lu
+POINTER	lsn_prev	DB_LSN *	lu
+ARG	next		db_pgno_t	lu
+POINTER	lsn_next	DB_LSN *	lu
+END
+
 /*
  * Debug -- log an operation upon entering an access method.
  * op:		Operation (cursor, c_close, c_get, c_put, c_del,
@@ -104,7 +119,7 @@ END
  * data:	data parameter
  * flags:	flags parameter
  */
-BEGIN debug		47
+BEGIN debug		42	47
 DBT	op		DBT		s
 ARG	fileid		int32_t		ld
 DBT	key		DBT		s
@@ -115,7 +130,7 @@ END
 /*
  * noop -- do nothing, but get an LSN.
  */
-BEGIN noop		48
+BEGIN noop		42	48
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
 POINTER	prevlsn		DB_LSN *	lu
@@ -130,9 +145,19 @@ END
  * pgno:	the page allocated.
  * ptype:	the type of the page allocated.
  * next:	the next page on the free list.
- * last_pgno:	the last page in the file after this op.
+ * last_pgno:	the last page in the file after this op (4.3+).
  */
-BEGIN pg_alloc	49
+BEGIN_COMPAT pg_alloc	42	49
+DB	fileid		int32_t		ld
+POINTER	meta_lsn	DB_LSN *	lu
+ARG	meta_pgno	db_pgno_t	lu
+POINTER	page_lsn	DB_LSN *	lu
+ARG	pgno		db_pgno_t	lu
+ARG	ptype		u_int32_t	lu
+ARG	next		db_pgno_t	lu
+END
+
+BEGIN pg_alloc	43	49
 DB	fileid		int32_t		ld
 POINTER	meta_lsn	DB_LSN *	lu
 ARG	meta_pgno	db_pgno_t	lu
@@ -151,9 +176,18 @@ END
  * meta_pgno:	the meta-data page number.
  * header:	the header from the free'd page.
  * next:	the previous next pointer on the metadata page.
- * last_pgno:	the last page in the file before this op.
+ * last_pgno:	the last page in the file before this op (4.3+).
  */
-BEGIN pg_free		50
+BEGIN_COMPAT pg_free		42	50
+DB	fileid		int32_t		ld
+ARG	pgno		db_pgno_t	lu
+POINTER	meta_lsn	DB_LSN *	lu
+ARG	meta_pgno	db_pgno_t	lu
+PGDBT	header		DBT		s
+ARG	next		db_pgno_t	lu
+END
+
+BEGIN pg_free		43	50
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
 POINTER	meta_lsn	DB_LSN *	lu
@@ -170,7 +204,7 @@ END
  *	recovery to itself return DB_RUNRECOVERY, as only catastrophic
  *	recovery can fix things.
  */
-BEGIN cksum		51
+BEGIN cksum		42	51
 END
 
 /*
@@ -182,9 +216,19 @@ END
  * header:	the header and index entries from the free'd page.
  * data:	the data from the free'd page.
  * next:	the previous next pointer on the metadata page.
- * last_pgno:	the last page in the file before this op.
+ * last_pgno:	the last page in the file before this op (4.3+).
  */
-BEGIN pg_freedata		52
+BEGIN_COMPAT pg_freedata		42	52
+DB	fileid		int32_t		ld
+ARG	pgno		db_pgno_t	lu
+POINTER	meta_lsn	DB_LSN *	lu
+ARG	meta_pgno	db_pgno_t	lu
+PGDBT	header		DBT		s
+ARG	next		db_pgno_t	lu
+PGDBT	data		DBT		s
+END
+
+BEGIN pg_freedata		43	52
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
 POINTER	meta_lsn	DB_LSN *	lu
@@ -200,7 +244,7 @@ END
  *
  * pgno:	the page being freed.
  */
-BEGIN pg_prepare		53
+BEGIN pg_prepare		42	53
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
 END
@@ -214,7 +258,7 @@ END
  * header:	the header from the free'd page.
  * next:	the previous next pointer on the metadata page.
  */
-BEGIN pg_new		54
+BEGIN pg_new		42	54
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
 POINTER	meta_lsn	DB_LSN *	lu
@@ -230,9 +274,30 @@ END
  * header:	the header from the page.
  * data:	data that used to be on the page.
  */
-BEGIN pg_init		60
+BEGIN pg_init		43	60
 DB	fileid		int32_t		ld
 ARG	pgno		db_pgno_t	lu
 PGDBT	header		DBT		s
 PGDBT	data		DBT		s
 END
+
+/*
+ * pg_sort: sort the free list
+ *
+ * meta:	meta page number
+ * meta_lsn:	lsn on meta page.
+ * last_free:	page number of new last free page.
+ * last_lsn;	lsn of last free page.
+ * last_pgno:	current last page number.
+ * list:	list of pages and lsns to sort.
+ */
+BEGIN pg_sort		44	61
+DB	fileid		int32_t		ld
+ARG	meta		db_pgno_t	lu
+POINTER	meta_lsn	DB_LSN *	lu
+ARG	last_free	db_pgno_t	lu
+POINTER	last_lsn	DB_LSN *	lu
+ARG	last_pgno	db_pgno_t	lu
+DBT	list		DBT		s
+END
+
diff --git a/db/db/db_am.c b/db/db/db_am.c
index 0e4a864f9..becfd8b77 100644
--- a/db/db/db_am.c
+++ b/db/db/db_am.c
@@ -1,23 +1,16 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1998-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1998-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_am.c,v 11.120 2004/10/07 17:33:32 sue Exp $
+ * $Id: db_am.c,v 12.24 2006/08/24 14:45:15 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/btree.h"
 #include "dbinc/hash.h"
 #include "dbinc/lock.h"
@@ -48,7 +41,9 @@ __db_cursor_int(dbp, txn, dbtype, root, is_opd, lockerid, dbcp)
 	DBC *dbc;
 	DBC_INTERNAL *cp;
 	DB_ENV *dbenv;
+	db_threadid_t tid;
 	int allocated, ret;
+	pid_t pid;
 
 	dbenv = dbp->dbenv;
 	allocated = 0;
@@ -61,15 +56,14 @@ __db_cursor_int(dbp, txn, dbtype, root, is_opd, lockerid, dbcp)
 	 * right type.  With off page dups we may have different kinds
 	 * of cursors on the queue for a single database.
 	 */
-	MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
-	for (dbc = TAILQ_FIRST(&dbp->free_queue);
-	    dbc != NULL; dbc = TAILQ_NEXT(dbc, links))
+	MUTEX_LOCK(dbenv, dbp->mutex);
+	TAILQ_FOREACH(dbc, &dbp->free_queue, links)
 		if (dbtype == dbc->dbtype) {
 			TAILQ_REMOVE(&dbp->free_queue, dbc, links);
 			F_CLR(dbc, ~DBC_OWN_LID);
 			break;
 		}
-	MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp);
+	MUTEX_UNLOCK(dbenv, dbp->mutex);
 
 	if (dbc == NULL) {
 		if ((ret = __os_calloc(dbenv, 1, sizeof(DBC), &dbc)) != 0)
@@ -92,13 +86,14 @@ __db_cursor_int(dbp, txn, dbtype, root, is_opd, lockerid, dbcp)
 			 * environment handles.
 			 */
 			if (!DB_IS_THREADED(dbp)) {
-				if (dbp->dbenv->env_lid == DB_LOCK_INVALIDID &&
-				    (ret =
-				    __lock_id(dbenv,&dbp->dbenv->env_lid)) != 0)
+				if (dbp->dbenv->env_lref == NULL &&
+				    (ret = __lock_id(dbenv, NULL,
+				    (DB_LOCKER **)&dbp->dbenv->env_lref)) != 0)
 					goto err;
-				dbc->lid = dbp->dbenv->env_lid;
+				dbc->lref = dbp->dbenv->env_lref;
 			} else {
-				if ((ret = __lock_id(dbenv, &dbc->lid)) != 0)
+				if ((ret = __lock_id(dbenv, NULL,
+				    (DB_LOCKER **)&dbc->lref)) != 0)
 					goto err;
 				F_SET(dbc, DBC_OWN_LID);
 			}
@@ -132,7 +127,7 @@ __db_cursor_int(dbp, txn, dbtype, root, is_opd, lockerid, dbcp)
 					 * lock object just like we do to
 					 * single thread creates.
 					 */
-					DB_ASSERT(sizeof(db_pgno_t) ==
+					DB_ASSERT(dbenv, sizeof(db_pgno_t) ==
 					    sizeof(u_int32_t));
 					dbc->lock_dbt.size = sizeof(u_int32_t);
 					dbc->lock_dbt.data = &dbc->lock.pgno;
@@ -175,7 +170,9 @@ __db_cursor_int(dbp, txn, dbtype, root, is_opd, lockerid, dbcp)
 	dbc->dbtype = dbtype;
 	RESET_RET_MEM(dbc);
 
-	if ((dbc->txn = txn) == NULL) {
+	if ((dbc->txn = txn) != NULL)
+		dbc->locker = txn->txnid;
+	else if (LOCKING_ON(dbenv)) {
 		/*
 		 * There are certain cases in which we want to create a
 		 * new cursor with a particular locker ID that is known
@@ -193,16 +190,25 @@ __db_cursor_int(dbp, txn, dbtype, root, is_opd, lockerid, dbcp)
 		 * primary are subdatabases or we're using env-wide locking,
 		 * this is disastrous.
 		 *
-		 * In these cases, our caller will pass a nonzero locker ID
-		 * into this function.  Use this locker ID instead of dbc->lid
-		 * as the locker ID for our new cursor.
+		 * In these cases, our caller will pass a nonzero locker
+		 * ID into this function.  Use this locker ID instead of
+		 * the default as the locker ID for our new cursor.
 		 */
 		if (lockerid != DB_LOCK_INVALIDID)
 			dbc->locker = lockerid;
-		else
-			dbc->locker = dbc->lid;
-	} else
-		dbc->locker = txn->txnid;
+		else {
+			/*
+			 * If we are threaded then we need to set the
+			 * proper thread id into the locker.
+			 */
+			if (DB_IS_THREADED(dbp)) {
+				dbenv->thread_id(dbenv, &pid, &tid);
+				__lock_set_thread_id(
+				    (DB_LOCKER *)dbc->lref, pid, tid);
+			}
+			dbc->locker = ((DB_LOCKER *)dbc->lref)->id;
+		}
+	}
 
 	/*
 	 * These fields change when we are used as a secondary index, so
@@ -219,7 +225,7 @@ __db_cursor_int(dbp, txn, dbtype, root, is_opd, lockerid, dbcp)
 	if (F_ISSET(dbp, DB_AM_RECOVER))
 		F_SET(dbc, DBC_RECOVER);
 	if (F_ISSET(dbp, DB_AM_COMPENSATE))
-		F_SET(dbc, DBC_COMPENSATE);
+		F_SET(dbc, DBC_DONTLOCK);
 
 	/* Refresh the DBC internal structure. */
 	cp = dbc->internal;
@@ -253,10 +259,10 @@ __db_cursor_int(dbp, txn, dbtype, root, is_opd, lockerid, dbcp)
 	if (txn != NULL)
 		++txn->cursors;
 
-	MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
+	MUTEX_LOCK(dbenv, dbp->mutex);
 	TAILQ_INSERT_TAIL(&dbp->active_queue, dbc, links);
 	F_SET(dbc, DBC_ACTIVE);
-	MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp);
+	MUTEX_UNLOCK(dbenv, dbp->mutex);
 
 	*dbcp = dbc;
 	return (0);
@@ -333,7 +339,7 @@ __db_put(dbp, txn, key, data, flags)
 		case DB_UNKNOWN:
 		default:
 			/* The interface should prevent this. */
-			DB_ASSERT(
+			DB_ASSERT(dbenv,
 			    dbp->type == DB_QUEUE || dbp->type == DB_RECNO);
 
 			ret = __db_ferr(dbenv, "DB->put", 0);
@@ -341,46 +347,29 @@ __db_put(dbp, txn, key, data, flags)
 		}
 
 		/*
-		 * Secondary indices:  since we've returned zero from
-		 * an append function, we've just put a record, and done
-		 * so outside __db_c_put.  We know we're not a secondary--
-		 * the interface prevents puts on them--but we may be a
-		 * primary.  If so, update our secondary indices
-		 * appropriately.
+		 * Secondary indices:  since we've returned zero from an append
+		 * function, we've just put a record, and done so outside
+		 * __db_c_put.  We know we're not a secondary-- the interface
+		 * prevents puts on them--but we may be a primary.  If so,
+		 * update our secondary indices appropriately.
+		 *
+		 * If the application is managing this key's data, we need a
+		 * copy of it here.  It will be freed in __db_put_pp.
 		 */
-		DB_ASSERT(!F_ISSET(dbp, DB_AM_SECONDARY));
+		DB_ASSERT(dbenv, !F_ISSET(dbp, DB_AM_SECONDARY));
 
-		if (LIST_FIRST(&dbp->s_secondaries) != NULL)
+		if (LIST_FIRST(&dbp->s_secondaries) != NULL &&
+		    (ret = __dbt_usercopy(dbenv, key)) == 0)
 			ret = __db_append_primary(dbc, key, &tdata);
 
 		/*
 		 * The append callback, if one exists, may have allocated
 		 * a new tdata.data buffer.  If so, free it.
 		 */
-		FREE_IF_NEEDED(dbp, &tdata);
+		FREE_IF_NEEDED(dbenv, &tdata);
 
 		/* No need for a cursor put;  we're done. */
 		goto done;
-	case DB_NOOVERWRITE:
-		flags = 0;
-		/*
-		 * Set DB_DBT_USERMEM, this might be a threaded application and
-		 * the flags checking will catch us.  We don't want the actual
-		 * data, so request a partial of length 0.
-		 */
-		memset(&tdata, 0, sizeof(tdata));
-		F_SET(&tdata, DB_DBT_USERMEM | DB_DBT_PARTIAL);
-
-		/*
-		 * If we're doing page-level locking, set the read-modify-write
-		 * flag, we're going to overwrite immediately.
-		 */
-		if ((ret = __db_c_get(dbc, key, &tdata,
-		    DB_SET | (STD_LOCKING(dbc) ? DB_RMW : 0))) == 0)
-			ret = DB_KEYEXIST;
-		else if (ret == DB_NOTFOUND || ret == DB_KEYEMPTY)
-			ret = 0;
-		break;
 	default:
 		/* Fall through to normal cursor put. */
 		break;
@@ -412,7 +401,7 @@ __db_del(dbp, txn, key, flags)
 	u_int32_t flags;
 {
 	DBC *dbc;
-	DBT data, lkey;
+	DBT data;
 	u_int32_t f_init, f_next;
 	int ret, t_ret;
 
@@ -427,12 +416,12 @@ __db_del(dbp, txn, key, flags)
 	 * Walk a cursor through the key/data pairs, deleting as we go.  Set
 	 * the DB_DBT_USERMEM flag, as this might be a threaded application
 	 * and the flags checking will catch us.  We don't actually want the
-	 * keys or data, so request a partial of length 0.
+	 * keys or data, set DB_DBT_ISSET.  We rely on __db_c_get to clear
+	 * this.
 	 */
-	memset(&lkey, 0, sizeof(lkey));
-	F_SET(&lkey, DB_DBT_USERMEM | DB_DBT_PARTIAL);
 	memset(&data, 0, sizeof(data));
-	F_SET(&data, DB_DBT_USERMEM | DB_DBT_PARTIAL);
+	F_SET(&data, DB_DBT_USERMEM | DB_DBT_ISSET);
+	F_SET(key, DB_DBT_ISSET);
 
 	/*
 	 * If locking (and we haven't already acquired CDB locks), set the
@@ -445,42 +434,66 @@ __db_del(dbp, txn, key, flags)
 		f_next |= DB_RMW;
 	}
 
-	/* Walk through the set of key/data pairs, deleting as we go. */
-	if ((ret = __db_c_get(dbc, key, &data, f_init)) != 0)
-		goto err;
-
 	/*
-	 * Hash permits an optimization in DB->del:  since on-page
-	 * duplicates are stored in a single HKEYDATA structure, it's
-	 * possible to delete an entire set of them at once, and as
-	 * the HKEYDATA has to be rebuilt and re-put each time it
-	 * changes, this is much faster than deleting the duplicates
-	 * one by one.  Thus, if we're not pointing at an off-page
-	 * duplicate set, and we're not using secondary indices (in
-	 * which case we'd have to examine the items one by one anyway),
-	 * let hash do this "quick delete".
+	 * Optimize the simple cases.  For all AMs if we don't have secondaries
+	 * and are not a secondary and there are no dups then we can avoid a
+	 * bunch of overhead.  For queue we don't need to fetch the record since
+	 * we delete by direct calculation from the record number.
+	 *
+	 * Hash permits an optimization in DB->del: since on-page duplicates are
+	 * stored in a single HKEYDATA structure, it's possible to delete an
+	 * entire set of them at once, and as the HKEYDATA has to be rebuilt
+	 * and re-put each time it changes, this is much faster than deleting
+	 * the duplicates one by one.  Thus, if not pointing at an off-page
+	 * duplicate set, and we're not using secondary indices (in which case
+	 * we'd have to examine the items one by one anyway), let hash do this
+	 * "quick delete".
 	 *
 	 * !!!
 	 * Note that this is the only application-executed delete call in
 	 * Berkeley DB that does not go through the __db_c_del function.
 	 * If anything other than the delete itself (like a secondary index
 	 * update) has to happen there in a particular situation, the
-	 * conditions here should be modified not to call __ham_quick_delete.
-	 * The ordinary AM-independent alternative will work just fine with
-	 * a hash;  it'll just be slower.
+	 * conditions here should be modified not to use these optimizations.
+	 * The ordinary AM-independent alternative will work just fine;
+	 * it'll just be slower.
 	 */
-	if (dbp->type == DB_HASH)
-		if (LIST_FIRST(&dbp->s_secondaries) == NULL &&
-		    !F_ISSET(dbp, DB_AM_SECONDARY) &&
-		    dbc->internal->opd == NULL) {
+	if (!F_ISSET(dbp, DB_AM_SECONDARY) &&
+	    LIST_FIRST(&dbp->s_secondaries) == NULL) {
+#ifdef HAVE_QUEUE
+		if (dbp->type == DB_QUEUE) {
+			ret = __qam_delete(dbc, key);
+			F_CLR(key, DB_DBT_ISSET);
+			goto done;
+		}
+#endif
+
+		/* Fetch the first record. */
+		if ((ret = __db_c_get(dbc, key, &data, f_init)) != 0)
+			goto err;
+
+#ifdef HAVE_HASH
+		if (dbp->type == DB_HASH && dbc->internal->opd == NULL) {
 			ret = __ham_quick_delete(dbc);
 			goto done;
 		}
+#endif
 
+		if ((dbp->type == DB_BTREE || dbp->type == DB_RECNO) &&
+		    !F_ISSET(dbp, DB_AM_DUP)) {
+			ret = dbc->c_am_del(dbc);
+			goto done;
+		}
+	} else if ((ret = __db_c_get(dbc, key, &data, f_init)) != 0)
+		goto err;
+
+	/* Walk through the set of key/data pairs, deleting as we go. */
 	for (;;) {
 		if ((ret = __db_c_del(dbc, 0)) != 0)
 			break;
-		if ((ret = __db_c_get(dbc, &lkey, &data, f_next)) != 0) {
+		F_SET(key, DB_DBT_ISSET);
+		F_SET(&data, DB_DBT_ISSET);
+		if ((ret = __db_c_get(dbc, key, &data, f_next)) != 0) {
 			if (ret == DB_NOTFOUND)
 				ret = 0;
 			break;
@@ -554,21 +567,11 @@ __db_associate(dbp, txn, sdbp, callback, flags)
 	pdbc = sdbc = NULL;
 	ret = 0;
 
-	sdbp->s_callback = callback;
-	sdbp->s_primary = dbp;
-
-	sdbp->stored_get = sdbp->get;
-	sdbp->get = __db_secondary_get;
-
-	sdbp->stored_close = sdbp->close;
-	sdbp->close = __db_secondary_close_pp;
-
-	F_SET(sdbp, DB_AM_SECONDARY);
-
 	/*
-	 * Check to see if the secondary is empty--and thus if we should
-	 * build it--before we link it in and risk making it show up in
-	 * other threads.
+	 * Check to see if the secondary is empty -- and thus if we should
+	 * build it -- before we link it in and risk making it show up in other
+	 * threads.  Do this first so that the databases remain unassociated on
+	 * error.
 	 */
 	build = 0;
 	if (LF_ISSET(DB_CREATE)) {
@@ -590,10 +593,6 @@ __db_associate(dbp, txn, sdbp, callback, flags)
 			ret = 0;
 		}
 
-		/*
-		 * Secondary cursors have special refcounting close
-		 * methods.  Be careful.
-		 */
 		if ((t_ret = __db_c_close(sdbc)) != 0 && ret == 0)
 			ret = t_ret;
 
@@ -604,18 +603,35 @@ __db_associate(dbp, txn, sdbp, callback, flags)
 			goto err;
 	}
 
+	/*
+	 * Set up the database handle as a secondary.
+	 */
+	sdbp->s_callback = callback;
+	sdbp->s_primary = dbp;
+
+	sdbp->stored_get = sdbp->get;
+	sdbp->get = __db_secondary_get;
+
+	sdbp->stored_close = sdbp->close;
+	sdbp->close = __db_secondary_close_pp;
+
+	F_SET(sdbp, DB_AM_SECONDARY);
+
+	if (LF_ISSET(DB_IMMUTABLE_KEY))
+		FLD_SET(sdbp->s_assoc_flags, DB_ASSOC_IMMUTABLE_KEY);
+
 	/*
 	 * Add the secondary to the list on the primary.  Do it here
 	 * so that we see any updates that occur while we're walking
 	 * the primary.
 	 */
-	MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
+	MUTEX_LOCK(dbenv, dbp->mutex);
 
 	/* See __db_s_next for an explanation of secondary refcounting. */
-	DB_ASSERT(sdbp->s_refcnt == 0);
+	DB_ASSERT(dbenv, sdbp->s_refcnt == 0);
 	sdbp->s_refcnt = 1;
 	LIST_INSERT_HEAD(&dbp->s_secondaries, sdbp, s_links);
-	MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp);
+	MUTEX_UNLOCK(dbenv, dbp->mutex);
 
 	if (build) {
 		/*
@@ -650,13 +666,14 @@ __db_associate(dbp, txn, sdbp, callback, flags)
 					continue;
 				goto err;
 			}
+			SWAP_IF_NEEDED(sdbp, &key);
 			if ((ret = __db_c_put(sdbc,
 			    &skey, &key, DB_UPDATE_SECONDARY)) != 0) {
-				FREE_IF_NEEDED(sdbp, &skey);
+				FREE_IF_NEEDED(dbenv, &skey);
 				goto err;
 			}
-
-			FREE_IF_NEEDED(sdbp, &skey);
+			SWAP_IF_NEEDED(sdbp, &key);
+			FREE_IF_NEEDED(dbenv, &skey);
 		}
 		if (ret == DB_NOTFOUND)
 			ret = 0;
@@ -685,8 +702,7 @@ __db_secondary_get(sdbp, txn, skey, data, flags)
 	DBT *skey, *data;
 	u_int32_t flags;
 {
-
-	DB_ASSERT(F_ISSET(sdbp, DB_AM_SECONDARY));
+	DB_ASSERT(sdbp->dbenv, F_ISSET(sdbp, DB_AM_SECONDARY));
 	return (__db_pget_pp(sdbp, txn, skey, NULL, data, flags));
 }
 
@@ -703,13 +719,15 @@ __db_secondary_close(sdbp, flags)
 	DB *sdbp;
 	u_int32_t flags;
 {
+	DB_ENV *dbenv;
 	DB *primary;
 	int doclose;
 
 	doclose = 0;
 	primary = sdbp->s_primary;
+	dbenv = primary->dbenv;
 
-	MUTEX_THREAD_LOCK(primary->dbenv, primary->mutexp);
+	MUTEX_LOCK(dbenv, primary->mutex);
 	/*
 	 * Check the refcount--if it was at 1 when we were called, no
 	 * thread is currently updating this secondary through the primary,
@@ -719,13 +737,13 @@ __db_secondary_close(sdbp, flags)
 	 * database will actually be closed when the refcount is decremented,
 	 * which can happen in either __db_s_next or __db_s_done.
 	 */
-	DB_ASSERT(sdbp->s_refcnt != 0);
+	DB_ASSERT(dbenv, sdbp->s_refcnt != 0);
 	if (--sdbp->s_refcnt == 0) {
 		LIST_REMOVE(sdbp, s_links);
 		/* We don't want to call close while the mutex is held. */
 		doclose = 1;
 	}
-	MUTEX_THREAD_UNLOCK(primary->dbenv, primary->mutexp);
+	MUTEX_UNLOCK(dbenv, primary->mutex);
 
 	/*
 	 * sdbp->close is this function;  call the real one explicitly if
@@ -747,9 +765,11 @@ __db_append_primary(dbc, key, data)
 	DB *dbp, *sdbp;
 	DBC *sdbc, *pdbc;
 	DBT oldpkey, pkey, pdata, skey;
+	DB_ENV *dbenv;
 	int cmp, ret, t_ret;
 
 	dbp = dbc->dbp;
+	dbenv = dbp->dbenv;
 	sdbp = NULL;
 	ret = 0;
 
@@ -793,23 +813,23 @@ __db_append_primary(dbc, key, data)
 	 * just that section into a common function, but the basic
 	 * overview is the same here.
 	 */
-	for (sdbp = __db_s_first(dbp);
-	    sdbp != NULL && ret == 0; ret = __db_s_next(&sdbp)) {
+	if ((ret = __db_s_first(dbp, &sdbp)) != 0)
+		goto err;
+	for (; sdbp != NULL && ret == 0; ret = __db_s_next(&sdbp)) {
 		memset(&skey, 0, sizeof(DBT));
 		if ((ret = sdbp->s_callback(sdbp, key, data, &skey)) != 0) {
 			if (ret == DB_DONOTINDEX)
 				continue;
-			else
-				goto err;
+			goto err;
 		}
 
 		if ((ret = __db_cursor_int(sdbp, dbc->txn, sdbp->type,
 		    PGNO_INVALID, 0, dbc->locker, &sdbc)) != 0) {
-			FREE_IF_NEEDED(sdbp, &skey);
+			FREE_IF_NEEDED(dbenv, &skey);
 			goto err;
 		}
-		if (CDB_LOCKING(sdbp->dbenv)) {
-			DB_ASSERT(sdbc->mylock.off == LOCK_INVALID);
+		if (CDB_LOCKING(dbenv)) {
+			DB_ASSERT(dbenv, sdbc->mylock.off == LOCK_INVALID);
 			F_SET(sdbc, DBC_WRITER);
 		}
 
@@ -832,10 +852,9 @@ __db_append_primary(dbc, key, data)
 				 * This needs to use the right free function
 				 * as soon as this is possible.
 				 */
-				__os_ufree(sdbp->dbenv,
-				    oldpkey.data);
+				__os_ufree(dbenv, oldpkey.data);
 				if (cmp != 0) {
-					__db_err(sdbp->dbenv, "%s%s",
+					__db_errx(dbenv, "%s%s",
 			    "Append results in a non-unique secondary key in",
 			    " an index not configured to support duplicates");
 					ret = EINVAL;
@@ -847,11 +866,10 @@ __db_append_primary(dbc, key, data)
 
 		ret = __db_c_put(sdbc, &skey, key, DB_UPDATE_SECONDARY);
 
-err1:		FREE_IF_NEEDED(sdbp, &skey);
+err1:		FREE_IF_NEEDED(dbenv, &skey);
 
 		if ((t_ret = __db_c_close(sdbc)) != 0 && ret == 0)
 			ret = t_ret;
-
 		if (ret != 0)
 			goto err;
 	}
diff --git a/db/db/db_auto.c b/db/db/db_auto.c
index b0d479dc8..f9cdedd7f 100644
--- a/db/db/db_auto.c
+++ b/db/db/db_auto.c
@@ -2,13 +2,6 @@
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/crypto.h"
 #include "dbinc/db_page.h"
@@ -23,11 +16,11 @@
  * PUBLIC:     const DBT *, const DBT *, DB_LSN *));
  */
 int
-__db_addrem_log(dbp, txnid, ret_lsnp, flags,
+__db_addrem_log(dbp, txnp, ret_lsnp, flags,
     opcode, pgno, indx, nbytes, hdr,
     dbt, pagelsn)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	u_int32_t opcode;
@@ -58,30 +51,31 @@ __db_addrem_log(dbp, txnid, ret_lsnp, flags,
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -101,7 +95,7 @@ __db_addrem_log(dbp, txnid, ret_lsnp, flags,
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -175,18 +169,25 @@ __db_addrem_log(dbp, txnid, ret_lsnp, flags,
 		bp += dbt->size;
 	}
 
-	if (pagelsn != NULL)
+	if (pagelsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(pagelsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, pagelsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, pagelsn, sizeof(*pagelsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*pagelsn));
 	bp += sizeof(*pagelsn);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -205,20 +206,21 @@ __db_addrem_log(dbp, txnid, ret_lsnp, flags,
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_addrem_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -242,13 +244,14 @@ __db_addrem_read(dbenv, recbuf, argpp)
 	    sizeof(__db_addrem_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -298,11 +301,11 @@ __db_addrem_read(dbenv, recbuf, argpp)
  * PUBLIC:     const DBT *, DB_LSN *, DB_LSN *, DB_LSN *));
  */
 int
-__db_big_log(dbp, txnid, ret_lsnp, flags,
+__db_big_log(dbp, txnp, ret_lsnp, flags,
     opcode, pgno, prev_pgno, next_pgno, dbt,
     pagelsn, prevlsn, nextlsn)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	u_int32_t opcode;
@@ -334,30 +337,31 @@ __db_big_log(dbp, txnid, ret_lsnp, flags,
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -378,7 +382,7 @@ __db_big_log(dbp, txnid, ret_lsnp, flags,
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -441,30 +445,49 @@ __db_big_log(dbp, txnid, ret_lsnp, flags,
 		bp += dbt->size;
 	}
 
-	if (pagelsn != NULL)
+	if (pagelsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(pagelsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, pagelsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, pagelsn, sizeof(*pagelsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*pagelsn));
 	bp += sizeof(*pagelsn);
 
-	if (prevlsn != NULL)
+	if (prevlsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(prevlsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, prevlsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, prevlsn, sizeof(*prevlsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*prevlsn));
 	bp += sizeof(*prevlsn);
 
-	if (nextlsn != NULL)
+	if (nextlsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(nextlsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, nextlsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, nextlsn, sizeof(*nextlsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*nextlsn));
 	bp += sizeof(*nextlsn);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -483,20 +506,21 @@ __db_big_log(dbp, txnid, ret_lsnp, flags,
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_big_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -520,13 +544,14 @@ __db_big_read(dbenv, recbuf, argpp)
 	    sizeof(__db_big_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -575,9 +600,9 @@ __db_big_read(dbenv, recbuf, argpp)
  * PUBLIC:     u_int32_t, db_pgno_t, int32_t, DB_LSN *));
  */
 int
-__db_ovref_log(dbp, txnid, ret_lsnp, flags, pgno, adjust, lsn)
+__db_ovref_log(dbp, txnp, ret_lsnp, flags, pgno, adjust, lsn)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	db_pgno_t pgno;
@@ -604,30 +629,31 @@ __db_ovref_log(dbp, txnid, ret_lsnp, flags, pgno, adjust, lsn)
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -643,7 +669,7 @@ __db_ovref_log(dbp, txnid, ret_lsnp, flags, pgno, adjust, lsn)
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -687,18 +713,25 @@ __db_ovref_log(dbp, txnid, ret_lsnp, flags, pgno, adjust, lsn)
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	if (lsn != NULL)
+	if (lsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, lsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, lsn, sizeof(*lsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*lsn));
 	bp += sizeof(*lsn);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -717,20 +750,21 @@ __db_ovref_log(dbp, txnid, ret_lsnp, flags, pgno, adjust, lsn)
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_ovref_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -754,13 +788,14 @@ __db_ovref_read(dbenv, recbuf, argpp)
 	    sizeof(__db_ovref_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -784,16 +819,80 @@ __db_ovref_read(dbenv, recbuf, argpp)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __db_relink_42_read __P((DB_ENV *, void *,
+ * PUBLIC:     __db_relink_42_args **));
+ */
+int
+__db_relink_42_read(dbenv, recbuf, argpp)
+	DB_ENV *dbenv;
+	void *recbuf;
+	__db_relink_42_args **argpp;
+{
+	__db_relink_42_args *argp;
+	u_int32_t uinttmp;
+	u_int8_t *bp;
+	int ret;
+
+	if ((ret = __os_malloc(dbenv,
+	    sizeof(__db_relink_42_args) + sizeof(DB_TXN), &argp)) != 0)
+		return (ret);
+	bp = recbuf;
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
+
+	memcpy(&argp->type, bp, sizeof(argp->type));
+	bp += sizeof(argp->type);
+
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
+
+	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->opcode = (u_int32_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->fileid = (int32_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->pgno = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&argp->lsn, bp,  sizeof(argp->lsn));
+	bp += sizeof(argp->lsn);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->prev = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&argp->lsn_prev, bp,  sizeof(argp->lsn_prev));
+	bp += sizeof(argp->lsn_prev);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->next = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&argp->lsn_next, bp,  sizeof(argp->lsn_next));
+	bp += sizeof(argp->lsn_next);
+
+	*argpp = argp;
+	return (0);
+}
+
 /*
  * PUBLIC: int __db_debug_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, const DBT *, int32_t, const DBT *, const DBT *,
  * PUBLIC:     u_int32_t));
  */
 int
-__db_debug_log(dbenv, txnid, ret_lsnp, flags,
+__db_debug_log(dbenv, txnp, ret_lsnp, flags,
     op, fileid, key, data, arg_flags)
 	DB_ENV *dbenv;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	const DBT *op;
@@ -819,13 +918,15 @@ __db_debug_log(dbenv, txnid, ret_lsnp, flags,
 	ret = 0;
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
-		if (txnid == NULL)
+		if (txnp == NULL)
+			return (0);
+		if (txnp == NULL)
 			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
@@ -835,10 +936,9 @@ __db_debug_log(dbenv, txnid, ret_lsnp, flags,
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
 	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
@@ -853,7 +953,7 @@ __db_debug_log(dbenv, txnid, ret_lsnp, flags,
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -926,12 +1026,13 @@ __db_debug_log(dbenv, txnid, ret_lsnp, flags,
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -950,20 +1051,21 @@ __db_debug_log(dbenv, txnid, ret_lsnp, flags,
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_debug_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -987,13 +1089,14 @@ __db_debug_read(dbenv, recbuf, argpp)
 	    sizeof(__db_debug_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -1033,9 +1136,9 @@ __db_debug_read(dbenv, recbuf, argpp)
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *));
  */
 int
-__db_noop_log(dbp, txnid, ret_lsnp, flags, pgno, prevlsn)
+__db_noop_log(dbp, txnp, ret_lsnp, flags, pgno, prevlsn)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	db_pgno_t pgno;
@@ -1061,30 +1164,31 @@ __db_noop_log(dbp, txnid, ret_lsnp, flags, pgno, prevlsn)
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -1099,7 +1203,7 @@ __db_noop_log(dbp, txnid, ret_lsnp, flags, pgno, prevlsn)
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -1139,18 +1243,25 @@ __db_noop_log(dbp, txnid, ret_lsnp, flags, pgno, prevlsn)
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	if (prevlsn != NULL)
+	if (prevlsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(prevlsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, prevlsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, prevlsn, sizeof(*prevlsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*prevlsn));
 	bp += sizeof(*prevlsn);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -1169,20 +1280,21 @@ __db_noop_log(dbp, txnid, ret_lsnp, flags, pgno, prevlsn)
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_noop_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -1206,13 +1318,14 @@ __db_noop_read(dbenv, recbuf, argpp)
 	    sizeof(__db_noop_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -1232,16 +1345,77 @@ __db_noop_read(dbenv, recbuf, argpp)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __db_pg_alloc_42_read __P((DB_ENV *, void *,
+ * PUBLIC:     __db_pg_alloc_42_args **));
+ */
+int
+__db_pg_alloc_42_read(dbenv, recbuf, argpp)
+	DB_ENV *dbenv;
+	void *recbuf;
+	__db_pg_alloc_42_args **argpp;
+{
+	__db_pg_alloc_42_args *argp;
+	u_int32_t uinttmp;
+	u_int8_t *bp;
+	int ret;
+
+	if ((ret = __os_malloc(dbenv,
+	    sizeof(__db_pg_alloc_42_args) + sizeof(DB_TXN), &argp)) != 0)
+		return (ret);
+	bp = recbuf;
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
+
+	memcpy(&argp->type, bp, sizeof(argp->type));
+	bp += sizeof(argp->type);
+
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
+
+	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->fileid = (int32_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&argp->meta_lsn, bp,  sizeof(argp->meta_lsn));
+	bp += sizeof(argp->meta_lsn);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->meta_pgno = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&argp->page_lsn, bp,  sizeof(argp->page_lsn));
+	bp += sizeof(argp->page_lsn);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->pgno = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->ptype = (u_int32_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->next = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	*argpp = argp;
+	return (0);
+}
+
 /*
  * PUBLIC: int __db_pg_alloc_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, u_int32_t,
  * PUBLIC:     db_pgno_t, db_pgno_t));
  */
 int
-__db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pgno, ptype,
+__db_pg_alloc_log(dbp, txnp, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pgno, ptype,
     next, last_pgno)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	DB_LSN * meta_lsn;
@@ -1272,30 +1446,31 @@ __db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pg
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -1315,7 +1490,7 @@ __db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pg
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -1351,9 +1526,15 @@ __db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pg
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	if (meta_lsn != NULL)
+	if (meta_lsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, meta_lsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, meta_lsn, sizeof(*meta_lsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*meta_lsn));
 	bp += sizeof(*meta_lsn);
 
@@ -1361,9 +1542,15 @@ __db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pg
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	if (page_lsn != NULL)
+	if (page_lsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(page_lsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, page_lsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, page_lsn, sizeof(*page_lsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*page_lsn));
 	bp += sizeof(*page_lsn);
 
@@ -1383,12 +1570,13 @@ __db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pg
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -1407,20 +1595,21 @@ __db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pg
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_pg_alloc_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -1445,13 +1634,14 @@ __db_pg_alloc_read(dbenv, recbuf, argpp)
 	    sizeof(__db_pg_alloc_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -1490,16 +1680,76 @@ __db_pg_alloc_read(dbenv, recbuf, argpp)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __db_pg_free_42_read __P((DB_ENV *, void *,
+ * PUBLIC:     __db_pg_free_42_args **));
+ */
+int
+__db_pg_free_42_read(dbenv, recbuf, argpp)
+	DB_ENV *dbenv;
+	void *recbuf;
+	__db_pg_free_42_args **argpp;
+{
+	__db_pg_free_42_args *argp;
+	u_int32_t uinttmp;
+	u_int8_t *bp;
+	int ret;
+
+	if ((ret = __os_malloc(dbenv,
+	    sizeof(__db_pg_free_42_args) + sizeof(DB_TXN), &argp)) != 0)
+		return (ret);
+	bp = recbuf;
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
+
+	memcpy(&argp->type, bp, sizeof(argp->type));
+	bp += sizeof(argp->type);
+
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
+
+	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->fileid = (int32_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->pgno = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&argp->meta_lsn, bp,  sizeof(argp->meta_lsn));
+	bp += sizeof(argp->meta_lsn);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->meta_pgno = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memset(&argp->header, 0, sizeof(argp->header));
+	memcpy(&argp->header.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->header.data = bp;
+	bp += argp->header.size;
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->next = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	*argpp = argp;
+	return (0);
+}
+
 /*
  * PUBLIC: int __db_pg_free_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *,
  * PUBLIC:     db_pgno_t, db_pgno_t));
  */
 int
-__db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header, next,
+__db_pg_free_log(dbp, txnp, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header, next,
     last_pgno)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	db_pgno_t pgno;
@@ -1529,30 +1779,31 @@ __db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -1571,7 +1822,7 @@ __db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -1611,9 +1862,15 @@ __db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	if (meta_lsn != NULL)
+	if (meta_lsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, meta_lsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, meta_lsn, sizeof(*meta_lsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*meta_lsn));
 	bp += sizeof(*meta_lsn);
 
@@ -1640,12 +1897,13 @@ __db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -1664,20 +1922,21 @@ __db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_pg_free_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -1701,13 +1960,14 @@ __db_pg_free_read(dbenv, recbuf, argpp)
 	    sizeof(__db_pg_free_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -1749,9 +2009,9 @@ __db_pg_free_read(dbenv, recbuf, argpp)
  * PUBLIC: int __db_cksum_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t));
  */
 int
-__db_cksum_log(dbenv, txnid, ret_lsnp, flags)
+__db_cksum_log(dbenv, txnp, ret_lsnp, flags)
 	DB_ENV *dbenv;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 {
@@ -1772,29 +2032,30 @@ __db_cksum_log(dbenv, txnid, ret_lsnp, flags)
 	ret = 0;
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
-		if (txnid == NULL)
+		if (txnp == NULL)
+			return (0);
+		if (txnp == NULL)
 			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
 	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN);
@@ -1804,7 +2065,7 @@ __db_cksum_log(dbenv, txnid, ret_lsnp, flags)
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -1836,12 +2097,13 @@ __db_cksum_log(dbenv, txnid, ret_lsnp, flags)
 	memcpy(bp, lsnp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -1860,20 +2122,21 @@ __db_cksum_log(dbenv, txnid, ret_lsnp, flags)
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_cksum_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -1896,13 +2159,14 @@ __db_cksum_read(dbenv, recbuf, argpp)
 	    sizeof(__db_cksum_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -1911,16 +2175,82 @@ __db_cksum_read(dbenv, recbuf, argpp)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __db_pg_freedata_42_read __P((DB_ENV *, void *,
+ * PUBLIC:     __db_pg_freedata_42_args **));
+ */
+int
+__db_pg_freedata_42_read(dbenv, recbuf, argpp)
+	DB_ENV *dbenv;
+	void *recbuf;
+	__db_pg_freedata_42_args **argpp;
+{
+	__db_pg_freedata_42_args *argp;
+	u_int32_t uinttmp;
+	u_int8_t *bp;
+	int ret;
+
+	if ((ret = __os_malloc(dbenv,
+	    sizeof(__db_pg_freedata_42_args) + sizeof(DB_TXN), &argp)) != 0)
+		return (ret);
+	bp = recbuf;
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
+
+	memcpy(&argp->type, bp, sizeof(argp->type));
+	bp += sizeof(argp->type);
+
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
+
+	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->fileid = (int32_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->pgno = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&argp->meta_lsn, bp,  sizeof(argp->meta_lsn));
+	bp += sizeof(argp->meta_lsn);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->meta_pgno = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memset(&argp->header, 0, sizeof(argp->header));
+	memcpy(&argp->header.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->header.data = bp;
+	bp += argp->header.size;
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->next = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memset(&argp->data, 0, sizeof(argp->data));
+	memcpy(&argp->data.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->data.data = bp;
+	bp += argp->data.size;
+
+	*argpp = argp;
+	return (0);
+}
+
 /*
  * PUBLIC: int __db_pg_freedata_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *,
  * PUBLIC:     db_pgno_t, db_pgno_t, const DBT *));
  */
 int
-__db_pg_freedata_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header, next,
+__db_pg_freedata_log(dbp, txnp, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header, next,
     last_pgno, data)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	db_pgno_t pgno;
@@ -1951,30 +2281,31 @@ __db_pg_freedata_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, hea
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -1994,7 +2325,7 @@ __db_pg_freedata_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, hea
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -2034,9 +2365,15 @@ __db_pg_freedata_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, hea
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	if (meta_lsn != NULL)
+	if (meta_lsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, meta_lsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, meta_lsn, sizeof(*meta_lsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*meta_lsn));
 	bp += sizeof(*meta_lsn);
 
@@ -2074,12 +2411,13 @@ __db_pg_freedata_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, hea
 		bp += data->size;
 	}
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -2098,20 +2436,21 @@ __db_pg_freedata_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, hea
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_pg_freedata_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -2136,13 +2475,14 @@ __db_pg_freedata_read(dbenv, recbuf, argpp)
 	    sizeof(__db_pg_freedata_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -2191,9 +2531,9 @@ __db_pg_freedata_read(dbenv, recbuf, argpp)
  * PUBLIC:     u_int32_t, db_pgno_t));
  */
 int
-__db_pg_prepare_log(dbp, txnid, ret_lsnp, flags, pgno)
+__db_pg_prepare_log(dbp, txnp, ret_lsnp, flags, pgno)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	db_pgno_t pgno;
@@ -2218,30 +2558,31 @@ __db_pg_prepare_log(dbp, txnid, ret_lsnp, flags, pgno)
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -2255,7 +2596,7 @@ __db_pg_prepare_log(dbp, txnid, ret_lsnp, flags, pgno)
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -2295,12 +2636,13 @@ __db_pg_prepare_log(dbp, txnid, ret_lsnp, flags, pgno)
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -2319,20 +2661,21 @@ __db_pg_prepare_log(dbp, txnid, ret_lsnp, flags, pgno)
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_pg_prepare_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -2357,13 +2700,14 @@ __db_pg_prepare_read(dbenv, recbuf, argpp)
 	    sizeof(__db_pg_prepare_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -2386,9 +2730,9 @@ __db_pg_prepare_read(dbenv, recbuf, argpp)
  * PUBLIC:     db_pgno_t));
  */
 int
-__db_pg_new_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header, next)
+__db_pg_new_log(dbp, txnp, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header, next)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	db_pgno_t pgno;
@@ -2417,30 +2761,31 @@ __db_pg_new_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -2458,7 +2803,7 @@ __db_pg_new_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -2498,9 +2843,15 @@ __db_pg_new_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	if (meta_lsn != NULL)
+	if (meta_lsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, meta_lsn) != 0))
+				return (ret);
+		}
 		memcpy(bp, meta_lsn, sizeof(*meta_lsn));
-	else
+	} else
 		memset(bp, 0, sizeof(*meta_lsn));
 	bp += sizeof(*meta_lsn);
 
@@ -2523,12 +2874,13 @@ __db_pg_new_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -2547,20 +2899,21 @@ __db_pg_new_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_pg_new_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -2584,13 +2937,14 @@ __db_pg_new_read(dbenv, recbuf, argpp)
 	    sizeof(__db_pg_new_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -2629,9 +2983,9 @@ __db_pg_new_read(dbenv, recbuf, argpp)
  * PUBLIC:     u_int32_t, db_pgno_t, const DBT *, const DBT *));
  */
 int
-__db_pg_init_log(dbp, txnid, ret_lsnp, flags, pgno, header, data)
+__db_pg_init_log(dbp, txnp, ret_lsnp, flags, pgno, header, data)
 	DB *dbp;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	db_pgno_t pgno;
@@ -2658,30 +3012,31 @@ __db_pg_init_log(dbp, txnid, ret_lsnp, flags, pgno, header, data)
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
-	DB_ASSERT(dbp->log_filename != NULL);
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
 	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
 	    (ret = __dbreg_lazy_id(dbp)) != 0)
 		return (ret);
@@ -2697,7 +3052,7 @@ __db_pg_init_log(dbp, txnid, ret_lsnp, flags, pgno, header, data)
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -2759,12 +3114,13 @@ __db_pg_init_log(dbp, txnid, ret_lsnp, flags, pgno, header, data)
 		bp += data->size;
 	}
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -2783,20 +3139,21 @@ __db_pg_init_log(dbp, txnid, ret_lsnp, flags, pgno, header, data)
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__db_pg_init_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -2820,13 +3177,14 @@ __db_pg_init_read(dbenv, recbuf, argpp)
 	    sizeof(__db_pg_init_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
@@ -2855,6 +3213,278 @@ __db_pg_init_read(dbenv, recbuf, argpp)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __db_pg_sort_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t,
+ * PUBLIC:     const DBT *));
+ */
+int
+__db_pg_sort_log(dbp, txnp, ret_lsnp, flags, meta, meta_lsn, last_free, last_lsn, last_pgno,
+    list)
+	DB *dbp;
+	DB_TXN *txnp;
+	DB_LSN *ret_lsnp;
+	u_int32_t flags;
+	db_pgno_t meta;
+	DB_LSN * meta_lsn;
+	db_pgno_t last_free;
+	DB_LSN * last_lsn;
+	db_pgno_t last_pgno;
+	const DBT *list;
+{
+	DBT logrec;
+	DB_ENV *dbenv;
+	DB_TXNLOGREC *lr;
+	DB_LSN *lsnp, null_lsn, *rlsnp;
+	u_int32_t zero, uinttmp, rectype, txn_num;
+	u_int npad;
+	u_int8_t *bp;
+	int is_durable, ret;
+
+	dbenv = dbp->dbenv;
+	COMPQUIET(lr, NULL);
+
+	rectype = DB___db_pg_sort;
+	npad = 0;
+	rlsnp = ret_lsnp;
+
+	ret = 0;
+
+	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
+	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+		if (txnp == NULL)
+			return (0);
+		is_durable = 0;
+	} else
+		is_durable = 1;
+
+	if (txnp == NULL) {
+		txn_num = 0;
+		lsnp = &null_lsn;
+		null_lsn.file = null_lsn.offset = 0;
+	} else {
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
+			return (ret);
+		/*
+		 * We need to assign begin_lsn while holding region mutex.
+		 * That assignment is done inside the DbEnv->log_put call,
+		 * so pass in the appropriate memory location to be filled
+		 * in by the log_put code.
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
+	}
+
+	DB_ASSERT(dbenv, dbp->log_filename != NULL);
+	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
+	    (ret = __dbreg_lazy_id(dbp)) != 0)
+		return (ret);
+
+	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
+	    + sizeof(u_int32_t)
+	    + sizeof(u_int32_t)
+	    + sizeof(*meta_lsn)
+	    + sizeof(u_int32_t)
+	    + sizeof(*last_lsn)
+	    + sizeof(u_int32_t)
+	    + sizeof(u_int32_t) + (list == NULL ? 0 : list->size);
+	if (CRYPTO_ON(dbenv)) {
+		npad =
+		    ((DB_CIPHER *)dbenv->crypto_handle)->adj_size(logrec.size);
+		logrec.size += npad;
+	}
+
+	if (is_durable || txnp == NULL) {
+		if ((ret =
+		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
+			return (ret);
+	} else {
+		if ((ret = __os_malloc(dbenv,
+		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
+			return (ret);
+#ifdef DIAGNOSTIC
+		if ((ret =
+		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0) {
+			__os_free(dbenv, lr);
+			return (ret);
+		}
+#else
+		logrec.data = lr->data;
+#endif
+	}
+	if (npad > 0)
+		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
+
+	bp = logrec.data;
+
+	memcpy(bp, &rectype, sizeof(rectype));
+	bp += sizeof(rectype);
+
+	memcpy(bp, &txn_num, sizeof(txn_num));
+	bp += sizeof(txn_num);
+
+	memcpy(bp, lsnp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	uinttmp = (u_int32_t)dbp->log_filename->id;
+	memcpy(bp, &uinttmp, sizeof(uinttmp));
+	bp += sizeof(uinttmp);
+
+	uinttmp = (u_int32_t)meta;
+	memcpy(bp, &uinttmp, sizeof(uinttmp));
+	bp += sizeof(uinttmp);
+
+	if (meta_lsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, meta_lsn) != 0))
+				return (ret);
+		}
+		memcpy(bp, meta_lsn, sizeof(*meta_lsn));
+	} else
+		memset(bp, 0, sizeof(*meta_lsn));
+	bp += sizeof(*meta_lsn);
+
+	uinttmp = (u_int32_t)last_free;
+	memcpy(bp, &uinttmp, sizeof(uinttmp));
+	bp += sizeof(uinttmp);
+
+	if (last_lsn != NULL) {
+		if (txnp != NULL) {
+			LOG *lp = dbenv->lg_handle->reginfo.primary;
+			if (LOG_COMPARE(last_lsn, &lp->lsn) >= 0 && (ret =
+			    __log_check_page_lsn(dbenv, dbp, last_lsn) != 0))
+				return (ret);
+		}
+		memcpy(bp, last_lsn, sizeof(*last_lsn));
+	} else
+		memset(bp, 0, sizeof(*last_lsn));
+	bp += sizeof(*last_lsn);
+
+	uinttmp = (u_int32_t)last_pgno;
+	memcpy(bp, &uinttmp, sizeof(uinttmp));
+	bp += sizeof(uinttmp);
+
+	if (list == NULL) {
+		zero = 0;
+		memcpy(bp, &zero, sizeof(u_int32_t));
+		bp += sizeof(u_int32_t);
+	} else {
+		memcpy(bp, &list->size, sizeof(list->size));
+		bp += sizeof(list->size);
+		memcpy(bp, list->data, list->size);
+		bp += list->size;
+	}
+
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+
+	if (is_durable || txnp == NULL) {
+		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
+			if (rlsnp != ret_lsnp)
+				 *ret_lsnp = *rlsnp;
+		}
+	} else {
+#ifdef DIAGNOSTIC
+		/*
+		 * Set the debug bit if we are going to log non-durable
+		 * transactions so they will be ignored by recovery.
+		 */
+		memcpy(lr->data, logrec.data, logrec.size);
+		rectype |= DB_debug_FLAG;
+		memcpy(logrec.data, &rectype, sizeof(rectype));
+
+		ret = __log_put(dbenv,
+		    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
+#else
+		ret = 0;
+#endif
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
+		LSN_NOT_LOGGED(*ret_lsnp);
+	}
+
+#ifdef LOG_DIAGNOSTIC
+	if (ret != 0)
+		(void)__db_pg_sort_print(dbenv,
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
+#endif
+
+#ifdef DIAGNOSTIC
+	__os_free(dbenv, logrec.data);
+#else
+	if (is_durable || txnp == NULL)
+		__os_free(dbenv, logrec.data);
+#endif
+	return (ret);
+}
+
+/*
+ * PUBLIC: int __db_pg_sort_read __P((DB_ENV *, void *, __db_pg_sort_args **));
+ */
+int
+__db_pg_sort_read(dbenv, recbuf, argpp)
+	DB_ENV *dbenv;
+	void *recbuf;
+	__db_pg_sort_args **argpp;
+{
+	__db_pg_sort_args *argp;
+	u_int32_t uinttmp;
+	u_int8_t *bp;
+	int ret;
+
+	if ((ret = __os_malloc(dbenv,
+	    sizeof(__db_pg_sort_args) + sizeof(DB_TXN), &argp)) != 0)
+		return (ret);
+	bp = recbuf;
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
+
+	memcpy(&argp->type, bp, sizeof(argp->type));
+	bp += sizeof(argp->type);
+
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
+
+	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
+	bp += sizeof(DB_LSN);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->fileid = (int32_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->meta = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&argp->meta_lsn, bp,  sizeof(argp->meta_lsn));
+	bp += sizeof(argp->meta_lsn);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->last_free = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memcpy(&argp->last_lsn, bp,  sizeof(argp->last_lsn));
+	bp += sizeof(argp->last_lsn);
+
+	memcpy(&uinttmp, bp, sizeof(uinttmp));
+	argp->last_pgno = (db_pgno_t)uinttmp;
+	bp += sizeof(uinttmp);
+
+	memset(&argp->list, 0, sizeof(argp->list));
+	memcpy(&argp->list.size, bp, sizeof(u_int32_t));
+	bp += sizeof(u_int32_t);
+	argp->list.data = bp;
+	bp += argp->list.size;
+
+	*argpp = argp;
+	return (0);
+}
+
 /*
  * PUBLIC: int __db_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
  * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
@@ -2903,5 +3533,8 @@ __db_init_recover(dbenv, dtabp, dtabsizep)
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __db_pg_init_recover, DB___db_pg_init)) != 0)
 		return (ret);
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __db_pg_sort_recover, DB___db_pg_sort)) != 0)
+		return (ret);
 	return (0);
 }
diff --git a/db/db/db_autop.c b/db/db/db_autop.c
index 8f97a7cf5..a212f5faa 100644
--- a/db/db/db_autop.c
+++ b/db/db/db_autop.c
@@ -2,13 +2,6 @@
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/crypto.h"
 #include "dbinc/db_page.h"
@@ -34,20 +27,18 @@ __db_addrem_print(dbenv, dbtp, lsnp, notused2, notused3)
 	int ch;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_addrem_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_addrem%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_addrem%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\topcode: %lu\n", (u_long)argp->opcode);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
@@ -89,20 +80,18 @@ __db_big_print(dbenv, dbtp, lsnp, notused2, notused3)
 	int ch;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_big_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_big%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_big%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\topcode: %lu\n", (u_long)argp->opcode);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
@@ -140,20 +129,18 @@ __db_ovref_print(dbenv, dbtp, lsnp, notused2, notused3)
 	__db_ovref_args *argp;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_ovref_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_ovref%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_ovref%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
 	(void)printf("\tadjust: %ld\n", (long)argp->adjust);
@@ -164,6 +151,49 @@ __db_ovref_print(dbenv, dbtp, lsnp, notused2, notused3)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __db_relink_42_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, void *));
+ */
+int
+__db_relink_42_print(dbenv, dbtp, lsnp, notused2, notused3)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops notused2;
+	void *notused3;
+{
+	__db_relink_42_args *argp;
+	int ret;
+
+	notused2 = DB_TXN_PRINT;
+	notused3 = NULL;
+
+	if ((ret = __db_relink_42_read(dbenv, dbtp->data, &argp)) != 0)
+		return (ret);
+	(void)printf(
+    "[%lu][%lu]__db_relink_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
+	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
+	    (u_long)argp->type,
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
+	(void)printf("\topcode: %lu\n", (u_long)argp->opcode);
+	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
+	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
+	(void)printf("\tlsn: [%lu][%lu]\n",
+	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
+	(void)printf("\tprev: %lu\n", (u_long)argp->prev);
+	(void)printf("\tlsn_prev: [%lu][%lu]\n",
+	    (u_long)argp->lsn_prev.file, (u_long)argp->lsn_prev.offset);
+	(void)printf("\tnext: %lu\n", (u_long)argp->next);
+	(void)printf("\tlsn_next: [%lu][%lu]\n",
+	    (u_long)argp->lsn_next.file, (u_long)argp->lsn_next.offset);
+	(void)printf("\n");
+	__os_free(dbenv, argp);
+	return (0);
+}
+
 /*
  * PUBLIC: int __db_debug_print __P((DB_ENV *, DBT *, DB_LSN *,
  * PUBLIC:     db_recops, void *));
@@ -181,20 +211,18 @@ __db_debug_print(dbenv, dbtp, lsnp, notused2, notused3)
 	int ch;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_debug_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_debug%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_debug%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\top: ");
 	for (i = 0; i < argp->op.size; i++) {
 		ch = ((u_int8_t *)argp->op.data)[i];
@@ -235,20 +263,18 @@ __db_noop_print(dbenv, dbtp, lsnp, notused2, notused3)
 	__db_noop_args *argp;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_noop_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_noop%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_noop%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
 	(void)printf("\tprevlsn: [%lu][%lu]\n",
@@ -258,6 +284,47 @@ __db_noop_print(dbenv, dbtp, lsnp, notused2, notused3)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __db_pg_alloc_42_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, void *));
+ */
+int
+__db_pg_alloc_42_print(dbenv, dbtp, lsnp, notused2, notused3)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops notused2;
+	void *notused3;
+{
+	__db_pg_alloc_42_args *argp;
+	int ret;
+
+	notused2 = DB_TXN_PRINT;
+	notused3 = NULL;
+
+	if ((ret = __db_pg_alloc_42_read(dbenv, dbtp->data, &argp)) != 0)
+		return (ret);
+	(void)printf(
+    "[%lu][%lu]__db_pg_alloc_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
+	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
+	    (u_long)argp->type,
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
+	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
+	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
+	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
+	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
+	(void)printf("\tpage_lsn: [%lu][%lu]\n",
+	    (u_long)argp->page_lsn.file, (u_long)argp->page_lsn.offset);
+	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
+	(void)printf("\tptype: %lu\n", (u_long)argp->ptype);
+	(void)printf("\tnext: %lu\n", (u_long)argp->next);
+	(void)printf("\n");
+	__os_free(dbenv, argp);
+	return (0);
+}
+
 /*
  * PUBLIC: int __db_pg_alloc_print __P((DB_ENV *, DBT *, DB_LSN *,
  * PUBLIC:     db_recops, void *));
@@ -273,20 +340,18 @@ __db_pg_alloc_print(dbenv, dbtp, lsnp, notused2, notused3)
 	__db_pg_alloc_args *argp;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_pg_alloc_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_pg_alloc%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_pg_alloc%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
 	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
@@ -302,6 +367,52 @@ __db_pg_alloc_print(dbenv, dbtp, lsnp, notused2, notused3)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __db_pg_free_42_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, void *));
+ */
+int
+__db_pg_free_42_print(dbenv, dbtp, lsnp, notused2, notused3)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops notused2;
+	void *notused3;
+{
+	__db_pg_free_42_args *argp;
+	u_int32_t i;
+	int ch;
+	int ret;
+
+	notused2 = DB_TXN_PRINT;
+	notused3 = NULL;
+
+	if ((ret = __db_pg_free_42_read(dbenv, dbtp->data, &argp)) != 0)
+		return (ret);
+	(void)printf(
+    "[%lu][%lu]__db_pg_free_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
+	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
+	    (u_long)argp->type,
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
+	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
+	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
+	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
+	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
+	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
+	(void)printf("\theader: ");
+	for (i = 0; i < argp->header.size; i++) {
+		ch = ((u_int8_t *)argp->header.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\tnext: %lu\n", (u_long)argp->next);
+	(void)printf("\n");
+	__os_free(dbenv, argp);
+	return (0);
+}
+
 /*
  * PUBLIC: int __db_pg_free_print __P((DB_ENV *, DBT *, DB_LSN *,
  * PUBLIC:     db_recops, void *));
@@ -319,20 +430,18 @@ __db_pg_free_print(dbenv, dbtp, lsnp, notused2, notused3)
 	int ch;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_pg_free_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_pg_free%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_pg_free%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
 	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
@@ -366,20 +475,70 @@ __db_cksum_print(dbenv, dbtp, lsnp, notused2, notused3)
 	__db_cksum_args *argp;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_cksum_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_cksum%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_cksum%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
+	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
+	    (u_long)argp->type,
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
+	(void)printf("\n");
+	__os_free(dbenv, argp);
+	return (0);
+}
+
+/*
+ * PUBLIC: int __db_pg_freedata_42_print __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, void *));
+ */
+int
+__db_pg_freedata_42_print(dbenv, dbtp, lsnp, notused2, notused3)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops notused2;
+	void *notused3;
+{
+	__db_pg_freedata_42_args *argp;
+	u_int32_t i;
+	int ch;
+	int ret;
+
+	notused2 = DB_TXN_PRINT;
+	notused3 = NULL;
+
+	if ((ret = __db_pg_freedata_42_read(dbenv, dbtp->data, &argp)) != 0)
+		return (ret);
+	(void)printf(
+    "[%lu][%lu]__db_pg_freedata_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
+	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
+	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
+	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
+	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
+	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
+	(void)printf("\theader: ");
+	for (i = 0; i < argp->header.size; i++) {
+		ch = ((u_int8_t *)argp->header.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\tnext: %lu\n", (u_long)argp->next);
+	(void)printf("\tdata: ");
+	for (i = 0; i < argp->data.size; i++) {
+		ch = ((u_int8_t *)argp->data.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
 	(void)printf("\n");
 	__os_free(dbenv, argp);
 	return (0);
@@ -402,20 +561,18 @@ __db_pg_freedata_print(dbenv, dbtp, lsnp, notused2, notused3)
 	int ch;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_pg_freedata_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_pg_freedata%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_pg_freedata%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
 	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
@@ -455,20 +612,18 @@ __db_pg_prepare_print(dbenv, dbtp, lsnp, notused2, notused3)
 	__db_pg_prepare_args *argp;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_pg_prepare_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_pg_prepare%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_pg_prepare%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
 	(void)printf("\n");
@@ -493,20 +648,18 @@ __db_pg_new_print(dbenv, dbtp, lsnp, notused2, notused3)
 	int ch;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_pg_new_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_pg_new%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_pg_new%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
 	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
@@ -541,20 +694,18 @@ __db_pg_init_print(dbenv, dbtp, lsnp, notused2, notused3)
 	int ch;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __db_pg_init_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__db_pg_init%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__db_pg_init%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
 	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
 	(void)printf("\theader: ");
@@ -574,6 +725,54 @@ __db_pg_init_print(dbenv, dbtp, lsnp, notused2, notused3)
 	return (0);
 }
 
+/*
+ * PUBLIC: int __db_pg_sort_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, void *));
+ */
+int
+__db_pg_sort_print(dbenv, dbtp, lsnp, notused2, notused3)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops notused2;
+	void *notused3;
+{
+	__db_pg_sort_args *argp;
+	u_int32_t i;
+	int ch;
+	int ret;
+
+	notused2 = DB_TXN_PRINT;
+	notused3 = NULL;
+
+	if ((ret = __db_pg_sort_read(dbenv, dbtp->data, &argp)) != 0)
+		return (ret);
+	(void)printf(
+    "[%lu][%lu]__db_pg_sort%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
+	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
+	    (u_long)argp->type,
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
+	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
+	(void)printf("\tmeta: %lu\n", (u_long)argp->meta);
+	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
+	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
+	(void)printf("\tlast_free: %lu\n", (u_long)argp->last_free);
+	(void)printf("\tlast_lsn: [%lu][%lu]\n",
+	    (u_long)argp->last_lsn.file, (u_long)argp->last_lsn.offset);
+	(void)printf("\tlast_pgno: %lu\n", (u_long)argp->last_pgno);
+	(void)printf("\tlist: ");
+	for (i = 0; i < argp->list.size; i++) {
+		ch = ((u_int8_t *)argp->list.data)[i];
+		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
+	}
+	(void)printf("\n");
+	(void)printf("\n");
+	__os_free(dbenv, argp);
+	return (0);
+}
+
 /*
  * PUBLIC: int __db_init_print __P((DB_ENV *, int (***)(DB_ENV *,
  * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
@@ -622,5 +821,8 @@ __db_init_print(dbenv, dtabp, dtabsizep)
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __db_pg_init_print, DB___db_pg_init)) != 0)
 		return (ret);
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __db_pg_sort_print, DB___db_pg_sort)) != 0)
+		return (ret);
 	return (0);
 }
diff --git a/db/db/db_cam.c b/db/db/db_cam.c
index 075765072..af88d955e 100644
--- a/db/db/db_cam.c
+++ b/db/db/db_cam.c
@@ -1,57 +1,54 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2000-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2000-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_cam.c,v 11.156 2004/09/28 18:07:32 ubell Exp $
+ * $Id: db_cam.c,v 12.43 2006/08/24 14:45:15 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/btree.h"
 #include "dbinc/hash.h"
 #include "dbinc/lock.h"
 #include "dbinc/mp.h"
 #include "dbinc/qam.h"
+#include "dbinc/txn.h"
 
 static int __db_buildpartial __P((DB *, DBT *, DBT *, DBT *));
 static int __db_c_cleanup __P((DBC *, DBC *, int));
+static int __db_c_del_oldskey __P((DB *, DBC *, DBT *, DBT *, DBT *));
 static int __db_c_del_secondary __P((DBC *));
 static int __db_c_pget_recno __P((DBC *, DBT *, DBT *, u_int32_t));
+static int __db_s_count __P((DB *));
 static int __db_wrlock_err __P((DB_ENV *));
 
-#define	CDB_LOCKING_INIT(dbp, dbc)					\
+#define	CDB_LOCKING_INIT(dbenv, dbc)					\
 	/*								\
 	 * If we are running CDB, this had better be either a write	\
 	 * cursor or an immediate writer.  If it's a regular writer,	\
 	 * that means we have an IWRITE lock and we need to upgrade	\
 	 * it to a write lock.						\
 	 */								\
-	if (CDB_LOCKING((dbp)->dbenv)) {				\
+	if (CDB_LOCKING(dbenv)) {					\
 		if (!F_ISSET(dbc, DBC_WRITECURSOR | DBC_WRITER))	\
-			return (__db_wrlock_err(dbp->dbenv));		\
+			return (__db_wrlock_err(dbenv));		\
 									\
 		if (F_ISSET(dbc, DBC_WRITECURSOR) &&			\
-		    (ret = __lock_get((dbp)->dbenv,			\
+		    (ret = __lock_get(dbenv,				\
 		    (dbc)->locker, DB_LOCK_UPGRADE, &(dbc)->lock_dbt,	\
 		    DB_LOCK_WRITE, &(dbc)->mylock)) != 0)		\
 			return (ret);					\
 	}
-#define	CDB_LOCKING_DONE(dbp, dbc)					\
+#define	CDB_LOCKING_DONE(dbenv, dbc)					\
 	/* Release the upgraded lock. */				\
 	if (F_ISSET(dbc, DBC_WRITECURSOR))				\
 		(void)__lock_downgrade(					\
-		    (dbp)->dbenv, &(dbc)->mylock, DB_LOCK_IWRITE, 0);
+		    dbenv, &(dbc)->mylock, DB_LOCK_IWRITE, 0);
+
 /*
  * __db_c_close --
  *	DBC->c_close.
@@ -66,6 +63,7 @@ __db_c_close(dbc)
 	DBC *opd;
 	DBC_INTERNAL *cp;
 	DB_ENV *dbenv;
+	DB_TXN *txn;
 	int ret, t_ret;
 
 	dbp = dbc->dbp;
@@ -85,16 +83,18 @@ __db_c_close(dbc)
 	 * access specific cursor close routine, btree depends on having that
 	 * order of operations.
 	 */
-	MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
+	MUTEX_LOCK(dbenv, dbp->mutex);
 
 	if (opd != NULL) {
+		DB_ASSERT(dbenv, F_ISSET(opd, DBC_ACTIVE));
 		F_CLR(opd, DBC_ACTIVE);
 		TAILQ_REMOVE(&dbp->active_queue, opd, links);
 	}
+	DB_ASSERT(dbenv, F_ISSET(dbc, DBC_ACTIVE));
 	F_CLR(dbc, DBC_ACTIVE);
 	TAILQ_REMOVE(&dbp->active_queue, dbc, links);
 
-	MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp);
+	MUTEX_UNLOCK(dbenv, dbp->mutex);
 
 	/* Call the access specific cursor close routine. */
 	if ((t_ret =
@@ -121,19 +121,23 @@ __db_c_close(dbc)
 			memset(&opd->mylock, 0, sizeof(opd->mylock));
 	}
 
-	if (dbc->txn != NULL)
-		dbc->txn->cursors--;
+	if ((txn = dbc->txn) != NULL)
+		txn->cursors--;
 
 	/* Move the cursor(s) to the free queue. */
-	MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
+	MUTEX_LOCK(dbenv, dbp->mutex);
 	if (opd != NULL) {
-		if (dbc->txn != NULL)
-			dbc->txn->cursors--;
+		if (txn != NULL)
+			txn->cursors--;
 		TAILQ_INSERT_TAIL(&dbp->free_queue, opd, links);
 		opd = NULL;
 	}
 	TAILQ_INSERT_TAIL(&dbp->free_queue, dbc, links);
-	MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp);
+	MUTEX_UNLOCK(dbenv, dbp->mutex);
+
+	if (txn != NULL && F_ISSET(txn, TXN_PRIVATE) && txn->cursors == 0 &&
+	    (t_ret = __txn_commit(txn, 0)) != 0 && ret == 0)
+		ret = t_ret;
 
 	return (ret);
 }
@@ -156,9 +160,9 @@ __db_c_destroy(dbc)
 	dbenv = dbp->dbenv;
 
 	/* Remove the cursor from the free queue. */
-	MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
+	MUTEX_LOCK(dbenv, dbp->mutex);
 	TAILQ_REMOVE(&dbp->free_queue, dbc, links);
-	MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp);
+	MUTEX_UNLOCK(dbenv, dbp->mutex);
 
 	/* Free up allocated memory. */
 	if (dbc->my_rskey.data != NULL)
@@ -176,7 +180,8 @@ __db_c_destroy(dbc)
 	 */
 	if (LOCKING_ON(dbenv) &&
 	    F_ISSET(dbc, DBC_OWN_LID) &&
-	    (t_ret = __lock_id_free(dbenv, dbc->lid)) != 0 && ret == 0)
+	    (t_ret = __lock_id_free(dbenv,
+	    ((DB_LOCKER *)dbc->lref)->id)) != 0 && ret == 0)
 		ret = t_ret;
 
 	__os_free(dbenv, dbc);
@@ -243,9 +248,11 @@ __db_c_del(dbc, flags)
 {
 	DB *dbp;
 	DBC *opd;
+	DB_ENV *dbenv;
 	int ret, t_ret;
 
 	dbp = dbc->dbp;
+	dbenv = dbp->dbenv;
 
 	/*
 	 * Cursor Cleanup Note:
@@ -255,7 +262,7 @@ __db_c_del(dbc, flags)
 	 * underlying functions.
 	 */
 
-	CDB_LOCKING_INIT(dbp, dbc);
+	CDB_LOCKING_INIT(dbenv, dbc);
 
 	/*
 	 * If we're a secondary index, and DB_UPDATE_SECONDARY isn't set
@@ -298,7 +305,7 @@ __db_c_del(dbc, flags)
 	 * to explicitly downgrade this lock.  The closed cursor
 	 * may only have had a read lock.
 	 */
-	if (F_ISSET(dbc->dbp, DB_AM_DIRTY) &&
+	if (F_ISSET(dbc->dbp, DB_AM_READ_UNCOMMITTED) &&
 	    dbc->internal->lock_mode == DB_LOCK_WRITE) {
 		if ((t_ret =
 		    __TLPUT(dbc, dbc->internal->lock)) != 0 && ret == 0)
@@ -307,7 +314,7 @@ __db_c_del(dbc, flags)
 			dbc->internal->lock_mode = DB_LOCK_WWRITE;
 	}
 
-done:	CDB_LOCKING_DONE(dbp, dbc);
+done:	CDB_LOCKING_DONE(dbenv, dbc);
 
 	return (ret);
 }
@@ -413,8 +420,8 @@ __db_c_idup(dbc_orig, dbcp, flags)
 	}
 
 	/* Copy the locking flags to the new cursor. */
-	F_SET(dbc_n,
-	    F_ISSET(dbc_orig, DBC_WRITECURSOR | DBC_DIRTY_READ | DBC_DEGREE_2));
+	F_SET(dbc_n, F_ISSET(dbc_orig,
+	    DBC_READ_COMMITTED | DBC_READ_UNCOMMITTED | DBC_WRITECURSOR));
 
 	/*
 	 * If we're in CDB and this isn't an offpage dup cursor, then
@@ -502,11 +509,16 @@ __db_c_get(dbc_arg, key, data, flags)
 	DB *dbp;
 	DBC *dbc, *dbc_n, *opd;
 	DBC_INTERNAL *cp, *cp_n;
+	DB_ENV *dbenv;
 	DB_MPOOLFILE *mpf;
 	db_pgno_t pgno;
-	u_int32_t multi, tmp_dirty, tmp_flags, tmp_rmw;
+	u_int32_t multi, orig_ulen, tmp_flags, tmp_read_uncommitted, tmp_rmw;
 	u_int8_t type;
-	int ret, t_ret;
+	int key_small, ret, t_ret;
+
+	COMPQUIET(orig_ulen, 0);
+
+	key_small = 0;
 
 	/*
 	 * Cursor Cleanup Note:
@@ -518,6 +530,7 @@ __db_c_get(dbc_arg, key, data, flags)
 	 * functions.
 	 */
 	dbp = dbc_arg->dbp;
+	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
 	dbc_n = NULL;
 	opd = NULL;
@@ -526,8 +539,10 @@ __db_c_get(dbc_arg, key, data, flags)
 	tmp_rmw = LF_ISSET(DB_RMW);
 	LF_CLR(DB_RMW);
 
-	tmp_dirty = LF_ISSET(DB_DIRTY_READ);
-	LF_CLR(DB_DIRTY_READ);
+	tmp_read_uncommitted =
+	    LF_ISSET(DB_READ_UNCOMMITTED) &&
+	    !F_ISSET(dbc_arg, DBC_READ_UNCOMMITTED);
+	LF_CLR(DB_READ_UNCOMMITTED);
 
 	multi = LF_ISSET(DB_MULTIPLE|DB_MULTIPLE_KEY);
 	LF_CLR(DB_MULTIPLE|DB_MULTIPLE_KEY);
@@ -539,18 +554,31 @@ __db_c_get(dbc_arg, key, data, flags)
 	if (flags == DB_GET_RECNO) {
 		if (tmp_rmw)
 			F_SET(dbc_arg, DBC_RMW);
-		if (tmp_dirty)
-			F_SET(dbc_arg, DBC_DIRTY_READ);
+		if (tmp_read_uncommitted)
+			F_SET(dbc_arg, DBC_READ_UNCOMMITTED);
 		ret = __bam_c_rget(dbc_arg, data);
 		if (tmp_rmw)
 			F_CLR(dbc_arg, DBC_RMW);
-		if (tmp_dirty)
-			F_CLR(dbc_arg, DBC_DIRTY_READ);
+		if (tmp_read_uncommitted)
+			F_CLR(dbc_arg, DBC_READ_UNCOMMITTED);
 		return (ret);
 	}
 
 	if (flags == DB_CONSUME || flags == DB_CONSUME_WAIT)
-		CDB_LOCKING_INIT(dbp, dbc_arg);
+		CDB_LOCKING_INIT(dbenv, dbc_arg);
+
+	/*
+	 * Don't return the key or data if it was passed to us.  Ignore the
+	 * application's DBT if there is a custom comparator: it might be a
+	 * partial key containing only the unique identifier.
+	 */
+	if ((flags == DB_GET_BOTH || flags == DB_GET_BOTH_RANGE ||
+	    flags == DB_SET) &&
+	    ((BTREE *)dbp->bt_internal)->bt_compare == __bam_defcmp)
+		F_SET(key, DB_DBT_ISSET);
+
+	if (flags == DB_GET_BOTH && dbp->dup_compare == NULL)
+		F_SET(data, DB_DBT_ISSET);
 
 	/*
 	 * If we have an off-page duplicates cursor, and the operation applies
@@ -568,12 +596,13 @@ __db_c_get(dbc_arg, key, data, flags)
 	    (flags == DB_CURRENT || flags == DB_GET_BOTHC ||
 	    flags == DB_NEXT || flags == DB_NEXT_DUP || flags == DB_PREV)) {
 		if (tmp_rmw && (ret = dbc_arg->c_am_writelock(dbc_arg)) != 0)
-			return (ret);
-		if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITION)) != 0)
-			return (ret);
+			goto err;
+		if (F_ISSET(dbc_arg, DBC_TRANSIENT))
+			opd = cp->opd;
+		else if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITION)) != 0)
+			goto err;
 
-		switch (ret =
-		    opd->c_am_get(opd, key, data, flags, NULL)) {
+		switch (ret = opd->c_am_get(opd, key, data, flags, NULL)) {
 		case 0:
 			goto done;
 		case DB_NOTFOUND:
@@ -586,12 +615,18 @@ __db_c_get(dbc_arg, key, data, flags)
 				if ((ret = __db_c_close(opd)) != 0)
 					goto err;
 				opd = NULL;
+				if (F_ISSET(dbc_arg, DBC_TRANSIENT))
+					cp->opd = NULL;
 				break;
 			}
 			goto err;
 		default:
 			goto err;
 		}
+	} else if (cp->opd != NULL && F_ISSET(dbc_arg, DBC_TRANSIENT)) {
+		if ((ret = __db_c_close(cp->opd)) != 0)
+			goto err;
+		cp->opd = NULL;
 	}
 
 	/*
@@ -613,8 +648,8 @@ __db_c_get(dbc_arg, key, data, flags)
 		break;
 	}
 
-	if (tmp_dirty)
-		F_SET(dbc_arg, DBC_DIRTY_READ);
+	if (tmp_read_uncommitted)
+		F_SET(dbc_arg, DBC_READ_UNCOMMITTED);
 
 	/*
 	 * If this cursor is going to be closed immediately, we don't
@@ -624,8 +659,8 @@ __db_c_get(dbc_arg, key, data, flags)
 		dbc_n = dbc_arg;
 	else {
 		ret = __db_c_idup(dbc_arg, &dbc_n, tmp_flags);
-		if (tmp_dirty)
-			F_CLR(dbc_arg, DBC_DIRTY_READ);
+		if (tmp_read_uncommitted)
+			F_CLR(dbc_arg, DBC_READ_UNCOMMITTED);
 
 		if (ret != 0)
 			goto err;
@@ -654,8 +689,8 @@ __db_c_get(dbc_arg, key, data, flags)
 	ret = dbc_n->c_am_get(dbc_n, key, data, flags, &pgno);
 	if (tmp_rmw)
 		F_CLR(dbc_n, DBC_RMW);
-	if (tmp_dirty)
-		F_CLR(dbc_arg, DBC_DIRTY_READ);
+	if (tmp_read_uncommitted)
+		F_CLR(dbc_arg, DBC_READ_UNCOMMITTED);
 	F_CLR(dbc_n, DBC_MULTIPLE|DBC_MULTIPLE_KEY);
 	if (ret != 0)
 		goto err;
@@ -691,8 +726,7 @@ __db_c_get(dbc_arg, key, data, flags)
 			tmp_flags = flags;
 			break;
 		default:
-			ret =
-			    __db_unknown_flag(dbp->dbenv, "__db_c_get", flags);
+			ret = __db_unknown_flag(dbenv, "__db_c_get", flags);
 			goto err;
 		}
 		if ((ret = cp_n->opd->c_am_get(
@@ -716,13 +750,28 @@ done:	/*
 	 */
 	cp_n = dbc_n == NULL ? dbc_arg->internal : dbc_n->internal;
 	if (!F_ISSET(key, DB_DBT_ISSET)) {
-		if (cp_n->page == NULL && (ret =
-		    __memp_fget(mpf, &cp_n->pgno, 0, &cp_n->page)) != 0)
+		if (cp_n->page == NULL && (ret = __memp_fget(mpf, &cp_n->pgno,
+		    dbc_arg->txn, 0, &cp_n->page)) != 0)
 			goto err;
 
-		if ((ret = __db_ret(dbp, cp_n->page, cp_n->indx,
-		    key, &dbc_arg->rkey->data, &dbc_arg->rkey->ulen)) != 0)
-			goto err;
+		if ((ret = __db_ret(dbp, dbc_arg->txn,
+		    cp_n->page, cp_n->indx, key,
+		    &dbc_arg->rkey->data, &dbc_arg->rkey->ulen)) != 0) {
+			/*
+			 * If the key DBT is too small, we still want to return
+			 * the size of the data.  Otherwise applications are
+			 * forced to check each one with a separate call.  We
+			 * don't want to copy the data, so we set the ulen to
+			 * zero before calling __db_ret.
+			 */
+			if (ret == DB_BUFFER_SMALL &&
+			    F_ISSET(data, DB_DBT_USERMEM)) {
+				key_small = 1;
+				orig_ulen = data->ulen;
+				data->ulen = 0;
+			} else
+				goto err;
+		}
 	}
 	if (multi != 0) {
 		/*
@@ -757,7 +806,7 @@ done:	/*
 		 * key.
 		 */
 		if (opd != NULL) {
-			DB_ASSERT(cp_n->opd == NULL);
+			DB_ASSERT(dbenv, cp_n->opd == NULL);
 			cp_n->opd = opd;
 			opd = NULL;
 		}
@@ -774,8 +823,14 @@ done:	/*
 		ret = dbc_n->c_am_bulk(dbc_n, data, flags | multi);
 	} else if (!F_ISSET(data, DB_DBT_ISSET)) {
 		dbc = opd != NULL ? opd : cp_n->opd != NULL ? cp_n->opd : dbc_n;
-		type = TYPE(dbc->internal->page);
-		ret = __db_ret(dbp, dbc->internal->page, dbc->internal->indx +
+		cp = dbc->internal;
+		if (cp->page == NULL &&
+		    (ret = __memp_fget(mpf, &cp->pgno, dbc->txn,
+			0, &cp->page)) != 0)
+			goto err;
+
+		type = TYPE(cp->page);
+		ret = __db_ret(dbp, dbc->txn, cp->page, cp->indx +
 		    (type == P_LBTREE || type == P_HASH ? O_INDX : 0),
 		    data, &dbc_arg->rdata->data, &dbc_arg->rdata->ulen);
 	}
@@ -793,11 +848,11 @@ err:	/* Don't pass DB_DBT_ISSET back to application level, error or no. */
 		 * about the referencing page or cursor we need
 		 * to peek at the OPD cursor and get the lock here.
 		 */
-		if (F_ISSET(dbc_arg->dbp, DB_AM_DIRTY) &&
+		if (F_ISSET(dbc_arg->dbp, DB_AM_READ_UNCOMMITTED) &&
 		     F_ISSET((BTREE_CURSOR *)
 		     dbc_arg->internal->opd->internal, C_DELETED))
 			if ((t_ret =
-			    dbc_arg->c_am_writelock(dbc_arg)) != 0 && ret != 0)
+			    dbc_arg->c_am_writelock(dbc_arg)) != 0 && ret == 0)
 				ret = t_ret;
 		if ((t_ret = __db_c_cleanup(
 		    dbc_arg->internal->opd, opd, ret)) != 0 && ret == 0)
@@ -805,11 +860,18 @@ err:	/* Don't pass DB_DBT_ISSET back to application level, error or no. */
 
 	}
 
-	if ((t_ret = __db_c_cleanup(dbc_arg, dbc_n, ret)) != 0 && ret == 0)
+	if (key_small) {
+		data->ulen = orig_ulen;
+		if (ret == 0)
+			ret = DB_BUFFER_SMALL;
+	}
+
+	if ((t_ret = __db_c_cleanup(dbc_arg, dbc_n, ret)) != 0 &&
+	    (ret == 0 || ret == DB_BUFFER_SMALL))
 		ret = t_ret;
 
 	if (flags == DB_CONSUME || flags == DB_CONSUME_WAIT)
-		CDB_LOCKING_DONE(dbp, dbc_arg);
+		CDB_LOCKING_DONE(dbenv, dbc_arg);
 	return (ret);
 }
 
@@ -828,10 +890,11 @@ __db_c_put(dbc_arg, key, data, flags)
 	DB_ENV *dbenv;
 	DB *dbp, *sdbp;
 	DBC *dbc_n, *oldopd, *opd, *sdbc, *pdbc;
-	DBT olddata, oldpkey, oldskey, newdata, pkey, skey, temppkey, tempskey;
+	DBT olddata, oldpkey, newdata, pkey, temppkey, tempskey;
+	DBT *all_skeys, *skeyp;
 	db_pgno_t pgno;
-	int cmp, have_oldrec, ispartial, nodel, re_pad, ret, rmw, t_ret;
-	u_int32_t re_len, size, tmp_flags;
+	int cmp, have_oldrec, ispartial, nodel, re_pad, ret, s_count, t_ret;
+	u_int32_t re_len, rmw, size, tmp_flags;
 
 	/*
 	 * Cursor Cleanup Note:
@@ -846,8 +909,9 @@ __db_c_put(dbc_arg, key, data, flags)
 	dbenv = dbp->dbenv;
 	sdbp = NULL;
 	pdbc = dbc_n = NULL;
+	all_skeys = NULL;
 	memset(&newdata, 0, sizeof(DBT));
-	ret = 0;
+	ret = s_count = 0;
 
 	/*
 	 * We do multiple cursor operations in some cases and subsequently
@@ -866,7 +930,7 @@ __db_c_put(dbc_arg, key, data, flags)
 	if (flags == DB_UPDATE_SECONDARY)
 		flags = DB_KEYLAST;
 
-	CDB_LOCKING_INIT(dbp, dbc_arg);
+	CDB_LOCKING_INIT(dbenv, dbc_arg);
 
 	/*
 	 * Check to see if we are a primary and have secondary indices.
@@ -934,6 +998,10 @@ __db_c_put(dbc_arg, key, data, flags)
 	 *    the old secondary in each.
 	 */
 	memset(&pkey, 0, sizeof(DBT));
+	s_count = __db_s_count(dbp);
+	if ((ret = __os_calloc(
+	    dbenv, (u_int)s_count, sizeof(DBT), &all_skeys)) != 0)
+		goto err;
 	have_oldrec = nodel = 0;
 
 	/*
@@ -942,8 +1010,8 @@ __db_c_put(dbc_arg, key, data, flags)
 	 * should have been caught by the checking routine, but
 	 * add a sprinkling of paranoia.
 	 */
-	DB_ASSERT(flags == DB_CURRENT ||
-	    flags == DB_KEYFIRST || flags == DB_KEYLAST);
+	DB_ASSERT(dbenv, flags == DB_CURRENT || flags == DB_KEYFIRST ||
+	      flags == DB_KEYLAST || flags == DB_NOOVERWRITE);
 
 	/*
 	 * We'll want to use DB_RMW in a few places, but it's only legal
@@ -972,11 +1040,7 @@ __db_c_put(dbc_arg, key, data, flags)
 
 		have_oldrec = 1; /* We've looked for the old record. */
 	} else {
-		/*
-		 * Set pkey so we can use &pkey everywhere instead of key.
-		 * If DB_CURRENT is set and there is a key at the current
-		 * location, pkey will be overwritten before it's used.
-		 */
+		/* Set pkey so we can use &pkey everywhere instead of key.  */
 		pkey.data = key->data;
 		pkey.size = key->size;
 	}
@@ -995,7 +1059,7 @@ __db_c_put(dbc_arg, key, data, flags)
 				goto err;
 
 			/* We should have gotten DB_CURRENT in step 1. */
-			DB_ASSERT(flags != DB_CURRENT);
+			DB_ASSERT(dbenv, flags != DB_CURRENT);
 
 			ret = __db_c_get(pdbc, &pkey, &olddata, rmw | DB_SET);
 			if (ret == DB_KEYEMPTY || ret == DB_NOTFOUND) {
@@ -1011,8 +1075,10 @@ __db_c_put(dbc_arg, key, data, flags)
 		}
 
 		/*
-		 * Now build the new datum from olddata and the partial
-		 * data we were given.
+		 * Now build the new datum from olddata and the partial data we
+		 * were given.  It's okay to do this if no record was returned
+		 * above: a partial put on an empty record is allowed, if a
+		 * little strange.  The data is zero-padded.
 		 */
 		if ((ret =
 		    __db_buildpartial(dbp, &olddata, data, &newdata)) != 0)
@@ -1071,15 +1137,25 @@ __db_c_put(dbc_arg, key, data, flags)
 	 * Note that __db_s_first and __db_s_next will take care of
 	 * thread-locking and refcounting issues.
 	 */
-	for (sdbp = __db_s_first(dbp);
-	    sdbp != NULL && ret == 0; ret = __db_s_next(&sdbp)) {
+	for (ret = __db_s_first(dbp, &sdbp), skeyp = all_skeys;
+	    sdbp != NULL && ret == 0;
+	    ret = __db_s_next(&sdbp), ++skeyp) {
+		DB_ASSERT(dbenv, skeyp - all_skeys < s_count);
+		/*
+		 * Don't process this secondary if the key is immutable and we
+		 * know that the old record exists.  This optimization can't be
+		 * used if we have not checked for the old record yet.
+		 */
+		if (have_oldrec && !nodel &&
+		    FLD_ISSET(sdbp->s_assoc_flags, DB_ASSOC_IMMUTABLE_KEY))
+			continue;
+
 		/*
 		 * Call the callback for this secondary, to get the
 		 * appropriate secondary key.
 		 */
-		memset(&skey, 0, sizeof(DBT));
 		if ((ret = sdbp->s_callback(sdbp,
-		    &pkey, ispartial ? &newdata : data, &skey)) != 0) {
+		    &pkey, ispartial ? &newdata : data, skeyp)) != 0) {
 			if (ret == DB_DONOTINDEX)
 				/*
 				 * The callback returned a null value--don't
@@ -1088,7 +1164,24 @@ __db_c_put(dbc_arg, key, data, flags)
 				 * any necessary deletes in step 5.
 				 */
 				continue;
-			else
+			goto err;
+		}
+
+		/*
+		 * If we have the old record, we can generate and remove the
+		 * old secondary key now.  We can also skip the secondary put
+		 * if there is no change.
+		 */
+		if (have_oldrec) {
+			/*
+			 * Mark that the secondary key is set -- that is, the
+			 * callback returned 0 rather than DB_DONOTINDEX.
+			 */
+			F_SET(skeyp, DB_DBT_ISSET);
+			if ((ret = __db_c_del_oldskey(sdbp, dbc_arg,
+			    skeyp, &pkey, &olddata)) == DB_KEYEXIST)
+				continue;
+			else if (ret != 0)
 				goto err;
 		}
 
@@ -1114,10 +1207,18 @@ __db_c_put(dbc_arg, key, data, flags)
 		 * really have a lock.
 		 */
 		if (CDB_LOCKING(dbenv)) {
-			DB_ASSERT(sdbc->mylock.off == LOCK_INVALID);
+			DB_ASSERT(dbenv, sdbc->mylock.off == LOCK_INVALID);
 			F_SET(sdbc, DBC_WRITER);
 		}
 
+		/*
+		 * Swap the primary key to the byte order of this secondary, if
+		 * necessary.  By doing this now, we can compare directly
+		 * against the data already in the secondary without having to
+		 * swap it after reading.
+		 */
+		SWAP_IF_NEEDED(sdbp, &pkey);
+
 		/*
 		 * There are three cases here--
 		 * 1) The secondary supports sorted duplicates.
@@ -1152,24 +1253,24 @@ __db_c_put(dbc_arg, key, data, flags)
 			memset(&oldpkey, 0, sizeof(DBT));
 			F_SET(&oldpkey, DB_DBT_MALLOC);
 			ret = __db_c_get(sdbc,
-			    &skey, &oldpkey, rmw | DB_SET);
+			    skeyp, &oldpkey, rmw | DB_SET);
 			if (ret == 0) {
 				cmp = __bam_defcmp(sdbp, &oldpkey, &pkey);
 				__os_ufree(dbenv, oldpkey.data);
 				if (cmp != 0) {
-					__db_err(dbenv, "%s%s",
+					__db_errx(dbenv, "%s%s",
 			    "Put results in a non-unique secondary key in an ",
 			    "index not configured to support duplicates");
 					ret = EINVAL;
-					goto skipput;
 				}
-			} else if (ret != DB_NOTFOUND && ret != DB_KEYEMPTY)
+			}
+			if (ret != DB_NOTFOUND && ret != DB_KEYEMPTY)
 				goto skipput;
 		} else if (!F_ISSET(sdbp, DB_AM_DUPSORT)) {
 			/* Case 2. */
 			memset(&tempskey, 0, sizeof(DBT));
-			tempskey.data = skey.data;
-			tempskey.size = skey.size;
+			tempskey.data = skeyp->data;
+			tempskey.size = skeyp->size;
 			memset(&temppkey, 0, sizeof(DBT));
 			temppkey.data = pkey.data;
 			temppkey.size = pkey.size;
@@ -1179,7 +1280,7 @@ __db_c_put(dbc_arg, key, data, flags)
 				goto skipput;
 		}
 
-		ret = __db_c_put(sdbc, &skey, &pkey, DB_UPDATE_SECONDARY);
+		ret = __db_c_put(sdbc, skeyp, &pkey, DB_UPDATE_SECONDARY);
 
 		/*
 		 * We don't know yet whether this was a put-overwrite that
@@ -1189,115 +1290,75 @@ __db_c_put(dbc_arg, key, data, flags)
 		if (ret == DB_KEYEXIST)
 			ret = 0;
 
-skipput:	FREE_IF_NEEDED(sdbp, &skey)
+skipput:	/* Make sure the primary key is back in native byte-order. */
+		SWAP_IF_NEEDED(sdbp, &pkey);
 
 		if ((t_ret = __db_c_close(sdbc)) != 0 && ret == 0)
 			ret = t_ret;
 
 		if (ret != 0)
 			goto err;
+
+		/*
+		 * Mark that we have a key for this secondary so we can check
+		 * it later before deleting the old one.  We can't set it
+		 * earlier or it would be cleared in the calls above.
+		 */
+		F_SET(skeyp, DB_DBT_ISSET);
+
 	}
 	if (ret != 0)
 		goto err;
 
+	/*
+	 * If we've already got the old primary key/data pair, the secondary
+	 * updates are already done.
+	 */
+	if (have_oldrec)
+		goto skip_s_update;
+
 	/* If still necessary, go get the old primary key/data.  (Step 4.) */
-	if (!have_oldrec) {
-		/* See the comments in step 2.  This is real familiar. */
-		if ((ret = __db_c_idup(dbc_arg, &pdbc, 0)) != 0)
-			goto err;
-		DB_ASSERT(flags != DB_CURRENT);
-		pkey.data = key->data;
-		pkey.size = key->size;
-		ret = __db_c_get(pdbc, &pkey, &olddata, rmw | DB_SET);
-		if (ret == DB_KEYEMPTY || ret == DB_NOTFOUND) {
-			nodel = 1;
-			ret = 0;
-		}
-		if ((t_ret = __db_c_close(pdbc)) != 0 && ret == 0)
-			ret = t_ret;
-		if (ret != 0)
-			goto err;
-		have_oldrec = 1;
+	/* See the comments in step 2.  This is real familiar. */
+	if ((ret = __db_c_idup(dbc_arg, &pdbc, 0)) != 0)
+		goto err;
+	DB_ASSERT(dbenv, flags != DB_CURRENT);
+	pkey.data = key->data;
+	pkey.size = key->size;
+	ret = __db_c_get(pdbc, &pkey, &olddata, rmw | DB_SET);
+	if (ret == DB_KEYEMPTY || ret == DB_NOTFOUND) {
+		nodel = 1;
+		ret = 0;
 	}
+	if ((t_ret = __db_c_close(pdbc)) != 0 && ret == 0)
+		ret = t_ret;
+	if (ret != 0)
+		goto err;
 
 	/*
-	 * If we don't follow this goto, we do in fact have an old record
-	 * we may need to go delete.  (Step 5).
+	 * Check whether we do in fact have an old record we may need to
+	 * delete.  (Step 5).
 	 */
 	if (nodel)
 		goto skip_s_update;
 
-	for (sdbp = __db_s_first(dbp);
-	    sdbp != NULL && ret == 0; ret = __db_s_next(&sdbp)) {
-		/*
-		 * Call the callback for this secondary to get the
-		 * old secondary key.
-		 */
-		memset(&oldskey, 0, sizeof(DBT));
-		if ((ret = sdbp->s_callback(sdbp,
-		    &pkey, &olddata, &oldskey)) != 0) {
-			if (ret == DB_DONOTINDEX)
-				/*
-				 * The callback returned a null value--there's
-				 * nothing to delete.  Go on to the next
-				 * secondary.
-				 */
-				continue;
-			else
-				goto err;
-		}
-		memset(&skey, 0, sizeof(DBT));
-		if ((ret = sdbp->s_callback(sdbp,
-		    &pkey, ispartial ? &newdata : data, &skey)) != 0 &&
-		    ret != DB_DONOTINDEX)
-			goto err;
-
+	for (ret = __db_s_first(dbp, &sdbp), skeyp = all_skeys;
+	    sdbp != NULL && ret == 0;
+	    ret = __db_s_next(&sdbp), skeyp++) {
+		DB_ASSERT(dbenv, skeyp - all_skeys < s_count);
 		/*
-		 * If there is no new secondary key, or if the old secondary
-		 * key is different from the new secondary key, then
-		 * we need to delete the old one.
-		 *
-		 * Note that bt_compare is (and must be) set no matter
-		 * what access method we're in.
+		 * Don't process this secondary if the key is immutable.  We
+		 * know that the old record exists, so this optimization can
+		 * always be used.
 		 */
-		sdbc = NULL;
-		if (ret == DB_DONOTINDEX ||
-		    ((BTREE *)sdbp->bt_internal)->bt_compare(sdbp,
-		    &oldskey, &skey) != 0) {
-			if ((ret = __db_cursor_int(
-			    sdbp, dbc_arg->txn, sdbp->type,
-			    PGNO_INVALID, 0, dbc_arg->locker, &sdbc)) != 0)
-				goto err;
-			if (CDB_LOCKING(dbenv)) {
-				DB_ASSERT(sdbc->mylock.off == LOCK_INVALID);
-				F_SET(sdbc, DBC_WRITER);
-			}
-
-			/*
-			 * Don't let c_get(DB_GET_BOTH) stomp on
-			 * our data.  Use a temp DBT instead.
-			 */
-			memset(&tempskey, 0, sizeof(DBT));
-			tempskey.data = oldskey.data;
-			tempskey.size = oldskey.size;
-			memset(&temppkey, 0, sizeof(DBT));
-			temppkey.data = pkey.data;
-			temppkey.size = pkey.size;
-			if ((ret = __db_c_get(sdbc,
-			    &tempskey, &temppkey, rmw | DB_GET_BOTH)) == 0)
-				ret = __db_c_del(sdbc, DB_UPDATE_SECONDARY);
-			else if (ret == DB_NOTFOUND)
-				ret = __db_secondary_corrupt(dbp);
-		}
+		if (FLD_ISSET(sdbp->s_assoc_flags, DB_ASSOC_IMMUTABLE_KEY))
+			continue;
 
-		FREE_IF_NEEDED(sdbp, &skey);
-		FREE_IF_NEEDED(sdbp, &oldskey);
-		if (sdbc != NULL && (t_ret = __db_c_close(sdbc)) != 0 &&
-		    ret == 0)
-			ret = t_ret;
-		if (ret != 0)
+		ret = __db_c_del_oldskey(sdbp, dbc_arg, skeyp, &pkey, &olddata);
+		if (ret != 0 && ret != DB_KEYEXIST)
 			goto err;
 	}
+	if (ret != 0)
+		goto err;
 
 	/* Secondary index updates are now done.  On to the "real" stuff. */
 
@@ -1328,9 +1389,8 @@ skip_s_update:
 			goto err;
 		}
 
-		if ((ret = dbc_arg->c_am_writelock(dbc_arg)) != 0)
-			return (ret);
-		if ((ret = __db_c_dup(dbc_arg, &dbc_n, DB_POSITION)) != 0)
+		if ((ret = dbc_arg->c_am_writelock(dbc_arg)) != 0 ||
+		    (ret = __db_c_dup(dbc_arg, &dbc_n, DB_POSITION)) != 0)
 			goto err;
 		opd = dbc_n->internal->opd;
 		if ((ret = opd->c_am_put(
@@ -1376,6 +1436,8 @@ skip_s_update:
 
 		dbc_n->internal->opd = opd;
 
+		if (flags == DB_NOOVERWRITE)
+			flags = DB_KEYLAST;
 		if ((ret = opd->c_am_put(
 		    opd, key, data, flags, NULL)) != 0)
 			goto err;
@@ -1392,11 +1454,95 @@ err:	/* Cleanup and cursor resolution. */
 	if (olddata.data != NULL)
 		__os_ufree(dbenv, olddata.data);
 
-	CDB_LOCKING_DONE(dbp, dbc_arg);
+	CDB_LOCKING_DONE(dbenv, dbc_arg);
 
 	if (sdbp != NULL && (t_ret = __db_s_done(sdbp)) != 0 && ret == 0)
 		ret = t_ret;
 
+	for (skeyp = all_skeys; skeyp - all_skeys < s_count; skeyp++)
+		FREE_IF_NEEDED(dbenv, skeyp);
+	if (all_skeys != NULL)
+		__os_free(dbenv, all_skeys);
+
+	return (ret);
+}
+
+/*
+ * __db_c_del_oldskey --
+ *	Delete an old secondary key, if necessary.
+ *	Returns DB_KEYEXIST if the new and old keys match..
+ */
+static int
+__db_c_del_oldskey(sdbp, dbc_arg, skey, pkey, olddata)
+	DB *sdbp;
+	DBC *dbc_arg;
+	DBT *skey, *pkey, *olddata;
+{
+	DB_ENV *dbenv;
+	DB *dbp;
+	DBC *sdbc;
+	DBT oldskey, temppkey, tempskey;
+	int ret, t_ret;
+	u_int32_t rmw;
+
+	sdbc = NULL;
+	dbp = sdbp->s_primary;
+	dbenv = dbp->dbenv;
+	rmw = STD_LOCKING(dbc_arg) ? DB_RMW : 0;
+
+	/*
+	 * Get the old secondary key.
+	 */
+	memset(&oldskey, 0, sizeof(DBT));
+	if ((ret = sdbp->s_callback(sdbp, pkey, olddata, &oldskey)) != 0) {
+		if (ret == DB_DONOTINDEX)
+			/* There's no old key to delete. */
+			ret = 0;
+		return (ret);
+	}
+
+	/*
+	 * If there is a new secondary key, check whether it is different from
+	 * the old secondary key before we delete it.  Note that bt_compare is
+	 * (and must be) set no matter what access method we're in.
+	 */
+	if (F_ISSET(skey, DB_DBT_ISSET) &&
+	    ((BTREE *)sdbp->bt_internal)->bt_compare(sdbp,
+	    &oldskey, skey) == 0) {
+		ret = DB_KEYEXIST;
+		goto err;
+	}
+
+	if ((ret = __db_cursor_int(
+	    sdbp, dbc_arg->txn, sdbp->type,
+	    PGNO_INVALID, 0, dbc_arg->locker, &sdbc)) != 0)
+		goto err;
+	if (CDB_LOCKING(dbenv)) {
+		DB_ASSERT(dbenv, sdbc->mylock.off == LOCK_INVALID);
+		F_SET(sdbc, DBC_WRITER);
+	}
+
+	/*
+	 * Don't let c_get(DB_GET_BOTH) stomp on our data.  Use a temp DBT
+	 * instead.
+	 */
+	memset(&tempskey, 0, sizeof(DBT));
+	tempskey.data = oldskey.data;
+	tempskey.size = oldskey.size;
+	SWAP_IF_NEEDED(sdbp, pkey);
+	memset(&temppkey, 0, sizeof(DBT));
+	temppkey.data = pkey->data;
+	temppkey.size = pkey->size;
+	if ((ret = __db_c_get(sdbc,
+	    &tempskey, &temppkey, rmw | DB_GET_BOTH)) == 0)
+		ret = __db_c_del(sdbc, DB_UPDATE_SECONDARY);
+	else if (ret == DB_NOTFOUND)
+		ret = __db_secondary_corrupt(dbp);
+	SWAP_IF_NEEDED(sdbp, pkey);
+
+err:	FREE_IF_NEEDED(dbenv, &oldskey);
+	if (sdbc != NULL && (t_ret = __db_c_close(sdbc)) != 0 && ret == 0)
+		ret = t_ret;
 	return (ret);
 }
 
@@ -1424,7 +1570,7 @@ __db_duperr(dbp, flags)
 	 * "DB_NODUPDATA" behavior for databases with DB_AM_SECONDARY set.
 	 */
 	if (flags != DB_NODUPDATA && !F_ISSET(dbp, DB_AM_SECONDARY))
-		__db_err(dbp->dbenv,
+		__db_errx(dbp->dbenv,
 		    "Duplicate data items are not supported with sorted data");
 	return (DB_KEYEXIST);
 }
@@ -1530,7 +1676,7 @@ __db_c_cleanup(dbc, dbc_n, failed)
 	 * to explicitly downgrade this lock.  The closed cursor
 	 * may only have had a read lock.
 	 */
-	if (F_ISSET(dbp, DB_AM_DIRTY) &&
+	if (F_ISSET(dbp, DB_AM_READ_UNCOMMITTED) &&
 	    dbc->internal->lock_mode == DB_LOCK_WRITE) {
 		if ((t_ret =
 		    __TLPUT(dbc, dbc->internal->lock)) != 0 && ret == 0)
@@ -1555,8 +1701,7 @@ __db_c_secondary_get_pp(dbc, skey, data, flags)
 	DBT *skey, *data;
 	u_int32_t flags;
 {
-
-	DB_ASSERT(F_ISSET(dbc->dbp, DB_AM_SECONDARY));
+	DB_ASSERT(dbc->dbp->dbenv, F_ISSET(dbc->dbp, DB_AM_SECONDARY));
 	return (__db_c_pget_pp(dbc, skey, NULL, data, flags));
 }
 
@@ -1573,13 +1718,14 @@ __db_c_pget(dbc, skey, pkey, data, flags)
 	u_int32_t flags;
 {
 	DB *pdbp, *sdbp;
-	DBC *pdbc;
-	DBT *save_rdata, nullpkey;
-	u_int32_t save_pkey_flags;
+	DBC *dbc_n, *pdbc;
+	DBT nullpkey;
+	u_int32_t save_pkey_flags, tmp_flags, tmp_read_uncommitted, tmp_rmw;
 	int pkeymalloc, ret, t_ret;
 
 	sdbp = dbc->dbp;
 	pdbp = sdbp->s_primary;
+	dbc_n = NULL;
 	pkeymalloc = t_ret = 0;
 
 	/*
@@ -1599,13 +1745,32 @@ __db_c_pget(dbc, skey, pkey, data, flags)
 		pkey = &nullpkey;
 	}
 
+	/* Clear OR'd in additional bits so we can check for flag equality. */
+	tmp_rmw = LF_ISSET(DB_RMW);
+	LF_CLR(DB_RMW);
+
+	tmp_read_uncommitted =
+	    LF_ISSET(DB_READ_UNCOMMITTED) &&
+	    !F_ISSET(dbc, DBC_READ_UNCOMMITTED);
+	LF_CLR(DB_READ_UNCOMMITTED);
+
 	/*
 	 * DB_GET_RECNO is a special case, because we're interested not in
 	 * the primary key/data pair, but rather in the primary's record
 	 * number.
 	 */
-	if ((flags & DB_OPFLAGS_MASK) == DB_GET_RECNO)
-		return (__db_c_pget_recno(dbc, pkey, data, flags));
+	if (flags == DB_GET_RECNO) {
+		if (tmp_rmw)
+			F_SET(dbc, DBC_RMW);
+		if (tmp_read_uncommitted)
+			F_SET(dbc, DBC_READ_UNCOMMITTED);
+		ret = __db_c_pget_recno(dbc, pkey, data, flags);
+		if (tmp_rmw)
+			F_CLR(dbc, DBC_RMW);
+		if (tmp_read_uncommitted)
+			F_CLR(dbc, DBC_READ_UNCOMMITTED);
+		return (ret);
+	}
 
 	/*
 	 * If the DBTs we've been passed don't have any of the
@@ -1623,28 +1788,23 @@ __db_c_pget(dbc, skey, pkey, data, flags)
 	 * the rkey/rdata from the *secondary* cursor.
 	 *
 	 * We accomplish all this by passing in the DBTs we started out
-	 * with to the c_get, but having swapped the contents of rskey and
-	 * rkey, respectively, into rkey and rdata;  __db_ret will treat
-	 * them like the normal key/data pair in a c_get call, and will
-	 * realloc them as need be (this is "step 1").  Then, for "step 2",
-	 * we swap back rskey/rkey/rdata to normal, and do a get on the primary
-	 * with the secondary dbc appointed as the owner of the returned-data
-	 * memory.
+	 * with to the c_get, but swapping the contents of rskey and rkey,
+	 * respectively, into rkey and rdata;  __db_ret will treat them like
+	 * the normal key/data pair in a c_get call, and will realloc them as
+	 * need be (this is "step 1").  Then, for "step 2", we swap back
+	 * rskey/rkey/rdata to normal, and do a get on the primary with the
+	 * secondary dbc appointed as the owner of the returned-data memory.
 	 *
 	 * Note that in step 2, we copy the flags field in case we need to
 	 * pass down a DB_DBT_PARTIAL or other flag that is compatible with
 	 * letting DB do the memory management.
 	 */
-	/* Step 1. */
-	save_rdata = dbc->rdata;
-	dbc->rdata = dbc->rkey;
-	dbc->rkey = dbc->rskey;
 
 	/*
-	 * It is correct, though slightly sick, to attempt a partial get
-	 * of a primary key.  However, if we do so here, we'll never find the
-	 * primary record;  clear the DB_DBT_PARTIAL field of pkey just
-	 * for the duration of the next call.
+	 * It is correct, though slightly sick, to attempt a partial get of a
+	 * primary key.  However, if we do so here, we'll never find the
+	 * primary record;  clear the DB_DBT_PARTIAL field of pkey just for the
+	 * duration of the next call.
 	 */
 	save_pkey_flags = pkey->flags;
 	F_CLR(pkey, DB_DBT_PARTIAL);
@@ -1653,107 +1813,168 @@ __db_c_pget(dbc, skey, pkey, data, flags)
 	 * Now we can go ahead with the meat of this call.  First, get the
 	 * primary key from the secondary index.  (What exactly we get depends
 	 * on the flags, but the underlying cursor get will take care of the
-	 * dirty work.)
-	 */
-	if ((ret = __db_c_get(dbc, skey, pkey, flags)) != 0) {
-		/* Restore rskey/rkey/rdata and return. */
-		pkey->flags = save_pkey_flags;
-		dbc->rskey = dbc->rkey;
-		dbc->rkey = dbc->rdata;
-		dbc->rdata = save_rdata;
-		goto err;
+	 * dirty work.)  Duplicate the cursor, in case the later get on the
+	 * primary fails.
+	 */
+	switch (flags) {
+	case DB_CURRENT:
+	case DB_GET_BOTHC:
+	case DB_NEXT:
+	case DB_NEXT_DUP:
+	case DB_NEXT_NODUP:
+	case DB_PREV:
+	case DB_PREV_NODUP:
+		tmp_flags = DB_POSITION;
+		break;
+	default:
+		tmp_flags = 0;
+		break;
 	}
 
+	if ((ret = __db_c_dup(dbc, &dbc_n, tmp_flags)) != 0)
+		return (ret);
+
+	F_SET(dbc_n, DBC_TRANSIENT);
+
+	if (tmp_rmw)
+		F_SET(dbc_n, DBC_RMW);
+	if (tmp_read_uncommitted)
+		F_SET(dbc_n, DBC_READ_UNCOMMITTED);
+
+	/*
+	 * If we've been handed a primary key, it will be in native byte order,
+	 * so we need to swap it before reading from the secondary.
+	 */
+	if (flags == DB_GET_BOTH || flags == DB_GET_BOTHC ||
+	    flags == DB_GET_BOTH_RANGE)
+		SWAP_IF_NEEDED(sdbp, pkey);
+
+retry:	/* Step 1. */
+	dbc_n->rdata = dbc->rkey;
+	dbc_n->rkey = dbc->rskey;
+	ret = __db_c_get(dbc_n, skey, pkey, flags);
 	/* Restore pkey's flags in case we stomped the PARTIAL flag. */
 	pkey->flags = save_pkey_flags;
 
 	/*
-	 * Restore the cursor's rskey, rkey, and rdata DBTs.  If DB
-	 * is handling the memory management, we now have newly
-	 * reallocated buffers and ulens in rkey and rdata which we want
-	 * to put in rskey and rkey.  save_rdata contains the old value
-	 * of dbc->rdata.
+	 * We need to swap the primary key to native byte order if we read it
+	 * successfully, or if we swapped it on entry above.  We can't return
+	 * with the application's data modified.
 	 */
-	dbc->rskey = dbc->rkey;
-	dbc->rkey = dbc->rdata;
-	dbc->rdata = save_rdata;
+	if (ret == 0 || flags == DB_GET_BOTH || flags == DB_GET_BOTHC ||
+	    flags == DB_GET_BOTH_RANGE)
+		SWAP_IF_NEEDED(sdbp, pkey);
+
+	if (ret != 0)
+		goto err;
 
 	/*
-	 * Now we're ready for "step 2".  If either or both of pkey and
-	 * data do not have memory management flags set--that is, if DB is
-	 * managing their memory--we need to swap around the rkey/rdata
-	 * structures so that we don't wind up trying to use memory managed
-	 * by the primary database cursor, which we'll close before we return.
+	 * Now we're ready for "step 2".  If either or both of pkey and data do
+	 * not have memory management flags set--that is, if DB is managing
+	 * their memory--we need to swap around the rkey/rdata structures so
+	 * that we don't wind up trying to use memory managed by the primary
+	 * database cursor, which we'll close before we return.
 	 *
 	 * !!!
-	 * If you're carefully following the bouncing ball, you'll note
-	 * that in the DB-managed case, the buffer hanging off of pkey is
-	 * the same as dbc->rkey->data.  This is just fine;  we may well
-	 * realloc and stomp on it when we return, if we're going a
-	 * DB_GET_BOTH and need to return a different partial or key
-	 * (depending on the comparison function), but this is safe.
+	 * If you're carefully following the bouncing ball, you'll note that in
+	 * the DB-managed case, the buffer hanging off of pkey is the same as
+	 * dbc->rkey->data.  This is just fine;  we may well realloc and stomp
+	 * on it when we return, if we're doing a DB_GET_BOTH and need to
+	 * return a different partial or key (depending on the comparison
+	 * function), but this is safe.
 	 *
 	 * !!!
 	 * We need to use __db_cursor_int here rather than simply calling
-	 * pdbp->cursor, because otherwise, if we're in CDB, we'll
-	 * allocate a new locker ID and leave ourselves open to deadlocks.
-	 * (Even though we're only acquiring read locks, we'll still block
-	 * if there are any waiters.)
+	 * pdbp->cursor, because otherwise, if we're in CDB, we'll allocate a
+	 * new locker ID and leave ourselves open to deadlocks.  (Even though
+	 * we're only acquiring read locks, we'll still block if there are any
+	 * waiters.)
 	 */
 	if ((ret = __db_cursor_int(pdbp,
 	    dbc->txn, pdbp->type, PGNO_INVALID, 0, dbc->locker, &pdbc)) != 0)
 		goto err;
 
+	if (tmp_read_uncommitted || F_ISSET(dbc, DBC_READ_UNCOMMITTED))
+		F_SET(pdbc, DBC_READ_UNCOMMITTED);
+	if (tmp_rmw || F_ISSET(dbc, DBC_RMW))
+		F_SET(pdbc, DBC_RMW);
+	if (F_ISSET(dbc, DBC_READ_COMMITTED))
+		F_SET(pdbc, DBC_READ_COMMITTED);
+
 	/*
-	 * We're about to use pkey a second time.  If DB_DBT_MALLOC
-	 * is set on it, we'll leak the memory we allocated the first time.
-	 * Thus, set DB_DBT_REALLOC instead so that we reuse that memory
-	 * instead of leaking it.
+	 * We're about to use pkey a second time.  If DB_DBT_MALLOC is set on
+	 * it, we'll leak the memory we allocated the first time.  Thus, set
+	 * DB_DBT_REALLOC instead so that we reuse that memory instead of
+	 * leaking it.
+	 *
+	 * Alternatively, if the application is handling copying for pkey, we
+	 * need to take a copy now.  The copy will be freed on exit from
+	 * __db_c_pget_pp (and we must be coming through there if
+	 * DB_DBT_USERCOPY is set).
 	 *
 	 * !!!
-	 * This assumes that the user must always specify a compatible
-	 * realloc function if a malloc function is specified.  I think
-	 * this is a reasonable requirement.
+	 * This assumes that the user must always specify a compatible realloc
+	 * function if a malloc function is specified.  I think this is a
+	 * reasonable requirement.
 	 */
 	if (F_ISSET(pkey, DB_DBT_MALLOC)) {
 		F_CLR(pkey, DB_DBT_MALLOC);
 		F_SET(pkey, DB_DBT_REALLOC);
 		pkeymalloc = 1;
-	}
+	} else if (F_ISSET(pkey, DB_DBT_USERCOPY) &&
+	    (ret = __dbt_usercopy(sdbp->dbenv, pkey)) != 0)
+		goto err;
 
 	/*
-	 * Do the actual get.  Set DBC_TRANSIENT since we don't care
-	 * about preserving the position on error, and it's faster.
-	 * SET_RET_MEM so that the secondary DBC owns any returned-data
-	 * memory.
+	 * Do the actual get.  Set DBC_TRANSIENT since we don't care about
+	 * preserving the position on error, and it's faster.  SET_RET_MEM so
+	 * that the secondary DBC owns any returned-data memory.
 	 */
 	F_SET(pdbc, DBC_TRANSIENT);
 	SET_RET_MEM(pdbc, dbc);
 	ret = __db_c_get(pdbc, pkey, data, DB_SET);
 
 	/*
-	 * If the item wasn't found in the primary, this is a bug;
-	 * our secondary has somehow gotten corrupted, and contains
-	 * elements that don't correspond to anything in the primary.
-	 * Complain.
+	 * If the item wasn't found in the primary, this is a bug; our
+	 * secondary has somehow gotten corrupted, and contains elements that
+	 * don't correspond to anything in the primary.  Complain.
 	 */
-	if (ret == DB_NOTFOUND)
-		ret = __db_secondary_corrupt(pdbp);
 
 	/* Now close the primary cursor. */
-	t_ret = __db_c_close(pdbc);
+	if ((t_ret = __db_c_close(pdbc)) != 0 && ret == 0)
+		ret = t_ret;
 
-err:	if (pkeymalloc) {
+	else if (ret == DB_NOTFOUND) {
+		if (!F_ISSET(pdbc, DBC_READ_UNCOMMITTED))
+			ret = __db_secondary_corrupt(pdbp);
+		else switch (flags) {
+		case DB_GET_BOTHC:
+		case DB_NEXT:
+		case DB_NEXT_DUP:
+		case DB_NEXT_NODUP:
+		case DB_PREV:
+		case DB_PREV_NODUP:
+			goto retry;
+		default:
+			break;
+		}
+	}
+
+err:	/* Cleanup and cursor resolution. */
+	if ((t_ret = __db_c_cleanup(dbc, dbc_n, ret)) != 0 && ret == 0)
+		ret = t_ret;
+	if (pkeymalloc) {
 		/*
-		 * If pkey had a MALLOC flag, we need to restore it;
-		 * otherwise, if the user frees the buffer but reuses
-		 * the DBT without NULL'ing its data field or changing
-		 * the flags, we may drop core.
+		 * If pkey had a MALLOC flag, we need to restore it; otherwise,
+		 * if the user frees the buffer but reuses the DBT without
+		 * NULL'ing its data field or changing the flags, we may drop
+		 * core.
 		 */
 		F_CLR(pkey, DB_DBT_REALLOC);
 		F_SET(pkey, DB_DBT_MALLOC);
 	}
-	return (t_ret == 0 ? ret : t_ret);
+
+	return (ret);
 }
 
 /*
@@ -1855,7 +2076,7 @@ static int
 __db_wrlock_err(dbenv)
 	DB_ENV *dbenv;
 {
-	__db_err(dbenv, "Write attempted on read-only cursor");
+	__db_errx(dbenv, "Write attempted on read-only cursor");
 	return (EPERM);
 }
 
@@ -1873,11 +2094,14 @@ static int
 __db_c_del_secondary(dbc)
 	DBC *dbc;
 {
+	DB_ENV *dbenv;
 	DB *pdbp;
 	DBC *pdbc;
 	DBT skey, pkey;
 	int ret, t_ret;
 
+	pdbp = dbc->dbp->s_primary;
+	dbenv = pdbp->dbenv;
 	memset(&skey, 0, sizeof(DBT));
 	memset(&pkey, 0, sizeof(DBT));
 
@@ -1890,6 +2114,8 @@ __db_c_del_secondary(dbc)
 	if ((ret = __db_c_get(dbc, &skey, &pkey, DB_CURRENT)) != 0)
 		return (ret);
 
+	SWAP_IF_NEEDED(dbc->dbp, &pkey);
+
 	/*
 	 * Create a cursor on the primary with our locker ID,
 	 * so that when it calls back, we don't conflict.
@@ -1900,7 +2126,6 @@ __db_c_del_secondary(dbc)
 	 * interface.  This shouldn't be any less efficient
 	 * anyway.
 	 */
-	pdbp = dbc->dbp->s_primary;
 	if ((ret = __db_cursor_int(pdbp, dbc->txn,
 	    pdbp->type, PGNO_INVALID, 0, dbc->locker, &pdbc)) != 0)
 		return (ret);
@@ -1911,8 +2136,8 @@ __db_c_del_secondary(dbc)
 	 * the cursor as a WRITER so we don't run into errors
 	 * when we try to delete.
 	 */
-	if (CDB_LOCKING(pdbp->dbenv)) {
-		DB_ASSERT(pdbc->mylock.off == LOCK_INVALID);
+	if (CDB_LOCKING(dbenv)) {
+		DB_ASSERT(dbenv, pdbc->mylock.off == LOCK_INVALID);
 		F_SET(pdbc, DBC_WRITER);
 	}
 
@@ -1950,12 +2175,14 @@ int
 __db_c_del_primary(dbc)
 	DBC *dbc;
 {
+	DB_ENV *dbenv;
 	DB *dbp, *sdbp;
 	DBC *sdbc;
 	DBT data, pkey, skey, temppkey, tempskey;
 	int ret, t_ret;
 
 	dbp = dbc->dbp;
+	dbenv = dbp->dbenv;
 
 	/*
 	 * If we're called at all, we have at least one secondary.
@@ -1968,13 +2195,14 @@ __db_c_del_primary(dbc)
 	if ((ret = __db_c_get(dbc, &pkey, &data, DB_CURRENT)) != 0)
 		return (ret);
 
-	for (sdbp = __db_s_first(dbp);
-	    sdbp != NULL && ret == 0; ret = __db_s_next(&sdbp)) {
+	memset(&skey, 0, sizeof(DBT));
+	for (ret = __db_s_first(dbp, &sdbp);
+	    sdbp != NULL && ret == 0;
+	    ret = __db_s_next(&sdbp)) {
 		/*
 		 * Get the secondary key for this secondary and the current
 		 * item.
 		 */
-		memset(&skey, 0, sizeof(DBT));
 		if ((ret = sdbp->s_callback(sdbp, &pkey, &data, &skey)) != 0) {
 			/*
 			 * If the current item isn't in this index, we
@@ -1984,17 +2212,16 @@ __db_c_del_primary(dbc)
 				continue;
 
 			/* We had a substantive error.  Bail. */
-			FREE_IF_NEEDED(sdbp, &skey);
-			goto done;
+			goto err;
 		}
 
 		/* Open a secondary cursor. */
 		if ((ret = __db_cursor_int(sdbp, dbc->txn, sdbp->type,
 		    PGNO_INVALID, 0, dbc->locker, &sdbc)) != 0)
-			goto done;
+			goto err;
 		/* See comment above and in __db_c_put. */
-		if (CDB_LOCKING(sdbp->dbenv)) {
-			DB_ASSERT(sdbc->mylock.off == LOCK_INVALID);
+		if (CDB_LOCKING(dbenv)) {
+			DB_ASSERT(dbenv, sdbc->mylock.off == LOCK_INVALID);
 			F_SET(sdbc, DBC_WRITER);
 		}
 
@@ -2014,6 +2241,7 @@ __db_c_del_primary(dbc)
 		memset(&tempskey, 0, sizeof(DBT));
 		tempskey.data = skey.data;
 		tempskey.size = skey.size;
+		SWAP_IF_NEEDED(sdbp, &pkey);
 		memset(&temppkey, 0, sizeof(DBT));
 		temppkey.data = pkey.data;
 		temppkey.size = pkey.size;
@@ -2022,17 +2250,18 @@ __db_c_del_primary(dbc)
 			ret = __db_c_del(sdbc, DB_UPDATE_SECONDARY);
 		else if (ret == DB_NOTFOUND)
 			ret = __db_secondary_corrupt(dbp);
-
-		FREE_IF_NEEDED(sdbp, &skey);
+		SWAP_IF_NEEDED(sdbp, &pkey);
+		FREE_IF_NEEDED(dbenv, &skey);
 
 		if ((t_ret = __db_c_close(sdbc)) != 0 && ret == 0)
 			ret = t_ret;
 		if (ret != 0)
-			goto done;
+			goto err;
 	}
 
-done:	if (sdbp != NULL && (t_ret = __db_s_done(sdbp)) != 0 && ret == 0)
+err:	if (sdbp != NULL && (t_ret = __db_s_done(sdbp)) != 0 && ret == 0)
 		ret = t_ret;
+	FREE_IF_NEEDED(dbenv, &skey);
 	return (ret);
 }
 
@@ -2040,23 +2269,25 @@ done:	if (sdbp != NULL && (t_ret = __db_s_done(sdbp)) != 0 && ret == 0)
  * __db_s_first --
  *	Get the first secondary, if any are present, from the primary.
  *
- * PUBLIC: DB *__db_s_first __P((DB *));
+ * PUBLIC: int __db_s_first __P((DB *, DB **));
  */
-DB *
-__db_s_first(pdbp)
-	DB *pdbp;
+int
+__db_s_first(pdbp, sdbpp)
+	DB *pdbp, **sdbpp;
 {
 	DB *sdbp;
 
-	MUTEX_THREAD_LOCK(pdbp->dbenv, pdbp->mutexp);
+	MUTEX_LOCK(pdbp->dbenv, pdbp->mutex);
 	sdbp = LIST_FIRST(&pdbp->s_secondaries);
 
 	/* See __db_s_next. */
 	if (sdbp != NULL)
 		sdbp->s_refcnt++;
-	MUTEX_THREAD_UNLOCK(pdbp->dbenv, pdbp->mutexp);
+	MUTEX_UNLOCK(pdbp->dbenv, pdbp->mutex);
+
+	*sdbpp = sdbp;
 
-	return (sdbp);
+	return (0);
 }
 
 /*
@@ -2069,6 +2300,7 @@ int
 __db_s_next(sdbpp)
 	DB **sdbpp;
 {
+	DB_ENV *dbenv;
 	DB *sdbp, *pdbp, *closeme;
 	int ret;
 
@@ -2097,10 +2329,11 @@ __db_s_next(sdbpp)
 	 */
 	sdbp = *sdbpp;
 	pdbp = sdbp->s_primary;
+	dbenv = pdbp->dbenv;
 	closeme = NULL;
 
-	MUTEX_THREAD_LOCK(pdbp->dbenv, pdbp->mutexp);
-	DB_ASSERT(sdbp->s_refcnt != 0);
+	MUTEX_LOCK(dbenv, pdbp->mutex);
+	DB_ASSERT(dbenv, sdbp->s_refcnt != 0);
 	if (--sdbp->s_refcnt == 0) {
 		LIST_REMOVE(sdbp, s_links);
 		closeme = sdbp;
@@ -2108,7 +2341,7 @@ __db_s_next(sdbpp)
 	sdbp = LIST_NEXT(sdbp, s_links);
 	if (sdbp != NULL)
 		sdbp->s_refcnt++;
-	MUTEX_THREAD_UNLOCK(pdbp->dbenv, pdbp->mutexp);
+	MUTEX_UNLOCK(dbenv, pdbp->mutex);
 
 	*sdbpp = sdbp;
 
@@ -2130,23 +2363,50 @@ int
 __db_s_done(sdbp)
 	DB *sdbp;
 {
+	DB_ENV *dbenv;
 	DB *pdbp;
 	int doclose;
 
 	pdbp = sdbp->s_primary;
+	dbenv = pdbp->dbenv;
 	doclose = 0;
 
-	MUTEX_THREAD_LOCK(pdbp->dbenv, pdbp->mutexp);
-	DB_ASSERT(sdbp->s_refcnt != 0);
+	MUTEX_LOCK(dbenv, pdbp->mutex);
+	DB_ASSERT(dbenv, sdbp->s_refcnt != 0);
 	if (--sdbp->s_refcnt == 0) {
 		LIST_REMOVE(sdbp, s_links);
 		doclose = 1;
 	}
-	MUTEX_THREAD_UNLOCK(pdbp->dbenv, pdbp->mutexp);
+	MUTEX_UNLOCK(dbenv, pdbp->mutex);
 
 	return (doclose ? __db_close(sdbp, NULL, 0) : 0);
 }
 
+/*
+ * __db_s_count --
+ *	Count the number of secondaries associated with a given primary.
+ */
+static int
+__db_s_count(pdbp)
+	DB *pdbp;
+{
+	DB_ENV *dbenv;
+	DB *sdbp;
+	int count;
+
+	dbenv = pdbp->dbenv;
+	count = 0;
+
+	MUTEX_LOCK(dbenv, pdbp->mutex);
+	for (sdbp = LIST_FIRST(&pdbp->s_secondaries);
+	    sdbp != NULL;
+	    sdbp = LIST_NEXT(sdbp, s_links))
+		++count;
+	MUTEX_UNLOCK(dbenv, pdbp->mutex);
+
+	return (count);
+}
+
 /*
  * __db_buildpartial --
  *	Build the record that will result after a partial put is applied to
@@ -2161,18 +2421,21 @@ __db_buildpartial(dbp, oldrec, partial, newrec)
 	DB *dbp;
 	DBT *oldrec, *partial, *newrec;
 {
-	int ret;
-	u_int8_t *buf;
+	DB_ENV *dbenv;
 	u_int32_t len, nbytes;
+	u_int8_t *buf;
+	int ret;
+
+	dbenv = dbp->dbenv;
 
-	DB_ASSERT(F_ISSET(partial, DB_DBT_PARTIAL));
+	DB_ASSERT(dbenv, F_ISSET(partial, DB_DBT_PARTIAL));
 
 	memset(newrec, 0, sizeof(DBT));
 
 	nbytes = __db_partsize(oldrec->size, partial);
 	newrec->size = nbytes;
 
-	if ((ret = __os_malloc(dbp->dbenv, nbytes, &buf)) != 0)
+	if ((ret = __os_malloc(dbenv, nbytes, &buf)) != 0)
 		return (ret);
 	newrec->data = buf;
 
diff --git a/db/db/db_cds.c b/db/db/db_cds.c
new file mode 100644
index 000000000..ee9caa062
--- /dev/null
+++ b/db/db/db_cds.c
@@ -0,0 +1,173 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2000-2006
+ *	Oracle Corporation.  All rights reserved.
+ *
+ * $Id: db_cds.c,v 12.5 2006/09/07 05:46:15 mjc Exp $
+ */
+
+#include "db_config.h"
+
+#include "db_int.h"
+#include "dbinc/db_page.h"
+#include "dbinc/db_am.h"
+#include "dbinc/lock.h"
+#include "dbinc/txn.h"
+
+static int __cdsgroup_abort __P((DB_TXN *txn));
+static int __cdsgroup_commit __P((DB_TXN *txn, u_int32_t flags));
+static int __cdsgroup_discard __P((DB_TXN *txn, u_int32_t flags));
+static u_int32_t __cdsgroup_id __P((DB_TXN *txn));
+static int __cdsgroup_notsup __P((DB_ENV *dbenv, const char *meth));
+static int __cdsgroup_prepare __P((DB_TXN *txn, u_int8_t *gid));
+static int __cdsgroup_set_name __P((DB_TXN *txn, const char *name));
+static int __cdsgroup_set_timeout
+    __P((DB_TXN *txn, db_timeout_t timeout, u_int32_t flags));
+
+/*
+ * __cdsgroup_notsup --
+ *	Error when CDS groups don't support a method.
+ */
+static int
+__cdsgroup_notsup(dbenv, meth)
+	DB_ENV *dbenv;
+	const char *meth;
+{
+	__db_errx(dbenv, "CDS groups do not support %s", meth);
+	return (DB_OPNOTSUP);
+}
+
+static int __cdsgroup_abort(txn)
+	DB_TXN *txn;
+{
+	return (__cdsgroup_notsup(txn->mgrp->dbenv, "abort"));
+}
+
+static int __cdsgroup_commit(txn, flags)
+	DB_TXN *txn;
+	u_int32_t flags;
+{
+	DB_ENV *dbenv;
+	DB_LOCKREQ lreq;
+	u_int32_t locker;
+	int ret, t_ret;
+
+	COMPQUIET(flags, 0);
+	dbenv = txn->mgrp->dbenv;
+
+	/* Check for live cursors. */
+	if (txn->cursors != 0) {
+		__db_errx(dbenv, "CDS group has active cursors");
+		return (EINVAL);
+	}
+
+	/* We may be holding handle locks; release them. */
+	lreq.op = DB_LOCK_PUT_ALL;
+	lreq.obj = NULL;
+	ret = __lock_vec(dbenv, txn->txnid, 0, &lreq, 1, NULL);
+
+	dbenv = txn->mgrp->dbenv;
+	locker = txn->txnid;
+	__os_free(dbenv, txn->mgrp);
+	__os_free(dbenv, txn);
+	if ((t_ret = __lock_id_free(dbenv, locker)) != 0 && ret == 0)
+		ret = t_ret;
+	return (ret);
+}
+
+static int __cdsgroup_discard(txn, flags)
+	DB_TXN *txn;
+	u_int32_t flags;
+{
+	COMPQUIET(flags, 0);
+	return (__cdsgroup_notsup(txn->mgrp->dbenv, "discard"));
+}
+
+static u_int32_t __cdsgroup_id(txn)
+	DB_TXN *txn;
+{
+	return (txn->txnid);
+}
+
+static int __cdsgroup_prepare(txn, gid)
+	DB_TXN *txn;
+	u_int8_t *gid;
+{
+	COMPQUIET(gid, NULL);
+	return (__cdsgroup_notsup(txn->mgrp->dbenv, "prepare"));
+}
+
+static int __cdsgroup_set_name(txn, name)
+	DB_TXN *txn;
+	const char *name;
+{
+	COMPQUIET(name, NULL);
+	return (__cdsgroup_notsup(txn->mgrp->dbenv, "set_name"));
+}
+
+static int __cdsgroup_set_timeout(txn, timeout, flags)
+	DB_TXN *txn;
+	db_timeout_t timeout;
+	u_int32_t flags;
+{
+	COMPQUIET(timeout, 0);
+	COMPQUIET(flags, 0);
+	return (__cdsgroup_notsup(txn->mgrp->dbenv, "set_timeout"));
+}
+
+/*
+ * __cds_txn_begin --
+ *	DB_ENV->cdsgroup_begin
+ *
+ * PUBLIC: int __cdsgroup_begin __P((DB_ENV *, DB_TXN **));
+ */
+int __cdsgroup_begin(dbenv, txnpp)
+	DB_ENV *dbenv;
+	DB_TXN **txnpp;
+{
+	DB_THREAD_INFO *ip;
+	DB_TXN *txn;
+	int ret;
+
+	PANIC_CHECK(dbenv);
+	ENV_ILLEGAL_BEFORE_OPEN(dbenv, "cdsgroup_begin");
+	if (!CDB_LOCKING(dbenv))
+		return (__db_env_config(dbenv, "cdsgroup_begin", DB_INIT_CDB));
+
+	ENV_ENTER(dbenv, ip);
+	*txnpp = txn = NULL;
+	if ((ret = __os_calloc(dbenv, 1, sizeof(DB_TXN), &txn)) != 0)
+		goto err;
+	/*
+	 * We need a dummy DB_TXNMGR -- it's the only way to get from a
+	 * transaction handle to the environment handle.
+	 */
+	if ((ret = __os_calloc(dbenv, 1, sizeof(DB_TXNMGR), &txn->mgrp)) != 0)
+		goto err;
+	txn->mgrp->dbenv = dbenv;
+
+	if ((ret = __lock_id(dbenv, &txn->txnid, NULL)) != 0)
+		goto err;
+
+	txn->flags = TXN_CDSGROUP;
+	txn->abort = __cdsgroup_abort;
+	txn->commit = __cdsgroup_commit;
+	txn->discard = __cdsgroup_discard;
+	txn->id = __cdsgroup_id;
+	txn->prepare = __cdsgroup_prepare;
+	txn->set_name = __cdsgroup_set_name;
+	txn->set_timeout = __cdsgroup_set_timeout;
+
+	*txnpp = txn;
+
+	if (0) {
+err:		if (txn != NULL) {
+			if (txn->mgrp != NULL)
+				__os_free(dbenv, txn->mgrp);
+			__os_free(dbenv, txn);
+		}
+	}
+	ENV_LEAVE(dbenv, ip);
+	return (ret);
+}
diff --git a/db/db/db_conv.c b/db/db/db_conv.c
index b4c5c9a29..94afb1db7 100644
--- a/db/db/db_conv.c
+++ b/db/db/db_conv.c
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994, 1995, 1996
@@ -36,17 +36,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db_conv.c,v 11.45 2004/01/28 03:35:57 bostic Exp $
+ * $Id: db_conv.c,v 12.7 2006/08/24 14:45:15 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/crypto.h"
 #include "dbinc/hmac.h"
@@ -143,14 +137,14 @@ __db_pgin(dbenv, pg, pp, cookie)
 		if (F_ISSET(dbp, DB_AM_SWAP) && is_hmac == 0)
 			P_32_SWAP(chksum);
 		switch (ret = __db_check_chksum(
-		    dbenv, db_cipher, chksum, pp, sum_len, is_hmac)) {
+		    dbenv, NULL, db_cipher, chksum, pp, sum_len, is_hmac)) {
 		case 0:
 			break;
 		case -1:
 			if (DBENV_LOGGING(dbenv))
 				(void)__db_cksum_log(
 				    dbenv, NULL, ¬_used, DB_FLUSH);
-			__db_err(dbenv,
+			__db_errx(dbenv,
 	    "checksum error: page %lu: catastrophic recovery required",
 			    (u_long)pg);
 			return (__db_panic(dbenv, DB_RUNRECOVERY));
@@ -159,11 +153,11 @@ __db_pgin(dbenv, pg, pp, cookie)
 		}
 	}
 	if (F_ISSET(dbp, DB_AM_ENCRYPT)) {
-		DB_ASSERT(db_cipher != NULL);
-		DB_ASSERT(F_ISSET(dbp, DB_AM_CHKSUM));
+		DB_ASSERT(dbenv, db_cipher != NULL);
+		DB_ASSERT(dbenv, F_ISSET(dbp, DB_AM_CHKSUM));
 
 		pg_off = P_OVERHEAD(dbp);
-		DB_ASSERT(db_cipher->adj_size(pg_off) == 0);
+		DB_ASSERT(dbenv, db_cipher->adj_size(pg_off) == 0);
 
 		switch (pagep->type) {
 		case P_HASHMETA:
@@ -283,11 +277,11 @@ __db_pgout(dbenv, pg, pp, cookie)
 	db_cipher = (DB_CIPHER *)dbenv->crypto_handle;
 	if (F_ISSET(dbp, DB_AM_ENCRYPT)) {
 
-		DB_ASSERT(db_cipher != NULL);
-		DB_ASSERT(F_ISSET(dbp, DB_AM_CHKSUM));
+		DB_ASSERT(dbenv, db_cipher != NULL);
+		DB_ASSERT(dbenv, F_ISSET(dbp, DB_AM_CHKSUM));
 
 		pg_off = P_OVERHEAD(dbp);
-		DB_ASSERT(db_cipher->adj_size(pg_off) == 0);
+		DB_ASSERT(dbenv, db_cipher->adj_size(pg_off) == 0);
 
 		key = db_cipher->mac_key;
 
@@ -332,7 +326,7 @@ __db_pgout(dbenv, pg, pp, cookie)
 			sum_len = pginfo->db_pagesize;
 			break;
 		}
-		__db_chksum(pp, sum_len, key, chksum);
+		__db_chksum(NULL, pp, sum_len, key, chksum);
 		if (F_ISSET(dbp, DB_AM_SWAP) && !F_ISSET(dbp, DB_AM_ENCRYPT))
 			 P_32_SWAP(chksum);
 	}
diff --git a/db/db/db_dispatch.c b/db/db/db_dispatch.c
index 2317f500a..4ef8347ba 100644
--- a/db/db/db_dispatch.c
+++ b/db/db/db_dispatch.c
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1995, 1996
@@ -35,30 +35,22 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db_dispatch.c,v 11.169 2004/10/27 16:44:26 ubell Exp $
+ * $Id: db_dispatch.c,v 12.26 2006/08/24 14:45:15 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/hash.h"
+#include "dbinc/fop.h"
+#include "dbinc/lock.h"
 #include "dbinc/log.h"
 #include "dbinc/mp.h"
-#include "dbinc/fop.h"
 #include "dbinc/txn.h"
 
-#ifndef HAVE_FTRUNCATE
-static int __db_limbo_fix __P((DB *,
-    DB_TXN *, DB_TXNLIST *, db_pgno_t *, DBMETA *, db_limbo_state));
+static int __db_limbo_fix __P((DB *, DB_TXN *,
+		DB_TXNLIST *, db_pgno_t *, DBMETA *, db_limbo_state));
 static int __db_limbo_bucket __P((DB_ENV *,
 	     DB_TXN *, DB_TXNLIST *, db_limbo_state));
 static int __db_limbo_move __P((DB_ENV *, DB_TXN *, DB_TXN *, DB_TXNLIST *));
@@ -66,11 +58,10 @@ static int __db_limbo_prepare __P(( DB *, DB_TXN *, DB_TXNLIST *));
 static int __db_lock_move __P((DB_ENV *,
 		u_int8_t *, db_pgno_t, db_lockmode_t, DB_TXN *, DB_TXN *));
 static int __db_txnlist_pgnoadd __P((DB_ENV *, DB_TXNHEAD *,
-		int32_t, u_int8_t [DB_FILE_ID_LEN], char *, db_pgno_t));
-#endif
-static int __db_txnlist_find_internal __P((DB_ENV *,
-    void *, db_txnlist_type, u_int32_t, u_int8_t[DB_FILE_ID_LEN],
-    DB_TXNLIST **, int, u_int32_t *));
+		int32_t, u_int8_t *, char *, db_pgno_t));
+static int __db_txnlist_find_internal __P((DB_ENV *, DB_TXNHEAD *,
+		db_txnlist_type, u_int32_t, u_int8_t *, DB_TXNLIST **,
+		int, u_int32_t *));
 
 /*
  * __db_dispatch --
@@ -83,7 +74,7 @@ static int __db_txnlist_find_internal __P((DB_ENV *,
  *
  * PUBLIC: int __db_dispatch __P((DB_ENV *,
  * PUBLIC:     int (**)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)),
- * PUBLIC:     size_t, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC:     size_t, DBT *, DB_LSN *, db_recops, DB_TXNHEAD *));
  */
 int
 __db_dispatch(dbenv, dtab, dtabsize, db, lsnp, redo, info)
@@ -93,7 +84,7 @@ __db_dispatch(dbenv, dtab, dtabsize, db, lsnp, redo, info)
 	DBT *db;		/* The log record upon which to dispatch. */
 	DB_LSN *lsnp;		/* The lsn of the record being dispatched. */
 	db_recops redo;		/* Redo this op (or undo it). */
-	void *info;
+	DB_TXNHEAD *info;	/* Transaction list. */
 {
 	DB_LSN prev_lsn;
 	u_int32_t rectype, status, txnid;
@@ -104,7 +95,7 @@ __db_dispatch(dbenv, dtab, dtabsize, db, lsnp, redo, info)
 	make_call = ret = 0;
 
 	/* If we don't have a dispatch table, it's hard to dispatch. */
-	DB_ASSERT(dtab != NULL);
+	DB_ASSERT(dbenv, dtab != NULL);
 
 	/*
 	 * If we find a record that is in the user's number space and they
@@ -235,7 +226,9 @@ __db_dispatch(dbenv, dtab, dtabsize, db, lsnp, redo, info)
 			break;
 
 		default:
-			if (txnid != 0) {
+			if (txnid == 0)
+				status = 0;
+			else {
 				ret = __db_txnlist_find(dbenv,
 				    info, txnid, &status);
 
@@ -314,7 +307,7 @@ __db_dispatch(dbenv, dtab, dtabsize, db, lsnp, redo, info)
 			 * as our sanity check.
 			 */
 			if (rectype > dtabsize || dtab[rectype] == NULL) {
-				__db_err(dbenv,
+				__db_errx(dbenv,
 				    "Illegal record type %lu in log",
 				    (u_long)rectype);
 				return (EINVAL);
@@ -364,14 +357,14 @@ __db_add_recovery(dbenv, dtab, dtabsize, func, ndx)
  *	Initialize transaction linked list.
  *
  * PUBLIC: int __db_txnlist_init __P((DB_ENV *,
- * PUBLIC:     u_int32_t, u_int32_t, DB_LSN *, void *));
+ * PUBLIC:     u_int32_t, u_int32_t, DB_LSN *, DB_TXNHEAD **));
  */
 int
 __db_txnlist_init(dbenv, low_txn, hi_txn, trunc_lsn, retp)
 	DB_ENV *dbenv;
 	u_int32_t low_txn, hi_txn;
 	DB_LSN *trunc_lsn;
-	void *retp;
+	DB_TXNHEAD **retp;
 {
 	DB_TXNHEAD *headp;
 	u_int32_t size, tmp;
@@ -427,7 +420,7 @@ __db_txnlist_init(dbenv, low_txn, hi_txn, trunc_lsn, retp)
 	}
 	ZERO_LSN(headp->ckplsn);
 
-	*(void **)retp = headp;
+	*retp = headp;
 	return (0);
 }
 
@@ -436,23 +429,21 @@ __db_txnlist_init(dbenv, low_txn, hi_txn, trunc_lsn, retp)
  *	Add an element to our transaction linked list.
  *
  * PUBLIC: int __db_txnlist_add __P((DB_ENV *,
- * PUBLIC:     void *, u_int32_t, u_int32_t, DB_LSN *));
+ * PUBLIC:     DB_TXNHEAD *, u_int32_t, u_int32_t, DB_LSN *));
  */
 int
-__db_txnlist_add(dbenv, listp, txnid, status, lsn)
+__db_txnlist_add(dbenv, hp, txnid, status, lsn)
 	DB_ENV *dbenv;
-	void *listp;
+	DB_TXNHEAD *hp;
 	u_int32_t txnid, status;
 	DB_LSN *lsn;
 {
-	DB_TXNHEAD *hp;
 	DB_TXNLIST *elp;
 	int ret;
 
 	if ((ret = __os_malloc(dbenv, sizeof(DB_TXNLIST), &elp)) != 0)
 		return (ret);
 
-	hp = (DB_TXNHEAD *)listp;
 	LIST_INSERT_HEAD(&hp->head[DB_TXNLIST_MASK(hp, txnid)], elp, links);
 
 	elp->type = TXNLIST_TXNID;
@@ -464,8 +455,8 @@ __db_txnlist_add(dbenv, listp, txnid, status, lsn)
 	if (lsn != NULL && IS_ZERO_LSN(hp->maxlsn) && status == TXN_COMMIT)
 		hp->maxlsn = *lsn;
 
-	DB_ASSERT(lsn == NULL ||
-	    status != TXN_COMMIT || log_compare(&hp->maxlsn, lsn) >= 0);
+	DB_ASSERT(dbenv, lsn == NULL ||
+	    status != TXN_COMMIT || LOG_COMPARE(&hp->maxlsn, lsn) >= 0);
 
 	return (0);
 }
@@ -474,19 +465,19 @@ __db_txnlist_add(dbenv, listp, txnid, status, lsn)
  * __db_txnlist_remove --
  *	Remove an element from our transaction linked list.
  *
- * PUBLIC: int __db_txnlist_remove __P((DB_ENV *, void *, u_int32_t));
+ * PUBLIC: int __db_txnlist_remove __P((DB_ENV *, DB_TXNHEAD *, u_int32_t));
  */
 int
-__db_txnlist_remove(dbenv, listp, txnid)
+__db_txnlist_remove(dbenv, hp, txnid)
 	DB_ENV *dbenv;
-	void *listp;
+	DB_TXNHEAD *hp;
 	u_int32_t txnid;
 {
 	DB_TXNLIST *entry;
 	u_int32_t status;
 
 	return (__db_txnlist_find_internal(dbenv,
-	    listp, TXNLIST_TXNID, txnid, NULL, &entry, 1, &status));
+	    hp, TXNLIST_TXNID, txnid, NULL, &entry, 1, &status));
 }
 
 /*
@@ -497,22 +488,19 @@ __db_txnlist_remove(dbenv, listp, txnid)
  * recovery, we are going to virtually truncate the log and we need
  * to retain the last checkpoint before the truncation point.
  *
- * PUBLIC: void __db_txnlist_ckp __P((DB_ENV *, void *, DB_LSN *));
+ * PUBLIC: void __db_txnlist_ckp __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *));
  */
 void
-__db_txnlist_ckp(dbenv, listp, ckp_lsn)
+__db_txnlist_ckp(dbenv, hp, ckp_lsn)
 	DB_ENV *dbenv;
-	void *listp;
+	DB_TXNHEAD *hp;
 	DB_LSN *ckp_lsn;
 {
-	DB_TXNHEAD *hp;
 
 	COMPQUIET(dbenv, NULL);
 
-	hp = (DB_TXNHEAD *)listp;
-
 	if (IS_ZERO_LSN(hp->ckplsn) && !IS_ZERO_LSN(hp->maxlsn) &&
-	    log_compare(&hp->maxlsn, ckp_lsn) >= 0)
+	    LOG_COMPARE(&hp->maxlsn, ckp_lsn) >= 0)
 		hp->ckplsn = *ckp_lsn;
 }
 
@@ -520,26 +508,24 @@ __db_txnlist_ckp(dbenv, listp, ckp_lsn)
  * __db_txnlist_end --
  *	Discard transaction linked list.
  *
- * PUBLIC: void __db_txnlist_end __P((DB_ENV *, void *));
+ * PUBLIC: void __db_txnlist_end __P((DB_ENV *, DB_TXNHEAD *));
  */
 void
-__db_txnlist_end(dbenv, listp)
+__db_txnlist_end(dbenv, hp)
 	DB_ENV *dbenv;
-	void *listp;
-{
 	DB_TXNHEAD *hp;
-	DB_TXNLIST *p;
+{
 	u_int32_t i;
+	DB_TXNLIST *p;
 
-	if ((hp = (DB_TXNHEAD *)listp) == NULL)
+	if (hp == NULL)
 		return;
 
 	for (i = 0; i < hp->nslots; i++)
 		while (hp != NULL && (p = LIST_FIRST(&hp->head[i])) != NULL) {
-			LIST_REMOVE(p, links);
 			switch (p->type) {
 			case TXNLIST_LSN:
-				__os_free(dbenv, p->u.l.lsn_array);
+				__os_free(dbenv, p->u.l.lsn_stack);
 				break;
 			case TXNLIST_DELETE:
 			case TXNLIST_PGNO:
@@ -551,12 +537,13 @@ __db_txnlist_end(dbenv, listp)
 				 */
 				break;
 			}
+			LIST_REMOVE(p, links);
 			__os_free(dbenv, p);
 		}
 
 	if (hp->gen_array != NULL)
 		__os_free(dbenv, hp->gen_array);
-	__os_free(dbenv, listp);
+	__os_free(dbenv, hp);
 }
 
 /*
@@ -568,12 +555,12 @@ __db_txnlist_end(dbenv, listp)
  *	was generated while not in a transaction.
  *
  * PUBLIC: int __db_txnlist_find __P((DB_ENV *,
- * PUBLIC:     void *, u_int32_t, u_int32_t *));
+ * PUBLIC:     DB_TXNHEAD *, u_int32_t, u_int32_t *));
  */
 int
-__db_txnlist_find(dbenv, listp, txnid, statusp)
+__db_txnlist_find(dbenv, hp, txnid, statusp)
 	DB_ENV *dbenv;
-	void *listp;
+	DB_TXNHEAD *hp;
 	u_int32_t txnid, *statusp;
 {
 	DB_TXNLIST *entry;
@@ -581,7 +568,7 @@ __db_txnlist_find(dbenv, listp, txnid, statusp)
 	if (txnid == 0)
 		return (DB_NOTFOUND);
 
-	return (__db_txnlist_find_internal(dbenv, listp,
+	return (__db_txnlist_find_internal(dbenv, hp,
 	    TXNLIST_TXNID, txnid, NULL, &entry, 0, statusp));
 }
 
@@ -590,32 +577,30 @@ __db_txnlist_find(dbenv, listp, txnid, statusp)
  *	Change the status of an existing transaction entry.
  *	Returns DB_NOTFOUND if no such entry exists.
  *
- * PUBLIC: int __db_txnlist_update __P((DB_ENV *,
- * PUBLIC:     void *, u_int32_t, u_int32_t, DB_LSN *, u_int32_t *, int));
+ * PUBLIC: int __db_txnlist_update __P((DB_ENV *, DB_TXNHEAD *,
+ * PUBLIC:     u_int32_t, u_int32_t, DB_LSN *, u_int32_t *, int));
  */
 int
-__db_txnlist_update(dbenv, listp, txnid, status, lsn, ret_status, add_ok)
+__db_txnlist_update(dbenv, hp, txnid, status, lsn, ret_status, add_ok)
 	DB_ENV *dbenv;
-	void *listp;
+	DB_TXNHEAD *hp;
 	u_int32_t txnid, status;
 	DB_LSN *lsn;
 	u_int32_t *ret_status;
 	int add_ok;
 {
-	DB_TXNHEAD *hp;
 	DB_TXNLIST *elp;
 	int ret;
 
 	if (txnid == 0)
 		return (DB_NOTFOUND);
 
-	hp = (DB_TXNHEAD *)listp;
 	ret = __db_txnlist_find_internal(dbenv,
-	    listp, TXNLIST_TXNID, txnid, NULL, &elp, 0, ret_status);
+	    hp, TXNLIST_TXNID, txnid, NULL, &elp, 0, ret_status);
 
 	if (ret == DB_NOTFOUND && add_ok) {
 		*ret_status = status;
-		return (__db_txnlist_add(dbenv, listp, txnid, status, lsn));
+		return (__db_txnlist_add(dbenv, hp, txnid, status, lsn));
 	}
 	if (ret != 0)
 		return (ret);
@@ -640,9 +625,9 @@ __db_txnlist_update(dbenv, listp, txnid, status, lsn, ret_status, add_ok)
  */
 static int
 __db_txnlist_find_internal(dbenv,
-    listp, type, txnid, uid, txnlistp, delete, statusp)
+    hp, type, txnid, uid, txnlistp, delete, statusp)
 	DB_ENV *dbenv;
-	void *listp;
+	DB_TXNHEAD *hp;
 	db_txnlist_type type;
 	u_int32_t  txnid;
 	u_int8_t uid[DB_FILE_ID_LEN];
@@ -651,14 +636,13 @@ __db_txnlist_find_internal(dbenv,
 	u_int32_t *statusp;
 {
 	struct __db_headlink *head;
-	DB_TXNHEAD *hp;
 	DB_TXNLIST *p;
 	u_int32_t generation, hash, i;
 	int ret;
 
 	ret = 0;
 
-	if ((hp = (DB_TXNHEAD *)listp) == NULL)
+	if (hp == NULL)
 		return (DB_NOTFOUND);
 
 	switch (type) {
@@ -674,7 +658,7 @@ __db_txnlist_find_internal(dbenv,
 			    (txnid >= hp->gen_array[i].txn_min ||
 			    txnid <= hp->gen_array[i].txn_max))
 				break;
-		DB_ASSERT(i <= hp->generation);
+		DB_ASSERT(dbenv, i <= hp->generation);
 		generation = hp->gen_array[i].generation;
 		break;
 	case TXNLIST_PGNO:
@@ -688,8 +672,7 @@ __db_txnlist_find_internal(dbenv,
 	}
 
 	head = &hp->head[DB_TXNLIST_MASK(hp, hash)];
-
-	for (p = LIST_FIRST(head); p != NULL; p = LIST_NEXT(p, links)) {
+	LIST_FOREACH(p, head, links) {
 		if (p->type != type)
 			continue;
 		switch (type) {
@@ -703,6 +686,7 @@ __db_txnlist_find_internal(dbenv,
 		case TXNLIST_PGNO:
 			if (memcmp(uid, p->u.p.uid, DB_FILE_ID_LEN) != 0)
 				continue;
+			*statusp = TXN_OK;
 			break;
 		case TXNLIST_DELETE:
 		case TXNLIST_LSN:
@@ -712,12 +696,14 @@ __db_txnlist_find_internal(dbenv,
 		if (delete == 1) {
 			LIST_REMOVE(p, links);
 			__os_free(dbenv, p);
+			*txnlistp = NULL;
 		} else if (p != LIST_FIRST(head)) {
 			/* Move it to head of list. */
 			LIST_REMOVE(p, links);
 			LIST_INSERT_HEAD(head, p, links);
-		}
-		*txnlistp = p;
+			*txnlistp = p;
+		} else
+			*txnlistp = p;
 		return (ret);
 	}
 
@@ -729,16 +715,15 @@ __db_txnlist_find_internal(dbenv,
  *	Change the current generation number.
  *
  * PUBLIC: int __db_txnlist_gen __P((DB_ENV *,
- * PUBLIC:       void *, int, u_int32_t, u_int32_t));
+ * PUBLIC:       DB_TXNHEAD *, int, u_int32_t, u_int32_t));
  */
 int
-__db_txnlist_gen(dbenv, listp, incr, min, max)
+__db_txnlist_gen(dbenv, hp, incr, min, max)
 	DB_ENV *dbenv;
-	void *listp;
+	DB_TXNHEAD *hp;
 	int incr;
 	u_int32_t min, max;
 {
-	DB_TXNHEAD *hp;
 	int ret;
 
 	/*
@@ -753,7 +738,6 @@ __db_txnlist_gen(dbenv, listp, incr, min, max)
 	 * is given the generation number of the first range it falls into
 	 * in the stack.
 	 */
-	hp = (DB_TXNHEAD *)listp;
 	if (incr < 0) {
 		--hp->generation;
 		memmove(hp->gen_array, &hp->gen_array[1],
@@ -775,71 +759,76 @@ __db_txnlist_gen(dbenv, listp, incr, min, max)
 	return (0);
 }
 
-#define	TXN_BUBBLE(AP, MAX) {						\
-	DB_LSN __tmp;							\
-	u_int32_t __j;							\
-									\
-	for (__j = 0; __j < MAX - 1; __j++)				\
-		if (log_compare(&AP[__j], &AP[__j + 1]) < 0) {		\
-			__tmp = AP[__j];				\
-			AP[__j] = AP[__j + 1];				\
-			AP[__j + 1] = __tmp;				\
-		}							\
-}
-
 /*
  * __db_txnlist_lsnadd --
- *	Add to or re-sort the transaction list lsn entry.  Note that since this
- *	is used during an abort, the __txn_undo code calls into the "recovery"
- *	subsystem explicitly, and there is only a single TXNLIST_LSN entry on
- *	the list.
+ *	Save the prev_lsn from a txn_child record.
  *
- * PUBLIC: int __db_txnlist_lsnadd __P((DB_ENV *, void *, DB_LSN *, u_int32_t));
+ * PUBLIC: int __db_txnlist_lsnadd __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *));
  */
 int
-__db_txnlist_lsnadd(dbenv, listp, lsnp, flags)
+__db_txnlist_lsnadd(dbenv, hp, lsnp)
 	DB_ENV *dbenv;
-	void *listp;
+	DB_TXNHEAD *hp;
 	DB_LSN *lsnp;
-	u_int32_t flags;
 {
-	DB_TXNHEAD *hp;
 	DB_TXNLIST *elp;
-	u_int32_t i;
 	int ret;
 
-	hp = (DB_TXNHEAD *)listp;
+	if (IS_ZERO_LSN(*lsnp))
+		return (0);
 
-	for (elp = LIST_FIRST(&hp->head[0]);
-	    elp != NULL; elp = LIST_NEXT(elp, links))
+	LIST_FOREACH(elp, &hp->head[0], links)
 		if (elp->type == TXNLIST_LSN)
 			break;
 
-	if (elp == NULL)
+	if (elp == NULL) {
+		if ((ret = __db_txnlist_lsninit(dbenv, hp, lsnp)) != 0)
+			return (ret);
 		return (DB_SURPRISE_KID);
+	}
 
-	if (LF_ISSET(TXNLIST_NEW)) {
-		if (elp->u.l.ntxns >= elp->u.l.maxn) {
-			if ((ret = __os_realloc(dbenv,
-			    2 * elp->u.l.maxn * sizeof(DB_LSN),
-			    &elp->u.l.lsn_array)) != 0)
-				return (ret);
-			elp->u.l.maxn *= 2;
+	if (elp->u.l.stack_indx == elp->u.l.stack_size) {
+		elp->u.l.stack_size <<= 1;
+		if ((ret = __os_realloc(dbenv, sizeof(DB_LSN) *
+		     elp->u.l.stack_size, &elp->u.l.lsn_stack)) != 0) {
+			__db_txnlist_end(dbenv, hp);
+			return (ret);
 		}
-		elp->u.l.lsn_array[elp->u.l.ntxns++] = *lsnp;
-	} else
-		/* Simply replace the 0th element. */
-		elp->u.l.lsn_array[0] = *lsnp;
+	}
+	elp->u.l.lsn_stack[elp->u.l.stack_indx++] = *lsnp;
 
-	/*
-	 * If we just added a new entry and there may be NULL entries, so we
-	 * have to do a complete bubble sort, not just trickle a changed entry
-	 * around.
-	 */
-	for (i = 0; i < (!LF_ISSET(TXNLIST_NEW) ? 1 : elp->u.l.ntxns); i++)
-		TXN_BUBBLE(elp->u.l.lsn_array, elp->u.l.ntxns);
+	return (0);
+}
+
+/*
+ * __db_txnlist_lsnget --
+ *
+ * PUBLIC: int __db_txnlist_lsnget __P((DB_ENV *,
+ * PUBLIC:     DB_TXNHEAD *, DB_LSN *, u_int32_t));
+ *	Get the lsn saved from a txn_child record.
+ */
+int
+__db_txnlist_lsnget(dbenv, hp, lsnp, flags)
+	DB_ENV *dbenv;
+	DB_TXNHEAD *hp;
+	DB_LSN *lsnp;
+	u_int32_t flags;
+{
+	DB_TXNLIST *elp;
+
+	COMPQUIET(dbenv, NULL);
+	COMPQUIET(flags, 0);
 
-	*lsnp = elp->u.l.lsn_array[0];
+	LIST_FOREACH(elp, &hp->head[0], links)
+		if (elp->type == TXNLIST_LSN)
+			break;
+
+	if (elp == NULL || elp->u.l.stack_indx == 0) {
+		ZERO_LSN(*lsnp);
+		return (0);
+	}
+
+	*lsnp = elp->u.l.lsn_stack[--elp->u.l.stack_indx];
 
 	return (0);
 }
@@ -865,13 +854,13 @@ __db_txnlist_lsninit(dbenv, hp, lsnp)
 		goto err;
 	LIST_INSERT_HEAD(&hp->head[0], elp, links);
 
+	elp->type = TXNLIST_LSN;
 	if ((ret = __os_malloc(dbenv,
-	    12 * sizeof(DB_LSN), &elp->u.l.lsn_array)) != 0)
+	    sizeof(DB_LSN) * DB_LSN_STACK_SIZE, &elp->u.l.lsn_stack)) != 0)
 		goto err;
-	elp->type = TXNLIST_LSN;
-	elp->u.l.maxn = 12;
-	elp->u.l.ntxns = 1;
-	elp->u.l.lsn_array[0] = *lsnp;
+	elp->u.l.stack_indx = 1;
+	elp->u.l.stack_size = DB_LSN_STACK_SIZE;
+	elp->u.l.lsn_stack[0] = *lsnp;
 
 	return (0);
 
@@ -879,23 +868,20 @@ err:	__db_txnlist_end(dbenv, hp);
 	return (ret);
 }
 
-#ifndef HAVE_FTRUNCATE
 /*
  * __db_add_limbo -- add pages to the limbo list.
  *	Get the file information and call pgnoadd for each page.
  *
- * PUBLIC: #ifndef HAVE_FTRUNCATE
  * PUBLIC: int __db_add_limbo __P((DB_ENV *,
- * PUBLIC:      void *, int32_t, db_pgno_t, int32_t));
- * PUBLIC: #endif
+ * PUBLIC:      DB_TXNHEAD *, int32_t, db_pgno_t, u_int32_t));
  */
 int
-__db_add_limbo(dbenv, info, fileid, pgno, count)
+__db_add_limbo(dbenv, hp, fileid, pgno, count)
 	DB_ENV *dbenv;
-	void *info;
+	DB_TXNHEAD *hp;
 	int32_t fileid;
 	db_pgno_t pgno;
-	int32_t count;
+	u_int32_t count;
 {
 	DB_LOG *dblp;
 	FNAME *fnp;
@@ -907,7 +893,7 @@ __db_add_limbo(dbenv, info, fileid, pgno, count)
 
 	do {
 		if ((ret =
-		    __db_txnlist_pgnoadd(dbenv, info, fileid, fnp->ufid,
+		    __db_txnlist_pgnoadd(dbenv, hp, fileid, fnp->ufid,
 		    R_ADDR(&dblp->reginfo, fnp->name_off), pgno)) != 0)
 			return (ret);
 		pgno++;
@@ -948,10 +934,8 @@ __db_add_limbo(dbenv, info, fileid, pgno, count)
  * "create list and write meta-data page" algorithm.  Otherwise, we're in
  * an abort and doing the "use compensating transaction" algorithm.
  *
- * PUBLIC: #ifndef HAVE_FTRUNCATE
  * PUBLIC: int __db_do_the_limbo __P((DB_ENV *,
  * PUBLIC:     DB_TXN *, DB_TXN *, DB_TXNHEAD *, db_limbo_state));
- * PUBLIC: #endif
  */
 int
 __db_do_the_limbo(dbenv, ptxn, txn, hp, state)
@@ -983,7 +967,7 @@ __db_do_the_limbo(dbenv, ptxn, txn, hp, state)
 	}
 
 err:	if (ret != 0) {
-		__db_err(dbenv, "Fatal error in abort of an allocation");
+		__db_errx(dbenv, "Fatal error in abort of an allocation");
 		ret = __db_panic(dbenv, ret);
 	}
 
@@ -1136,9 +1120,9 @@ retry:		dbp_created = 0;
 			dbp_created = 1;
 
 			/* It is ok if the file is nolonger there. */
-			ret = __db_open(dbp,
-			    t, elp->u.p.fname, NULL, DB_UNKNOWN,
-			    DB_ODDFILESIZE, __db_omode("rw----"), PGNO_BASE_MD);
+			ret = __db_open(dbp, t, elp->u.p.fname, NULL,
+			    DB_UNKNOWN, DB_ODDFILESIZE, __db_omode(OWNER_RW),
+			    PGNO_BASE_MD);
 			if (ret == ENOENT)
 				goto next;
 		}
@@ -1153,10 +1137,12 @@ retry:		dbp_created = 0;
 		mpf = dbp->mpf;
 		last_pgno = PGNO_INVALID;
 
-		if (meta == NULL && 
+		if (meta == NULL &&
 		    (ctxn == NULL || state == LIMBO_COMPENSATE)) {
 			pgno = PGNO_BASE_MD;
-			if ((ret = __memp_fget(mpf, &pgno, 0, &meta)) != 0)
+			if ((ret = __memp_fget(mpf, &pgno, txn,
+			    (state != LIMBO_PREPARE) ? DB_MPOOL_DIRTY : 0,
+			    &meta)) != 0)
 				goto err;
 			last_pgno = meta->free;
 		}
@@ -1194,13 +1180,11 @@ retry:		dbp_created = 0;
 			 * off the recovery flag briefly.
 			 */
 			if (state == LIMBO_COMPENSATE)
-				F_CLR(
-				    (DB_LOG *)dbenv->lg_handle, DBLOG_RECOVER);
+				F_CLR(dbenv->lg_handle, DBLOG_RECOVER);
 			ret = __txn_commit(ctxn, DB_TXN_NOSYNC);
 			ctxn = NULL;
 			if (state == LIMBO_COMPENSATE)
-				F_SET(
-				    (DB_LOG *)dbenv->lg_handle, DBLOG_RECOVER);
+				F_SET(dbenv->lg_handle, DBLOG_RECOVER);
 			if (ret != 0)
 				goto retry;
 		}
@@ -1225,7 +1209,7 @@ retry:		dbp_created = 0;
 			 * first so that it isn't pinned when we try to sync.
 			 */
 			if (!IS_RECOVERING(dbenv) && !T_RESTORED(txn))
-				__db_err(dbenv, "Flushing free list to disk");
+				__db_errx(dbenv, "Flushing free list to disk");
 			if ((ret = __memp_fput(mpf, meta, 0)) != 0)
 				goto err;
 			meta = NULL;
@@ -1240,18 +1224,16 @@ retry:		dbp_created = 0;
 			 */
 			if ((ret = __db_sync(dbp)) == 0) {
 				pgno = PGNO_BASE_MD;
-				if ((ret =
-				    __memp_fget(mpf, &pgno, 0, &meta)) != 0)
+				if ((ret = __memp_fget(mpf, &pgno, txn,
+				    DB_MPOOL_DIRTY, &meta)) != 0)
 					goto err;
 				meta->free = last_pgno;
-				if ((ret = __memp_fput(mpf,
-				     meta, DB_MPOOL_DIRTY)) != 0)
+				if ((ret = __memp_fput(mpf, meta, 0)) != 0)
 					goto err;
 				meta = NULL;
 			} else {
-				__db_err(dbenv,
-				    "%s: %s", dbp->fname, db_strerror(ret));
-				__db_err(dbenv, "%s: %s %s", dbp->fname,
+				__db_err(dbenv, ret, "%s", dbp->fname);
+				__db_errx(dbenv, "%s: %s %s", dbp->fname,
 				    "allocation flush failed, some free pages",
 				    "may not appear in the free list");
 				ret = 0;
@@ -1324,8 +1306,8 @@ __db_limbo_fix(dbp, ctxn, elp, lastp, meta, state)
 		if (pgno == PGNO_INVALID)
 			continue;
 
-		if ((ret =
-		    __memp_fget(mpf, &pgno, DB_MPOOL_CREATE, &pagep)) != 0) {
+		if ((ret = __memp_fget(mpf, &pgno, ctxn,
+		    DB_MPOOL_CREATE | DB_MPOOL_EDIT, &pagep)) != 0) {
 			if (ret != ENOSPC)
 				goto err;
 			continue;
@@ -1342,7 +1324,7 @@ __db_limbo_fix(dbp, ctxn, elp, lastp, meta, state)
 					if (next == pgno)
 						break;
 					if ((ret = __memp_fget(mpf,
-					    &next, 0, &freep)) != 0)
+					    &next, ctxn, 0, &freep)) != 0)
 						goto err;
 					next = NEXT_PGNO(freep);
 					if ((ret =
@@ -1382,7 +1364,16 @@ __db_limbo_fix(dbp, ctxn, elp, lastp, meta, state)
 				 * marked compensating, but in case we didn't
 				 * do the open, we have to mark it explicitly.
 				 */
-				F_SET(dbc, DBC_COMPENSATE);
+				F_SET(dbc, DBC_DONTLOCK);
+
+				/*
+				 * If aborting a txn for a different process
+				 * via XA or failchk, DB_AM_RECOVER will be
+				 * set but we need to log the compensating
+				 * transactions.
+				 */
+				F_CLR(dbc, DBC_RECOVER);
+
 				ret = __db_free(dbc, pagep);
 				pagep = NULL;
 
@@ -1407,15 +1398,15 @@ __db_limbo_fix(dbp, ctxn, elp, lastp, meta, state)
 			elp->u.p.pgno_array[i] = PGNO_INVALID;
 
 		if (pagep != NULL) {
-			ret = __memp_fput(mpf, pagep, DB_MPOOL_DIRTY);
+			ret = __memp_fput(mpf, pagep, 0);
 			pagep = NULL;
 		}
 		if (ret != 0)
 			goto err;
 	}
 
-err:	if (pagep != NULL &&
-	    (t_ret = __memp_fput(mpf, pagep, DB_MPOOL_DIRTY)) != 0 && ret == 0)
+err:	if (pagep != NULL && (t_ret = __memp_fput(mpf, pagep, 0)) != 0 &&
+	    ret == 0)
 		ret = t_ret;
 	if (dbc != NULL && (t_ret = __db_c_close(dbc)) != 0 && ret == 0)
 		ret = t_ret;
@@ -1446,8 +1437,8 @@ __db_limbo_prepare(dbp, txn, elp)
 	for (i = 0; i < elp->u.p.nentries; i++) {
 		pgno = elp->u.p.pgno_array[i];
 
-		if ((ret =
-		    __memp_fget(mpf, &pgno, DB_MPOOL_CREATE, &pagep)) != 0) {
+		if ((ret = __memp_fget(mpf,
+		    &pgno, txn, DB_MPOOL_CREATE, &pagep)) != 0) {
 			if (ret != ENOSPC)
 				return (ret);
 			continue;
@@ -1530,31 +1521,26 @@ __db_txnlist_pgnoadd(dbenv, hp, fileid, uid, fname, pgno)
 
 err:	return (ret);
 }
-#endif
 
 #ifdef DEBUG
 /*
  * __db_txnlist_print --
  *	Print out the transaction list.
  *
- * PUBLIC: void __db_txnlist_print __P((void *));
+ * PUBLIC: void __db_txnlist_print __P((DB_TXNHEAD *));
  */
 void
-__db_txnlist_print(listp)
-	void *listp;
-{
+__db_txnlist_print(hp)
 	DB_TXNHEAD *hp;
+{
 	DB_TXNLIST *p;
 	u_int32_t i;
 	char *txntype;
 
-	hp = (DB_TXNHEAD *)listp;
-
 	printf("Maxid: %lu Generation: %lu\n",
 	    (u_long)hp->maxid, (u_long)hp->generation);
 	for (i = 0; i < hp->nslots; i++)
-		for (p = LIST_FIRST(&hp->head[i]);
-		    p != NULL; p = LIST_NEXT(p, links)) {
+		LIST_FOREACH(p, &hp->head[i], links) {
 			if (p->type != TXNLIST_TXNID) {
 				printf("Unrecognized type: %d\n", p->type);
 				continue;
diff --git a/db/db/db_dup.c b/db/db/db_dup.c
index 725e81cce..84b326c0c 100644
--- a/db/db/db_dup.c
+++ b/db/db/db_dup.c
@@ -1,23 +1,16 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_dup.c,v 11.39 2004/02/18 21:34:37 bostic Exp $
+ * $Id: db_dup.c,v 12.9 2006/08/24 14:45:15 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/mp.h"
 #include "dbinc/db_am.h"
 
@@ -40,6 +33,9 @@ __db_ditem(dbc, pagep, indx, nbytes)
 	u_int8_t *from;
 
 	dbp = dbc->dbp;
+	DB_ASSERT(dbp->dbenv, IS_DIRTY(pagep));
+	DB_ASSERT(dbp->dbenv, indx < NUM_ENT(pagep));
+
 	if (DBC_LOGGING(dbc)) {
 		ldbt.data = P_ENTRY(dbp, pagep, indx);
 		ldbt.size = nbytes;
@@ -66,7 +62,7 @@ __db_ditem(dbc, pagep, indx, nbytes)
 	 * memmove(3), the regions may overlap.
 	 */
 	from = (u_int8_t *)pagep + HOFFSET(pagep);
-	DB_ASSERT((int)inp[indx] - HOFFSET(pagep) >= 0);
+	DB_ASSERT(dbp->dbenv, inp[indx] >= HOFFSET(pagep));
 	memmove(from + nbytes, from, inp[indx] - HOFFSET(pagep));
 	HOFFSET(pagep) += nbytes;
 
@@ -108,8 +104,10 @@ __db_pitem(dbc, pagep, indx, nbytes, hdr, data)
 	u_int8_t *p;
 
 	dbp = dbc->dbp;
+	DB_ASSERT(dbp->dbenv, IS_DIRTY(pagep));
+
 	if (nbytes > P_FREESPACE(dbp, pagep)) {
-		DB_ASSERT(nbytes <= P_FREESPACE(dbp, pagep));
+		DB_ASSERT(dbp->dbenv, nbytes <= P_FREESPACE(dbp, pagep));
 		return (EINVAL);
 	}
 	/*
@@ -138,7 +136,7 @@ __db_pitem(dbc, pagep, indx, nbytes, hdr, data)
 		LSN_NOT_LOGGED(LSN(pagep));
 
 	if (hdr == NULL) {
-		B_TSET(bk.type, B_KEYDATA, 0);
+		B_TSET(bk.type, B_KEYDATA);
 		bk.len = data == NULL ? 0 : data->size;
 
 		thdr.data = &bk;
diff --git a/db/db/db_iface.c b/db/db/db_iface.c
index 7be20ede1..bf41332df 100644
--- a/db/db/db_iface.c
+++ b/db/db/db_iface.c
@@ -1,71 +1,59 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_iface.c,v 11.121 2004/10/07 17:33:32 sue Exp $
+ * $Id: db_iface.c,v 12.51 2006/09/19 15:06:58 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/btree.h"
+#ifndef HAVE_HASH
 #include "dbinc/hash.h"			/* For __db_no_hash_am(). */
+#endif
+#ifndef HAVE_QUEUE
 #include "dbinc/qam.h"			/* For __db_no_queue_am(). */
+#endif
 #include "dbinc/lock.h"
 #include "dbinc/log.h"
 #include "dbinc/mp.h"
+#include "dbinc/txn.h"
 
 static int __db_associate_arg __P((DB *, DB *,
 	       int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
+static int __db_c_del_arg __P((DBC *, u_int32_t));
 static int __db_c_get_arg __P((DBC *, DBT *, DBT *, u_int32_t));
 static int __db_c_pget_arg __P((DBC *, DBT *, u_int32_t));
 static int __db_c_put_arg __P((DBC *, DBT *, DBT *, u_int32_t));
 static int __db_curinval __P((const DB_ENV *));
 static int __db_cursor_arg __P((DB *, u_int32_t));
-static int __db_del_arg __P((DB *, u_int32_t));
-static int __db_get_arg __P((const DB *, const DBT *, DBT *, u_int32_t));
+static int __db_del_arg __P((DB *, DBT *, u_int32_t));
+static int __db_get_arg __P((const DB *, DBT *, DBT *, u_int32_t));
 static int __db_join_arg __P((DB *, DBC **, u_int32_t));
 static int __db_open_arg __P((DB *,
 	       DB_TXN *, const char *, const char *, DBTYPE, u_int32_t));
 static int __db_pget_arg __P((DB *, DBT *, u_int32_t));
 static int __db_put_arg __P((DB *, DBT *, DBT *, u_int32_t));
-static int __db_rdonly __P((const DB_ENV *, const char *));
 static int __dbt_ferr __P((const DB *, const char *, const DBT *, int));
 
-/*
- * A database should be required to be readonly if it's been explicitly
- * specified as such or if we're a client in a replicated environment and
- * we don't have the special "client-writer" designation.
- */
-#define	IS_READONLY(dbp)						\
-    (F_ISSET(dbp, DB_AM_RDONLY) ||					\
-    (IS_REP_CLIENT((dbp)->dbenv) &&					\
-    !F_ISSET((dbp), DB_AM_CL_WRITER)))
-
 /*
  * These functions implement the Berkeley DB API.  They are organized in a
  * layered fashion.  The interface functions (XXX_pp) perform all generic
  * error checks (for example, PANIC'd region, replication state change
  * in progress, inconsistent transaction usage), call function-specific
  * check routines (_arg) to check for proper flag usage, etc., do pre-amble
- * processing (incrementing handle counts, handling auto-commit), call the
- * function and then do post-amble processing (DB_AUTO_COMMIT, dec handle
- * counts).
+ * processing (incrementing handle counts, handling local transactions),
+ * call the function and then do post-amble processing (local transactions,
+ * decrement handle counts).
  *
- * So, the basic structure is:
- *	Check for generic errors
- *	Call function-specific check routine
- *	Increment handle count
+ * The basic structure is:
+ *	Check for simple/generic errors (PANIC'd region)
+ *	Check if replication is changing state (increment handle count).
+ *	Call function-specific argument checking routine
  *	Create internal transaction if necessary
  *	Call underlying worker function
  *	Commit/abort internal transaction if necessary
@@ -88,14 +76,24 @@ __db_associate_pp(dbp, txn, sdbp, callback, flags)
 {
 	DBC *sdbc;
 	DB_ENV *dbenv;
-	int handle_check, ret, txn_local;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret, txn_local;
 
 	dbenv = dbp->dbenv;
+	txn_local = 0;
 
 	PANIC_CHECK(dbenv);
+	STRIP_AUTO_COMMIT(flags);
 
-	if ((ret = __db_associate_arg(dbp, sdbp, callback, flags)) != 0)
-		return (ret);
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check &&
+	    (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
 	/*
 	 * Secondary cursors may have the primary's lock file ID, so we need
@@ -104,46 +102,45 @@ __db_associate_pp(dbp, txn, sdbp, callback, flags)
 	 */
 	if (TAILQ_FIRST(&sdbp->active_queue) != NULL ||
 	    TAILQ_FIRST(&sdbp->join_queue) != NULL) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
     "Databases may not become secondary indices while cursors are open");
-		return (EINVAL);
+		ret = EINVAL;
+		goto err;
 	}
 
+	if ((ret = __db_associate_arg(dbp, sdbp, callback, flags)) != 0)
+		goto err;
+
 	/*
 	 * Create a local transaction as necessary, check for consistent
 	 * transaction usage, and, if we have no transaction but do have
 	 * locking on, acquire a locker id for the handle lock acquisition.
 	 */
-	txn_local = 0;
-	if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
-		if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
-			return (ret);
+	if (IS_DB_AUTO_COMMIT(dbp, txn)) {
+		if ((ret = __txn_begin(dbenv, NULL, &txn, 0)) != 0)
+			goto err;
 		txn_local = 1;
-		LF_CLR(DB_AUTO_COMMIT);
-	} else if (txn != NULL && !TXN_ON(dbenv))
-		return (__db_not_txn_env(dbenv));
+	}
 
 	/* Check for consistent transaction usage. */
 	if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0)
 		goto err;
 
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
-		goto err;
-
 	while ((sdbc = TAILQ_FIRST(&sdbp->free_queue)) != NULL)
 		if ((ret = __db_c_destroy(sdbc)) != 0)
-			break;
+			goto err;
 
-	if (ret == 0)
-		ret = __db_associate(dbp, txn, sdbp, callback, flags);
+	ret = __db_associate(dbp, txn, sdbp, callback, flags);
 
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+err:	if (txn_local &&
+	    (t_ret = __db_txn_auto_resolve(dbenv, txn, 0, ret)) && ret == 0)
+		ret = t_ret;
 
-err:	return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
+	/* Release replication block. */
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
+	ENV_LEAVE(dbenv, ip);
+	return (ret);
 }
 
 /*
@@ -162,47 +159,55 @@ __db_associate_arg(dbp, sdbp, callback, flags)
 	dbenv = dbp->dbenv;
 
 	if (F_ISSET(sdbp, DB_AM_SECONDARY)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "Secondary index handles may not be re-associated");
 		return (EINVAL);
 	}
 	if (F_ISSET(dbp, DB_AM_SECONDARY)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "Secondary indices may not be used as primary databases");
 		return (EINVAL);
 	}
 	if (F_ISSET(dbp, DB_AM_DUP)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "Primary databases may not be configured with duplicates");
 		return (EINVAL);
 	}
 	if (F_ISSET(dbp, DB_AM_RENUMBER)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 	    "Renumbering recno databases may not be used as primary databases");
 		return (EINVAL);
 	}
+
+	/*
+	 * It's OK for the primary and secondary to not share an environment IFF
+	 * the environments are local to the DB handle.  (Specifically, cursor
+	 * adjustment will work correctly in this case.)  The environment being
+	 * local implies the environment is not configured for either locking or
+	 * transactions, as neither of those could work correctly.
+	 */
 	if (dbp->dbenv != sdbp->dbenv &&
 	    (!F_ISSET(dbp->dbenv, DB_ENV_DBLOCAL) ||
 	     !F_ISSET(sdbp->dbenv, DB_ENV_DBLOCAL))) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 	    "The primary and secondary must be opened in the same environment");
 		return (EINVAL);
 	}
 	if ((DB_IS_THREADED(dbp) && !DB_IS_THREADED(sdbp)) ||
 	    (!DB_IS_THREADED(dbp) && DB_IS_THREADED(sdbp))) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 	    "The DB_THREAD setting must be the same for primary and secondary");
 		return (EINVAL);
 	}
 	if (callback == NULL &&
 	    (!F_ISSET(dbp, DB_AM_RDONLY) || !F_ISSET(sdbp, DB_AM_RDONLY))) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
     "Callback function may be NULL only when database handles are read-only");
 		return (EINVAL);
 	}
 
-	if ((ret = __db_fchk(dbenv,
-	    "DB->associate", flags, DB_CREATE | DB_AUTO_COMMIT)) != 0)
+	if ((ret = __db_fchk(dbenv, "DB->associate", flags, DB_CREATE |
+	    DB_IMMUTABLE_KEY)) != 0)
 		return (ret);
 
 	return (0);
@@ -220,6 +225,7 @@ __db_close_pp(dbp, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
@@ -228,20 +234,20 @@ __db_close_pp(dbp, flags)
 	PANIC_CHECK(dbenv);
 
 	/*
-	 * !!!
-	 * The actual argument checking is simple, do it inline.
+	 * Close a DB handle -- as a handle destructor, we can't fail.
 	 *
-	 * Validate arguments and complain if they're wrong, but as a DB
-	 * handle destructor, we can't fail.
+	 * !!!
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
 	 */
-	if (flags != 0 && flags != DB_NOSYNC &&
-	    (t_ret = __db_ferr(dbenv, "DB->close", 0)) != 0 && ret == 0)
-		ret = t_ret;
+	if (flags != 0 && flags != DB_NOSYNC)
+		ret = __db_ferr(dbenv, "DB->close", 0);
+
+	ENV_ENTER(dbenv, ip);
 
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (t_ret = __db_rep_enter(dbp, 0, 0, 0)) != 0) {
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (t_ret = __db_rep_enter(dbp, 0, 0, 0)) != 0) {
 		handle_check = 0;
 		if (ret == 0)
 			ret = t_ret;
@@ -251,9 +257,10 @@ __db_close_pp(dbp, flags)
 		ret = t_ret;
 
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -271,6 +278,7 @@ __db_cursor_pp(dbp, txn, dbcp, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	int handle_check, ret;
 
 	dbenv = dbp->dbenv;
@@ -278,30 +286,37 @@ __db_cursor_pp(dbp, txn, dbcp, flags)
 	PANIC_CHECK(dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->cursor");
 
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	if (txn == NULL) {
+		handle_check = IS_ENV_REPLICATED(dbenv) ? 1 : 0;
+		if (handle_check && (ret = __op_rep_enter(dbenv)) != 0) {
+			handle_check = 0;
+			goto err;
+		}
+	} else
+		handle_check = 0;
 	if ((ret = __db_cursor_arg(dbp, flags)) != 0)
-		return (ret);
+		goto err;
 
 	/*
-	 * Check for consistent transaction usage.  For now, assume that
-	 * this cursor might be used for read operations only (in which
-	 * case it may not require a txn).  We'll check more stringently
-	 * in c_del and c_put.  (Note that this all means that the
-	 * read-op txn tests have to be a subset of the write-op ones.)
+	 * Check for consistent transaction usage.  For now, assume this
+	 * cursor might be used for read operations only (in which case
+	 * it may not require a txn).  We'll check more stringently in
+	 * c_del and c_put.  (Note this means the read-op txn tests have
+	 * to be a subset of the write-op ones.)
 	 */
 	if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 1)) != 0)
-		return (ret);
-
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
-		return (ret);
+		goto err;
 
 	ret = __db_cursor(dbp, txn, dbcp, flags);
 
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+err:	/* Release replication block on error. */
+	if (ret != 0 && handle_check)
+		(void)__op_rep_exit(dbenv);
 
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -326,6 +341,14 @@ __db_cursor(dbp, txn, dbcp, flags)
 
 	dbenv = dbp->dbenv;
 
+	if (MULTIVERSION(dbp) && txn == NULL && (LF_ISSET(DB_TXN_SNAPSHOT) ||
+	    F_ISSET(dbenv, DB_ENV_TXN_SNAPSHOT))) {
+		if ((ret =
+		    __txn_begin(dbenv, NULL, &txn, DB_TXN_SNAPSHOT)) != 0)
+			return (ret);
+		F_SET(txn, TXN_PRIVATE);
+	}
+
 	if ((ret = __db_cursor_int(dbp,
 	    txn, dbp->type, PGNO_INVALID, 0, DB_LOCK_INVALIDID, &dbc)) != 0)
 		return (ret);
@@ -337,7 +360,8 @@ __db_cursor(dbp, txn, dbcp, flags)
 	if (CDB_LOCKING(dbenv)) {
 		op = LF_ISSET(DB_OPFLAGS_MASK);
 		mode = (op == DB_WRITELOCK) ? DB_LOCK_WRITE :
-		    ((op == DB_WRITECURSOR) ? DB_LOCK_IWRITE : DB_LOCK_READ);
+		    ((op == DB_WRITECURSOR || txn != NULL) ? DB_LOCK_IWRITE :
+		    DB_LOCK_READ);
 		if ((ret = __lock_get(dbenv, dbc->locker, 0,
 		    &dbc->lock_dbt, mode, &dbc->mylock)) != 0)
 			goto err;
@@ -347,13 +371,13 @@ __db_cursor(dbp, txn, dbcp, flags)
 			F_SET(dbc, DBC_WRITER);
 	}
 
-	if (LF_ISSET(DB_DIRTY_READ) ||
-	    (txn != NULL && F_ISSET(txn, TXN_DIRTY_READ)))
-		F_SET(dbc, DBC_DIRTY_READ);
+	if (LF_ISSET(DB_READ_UNCOMMITTED) ||
+	    (txn != NULL && F_ISSET(txn, TXN_READ_UNCOMMITTED)))
+		F_SET(dbc, DBC_READ_UNCOMMITTED);
 
-	if (LF_ISSET(DB_DEGREE_2) ||
-	    (txn != NULL && F_ISSET(txn, TXN_DEGREE_2)))
-		F_SET(dbc, DBC_DEGREE_2);
+	if (LF_ISSET(DB_READ_COMMITTED) ||
+	    (txn != NULL && F_ISSET(txn, TXN_READ_COMMITTED)))
+		F_SET(dbc, DBC_READ_COMMITTED);
 
 	*dbcp = dbc;
 	return (0);
@@ -376,27 +400,27 @@ __db_cursor_arg(dbp, flags)
 	dbenv = dbp->dbenv;
 
 	/*
-	 * DB_DIRTY_READ  and DB_DGREE_2 are the only valid bit-flags
-	 * and requires locking.
+	 * DB_READ_COMMITTED and DB_READ_UNCOMMITTED require locking.
 	 */
-	if (LF_ISSET(DB_DIRTY_READ | DB_DEGREE_2)) {
+	if (LF_ISSET(DB_READ_COMMITTED | DB_READ_UNCOMMITTED)) {
 		if (!LOCKING_ON(dbenv))
 			return (__db_fnl(dbenv, "DB->cursor"));
-		LF_CLR(DB_DIRTY_READ | DB_DEGREE_2);
 	}
 
+	LF_CLR(DB_READ_COMMITTED | DB_READ_UNCOMMITTED | DB_TXN_SNAPSHOT);
+
 	/* Check for invalid function flags. */
 	switch (flags) {
 	case 0:
 		break;
 	case DB_WRITECURSOR:
-		if (IS_READONLY(dbp))
+		if (DB_IS_READONLY(dbp))
 			return (__db_rdonly(dbenv, "DB->cursor"));
 		if (!CDB_LOCKING(dbenv))
 			return (__db_ferr(dbenv, "DB->cursor", 0));
 		break;
 	case DB_WRITELOCK:
-		if (IS_READONLY(dbp))
+		if (DB_IS_READONLY(dbp))
 			return (__db_rdonly(dbenv, "DB->cursor"));
 		break;
 	default:
@@ -420,41 +444,56 @@ __db_del_pp(dbp, txn, key, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret, txn_local;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret, txn_local;
 
 	dbenv = dbp->dbenv;
+	txn_local = 0;
 
 	PANIC_CHECK(dbenv);
+	STRIP_AUTO_COMMIT(flags);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->del");
 
-	if ((ret = __db_del_arg(dbp, flags)) != 0)
-		return (ret);
+#ifdef CONFIG_TEST
+	if (IS_REP_MASTER(dbenv))
+		DB_TEST_WAIT(dbenv, dbenv->test_check);
+#endif
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check &&
+	     (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
+			handle_check = 0;
+			goto err;
+	}
+
+	if ((ret = __db_del_arg(dbp, key, flags)) != 0)
+		goto err;
 
 	/* Create local transaction as necessary. */
-	if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
-		if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
-			return (ret);
+	if (IS_DB_AUTO_COMMIT(dbp, txn)) {
+		if ((ret = __txn_begin(dbenv, NULL, &txn, 0)) != 0)
+			goto err;
 		txn_local = 1;
-		LF_CLR(DB_AUTO_COMMIT);
-	} else
-		txn_local = 0;
+	}
 
 	/* Check for consistent transaction usage. */
 	if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0)
 		goto err;
 
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
-		goto err;
-
 	ret = __db_del(dbp, txn, key, flags);
 
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+err:	if (txn_local &&
+	    (t_ret = __db_txn_auto_resolve(dbenv, txn, 0, ret)) && ret == 0)
+		ret = t_ret;
 
-err:	return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
+	/* Release replication block. */
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
+	ENV_LEAVE(dbenv, ip);
+	__dbt_userfree(dbenv, key, NULL, NULL);
+	return (ret);
 }
 
 /*
@@ -462,22 +501,25 @@ err:	return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
  *	Check DB->delete arguments.
  */
 static int
-__db_del_arg(dbp, flags)
+__db_del_arg(dbp, key, flags)
 	DB *dbp;
+	DBT *key;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
+	int ret;
 
 	dbenv = dbp->dbenv;
 
 	/* Check for changes to a read-only tree. */
-	if (IS_READONLY(dbp))
+	if (DB_IS_READONLY(dbp))
 		return (__db_rdonly(dbenv, "DB->del"));
 
 	/* Check for invalid function flags. */
-	LF_CLR(DB_AUTO_COMMIT);
 	switch (flags) {
 	case 0:
+		if ((ret = __dbt_usercopy(dbenv, key)) != 0)
+			return (ret);
 		break;
 	default:
 		return (__db_ferr(dbenv, "DB->del", 0));
@@ -498,18 +540,21 @@ __db_fd_pp(dbp, fdp)
 	int *fdp;
 {
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	DB_FH *fhp;
-	int handle_check, ret;
+	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
 	PANIC_CHECK(dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->fd");
 
+	ENV_ENTER(dbenv, ip);
+
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
+	handle_check = IS_ENV_REPLICATED(dbenv);
 	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0)
-		return (ret);
+		goto err;
 
 	/*
 	 * !!!
@@ -521,21 +566,21 @@ __db_fd_pp(dbp, fdp)
 	 * XXX
 	 * Truly spectacular layering violation.
 	 */
-	if ((ret = __mp_xxx_fh(dbp->mpf, &fhp)) != 0)
-		goto err;
-
-	if (fhp == NULL) {
-		*fdp = -1;
-		__db_err(dbenv,
-		    "Database does not have a valid file handle");
-		ret = ENOENT;
-	} else
-		*fdp = fhp->fd;
+	if ((ret = __mp_xxx_fh(dbp->mpf, &fhp)) == 0) {
+		if (fhp == NULL) {
+			*fdp = -1;
+			__db_errx(dbenv,
+			    "Database does not have a valid file handle");
+			ret = ENOENT;
+		} else
+			*fdp = fhp->fd;
+	}
 
-err:	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	/* Release replication block. */
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+err:	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -553,29 +598,40 @@ __db_get_pp(dbp, txn, key, data, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	u_int32_t mode;
-	int handle_check, ret, txn_local;
+	int handle_check, ret, t_ret, txn_local;
 
 	dbenv = dbp->dbenv;
+	mode = 0;
+	txn_local = 0;
 
 	PANIC_CHECK(dbenv);
+	STRIP_AUTO_COMMIT(flags);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->get");
 
 	if ((ret = __db_get_arg(dbp, key, data, flags)) != 0)
 		return (ret);
 
-	mode = 0;
-	txn_local = 0;
-	if (LF_ISSET(DB_DIRTY_READ))
-		mode = DB_DIRTY_READ;
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check &&
+	     (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
+			handle_check = 0;
+			goto err;
+	}
+
+	if (LF_ISSET(DB_READ_UNCOMMITTED))
+		mode = DB_READ_UNCOMMITTED;
 	else if ((flags & DB_OPFLAGS_MASK) == DB_CONSUME ||
 	    (flags & DB_OPFLAGS_MASK) == DB_CONSUME_WAIT) {
 		mode = DB_WRITELOCK;
-		if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
-			if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
-				return (ret);
+		if (IS_DB_AUTO_COMMIT(dbp, txn)) {
+			if ((ret = __txn_begin(dbenv, NULL, &txn, 0)) != 0)
+				goto err;
 			txn_local = 1;
-			LF_CLR(DB_AUTO_COMMIT);
 		}
 	}
 
@@ -584,18 +640,19 @@ __db_get_pp(dbp, txn, key, data, flags)
 	    mode == DB_WRITELOCK || LF_ISSET(DB_RMW) ? 0 : 1)) != 0)
 		goto err;
 
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
-		goto err;
-
 	ret = __db_get(dbp, txn, key, data, flags);
 
+err:	if (txn_local &&
+	    (t_ret = __db_txn_auto_resolve(dbenv, txn, 0, ret)) && ret == 0)
+		ret = t_ret;
+
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
-err:	return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
+	ENV_LEAVE(dbenv, ip);
+	__dbt_userfree(dbenv, key, NULL, data);
+	return (ret);
 }
 
 /*
@@ -616,12 +673,12 @@ __db_get(dbp, txn, key, data, flags)
 	int ret, t_ret;
 
 	mode = 0;
-	if (LF_ISSET(DB_DIRTY_READ)) {
-		mode = DB_DIRTY_READ;
-		LF_CLR(DB_DIRTY_READ);
-	} else if (LF_ISSET(DB_DEGREE_2)) {
-		mode = DB_DEGREE_2;
-		LF_CLR(DB_DEGREE_2);
+	if (LF_ISSET(DB_READ_UNCOMMITTED)) {
+		mode = DB_READ_UNCOMMITTED;
+		LF_CLR(DB_READ_UNCOMMITTED);
+	} else if (LF_ISSET(DB_READ_COMMITTED)) {
+		mode = DB_READ_COMMITTED;
+		LF_CLR(DB_READ_COMMITTED);
 	} else if ((flags & DB_OPFLAGS_MASK) == DB_CONSUME ||
 	    (flags & DB_OPFLAGS_MASK) == DB_CONSUME_WAIT)
 		mode = DB_WRITELOCK;
@@ -666,8 +723,7 @@ __db_get(dbp, txn, key, data, flags)
 static int
 __db_get_arg(dbp, key, data, flags)
 	const DB *dbp;
-	const DBT *key;
-	DBT *data;
+	DBT *key, *data;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
@@ -684,14 +740,15 @@ __db_get_arg(dbp, key, data, flags)
 	 * flag in a path where CDB may have been configured.
 	 */
 	check_thread = dirty = 0;
-	if (LF_ISSET(DB_DIRTY_READ | DB_RMW | DB_DEGREE_2)) {
+	if (LF_ISSET(DB_READ_COMMITTED | DB_READ_UNCOMMITTED | DB_RMW)) {
 		if (!LOCKING_ON(dbenv))
 			return (__db_fnl(dbenv, "DB->get"));
-		dirty = LF_ISSET(DB_DIRTY_READ | DB_DEGREE_2);
-		if ((ret = __db_fcchk(dbenv,
-		    "DB->get", flags, DB_DIRTY_READ, DB_DEGREE_2)) != 0)
+		if ((ret = __db_fcchk(dbenv, "DB->get",
+		    flags, DB_READ_UNCOMMITTED, DB_READ_COMMITTED)) != 0)
 			return (ret);
-		LF_CLR(DB_DIRTY_READ | DB_RMW | DB_DEGREE_2);
+		if (LF_ISSET(DB_READ_COMMITTED | DB_READ_UNCOMMITTED))
+			dirty = 1;
+		LF_CLR(DB_READ_COMMITTED | DB_READ_UNCOMMITTED | DB_RMW);
 	}
 
 	multi = 0;
@@ -702,30 +759,33 @@ __db_get_arg(dbp, key, data, flags)
 		LF_CLR(DB_MULTIPLE);
 	}
 
-	if (LF_ISSET(DB_AUTO_COMMIT)) {
-		LF_CLR(DB_AUTO_COMMIT);
-		if (flags != DB_CONSUME && flags != DB_CONSUME_WAIT)
-			goto err;
-	}
-
 	/* Check for invalid function flags. */
 	switch (flags) {
-	case 0:
 	case DB_GET_BOTH:
+		if ((ret = __dbt_usercopy(dbenv, data)) != 0)
+			return (ret);
+		/* FALLTHROUGH */
+	case 0:
+		if ((ret = __dbt_usercopy(dbenv, key)) != 0) {
+			__dbt_userfree(dbenv, key, NULL, data);
+			return (ret);
+		}
 		break;
 	case DB_SET_RECNO:
 		check_thread = 1;
 		if (!F_ISSET(dbp, DB_AM_RECNUM))
 			goto err;
+		if ((ret = __dbt_usercopy(dbenv, key)) != 0)
+			return (ret);
 		break;
 	case DB_CONSUME:
 	case DB_CONSUME_WAIT:
 		check_thread = 1;
 		if (dirty) {
-			__db_err(dbenv,
-    "%s is not supported with DB_CONSUME or DB_CONSUME_WAIT",
-			     LF_ISSET(DB_DIRTY_READ) ?
-			     "DB_DIRTY_READ" : "DB_DEGREE_2");
+			__db_errx(dbenv,
+		    "%s is not supported with DB_CONSUME or DB_CONSUME_WAIT",
+			     LF_ISSET(DB_READ_UNCOMMITTED) ?
+			     "DB_READ_UNCOMMITTED" : "DB_READ_COMMITTED");
 			return (EINVAL);
 		}
 		if (multi)
@@ -750,19 +810,19 @@ err:		return (__db_ferr(dbenv, "DB->get", 0));
 
 	if (multi) {
 		if (!F_ISSET(data, DB_DBT_USERMEM)) {
-			__db_err(dbenv,
+			__db_errx(dbenv,
 			    "DB_MULTIPLE requires DB_DBT_USERMEM be set");
 			return (EINVAL);
 		}
 		if (F_ISSET(key, DB_DBT_PARTIAL) ||
 		    F_ISSET(data, DB_DBT_PARTIAL)) {
-			__db_err(dbenv,
+			__db_errx(dbenv,
 			    "DB_MULTIPLE does not support DB_DBT_PARTIAL");
 			return (EINVAL);
 		}
 		if (data->ulen < 1024 ||
 		    data->ulen < dbp->pgsize || data->ulen % 1024 != 0) {
-			__db_err(dbenv, "%s%s",
+			__db_errx(dbenv, "%s%s",
 			    "DB_MULTIPLE buffers must be ",
 			    "aligned, at least page size and multiples of 1KB");
 			return (EINVAL);
@@ -785,27 +845,31 @@ __db_join_pp(primary, curslist, dbcp, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
 
 	dbenv = primary->dbenv;
 
 	PANIC_CHECK(dbenv);
 
-	if ((ret = __db_join_arg(primary, curslist, flags)) != 0)
-		return (ret);
+	ENV_ENTER(dbenv, ip);
 
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, primary);
+	handle_check = IS_ENV_REPLICATED(dbenv);
 	if (handle_check && (ret =
-	    __db_rep_enter(primary, 1, 0, curslist[0]->txn != NULL)) != 0)
-		return (ret);
+	    __db_rep_enter(primary, 1, 0, curslist[0]->txn != NULL)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
-	ret = __db_join(primary, curslist, dbcp, flags);
+	if ((ret = __db_join_arg(primary, curslist, flags)) == 0)
+		ret = __db_join(primary, curslist, dbcp, flags);
 
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+err:	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -834,7 +898,7 @@ __db_join_arg(primary, curslist, flags)
 	}
 
 	if (curslist == NULL || curslist[0] == NULL) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 	    "At least one secondary cursor must be specified to DB->join");
 		return (EINVAL);
 	}
@@ -842,7 +906,7 @@ __db_join_arg(primary, curslist, flags)
 	txn = curslist[0]->txn;
 	for (i = 1; curslist[i] != NULL; i++)
 		if (curslist[i]->txn != txn) {
-			__db_err(dbenv,
+			__db_errx(dbenv,
 		    "All secondary cursors must share the same transaction");
 			return (EINVAL);
 		}
@@ -867,6 +931,7 @@ __db_key_range_pp(dbp, txn, key, kr, flags)
 {
 	DBC *dbc;
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
@@ -876,19 +941,25 @@ __db_key_range_pp(dbp, txn, key, kr, flags)
 
 	/*
 	 * !!!
-	 * The actual argument checking is simple, do it inline.
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
 	 */
 	if (flags != 0)
 		return (__db_ferr(dbenv, "DB->key_range", 0));
 
-	/* Check for consistent transaction usage. */
-	if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 1)) != 0)
-		return (ret);
+	ENV_ENTER(dbenv, ip);
 
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
-		return (ret);
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check &&
+	     (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
+
+	/* Check for consistent transaction usage. */
+	if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 1)) != 0)
+		goto err;
 
 	/*
 	 * !!!
@@ -896,6 +967,9 @@ __db_key_range_pp(dbp, txn, key, kr, flags)
 	 */
 	switch (dbp->type) {
 	case DB_BTREE:
+		if ((ret = __dbt_usercopy(dbenv, key)) != 0)
+			goto err;
+
 		/* Acquire a cursor. */
 		if ((ret = __db_cursor(dbp, txn, &dbc, 0)) != 0)
 			break;
@@ -906,6 +980,7 @@ __db_key_range_pp(dbp, txn, key, kr, flags)
 
 		if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0)
 			ret = t_ret;
+		__dbt_userfree(dbenv, key, NULL, NULL);
 		break;
 	case DB_HASH:
 	case DB_QUEUE:
@@ -918,10 +993,11 @@ __db_key_range_pp(dbp, txn, key, kr, flags)
 		break;
 	}
 
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+err:	/* Release replication block. */
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -942,16 +1018,17 @@ __db_open_pp(dbp, txn, fname, dname, type, flags, mode)
 	int mode;
 {
 	DB_ENV *dbenv;
-	int handle_check, nosync, remove_me, ret, txn_local;
+	DB_THREAD_INFO *ip;
+	int handle_check, nosync, remove_me, ret, t_ret, txn_local;
 
 	dbenv = dbp->dbenv;
 	nosync = 1;
-	remove_me = 0;
+	remove_me = txn_local = 0;
+	handle_check = 0;
 
 	PANIC_CHECK(dbenv);
 
-	if ((ret = __db_open_arg(dbp, txn, fname, dname, type, flags)) != 0)
-		return (ret);
+	ENV_ENTER(dbenv, ip);
 
 	/*
 	 * Save the file and database names and flags.  We do this here
@@ -959,40 +1036,48 @@ __db_open_pp(dbp, txn, fname, dname, type, flags, mode)
 	 * DB->open method call, we strip DB_AUTO_COMMIT at this layer.
 	 */
 	if ((fname != NULL &&
-	    (ret = __os_strdup(dbenv, fname, &dbp->fname)) != 0) ||
-	    (dname != NULL &&
+	    (ret = __os_strdup(dbenv, fname, &dbp->fname)) != 0))
+		goto err;
+	if ((dname != NULL &&
 	    (ret = __os_strdup(dbenv, dname, &dbp->dname)) != 0))
-		return (ret);
+		goto err;
 	dbp->open_flags = flags;
 
 	/* Save the current DB handle flags for refresh. */
 	dbp->orig_flags = dbp->flags;
 
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check &&
+	    (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
+
 	/*
 	 * Create local transaction as necessary, check for consistent
 	 * transaction usage.
 	 */
-	txn_local = 0;
-	if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
+	if (IS_ENV_AUTO_COMMIT(dbenv, txn, flags)) {
 		if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
-			return (ret);
+			goto err;
 		txn_local = 1;
-		LF_CLR(DB_AUTO_COMMIT);
-	} else
-		if (txn != NULL && !TXN_ON(dbenv))
-			return (__db_not_txn_env(dbenv));
-
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
-		handle_check = 0;
+	} else if (txn != NULL && !TXN_ON(dbenv) &&
+	    (!CDB_LOCKING(dbenv) || !F_ISSET(txn, TXN_CDSGROUP))) {
+		ret = __db_not_txn_env(dbenv);
 		goto err;
 	}
+	LF_CLR(DB_AUTO_COMMIT);
 
-	if ((ret = __db_open(dbp,
-	    txn, fname, dname, type, flags, mode, PGNO_BASE_MD)) != 0)
-		goto err;
+	/*
+	 * We check arguments after possibly creating a local transaction,
+	 * which is unusual -- the reason is some flags are illegal if any
+	 * kind of transaction is in effect.
+	 */
+	if ((ret = __db_open_arg(dbp, txn, fname, dname, type, flags)) == 0)
+		if ((ret = __db_open(dbp, txn, fname, dname, type,
+		    flags, mode, PGNO_BASE_MD)) != 0)
+			goto txnerr;
 
 	/*
 	 * You can open the database that describes the subdatabases in the
@@ -1006,10 +1091,10 @@ __db_open_pp(dbp, txn, fname, dname, type, flags, mode)
 	 */
 	if (dname == NULL && !IS_RECOVERING(dbenv) && !LF_ISSET(DB_RDONLY) &&
 	    !LF_ISSET(DB_RDWRMASTER) && F_ISSET(dbp, DB_AM_SUBDB)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
     "files containing multiple databases may only be opened read-only");
 		ret = EINVAL;
-		goto err;
+		goto txnerr;
 	}
 
 	/*
@@ -1026,7 +1111,7 @@ __db_open_pp(dbp, txn, fname, dname, type, flags, mode)
 	 * If not transactional, remove the databases/subdatabases.  If we're
 	 * transactional, the child transaction abort cleans up.
 	 */
-err:	if (ret != 0 && txn == NULL) {
+txnerr:	if (ret != 0 && !IS_REAL_TXN(txn)) {
 		remove_me = F_ISSET(dbp, DB_AM_CREATED);
 		if (F_ISSET(dbp, DB_AM_CREATED_MSTR) ||
 		    (dname == NULL && remove_me))
@@ -1037,12 +1122,16 @@ err:	if (ret != 0 && txn == NULL) {
 			(void)__db_remove_int(dbp, txn, fname, dname, DB_FORCE);
 	}
 
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (txn_local && (t_ret =
+	     __db_txn_auto_resolve(dbenv, txn, nosync, ret)) && ret == 0)
+		ret = t_ret;
 
-	return (txn_local ?
-	    __db_txn_auto_resolve(dbenv, txn, nosync, ret) : ret);
+err:	/* Release replication block. */
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
+
+	ENV_LEAVE(dbenv, ip);
+	return (ret);
 }
 
 /*
@@ -1066,9 +1155,10 @@ __db_open_arg(dbp, txn, fname, dname, type, flags)
 	/* Validate arguments. */
 #undef	OKFLAGS
 #define	OKFLAGS								\
-    (DB_AUTO_COMMIT | DB_CREATE | DB_DIRTY_READ | DB_EXCL |		\
-     DB_FCNTL_LOCKING | DB_NO_AUTO_COMMIT | DB_NOMMAP | DB_RDONLY |	\
-     DB_RDWRMASTER | DB_THREAD | DB_TRUNCATE | DB_WRITEOPEN)
+	(DB_AUTO_COMMIT | DB_CREATE | DB_EXCL | DB_FCNTL_LOCKING |	\
+	DB_MULTIVERSION | DB_NOMMAP | DB_NO_AUTO_COMMIT | DB_RDONLY |	\
+	DB_RDWRMASTER | DB_READ_UNCOMMITTED | DB_THREAD | DB_TRUNCATE |	\
+	DB_WRITEOPEN)
 	if ((ret = __db_fchk(dbenv, "DB->open", flags, OKFLAGS)) != 0)
 		return (ret);
 	if (LF_ISSET(DB_EXCL) && !LF_ISSET(DB_CREATE))
@@ -1078,16 +1168,15 @@ __db_open_arg(dbp, txn, fname, dname, type, flags)
 
 #ifdef	HAVE_VXWORKS
 	if (LF_ISSET(DB_TRUNCATE)) {
-		__db_err(dbenv, "DB_TRUNCATE not supported on VxWorks");
+		__db_errx(dbenv, "DB_TRUNCATE not supported on VxWorks");
 		return (DB_OPNOTSUP);
 	}
 #endif
 	switch (type) {
 	case DB_UNKNOWN:
 		if (LF_ISSET(DB_CREATE|DB_TRUNCATE)) {
-			__db_err(dbenv,
-	    "%s: DB_UNKNOWN type specified with DB_CREATE or DB_TRUNCATE",
-			    fname);
+			__db_errx(dbenv,
+	    "DB_UNKNOWN type specified with DB_CREATE or DB_TRUNCATE");
 			return (EINVAL);
 		}
 		ok_flags = 0;
@@ -1111,7 +1200,7 @@ __db_open_arg(dbp, txn, fname, dname, type, flags)
 		ok_flags = DB_OK_RECNO;
 		break;
 	default:
-		__db_err(dbenv, "unknown type: %lu", (u_long)type);
+		__db_errx(dbenv, "unknown type: %lu", (u_long)type);
 		return (EINVAL);
 	}
 	if (ok_flags)
@@ -1119,7 +1208,7 @@ __db_open_arg(dbp, txn, fname, dname, type, flags)
 
 	/* The environment may have been created, but never opened. */
 	if (!F_ISSET(dbenv, DB_ENV_DBLOCAL | DB_ENV_OPEN_CALLED)) {
-		__db_err(dbenv, "environment not yet opened");
+		__db_errx(dbenv, "database environment not yet opened");
 		return (EINVAL);
 	}
 
@@ -1129,7 +1218,7 @@ __db_open_arg(dbp, txn, fname, dname, type, flags)
 	 * no longer works.
 	 */
 	if (!F_ISSET(dbenv, DB_ENV_DBLOCAL) && !MPOOL_ON(dbenv)) {
-		__db_err(dbenv, "environment did not include a memory pool");
+		__db_errx(dbenv, "environment did not include a memory pool");
 		return (EINVAL);
 	}
 
@@ -1139,13 +1228,26 @@ __db_open_arg(dbp, txn, fname, dname, type, flags)
 	 */
 	if (LF_ISSET(DB_THREAD) &&
 	    !F_ISSET(dbenv, DB_ENV_DBLOCAL | DB_ENV_THREAD)) {
-		__db_err(dbenv, "environment not created using DB_THREAD");
+		__db_errx(dbenv, "environment not created using DB_THREAD");
+		return (EINVAL);
+	}
+
+	/* DB_MULTIVERSION requires a database configured for transactions. */
+	if (LF_ISSET(DB_MULTIVERSION) && !IS_REAL_TXN(txn)) {
+		__db_errx(dbenv,
+		    "DB_MULTIVERSION illegal without a transaction specified");
+		return (EINVAL);
+	}
+
+	if (LF_ISSET(DB_MULTIVERSION) && type == DB_QUEUE) {
+		__db_errx(dbenv,
+		    "DB_MULTIVERSION illegal with queue databases");
 		return (EINVAL);
 	}
 
 	/* DB_TRUNCATE is neither transaction recoverable nor lockable. */
 	if (LF_ISSET(DB_TRUNCATE) && (LOCKING_ON(dbenv) || txn != NULL)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "DB_TRUNCATE illegal with %s specified",
 		    LOCKING_ON(dbenv) ? "locking" : "transactions");
 		return (EINVAL);
@@ -1153,18 +1255,19 @@ __db_open_arg(dbp, txn, fname, dname, type, flags)
 
 	/* Subdatabase checks. */
 	if (dname != NULL) {
-		/* Subdatabases must be created in named files. */
-		if (fname == NULL) {
-			__db_err(dbenv,
-		    "multiple databases cannot be created in temporary files");
+		/* QAM can only be done on in-memory subdatabases. */
+		if (type == DB_QUEUE && fname != NULL) {
+			__db_errx(
+			    dbenv, "Queue databases must be one-per-file");
 			return (EINVAL);
 		}
 
-		/* QAM can't be done as a subdatabase. */
-		if (type == DB_QUEUE) {
-			__db_err(dbenv, "Queue databases must be one-per-file");
-			return (EINVAL);
-		}
+		/*
+		 * Named in-memory databases can't support certain flags,
+		 * so check here.
+		 */
+		if (fname == NULL)
+			F_CLR(dbp, DB_AM_CHKSUM | DB_AM_ENCRYPT);
 	}
 
 	return (0);
@@ -1185,30 +1288,38 @@ __db_pget_pp(dbp, txn, skey, pkey, data, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
 	PANIC_CHECK(dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->pget");
 
-	if ((ret = __db_pget_arg(dbp, pkey, flags)) != 0)
+	if ((ret = __db_pget_arg(dbp, pkey, flags)) != 0 ||
+	    (ret = __db_get_arg(dbp, skey, data, flags)) != 0) {
+		__dbt_userfree(dbenv, skey, pkey, data);
 		return (ret);
+	}
 
-	if ((ret = __db_get_arg(dbp, skey, data, flags)) != 0)
-		return (ret);
+	ENV_ENTER(dbenv, ip);
 
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
-		return (ret);
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check &&
+	    (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
 	ret = __db_pget(dbp, txn, skey, pkey, data, flags);
 
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+err:	/* Release replication block. */
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+	ENV_LEAVE(dbenv, ip);
+	__dbt_userfree(dbenv, skey, pkey, data);
 	return (ret);
 }
 
@@ -1227,9 +1338,19 @@ __db_pget(dbp, txn, skey, pkey, data, flags)
 	u_int32_t flags;
 {
 	DBC *dbc;
+	u_int32_t mode;
 	int ret, t_ret;
 
-	if ((ret = __db_cursor(dbp, txn, &dbc, 0)) != 0)
+	if (LF_ISSET(DB_READ_UNCOMMITTED)) {
+		mode = DB_READ_UNCOMMITTED;
+		LF_CLR(DB_READ_UNCOMMITTED);
+	} else if (LF_ISSET(DB_READ_COMMITTED)) {
+		mode = DB_READ_COMMITTED;
+		LF_CLR(DB_READ_COMMITTED);
+	} else
+		mode = 0;
+
+	if ((ret = __db_cursor(dbp, txn, &dbc, mode)) != 0)
 		return (ret);
 
 	SET_RET_MEM(dbc, dbp);
@@ -1284,19 +1405,19 @@ __db_pget_arg(dbp, pkey, flags)
 	dbenv = dbp->dbenv;
 
 	if (!F_ISSET(dbp, DB_AM_SECONDARY)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "DB->pget may only be used on secondary indices");
 		return (EINVAL);
 	}
 
 	if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 	"DB_MULTIPLE and DB_MULTIPLE_KEY may not be used on secondary indices");
 		return (EINVAL);
 	}
 
 	/* DB_CONSUME makes no sense on a secondary index. */
-	LF_CLR(DB_RMW);
+	LF_CLR(DB_READ_COMMITTED | DB_READ_UNCOMMITTED | DB_RMW);
 	switch (flags) {
 	case DB_CONSUME:
 	case DB_CONSUME_WAIT:
@@ -1314,11 +1435,15 @@ __db_pget_arg(dbp, pkey, flags)
 	    (ret = __dbt_ferr(dbp, "primary key", pkey, 1)) != 0)
 		return (ret);
 
-	/* But the pkey field can't be NULL if we're doing a DB_GET_BOTH. */
-	if (pkey == NULL && flags == DB_GET_BOTH) {
-		__db_err(dbenv,
+	if (flags == DB_GET_BOTH) {
+		/* The pkey field can't be NULL if we're doing a DB_GET_BOTH. */
+		if (pkey == NULL) {
+			__db_errx(dbenv,
 		    "DB_GET_BOTH on a secondary index requires a primary key");
-		return (EINVAL);
+			return (EINVAL);
+		}
+		if ((ret = __dbt_usercopy(dbenv, pkey)) != 0)
+			return (ret);
 	}
 
 	return (0);
@@ -1338,41 +1463,53 @@ __db_put_pp(dbp, txn, key, data, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret, txn_local;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, txn_local, t_ret;
 
 	dbenv = dbp->dbenv;
+	txn_local = 0;
 
 	PANIC_CHECK(dbenv);
+	STRIP_AUTO_COMMIT(flags);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->put");
 
 	if ((ret = __db_put_arg(dbp, key, data, flags)) != 0)
 		return (ret);
 
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check &&
+	    (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
+
 	/* Create local transaction as necessary. */
-	if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
-		if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
-			return (ret);
+	if (IS_DB_AUTO_COMMIT(dbp, txn)) {
+		if ((ret = __txn_begin(dbenv, NULL, &txn, 0)) != 0)
+			goto err;
 		txn_local = 1;
-		LF_CLR(DB_AUTO_COMMIT);
-	} else
-		txn_local = 0;
+	}
 
 	/* Check for consistent transaction usage. */
 	if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0)
 		goto err;
 
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
-		goto err;
-
 	ret = __db_put(dbp, txn, key, data, flags);
 
+err:	if (txn_local &&
+	    (t_ret = __db_txn_auto_resolve(dbenv, txn, 0, ret)) && ret == 0)
+		ret = t_ret;
+
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
-err:	return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
+	ENV_LEAVE(dbenv, ip);
+	__dbt_userfree(dbenv, key, NULL, data);
+	return (ret);
 }
 
 /*
@@ -1392,17 +1529,16 @@ __db_put_arg(dbp, key, data, flags)
 	returnkey = 0;
 
 	/* Check for changes to a read-only tree. */
-	if (IS_READONLY(dbp))
-		return (__db_rdonly(dbenv, "put"));
+	if (DB_IS_READONLY(dbp))
+		return (__db_rdonly(dbenv, "DB->put"));
 
 	/* Check for puts on a secondary. */
 	if (F_ISSET(dbp, DB_AM_SECONDARY)) {
-		__db_err(dbenv, "DB->put forbidden on secondary indices");
+		__db_errx(dbenv, "DB->put forbidden on secondary indices");
 		return (EINVAL);
 	}
 
 	/* Check for invalid function flags. */
-	LF_CLR(DB_AUTO_COMMIT);
 	switch (flags) {
 	case 0:
 	case DB_NOOVERWRITE:
@@ -1433,14 +1569,94 @@ err:		return (__db_ferr(dbenv, "DB->put", 0));
 	/* Check for partial puts in the presence of duplicates. */
 	if (F_ISSET(data, DB_DBT_PARTIAL) &&
 	    (F_ISSET(dbp, DB_AM_DUP) || F_ISSET(key, DB_DBT_DUPOK))) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 "a partial put in the presence of duplicates requires a cursor operation");
 		return (EINVAL);
 	}
 
+	if ((flags != DB_APPEND && (ret = __dbt_usercopy(dbenv, key)) != 0) ||
+	    (ret = __dbt_usercopy(dbenv, data)) != 0)
+		return (ret);
+
 	return (0);
 }
 
+/*
+ * __db_compact_pp --
+ *	DB->compact pre/post processing.
+ *
+ * PUBLIC: int __db_compact_pp __P((DB *, DB_TXN *,
+ * PUBLIC:       DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *));
+ */
+int
+__db_compact_pp(dbp, txn, start, stop, c_data, flags, end)
+	DB *dbp;
+	DB_TXN *txn;
+	DBT *start, *stop;
+	DB_COMPACT *c_data;
+	u_int32_t flags;
+	DBT *end;
+{
+	DB_COMPACT *dp, l_data;
+	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
+
+	dbenv = dbp->dbenv;
+
+	PANIC_CHECK(dbenv);
+	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->compact");
+
+	/*
+	 * !!!
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
+	 */
+	if ((flags & ~DB_COMPACT_FLAGS) != 0)
+		return (__db_ferr(dbenv, "DB->compact", 0));
+
+	/* Check for changes to a read-only database. */
+	if (DB_IS_READONLY(dbp))
+		return (__db_rdonly(dbenv, "DB->compact"));
+
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
+
+	if (c_data == NULL) {
+		dp = &l_data;
+		memset(dp, 0, sizeof(*dp));
+	} else
+		dp = c_data;
+
+	switch (dbp->type) {
+	case DB_HASH:
+		if (!LF_ISSET(DB_FREELIST_ONLY))
+			goto err;
+		/* FALLTHROUGH */
+	case DB_BTREE:
+	case DB_RECNO:
+		ret = __bam_compact(dbp, txn, start, stop, dp, flags, end);
+		break;
+
+	default:
+err:		ret = __dbh_am_chk(dbp, DB_OK_BTREE);
+		break;
+	}
+
+	/* Release replication block. */
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
+
+	ENV_LEAVE(dbenv, ip);
+	return (ret);
+}
+
 /*
  * __db_sync_pp --
  *	DB->sync pre/post processing.
@@ -1453,31 +1669,38 @@ __db_sync_pp(dbp, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
-	PANIC_CHECK(dbp->dbenv);
+	PANIC_CHECK(dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->sync");
 
 	/*
 	 * !!!
-	 * The actual argument checking is simple, do it inline.
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
 	 */
 	if (flags != 0)
 		return (__db_ferr(dbenv, "DB->sync", 0));
 
+	ENV_ENTER(dbenv, ip);
+
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0)
-		return (ret);
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
 	ret = __db_sync(dbp);
 
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+err:	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -1492,13 +1715,15 @@ __db_c_close_pp(dbc)
 	DBC *dbc;
 {
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	DB *dbp;
-	int handle_check, ret;
+	int handle_check, ret, t_ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
 
 	PANIC_CHECK(dbenv);
+	ENV_ENTER(dbenv, ip);
 
 	/*
 	 * If the cursor is already closed we have a serious problem, and we
@@ -1506,24 +1731,21 @@ __db_c_close_pp(dbc)
 	 * the remaining cursor close processing.
 	 */
 	if (!F_ISSET(dbc, DBC_ACTIVE)) {
-		if (dbp != NULL)
-			__db_err(dbenv, "Closing already-closed cursor");
-		DB_ASSERT(0);
-		return (EINVAL);
+		__db_errx(dbenv, "Closing already-closed cursor");
+		ret = EINVAL;
+		goto err;
 	}
 
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 0, 0, dbc->txn != NULL)) != 0)
-		return (ret);
-
+	handle_check = dbc->txn == NULL && IS_ENV_REPLICATED(dbenv);
 	ret = __db_c_close(dbc);
 
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check &&
+	    (t_ret = __op_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+err:	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -1540,8 +1762,9 @@ __db_c_count_pp(dbc, recnop, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	DB *dbp;
-	int handle_check, ret;
+	int ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -1550,30 +1773,21 @@ __db_c_count_pp(dbc, recnop, flags)
 
 	/*
 	 * !!!
-	 * The actual argument checking is simple, do it inline.
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
+	 *
+	 * The cursor must be initialized, return EINVAL for an invalid cursor.
 	 */
 	if (flags != 0)
 		return (__db_ferr(dbenv, "DBcursor->count", 0));
 
-	/*
-	 * The cursor must be initialized, return EINVAL for an invalid cursor,
-	 * otherwise 0.
-	 */
 	if (!IS_INITIALIZED(dbc))
 		return (__db_curinval(dbenv));
 
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
-		return (ret);
+	ENV_ENTER(dbenv, ip);
 
 	ret = __db_c_count(dbc, recnop);
-
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
-
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -1590,7 +1804,8 @@ __db_c_del_pp(dbc, flags)
 {
 	DB *dbp;
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -1600,34 +1815,24 @@ __db_c_del_pp(dbc, flags)
 	if ((ret = __db_c_del_arg(dbc, flags)) != 0)
 		return (ret);
 
+	ENV_ENTER(dbenv, ip);
+
 	/* Check for consistent transaction usage. */
 	if ((ret = __db_check_txn(dbp, dbc->txn, dbc->locker, 0)) != 0)
-		return (ret);
-
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
-		return (ret);
+		goto err;
 
 	DEBUG_LWRITE(dbc, dbc->txn, "DBcursor->del", NULL, NULL, flags);
-
 	ret = __db_c_del(dbc, flags);
-
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
-
+err:
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
 /*
  * __db_c_del_arg --
  *	Check DBC->c_del arguments.
- *
- * PUBLIC: int __db_c_del_arg __P((DBC *, u_int32_t));
  */
-int
+static int
 __db_c_del_arg(dbc, flags)
 	DBC *dbc;
 	u_int32_t flags;
@@ -1639,7 +1844,7 @@ __db_c_del_arg(dbc, flags)
 	dbenv = dbp->dbenv;
 
 	/* Check for changes to a read-only tree. */
-	if (IS_READONLY(dbp))
+	if (DB_IS_READONLY(dbp))
 		return (__db_rdonly(dbenv, "DBcursor->del"));
 
 	/* Check for invalid function flags. */
@@ -1647,7 +1852,7 @@ __db_c_del_arg(dbc, flags)
 	case 0:
 		break;
 	case DB_UPDATE_SECONDARY:
-		DB_ASSERT(F_ISSET(dbp, DB_AM_SECONDARY));
+		DB_ASSERT(dbenv, F_ISSET(dbp, DB_AM_SECONDARY));
 		break;
 	default:
 		return (__db_ferr(dbenv, "DBcursor->del", 0));
@@ -1676,7 +1881,8 @@ __db_c_dup_pp(dbc, dbcp, flags)
 {
 	DB *dbp;
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -1685,23 +1891,16 @@ __db_c_dup_pp(dbc, dbcp, flags)
 
 	/*
 	 * !!!
-	 * The actual argument checking is simple, do it inline.
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
 	 */
 	if (flags != 0 && flags != DB_POSITION)
 		return (__db_ferr(dbenv, "DBcursor->dup", 0));
 
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
-		return (ret);
+	ENV_ENTER(dbenv, ip);
 
 	ret = __db_c_dup(dbc, dbcp, flags);
-
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
-
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -1719,7 +1918,8 @@ __db_c_get_pp(dbc, key, data, flags)
 {
 	DB *dbp;
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	int ret;
+	DB_THREAD_INFO *ip;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -1729,21 +1929,14 @@ __db_c_get_pp(dbc, key, data, flags)
 	if ((ret = __db_c_get_arg(dbc, key, data, flags)) != 0)
 		return (ret);
 
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
-		return (ret);
+	ENV_ENTER(dbenv, ip);
 
 	DEBUG_LREAD(dbc, dbc->txn, "DBcursor->get",
 	    flags == DB_SET || flags == DB_SET_RANGE ? key : NULL, NULL, flags);
-
 	ret = __db_c_get(dbc, key, data, flags);
 
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
-
+	ENV_LEAVE(dbenv, ip);
+	__dbt_userfree(dbenv, key, NULL, data);
 	return (ret);
 }
 
@@ -1780,12 +1973,12 @@ __db_c_get_arg(dbc, key, data, flags)
 	 * flag in a path where CDB may have been configured.
 	 */
 	dirty = 0;
-	if (LF_ISSET(DB_DIRTY_READ | DB_RMW)) {
+	if (LF_ISSET(DB_READ_UNCOMMITTED | DB_RMW)) {
 		if (!LOCKING_ON(dbenv))
 			return (__db_fnl(dbenv, "DBcursor->get"));
-		if (LF_ISSET(DB_DIRTY_READ))
+		if (LF_ISSET(DB_READ_UNCOMMITTED))
 			dirty = 1;
-		LF_CLR(DB_DIRTY_READ | DB_RMW);
+		LF_CLR(DB_READ_UNCOMMITTED | DB_RMW);
 	}
 
 	multi = 0;
@@ -1801,8 +1994,8 @@ __db_c_get_arg(dbc, key, data, flags)
 	case DB_CONSUME:
 	case DB_CONSUME_WAIT:
 		if (dirty) {
-			__db_err(dbenv,
-    "DB_DIRTY_READ is not supported with DB_CONSUME or DB_CONSUME_WAIT");
+			__db_errx(dbenv,
+    "DB_READ_UNCOMMITTED is not supported with DB_CONSUME or DB_CONSUME_WAIT");
 			return (EINVAL);
 		}
 		if (dbp->type != DB_QUEUE)
@@ -1810,13 +2003,9 @@ __db_c_get_arg(dbc, key, data, flags)
 		break;
 	case DB_CURRENT:
 	case DB_FIRST:
-	case DB_GET_BOTH:
-	case DB_GET_BOTH_RANGE:
 	case DB_NEXT:
 	case DB_NEXT_DUP:
 	case DB_NEXT_NODUP:
-	case DB_SET:
-	case DB_SET_RANGE:
 		break;
 	case DB_LAST:
 	case DB_PREV:
@@ -1827,6 +2016,16 @@ multi_err:		return (__db_ferr(dbenv, "DBcursor->get", 1));
 	case DB_GET_BOTHC:
 		if (dbp->type == DB_QUEUE)
 			goto err;
+		/* FALLTHROUGH */
+	case DB_GET_BOTH:
+	case DB_GET_BOTH_RANGE:
+		if ((ret = __dbt_usercopy(dbenv, data)) != 0)
+			goto err;
+		/* FALLTHROUGH */
+	case DB_SET:
+	case DB_SET_RANGE:
+		if ((ret = __dbt_usercopy(dbenv, key)) != 0)
+			goto err;
 		break;
 	case DB_GET_RECNO:
 		/*
@@ -1842,9 +2041,12 @@ multi_err:		return (__db_ferr(dbenv, "DBcursor->get", 1));
 	case DB_SET_RECNO:
 		if (!F_ISSET(dbp, DB_AM_RECNUM))
 			goto err;
+		if ((ret = __dbt_usercopy(dbenv, key)) != 0)
+			goto err;
 		break;
 	default:
-err:		return (__db_ferr(dbenv, "DBcursor->get", 0));
+err:		__dbt_userfree(dbenv, key, NULL, data);
+		return (__db_ferr(dbenv, "DBcursor->get", 0));
 	}
 
 	/* Check for invalid key/data flags. */
@@ -1855,19 +2057,19 @@ err:		return (__db_ferr(dbenv, "DBcursor->get", 0));
 
 	if (multi) {
 		if (!F_ISSET(data, DB_DBT_USERMEM)) {
-			__db_err(dbenv,
+			__db_errx(dbenv,
 	    "DB_MULTIPLE/DB_MULTIPLE_KEY require DB_DBT_USERMEM be set");
 			return (EINVAL);
 		}
 		if (F_ISSET(key, DB_DBT_PARTIAL) ||
 		    F_ISSET(data, DB_DBT_PARTIAL)) {
-			__db_err(dbenv,
+			__db_errx(dbenv,
 	    "DB_MULTIPLE/DB_MULTIPLE_KEY do not support DB_DBT_PARTIAL");
 			return (EINVAL);
 		}
 		if (data->ulen < 1024 ||
 		    data->ulen < dbp->pgsize || data->ulen % 1024 != 0) {
-			__db_err(dbenv, "%s%s",
+			__db_errx(dbenv, "%s%s",
 			    "DB_MULTIPLE/DB_MULTIPLE_KEY buffers must be ",
 			    "aligned, at least page size and multiples of 1KB");
 			return (EINVAL);
@@ -1902,6 +2104,7 @@ __db_secondary_close_pp(dbp, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
@@ -1910,20 +2113,20 @@ __db_secondary_close_pp(dbp, flags)
 	PANIC_CHECK(dbenv);
 
 	/*
-	 * !!!
-	 * The actual argument checking is simple, do it inline.
+	 * As a DB handle destructor, we can't fail.
 	 *
-	 * Validate arguments and complain if they're wrong, but as a DB
-	 * handle destructor, we can't fail.
+	 * !!!
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
 	 */
-	if (flags != 0 && flags != DB_NOSYNC &&
-	    (t_ret = __db_ferr(dbenv, "DB->close", 0)) != 0 && ret == 0)
-		ret = t_ret;
+	if (flags != 0 && flags != DB_NOSYNC)
+		ret = __db_ferr(dbenv, "DB->close", 0);
+
+	ENV_ENTER(dbenv, ip);
 
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (t_ret = __db_rep_enter(dbp, 0, 0, 0)) != 0) {
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (t_ret = __db_rep_enter(dbp, 0, 0, 0)) != 0) {
 		handle_check = 0;
 		if (ret == 0)
 			ret = t_ret;
@@ -1933,9 +2136,10 @@ __db_secondary_close_pp(dbp, flags)
 		ret = t_ret;
 
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -1953,31 +2157,23 @@ __db_c_pget_pp(dbc, skey, pkey, data, flags)
 {
 	DB *dbp;
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
 
 	PANIC_CHECK(dbenv);
 
-	if ((ret = __db_c_pget_arg(dbc, pkey, flags)) != 0)
-		return (ret);
-
-	if ((ret = __db_c_get_arg(dbc, skey, data, flags)) != 0)
-		return (ret);
-
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
+	if ((ret = __db_c_pget_arg(dbc, pkey, flags)) != 0 ||
+	    (ret = __db_c_get_arg(dbc, skey, data, flags)) != 0)
 		return (ret);
 
+	ENV_ENTER(dbenv, ip);
 	ret = __db_c_pget(dbc, skey, pkey, data, flags);
+	ENV_LEAVE(dbenv, ip);
 
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
-
+	__dbt_userfree(dbenv, skey, pkey, data);
 	return (ret);
 }
 
@@ -1999,13 +2195,13 @@ __db_c_pget_arg(dbc, pkey, flags)
 	dbenv = dbp->dbenv;
 
 	if (!F_ISSET(dbp, DB_AM_SECONDARY)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "DBcursor->pget may only be used on secondary indices");
 		return (EINVAL);
 	}
 
 	if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 	"DB_MULTIPLE and DB_MULTIPLE_KEY may not be used on secondary indices");
 		return (EINVAL);
 	}
@@ -2016,12 +2212,17 @@ __db_c_pget_arg(dbc, pkey, flags)
 		/* These flags make no sense on a secondary index. */
 		return (__db_ferr(dbenv, "DBcursor->pget", 0));
 	case DB_GET_BOTH:
-		/* DB_GET_BOTH is "get both the primary and the secondary". */
+	case DB_GET_BOTH_RANGE:
+		/* BOTH is "get both the primary and the secondary". */
 		if (pkey == NULL) {
-			__db_err(dbenv,
-		    "DB_GET_BOTH requires both a secondary and a primary key");
+			__db_errx(dbenv,
+			    "%s requires both a secondary and a primary key",
+			     LF_ISSET(DB_GET_BOTH) ?
+			     "DB_GET_BOTH" : "DB_GET_BOTH_RANGE");
 			return (EINVAL);
 		}
+		if ((ret = __dbt_usercopy(dbenv, pkey)) != 0)
+			return (ret);
 		break;
 	default:
 		/* __db_c_get_arg will catch the rest. */
@@ -2038,7 +2239,7 @@ __db_c_pget_arg(dbc, pkey, flags)
 
 	/* But the pkey field can't be NULL if we're doing a DB_GET_BOTH. */
 	if (pkey == NULL && (flags & DB_OPFLAGS_MASK) == DB_GET_BOTH) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "DB_GET_BOTH on a secondary index requires a primary key");
 		return (EINVAL);
 	}
@@ -2059,7 +2260,8 @@ __db_c_put_pp(dbc, key, data, flags)
 {
 	DB *dbp;
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -2069,27 +2271,20 @@ __db_c_put_pp(dbc, key, data, flags)
 	if ((ret = __db_c_put_arg(dbc, key, data, flags)) != 0)
 		return (ret);
 
+	ENV_ENTER(dbenv, ip);
+
 	/* Check for consistent transaction usage. */
 	if ((ret = __db_check_txn(dbp, dbc->txn, dbc->locker, 0)) != 0)
-		return (ret);
-
-	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
-		return (ret);
+		goto err;
 
 	DEBUG_LWRITE(dbc, dbc->txn, "DBcursor->put",
 	    flags == DB_KEYFIRST || flags == DB_KEYLAST ||
 	    flags == DB_NODUPDATA || flags == DB_UPDATE_SECONDARY ?
 	    key : NULL, data, flags);
-
 	ret =__db_c_put(dbc, key, data, flags);
 
-	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
-
+err:	ENV_LEAVE(dbenv, ip);
+	__dbt_userfree(dbenv, key, NULL, data);
 	return (ret);
 }
 
@@ -2112,20 +2307,23 @@ __db_c_put_arg(dbc, key, data, flags)
 	key_flags = 0;
 
 	/* Check for changes to a read-only tree. */
-	if (IS_READONLY(dbp))
-		return (__db_rdonly(dbenv, "c_put"));
+	if (DB_IS_READONLY(dbp))
+		return (__db_rdonly(dbenv, "DBcursor->put"));
 
 	/* Check for puts on a secondary. */
 	if (F_ISSET(dbp, DB_AM_SECONDARY)) {
 		if (flags == DB_UPDATE_SECONDARY)
 			flags = DB_KEYLAST;
 		else {
-			__db_err(dbenv,
+			__db_errx(dbenv,
 		    "DBcursor->put forbidden on secondary indices");
 			return (EINVAL);
 		}
 	}
 
+	if ((ret = __dbt_usercopy(dbenv, data)) != 0)
+		return (ret);
+
 	/* Check for invalid function flags. */
 	switch (flags) {
 	case DB_AFTER:
@@ -2164,6 +2362,8 @@ __db_c_put_arg(dbc, key, data, flags)
 	case DB_KEYFIRST:
 	case DB_KEYLAST:
 		key_flags = 1;
+		if ((ret = __dbt_usercopy(dbenv, key)) != 0)
+			return (ret);
 		break;
 	default:
 err:		return (__db_ferr(dbenv, "DBcursor->put", 0));
@@ -2176,7 +2376,7 @@ err:		return (__db_ferr(dbenv, "DBcursor->put", 0));
 		return (ret);
 
 	/* Keys shouldn't have partial flags during a put. */
-	if (F_ISSET(key, DB_DBT_PARTIAL))
+	if (key_flags && F_ISSET(key, DB_DBT_PARTIAL))
 		return (__db_ferr(dbenv, "key DBT", 0));
 
 	/*
@@ -2214,13 +2414,15 @@ __dbt_ferr(dbp, name, dbt, check_thread)
 	 * database, without having to clear flags.
 	 */
 	if ((ret = __db_fchk(dbenv, name, dbt->flags, DB_DBT_APPMALLOC |
-	    DB_DBT_MALLOC | DB_DBT_DUPOK | DB_DBT_REALLOC | DB_DBT_USERMEM |
-	    DB_DBT_PARTIAL)) != 0)
+	    DB_DBT_MALLOC | DB_DBT_DUPOK | DB_DBT_REALLOC |
+	    DB_DBT_USERCOPY | DB_DBT_USERMEM | DB_DBT_PARTIAL)) != 0)
 		return (ret);
-	switch (F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM)) {
+	switch (F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC |
+	    DB_DBT_USERCOPY | DB_DBT_USERMEM)) {
 	case 0:
 	case DB_DBT_MALLOC:
 	case DB_DBT_REALLOC:
+	case DB_DBT_USERCOPY:
 	case DB_DBT_USERMEM:
 		break;
 	default:
@@ -2228,8 +2430,9 @@ __dbt_ferr(dbp, name, dbt, check_thread)
 	}
 
 	if (check_thread && DB_IS_THREADED(dbp) &&
-	    !F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM)) {
-		__db_err(dbenv,
+	    !F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC |
+		DB_DBT_USERCOPY | DB_DBT_USERMEM)) {
+		__db_errx(dbenv,
 		    "DB_THREAD mandates memory allocation flag on DBT %s",
 		    name);
 		return (EINVAL);
@@ -2237,19 +2440,6 @@ __dbt_ferr(dbp, name, dbt, check_thread)
 	return (0);
 }
 
-/*
- * __db_rdonly --
- *	Common readonly message.
- */
-static int
-__db_rdonly(dbenv, name)
-	const DB_ENV *dbenv;
-	const char *name;
-{
-	__db_err(dbenv, "%s: attempt to modify a read-only tree", name);
-	return (EACCES);
-}
-
 /*
  * __db_curinval
  *	Report that a cursor is in an invalid state.
@@ -2258,7 +2448,7 @@ static int
 __db_curinval(dbenv)
 	const DB_ENV *dbenv;
 {
-	__db_err(dbenv,
+	__db_errx(dbenv,
 	    "Cursor position must be set before performing this operation");
 	return (EINVAL);
 }
@@ -2274,28 +2464,34 @@ __db_txn_auto_init(dbenv, txnidp)
 	DB_ENV *dbenv;
 	DB_TXN **txnidp;
 {
+	/*
+	 * Method calls where applications explicitly specify DB_AUTO_COMMIT
+	 * require additional validation: the DB_AUTO_COMMIT flag cannot be
+	 * specified if a transaction cookie is also specified, nor can the
+	 * flag be specified in a non-transactional environment.
+	 */
 	if (*txnidp != NULL) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
     "DB_AUTO_COMMIT may not be specified along with a transaction handle");
 		return (EINVAL);
 	}
 
 	if (!TXN_ON(dbenv)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
     "DB_AUTO_COMMIT may not be specified in non-transactional environment");
 		return (EINVAL);
 	}
 
 	/*
-	 * We're creating a transaction for the user, and we want it to block
-	 * if replication recovery is running.  Call the user-level API.
+	 * Our caller checked to see if replication is making a state change.
+	 * Don't call the user-level API (which would repeat that check).
 	 */
-	return (dbenv->txn_begin(dbenv, NULL, txnidp, 0));
+	return (__txn_begin(dbenv, NULL, txnidp, 0));
 }
 
 /*
  * __db_txn_auto_resolve --
- *	Handle DB_AUTO_COMMIT resolution.
+ *	Resolve local transactions.
  *
  * PUBLIC: int __db_txn_auto_resolve __P((DB_ENV *, DB_TXN *, int, int));
  */
@@ -2312,10 +2508,73 @@ __db_txn_auto_resolve(dbenv, txn, nosync, ret)
 	 * replication handle count.  Call the user-level API.
 	 */
 	if (ret == 0)
-		return (txn->commit(txn, nosync ? DB_TXN_NOSYNC : 0));
+		return (__txn_commit(txn, nosync ? DB_TXN_NOSYNC : 0));
 
-	if ((t_ret = txn->abort(txn)) != 0)
+	if ((t_ret = __txn_abort(txn)) != 0)
 		return (__db_panic(dbenv, t_ret));
 
 	return (ret);
 }
+
+/*
+ * __dbt_usercopy --
+ *	Take a copy of the user's data, if a callback is supplied.
+ *
+ * PUBLIC: int __dbt_usercopy __P((DB_ENV *, DBT *));
+ */
+int
+__dbt_usercopy(dbenv, dbt)
+	DB_ENV *dbenv;
+	DBT *dbt;
+{
+	void *buf;
+	int ret;
+
+	if (dbt == NULL || !F_ISSET(dbt, DB_DBT_USERCOPY) || dbt->size == 0 ||
+	    dbt->data != NULL)
+		return (0);
+
+	buf = NULL;
+	if ((ret = __os_umalloc(dbenv, dbt->size, &buf)) != 0 ||
+	    (ret = dbenv->dbt_usercopy(dbt, 0, buf, dbt->size,
+	    DB_USERCOPY_GETDATA)) != 0)
+		goto err;
+	dbt->data = buf;
+
+	return (0);
+
+err:	if (buf != NULL) {
+		__os_ufree(dbenv, buf);
+		dbt->data = NULL;
+	}
+
+	return (ret);
+}
+
+/*
+ * __dbt_userfree --
+ *	Free a copy of the user's data, if necessary.
+ *
+ * PUBLIC: void __dbt_userfree __P((DB_ENV *, DBT *, DBT *, DBT *));
+ */
+void
+__dbt_userfree(dbenv, key, pkey, data)
+	DB_ENV *dbenv;
+	DBT *key, *pkey, *data;
+{
+	if (key != NULL &&
+	    F_ISSET(key, DB_DBT_USERCOPY) && key->data != NULL) {
+		__os_ufree(dbenv, key->data);
+		key->data = NULL;
+	}
+	if (pkey != NULL &&
+	    F_ISSET(pkey, DB_DBT_USERCOPY) && pkey->data != NULL) {
+		__os_ufree(dbenv, pkey->data);
+		pkey->data = NULL;
+	}
+	if (data != NULL &&
+	    F_ISSET(data, DB_DBT_USERCOPY) && data->data != NULL) {
+		__os_ufree(dbenv, data->data);
+		data->data = NULL;
+	}
+}
diff --git a/db/db/db_join.c b/db/db/db_join.c
index f486f296e..7d75b344e 100644
--- a/db/db/db_join.c
+++ b/db/db/db_join.c
@@ -1,21 +1,14 @@
 /*
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1998-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1998-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_join.c,v 11.75 2004/09/22 03:30:23 bostic Exp $
+ * $Id: db_join.c,v 12.14 2006/08/24 14:45:15 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_join.h"
@@ -216,9 +209,9 @@ __db_join(primary, curslist, dbcp, flags)
 
 	*dbcp = dbc;
 
-	MUTEX_THREAD_LOCK(dbenv, primary->mutexp);
+	MUTEX_LOCK(dbenv, primary->mutex);
 	TAILQ_INSERT_TAIL(&primary->join_queue, dbc, links);
-	MUTEX_THREAD_UNLOCK(dbenv, primary->mutexp);
+	MUTEX_UNLOCK(dbenv, primary->mutex);
 
 	return (0);
 
@@ -250,24 +243,30 @@ __db_join_close_pp(dbc)
 	DBC *dbc;
 {
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	DB *dbp;
-	int handle_check, ret;
+	int handle_check, ret, t_ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
 
 	PANIC_CHECK(dbenv);
 
-	handle_check = IS_REPLICATED(dbenv, dbp);
+	ENV_ENTER(dbenv, ip);
+
+	handle_check = IS_ENV_REPLICATED(dbenv);
 	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 0, 0, dbc->txn != NULL)) != 0)
-		return (ret);
+	    (ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
 	ret = __db_join_close(dbc);
 
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+err:	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -309,8 +308,9 @@ __db_join_get_pp(dbc, key, data, flags)
 {
 	DB *dbp;
 	DB_ENV *dbenv;
+	DB_THREAD_INFO *ip;
 	u_int32_t handle_check, save_flags;
-	int ret;
+	int ret, t_ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -320,11 +320,10 @@ __db_join_get_pp(dbc, key, data, flags)
 
 	PANIC_CHECK(dbenv);
 
-	if (LF_ISSET(DB_DIRTY_READ | DB_DEGREE_2 | DB_RMW)) {
-		if (!LOCKING_ON(dbp->dbenv))
-			return (__db_fnl(dbp->dbenv, "DBcursor->c_get"));
-
-		LF_CLR(DB_DIRTY_READ | DB_DEGREE_2 | DB_RMW);
+	if (LF_ISSET(DB_READ_COMMITTED | DB_READ_UNCOMMITTED | DB_RMW)) {
+		if (!LOCKING_ON(dbenv))
+			return (__db_fnl(dbenv, "DBcursor->c_get"));
+		LF_CLR(DB_READ_COMMITTED | DB_READ_UNCOMMITTED | DB_RMW);
 	}
 
 	switch (flags) {
@@ -332,7 +331,7 @@ __db_join_get_pp(dbc, key, data, flags)
 	case DB_JOIN_ITEM:
 		break;
 	default:
-		return (__db_ferr(dbp->dbenv, "DBcursor->c_get", 0));
+		return (__db_ferr(dbenv, "DBcursor->c_get", 0));
 	}
 
 	/*
@@ -347,24 +346,30 @@ __db_join_get_pp(dbc, key, data, flags)
 	 * and causes us no headaches, so we permit it.
 	 */
 	if (F_ISSET(key, DB_DBT_PARTIAL)) {
-		__db_err(dbp->dbenv,
+		__db_errx(dbenv,
 		    "DB_DBT_PARTIAL may not be set on key during join_get");
 		return (EINVAL);
 	}
 
-	handle_check = IS_REPLICATED(dbp->dbenv, dbp);
+	ENV_ENTER(dbenv, ip);
+
+	handle_check = IS_ENV_REPLICATED(dbenv);
 	if (handle_check &&
-	    (ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
-		return (ret);
+	    (ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
 	/* Restore the original flags value. */
 	flags = save_flags;
 
 	ret = __db_join_get(dbc, key, data, flags);
 
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+err:	ENV_LEAVE(dbenv, ip);
+	__dbt_userfree(dbenv, key, NULL, NULL);
 	return (ret);
 }
 
@@ -374,14 +379,16 @@ __db_join_get(dbc, key_arg, data_arg, flags)
 	DBT *key_arg, *data_arg;
 	u_int32_t flags;
 {
-	DBT *key_n, key_n_mem;
 	DB *dbp;
 	DBC *cp;
+	DBT *key_n, key_n_mem;
+	DB_ENV *dbenv;
 	JOIN_CURSOR *jc;
 	int db_manage_data, ret;
 	u_int32_t i, j, operation, opmods;
 
 	dbp = dbc->dbp;
+	dbenv = dbp->dbenv;
 	jc = (JOIN_CURSOR *)dbc->internal;
 
 	operation = LF_ISSET(DB_OPFLAGS_MASK);
@@ -390,7 +397,7 @@ __db_join_get(dbc, key_arg, data_arg, flags)
 	 * If the set of flags here changes, check that __db_join_primget
 	 * is updated to handle them properly.
 	 */
-	opmods = LF_ISSET(DB_RMW | DB_DEGREE_2 | DB_DIRTY_READ);
+	opmods = LF_ISSET(DB_READ_COMMITTED | DB_READ_UNCOMMITTED | DB_RMW);
 
 	/*
 	 * Since we are fetching the key as a datum in the secondary indices,
@@ -398,8 +405,8 @@ __db_join_get(dbc, key_arg, data_arg, flags)
 	 * management flags.  If necessary, use a stack-allocated DBT;
 	 * we'll appropriately copy and/or allocate the data later.
 	 */
-	if (F_ISSET(key_arg, DB_DBT_USERMEM) ||
-	    F_ISSET(key_arg, DB_DBT_MALLOC)) {
+	if (F_ISSET(key_arg,
+	    DB_DBT_MALLOC | DB_DBT_USERCOPY | DB_DBT_USERMEM)) {
 		/* We just use the default buffer;  no need to go malloc. */
 		key_n = &key_n_mem;
 		memset(key_n, 0, sizeof(DBT));
@@ -410,6 +417,8 @@ __db_join_get(dbc, key_arg, data_arg, flags)
 		 */
 		key_n = key_arg;
 	}
+	if (F_ISSET(key_arg, DB_DBT_USERCOPY))
+		key_arg->data = NULL;
 
 	/*
 	 * If our last attempt to do a get on the primary key failed,
@@ -424,7 +433,7 @@ retry:	ret = __db_c_get(jc->j_workcurs[0], &jc->j_key, key_n,
 
 	if (ret == DB_BUFFER_SMALL) {
 		jc->j_key.ulen <<= 1;
-		if ((ret = __os_realloc(dbp->dbenv,
+		if ((ret = __os_realloc(dbenv,
 		    jc->j_key.ulen, &jc->j_key.data)) != 0)
 			goto mem_err;
 		goto retry;
@@ -468,7 +477,7 @@ retry:	ret = __db_c_get(jc->j_workcurs[0], &jc->j_key, key_n,
 
 	/* We have the first element; now look for it in the other cursors. */
 	for (i = 1; i < jc->j_ncurs; i++) {
-		DB_ASSERT(jc->j_curslist[i] != NULL);
+		DB_ASSERT(dbenv, jc->j_curslist[i] != NULL);
 		if (jc->j_workcurs[i] == NULL)
 			/* If this is NULL, we need to dup curslist into it. */
 			if ((ret = __db_c_dup(jc->j_curslist[i],
@@ -571,9 +580,9 @@ retry2:		cp = jc->j_workcurs[i];
 
 		if (ret == DB_BUFFER_SMALL) {
 			jc->j_key.ulen <<= 1;
-			if ((ret = __os_realloc(dbp->dbenv, jc->j_key.ulen,
+			if ((ret = __os_realloc(dbenv, jc->j_key.ulen,
 			    &jc->j_key.data)) != 0) {
-mem_err:			__db_err(dbp->dbenv,
+mem_err:			__db_errx(dbenv,
 				    "Allocation failed for join key, len = %lu",
 				    (u_long)jc->j_key.ulen);
 				goto err;
@@ -632,11 +641,12 @@ samekey:	/*
 	 * back into the dbt we were given for the key; call __db_retcopy.
 	 * Otherwise, assert that we do not need to copy anything and proceed.
 	 */
-	DB_ASSERT(F_ISSET(
-	    key_arg, DB_DBT_USERMEM | DB_DBT_MALLOC) || key_n == key_arg);
+	DB_ASSERT(dbenv, F_ISSET(key_arg, DB_DBT_USERMEM | DB_DBT_MALLOC |
+	    DB_DBT_USERCOPY) || key_n == key_arg);
 
-	if (F_ISSET(key_arg, DB_DBT_USERMEM | DB_DBT_MALLOC) &&
-	    (ret = __db_retcopy(dbp->dbenv,
+	if ((F_ISSET(key_arg, DB_DBT_USERMEM | DB_DBT_MALLOC |
+	    DB_DBT_USERCOPY)) &&
+	    (ret = __db_retcopy(dbenv,
 	    key_arg, key_n->data, key_n->size, NULL, NULL)) != 0) {
 		/*
 		 * The retcopy failed, most commonly because we have a user
@@ -650,9 +660,6 @@ samekey:	/*
 	/*
 	 * If DB_JOIN_ITEM is set, we return it; otherwise we do the lookup
 	 * in the primary and then return.
-	 *
-	 * Note that we use key_arg here;  it is safe (and appropriate)
-	 * to do so.
 	 */
 	if (operation == DB_JOIN_ITEM)
 		return (0);
@@ -667,14 +674,19 @@ samekey:	/*
 	 * Instead, use memory that is managed by the join cursor, in
 	 * jc->j_rdata.
 	 */
-	if (!F_ISSET(data_arg, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM))
+	if (!F_ISSET(data_arg, DB_DBT_MALLOC | DB_DBT_REALLOC |
+	    DB_DBT_USERMEM | DB_DBT_USERCOPY))
 		db_manage_data = 1;
 	else
 		db_manage_data = 0;
 	if ((ret = __db_join_primget(jc->j_primary,
-	    jc->j_curslist[0]->txn, jc->j_curslist[0]->locker, key_arg,
+	    jc->j_curslist[0]->txn, jc->j_curslist[0]->locker, key_n,
 	    db_manage_data ? &jc->j_rdata : data_arg, opmods)) != 0) {
-		if (ret == DB_NOTFOUND)
+		if (ret == DB_NOTFOUND) {
+			if (LF_ISSET(DB_READ_UNCOMMITTED) ||
+			    (jc->j_curslist[0]->txn != NULL && F_ISSET(
+			    jc->j_curslist[0]->txn, TXN_READ_UNCOMMITTED)))
+				goto retry;
 			/*
 			 * If ret == DB_NOTFOUND, the primary and secondary
 			 * are out of sync;  every item in each secondary
@@ -683,7 +695,7 @@ samekey:	/*
 			 * Wail.
 			 */
 			ret = __db_secondary_corrupt(jc->j_primary);
-		else
+		} else
 			/*
 			 * The get on the primary failed for some other
 			 * reason, most commonly because we're using a user
@@ -726,9 +738,9 @@ __db_join_close(dbc)
 	 * must happen before any action that can fail and return, or else
 	 * __db_close may loop indefinitely.
 	 */
-	MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
+	MUTEX_LOCK(dbenv, dbp->mutex);
 	TAILQ_REMOVE(&dbp->join_queue, dbc, links);
-	MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp);
+	MUTEX_UNLOCK(dbenv, dbp->mutex);
 
 	PANIC_CHECK(dbenv);
 
@@ -872,29 +884,30 @@ __db_join_primget(dbp, txn, lockerid, key, data, flags)
 	u_int32_t flags;
 {
 	DBC *dbc;
-	int ret, rmw, t_ret;
+	u_int32_t rmw;
+	int ret, t_ret;
 
 	if ((ret = __db_cursor_int(dbp,
 	    txn, dbp->type, PGNO_INVALID, 0, lockerid, &dbc)) != 0)
 		return (ret);
 
 	/*
-	 * The only allowable flags here are the two flags copied into
-	 * "opmods" in __db_join_get, DB_RMW and DB_DIRTY_READ.  The former
-	 * is an op on the c_get call, the latter on the cursor call.
-	 * It's a DB bug if we allow any other flags down in here.
+	 * The only allowable flags here are the two flags copied into "opmods"
+	 * in __db_join_get, DB_RMW and DB_READ_UNCOMMITTED.  The former is an
+	 * op on the c_get call, the latter on the cursor call.  It's a DB bug
+	 * if we allow any other flags down in here.
 	 */
 	rmw = LF_ISSET(DB_RMW);
-	if (LF_ISSET(DB_DIRTY_READ) ||
-	    (txn != NULL && F_ISSET(txn, TXN_DIRTY_READ)))
-		F_SET(dbc, DBC_DIRTY_READ);
+	if (LF_ISSET(DB_READ_UNCOMMITTED) ||
+	    (txn != NULL && F_ISSET(txn, TXN_READ_UNCOMMITTED)))
+		F_SET(dbc, DBC_READ_UNCOMMITTED);
 
-	if (LF_ISSET(DB_DEGREE_2) ||
-	    (txn != NULL && F_ISSET(txn, TXN_DEGREE_2)))
-		F_SET(dbc, DBC_DEGREE_2);
+	if (LF_ISSET(DB_READ_COMMITTED) ||
+	    (txn != NULL && F_ISSET(txn, TXN_READ_COMMITTED)))
+		F_SET(dbc, DBC_READ_COMMITTED);
 
-	LF_CLR(DB_RMW | DB_DIRTY_READ | DB_DEGREE_2);
-	DB_ASSERT(flags == 0);
+	LF_CLR(DB_READ_COMMITTED | DB_READ_UNCOMMITTED | DB_RMW);
+	DB_ASSERT(dbp->dbenv, flags == 0);
 
 	F_SET(dbc, DBC_TRANSIENT);
 
@@ -924,7 +937,7 @@ int
 __db_secondary_corrupt(dbp)
 	DB *dbp;
 {
-	__db_err(dbp->dbenv,
+	__db_errx(dbp->dbenv,
 	    "Secondary index corrupt: not consistent with primary");
 	return (DB_SECONDARY_BAD);
 }
diff --git a/db/db/db_meta.c b/db/db/db_meta.c
index c5e88bb56..316840a02 100644
--- a/db/db/db_meta.c
+++ b/db/db/db_meta.c
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994, 1995, 1996
@@ -39,25 +39,24 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db_meta.c,v 11.89 2004/10/05 14:28:33 bostic Exp $
+ * $Id: db_meta.c,v 12.35 2006/08/24 14:45:15 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/lock.h"
 #include "dbinc/mp.h"
 #include "dbinc/db_am.h"
 
 static void __db_init_meta __P((DB *, void *, db_pgno_t, u_int32_t));
+#ifdef HAVE_FTRUNCATE
+static void __db_freelist_sort __P((struct pglist *, u_int32_t));
+static int  __db_pglistcmp __P((const void *, const void *));
+static int  __db_truncate_freelist __P((DBC *, DBMETA *,
+      PAGE *, db_pgno_t *, u_int32_t, u_int32_t));
+#endif
 
 /*
  * __db_init_meta --
@@ -98,19 +97,19 @@ __db_new(dbc, type, pagepp)
 	u_int32_t type;
 	PAGE **pagepp;
 {
+	DB_ENV *dbenv;
 	DBMETA *meta;
 	DB *dbp;
 	DB_LOCK metalock;
 	DB_LSN lsn;
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
-	db_pgno_t last, pgno, newnext;
-	u_int32_t meta_flags;
+	db_pgno_t last, *list, pgno, newnext;
 	int extend, ret, t_ret;
 
 	meta = NULL;
-	meta_flags = 0;
 	dbp = dbc->dbp;
+	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
 	h = NULL;
 	newnext = PGNO_INVALID;
@@ -119,16 +118,22 @@ __db_new(dbc, type, pagepp)
 	if ((ret = __db_lget(dbc,
 	    LCK_ALWAYS, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0)
 		goto err;
-	if ((ret = __memp_fget(mpf, &pgno, 0, &meta)) != 0)
+	if ((ret = __memp_fget(mpf, &pgno, dbc->txn,
+	    DB_MPOOL_DIRTY, &meta)) != 0)
 		goto err;
 	last = meta->last_pgno;
 	if (meta->free == PGNO_INVALID) {
+		if (FLD_ISSET(type, P_DONTEXTEND)) {
+			*pagepp = NULL;
+			goto err;
+		}
 		last = pgno = meta->last_pgno + 1;
 		ZERO_LSN(lsn);
 		extend = 1;
 	} else {
 		pgno = meta->free;
-		if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0)
+		if ((ret = __memp_fget(mpf, &pgno, dbc->txn,
+		    DB_MPOOL_DIRTY, &h)) != 0)
 			goto err;
 
 		/*
@@ -139,8 +144,19 @@ __db_new(dbc, type, pagepp)
 		newnext = h->next_pgno;
 		lsn = h->lsn;
 		extend = 0;
+		DB_ASSERT(dbenv, TYPE(h) == P_INVALID);
+
+		if (TYPE(h) != P_INVALID) {
+			__db_errx(dbenv,
+			    "%s page %lu is on free list with type %lu",
+				dbp->fname, (u_long)PGNO(h), (u_long)TYPE(h));
+			return (__db_panic(dbenv, EINVAL));
+		}
+
 	}
 
+	FLD_CLR(type, P_DONTEXTEND);
+
 	/*
 	 * Log the allocation before fetching the new page.  If we
 	 * don't have room in the log then we don't want to tell
@@ -154,25 +170,20 @@ __db_new(dbc, type, pagepp)
 	} else
 		LSN_NOT_LOGGED(LSN(meta));
 
-	meta_flags = DB_MPOOL_DIRTY;
 	meta->free = newnext;
 
 	if (extend == 1) {
-		if ((ret = __memp_fget(mpf, &pgno, DB_MPOOL_NEW, &h)) != 0)
+		if ((ret = __memp_fget(mpf, &pgno, dbc->txn,
+		    DB_MPOOL_NEW, &h)) != 0)
 			goto err;
-		DB_ASSERT(last == pgno);
+		DB_ASSERT(dbenv, last == pgno);
 		meta->last_pgno = pgno;
 		ZERO_LSN(h->lsn);
 		h->pgno = pgno;
 	}
 	LSN(h) = LSN(meta);
 
-	DB_ASSERT(TYPE(h) == P_INVALID);
-
-	if (TYPE(h) != P_INVALID)
-		return (__db_panic(dbp->dbenv, EINVAL));
-
-	ret = __memp_fput(mpf, (PAGE *)meta, DB_MPOOL_DIRTY);
+	ret = __memp_fput(mpf, meta, 0);
 	meta = NULL;
 	if ((t_ret = __TLPUT(dbc, metalock)) != 0 && ret == 0)
 		ret = t_ret;
@@ -191,26 +202,47 @@ __db_new(dbc, type, pagepp)
 			break;
 	}
 
+	/* Fix up the sorted free list if necessary. */
+#ifdef HAVE_FTRUNCATE
+	if (extend == 0) {
+		u_int32_t nelems = 0;
+
+		if ((ret = __memp_get_freelist(dbp->mpf, &nelems, &list)) != 0)
+			goto err;
+		if (nelems != 0) {
+			DB_ASSERT(dbenv, h->pgno == list[0]);
+			memmove(list, &list[1], (nelems - 1) * sizeof(*list));
+			if ((ret = __memp_extend_freelist(
+			    dbp->mpf, nelems - 1, &list)) != 0)
+				goto err;
+		}
+	}
+#else
+	COMPQUIET(list, NULL);
+#endif
+
 	/*
 	 * If dirty reads are enabled and we are in a transaction, we could
 	 * abort this allocation after the page(s) pointing to this
 	 * one have their locks downgraded.  This would permit dirty readers
 	 * to access this page which is ok, but they must be off the
-	 * page when we abort.  This will also prevent updates happening
-	 * to this page until we commit.
+	 * page when we abort.  We never lock overflow pages or off page
+	 * duplicate trees.
 	 */
-	if (F_ISSET(dbc->dbp, DB_AM_DIRTY) && dbc->txn != NULL) {
+	if (type != P_OVERFLOW && !F_ISSET(dbc, DBC_OPD) &&
+	     F_ISSET(dbc->dbp, DB_AM_READ_UNCOMMITTED) && dbc->txn != NULL) {
 		if ((ret = __db_lget(dbc, 0,
 		    h->pgno, DB_LOCK_WWRITE, 0, &metalock)) != 0)
 			goto err;
 	}
+
 	*pagepp = h;
 	return (0);
 
 err:	if (h != NULL)
 		(void)__memp_fput(mpf, h, 0);
 	if (meta != NULL)
-		(void)__memp_fput(mpf, meta, meta_flags);
+		(void)__memp_fput(mpf, meta, 0);
 	(void)__TLPUT(dbc, metalock);
 	return (ret);
 }
@@ -231,35 +263,125 @@ __db_free(dbc, h)
 	DBT ddbt, ldbt;
 	DB_LOCK metalock;
 	DB_MPOOLFILE *mpf;
-	db_pgno_t pgno;
-	u_int32_t dirty_flag;
-	int ret, t_ret;
+	db_pgno_t last_pgno, *lp, next_pgno, pgno, prev_pgno;
+	u_int32_t lflag, nelem;
+	int do_truncate, ret, t_ret;
+#ifdef HAVE_FTRUNCATE
+	db_pgno_t *list;
+	u_int32_t position, start;
+#endif
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
+	prev_pgno = PGNO_INVALID;
+	nelem = 0;
+	meta = NULL;
+	do_truncate = 0;
+	lp = NULL;
 
 	/*
-	 * Retrieve the metadata page and insert the page at the head of
-	 * the free list.  If either the lock get or page get routines
+	 * Retrieve the metadata page.  If we are not keeping a sorted
+	 * free list put the page at the head of the the free list.
+	 * If we are keeping a sorted free list, for truncation,
+	 * then figure out where this page belongs and either
+	 * link it in or truncate the file as much as possible.
+	 * If either the lock get or page get routines
 	 * fail, then we need to put the page with which we were called
 	 * back because our caller assumes we take care of it.
 	 */
-	dirty_flag = 0;
 	pgno = PGNO_BASE_MD;
 	if ((ret = __db_lget(dbc,
 	    LCK_ALWAYS, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0)
 		goto err;
-	if ((ret = __memp_fget(mpf, &pgno, 0, &meta)) != 0) {
-		(void)__TLPUT(dbc, metalock);
-		goto err;
+	if ((ret = __memp_fget(mpf, &pgno, dbc->txn, 0, &meta)) != 0)
+		goto err1;
+
+	last_pgno = meta->last_pgno;
+	next_pgno = meta->free;
+
+	DB_ASSERT(dbp->dbenv, h->pgno != next_pgno);
+
+#ifdef HAVE_FTRUNCATE
+	/*
+	 * If we are maintaining a sorted free list see if we either have a
+	 * new truncation point or the page goes somewhere in the middle of
+	 * the list.  If it goes in the middle of the list, we will drop the
+	 * meta page and get the previous page.
+	 */
+	if ((ret = __memp_get_freelist(mpf, &nelem, &list)) != 0)
+		goto err1;
+	if (list == NULL)
+		goto no_sort;
+
+	if (h->pgno != last_pgno) {
+		/*
+		 * Put the page number in the sorted list.
+		 * Finds its position and the previous page,
+		 * extend the list, make room and insert.
+		 */
+		position = 0;
+		if (nelem != 0) {
+			__db_freelist_pos(h->pgno, list, nelem, &position);
+
+			DB_ASSERT(dbp->dbenv, h->pgno != list[position]);
+
+			/* Get the previous page if this is not the smallest. */
+			if (position != 0 || h->pgno > list[0])
+				prev_pgno = list[position];
+		}
+
+		/* Put the page number into the list. */
+		if ((ret = __memp_extend_freelist(mpf, nelem + 1, &list)) != 0)
+			return (ret);
+		if (prev_pgno != PGNO_INVALID)
+			lp = &list[position + 1];
+		else
+			lp = list;
+		if (nelem != 0 && position != nelem)
+			memmove(lp + 1, lp,
+			    (size_t)((u_int8_t*)&list[nelem] - (u_int8_t*)lp));
+		*lp = h->pgno;
+	} else if (nelem != 0) {
+		/* Find the truncation point. */
+		for (lp = &list[nelem - 1]; lp >= list; lp--)
+			if (--last_pgno != *lp)
+				break;
+		if (lp < list || last_pgno < h->pgno - 1)
+			do_truncate = 1;
+		last_pgno = meta->last_pgno;
 	}
 
-	DB_ASSERT(h->pgno != meta->free);
+no_sort:
+	if (prev_pgno != PGNO_INVALID) {
+		if ((ret = __memp_fput(mpf, meta, 0)) != 0)
+			goto err1;
+		meta = NULL;
+		pgno = prev_pgno;
+		if ((ret = __memp_fget(mpf, &pgno, dbc->txn, 0, &meta)) != 0)
+			goto err1;
+		next_pgno = NEXT_PGNO(meta);
+	}
+#endif
+
+	if ((ret = __memp_dirty(mpf, &meta, dbc->txn, 0)) != 0)
+		goto err1;
+
 	/* Log the change. */
 	if (DBC_LOGGING(dbc)) {
 		memset(&ldbt, 0, sizeof(ldbt));
 		ldbt.data = h;
 		ldbt.size = P_OVERHEAD(dbp);
+		/*
+		 * If we are truncating the file, we need to make sure
+		 * the logging happens before the truncation.  If we
+		 * are truncating multiple pages we don't need to flush the
+		 * log here as it will be flushed by __db_truncate_freelist.
+		 */
+		lflag = 0;
+#ifdef HAVE_FTRUNCATE
+		if (do_truncate == 0 && h->pgno == last_pgno)
+			lflag = DB_FLUSH;
+#endif
 		switch (h->type) {
 		case P_HASH:
 		case P_IBTREE:
@@ -269,78 +391,88 @@ __db_free(dbc, h)
 		case P_LDUP:
 			if (h->entries > 0) {
 				ldbt.size += h->entries * sizeof(db_indx_t);
-				ddbt.data = (u_int8_t *)h + h->hf_offset;
-				ddbt.size = dbp->pgsize - h->hf_offset;
-				ret = __db_pg_freedata_log(dbp, dbc->txn,
-				     &LSN(meta), 0, h->pgno, &LSN(meta),
-				     PGNO_BASE_MD, &ldbt,
-				     meta->free, meta->last_pgno, &ddbt);
-				break;
+				ddbt.data = (u_int8_t *)h + HOFFSET(h);
+				ddbt.size = dbp->pgsize - HOFFSET(h);
+				if ((ret = __db_pg_freedata_log(dbp, dbc->txn,
+				     &LSN(meta), lflag,
+				     h->pgno, &LSN(meta), pgno,
+				     &ldbt, next_pgno, last_pgno, &ddbt)) != 0)
+					goto err1;
+				goto logged;
 			}
-			goto log;
+			break;
 		case P_HASHMETA:
 			ldbt.size = sizeof(HMETA);
-			goto log;
+			break;
 		case P_BTREEMETA:
 			ldbt.size = sizeof(BTMETA);
-			goto log;
+			break;
 		case P_OVERFLOW:
 			ldbt.size += OV_LEN(h);
-			goto log;
+			break;
 		default:
-			DB_ASSERT(h->type != P_QAMDATA);
-
-log:			ret = __db_pg_free_log(dbp,
-			    dbc->txn, &LSN(meta), 0, h->pgno, &LSN(meta),
-			    PGNO_BASE_MD, &ldbt, meta->free, meta->last_pgno);
-		}
-		if (ret != 0) {
-			(void)__memp_fput(mpf, (PAGE *)meta, 0);
-			(void)__TLPUT(dbc, metalock);
-			goto err;
+			DB_ASSERT(dbp->dbenv, h->type != P_QAMDATA);
 		}
+
+		if ((ret = __db_pg_free_log(dbp,
+		      dbc->txn, &LSN(meta), lflag, h->pgno,
+		      &LSN(meta), pgno, &ldbt, next_pgno, last_pgno)) != 0)
+			goto err1;
 	} else
 		LSN_NOT_LOGGED(LSN(meta));
-	LSN(h) = LSN(meta);
-
+logged:
 #ifdef HAVE_FTRUNCATE
-	if (h->pgno == meta->last_pgno) {
+	if (do_truncate) {
+		start = (u_int32_t) (lp - list) + 1;
+		meta->last_pgno--;
+		ret = __db_truncate_freelist(
+		      dbc, meta, h, list, start, nelem);
+		h = NULL;
+	} else if (h->pgno == last_pgno) {
+		LSN(h) = LSN(meta);
+		P_INIT(h, dbp->pgsize,
+		    h->pgno, PGNO_INVALID, next_pgno, 0, P_INVALID);
 		if ((ret = __memp_fput(mpf, h, DB_MPOOL_DISCARD)) != 0)
-			goto err;
+			goto err1;
+		h = NULL;
 		/* Give the page back to the OS. */
-		if ((ret = __memp_ftruncate(mpf, meta->last_pgno, 0)) != 0)
-			goto err;
+		if ((ret = __memp_ftruncate(mpf, last_pgno, 0)) != 0)
+			goto err1;
+		DB_ASSERT(dbp->dbenv, meta->pgno == PGNO_BASE_MD);
 		meta->last_pgno--;
 		h = NULL;
 	} else
 #endif
-
 	{
 		/*
 		 * If we are not truncating the page then we
-		 * reinitialize it and put it hat the head of
+		 * reinitialize it and put it at the head of
 		 * the free list.
 		 */
+		if ((ret = __memp_dirty(mpf, &h, dbc->txn, 0)) != 0)
+			goto err1;
+		LSN(h) = LSN(meta);
 		P_INIT(h, dbp->pgsize,
-		    h->pgno, PGNO_INVALID, meta->free, 0, P_INVALID);
+		    h->pgno, PGNO_INVALID, next_pgno, 0, P_INVALID);
 #ifdef DIAGNOSTIC
 		memset((u_int8_t *) h + P_OVERHEAD(dbp),
 		    CLEAR_BYTE, dbp->pgsize - P_OVERHEAD(dbp));
 #endif
-		meta->free = h->pgno;
+		if (prev_pgno == PGNO_INVALID)
+			meta->free = h->pgno;
+		else
+			NEXT_PGNO(meta) = h->pgno;
 	}
 
-	/* Discard the metadata page. */
-	if ((t_ret =
-	    __memp_fput(mpf, (PAGE *)meta, DB_MPOOL_DIRTY)) != 0 && ret == 0)
+	/* Discard the metadata or previous page. */
+err1:	if (meta != NULL &&
+	    (t_ret = __memp_fput(mpf, (PAGE *)meta, 0)) != 0 && ret == 0)
 		ret = t_ret;
 	if ((t_ret = __TLPUT(dbc, metalock)) != 0 && ret == 0)
 		ret = t_ret;
 
 	/* Discard the caller's page reference. */
-	dirty_flag = DB_MPOOL_DIRTY;
-err:	if (h != NULL &&
-	    (t_ret = __memp_fput(mpf, h, dirty_flag)) != 0 && ret == 0)
+err:	if (h != NULL && (t_ret = __memp_fput(mpf, h, 0)) != 0 && ret == 0)
 		ret = t_ret;
 
 	/*
@@ -350,6 +482,382 @@ err:	if (h != NULL &&
 	return (ret);
 }
 
+#ifdef HAVE_FTRUNCATE
+/*
+ * __db_freelist_pos -- find the position of a page in the freelist.
+ *	The list is sorted, we do a binary search.
+ *
+ * PUBLIC: #ifdef HAVE_FTRUNCATE
+ * PUBLIC: void __db_freelist_pos __P((db_pgno_t,
+ * PUBLIC:       db_pgno_t *, u_int32_t, u_int32_t *));
+ * PUBLIC: #endif
+ */
+void
+__db_freelist_pos(pgno, list, nelem, posp)
+	db_pgno_t pgno;
+	db_pgno_t *list;
+	u_int32_t nelem;
+	u_int32_t *posp;
+{
+	u_int32_t base, indx, lim;
+
+	indx = 0;
+	for (base = 0, lim = nelem; lim != 0; lim >>= 1) {
+		indx = base + (lim >> 1);
+		if (pgno == list[indx]) {
+			*posp = indx;
+			return;
+		}
+		if (pgno > list[indx]) {
+			base = indx + 1;
+			--lim;
+		}
+	}
+	if (base != 0)
+		base--;
+	*posp = base;
+	return;
+}
+
+static int
+__db_pglistcmp(a, b)
+	const void *a, *b;
+{
+	struct pglist *ap, *bp;
+
+	ap = (struct pglist *)a;
+	bp = (struct pglist *)b;
+
+	return ((ap->pgno > bp->pgno) ? 1 : (ap->pgno < bp->pgno) ? -1: 0);
+}
+
+/*
+ * __db_freelist_sort -- sort a list of free pages.
+ */
+static void
+__db_freelist_sort(list, nelems)
+	struct pglist *list;
+	u_int32_t nelems;
+{
+	qsort(list, (size_t)nelems, sizeof(struct pglist), __db_pglistcmp);
+}
+
+/*
+ * __db_pg_truncate -- sort the freelist and find the truncation point.
+ *
+ * PUBLIC: #ifdef HAVE_FTRUNCATE
+ * PUBLIC: int __db_pg_truncate __P((DB_MPOOLFILE *, DB_TXN *,
+ * PUBLIC:    struct pglist *list, DB_COMPACT *, u_int32_t *, db_pgno_t *,
+ * PUBLIC:    DB_LSN *, int));
+ * PUBLIC: #endif
+ */
+int
+__db_pg_truncate(mpf, txn, list, c_data, nelemp, last_pgno, lsnp, in_recovery)
+	DB_MPOOLFILE *mpf;
+	DB_TXN *txn;
+	struct pglist *list;
+	DB_COMPACT *c_data;
+	u_int32_t *nelemp;
+	db_pgno_t *last_pgno;
+	DB_LSN *lsnp;
+	int in_recovery;
+{
+	PAGE *h;
+	struct pglist *lp;
+	db_pgno_t pgno;
+	u_int32_t nelems;
+	int ret;
+
+	ret = 0;
+
+	nelems = *nelemp;
+	/* Sort the list */
+	__db_freelist_sort(list, nelems);
+
+	/* Find the truncation point. */
+	pgno = *last_pgno;
+	lp = &list[nelems - 1];
+	while (nelems != 0) {
+		if (lp->pgno != pgno)
+			break;
+		pgno--;
+		nelems--;
+		lp--;
+	}
+
+	/*
+	 * Figure out what (if any) pages can be truncated immediately and
+	 * record the place from which we can truncate, so we can do the
+	 * memp_ftruncate below.  We also use this to avoid ever putting
+	 * these pages on the freelist, which we are about to relink.
+	 */
+	for (lp = list; lp < &list[nelems]; lp++) {
+		if ((ret = __memp_fget(mpf, &lp->pgno, txn, 0, &h)) != 0) {
+			/* Page may have been truncated later. */
+			if (in_recovery && ret == DB_PAGE_NOTFOUND) {
+				ret = 0;
+				continue;
+			}
+			goto err;
+		}
+		if (!in_recovery || LOG_COMPARE(&LSN(h), &lp->lsn) == 0) {
+			if ((ret = __memp_dirty(mpf, &h, txn, 0)) != 0) {
+				(void)__memp_fput(mpf, h, 0);
+				goto err;
+			}
+			if (lp == &list[nelems - 1])
+				NEXT_PGNO(h) = PGNO_INVALID;
+			else
+				NEXT_PGNO(h) = lp[1].pgno;
+			DB_ASSERT(mpf->dbenv, NEXT_PGNO(h) < *last_pgno);
+
+			LSN(h) = *lsnp;
+		}
+		if ((ret = __memp_fput(mpf, h, 0)) != 0)
+			goto err;
+	}
+
+	if (pgno != *last_pgno) {
+		if ((ret = __memp_ftruncate(mpf,
+		    pgno + 1, in_recovery ? MP_TRUNC_RECOVER : 0)) != 0)
+			goto err;
+		if (c_data)
+			c_data->compact_pages_truncated += *last_pgno - pgno;
+		*last_pgno = pgno;
+	}
+	*nelemp = nelems;
+
+err:	return (ret);
+}
+
+/*
+ * __db_free_truncate --
+ *	Truncate free pages at the end of the file.
+ *
+ * PUBLIC: #ifdef HAVE_FTRUNCATE
+ * PUBLIC: int __db_free_truncate __P((DB *, DB_TXN *, u_int32_t,
+ * PUBLIC:    DB_COMPACT *, struct pglist **, u_int32_t *, db_pgno_t *));
+ * PUBLIC: #endif
+ */
+int
+__db_free_truncate(dbp, txn, flags, c_data, listp, nelemp, last_pgnop)
+	DB *dbp;
+	DB_TXN *txn;
+	u_int32_t flags;
+	DB_COMPACT *c_data;
+	struct pglist **listp;
+	u_int32_t *nelemp;
+	db_pgno_t *last_pgnop;
+{
+	DBC *dbc;
+	DB_ENV *dbenv;
+	DBMETA *meta;
+	DBT ddbt;
+	DB_LOCK metalock;
+	DB_LSN null_lsn;
+	DB_MPOOLFILE *mpf;
+	PAGE *h;
+	db_pgno_t pgno;
+	u_int32_t nelems;
+	struct pglist *list, *lp;
+	int ret, t_ret;
+	size_t size;
+
+	COMPQUIET(flags, 0);
+	list = NULL;
+	meta = NULL;
+	dbenv = dbp->dbenv;
+	mpf = dbp->mpf;
+	h = NULL;
+	nelems = 0;
+	if (listp != NULL) {
+		*listp = NULL;
+		DB_ASSERT(dbenv, nelemp != NULL);
+		*nelemp = 0;
+	}
+
+	if ((ret = __db_cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0)
+		return (ret);
+
+	pgno = PGNO_BASE_MD;
+	if ((ret = __db_lget(dbc,
+	    LCK_ALWAYS, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0)
+		goto err;
+	if ((ret = __memp_fget(mpf, &pgno, dbc->txn,
+	    DB_MPOOL_DIRTY, &meta)) != 0)
+		goto err;
+
+	if (last_pgnop != NULL)
+		*last_pgnop = meta->last_pgno;
+	if ((pgno = meta->free) == PGNO_INVALID)
+		goto done;
+
+	size = 128;
+	if ((ret = __os_malloc(dbenv, size * sizeof(*list), &list)) != 0)
+		goto err;
+	lp = list;
+
+	do {
+		if (lp == &list[size]) {
+			size *= 2;
+			if ((ret = __os_realloc(dbenv,
+			    size * sizeof(*list), &list)) != 0)
+				goto err;
+			lp = &list[size / 2];
+		}
+		if ((ret = __memp_fget(mpf, &pgno, dbc->txn, 0, &h)) != 0)
+			goto err;
+
+		lp->pgno = pgno;
+		lp->lsn = LSN(h);
+		pgno = NEXT_PGNO(h);
+		if ((ret = __memp_fput(mpf, h, 0)) != 0)
+			goto err;
+		lp++;
+	} while (pgno != PGNO_INVALID);
+	nelems = (u_int32_t)(lp - list);
+
+	/* Log the current state of the free list */
+	if (DBC_LOGGING(dbc)) {
+		ddbt.data = list;
+		ddbt.size = nelems * sizeof(*lp);
+		ZERO_LSN(null_lsn);
+		if ((ret = __db_pg_sort_log(dbp,
+		     dbc->txn, &LSN(meta), DB_FLUSH, PGNO_BASE_MD, &LSN(meta),
+		     PGNO_INVALID, &null_lsn, meta->last_pgno, &ddbt)) != 0)
+			goto err;
+	} else
+		LSN_NOT_LOGGED(LSN(meta));
+
+	if ((ret = __db_pg_truncate(mpf, txn, list, c_data,
+	    &nelems, &meta->last_pgno, &LSN(meta), 0)) != 0)
+		goto err;
+
+	if (nelems == 0)
+		meta->free = PGNO_INVALID;
+	else
+		meta->free = list[0].pgno;
+
+done:	if (last_pgnop != NULL)
+		*last_pgnop = meta->last_pgno;
+
+	/*
+	 * The truncate point is the number of pages in the free
+	 * list back from the last page.  The number of pages
+	 * in the free list are the number that we can swap in.
+	 */
+	if (c_data)
+		c_data->compact_truncate = (u_int32_t)meta->last_pgno - nelems;
+
+	if (nelems != 0 && listp != NULL) {
+		*listp = list;
+		*nelemp = nelems;
+		list = NULL;
+	}
+
+err:	if (list != NULL)
+		__os_free(dbenv, list);
+	if (meta != NULL &&
+	    (t_ret = __memp_fput(mpf, (PAGE *)meta, 0)) != 0 && ret == 0)
+		ret = t_ret;
+	if ((t_ret = __TLPUT(dbc, metalock)) != 0 && ret == 0)
+		ret = t_ret;
+	if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0)
+		ret = t_ret;
+	return (ret);
+}
+
+static int
+__db_truncate_freelist(dbc, meta, h, list, start, nelem)
+	DBC *dbc;
+	DBMETA *meta;
+	PAGE *h;
+	db_pgno_t *list;
+	u_int32_t start, nelem;
+{
+	DB *dbp;
+	DB_LSN null_lsn;
+	DB_MPOOLFILE *mpf;
+	DBT ddbt;
+	PAGE *last_free, *pg;
+	db_pgno_t *lp;
+	struct pglist *plist, *pp;
+	int ret;
+
+	dbp = dbc->dbp;
+	mpf = dbp->mpf;
+	plist = NULL;
+	last_free = NULL;
+
+	if (start != 0 &&
+	    (ret = __memp_fget(mpf, &list[start - 1], dbc->txn,
+	    DB_MPOOL_DIRTY, &last_free)) != 0)
+		goto err;
+
+	if (DBC_LOGGING(dbc)) {
+		if ((ret = __os_malloc(dbp->dbenv,
+		     (nelem - start) * sizeof(*pp), &plist)) != 0)
+			goto err;
+
+		pp = plist;
+		for (lp = &list[start]; lp < &list[nelem]; lp++) {
+			pp->pgno = *lp;
+			if ((ret = __memp_fget(mpf, lp, dbc->txn, 0, &pg)) != 0)
+				goto err;
+			pp->lsn = LSN(pg);
+			if ((ret = __memp_fput(mpf, pg, DB_MPOOL_DISCARD)) != 0)
+				goto err;
+			pp++;
+		}
+		ddbt.data = plist;
+		ddbt.size = (nelem - start) * sizeof(*pp);
+		ZERO_LSN(null_lsn);
+		if (last_free != NULL) {
+			if ((ret = __db_pg_sort_log(dbp, dbc->txn, &LSN(meta),
+			     DB_FLUSH, PGNO(meta), &LSN(meta), PGNO(last_free),
+			     &LSN(last_free), meta->last_pgno, &ddbt)) != 0)
+				goto err;
+		} else if ((ret = __db_pg_sort_log(dbp, dbc->txn,
+		     &LSN(meta), DB_FLUSH, PGNO(meta), &LSN(meta),
+		     PGNO_INVALID, &null_lsn, meta->last_pgno, &ddbt)) != 0)
+			goto err;
+	} else
+		LSN_NOT_LOGGED(LSN(meta));
+	if (last_free != NULL)
+		LSN(last_free) = LSN(meta);
+
+	if ((ret = __memp_fput(mpf, h, DB_MPOOL_DISCARD)) != 0)
+		goto err;
+	h = NULL;
+	if ((ret = __memp_ftruncate(mpf, list[start], 0)) != 0)
+		goto err;
+	meta->last_pgno = list[start] - 1;
+
+	if (start == 0)
+		meta->free = PGNO_INVALID;
+	else {
+		NEXT_PGNO(last_free) = PGNO_INVALID;
+		if ((ret = __memp_fput(mpf, last_free, 0)) != 0)
+			goto err;
+		last_free = NULL;
+	}
+
+	/* Shrink the number of elements in the list. */
+	ret = __memp_extend_freelist(mpf, start, &list);
+
+err:	if (plist != NULL)
+		__os_free(dbp->dbenv, plist);
+
+	/* We need to put the page on error. */
+	if (h != NULL)
+		(void)__memp_fput(mpf, h, 0);
+	if (last_free != NULL)
+		(void)__memp_fput(mpf, last_free, 0);
+
+	return (ret);
+}
+#endif
+
 #ifdef DEBUG
 /*
  * __db_lprint --
@@ -394,9 +902,9 @@ __db_lget(dbc, action, pgno, mode, lkflags, lockp)
 {
 	DB *dbp;
 	DB_ENV *dbenv;
-	DB_LOCKREQ couple[2], *reqp;
+	DB_LOCKREQ couple[3], *reqp;
 	DB_TXN *txn;
-	int has_timeout, ret;
+	int has_timeout, i, ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -406,9 +914,10 @@ __db_lget(dbc, action, pgno, mode, lkflags, lockp)
 	 * We do not always check if we're configured for locking before
 	 * calling __db_lget to acquire the lock.
 	 */
-	if (CDB_LOCKING(dbenv) ||
-	    !LOCKING_ON(dbenv) || F_ISSET(dbc, DBC_COMPENSATE) ||
-	    (F_ISSET(dbc, DBC_RECOVER) &&
+	if (CDB_LOCKING(dbenv) || !LOCKING_ON(dbenv) ||
+	    (MULTIVERSION(dbp) && mode == DB_LOCK_READ &&
+	    dbc->txn != NULL && F_ISSET(dbc->txn, TXN_SNAPSHOT)) ||
+	    F_ISSET(dbc, DBC_DONTLOCK) || (F_ISSET(dbc, DBC_RECOVER) &&
 	    (action != LCK_ROLLBACK || IS_REP_CLIENT(dbenv))) ||
 	    (action != LCK_ALWAYS && F_ISSET(dbc, DBC_OPD))) {
 		LOCK_INIT(*lockp);
@@ -431,8 +940,8 @@ __db_lget(dbc, action, pgno, mode, lkflags, lockp)
 	if (DB_NONBLOCK(dbc))
 		lkflags |= DB_LOCK_NOWAIT;
 
-	if (F_ISSET(dbc, DBC_DIRTY_READ) && mode == DB_LOCK_READ)
-		mode = DB_LOCK_DIRTY;
+	if (F_ISSET(dbc, DBC_READ_UNCOMMITTED) && mode == DB_LOCK_READ)
+		mode = DB_LOCK_READ_UNCOMMITTED;
 
 	has_timeout = F_ISSET(dbc, DBC_RECOVER) ||
 	    (txn != NULL && F_ISSET(txn, TXN_LOCKTIMEOUT));
@@ -440,8 +949,8 @@ __db_lget(dbc, action, pgno, mode, lkflags, lockp)
 	/*
 	 * Transactional locking.
 	 * Hold on to the previous read lock only if we are in full isolation.
-	 * COUPLE_ALWAYS indicates we are holding an interior node
-	 * which need not be isolated.
+	 * COUPLE_ALWAYS indicates we are holding an interior node which need
+	 *	not be isolated.
 	 * Downgrade write locks if we are supporting dirty readers.
 	 */
 	if ((action != LCK_COUPLE && action != LCK_COUPLE_ALWAYS) ||
@@ -449,47 +958,54 @@ __db_lget(dbc, action, pgno, mode, lkflags, lockp)
 		action = 0;
 	else if (dbc->txn == NULL || action == LCK_COUPLE_ALWAYS)
 		action = LCK_COUPLE;
-	else if (F_ISSET(dbc, DBC_DEGREE_2) && lockp->mode == DB_LOCK_READ)
+	else if (F_ISSET(dbc,
+	    DBC_READ_COMMITTED) && lockp->mode == DB_LOCK_READ)
 		action = LCK_COUPLE;
-	else if (F_ISSET(dbc, DBC_DIRTY_READ) && lockp->mode == DB_LOCK_DIRTY)
+	else if (F_ISSET(dbc,
+	    DBC_READ_UNCOMMITTED) && lockp->mode == DB_LOCK_READ_UNCOMMITTED)
 		action = LCK_COUPLE;
-	else if (F_ISSET(dbc->dbp, DB_AM_DIRTY) && lockp->mode == DB_LOCK_WRITE)
+	else if (F_ISSET(dbc->dbp,
+	    DB_AM_READ_UNCOMMITTED) && lockp->mode == DB_LOCK_WRITE)
 		action = LCK_DOWNGRADE;
 	else
 		action = 0;
 
+	i = 0;
 	switch (action) {
-	case LCK_DOWNGRADE:
-		if ((ret = __lock_downgrade(
-		    dbenv, lockp, DB_LOCK_WWRITE, 0)) != 0)
-			return (ret);
-		/* FALLTHROUGH */
-
 	default:
-		if (!has_timeout) {
-			ret = __lock_get(dbenv,
-			    dbc->locker, lkflags, &dbc->lock_dbt, mode, lockp);
-			break;
-		}
+		if (has_timeout)
+			goto couple;
+		ret = __lock_get(dbenv,
+		    dbc->locker, lkflags, &dbc->lock_dbt, mode, lockp);
+		break;
 
+	case LCK_DOWNGRADE:
+		couple[0].op = DB_LOCK_GET;
+		couple[0].obj = NULL;
+		couple[0].lock = *lockp;
+		couple[0].mode = DB_LOCK_WWRITE;
+		UMRW_SET(couple[0].timeout);
+		i++;
 		/* FALLTHROUGH */
 	case LCK_COUPLE:
-		couple[0].op = has_timeout? DB_LOCK_GET_TIMEOUT : DB_LOCK_GET;
-		couple[0].obj = &dbc->lock_dbt;
-		couple[0].mode = mode;
-		UMRW_SET(couple[0].timeout);
+couple:		couple[i].op = has_timeout? DB_LOCK_GET_TIMEOUT : DB_LOCK_GET;
+		couple[i].obj = &dbc->lock_dbt;
+		couple[i].mode = mode;
+		UMRW_SET(couple[i].timeout);
+		i++;
 		if (has_timeout)
 			couple[0].timeout =
 			     F_ISSET(dbc, DBC_RECOVER) ? 0 : txn->lock_timeout;
-		if (action == LCK_COUPLE) {
-			couple[1].op = DB_LOCK_PUT;
-			couple[1].lock = *lockp;
+		if (action == LCK_COUPLE || action == LCK_DOWNGRADE) {
+			couple[i].op = DB_LOCK_PUT;
+			couple[i].lock = *lockp;
+			i++;
 		}
 
-		ret = __lock_vec(dbenv, dbc->locker,
-		    lkflags, couple, action == LCK_COUPLE ? 2 : 1, &reqp);
-		if (ret == 0 || reqp == &couple[1])
-			*lockp = couple[0].lock;
+		ret = __lock_vec(dbenv,
+		    dbc->locker, lkflags, couple, i, &reqp);
+		if (ret == 0 || reqp == &couple[i - 1])
+			*lockp = i == 1 ? couple[0].lock : couple[i - 2].lock;
 		break;
 	}
 
@@ -511,6 +1027,7 @@ __db_lput(dbc, lockp)
 	DB_LOCK *lockp;
 {
 	DB_ENV *dbenv;
+	DB_LOCKREQ couple[2], *reqp;
 	int action, ret;
 
 	/*
@@ -518,13 +1035,16 @@ __db_lput(dbc, lockp)
 	 * Hold on to the read locks only if we are in full isolation.
 	 * Downgrade write locks if we are supporting dirty readers.
 	 */
-	if (F_ISSET(dbc->dbp, DB_AM_DIRTY) && lockp->mode == DB_LOCK_WRITE)
+	if (F_ISSET(dbc->dbp,
+	    DB_AM_READ_UNCOMMITTED) && lockp->mode == DB_LOCK_WRITE)
 		action = LCK_DOWNGRADE;
 	else if (dbc->txn == NULL)
 		action = LCK_COUPLE;
-	else if (F_ISSET(dbc, DBC_DEGREE_2) && lockp->mode == DB_LOCK_READ)
+	else if (F_ISSET(dbc,
+	    DBC_READ_COMMITTED) && lockp->mode == DB_LOCK_READ)
 		action = LCK_COUPLE;
-	else if (F_ISSET(dbc, DBC_DIRTY_READ) && lockp->mode == DB_LOCK_DIRTY)
+	else if (F_ISSET(dbc,
+	    DBC_READ_UNCOMMITTED) && lockp->mode == DB_LOCK_READ_UNCOMMITTED)
 		action = LCK_COUPLE;
 	else
 		action = 0;
@@ -532,10 +1052,19 @@ __db_lput(dbc, lockp)
 	dbenv = dbc->dbp->dbenv;
 	switch (action) {
 	case LCK_COUPLE:
-		ret = __lock_put(dbenv, lockp, 0);
+		ret = __lock_put(dbenv, lockp);
 		break;
 	case LCK_DOWNGRADE:
-		ret = __lock_downgrade(dbenv, lockp, DB_LOCK_WWRITE, 0);
+		couple[0].op = DB_LOCK_GET;
+		couple[0].obj = NULL;
+		couple[0].mode = DB_LOCK_WWRITE;
+		couple[0].lock = *lockp;
+		UMRW_SET(couple[0].timeout);
+		couple[1].op = DB_LOCK_PUT;
+		couple[1].lock = *lockp;
+		ret = __lock_vec(dbenv, dbc->locker, 0, couple, 2, &reqp);
+		if (ret == 0 || reqp == &couple[1])
+			*lockp = couple[0].lock;
 		break;
 	default:
 		ret = 0;
diff --git a/db/db/db_method.c b/db/db/db_method.c
index 4266fbf0e..c4b28cb4d 100644
--- a/db/db/db_method.c
+++ b/db/db/db_method.c
@@ -1,50 +1,39 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1999-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1999-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_method.c,v 11.116 2004/10/11 18:22:05 bostic Exp $
+ * $Id: db_method.c,v 12.23 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#ifdef HAVE_RPC
-#include 
-#endif
-
-#include 
-#endif
-
-#ifdef HAVE_RPC
-#include "db_server.h"
-#endif
-
 #include "db_int.h"
 #include "dbinc/crypto.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/btree.h"
 #include "dbinc/hash.h"
 #include "dbinc/lock.h"
 #include "dbinc/mp.h"
 #include "dbinc/qam.h"
-#include "dbinc/xa.h"
-#include "dbinc_auto/xa_ext.h"
+#include "dbinc/txn.h"
 
 #ifdef HAVE_RPC
+#ifndef NO_SYSTEM_INCLUDES
+#include 
+#endif
+#include "db_server.h"
 #include "dbinc_auto/rpc_client_ext.h"
 #endif
 
 static int  __db_get_byteswapped __P((DB *, int *));
 static int  __db_get_dbname __P((DB *, const char **, const char **));
 static DB_ENV *__db_get_env __P((DB *));
+static DB_MPOOLFILE *__db_get_mpf __P((DB *));
 static int  __db_get_transactional __P((DB *));
 static int  __db_get_type __P((DB *, DBTYPE *dbtype));
-static int  __db_init __P((DB *, u_int32_t));
+static int  __db_init __P((DB_ENV *, DB *, u_int32_t));
 static int  __db_set_alloc __P((DB *, void *(*)(size_t),
 		void *(*)(void *, size_t), void (*)(void *)));
 static int  __db_set_append_recno __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
@@ -71,10 +60,6 @@ static void __db_set_msgfile __P((DB *, FILE *));
 static void __dbh_err __P((DB *, int, const char *, ...));
 static void __dbh_errx __P((DB *, const char *, ...));
 
-#ifdef HAVE_RPC
-static int  __dbcl_init __P((DB *, DB_ENV *, u_int32_t));
-#endif
-
 /*
  * db_create --
  *	DB constructor.
@@ -88,17 +73,17 @@ db_create(dbpp, dbenv, flags)
 	u_int32_t flags;
 {
 	DB *dbp;
+	DB_THREAD_INFO *ip;
+	DB_REP *db_rep;
 	int ret;
 
 	/* Check for invalid function flags. */
 	switch (flags) {
 	case 0:
 		break;
-	case DB_REP_CREATE:
-		break;
 	case DB_XA_CREATE:
 		if (dbenv != NULL) {
-			__db_err(dbenv,
+			__db_errx(dbenv,
 		"XA applications may not specify an environment to db_create");
 			return (EINVAL);
 		}
@@ -115,16 +100,17 @@ db_create(dbpp, dbenv, flags)
 		return (__db_ferr(dbenv, "db_create", 0));
 	}
 
+	ip = NULL;
+	if (dbenv != NULL)
+		ENV_ENTER(dbenv, ip);
 	/* Allocate the DB. */
-	if ((ret = __os_calloc(dbenv, 1, sizeof(*dbp), &dbp)) != 0)
+	if ((ret = __os_calloc(dbenv, 1, sizeof(*dbp), &dbp)) != 0) {
+		if (dbenv != NULL)
+			ENV_LEAVE(dbenv, ip);
 		return (ret);
-#ifdef HAVE_RPC
-	if (dbenv != NULL && RPC_ON(dbenv))
-		ret = __dbcl_init(dbp, dbenv, flags);
-	else
-#endif
-		ret = __db_init(dbp, flags);
-	if (ret != 0)
+	}
+
+	if ((ret = __db_init(dbenv, dbp, flags)) != 0)
 		goto err;
 
 	/* If we don't have an environment yet, allocate a local one. */
@@ -132,26 +118,32 @@ db_create(dbpp, dbenv, flags)
 		if ((ret = db_env_create(&dbenv, 0)) != 0)
 			goto err;
 		F_SET(dbenv, DB_ENV_DBLOCAL);
+		ENV_ENTER(dbenv, ip);
 	}
 	dbp->dbenv = dbenv;
-	MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp);
+	MUTEX_LOCK(dbenv, dbenv->mtx_dblist);
 	++dbenv->db_ref;
-	MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp);
+	MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist);
 
 	/*
 	 * Set the replication timestamp; it's 0 if we're not in a replicated
-	 * environment.
+	 * environment.  Don't acquire a lock to read the value, even though
+	 * it's opaque: all we check later is value equality, nothing else.
+	 */
+	dbp->timestamp = REP_ON(dbenv) ?
+	    ((REGENV *)((REGINFO *)dbenv->reginfo)->primary)->rep_timestamp : 0;
+	/*
+	 * Set the replication generation number for fid management; valid
+	 * replication generations start at 1.  Don't acquire a lock to
+	 * read the value.  All we check later is value equality.
 	 */
-	dbp->timestamp =
-	    (F_ISSET(dbenv, DB_ENV_DBLOCAL) || !REP_ON(dbenv)) ? 0 :
-	    ((REGENV *)((REGINFO *)dbenv->reginfo)->primary)->rep_timestamp;
+	db_rep = dbenv->rep_handle;
+	dbp->fid_gen = REP_ON(dbenv) ? ((REP *)db_rep->region)->gen : 0;
 
 	/* If not RPC, open a backing DB_MPOOLFILE handle in the memory pool. */
-#ifdef HAVE_RPC
-	if (!RPC_ON(dbenv))
-#endif
-		if ((ret = __memp_fcreate(dbenv, &dbp->mpf)) != 0)
-			goto err;
+	if (!RPC_ON(dbenv) &&
+	    (ret = __memp_fcreate(dbenv, &dbp->mpf)) != 0)
+		goto err;
 
 	dbp->type = DB_UNKNOWN;
 
@@ -161,9 +153,10 @@ db_create(dbpp, dbenv, flags)
 err:	if (dbp->mpf != NULL)
 		(void)__memp_fclose(dbp->mpf, 0);
 	if (dbenv != NULL && F_ISSET(dbenv, DB_ENV_DBLOCAL))
-		(void)__dbenv_close(dbenv, 0);
+		(void)__env_close(dbenv, 0);
 	__os_free(dbenv, dbp);
 	*dbpp = NULL;
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -172,7 +165,8 @@ err:	if (dbp->mpf != NULL)
  *	Initialize a DB structure.
  */
 static int
-__db_init(dbp, flags)
+__db_init(dbenv, dbp, flags)
+	DB_ENV *dbenv;
 	DB *dbp;
 	u_int32_t flags;
 {
@@ -189,8 +183,10 @@ __db_init(dbp, flags)
 	FLD_SET(dbp->am_ok,
 	    DB_OK_BTREE | DB_OK_HASH | DB_OK_QUEUE | DB_OK_RECNO);
 
+	/* DB PUBLIC HANDLE LIST BEGIN */
 	dbp->associate = __db_associate_pp;
 	dbp->close = __db_close_pp;
+	dbp->compact = __db_compact_pp;
 	dbp->cursor = __db_cursor_pp;
 	dbp->del = __db_del_pp;
 	dbp->dump = __db_dump_pp;
@@ -199,9 +195,18 @@ __db_init(dbp, flags)
 	dbp->fd = __db_fd_pp;
 	dbp->get = __db_get_pp;
 	dbp->get_byteswapped = __db_get_byteswapped;
+	dbp->get_cachesize = __db_get_cachesize;
 	dbp->get_dbname = __db_get_dbname;
+	dbp->get_encrypt_flags = __db_get_encrypt_flags;
 	dbp->get_env = __db_get_env;
+	dbp->get_errfile = __db_get_errfile;
+	dbp->get_errpfx = __db_get_errpfx;
+	dbp->get_flags = __db_get_flags;
+	dbp->get_lorder = __db_get_lorder;
+	dbp->get_mpf = __db_get_mpf;
+	dbp->get_msgfile = __db_get_msgfile;
 	dbp->get_open_flags = __db_get_open_flags;
+	dbp->get_pagesize = __db_get_pagesize;
 	dbp->get_transactional = __db_get_transactional;
 	dbp->get_type = __db_get_type;
 	dbp->join = __db_join_pp;
@@ -211,35 +216,28 @@ __db_init(dbp, flags)
 	dbp->put = __db_put_pp;
 	dbp->remove = __db_remove_pp;
 	dbp->rename = __db_rename_pp;
-	dbp->truncate = __db_truncate_pp;
 	dbp->set_alloc = __db_set_alloc;
 	dbp->set_append_recno = __db_set_append_recno;
-	dbp->get_cachesize = __db_get_cachesize;
 	dbp->set_cachesize = __db_set_cachesize;
 	dbp->set_dup_compare = __db_set_dup_compare;
-	dbp->get_encrypt_flags = __db_get_encrypt_flags;
 	dbp->set_encrypt = __db_set_encrypt;
 	dbp->set_errcall = __db_set_errcall;
-	dbp->get_errfile = __db_get_errfile;
 	dbp->set_errfile = __db_set_errfile;
-	dbp->get_errpfx = __db_get_errpfx;
 	dbp->set_errpfx = __db_set_errpfx;
 	dbp->set_feedback = __db_set_feedback;
-	dbp->get_flags = __db_get_flags;
 	dbp->set_flags = __db_set_flags;
-	dbp->get_lorder = __db_get_lorder;
 	dbp->set_lorder = __db_set_lorder;
 	dbp->set_msgcall = __db_set_msgcall;
-	dbp->get_msgfile = __db_get_msgfile;
 	dbp->set_msgfile = __db_set_msgfile;
-	dbp->get_pagesize = __db_get_pagesize;
 	dbp->set_pagesize = __db_set_pagesize;
 	dbp->set_paniccall = __db_set_paniccall;
 	dbp->stat = __db_stat_pp;
 	dbp->stat_print = __db_stat_print_pp;
 	dbp->sync = __db_sync_pp;
+	dbp->truncate = __db_truncate_pp;
 	dbp->upgrade = __db_upgrade_pp;
 	dbp->verify = __db_verify_pp;
+	/* DB PUBLIC HANDLE LIST END */
 
 					/* Access method specific. */
 	if ((ret = __bam_db_create(dbp)) != 0)
@@ -256,8 +254,25 @@ __db_init(dbp, flags)
 	if (LF_ISSET(DB_XA_CREATE) && (ret = __db_xa_create(dbp)) != 0)
 		return (ret);
 
-	if (LF_ISSET(DB_REP_CREATE))
-		F_SET(dbp, DB_AM_REPLICATION);
+#ifdef HAVE_RPC
+	/*
+	 * RPC specific: must be last, as we replace methods set by the
+	 * access methods.
+	 */
+	if (dbenv != NULL && RPC_ON(dbenv)) {
+		__dbcl_dbp_init(dbp);
+		/*
+		 * !!!
+		 * We wrap the DB->open method for RPC, and the rpc.src file
+		 * can't handle that.
+		 */
+		dbp->open = __dbcl_db_open_wrap;
+		if ((ret = __dbcl_db_create(dbp, dbenv, flags)) != 0)
+			return (ret);
+	}
+#else
+	COMPQUIET(dbenv, NULL);
+#endif
 
 	return (0);
 }
@@ -286,7 +301,7 @@ __dbh_am_chk(dbp, flags)
 		return (0);
 	}
 
-	__db_err(dbp->dbenv,
+	__db_errx(dbp->dbenv,
     "call implies an access method which is inconsistent with previous calls");
 	return (EINVAL);
 }
@@ -306,7 +321,7 @@ __dbh_err(dbp, error, fmt, va_alist)
 	va_dcl
 #endif
 {
-	DB_REAL_ERR(dbp->dbenv, error, 1, 1, fmt);
+	DB_REAL_ERR(dbp->dbenv, error, DB_ERROR_SET, 1, fmt);
 }
 
 /*
@@ -323,7 +338,7 @@ __dbh_errx(dbp, fmt, va_alist)
 	va_dcl
 #endif
 {
-	DB_REAL_ERR(dbp->dbenv, 0, 0, 1, fmt);
+	DB_REAL_ERR(dbp->dbenv, 0, DB_ERROR_NOT_SET, 1, fmt);
 }
 
 /*
@@ -370,6 +385,17 @@ __db_get_env(dbp)
 	return (dbp->dbenv);
 }
 
+/*
+ * __db_get_mpf --
+ *	Get the underlying DB_MPOOLFILE handle.
+ */
+static DB_MPOOLFILE *
+__db_get_mpf(dbp)
+	DB *dbp;
+{
+	return (dbp->mpf);
+}
+
 /*
  * get_transactional --
  *	Get whether this database was created in a transaction.
@@ -478,7 +504,7 @@ __db_get_encrypt_flags(dbp, flagsp)
 {
 	DB_ILLEGAL_IN_ENV(dbp, "DB->get_encrypt_flags");
 
-	return (__dbenv_get_encrypt_flags(dbp->dbenv, flagsp));
+	return (__env_get_encrypt_flags(dbp->dbenv, flagsp));
 }
 
 /*
@@ -497,7 +523,7 @@ __db_set_encrypt(dbp, passwd, flags)
 	DB_ILLEGAL_IN_ENV(dbp, "DB->set_encrypt");
 	DB_ILLEGAL_AFTER_OPEN(dbp, "DB->set_encrypt");
 
-	if ((ret = __dbenv_set_encrypt(dbp->dbenv, passwd, flags)) != 0)
+	if ((ret = __env_set_encrypt(dbp->dbenv, passwd, flags)) != 0)
 		return (ret);
 
 	/*
@@ -517,7 +543,7 @@ __db_set_errcall(dbp, errcall)
 	DB *dbp;
 	void (*errcall) __P((const DB_ENV *, const char *, const char *));
 {
-	__dbenv_set_errcall(dbp->dbenv, errcall);
+	__env_set_errcall(dbp->dbenv, errcall);
 }
 
 static void
@@ -525,7 +551,7 @@ __db_get_errfile(dbp, errfilep)
 	DB *dbp;
 	FILE **errfilep;
 {
-	__dbenv_get_errfile(dbp->dbenv, errfilep);
+	__env_get_errfile(dbp->dbenv, errfilep);
 }
 
 static void
@@ -533,7 +559,7 @@ __db_set_errfile(dbp, errfile)
 	DB *dbp;
 	FILE *errfile;
 {
-	__dbenv_set_errfile(dbp->dbenv, errfile);
+	__env_set_errfile(dbp->dbenv, errfile);
 }
 
 static void
@@ -541,7 +567,7 @@ __db_get_errpfx(dbp, errpfxp)
 	DB *dbp;
 	const char **errpfxp;
 {
-	__dbenv_get_errpfx(dbp->dbenv, errpfxp);
+	__env_get_errpfx(dbp->dbenv, errpfxp);
 }
 
 static void
@@ -549,7 +575,7 @@ __db_set_errpfx(dbp, errpfx)
 	DB *dbp;
 	const char *errpfx;
 {
-	__dbenv_set_errpfx(dbp->dbenv, errpfx);
+	__env_set_errpfx(dbp->dbenv, errpfx);
 }
 
 static int
@@ -623,7 +649,7 @@ __db_get_flags(dbp, flagsp)
 #ifdef HAVE_QUEUE
 		__qam_map_flags(dbp, &f, &mapped_flag);
 #endif
-		DB_ASSERT(f == 0);
+		DB_ASSERT(dbp->dbenv, f == 0);
 		if (F_ISSET(dbp, mapped_flag) == mapped_flag)
 			LF_SET(db_flags[i]);
 	}
@@ -649,7 +675,7 @@ __db_set_flags(dbp, flags)
 	dbenv = dbp->dbenv;
 
 	if (LF_ISSET(DB_ENCRYPT) && !CRYPTO_ON(dbenv)) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "Database environment not configured for encryption");
 		return (EINVAL);
 	}
@@ -740,7 +766,7 @@ __db_set_alloc(dbp, mal_func, real_func, free_func)
 	DB_ILLEGAL_IN_ENV(dbp, "DB->set_alloc");
 	DB_ILLEGAL_AFTER_OPEN(dbp, "DB->set_alloc");
 
-	return (__dbenv_set_alloc(dbp->dbenv, mal_func, real_func, free_func));
+	return (__env_set_alloc(dbp->dbenv, mal_func, real_func, free_func));
 }
 
 static void
@@ -748,7 +774,7 @@ __db_set_msgcall(dbp, msgcall)
 	DB *dbp;
 	void (*msgcall) __P((const DB_ENV *, const char *));
 {
-	__dbenv_set_msgcall(dbp->dbenv, msgcall);
+	__env_set_msgcall(dbp->dbenv, msgcall);
 }
 
 static void
@@ -756,7 +782,7 @@ __db_get_msgfile(dbp, msgfilep)
 	DB *dbp;
 	FILE **msgfilep;
 {
-	__dbenv_get_msgfile(dbp->dbenv, msgfilep);
+	__env_get_msgfile(dbp->dbenv, msgfilep);
 }
 
 static void
@@ -764,7 +790,7 @@ __db_set_msgfile(dbp, msgfile)
 	DB *dbp;
 	FILE *msgfile;
 {
-	__dbenv_set_msgfile(dbp->dbenv, msgfile);
+	__env_set_msgfile(dbp->dbenv, msgfile);
 }
 
 static int
@@ -790,12 +816,12 @@ __db_set_pagesize(dbp, db_pagesize)
 	DB_ILLEGAL_AFTER_OPEN(dbp, "DB->set_pagesize");
 
 	if (db_pagesize < DB_MIN_PGSIZE) {
-		__db_err(dbp->dbenv, "page sizes may not be smaller than %lu",
+		__db_errx(dbp->dbenv, "page sizes may not be smaller than %lu",
 		    (u_long)DB_MIN_PGSIZE);
 		return (EINVAL);
 	}
 	if (db_pagesize > DB_MAX_PGSIZE) {
-		__db_err(dbp->dbenv, "page sizes may not be larger than %lu",
+		__db_errx(dbp->dbenv, "page sizes may not be larger than %lu",
 		    (u_long)DB_MAX_PGSIZE);
 		return (EINVAL);
 	}
@@ -805,7 +831,7 @@ __db_set_pagesize(dbp, db_pagesize)
 	 * for alignment of various types on the pages.
 	 */
 	if (!POWER_OF_TWO(db_pagesize)) {
-		__db_err(dbp->dbenv, "page sizes must be a power-of-2");
+		__db_errx(dbp->dbenv, "page sizes must be a power-of-2");
 		return (EINVAL);
 	}
 
@@ -824,97 +850,5 @@ __db_set_paniccall(dbp, paniccall)
 	DB *dbp;
 	void (*paniccall) __P((DB_ENV *, int));
 {
-	return (__dbenv_set_paniccall(dbp->dbenv, paniccall));
-}
-
-#ifdef HAVE_RPC
-/*
- * __dbcl_init --
- *	Initialize a DB structure on the server.
- */
-static int
-__dbcl_init(dbp, dbenv, flags)
-	DB *dbp;
-	DB_ENV *dbenv;
-	u_int32_t flags;
-{
-	TAILQ_INIT(&dbp->free_queue);
-	TAILQ_INIT(&dbp->active_queue);
-	/* !!!
-	 * Note that we don't need to initialize the join_queue;  it's
-	 * not used in RPC clients.  See the comment in __dbcl_db_join_ret().
-	 */
-
-	dbp->associate = __dbcl_db_associate;
-	dbp->close = __dbcl_db_close;
-	dbp->cursor = __dbcl_db_cursor;
-	dbp->del = __dbcl_db_del;
-	dbp->err = __dbh_err;
-	dbp->errx = __dbh_errx;
-	dbp->fd = __dbcl_db_fd;
-	dbp->get = __dbcl_db_get;
-	dbp->get_byteswapped = __db_get_byteswapped;
-	dbp->get_transactional = __db_get_transactional;
-	dbp->get_type = __db_get_type;
-	dbp->join = __dbcl_db_join;
-	dbp->key_range = __dbcl_db_key_range;
-	dbp->get_dbname = __dbcl_db_get_name;
-	dbp->get_open_flags = __dbcl_db_get_open_flags;
-	dbp->open = __dbcl_db_open_wrap;
-	dbp->pget = __dbcl_db_pget;
-	dbp->put = __dbcl_db_put;
-	dbp->remove = __dbcl_db_remove;
-	dbp->rename = __dbcl_db_rename;
-	dbp->set_alloc = __dbcl_db_alloc;
-	dbp->set_append_recno = __dbcl_db_set_append_recno;
-	dbp->get_cachesize = __dbcl_db_get_cachesize;
-	dbp->set_cachesize = __dbcl_db_cachesize;
-	dbp->set_dup_compare = __dbcl_db_dup_compare;
-	dbp->get_encrypt_flags = __dbcl_db_get_encrypt_flags;
-	dbp->set_encrypt = __dbcl_db_encrypt;
-	dbp->set_errcall = __db_set_errcall;
-	dbp->get_errfile = __db_get_errfile;
-	dbp->set_errfile = __db_set_errfile;
-	dbp->get_errpfx = __db_get_errpfx;
-	dbp->set_errpfx = __db_set_errpfx;
-	dbp->set_feedback = __dbcl_db_feedback;
-	dbp->get_flags = __dbcl_db_get_flags;
-	dbp->set_flags = __dbcl_db_flags;
-	dbp->get_lorder = __dbcl_db_get_lorder;
-	dbp->set_lorder = __dbcl_db_lorder;
-	dbp->get_pagesize = __dbcl_db_get_pagesize;
-	dbp->set_pagesize = __dbcl_db_pagesize;
-	dbp->set_paniccall = __dbcl_db_panic;
-	dbp->stat = __dbcl_db_stat;
-	dbp->sync = __dbcl_db_sync;
-	dbp->truncate = __dbcl_db_truncate;
-	dbp->upgrade = __dbcl_db_upgrade;
-	dbp->verify = __dbcl_db_verify;
-
-	/*
-	 * Set all the method specific functions to client funcs as well.
-	 */
-	dbp->set_bt_compare = __dbcl_db_bt_compare;
-	dbp->set_bt_maxkey = __dbcl_db_bt_maxkey;
-	dbp->get_bt_minkey = __dbcl_db_get_bt_minkey;
-	dbp->set_bt_minkey = __dbcl_db_bt_minkey;
-	dbp->set_bt_prefix = __dbcl_db_bt_prefix;
-	dbp->get_h_ffactor = __dbcl_db_get_h_ffactor;
-	dbp->set_h_ffactor = __dbcl_db_h_ffactor;
-	dbp->set_h_hash = __dbcl_db_h_hash;
-	dbp->get_h_nelem = __dbcl_db_get_h_nelem;
-	dbp->set_h_nelem = __dbcl_db_h_nelem;
-	dbp->get_q_extentsize = __dbcl_db_get_extentsize;
-	dbp->set_q_extentsize = __dbcl_db_extentsize;
-	dbp->get_re_delim = __dbcl_db_get_re_delim;
-	dbp->set_re_delim = __dbcl_db_re_delim;
-	dbp->get_re_len = __dbcl_db_get_re_len;
-	dbp->set_re_len = __dbcl_db_re_len;
-	dbp->get_re_pad = __dbcl_db_get_re_pad;
-	dbp->set_re_pad = __dbcl_db_re_pad;
-	dbp->get_re_source = __dbcl_db_get_re_source;
-	dbp->set_re_source = __dbcl_db_re_source;
-
-	return (__dbcl_db_create(dbp, dbenv, flags));
+	return (__env_set_paniccall(dbp->dbenv, paniccall));
 }
-#endif
diff --git a/db/db/db_open.c b/db/db/db_open.c
index 35e115091..6fe158900 100644
--- a/db/db/db_open.c
+++ b/db/db/db_open.c
@@ -1,24 +1,16 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_open.c,v 11.240 2004/09/22 20:53:19 margo Exp $
+ * $Id: db_open.c,v 12.30 2006/09/19 15:06:58 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/db_swap.h"
 #include "dbinc/btree.h"
 #include "dbinc/crypto.h"
@@ -42,12 +34,15 @@
  * 2. It can be called to open a subdatabase during normal operation.  In
  *    this case, name and subname will both be non-NULL and meta_pgno will
  *    be PGNO_BASE_MD (also PGNO_INVALID).
- * 3. It can be called during recovery to open a file/database, in which case
+ * 3. It can be called to open an in-memory database (name == NULL;
+ *    subname = name).
+ * 4. It can be called during recovery to open a file/database, in which case
  *    name will be non-NULL, subname will be NULL, and meta-pgno will be
  *    PGNO_BASE_MD.
- * 4. It can be called during recovery to open a subdatabase, in which case
+ * 5. It can be called during recovery to open a subdatabase, in which case
  *    name will be non-NULL, subname may be NULL and meta-pgno will be
  *    a valid pgno (i.e., not PGNO_BASE_MD).
+ * 6. It can be called during recovery to open an in-memory database.
  *
  * PUBLIC: int __db_open __P((DB *, DB_TXN *,
  * PUBLIC:     const char *, const char *, DBTYPE, u_int32_t, int, db_pgno_t));
@@ -85,53 +80,74 @@ __db_open(dbp, txn, fname, dname, type, flags, mode, meta_pgno)
 	/* Convert any DB->open flags. */
 	if (LF_ISSET(DB_RDONLY))
 		F_SET(dbp, DB_AM_RDONLY);
-	if (LF_ISSET(DB_DIRTY_READ))
-		F_SET(dbp, DB_AM_DIRTY);
+	if (LF_ISSET(DB_READ_UNCOMMITTED))
+		F_SET(dbp, DB_AM_READ_UNCOMMITTED);
 
-	if (txn != NULL)
+	if (IS_REAL_TXN(txn))
 		F_SET(dbp, DB_AM_TXN);
 
 	/* Fill in the type. */
 	dbp->type = type;
 
 	/*
-	 * If fname is NULL, it's always a create, so make sure that we
-	 * have a type specified.  It would be nice if this checking
-	 * were done in __db_open where most of the interface checking
-	 * is done, but this interface (__db_dbopen) is used by the
-	 * recovery and limbo system, so we need to safeguard this
-	 * interface as well.
+	 * If both fname and subname are NULL, it's always a create, so make
+	 * sure that we have both DB_CREATE and a type specified.  It would
+	 * be nice if this checking were done in __db_open where most of the
+	 * interface checking is done, but this interface (__db_dbopen) is
+	 * used by the recovery and limbo system, so we need to safeguard
+	 * this interface as well.
 	 */
 	if (fname == NULL) {
-		F_SET(dbp, DB_AM_INMEM);
+		if (dname == NULL) {
+			if (!LF_ISSET(DB_CREATE)) {
+				__db_errx(dbenv,
+			    "DB_CREATE must be specified to create databases.");
+				return (ENOENT);
+			}
 
-		if (dbp->type == DB_UNKNOWN) {
-			__db_err(dbenv,
-			    "DBTYPE of unknown without existing file");
-			return (EINVAL);
-		}
+			F_SET(dbp, DB_AM_INMEM);
+			F_SET(dbp, DB_AM_CREATED);
 
-		if (dbp->pgsize == 0)
-			dbp->pgsize = DB_DEF_IOSIZE;
+			if (dbp->type == DB_UNKNOWN) {
+				__db_errx(dbenv,
+				    "DBTYPE of unknown without existing file");
+				return (EINVAL);
+			}
+
+			if (dbp->pgsize == 0)
+				dbp->pgsize = DB_DEF_IOSIZE;
+
+			/*
+			 * If the file is a temporary file and we're
+			 * doing locking, then we have to create a
+			 * unique file ID.  We can't use our normal
+			 * dev/inode pair (or whatever this OS uses
+			 * in place of dev/inode pairs) because no
+			 * backing file will be created until the
+			 * mpool cache is filled forcing the buffers
+			 * to disk.  Grab a random locker ID to use
+			 * as a file ID.  The created ID must never
+			 * match a potential real file ID -- we know
+			 * it won't because real file IDs contain a
+			 * time stamp after the dev/inode pair, and
+			 * we're simply storing a 4-byte value.
+
+			 * !!!
+			 * Store the locker in the file id structure
+			 * -- we can get it from there as necessary,
+			 * and it saves having two copies.
+			*/
+			if (LOCKING_ON(dbenv) && (ret = __lock_id(dbenv,
+			    (u_int32_t *)dbp->fileid, NULL)) != 0)
+				return (ret);
+		} else
+			MAKE_INMEM(dbp);
 
 		/*
-		 * If the file is a temporary file and we're doing locking,
-		 * then we have to create a unique file ID.  We can't use our
-		 * normal dev/inode pair (or whatever this OS uses in place of
-		 * dev/inode pairs) because no backing file will be created
-		 * until the mpool cache is filled forcing the buffers to disk.
-		 * Grab a random locker ID to use as a file ID.  The created
-		 * ID must never match a potential real file ID -- we know it
-		 * won't because real file IDs contain a time stamp after the
-		 * dev/inode pair, and we're simply storing a 4-byte value.
-		 *
-		 * !!!
-		 * Store the locker in the file id structure -- we can get it
-		 * from there as necessary, and it saves having two copies.
+		 * Normally we would do handle locking here, however, with
+		 * in-memory files, we cannot do any database manipulation
+		 * until the mpool is open, so it happens later.
 		 */
-		if (LOCKING_ON(dbenv) &&
-		    (ret = __lock_id(dbenv, (u_int32_t *)dbp->fileid)) != 0)
-			return (ret);
 	} else if (dname == NULL && meta_pgno == PGNO_BASE_MD) {
 		/* Open/create the underlying file.  Acquire locks. */
 		if ((ret =
@@ -161,40 +177,46 @@ __db_open(dbp, txn, fname, dname, type, flags, mode, meta_pgno)
 		LF_SET(DB_TRUNCATE);
 
 	/* Set up the underlying environment. */
-	if ((ret = __db_dbenv_setup(dbp, txn, fname, id, flags)) != 0)
+	if ((ret = __db_dbenv_setup(dbp, txn, fname, dname, id, flags)) != 0)
 		return (ret);
 
-	/*
-	 * Set the open flag.  We use it to mean that the dbp has gone
-	 * through mpf setup, including dbreg_register.  Also, below,
-	 * the underlying access method open functions may want to do
-	 * things like acquire cursors, so the open flag has to be set
-	 * before calling them.
-	 */
-	F_SET(dbp, DB_AM_OPEN_CALLED);
-
-	/*
-	 * For unnamed files, we need to actually create the file now
-	 * that the mpool is open.
-	 */
-	if (fname == NULL && (ret = __db_new_file(dbp, txn, NULL, NULL)) != 0)
-		return (ret);
+	/* For in-memory databases, we now need to open/create the database. */
+	if (F_ISSET(dbp, DB_AM_INMEM)) {
+		if (dname == NULL)
+			ret = __db_new_file(dbp, txn, NULL, NULL);
+		else {
+			id = TXN_INVALID;
+			if ((ret = __fop_file_setup(dbp,
+			    txn, dname, mode, flags, &id)) == 0 &&
+			    DBENV_LOGGING(dbenv) && !F_ISSET(dbp, DB_AM_RECOVER)
+#if !defined(DEBUG_ROP)
+			    && !F_ISSET(dbp, DB_AM_RDONLY)
+#endif
+			)
+				ret = __dbreg_log_id(dbp,
+				    txn, dbp->log_filename->id, 1);
+		}
+		if (ret != 0)
+			goto err;
+	}
 
 	switch (dbp->type) {
-	case DB_BTREE:
-		ret = __bam_open(dbp, txn, fname, meta_pgno, flags);
-		break;
-	case DB_HASH:
-		ret = __ham_open(dbp, txn, fname, meta_pgno, flags);
-		break;
-	case DB_RECNO:
-		ret = __ram_open(dbp, txn, fname, meta_pgno, flags);
-		break;
-	case DB_QUEUE:
-		ret = __qam_open(dbp, txn, fname, meta_pgno, mode, flags);
-		break;
-	case DB_UNKNOWN:
-		return (__db_unknown_type(dbenv, "__db_dbopen", dbp->type));
+		case DB_BTREE:
+			ret = __bam_open(dbp, txn, fname, meta_pgno, flags);
+			break;
+		case DB_HASH:
+			ret = __ham_open(dbp, txn, fname, meta_pgno, flags);
+			break;
+		case DB_RECNO:
+			ret = __ram_open(dbp, txn, fname, meta_pgno, flags);
+			break;
+		case DB_QUEUE:
+			ret = __qam_open(
+			    dbp, txn, fname, meta_pgno, mode, flags);
+			break;
+		case DB_UNKNOWN:
+			return (
+			    __db_unknown_type(dbenv, "__db_dbopen", dbp->type));
 	}
 	if (ret != 0)
 		goto err;
@@ -202,16 +224,16 @@ __db_open(dbp, txn, fname, dname, type, flags, mode, meta_pgno)
 	DB_TEST_RECOVERY(dbp, DB_TEST_POSTOPEN, ret, fname);
 
 	/*
-	 * Unnamed files don't need handle locks, so we only have to check
+	 * Temporary files don't need handle locks, so we only have to check
 	 * for a handle lock downgrade or lockevent in the case of named
 	 * files.
 	 */
-	if (!F_ISSET(dbp, DB_AM_RECOVER) &&
-	    fname != NULL && LOCK_ISSET(dbp->handle_lock)) {
-		if (txn != NULL) {
+	if (!F_ISSET(dbp, DB_AM_RECOVER) && (fname != NULL || dname != NULL) &&
+	    LOCK_ISSET(dbp->handle_lock)) {
+		if (IS_REAL_TXN(txn))
 			ret = __txn_lockevent(dbenv,
 			    txn, dbp, &dbp->handle_lock, dbp->lid);
-		} else if (LOCKING_ON(dbenv))
+		else if (LOCKING_ON(dbenv))
 			/* Trade write handle lock for read handle lock. */
 			ret = __lock_downgrade(dbenv,
 			    &dbp->handle_lock, DB_LOCK_READ, 0);
@@ -266,7 +288,7 @@ __db_new_file(dbp, txn, fhp, name)
 		break;
 	case DB_UNKNOWN:
 	default:
-		__db_err(dbp->dbenv,
+		__db_errx(dbp->dbenv,
 		    "%s: Invalid type %d specified", name, dbp->type);
 		ret = EINVAL;
 		break;
@@ -303,7 +325,8 @@ __db_init_subdb(mdbp, dbp, name, txn)
 	if (!F_ISSET(dbp, DB_AM_CREATED)) {
 		/* Subdb exists; read meta-data page and initialize. */
 		mpf = mdbp->mpf;
-		if  ((ret = __memp_fget(mpf, &dbp->meta_pgno, 0, &meta)) != 0)
+		if  ((ret = __memp_fget(mpf, &dbp->meta_pgno,
+		    txn, 0, &meta)) != 0)
 			goto err;
 		ret = __db_meta_setup(mdbp->dbenv, dbp, name, meta, 0, 0);
 		if ((t_ret = __memp_fput(mpf, meta, 0)) != 0 && ret == 0)
@@ -331,7 +354,7 @@ __db_init_subdb(mdbp, dbp, name, txn)
 		break;
 	case DB_UNKNOWN:
 	default:
-		__db_err(dbp->dbenv,
+		__db_errx(dbp->dbenv,
 		    "Invalid subdatabase type %d specified", dbp->type);
 		return (EINVAL);
 	}
@@ -341,8 +364,8 @@ err:	return (ret);
 
 /*
  * __db_chk_meta --
- *	Take a buffer containing a meta-data page and check it for a checksum
- *	(and verify the checksum if necessary) and possibly decrypt it.
+ *	Take a buffer containing a meta-data page and check it for a valid LSN,
+ *	checksum (and verify the checksum if necessary) and possibly decrypt it.
  *
  *	Return 0 on success, >0 (errno) on error, -1 on checksum mismatch.
  *
@@ -355,11 +378,13 @@ __db_chk_meta(dbenv, dbp, meta, do_metachk)
 	DBMETA *meta;
 	int do_metachk;
 {
+	DB_LSN swap_lsn;
 	int is_hmac, ret, swapped;
-	u_int32_t orig_chk;
+	u_int32_t magic, orig_chk;
 	u_int8_t *chksum;
 
 	ret = 0;
+	swapped = 0;
 
 	if (FLD_ISSET(meta->metaflags, DBMETA_CHKSUM)) {
 		if (dbp != NULL)
@@ -381,7 +406,7 @@ __db_chk_meta(dbenv, dbp, meta, do_metachk)
 		 */
 		if (do_metachk) {
 			swapped = 0;
-chk_retry:		if ((ret = __db_check_chksum(dbenv,
+chk_retry:		if ((ret = __db_check_chksum(dbenv, NULL,
 			    (DB_CIPHER *)dbenv->crypto_handle, chksum, meta,
 			    DBMETASIZE, is_hmac)) != 0) {
 				if (is_hmac || swapped)
@@ -399,6 +424,40 @@ chk_retry:		if ((ret = __db_check_chksum(dbenv,
 #ifdef HAVE_CRYPTO
 	ret = __crypto_decrypt_meta(dbenv, dbp, (u_int8_t *)meta, do_metachk);
 #endif
+
+	/* Now that we're decrypted, we can check LSN. */
+	if (LOGGING_ON(dbenv)) {
+		/*
+		 * This gets called both before and after swapping, so we
+		 * need to check ourselves.  If we already swapped it above,
+		 * we'll know that here.
+		 */
+
+		swap_lsn = meta->lsn;
+		magic = meta->magic;
+lsn_retry:
+		if (swapped) {
+			M_32_SWAP(swap_lsn.file);
+			M_32_SWAP(swap_lsn.offset);
+			M_32_SWAP(magic);
+		}
+		switch (magic) {
+		case DB_BTREEMAGIC:
+		case DB_HASHMAGIC:
+		case DB_QAMMAGIC:
+		case DB_RENAMEMAGIC:
+			break;
+		default:
+			if (swapped)
+				return (EINVAL);
+			swapped = 1;
+			goto lsn_retry;
+		}
+		if (!IS_REP_CLIENT(dbenv) &&
+		    !IS_NOT_LOGGED_LSN(swap_lsn) && !IS_ZERO_LSN(swap_lsn))
+			/* Need to do check. */
+			ret = __log_check_page_lsn(dbenv, dbp, &swap_lsn);
+	}
 	return (ret);
 }
 
@@ -433,7 +492,7 @@ __db_meta_setup(dbenv, dbp, name, meta, oflags, do_metachk)
 	 * we don't consider it an error, for example, if the user set
 	 * an expected byte order and the found file doesn't match it.
 	 */
-	F_CLR(dbp, DB_AM_SWAP);
+	F_CLR(dbp, DB_AM_SWAP | DB_AM_IN_RENAME);
 	magic = meta->magic;
 
 swap_retry:
@@ -451,7 +510,7 @@ swap_retry:
 		 * not yet initialized.
 		 */
 		if (F_ISSET(dbp, DB_AM_SUBDB) && ((IS_RECOVERING(dbenv) &&
-		    F_ISSET((DB_LOG *) dbenv->lg_handle, DBLOG_FORCE_OPEN)) ||
+		    F_ISSET(dbenv->lg_handle, DBLOG_FORCE_OPEN)) ||
 		    meta->pgno != PGNO_INVALID))
 			return (ENOENT);
 
@@ -474,7 +533,7 @@ swap_retry:
 	 */
 	if ((ret = __db_chk_meta(dbenv, dbp, meta, do_metachk)) != 0) {
 		if (ret == -1)
-			__db_err(dbenv,
+			__db_errx(dbenv,
 			    "%s: metadata page checksum error", name);
 		goto bad_format;
 	}
@@ -529,6 +588,6 @@ bad_format:
 	if (F_ISSET(dbp, DB_AM_RECOVER))
 		ret = ENOENT;
 	else
-		__db_err(dbenv, "%s: unexpected file type or format", name);
+		__db_errx(dbenv, "%s: unexpected file type or format", name);
 	return (ret == 0 ? EINVAL : ret);
 }
diff --git a/db/db/db_overflow.c b/db/db/db_overflow.c
index 046e60fab..bf39291fc 100644
--- a/db/db/db_overflow.c
+++ b/db/db/db_overflow.c
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994, 1995, 1996
@@ -39,20 +39,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db_overflow.c,v 11.54 2004/03/28 17:17:50 bostic Exp $
+ * $Id: db_overflow.c,v 12.13 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/db_am.h"
 #include "dbinc/mp.h"
 
@@ -69,12 +62,13 @@
  * __db_goff --
  *	Get an offpage item.
  *
- * PUBLIC: int __db_goff __P((DB *, DBT *,
+ * PUBLIC: int __db_goff __P((DB *, DB_TXN *, DBT *,
  * PUBLIC:     u_int32_t, db_pgno_t, void **, u_int32_t *));
  */
 int
-__db_goff(dbp, dbt, tlen, pgno, bpp, bpsz)
+__db_goff(dbp, txn, dbt, tlen, pgno, bpp, bpsz)
 	DB *dbp;
+	DB_TXN *txn;
 	DBT *dbt;
 	u_int32_t tlen;
 	db_pgno_t pgno;
@@ -111,6 +105,9 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz)
 		needed = tlen;
 	}
 
+	if (F_ISSET(dbt, DB_DBT_USERCOPY))
+		goto skip_alloc;
+
 	/* Allocate any necessary memory. */
 	if (F_ISSET(dbt, DB_DBT_USERMEM)) {
 		if (needed > dbt->ulen) {
@@ -131,33 +128,42 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz)
 	} else if (bpp != NULL)
 		dbt->data = *bpp;
 	else {
-		DB_ASSERT(
+		DB_ASSERT(dbenv,
 		    F_ISSET(dbt,
 		    DB_DBT_USERMEM | DB_DBT_MALLOC | DB_DBT_REALLOC) ||
 		    bpsz != NULL || bpp != NULL);
 		return (DB_BUFFER_SMALL);
 	}
 
+skip_alloc:
 	/*
 	 * Step through the linked list of pages, copying the data on each
 	 * one into the buffer.  Never copy more than the total data length.
 	 */
 	dbt->size = needed;
 	for (curoff = 0, p = dbt->data; pgno != PGNO_INVALID && needed > 0;) {
-		if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0)
+		if ((ret = __memp_fget(mpf, &pgno, txn, 0, &h)) != 0)
 			return (ret);
+		DB_ASSERT(dbenv, TYPE(h) == P_OVERFLOW);
 
 		/* Check if we need any bytes from this page. */
 		if (curoff + OV_LEN(h) >= start) {
-			src = (u_int8_t *)h + P_OVERHEAD(dbp);
 			bytes = OV_LEN(h);
+			src = (u_int8_t *)h + P_OVERHEAD(dbp);
 			if (start > curoff) {
 				src += start - curoff;
 				bytes -= start - curoff;
 			}
 			if (bytes > needed)
 				bytes = needed;
-			memcpy(p, src, bytes);
+			if (F_ISSET(dbt, DB_DBT_USERCOPY)) {
+				if ((ret = dbenv->dbt_usercopy(dbt, curoff,
+				    src, bytes, DB_USERCOPY_SETDATA)) != 0) {
+					(void)__memp_fput(mpf, h, 0);
+					return (ret);
+				}
+			} else
+				memcpy(p, src, bytes);
 			p += bytes;
 			needed -= bytes;
 		}
@@ -228,8 +234,7 @@ __db_poff(dbc, dbt, pgnop)
 			    lastp == NULL ? &null_lsn : &LSN(lastp),
 			    &null_lsn)) != 0) {
 				if (lastp != NULL)
-					(void)__memp_fput(mpf,
-					    lastp, DB_MPOOL_DIRTY);
+					(void)__memp_fput(mpf, lastp, 0);
 				lastp = pagep;
 				break;
 			}
@@ -241,8 +246,6 @@ __db_poff(dbc, dbt, pgnop)
 			LSN(lastp) = new_lsn;
 		LSN(pagep) = new_lsn;
 
-		P_INIT(pagep, dbp->pgsize,
-		    PGNO(pagep), PGNO_INVALID, PGNO_INVALID, 0, P_OVERFLOW);
 		OV_LEN(pagep) = pagespace;
 		OV_REF(pagep) = 1;
 		memcpy((u_int8_t *)pagep + P_OVERHEAD(dbp), p, pagespace);
@@ -257,27 +260,26 @@ __db_poff(dbc, dbt, pgnop)
 		else {
 			lastp->next_pgno = PGNO(pagep);
 			pagep->prev_pgno = PGNO(lastp);
-			(void)__memp_fput(mpf, lastp, DB_MPOOL_DIRTY);
+			(void)__memp_fput(mpf, lastp, 0);
 		}
 		lastp = pagep;
 	}
 	if (lastp != NULL &&
-	    (t_ret = __memp_fput(mpf, lastp, DB_MPOOL_DIRTY)) != 0 && ret == 0)
+	    (t_ret = __memp_fput(mpf, lastp, 0)) != 0 && ret == 0)
 		ret = t_ret;
 	return (ret);
 }
 
 /*
  * __db_ovref --
- *	Increment/decrement the reference count on an overflow page.
+ *	Decrement the reference count on an overflow page.
  *
- * PUBLIC: int __db_ovref __P((DBC *, db_pgno_t, int32_t));
+ * PUBLIC: int __db_ovref __P((DBC *, db_pgno_t));
  */
 int
-__db_ovref(dbc, pgno, adjust)
+__db_ovref(dbc, pgno)
 	DBC *dbc;
 	db_pgno_t pgno;
-	int32_t adjust;
 {
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
@@ -287,21 +289,30 @@ __db_ovref(dbc, pgno, adjust)
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
 
-	if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0)
-		return (__db_pgerr(dbp, pgno, ret));
+	if ((ret = __memp_fget(mpf, &pgno, dbc->txn, DB_MPOOL_DIRTY, &h)) != 0)
+		return (ret);
 
 	if (DBC_LOGGING(dbc)) {
 		if ((ret = __db_ovref_log(dbp,
-		    dbc->txn, &LSN(h), 0, h->pgno, adjust, &LSN(h))) != 0) {
+		    dbc->txn, &LSN(h), 0, h->pgno, -1, &LSN(h))) != 0) {
 			(void)__memp_fput(mpf, h, 0);
 			return (ret);
 		}
 	} else
 		LSN_NOT_LOGGED(LSN(h));
-	OV_REF(h) += adjust;
 
-	(void)__memp_fput(mpf, h, DB_MPOOL_DIRTY);
-	return (0);
+	/*
+	 * In BDB releases before 4.5, the overflow reference counts were
+	 * incremented when an overflow item was split onto an internal
+	 * page.  There was a lock race in that code, and rather than fix
+	 * the race, we changed BDB to copy overflow items when splitting
+	 * them onto internal pages.  The code to decrement reference
+	 * counts remains so databases already in the field continue to
+	 * work.
+	 */
+	--OV_REF(h);
+
+	return (__memp_fput(mpf, h, 0));
 }
 
 /*
@@ -326,17 +337,22 @@ __db_doff(dbc, pgno)
 	mpf = dbp->mpf;
 
 	do {
-		if ((ret = __memp_fget(mpf, &pgno, 0, &pagep)) != 0)
-			return (__db_pgerr(dbp, pgno, ret));
+		if ((ret = __memp_fget(mpf, &pgno, dbc->txn, 0, &pagep)) != 0)
+			return (ret);
 
-		DB_ASSERT(TYPE(pagep) == P_OVERFLOW);
+		DB_ASSERT(dbp->dbenv, TYPE(pagep) == P_OVERFLOW);
 		/*
 		 * If it's referenced by more than one key/data item,
 		 * decrement the reference count and return.
 		 */
 		if (OV_REF(pagep) > 1) {
 			(void)__memp_fput(mpf, pagep, 0);
-			return (__db_ovref(dbc, pgno, -1));
+			return (__db_ovref(dbc, pgno));
+		}
+
+		if ((ret = __memp_dirty(mpf, &pagep, dbc->txn, 0)) != 0) {
+			(void)__memp_fput(mpf, pagep, 0);
+			return (ret);
 		}
 
 		if (DBC_LOGGING(dbc)) {
@@ -372,12 +388,13 @@ __db_doff(dbc, pgno)
  * specified a comparison function.  In this case, we need to materialize
  * the entire object and call their comparison routine.
  *
- * PUBLIC: int __db_moff __P((DB *, const DBT *, db_pgno_t, u_int32_t,
+ * PUBLIC: int __db_moff __P((DB *, DB_TXN *, const DBT *, db_pgno_t, u_int32_t,
  * PUBLIC:     int (*)(DB *, const DBT *, const DBT *), int *));
  */
 int
-__db_moff(dbp, dbt, pgno, tlen, cmpfunc, cmpp)
+__db_moff(dbp, txn, dbt, pgno, tlen, cmpfunc, cmpp)
 	DB *dbp;
+	DB_TXN *txn;
 	const DBT *dbt;
 	db_pgno_t pgno;
 	u_int32_t tlen;
@@ -402,7 +419,7 @@ __db_moff(dbp, dbt, pgno, tlen, cmpfunc, cmpp)
 		buf = NULL;
 		bufsize = 0;
 
-		if ((ret = __db_goff(dbp,
+		if ((ret = __db_goff(dbp, txn,
 		    &local_dbt, tlen, pgno, &buf, &bufsize)) != 0)
 			return (ret);
 		/* Pass the key as the first argument */
@@ -414,7 +431,7 @@ __db_moff(dbp, dbt, pgno, tlen, cmpfunc, cmpp)
 	/* While there are both keys to compare. */
 	for (*cmpp = 0, p1 = dbt->data,
 	    key_left = dbt->size; key_left > 0 && pgno != PGNO_INVALID;) {
-		if ((ret = __memp_fget(mpf, &pgno, 0, &pagep)) != 0)
+		if ((ret = __memp_fget(mpf, &pgno, txn, 0, &pagep)) != 0)
 			return (ret);
 
 		cmp_bytes = OV_LEN(pagep) < key_left ? OV_LEN(pagep) : key_left;
diff --git a/db/db/db_ovfl_vrfy.c b/db/db/db_ovfl_vrfy.c
index a3c5fba7c..85cb85eba 100644
--- a/db/db/db_ovfl_vrfy.c
+++ b/db/db/db_ovfl_vrfy.c
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994, 1995, 1996
@@ -39,19 +39,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db_ovfl_vrfy.c,v 11.56 2004/01/28 03:35:57 bostic Exp $
+ * $Id: db_ovfl_vrfy.c,v 12.8 2006/09/07 20:05:26 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/db_am.h"
 #include "dbinc/db_verify.h"
 #include "dbinc/mp.h"
@@ -118,13 +112,15 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags)
 	u_int32_t flags;
 {
 	DB *pgset;
+	DB_ENV *dbenv;
 	VRFY_PAGEINFO *pip;
 	db_pgno_t next, prev;
 	int isbad, ret, seen_cnt, t_ret;
 	u_int32_t refcount;
 
+	dbenv = dbp->dbenv;
 	pgset = vdp->pgset;
-	DB_ASSERT(pgset != NULL);
+	DB_ASSERT(dbenv, pgset != NULL);
 	isbad = 0;
 
 	/* This shouldn't happen, but just to be sure. */
@@ -142,7 +138,7 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags)
 	refcount = pip->refcount;
 
 	if (pip->type != P_OVERFLOW) {
-		EPRINT((dbp->dbenv,
+		EPRINT((dbenv,
 		    "Page %lu: overflow page of invalid type %lu",
 		    (u_long)pgno, (u_long)pip->type));
 		ret = DB_VERIFY_BAD;
@@ -151,7 +147,7 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags)
 
 	prev = pip->prev_pgno;
 	if (prev != PGNO_INVALID) {
-		EPRINT((dbp->dbenv,
+		EPRINT((dbenv,
 	    "Page %lu: first page in overflow chain has a prev_pgno %lu",
 		    (u_long)pgno, (u_long)prev));
 		isbad = 1;
@@ -170,7 +166,7 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags)
 		if ((ret = __db_vrfy_pgset_get(pgset, pgno, &seen_cnt)) != 0)
 			goto err;
 		if ((u_int32_t)seen_cnt > refcount) {
-			EPRINT((dbp->dbenv,
+			EPRINT((dbenv,
 		"Page %lu: encountered too many times in overflow traversal",
 			    (u_long)pgno));
 			ret = DB_VERIFY_BAD;
@@ -205,7 +201,7 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags)
 		 */
 		if (LF_ISSET(ST_OVFL_LEAF)) {
 			if (F_ISSET(pip, VRFY_OVFL_LEAFSEEN)) {
-				EPRINT((dbp->dbenv,
+				EPRINT((dbenv,
 		"Page %lu: overflow page linked twice from leaf or data page",
 				    (u_long)pgno));
 				ret = DB_VERIFY_BAD;
@@ -248,19 +244,18 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags)
 		 * to be sure...
 		 */
 		if (!IS_VALID_PGNO(next)) {
-			DB_ASSERT(0);
-			EPRINT((dbp->dbenv,
+			EPRINT((dbenv,
 			    "Page %lu: bad next_pgno %lu on overflow page",
 			    (u_long)pgno, (u_long)next));
 			ret = DB_VERIFY_BAD;
 			goto err;
 		}
 
-		if ((ret = __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 ||
+		if ((ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0 ||
 		    (ret = __db_vrfy_getpageinfo(vdp, next, &pip)) != 0)
 			return (ret);
 		if (pip->prev_pgno != pgno) {
-			EPRINT((dbp->dbenv,
+			EPRINT((dbenv,
 		"Page %lu: bad prev_pgno %lu on overflow page (should be %lu)",
 			    (u_long)next, (u_long)pip->prev_pgno,
 			    (u_long)pgno));
@@ -276,13 +271,13 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags)
 
 	if (tlen > 0) {
 		isbad = 1;
-		EPRINT((dbp->dbenv,
+		EPRINT((dbenv,
 		    "Page %lu: overflow item incomplete", (u_long)pgno));
 	}
 
 done:
 err:	if ((t_ret =
-	    __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 && ret == 0)
+	    __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0 && ret == 0)
 		ret = t_ret;
 	return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret);
 }
@@ -323,7 +318,7 @@ __db_safe_goff(dbp, vdp, pgno, dbt, buf, flags)
 		if ((ret = __db_salvage_markdone(vdp, pgno)) != 0)
 			break;
 
-		if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0)
+		if ((ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0)
 			break;
 
 		/*
diff --git a/db/db/db_pr.c b/db/db/db_pr.c
index e63daf3ee..2a092ab0d 100644
--- a/db/db/db_pr.c
+++ b/db/db/db_pr.c
@@ -1,25 +1,16 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_pr.c,v 11.121 2004/10/28 14:48:43 bostic Exp $
+ * $Id: db_pr.c,v 12.29 2006/09/07 20:05:26 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/btree.h"
 #include "dbinc/hash.h"
 #include "dbinc/mp.h"
@@ -35,9 +26,9 @@
 void
 __db_loadme()
 {
-	u_int32_t id;
+	pid_t pid;
 
-	__os_id(&id);
+	__os_id(NULL, &pid, NULL);
 }
 
 #ifdef HAVE_STATISTICS
@@ -47,18 +38,19 @@ static void	 __db_meta __P((DB *, DBMETA *, FN const *, u_int32_t));
 static const char *__db_pagetype_to_string __P((u_int32_t));
 static void	 __db_prdb __P((DB *, u_int32_t));
 static void	 __db_proff __P((DB_ENV *, DB_MSGBUF *, void *));
-static int	 __db_prtree __P((DB *, u_int32_t));
+static int	 __db_prtree __P((DB *, DB_TXN *, u_int32_t));
 static int	 __db_qmeta __P((DB *, QMETA *, u_int32_t));
 
 /*
  * __db_dumptree --
  *	Dump the tree to a file.
  *
- * PUBLIC: int __db_dumptree __P((DB *, char *, char *));
+ * PUBLIC: int __db_dumptree __P((DB *, DB_TXN *, char *, char *));
  */
 int
-__db_dumptree(dbp, op, name)
+__db_dumptree(dbp, txn, op, name)
 	DB *dbp;
+	DB_TXN *txn;
 	char *op, *name;
 {
 	DB_ENV *dbenv;
@@ -95,7 +87,7 @@ __db_dumptree(dbp, op, name)
 
 	__db_msg(dbenv, "%s", DB_GLOBAL(db_line));
 
-	ret = __db_prtree(dbp, flags);
+	ret = __db_prtree(dbp, txn, flags);
 
 	if (fp != NULL) {
 		(void)fclose(fp);
@@ -106,38 +98,37 @@ __db_dumptree(dbp, op, name)
 }
 
 static const FN __db_flags_fn[] = {
-	{ DB_AM_CHKSUM,		"checksumming" },
-	{ DB_AM_CL_WRITER,	"client replica writer" },
-	{ DB_AM_COMPENSATE,	"created by compensating transaction" },
-	{ DB_AM_CREATED,	"database created" },
-	{ DB_AM_CREATED_MSTR,	"encompassing file created" },
-	{ DB_AM_DBM_ERROR,	"dbm/ndbm error" },
-	{ DB_AM_DELIMITER,	"variable length" },
-	{ DB_AM_DIRTY,		"dirty reads" },
-	{ DB_AM_DISCARD,	"discard cached pages" },
-	{ DB_AM_DUP,		"duplicates" },
-	{ DB_AM_DUPSORT,	"sorted duplicates" },
-	{ DB_AM_ENCRYPT,	"encrypted" },
-	{ DB_AM_FIXEDLEN,	"fixed-length records" },
-	{ DB_AM_INMEM,		"in-memory" },
-	{ DB_AM_IN_RENAME,	"file is being renamed" },
-	{ DB_AM_NOT_DURABLE,	"changes not logged" },
-	{ DB_AM_OPEN_CALLED,	"open called" },
-	{ DB_AM_PAD,		"pad value" },
-	{ DB_AM_PGDEF,		"default page size" },
-	{ DB_AM_RDONLY,		"read-only" },
-	{ DB_AM_RECNUM,		"Btree record numbers" },
-	{ DB_AM_RECOVER,	"opened for recovery" },
-	{ DB_AM_RENUMBER,	"renumber" },
-	{ DB_AM_REPLICATION,	"replication file" },
-	{ DB_AM_REVSPLITOFF,	"no reverse splits" },
-	{ DB_AM_SECONDARY,	"secondary" },
-	{ DB_AM_SNAPSHOT,	"load on open" },
-	{ DB_AM_SUBDB,		"subdatabases" },
-	{ DB_AM_SWAP,		"needswap" },
-	{ DB_AM_TXN,		"transactional" },
-	{ DB_AM_VERIFYING,	"verifier" },
-	{ 0,			NULL }
+	{ DB_AM_CHKSUM,			"checksumming" },
+	{ DB_AM_CL_WRITER,		"client replica writer" },
+	{ DB_AM_COMPENSATE,		"created by compensating transaction" },
+	{ DB_AM_CREATED,		"database created" },
+	{ DB_AM_CREATED_MSTR,		"encompassing file created" },
+	{ DB_AM_DBM_ERROR,		"dbm/ndbm error" },
+	{ DB_AM_DELIMITER,		"variable length" },
+	{ DB_AM_DISCARD,		"discard cached pages" },
+	{ DB_AM_DUP,			"duplicates" },
+	{ DB_AM_DUPSORT,		"sorted duplicates" },
+	{ DB_AM_ENCRYPT,		"encrypted" },
+	{ DB_AM_FIXEDLEN,		"fixed-length records" },
+	{ DB_AM_INMEM,			"in-memory" },
+	{ DB_AM_IN_RENAME,		"file is being renamed" },
+	{ DB_AM_NOT_DURABLE,		"changes not logged" },
+	{ DB_AM_OPEN_CALLED,		"open called" },
+	{ DB_AM_PAD,			"pad value" },
+	{ DB_AM_PGDEF,			"default page size" },
+	{ DB_AM_RDONLY,			"read-only" },
+	{ DB_AM_READ_UNCOMMITTED,	"read-uncommitted" },
+	{ DB_AM_RECNUM,			"Btree record numbers" },
+	{ DB_AM_RECOVER,		"opened for recovery" },
+	{ DB_AM_RENUMBER,		"renumber" },
+	{ DB_AM_REVSPLITOFF,		"no reverse splits" },
+	{ DB_AM_SECONDARY,		"secondary" },
+	{ DB_AM_SNAPSHOT,		"load on open" },
+	{ DB_AM_SUBDB,			"subdatabases" },
+	{ DB_AM_SWAP,			"needswap" },
+	{ DB_AM_TXN,			"transactional" },
+	{ DB_AM_VERIFYING,		"verifier" },
+	{ 0,				NULL }
 };
 
 /*
@@ -182,8 +173,7 @@ __db_prdb(dbp, flags)
 		bt = dbp->bt_internal;
 		__db_msg(dbenv, "bt_meta: %lu bt_root: %lu",
 		    (u_long)bt->bt_meta, (u_long)bt->bt_root);
-		__db_msg(dbenv, "bt_maxkey: %lu bt_minkey: %lu",
-		    (u_long)bt->bt_maxkey, (u_long)bt->bt_minkey);
+		__db_msg(dbenv, "bt_minkey: %lu", (u_long)bt->bt_minkey);
 		if (!LF_ISSET(DB_PR_RECOVERYTEST))
 			__db_msg(dbenv, "bt_compare: %#lx bt_prefix: %#lx",
 			    P_TO_ULONG(bt->bt_compare),
@@ -228,8 +218,9 @@ __db_prdb(dbp, flags)
  *	Print out the entire tree.
  */
 static int
-__db_prtree(dbp, flags)
+__db_prtree(dbp, txn, flags)
 	DB *dbp;
+	DB_TXN *txn;
 	u_int32_t flags;
 {
 	DB_MPOOLFILE *mpf;
@@ -246,9 +237,10 @@ __db_prtree(dbp, flags)
 	 * Find out the page number of the last page in the database, then
 	 * dump each page.
 	 */
-	__memp_last_pgno(mpf, &last);
+	if ((ret = __memp_last_pgno(mpf, &last)) != 0)
+		return (ret);
 	for (i = 0; i <= last; ++i) {
-		if ((ret = __memp_fget(mpf, &i, 0, &h)) != 0)
+		if ((ret = __memp_fget(mpf, &i, txn, 0, &h)) != 0)
 			return (ret);
 		(void)__db_prpage(dbp, h, flags);
 		if ((ret = __memp_fput(mpf, h, 0)) != 0)
@@ -298,7 +290,7 @@ __db_meta(dbp, dbmeta, fn, flags)
 		    dbenv, &mb, "\tfree list: %lu", (u_long)dbmeta->free);
 		for (pgno = dbmeta->free,
 		    cnt = 0, sep = ", "; pgno != PGNO_INVALID;) {
-			if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) {
+			if ((ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0) {
 				DB_MSGBUF_FLUSH(dbenv, &mb);
 				__db_msg(dbenv,
 			    "Unable to retrieve free-list page: %lu: %s",
@@ -362,8 +354,7 @@ __db_bmeta(dbp, h, flags)
 
 	__db_meta(dbp, (DBMETA *)h, fn, flags);
 
-	__db_msg(dbenv, "\tmaxkey: %lu minkey: %lu",
-	    (u_long)h->maxkey, (u_long)h->minkey);
+	__db_msg(dbenv, "\tminkey: %lu", (u_long)h->minkey);
 	if (dbp->type == DB_RECNO)
 		__db_msg(dbenv, "\tre_len: %#lx re_pad: %#lx",
 		    (u_long)h->re_len, (u_long)h->re_pad);
@@ -441,11 +432,12 @@ __db_qmeta(dbp, h, flags)
  * __db_prnpage
  *	-- Print out a specific page.
  *
- * PUBLIC: int __db_prnpage __P((DB *, db_pgno_t));
+ * PUBLIC: int __db_prnpage __P((DB *, DB_TXN *, db_pgno_t));
  */
 int
-__db_prnpage(dbp, pgno)
+__db_prnpage(dbp, txn, pgno)
 	DB *dbp;
+	DB_TXN *txn;
 	db_pgno_t pgno;
 {
 	DB_MPOOLFILE *mpf;
@@ -454,7 +446,7 @@ __db_prnpage(dbp, pgno)
 
 	mpf = dbp->mpf;
 
-	if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0)
+	if ((ret = __memp_fget(mpf, &pgno, txn, 0, &h)) != 0)
 		return (ret);
 
 	ret = __db_prpage(dbp, h, DB_PR_PAGE);
@@ -518,19 +510,29 @@ __db_prpage(dbp, h, flags)
 	pagesize = (u_int32_t)dbp->mpf->mfp->stat.st_pagesize;
 
 	/* Page number, page type. */
-	__db_msgadd(dbenv, &mb, "page %lu: %s level: %lu",
-	    (u_long)h->pgno, s, (u_long)h->level);
+	__db_msgadd(dbenv, &mb, "page %lu: %s:", (u_long)h->pgno, s);
+
+	/*
+	 * LSNs on a metadata page will be different from the original after an
+	 * abort, in some cases.  Don't display them if we're testing recovery.
+	 */
+	if (!LF_ISSET(DB_PR_RECOVERYTEST) ||
+	    (TYPE(h) != P_BTREEMETA && TYPE(h) != P_HASHMETA &&
+	    TYPE(h) != P_QAMMETA && TYPE(h) != P_QAMDATA))
+		__db_msgadd(dbenv, &mb, " LSN [%lu][%lu]:",
+		    (u_long)LSN(h).file, (u_long)LSN(h).offset);
+
+	/*
+	 * Page level (only applicable for Btree/Recno, but we always display
+	 * it, for no particular reason.
+	 */
+	__db_msgadd(dbenv, &mb, " level %lu", (u_long)h->level);
 
 	/* Record count. */
 	if (TYPE(h) == P_IBTREE ||
 	    TYPE(h) == P_IRECNO || (TYPE(h) == P_LRECNO &&
 	    h->pgno == ((BTREE *)dbp->bt_internal)->bt_root))
 		__db_msgadd(dbenv, &mb, " records: %lu", (u_long)RE_NREC(h));
-
-	/* LSN. */
-	if (!LF_ISSET(DB_PR_RECOVERYTEST))
-		__db_msgadd(dbenv, &mb, " (lsn.file: %lu lsn.offset: %lu)",
-		    (u_long)LSN(h).file, (u_long)LSN(h).offset);
 	DB_MSGBUF_FLUSH(dbenv, &mb);
 
 	switch (TYPE(h)) {
@@ -564,11 +566,6 @@ __db_prpage(dbp, h, flags)
 		break;
 	}
 
-	/* LSN. */
-	if (LF_ISSET(DB_PR_RECOVERYTEST))
-		__db_msg(dbenv, " (lsn.file: %lu lsn.offset: %lu)",
-		    (u_long)LSN(h).file, (u_long)LSN(h).offset);
-
 	s = "\t";
 	if (TYPE(h) != P_IBTREE && TYPE(h) != P_IRECNO) {
 		__db_msgadd(dbenv, &mb, "%sprev: %4lu next: %4lu",
@@ -680,7 +677,7 @@ __db_prpage(dbp, h, flags)
 		case P_IBTREE:
 			bi = sp;
 			__db_msgadd(dbenv, &mb,
-			    "count: %4lu pgno: %4lu type: %4lu",
+			    "count: %4lu pgno: %4lu type: %lu ",
 			    (u_long)bi->nrecs, (u_long)bi->pgno,
 			    (u_long)bi->type);
 			switch (B_TYPE(bi->type)) {
@@ -867,8 +864,8 @@ __db_lockmode_to_string(mode)
 		return ("Intent shared/read");
 	case DB_LOCK_IWR:
 		return ("Intent to read/write");
-	case DB_LOCK_DIRTY:
-		return ("Dirty read");
+	case DB_LOCK_READ_UNCOMMITTED:
+		return ("Read uncommitted");
 	case DB_LOCK_WWRITE:
 		return ("Was written");
 	default:
@@ -938,13 +935,15 @@ __db_pagetype_to_string(type)
  * __db_dumptree --
  *	Dump the tree to a file.
  *
- * PUBLIC: int __db_dumptree __P((DB *, char *, char *));
+ * PUBLIC: int __db_dumptree __P((DB *, DB_TXN *, char *, char *));
  */
 int
-__db_dumptree(dbp, op, name)
+__db_dumptree(dbp, txn, op, name)
 	DB *dbp;
+	DB_TXN *txn;
 	char *op, *name;
 {
+	COMPQUIET(txn, NULL);
 	COMPQUIET(op, NULL);
 	COMPQUIET(name, NULL);
 
@@ -988,25 +987,31 @@ __db_dump_pp(dbp, subname, callback, handle, pflag, keyflag)
 	int pflag, keyflag;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
 	PANIC_CHECK(dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->dump");
 
+	ENV_ENTER(dbenv, ip);
+
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 1)) != 0)
-		return (ret);
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 1)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
 	ret = __db_dump(dbp, subname, callback, handle, pflag, keyflag);
 
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
-	return (0);
+err:	ENV_LEAVE(dbenv, ip);
+	return (ret);
 }
 
 /*
@@ -1088,8 +1093,11 @@ retry: while ((ret =
 		data.ulen = data.size;
 		goto retry;
 	}
+	if (ret == DB_NOTFOUND)
+		ret = 0;
 
-	(void)__db_prfooter(handle, callback);
+	if ((t_ret = __db_prfooter(handle, callback)) != 0 && ret == 0)
+		ret = t_ret;
 
 err:	if ((t_ret = __db_c_close(dbcp)) != 0 && ret == 0)
 		ret = t_ret;
@@ -1220,12 +1228,11 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 	 * will have a non-NULL dbp (and vdp may or may not be NULL depending
 	 * on whether we're salvaging).
 	 */
-	DB_ASSERT(dbp != NULL || vdp != NULL);
-
 	if (dbp == NULL)
 		dbenv = NULL;
 	else
 		dbenv = dbp->dbenv;
+	DB_ASSERT(dbenv, dbp != NULL || vdp != NULL);
 
 	/*
 	 * If we've been passed a verifier statistics object, use that;  we're
@@ -1273,7 +1280,7 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 			 * the verifier for pip to be non-NULL.) Pretend we're
 			 * a Btree and salvage what we can.
 			 */
-			DB_ASSERT(F_ISSET(dbp, DB_AM_VERIFYING));
+			DB_ASSERT(dbenv, F_ISSET(dbp, DB_AM_VERIFYING));
 			dbtype = DB_BTREE;
 			break;
 		}
@@ -1300,9 +1307,7 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 		snprintf(buf, buflen, "database=");
 		if ((ret = callback(handle, buf)) != 0)
 			goto err;
-		memset(&dbt, 0, sizeof(dbt));
-		dbt.data = (char *)subname;
-		dbt.size = (u_int32_t)strlen(subname);
+		DB_INIT_DBT(dbt, subname, strlen(subname));
 		if ((ret = __db_prdbt(&dbt, 1, NULL, handle, callback, 0)) != 0)
 			goto err;
 	}
@@ -1310,39 +1315,26 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 	case DB_BTREE:
 		if ((ret = callback(handle, "type=btree\n")) != 0)
 			goto err;
-		if (using_vdp) {
-			if (F_ISSET(pip, VRFY_HAS_RECNUMS))
-				if ((ret =
-				    callback(handle, "recnum=1\n")) != 0)
-					goto err;
-			if (pip->bt_maxkey != 0) {
-				snprintf(buf, buflen,
-				    "bt_maxkey=%lu\n", (u_long)pip->bt_maxkey);
-				if ((ret = callback(handle, buf)) != 0)
-					goto err;
-			}
-			if (pip->bt_minkey != 0 &&
-			    pip->bt_minkey != DEFMINKEYPAGE) {
-				snprintf(buf, buflen,
-				    "bt_minkey=%lu\n", (u_long)pip->bt_minkey);
-				if ((ret = callback(handle, buf)) != 0)
-					goto err;
+		if (using_vdp)
+			tmp_int = F_ISSET(pip, VRFY_HAS_RECNUMS) ? 1 : 0;
+		else {
+			if ((ret = __db_get_flags(dbp, &flags)) != 0) {
+				__db_err(dbenv, ret, "DB->get_flags");
+				goto err;
 			}
-			break;
+			tmp_int = F_ISSET(dbp, DB_AM_RECNUM) ? 1 : 0;
 		}
-
-		if ((ret = __db_get_flags(dbp, &flags)) != 0) {
-			__db_err(dbenv, "DB->get_flags: %s", db_strerror(ret));
+		if (tmp_int && (ret = callback(handle, "recnum=1\n")) != 0)
 			goto err;
-		}
-		if (F_ISSET(dbp, DB_AM_RECNUM))
-			if ((ret = callback(handle, "recnum=1\n")) != 0)
+
+		if (using_vdp)
+			tmp_u_int32 = pip->bt_minkey;
+		else
+			if ((ret =
+			    __bam_get_bt_minkey(dbp, &tmp_u_int32)) != 0) {
+				__db_err(dbenv, ret, "DB->get_bt_minkey");
 				goto err;
-		if ((ret = __bam_get_bt_minkey(dbp, &tmp_u_int32)) != 0) {
-			__db_err(dbenv,
-			    "DB->get_bt_minkey: %s", db_strerror(ret));
-			goto err;
-		}
+			}
 		if (tmp_u_int32 != 0 && tmp_u_int32 != DEFMINKEYPAGE) {
 			snprintf(buf, buflen,
 			    "bt_minkey=%lu\n", (u_long)tmp_u_int32);
@@ -1354,38 +1346,33 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 #ifdef HAVE_HASH
 		if ((ret = callback(handle, "type=hash\n")) != 0)
 			goto err;
-		if (using_vdp) {
-			if (pip->h_ffactor != 0) {
-				snprintf(buf, buflen,
-				    "h_ffactor=%lu\n", (u_long)pip->h_ffactor);
-				if ((ret = callback(handle, buf)) != 0)
-					goto err;
-			}
-			if (pip->h_nelem != 0) {
-				snprintf(buf, buflen,
-				    "h_nelem=%lu\n", (u_long)pip->h_nelem);
-				if ((ret = callback(handle, buf)) != 0)
-					goto err;
+		if (using_vdp)
+			tmp_u_int32 = pip->h_ffactor;
+		else
+			if ((ret =
+			    __ham_get_h_ffactor(dbp, &tmp_u_int32)) != 0) {
+				__db_err(dbenv, ret, "DB->get_h_ffactor");
+				goto err;
 			}
-			break;
-		}
-		if ((ret = __ham_get_h_ffactor(dbp, &tmp_u_int32)) != 0) {
-			__db_err(dbenv,
-			    "DB->get_h_ffactor: %s", db_strerror(ret));
-			goto err;
-		}
 		if (tmp_u_int32 != 0) {
 			snprintf(buf, buflen,
 			    "h_ffactor=%lu\n", (u_long)tmp_u_int32);
 			if ((ret = callback(handle, buf)) != 0)
 				goto err;
 		}
-		if ((ret = __ham_get_h_nelem(dbp, &tmp_u_int32)) != 0) {
-			__db_err(dbenv,
-			    "DB->get_h_nelem: %s", db_strerror(ret));
-			goto err;
-		}
-		if (tmp_u_int32 != 0) {
+
+		if (using_vdp)
+			tmp_u_int32 = pip->h_nelem;
+		else
+			if ((ret = __ham_get_h_nelem(dbp, &tmp_u_int32)) != 0) {
+				__db_err(dbenv, ret, "DB->get_h_nelem");
+				goto err;
+			}
+		/*
+		 * Hash databases have an h_nelem field of 0 or 1, neither
+		 * of those values is interesting.
+		 */
+		if (tmp_u_int32 > 1) {
 			snprintf(buf, buflen,
 			    "h_nelem=%lu\n", (u_long)tmp_u_int32);
 			if ((ret = callback(handle, buf)) != 0)
@@ -1400,36 +1387,38 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 #ifdef HAVE_QUEUE
 		if ((ret = callback(handle, "type=queue\n")) != 0)
 			goto err;
-		if (vdp != NULL) {
-			snprintf(buf,
-			    buflen, "re_len=%lu\n", (u_long)vdp->re_len);
-			if ((ret = callback(handle, buf)) != 0)
+		if (using_vdp)
+			tmp_u_int32 = vdp->re_len;
+		else
+			if ((ret = __ram_get_re_len(dbp, &tmp_u_int32)) != 0) {
+				__db_err(dbenv, ret, "DB->get_re_len");
 				goto err;
-			break;
-		}
-		if ((ret = __ram_get_re_len(dbp, &tmp_u_int32)) != 0) {
-			__db_err(dbenv,
-			    "DB->get_re_len: %s", db_strerror(ret));
-			goto err;
-		}
+			}
 		snprintf(buf, buflen, "re_len=%lu\n", (u_long)tmp_u_int32);
 		if ((ret = callback(handle, buf)) != 0)
 			goto err;
-		if ((ret = __ram_get_re_pad(dbp, &tmp_int)) != 0) {
-			__db_err(dbenv,
-			    "DB->get_re_pad: %s", db_strerror(ret));
-			goto err;
-		}
+
+		if (using_vdp)
+			tmp_int = (int)vdp->re_pad;
+		else
+			if ((ret = __ram_get_re_pad(dbp, &tmp_int)) != 0) {
+				__db_err(dbenv, ret, "DB->get_re_pad");
+				goto err;
+			}
 		if (tmp_int != 0 && tmp_int != ' ') {
 			snprintf(buf, buflen, "re_pad=%#x\n", tmp_int);
 			if ((ret = callback(handle, buf)) != 0)
 				goto err;
 		}
-		if ((ret = __qam_get_extentsize(dbp, &tmp_u_int32)) != 0) {
-			__db_err(dbenv,
-			    "DB->get_q_extentsize: %s", db_strerror(ret));
-			goto err;
-		}
+
+		if (using_vdp)
+			tmp_u_int32 = vdp->page_ext;
+		else
+			if ((ret =
+			    __qam_get_extentsize(dbp, &tmp_u_int32)) != 0) {
+				__db_err(dbenv, ret, "DB->get_q_extentsize");
+				goto err;
+			}
 		if (tmp_u_int32 != 0) {
 			snprintf(buf, buflen,
 			    "extentsize=%lu\n", (u_long)tmp_u_int32);
@@ -1444,38 +1433,40 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 	case DB_RECNO:
 		if ((ret = callback(handle, "type=recno\n")) != 0)
 			goto err;
-		if (using_vdp) {
-			if (F_ISSET(pip, VRFY_IS_RRECNO))
+		if (using_vdp)
+			tmp_int = F_ISSET(pip, VRFY_IS_RRECNO) ? 1 : 0;
+		else
+			tmp_int = F_ISSET(dbp, DB_AM_RENUMBER) ? 1 : 0;
+		if (tmp_int != 0 &&
+		    (ret = callback(handle, "renumber=1\n")) != 0)
+				goto err;
+
+		if (using_vdp)
+			tmp_int = F_ISSET(pip, VRFY_IS_FIXEDLEN) ? 1 : 0;
+		else
+			tmp_int = F_ISSET(dbp, DB_AM_FIXEDLEN) ? 1 : 0;
+		if (tmp_int) {
+			if (using_vdp)
+				tmp_u_int32 = pip->re_len;
+			else
 				if ((ret =
-				    callback(handle, "renumber=1\n")) != 0)
+				    __ram_get_re_len(dbp, &tmp_u_int32)) != 0) {
+					__db_err(dbenv, ret, "DB->get_re_len");
 					goto err;
-			if (pip->re_len > 0) {
-				snprintf(buf, buflen,
-				    "re_len=%lu\n", (u_long)pip->re_len);
-				if ((ret = callback(handle, buf)) != 0)
-					goto err;
-			}
-			break;
-		}
-		if (F_ISSET(dbp, DB_AM_RENUMBER))
-			if ((ret = callback(handle, "renumber=1\n")) != 0)
-				goto err;
-		if (F_ISSET(dbp, DB_AM_FIXEDLEN)) {
-			if ((ret = __ram_get_re_len(dbp, &tmp_u_int32)) != 0) {
-				__db_err(dbenv,
-				    "DB->get_re_len: %s", db_strerror(ret));
-				goto err;
-			}
+				}
 			snprintf(buf, buflen,
 			    "re_len=%lu\n", (u_long)tmp_u_int32);
 			if ((ret = callback(handle, buf)) != 0)
 				goto err;
 
-			if ((ret = __ram_get_re_pad(dbp, &tmp_int)) != 0) {
-				__db_err(dbenv,
-				    "DB->get_re_pad: %s", db_strerror(ret));
-				goto err;
-			}
+			if (using_vdp)
+				tmp_int = (int)pip->re_pad;
+			else
+				if ((ret =
+				    __ram_get_re_pad(dbp, &tmp_int)) != 0) {
+					__db_err(dbenv, ret, "DB->get_re_pad");
+					goto err;
+				}
 			if (tmp_int != 0 && tmp_int != ' ') {
 				snprintf(buf,
 				    buflen, "re_pad=%#x\n", (u_int)tmp_int);
@@ -1484,22 +1475,27 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 			}
 		}
 		break;
-	case DB_UNKNOWN:
-		DB_ASSERT(0);			/* Impossible. */
-		__db_err(dbenv,
-		    "Unknown or unsupported DB type in __db_prheader");
-		ret = EINVAL;
+	case DB_UNKNOWN:			/* Impossible. */
+		ret = __db_unknown_path(dbenv, "__db_prheader");
 		goto err;
 	}
 
 	if (using_vdp) {
+		if (F_ISSET(pip, VRFY_HAS_CHKSUM))
+			if ((ret = callback(handle, "chksum=1\n")) != 0)
+				goto err;
 		if (F_ISSET(pip, VRFY_HAS_DUPS))
 			if ((ret = callback(handle, "duplicates=1\n")) != 0)
 				goto err;
 		if (F_ISSET(pip, VRFY_HAS_DUPSORT))
 			if ((ret = callback(handle, "dupsort=1\n")) != 0)
 				goto err;
-		/* We should handle page size. XXX */
+		/*
+		 * !!!
+		 * We don't know if the page size was the default if we're
+		 * salvaging.  It doesn't seem that interesting to have, so
+		 * we ignore it for now.
+		 */
 	} else {
 		if (F_ISSET(dbp, DB_AM_CHKSUM))
 			if ((ret = callback(handle, "chksum=1\n")) != 0)
diff --git a/db/db/db_rec.c b/db/db/db_rec.c
index bce2b8701..921b9c34a 100644
--- a/db/db/db_rec.c
+++ b/db/db/db_rec.c
@@ -1,29 +1,25 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_rec.c,v 11.61 2004/10/21 14:39:58 bostic Exp $
+ * $Id: db_rec.c,v 12.31 2006/09/19 04:04:49 ubell Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/log.h"
 #include "dbinc/mp.h"
 #include "dbinc/hash.h"
 
 static int __db_pg_free_recover_int __P((DB_ENV *,
     __db_pg_freedata_args *, DB *, DB_LSN *, DB_MPOOLFILE *, db_recops, int));
+static int __db_pg_free_recover_42_int __P((DB_ENV *,
+    __db_pg_freedata_42_args *,
+    DB *, DB_LSN *, DB_MPOOLFILE *, db_recops, int));
 
 /*
  * PUBLIC: int __db_addrem_recover
@@ -45,48 +41,47 @@ __db_addrem_recover(dbenv, dbtp, lsnp, op, info)
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	u_int32_t change;
-	int cmp_n, cmp_p, ret;
+	int cmp_n, cmp_p, modified, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
 	REC_PRINT(__db_addrem_print);
-	REC_INTRO(__db_addrem_read, 1);
+	REC_INTRO(__db_addrem_read, 1, 1);
 
 	REC_FGET(mpf, argp->pgno, &pagep, done);
+	modified = 0;
 
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-	cmp_p = log_compare(&LSN(pagep), &argp->pagelsn);
-	CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->pagelsn);
-	change = 0;
+	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
+	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->pagelsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->pagelsn);
 	if ((cmp_p == 0 && DB_REDO(op) && argp->opcode == DB_ADD_DUP) ||
 	    (cmp_n == 0 && DB_UNDO(op) && argp->opcode == DB_REM_DUP)) {
-
 		/* Need to redo an add, or undo a delete. */
+		REC_DIRTY(mpf, &pagep);
 		if ((ret = __db_pitem(dbc, pagep, argp->indx, argp->nbytes,
 		    argp->hdr.size == 0 ? NULL : &argp->hdr,
 		    argp->dbt.size == 0 ? NULL : &argp->dbt)) != 0)
 			goto out;
-
-		change = DB_MPOOL_DIRTY;
+		modified = 1;
 
 	} else if ((cmp_n == 0 && DB_UNDO(op) && argp->opcode == DB_ADD_DUP) ||
 	    (cmp_p == 0 && DB_REDO(op) && argp->opcode == DB_REM_DUP)) {
 		/* Need to undo an add, or redo a delete. */
+		REC_DIRTY(mpf, &pagep);
 		if ((ret = __db_ditem(dbc,
 		    pagep, argp->indx, argp->nbytes)) != 0)
 			goto out;
-		change = DB_MPOOL_DIRTY;
+		modified = 1;
 	}
 
-	if (change) {
+	if (modified) {
 		if (DB_REDO(op))
 			LSN(pagep) = *lsnp;
 		else
 			LSN(pagep) = argp->pagelsn;
 	}
 
-	if ((ret = __memp_fput(mpf, pagep, change)) != 0)
+	if ((ret = __memp_fput(mpf, pagep, 0)) != 0)
 		goto out;
 	pagep = NULL;
 
@@ -115,15 +110,15 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info)
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	u_int32_t change;
-	int cmp_n, cmp_p, ret;
+	int cmp_n, cmp_p, modified, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
 	REC_PRINT(__db_big_print);
-	REC_INTRO(__db_big_read, 1);
+	REC_INTRO(__db_big_read, 1, 0);
 
 	REC_FGET(mpf, argp->pgno, &pagep, ppage);
+	modified = 0;
 
 	/*
 	 * There are three pages we need to check.  The one on which we are
@@ -131,13 +126,13 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info)
 	 * been updated, and the next one whose prev_pointer may have
 	 * been updated.
 	 */
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-	cmp_p = log_compare(&LSN(pagep), &argp->pagelsn);
-	CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->pagelsn);
-	change = 0;
+	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
+	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->pagelsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->pagelsn);
 	if ((cmp_p == 0 && DB_REDO(op) && argp->opcode == DB_ADD_BIG) ||
 	    (cmp_n == 0 && DB_UNDO(op) && argp->opcode == DB_REM_BIG)) {
 		/* We are either redo-ing an add, or undoing a delete. */
+		REC_DIRTY(mpf, &pagep);
 		P_INIT(pagep, file_dbp->pgsize, argp->pgno, argp->prev_pgno,
 			argp->next_pgno, 0, P_OVERFLOW);
 		OV_LEN(pagep) = argp->dbt.size;
@@ -145,7 +140,7 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info)
 		memcpy((u_int8_t *)pagep + P_OVERHEAD(file_dbp), argp->dbt.data,
 		    argp->dbt.size);
 		PREV_PGNO(pagep) = argp->prev_pgno;
-		change = DB_MPOOL_DIRTY;
+		modified = 1;
 	} else if ((cmp_n == 0 && DB_UNDO(op) && argp->opcode == DB_ADD_BIG) ||
 	    (cmp_p == 0 && DB_REDO(op) && argp->opcode == DB_REM_BIG)) {
 		/*
@@ -153,14 +148,16 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info)
 		 * The page is about to be reclaimed in either case, so
 		 * there really isn't anything to do here.
 		 */
-		change = DB_MPOOL_DIRTY;
+		REC_DIRTY(mpf, &pagep);
+		modified = 1;
 	}
-	if (change)
+	if (modified)
 		LSN(pagep) = DB_REDO(op) ? *lsnp : argp->pagelsn;
 
-	if ((ret = __memp_fput(mpf, pagep, change)) != 0)
-		goto out;
+	ret = __memp_fput(mpf, pagep, 0);
 	pagep = NULL;
+	if (ret != 0)
+		goto out;
 
 	/*
 	 * We only delete a whole chain of overflow.
@@ -171,48 +168,56 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info)
 
 	/* Now check the previous page. */
 ppage:	if (argp->prev_pgno != PGNO_INVALID) {
-		change = 0;
 		REC_FGET(mpf, argp->prev_pgno, &pagep, npage);
+		modified = 0;
 
-		cmp_n = log_compare(lsnp, &LSN(pagep));
-		cmp_p = log_compare(&LSN(pagep), &argp->prevlsn);
-		CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->prevlsn);
+		cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
+		cmp_p = LOG_COMPARE(&LSN(pagep), &argp->prevlsn);
+		CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->prevlsn);
 
 		if (cmp_p == 0 && DB_REDO(op) && argp->opcode == DB_ADD_BIG) {
 			/* Redo add, undo delete. */
+			REC_DIRTY(mpf, &pagep);
 			NEXT_PGNO(pagep) = argp->pgno;
-			change = DB_MPOOL_DIRTY;
+			modified = 1;
 		} else if (cmp_n == 0 &&
 		    DB_UNDO(op) && argp->opcode == DB_ADD_BIG) {
 			/* Redo delete, undo add. */
+			REC_DIRTY(mpf, &pagep);
 			NEXT_PGNO(pagep) = argp->next_pgno;
-			change = DB_MPOOL_DIRTY;
+			modified = 1;
 		}
-		if (change)
+		if (modified)
 			LSN(pagep) = DB_REDO(op) ? *lsnp : argp->prevlsn;
-		if ((ret = __memp_fput(mpf, pagep, change)) != 0)
+		ret = __memp_fput(mpf, pagep, 0);
+		pagep = NULL;
+		if (ret != 0)
 			goto out;
 	}
 	pagep = NULL;
 
 	/* Now check the next page.  Can only be set on a delete. */
 npage:	if (argp->next_pgno != PGNO_INVALID) {
-		change = 0;
 		REC_FGET(mpf, argp->next_pgno, &pagep, done);
+		modified = 0;
 
-		cmp_n = log_compare(lsnp, &LSN(pagep));
-		cmp_p = log_compare(&LSN(pagep), &argp->nextlsn);
-		CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->nextlsn);
+		cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
+		cmp_p = LOG_COMPARE(&LSN(pagep), &argp->nextlsn);
+		CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->nextlsn);
 		if (cmp_p == 0 && DB_REDO(op)) {
+			REC_DIRTY(mpf, &pagep);
 			PREV_PGNO(pagep) = PGNO_INVALID;
-			change = DB_MPOOL_DIRTY;
+			modified = 1;
 		} else if (cmp_n == 0 && DB_UNDO(op)) {
+			REC_DIRTY(mpf, &pagep);
 			PREV_PGNO(pagep) = argp->pgno;
-			change = DB_MPOOL_DIRTY;
+			modified = 1;
 		}
-		if (change)
+		if (modified)
 			LSN(pagep) = DB_REDO(op) ? *lsnp : argp->nextlsn;
-		if ((ret = __memp_fput(mpf, pagep, change)) != 0)
+		ret = __memp_fput(mpf, pagep, 0);
+		pagep = NULL;
+		if (ret != 0)
 			goto out;
 	}
 	pagep = NULL;
@@ -245,32 +250,31 @@ __db_ovref_recover(dbenv, dbtp, lsnp, op, info)
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	int cmp, modified, ret;
+	int cmp, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
 	REC_PRINT(__db_ovref_print);
-	REC_INTRO(__db_ovref_read, 1);
+	REC_INTRO(__db_ovref_read, 1, 0);
 
 	REC_FGET(mpf, argp->pgno, &pagep, done);
 
-	modified = 0;
-	cmp = log_compare(&LSN(pagep), &argp->lsn);
-	CHECK_LSN(op, cmp, &LSN(pagep), &argp->lsn);
+	cmp = LOG_COMPARE(&LSN(pagep), &argp->lsn);
+	CHECK_LSN(dbenv, op, cmp, &LSN(pagep), &argp->lsn);
 	if (cmp == 0 && DB_REDO(op)) {
 		/* Need to redo update described. */
+		REC_DIRTY(mpf, &pagep);
 		OV_REF(pagep) += argp->adjust;
-
 		pagep->lsn = *lsnp;
-		modified = 1;
-	} else if (log_compare(lsnp, &LSN(pagep)) == 0 && DB_UNDO(op)) {
+	} else if (LOG_COMPARE(lsnp, &LSN(pagep)) == 0 && DB_UNDO(op)) {
 		/* Need to undo update described. */
+		REC_DIRTY(mpf, &pagep);
 		OV_REF(pagep) -= argp->adjust;
-
 		pagep->lsn = argp->lsn;
-		modified = 1;
 	}
-	if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0)
+	ret = __memp_fput(mpf, pagep, 0);
+	pagep = NULL;
+	if (ret != 0)
 		goto out;
 	pagep = NULL;
 
@@ -333,28 +337,26 @@ __db_noop_recover(dbenv, dbtp, lsnp, op, info)
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	u_int32_t change;
 	int cmp_n, cmp_p, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
 	REC_PRINT(__db_noop_print);
-	REC_INTRO(__db_noop_read, 0);
+	REC_INTRO(__db_noop_read, 0, 0);
 
 	REC_FGET(mpf, argp->pgno, &pagep, done);
 
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-	cmp_p = log_compare(&LSN(pagep), &argp->prevlsn);
-	CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->prevlsn);
-	change = 0;
+	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
+	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->prevlsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->prevlsn);
 	if (cmp_p == 0 && DB_REDO(op)) {
+		REC_DIRTY(mpf, &pagep);
 		LSN(pagep) = *lsnp;
-		change = DB_MPOOL_DIRTY;
 	} else if (cmp_n == 0 && DB_UNDO(op)) {
+		REC_DIRTY(mpf, &pagep);
 		LSN(pagep) = argp->prevlsn;
-		change = DB_MPOOL_DIRTY;
 	}
-	ret = __memp_fput(mpf, pagep, change);
+	ret = __memp_fput(mpf, pagep, 0);
 	pagep = NULL;
 
 done:	*lsnp = argp->prev_lsn;
@@ -385,13 +387,13 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	db_pgno_t pgno;
-	int cmp_n, cmp_p, created, level, meta_modified, modified, ret;
+	int cmp_n, cmp_p, created, level, ret;
 
 	meta = NULL;
 	pagep = NULL;
-	created = meta_modified = modified = 0;
+	created = 0;
 	REC_PRINT(__db_pg_alloc_print);
-	REC_INTRO(__db_pg_alloc_read, 0);
+	REC_INTRO(__db_pg_alloc_read, 0, 0);
 
 	/*
 	 * Fix up the metadata page.  If we're redoing the operation, we have
@@ -400,7 +402,8 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 	 * it on the freelist.
 	 */
 	pgno = PGNO_BASE_MD;
-	if ((ret = __memp_fget(mpf, &pgno, 0, &meta)) != 0) {
+	if ((ret = __memp_fget(mpf, &pgno, NULL,
+	    0, &meta)) != 0) {
 		/* The metadata page must always exist on redo. */
 		if (DB_REDO(op)) {
 			ret = __db_pgerr(file_dbp, pgno, ret);
@@ -408,18 +411,19 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 		} else
 			goto done;
 	}
-	cmp_n = log_compare(lsnp, &LSN(meta));
-	cmp_p = log_compare(&LSN(meta), &argp->meta_lsn);
-	CHECK_LSN(op, cmp_p, &LSN(meta), &argp->meta_lsn);
+	cmp_n = LOG_COMPARE(lsnp, &LSN(meta));
+	cmp_p = LOG_COMPARE(&LSN(meta), &argp->meta_lsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(meta), &argp->meta_lsn);
 	if (cmp_p == 0 && DB_REDO(op)) {
 		/* Need to redo update described. */
+		REC_DIRTY(mpf, &meta);
 		LSN(meta) = *lsnp;
 		meta->free = argp->next;
-		meta_modified = 1;
 		if (argp->pgno > meta->last_pgno)
 			meta->last_pgno = argp->pgno;
 	} else if (cmp_n == 0 && DB_UNDO(op)) {
 		/* Need to undo update described. */
+		REC_DIRTY(mpf, &meta);
 		LSN(meta) = argp->meta_lsn;
 		/*
 		 * If the page has a zero LSN then its newly created
@@ -436,9 +440,31 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 		 */
 		meta->last_pgno = argp->last_pgno;
 #endif
-		meta_modified = 1;
 	}
 
+#ifdef HAVE_FTRUNCATE
+	/*
+	 * Check to see if we are keeping a sorted
+	 * freelist, if so put this back in the in
+	 * memory list.  It must be the first element.
+	 */
+	if (op == DB_TXN_ABORT && !IS_ZERO_LSN(argp->page_lsn)) {
+		db_pgno_t *list;
+		u_int32_t nelem;
+
+		if ((ret = __memp_get_freelist(mpf, &nelem, &list)) != 0)
+			goto out;
+		if (list != NULL) {
+			if ((ret =
+			    __memp_extend_freelist(mpf, nelem + 1, &list)) != 0)
+				goto out;
+			if (nelem != 0)
+				memmove(list + 1, list, nelem * sizeof(list));
+			*list = argp->pgno;
+		}
+	}
+#endif
+
 	/*
 	 * Fix up the allocated page. If the page does not exist
 	 * and we can truncate it then don't create it.
@@ -447,7 +473,8 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 	 * LSN.  If we're undoing the operation, we have to reset the page's
 	 * LSN and put it on the free list, or into limbo..
 	 */
-	if ((ret = __memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) {
+	if ((ret = __memp_fget(mpf, &argp->pgno, NULL,
+	    0, &pagep)) != 0) {
 		/*
 		 * We have to be able to identify if a page was newly
 		 * created so we can recover it properly.  We cannot simply
@@ -460,19 +487,19 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 		if (DB_UNDO(op))
 			goto do_truncate;
 #endif
-		if ((ret = __memp_fget(
-		    mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) {
+		if ((ret = __memp_fget(mpf, &argp->pgno, NULL,
+		    DB_MPOOL_CREATE, &pagep)) != 0) {
 			if (DB_UNDO(op) && ret == ENOSPC)
 				goto do_truncate;
 			ret = __db_pgerr(file_dbp, argp->pgno, ret);
 			goto out;
 		}
-		created = modified = 1;
+		created = 1;
 	}
 
 	/* Fix up the allocated page. */
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-	cmp_p = log_compare(&LSN(pagep), &argp->page_lsn);
+	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
+	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->page_lsn);
 
 	/*
 	 * If an initial allocation is aborted and then reallocated during
@@ -485,7 +512,7 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 	    (IS_ZERO_LSN(argp->page_lsn) && IS_INIT_LSN(LSN(pagep))))
 		cmp_p = 0;
 
-	CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->page_lsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->page_lsn);
 	/*
 	 * Another special case we have to handle is if we ended up with a
 	 * page of all 0's which can happen if we abort between allocating a
@@ -494,6 +521,7 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 	 */
 	if (DB_REDO(op) && cmp_p == 0) {
 		/* Need to redo update described. */
+		REC_DIRTY(mpf, &pagep);
 		switch (argp->ptype) {
 		case P_LBTREE:
 		case P_LRECNO:
@@ -508,7 +536,6 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 		    argp->pgno, PGNO_INVALID, PGNO_INVALID, level, argp->ptype);
 
 		pagep->lsn = *lsnp;
-		modified = 1;
 	} else if (DB_UNDO(op) && (cmp_n == 0 || created)) {
 		/*
 		 * This is where we handle the case of a 0'd page (pagep->pgno
@@ -516,11 +543,11 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 		 * Undo the allocation, reinitialize the page and
 		 * link its next pointer to the free list.
 		 */
+		REC_DIRTY(mpf, &pagep);
 		P_INIT(pagep, file_dbp->pgsize,
 		    argp->pgno, PGNO_INVALID, argp->next, 0, P_INVALID);
 
 		pagep->lsn = argp->page_lsn;
-		modified = 1;
 	}
 
 do_truncate:
@@ -538,11 +565,11 @@ do_truncate:
 			     __memp_fput(mpf, pagep, DB_MPOOL_DISCARD)) != 0)
 				goto out;
 			pagep = NULL;
-			/* Give the page back to the OS. */
-			if (meta->last_pgno <= argp->pgno &&
-			    (ret = __memp_ftruncate(mpf, argp->pgno, 0)) != 0)
-				goto out;
 		}
+		/* Give the page back to the OS. */
+		if (meta->last_pgno <= argp->pgno && (ret =
+		    __memp_ftruncate(mpf, argp->pgno, MP_TRUNC_RECOVER)) != 0)
+			goto out;
 #else
 		/* Put the page in limbo.*/
 		if ((ret = __db_add_limbo(dbenv,
@@ -550,22 +577,23 @@ do_truncate:
 			goto out;
 		/* The last_pgno grows if this was a new page. */
 		if (argp->pgno > meta->last_pgno) {
+			REC_DIRTY(mpf, &meta);
 			meta->last_pgno = argp->pgno;
-			meta_modified = 1;
 		}
 #endif
 	}
 
-	if (pagep != NULL &&
-	     (ret = __memp_fput(mpf,
-	     pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0)
-		goto out;
-	pagep = NULL;
+	if (pagep != NULL) {
+		ret = __memp_fput(mpf, pagep, 0);
+		pagep = NULL;
+		if (ret != 0)
+			goto out;
+	}
 
-	if ((ret = __memp_fput(mpf,
-	    meta, meta_modified ? DB_MPOOL_DIRTY : 0)) != 0)
-		goto out;
+	ret = __memp_fput(mpf, meta, 0);
 	meta = NULL;
+	if (ret != 0)
+		goto out;
 
 done:	*lsnp = argp->prev_lsn;
 	ret = 0;
@@ -594,32 +622,36 @@ __db_pg_free_recover_int(dbenv, argp, file_dbp, lsnp, mpf, op, data)
 {
 	DBMETA *meta;
 	DB_LSN copy_lsn;
-	PAGE *pagep;
-	db_pgno_t pgno;
-	int cmp_n, cmp_p, meta_modified, modified, ret;
+	PAGE *pagep, *prevp;
+	int cmp_n, cmp_p, is_meta, ret;
 
 	meta = NULL;
 	pagep = NULL;
-	meta_modified = modified = 0;
+	prevp = NULL;
 
 	/*
-	 * Get the metapage first so we can see where we are.
+	 * Get the "metapage".  This will either be the metapage
+	 * or the previous page in the free list if we are doing
+	 * sorted allocations.  If its a previous page then
+	 * we will not be truncating.
 	 */
-	pgno = PGNO_BASE_MD;
-	if ((ret = __memp_fget(mpf, &pgno, 0, &meta)) != 0) {
-		/* The metadata page must always exist. */
-		ret = __db_pgerr(file_dbp, pgno, ret);
-		goto out;
-	}
-	cmp_n = log_compare(lsnp, &LSN(meta));
-	cmp_p = log_compare(&LSN(meta), &argp->meta_lsn);
-	CHECK_LSN(op, cmp_p, &LSN(meta), &argp->meta_lsn);
+	is_meta = argp->meta_pgno == PGNO_BASE_MD;
+
+	REC_FGET(mpf, argp->meta_pgno, &meta, check_meta);
+
+	if (argp->meta_pgno != PGNO_BASE_MD)
+		prevp = (PAGE *)meta;
+
+	cmp_n = LOG_COMPARE(lsnp, &LSN(meta));
+	cmp_p = LOG_COMPARE(&LSN(meta), &argp->meta_lsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(meta), &argp->meta_lsn);
 
 	/*
 	 * Fix up the metadata page.  If we're redoing or undoing the operation
 	 * we get the page and update its LSN, last and free pointer.
 	 */
 	if (cmp_p == 0 && DB_REDO(op)) {
+		REC_DIRTY(mpf, &meta);
 #ifdef HAVE_FTRUNCATE
 		/*
 		 * If we are at the end of the file truncate, otherwise
@@ -627,28 +659,42 @@ __db_pg_free_recover_int(dbenv, argp, file_dbp, lsnp, mpf, op, data)
 		*/
 		if (argp->pgno == argp->last_pgno)
 			meta->last_pgno = argp->pgno - 1;
-		else
+		else if (prevp == NULL)
 			meta->free = argp->pgno;
+		else
+			NEXT_PGNO(prevp) = argp->pgno;
 #else
 		/* Need to redo the deallocation. */
-		meta->free = argp->pgno;
+		if (prevp == NULL)
+			meta->free = argp->pgno;
+		else
+			NEXT_PGNO(prevp) = argp->pgno;
 		/*
 		 * If this was a compensating transaction and
 		 * we are a replica, then we never executed the
 		 * original allocation which incremented meta->free.
 		 */
-		if (meta->last_pgno < meta->free)
+		if (prevp == NULL && meta->last_pgno < meta->free)
 			meta->last_pgno = meta->free;
 #endif
 		LSN(meta) = *lsnp;
-		meta_modified = 1;
 	} else if (cmp_n == 0 && DB_UNDO(op)) {
 		/* Need to undo the deallocation. */
-		meta->free = argp->next;
+		REC_DIRTY(mpf, &meta);
+		if (prevp == NULL)
+			meta->free = argp->next;
+		else
+			NEXT_PGNO(prevp) = argp->next;
 		LSN(meta) = argp->meta_lsn;
-		if (meta->last_pgno < argp->pgno)
+		if (prevp == NULL && meta->last_pgno < argp->pgno)
 			meta->last_pgno = argp->pgno;
-		meta_modified = 1;
+	}
+
+check_meta:
+	if (ret != 0 && is_meta) {
+		/* The metadata page must always exist. */
+		ret = __db_pgerr(file_dbp, argp->meta_pgno, ret);
+		goto out;
 	}
 
 	/*
@@ -661,21 +707,25 @@ __db_pg_free_recover_int(dbenv, argp, file_dbp, lsnp, mpf, op, data)
 	 * and roll it back.
 	 */
 #ifdef HAVE_FTRUNCATE
-	if (DB_REDO(op) || meta->last_pgno < argp->pgno) {
-		if ((ret = __memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) {
-			if (ret == DB_PAGE_NOTFOUND)
-				goto done;
-			goto out;
+	if (DB_REDO(op) || (is_meta && meta->last_pgno < argp->pgno)) {
+		if ((ret =
+		    __memp_fget(mpf, &argp->pgno, NULL, 0, &pagep)) != 0) {
+			if (ret != DB_PAGE_NOTFOUND)
+				goto out;
+			if (is_meta &&
+			    DB_REDO(op) && meta->last_pgno <= argp->pgno)
+				goto trunc;
+			goto done;
 		}
 	} else
 #endif
 	if ((ret =
-	    __memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+	    __memp_fget(mpf, &argp->pgno, NULL, DB_MPOOL_CREATE, &pagep)) != 0)
 		goto out;
 
 	(void)__ua_memcpy(©_lsn, &LSN(argp->header.data), sizeof(DB_LSN));
-	cmp_n = IS_ZERO_LSN(LSN(pagep)) ? 0 : log_compare(lsnp, &LSN(pagep));
-	cmp_p = log_compare(&LSN(pagep), ©_lsn);
+	cmp_n = IS_ZERO_LSN(LSN(pagep)) ? 0 : LOG_COMPARE(lsnp, &LSN(pagep));
+	cmp_p = LOG_COMPARE(&LSN(pagep), ©_lsn);
 
 #ifdef HAVE_FTRUNCATE
 	/*
@@ -687,54 +737,87 @@ __db_pg_free_recover_int(dbenv, argp, file_dbp, lsnp, mpf, op, data)
 		cmp_p = 0;
 #endif
 
-	CHECK_LSN(op, cmp_p, &LSN(pagep), ©_lsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), ©_lsn);
 	if (DB_REDO(op) &&
 	    (cmp_p == 0 ||
 	    (IS_ZERO_LSN(copy_lsn) &&
-	    log_compare(&LSN(pagep), &argp->meta_lsn) <= 0))) {
+	    LOG_COMPARE(&LSN(pagep), &argp->meta_lsn) <= 0))) {
 		/* Need to redo the deallocation. */
 #ifdef HAVE_FTRUNCATE
-		if (meta->last_pgno <= argp->pgno) {
+		/*
+		 * The page can be truncated if it was truncated at runtime
+		 * and the current metapage reflects the truncation.
+		 */
+		if (is_meta && meta->last_pgno <= argp->pgno &&
+		    argp->last_pgno <= argp->pgno) {
 			if ((ret =
 			    __memp_fput(mpf, pagep, DB_MPOOL_DISCARD)) != 0)
 				goto out;
 			pagep = NULL;
-			if ((ret = __memp_ftruncate(mpf, argp->pgno, 0)) != 0)
+trunc:			if ((ret = __memp_ftruncate(mpf,
+			    argp->pgno, MP_TRUNC_RECOVER)) != 0)
 				goto out;
 		} else if (argp->last_pgno == argp->pgno) {
 			/* The page was truncated at runtime, zero it out. */
+			REC_DIRTY(mpf, &pagep);
 			P_INIT(pagep, 0, PGNO_INVALID,
 			    PGNO_INVALID, PGNO_INVALID, 0, P_INVALID);
 			ZERO_LSN(pagep->lsn);
-			modified = 1;
 		} else
 #endif
 		{
+			REC_DIRTY(mpf, &pagep);
 			P_INIT(pagep, file_dbp->pgsize,
 			    argp->pgno, PGNO_INVALID, argp->next, 0, P_INVALID);
 			pagep->lsn = *lsnp;
 
-			modified = 1;
 		}
 	} else if (cmp_n == 0 && DB_UNDO(op)) {
 		/* Need to reallocate the page. */
+		REC_DIRTY(mpf, &pagep);
 		memcpy(pagep, argp->header.data, argp->header.size);
 		if (data)
-			memcpy((u_int8_t*)pagep + pagep->hf_offset,
+			memcpy((u_int8_t*)pagep + HOFFSET(pagep),
 			     argp->data.data, argp->data.size);
-
-		modified = 1;
 	}
-	if (pagep != NULL &&
-	    (ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0)
+	if (pagep != NULL && (ret = __memp_fput(mpf, pagep, 0)) != 0)
 		goto out;
 
 	pagep = NULL;
 #ifdef HAVE_FTRUNCATE
+	/*
+	 * If we are keeping an in memory free list remove this
+	 * element from the list.
+	 */
+	if (op == DB_TXN_ABORT && argp->pgno != argp->last_pgno) {
+		db_pgno_t *lp;
+		u_int32_t nelem, pos;
+
+		if ((ret = __memp_get_freelist(mpf, &nelem, &lp)) != 0)
+			goto out;
+		if (lp != NULL) {
+			pos = 0;
+			if (!is_meta && nelem != 0) {
+				__db_freelist_pos(argp->pgno, lp, nelem, &pos);
+
+				DB_ASSERT(dbenv, argp->pgno == lp[pos]);
+				DB_ASSERT(dbenv,
+				    argp->meta_pgno == lp[pos - 1]);
+			}
+
+			if (nelem != 0 && pos != nelem)
+				memmove(&lp[pos], &lp[pos + 1],
+				    (nelem - pos) * sizeof(*lp));
+
+			/* Shrink the list */
+			if ((ret =
+			    __memp_extend_freelist(mpf, nelem - 1, &lp)) != 0)
+				goto out;
+		}
+	}
 done:
 #endif
-	if ((ret = __memp_fput(mpf,
-	     meta, meta_modified ? DB_MPOOL_DIRTY : 0)) != 0)
+	if (meta != NULL && (ret = __memp_fput(mpf, meta, 0)) != 0)
 		goto out;
 	meta = NULL;
 
@@ -771,7 +854,7 @@ __db_pg_free_recover(dbenv, dbtp, lsnp, op, info)
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__db_pg_free_print);
-	REC_INTRO(__db_pg_free_read, 1);
+	REC_INTRO(__db_pg_free_read, 1, 0);
 
 	ret = __db_pg_free_recover_int(dbenv,
 	     (__db_pg_freedata_args *)argp, file_dbp, lsnp, mpf, op, 0);
@@ -799,19 +882,36 @@ __db_pg_new_recover(dbenv, dbtp, lsnp, op, info)
 {
 #ifndef HAVE_FTRUNCATE
 	DB *file_dbp;
+	DBMETA *meta;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	__db_pg_free_args *argp;
 	int ret;
 
 	REC_PRINT(__db_pg_free_print);
-	REC_INTRO(__db_pg_free_read, 1);
-	COMPQUIET(op, DB_TXN_ABORT);
+	REC_INTRO(__db_pg_free_read, 1, 0);
+
+	REC_FGET(mpf, argp->meta_pgno, &meta, done);
+	if (DB_UNDO(op)) {
+		if (LOG_COMPARE(lsnp, &LSN(meta)) == 0) {
+			meta->lsn = argp->meta_lsn;
+			REC_DIRTY(mpf, &meta);
+		}
+
+	} else if (DB_REDO(op)) {
+		if (LOG_COMPARE(&argp->meta_lsn, &LSN(meta)) == 0) {
+			meta->lsn = *lsnp;
+			REC_DIRTY(mpf, &meta);
+		}
+	}
+	if ((ret = __memp_fput(mpf, meta, 0)) != 0)
+		goto out;
 
 	if ((ret =
 	    __db_add_limbo(dbenv, info, argp->fileid, argp->pgno, 1)) == 0)
 		*lsnp = argp->prev_lsn;
 
+
 done:
 out:
 	REC_CLOSE;
@@ -848,7 +948,7 @@ __db_pg_freedata_recover(dbenv, dbtp, lsnp, op, info)
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__db_pg_freedata_print);
-	REC_INTRO(__db_pg_freedata_read, 1);
+	REC_INTRO(__db_pg_freedata_read, 1, 0);
 
 	ret = __db_pg_free_recover_int(dbenv, argp, file_dbp, lsnp, mpf, op, 1);
 
@@ -892,7 +992,7 @@ __db_cksum_recover(dbenv, dbtp, lsnp, op, info)
 	if (F_ISSET(dbenv, DB_ENV_FATAL))
 		ret = 0;
 	else {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "Checksum failure requires catastrophic recovery");
 		ret = __db_panic(dbenv, DB_RUNRECOVERY);
 	}
@@ -925,7 +1025,7 @@ __db_pg_prepare_recover(dbenv, dbtp, lsnp, op, info)
 	int ret, t_ret;
 
 	REC_PRINT(__db_pg_prepare_print);
-	REC_INTRO(__db_pg_prepare_read, 1);
+	REC_INTRO(__db_pg_prepare_read, 1, 0);
 
 	mpf = file_dbp->mpf;
 
@@ -946,15 +1046,14 @@ __db_pg_prepare_recover(dbenv, dbtp, lsnp, op, info)
 	 * this transaction which we will roll back.
 	 */
 	if (op == DB_TXN_ABORT) {
-		if ((ret = __memp_fget(
-		    mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+		if ((ret = __memp_fget(mpf, &argp->pgno,
+		    NULL, DB_MPOOL_CREATE | DB_MPOOL_EDIT, &pagep)) != 0)
 			goto out;
 		P_INIT(pagep, file_dbp->pgsize,
 		    argp->pgno, PGNO_INVALID, PGNO_INVALID, 0, P_INVALID);
 		ZERO_LSN(pagep->lsn);
 		ret = __db_add_limbo(dbenv, info, argp->fileid, argp->pgno, 1);
-		if ((t_ret =
-		    __memp_fput(mpf, pagep, DB_MPOOL_DIRTY)) != 0 && ret == 0)
+		if ((t_ret = __memp_fput(mpf, pagep, 0)) != 0 && ret == 0)
 			ret = t_ret;
 	}
 
@@ -974,7 +1073,7 @@ out:	REC_CLOSE;
 
 /*
  * __db_pg_init_recover --
- *	Recovery function to reinit pages for truncate.
+ *	Recovery function to reinit pages after truncation.
  *
  * PUBLIC: int __db_pg_init_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
@@ -993,39 +1092,729 @@ __db_pg_init_recover(dbenv, dbtp, lsnp, op, info)
 	DB_LSN copy_lsn;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
+	int cmp_n, cmp_p, ret, type;
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__db_pg_init_print);
-	REC_INTRO(__db_pg_init_read, 1);
+	REC_INTRO(__db_pg_init_read, 1, 0);
 
 	mpf = file_dbp->mpf;
-	REC_FGET(mpf, argp->pgno, &pagep, done);
+	if ((ret = __memp_fget(mpf, &argp->pgno, NULL, 0, &pagep)) != 0) {
+		if (DB_UNDO(op)) {
+			if (ret == DB_PAGE_NOTFOUND)
+				goto done;
+			else {
+				ret = __db_pgerr(file_dbp, argp->pgno, ret);
+				goto out;
+			}
+		}
+
+		/*
+		 * This page was truncated and may simply not have
+		 * had an item written to it yet.  This should only
+		 * happen on hash databases, so confirm that.
+		 */
+		DB_ASSERT(dbenv, file_dbp->type == DB_HASH);
+		if ((ret = __memp_fget(mpf,
+		    &argp->pgno, NULL, DB_MPOOL_CREATE, &pagep)) != 0) {
+			ret = __db_pgerr(file_dbp, argp->pgno, ret);
+			goto out;
+		}
+	}
 
-	modified = 0;
 	(void)__ua_memcpy(©_lsn, &LSN(argp->header.data), sizeof(DB_LSN));
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-	cmp_p = log_compare(&LSN(pagep), ©_lsn);
-	CHECK_LSN(op, cmp_p, &LSN(pagep), ©_lsn);
+	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
+	cmp_p = LOG_COMPARE(&LSN(pagep), ©_lsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), ©_lsn);
 
 	if (cmp_p == 0 && DB_REDO(op)) {
+		if (TYPE(pagep) == P_HASH)
+			type = P_HASH;
+		else
+			type = file_dbp->type == DB_RECNO ? P_LRECNO : P_LBTREE;
+		REC_DIRTY(mpf, &pagep);
 		P_INIT(pagep, file_dbp->pgsize, PGNO(pagep), PGNO_INVALID,
-		    PGNO_INVALID, TYPE(pagep) == P_HASH ? 0 : 1, TYPE(pagep));
+		    PGNO_INVALID, TYPE(pagep) == P_HASH ? 0 : 1, type);
 		pagep->lsn = *lsnp;
-		modified = 1;
 	} else if (cmp_n == 0 && DB_UNDO(op)) {
 		/* Put the data back on the page. */
+		REC_DIRTY(mpf, &pagep);
 		memcpy(pagep, argp->header.data, argp->header.size);
 		if (argp->data.size > 0)
-			memcpy((u_int8_t*)pagep + pagep->hf_offset,
+			memcpy((u_int8_t*)pagep + HOFFSET(pagep),
 			     argp->data.data, argp->data.size);
-
-		modified = 1;
 	}
-	if ((ret = __memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0)
+	if ((ret = __memp_fput(mpf, pagep, 0)) != 0)
 		goto out;
 
 done:	*lsnp = argp->prev_lsn;
 out:
 	REC_CLOSE;
 }
+
+/*
+ * __db_pg_sort_recover --
+ *	Recovery function for pg_sort.
+ *
+ * PUBLIC: int __db_pg_sort_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_pg_sort_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+#ifdef HAVE_FTRUNCATE
+	__db_pg_sort_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DBMETA *meta;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	db_pgno_t pgno, *list;
+	u_int32_t felem, nelem;
+	struct pglist *pglist, *lp;
+	int ret;
+
+	COMPQUIET(info, NULL);
+	REC_PRINT(__db_pg_sort_print);
+	REC_INTRO(__db_pg_sort_read, 1, 1);
+
+	pglist = (struct pglist *) argp->list.data;
+	nelem = argp->list.size / sizeof(struct pglist);
+	if (DB_REDO(op)) {
+		pgno = argp->last_pgno;
+		if ((ret = __db_pg_truncate(mpf, NULL,
+		    pglist, NULL, &nelem, &pgno, lsnp, 1)) != 0)
+			goto out;
+
+		if (argp->last_free != PGNO_INVALID) {
+			if ((ret = __memp_fget(mpf, &argp->last_free, NULL,
+			    0, &meta)) == 0) {
+				if (LOG_COMPARE(&LSN(meta),
+				     &argp->last_lsn) == 0) {
+					REC_DIRTY(mpf, &meta);
+					NEXT_PGNO(meta) = PGNO_INVALID;
+					LSN(meta) = *lsnp;
+				}
+				if ((ret = __memp_fput(mpf, meta, 0)) != 0)
+					goto out;
+				meta = NULL;
+			} else if (ret != DB_PAGE_NOTFOUND)
+				goto out;
+		}
+		if ((ret = __memp_fget(mpf, &argp->meta, NULL,
+		    0, &meta)) != 0)
+			goto out;
+		if (LOG_COMPARE(&LSN(meta), &argp->meta_lsn) == 0) {
+			REC_DIRTY(mpf, &meta);
+			if (argp->last_free == PGNO_INVALID) {
+				if (nelem == 0)
+					meta->free = PGNO_INVALID;
+				else
+					meta->free = pglist->pgno;
+			}
+			meta->last_pgno = pgno;
+			LSN(meta) = *lsnp;
+		}
+	} else {
+		/* Put the free list back in its original order. */
+		for (lp = pglist; lp < &pglist[nelem]; lp++) {
+			if ((ret = __memp_fget(mpf, &lp->pgno, NULL,
+			    DB_MPOOL_CREATE, &pagep)) != 0)
+				goto out;
+			if (IS_ZERO_LSN(LSN(pagep)) ||
+			     LOG_COMPARE(&LSN(pagep), lsnp) == 0) {
+				REC_DIRTY(mpf, &pagep);
+				if (lp == &pglist[nelem - 1])
+					pgno = PGNO_INVALID;
+				else
+					pgno = lp[1].pgno;
+
+				P_INIT(pagep, file_dbp->pgsize,
+				    lp->pgno, PGNO_INVALID, pgno, 0, P_INVALID);
+				LSN(pagep) = lp->lsn;
+			}
+			if ((ret = __memp_fput(mpf, pagep, 0)) != 0)
+				goto out;
+		}
+		if (argp->last_free != PGNO_INVALID) {
+			if ((ret = __memp_fget(mpf, &argp->last_free, NULL,
+			    DB_MPOOL_EDIT, &meta)) == 0) {
+				if (LOG_COMPARE(&LSN(meta), lsnp) == 0) {
+					REC_DIRTY(mpf, &pagep);
+					NEXT_PGNO(meta) = pglist->pgno;
+					LSN(meta) = argp->last_lsn;
+				}
+				if ((ret = __memp_fput(mpf, meta, 0)) != 0)
+					goto out;
+			} else if (ret != DB_PAGE_NOTFOUND)
+				goto out;
+			meta = NULL;
+		}
+		if ((ret = __memp_fget(mpf, &argp->meta,
+		    NULL, DB_MPOOL_EDIT, &meta)) != 0)
+			goto out;
+		if (LOG_COMPARE(&LSN(meta), lsnp) == 0) {
+			REC_DIRTY(mpf, &meta);
+			meta->last_pgno = argp->last_pgno;
+			if (argp->last_free == PGNO_INVALID)
+				meta->free = pglist->pgno;
+			LSN(meta) = argp->meta_lsn;
+		}
+	}
+	if (op == DB_TXN_ABORT) {
+		if ((ret = __memp_get_freelist(mpf, &felem, &list)) != 0)
+			goto out;
+		if (list != NULL) {
+			DB_ASSERT(dbenv, felem == 0 ||
+			    argp->last_free == list[felem - 1]);
+			if ((ret = __memp_extend_freelist(
+			    mpf, felem + nelem, &list)) != 0)
+				goto out;
+			for (lp = pglist; lp < &pglist[nelem]; lp++)
+				list[felem++] = lp->pgno;
+		}
+	}
+
+	if ((ret = __memp_fput(mpf, meta, 0)) != 0)
+		goto out;
+
+done:	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	REC_CLOSE;
+#else
+	/*
+	 * If HAVE_FTRUNCATE is not defined, we'll never see pg_sort records
+	 * to recover.
+	 */
+	COMPQUIET(dbenv, NULL);
+	COMPQUIET(dbtp, NULL);
+	COMPQUIET(lsnp, NULL);
+	COMPQUIET(op,  DB_TXN_ABORT);
+	COMPQUIET(info, NULL);
+	return (EINVAL);
+#endif
+}
+
+/*
+ * __db_pg_alloc_42_recover --
+ *	Recovery function for pg_alloc.
+ *
+ * PUBLIC: int __db_pg_alloc_42_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_pg_alloc_42_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__db_pg_alloc_42_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DBMETA *meta;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	db_pgno_t pgno;
+	int cmp_n, cmp_p, created, level, ret;
+
+	meta = NULL;
+	pagep = NULL;
+	created = 0;
+	REC_PRINT(__db_pg_alloc_42_print);
+	REC_INTRO(__db_pg_alloc_42_read, 0, 0);
+
+	/*
+	 * Fix up the metadata page.  If we're redoing the operation, we have
+	 * to get the metadata page and update its LSN and its free pointer.
+	 * If we're undoing the operation and the page was ever created, we put
+	 * it on the freelist.
+	 */
+	pgno = PGNO_BASE_MD;
+	if ((ret = __memp_fget(mpf, &pgno, NULL, 0, &meta)) != 0) {
+		/* The metadata page must always exist on redo. */
+		if (DB_REDO(op)) {
+			ret = __db_pgerr(file_dbp, pgno, ret);
+			goto out;
+		} else
+			goto done;
+	}
+	cmp_n = LOG_COMPARE(lsnp, &LSN(meta));
+	cmp_p = LOG_COMPARE(&LSN(meta), &argp->meta_lsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(meta), &argp->meta_lsn);
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo update described. */
+		REC_DIRTY(mpf, &meta);
+		LSN(meta) = *lsnp;
+		meta->free = argp->next;
+		if (argp->pgno > meta->last_pgno)
+			meta->last_pgno = argp->pgno;
+	} else if (cmp_n == 0 && DB_UNDO(op)) {
+		/* Need to undo update described. */
+		REC_DIRTY(mpf, &meta);
+		LSN(meta) = argp->meta_lsn;
+		/*
+		 * If the page has a zero LSN then its newly created
+		 * and will be truncated or go into limbo rather than
+		 * directly on the free list.
+		 */
+		if (!IS_ZERO_LSN(argp->page_lsn))
+			meta->free = argp->pgno;
+	}
+
+	/*
+	 * Fix up the allocated page. If the page does not exist
+	 * and we can truncate it then don't create it.
+	 * Otherwise if we're redoing the operation, we have
+	 * to get the page (creating it if it doesn't exist), and update its
+	 * LSN.  If we're undoing the operation, we have to reset the page's
+	 * LSN and put it on the free list, or into limbo..
+	 */
+	if ((ret = __memp_fget(mpf, &argp->pgno, NULL, 0, &pagep)) != 0) {
+		/*
+		 * We have to be able to identify if a page was newly
+		 * created so we can recover it properly.  We cannot simply
+		 * look for an empty header, because hash uses a pgin
+		 * function that will set the header.  Instead, we explicitly
+		 * try for the page without CREATE and if that fails, then
+		 * create it.
+		 */
+		if ((ret = __memp_fget(
+		    mpf, &argp->pgno, NULL, DB_MPOOL_CREATE, &pagep)) != 0) {
+			if (DB_UNDO(op) && ret == ENOSPC)
+				goto do_truncate;
+			ret = __db_pgerr(file_dbp, argp->pgno, ret);
+			goto out;
+		}
+		created = 1;
+	}
+
+	/* Fix up the allocated page. */
+	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
+	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->page_lsn);
+
+	/*
+	 * If an initial allocation is aborted and then reallocated during
+	 * an archival restore the log record will have an LSN for the page
+	 * but the page will be empty.
+	 * If we we rolled back this allocation previously during an
+	 * archive restore, the page may have INIT_LSN from the limbo list.
+	 */
+	if (IS_ZERO_LSN(LSN(pagep)) ||
+	    (IS_ZERO_LSN(argp->page_lsn) && IS_INIT_LSN(LSN(pagep))))
+		cmp_p = 0;
+
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->page_lsn);
+	/*
+	 * Another special case we have to handle is if we ended up with a
+	 * page of all 0's which can happen if we abort between allocating a
+	 * page in mpool and initializing it.  In that case, even if we're
+	 * undoing, we need to re-initialize the page.
+	 */
+	if (DB_REDO(op) && cmp_p == 0) {
+		/* Need to redo update described. */
+		switch (argp->ptype) {
+		case P_LBTREE:
+		case P_LRECNO:
+		case P_LDUP:
+			level = LEAFLEVEL;
+			break;
+		default:
+			level = 0;
+			break;
+		}
+		REC_DIRTY(mpf, &pagep);
+		P_INIT(pagep, file_dbp->pgsize,
+		    argp->pgno, PGNO_INVALID, PGNO_INVALID, level, argp->ptype);
+
+		pagep->lsn = *lsnp;
+	} else if (DB_UNDO(op) && (cmp_n == 0 || created)) {
+		/*
+		 * This is where we handle the case of a 0'd page (pagep->pgno
+		 * is equal to PGNO_INVALID).
+		 * Undo the allocation, reinitialize the page and
+		 * link its next pointer to the free list.
+		 */
+		REC_DIRTY(mpf, &pagep);
+		P_INIT(pagep, file_dbp->pgsize,
+		    argp->pgno, PGNO_INVALID, argp->next, 0, P_INVALID);
+
+		pagep->lsn = argp->page_lsn;
+	}
+
+do_truncate:
+	/*
+	 * If the page was newly created, give it back, if
+	 * possible.  Otherwise put it into limbo.
+	 */
+	if ((pagep == NULL || IS_ZERO_LSN(LSN(pagep))) &&
+	    IS_ZERO_LSN(argp->page_lsn) && DB_UNDO(op)) {
+		/* Put the page in limbo.*/
+		if ((ret = __db_add_limbo(dbenv,
+		    info, argp->fileid, argp->pgno, 1)) != 0)
+			goto out;
+		/* The last_pgno grows if this was a new page. */
+		if (argp->pgno > meta->last_pgno) {
+			REC_DIRTY(mpf, &meta);
+			meta->last_pgno = argp->pgno;
+		}
+	}
+
+	if (pagep != NULL && (ret = __memp_fput(mpf, pagep, 0)) != 0)
+		goto out;
+	pagep = NULL;
+
+	if ((ret = __memp_fput(mpf, meta, 0)) != 0)
+		goto out;
+	meta = NULL;
+
+done:	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	if (pagep != NULL)
+		(void)__memp_fput(mpf, pagep, 0);
+	if (meta != NULL)
+		(void)__memp_fput(mpf, meta, 0);
+	if (ret == ENOENT && op == DB_TXN_BACKWARD_ALLOC)
+		ret = 0;
+	REC_CLOSE;
+}
+
+/*
+ * __db_pg_free_recover_42_int --
+ */
+static int
+__db_pg_free_recover_42_int(dbenv, argp, file_dbp, lsnp, mpf, op, data)
+	DB_ENV *dbenv;
+	__db_pg_freedata_42_args *argp;
+	DB *file_dbp;
+	DB_LSN *lsnp;
+	DB_MPOOLFILE *mpf;
+	db_recops op;
+	int data;
+{
+	DBMETA *meta;
+	DB_LSN copy_lsn;
+	PAGE *pagep, *prevp;
+	int cmp_n, cmp_p, is_meta, ret;
+
+	meta = NULL;
+	pagep = NULL;
+	prevp = NULL;
+
+	/*
+	 * Get the "metapage".  This will either be the metapage
+	 * or the previous page in the free list if we are doing
+	 * sorted allocations.  If its a previous page then
+	 * we will not be truncating.
+	 */
+	is_meta = argp->meta_pgno == PGNO_BASE_MD;
+
+	REC_FGET(mpf, argp->meta_pgno, &meta, check_meta);
+
+	if (argp->meta_pgno != PGNO_BASE_MD)
+		prevp = (PAGE *)meta;
+
+	cmp_n = LOG_COMPARE(lsnp, &LSN(meta));
+	cmp_p = LOG_COMPARE(&LSN(meta), &argp->meta_lsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(meta), &argp->meta_lsn);
+
+	/*
+	 * Fix up the metadata page.  If we're redoing or undoing the operation
+	 * we get the page and update its LSN, last and free pointer.
+	 */
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo the deallocation. */
+		REC_DIRTY(mpf, &meta);
+		if (prevp == NULL)
+			meta->free = argp->pgno;
+		else
+			NEXT_PGNO(prevp) = argp->pgno;
+		/*
+		 * If this was a compensating transaction and
+		 * we are a replica, then we never executed the
+		 * original allocation which incremented meta->free.
+		 */
+		if (prevp == NULL && meta->last_pgno < meta->free)
+			meta->last_pgno = meta->free;
+		LSN(meta) = *lsnp;
+	} else if (cmp_n == 0 && DB_UNDO(op)) {
+		/* Need to undo the deallocation. */
+		REC_DIRTY(mpf, &meta);
+		if (prevp == NULL)
+			meta->free = argp->next;
+		else
+			NEXT_PGNO(prevp) = argp->next;
+		LSN(meta) = argp->meta_lsn;
+		if (prevp == NULL && meta->last_pgno < argp->pgno)
+			meta->last_pgno = argp->pgno;
+	}
+
+check_meta:
+	if (ret != 0 && is_meta) {
+		/* The metadata page must always exist. */
+		ret = __db_pgerr(file_dbp, argp->meta_pgno, ret);
+		goto out;
+	}
+
+	/*
+	 * Get the freed page.  If we support truncate then don't
+	 * create the page if we are going to free it.  If we're
+	 * redoing the operation we get the page and explicitly discard
+	 * its contents, then update its LSN.  If we're undoing the
+	 * operation, we get the page and restore its header.
+	 * If we don't support truncate, then we must create the page
+	 * and roll it back.
+	 */
+	if ((ret =
+	    __memp_fget(mpf, &argp->pgno, NULL, DB_MPOOL_CREATE, &pagep)) != 0)
+		goto out;
+
+	(void)__ua_memcpy(©_lsn, &LSN(argp->header.data), sizeof(DB_LSN));
+	cmp_n = IS_ZERO_LSN(LSN(pagep)) ? 0 : LOG_COMPARE(lsnp, &LSN(pagep));
+	cmp_p = LOG_COMPARE(&LSN(pagep), ©_lsn);
+
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), ©_lsn);
+	if (DB_REDO(op) &&
+	    (cmp_p == 0 ||
+	    (IS_ZERO_LSN(copy_lsn) &&
+	    LOG_COMPARE(&LSN(pagep), &argp->meta_lsn) <= 0))) {
+		/* Need to redo the deallocation. */
+		REC_DIRTY(mpf, &pagep);
+		P_INIT(pagep, file_dbp->pgsize,
+		    argp->pgno, PGNO_INVALID, argp->next, 0, P_INVALID);
+		pagep->lsn = *lsnp;
+	} else if (cmp_n == 0 && DB_UNDO(op)) {
+		/* Need to reallocate the page. */
+		REC_DIRTY(mpf, &pagep);
+		memcpy(pagep, argp->header.data, argp->header.size);
+		if (data)
+			memcpy((u_int8_t*)pagep + HOFFSET(pagep),
+			     argp->data.data, argp->data.size);
+	}
+	if (pagep != NULL && (ret = __memp_fput(mpf, pagep, 0)) != 0)
+		goto out;
+
+	pagep = NULL;
+	if (meta != NULL && (ret = __memp_fput(mpf, meta, 0)) != 0)
+		goto out;
+	meta = NULL;
+
+	ret = 0;
+
+out:	if (pagep != NULL)
+		(void)__memp_fput(mpf, pagep, 0);
+	if (meta != NULL)
+		(void)__memp_fput(mpf, meta, 0);
+
+	return (ret);
+}
+
+/*
+ * __db_pg_free_42_recover --
+ *	Recovery function for pg_free.
+ *
+ * PUBLIC: int __db_pg_free_42_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_pg_free_42_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	__db_pg_free_42_args *argp;
+	int ret;
+
+	COMPQUIET(info, NULL);
+	REC_PRINT(__db_pg_free_42_print);
+	REC_INTRO(__db_pg_free_42_read, 1, 0);
+
+	ret = __db_pg_free_recover_42_int(dbenv,
+	     (__db_pg_freedata_42_args *)argp, file_dbp, lsnp, mpf, op, 0);
+
+done:	*lsnp = argp->prev_lsn;
+out:
+	REC_CLOSE;
+}
+
+/*
+ * __db_pg_freedata_42_recover --
+ *	Recovery function for pg_freedata.
+ *
+ * PUBLIC: int __db_pg_freedata_42_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_pg_freedata_42_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	__db_pg_freedata_42_args *argp;
+	int ret;
+
+	COMPQUIET(info, NULL);
+	REC_PRINT(__db_pg_freedata_42_print);
+	REC_INTRO(__db_pg_freedata_42_read, 1, 0);
+
+	ret = __db_pg_free_recover_42_int(
+	    dbenv, argp, file_dbp, lsnp, mpf, op, 1);
+
+done:	*lsnp = argp->prev_lsn;
+out:
+	REC_CLOSE;
+}
+
+/*
+ * __db_relink_42_recover --
+ *	Recovery function for relink.
+ *
+ * PUBLIC: int __db_relink_42_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_relink_42_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__db_relink_42_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	int cmp_n, cmp_p, modified, ret;
+
+	pagep = NULL;
+	COMPQUIET(info, NULL);
+	REC_PRINT(__db_relink_42_print);
+	REC_INTRO(__db_relink_42_read, 1, 0);
+
+	/*
+	 * There are up to three pages we need to check -- the page, and the
+	 * previous and next pages, if they existed.  For a page add operation,
+	 * the current page is the result of a split and is being recovered
+	 * elsewhere, so all we need do is recover the next page.
+	 */
+	if ((ret = __memp_fget(mpf, &argp->pgno, NULL, 0, &pagep)) != 0) {
+		if (DB_REDO(op)) {
+			ret = __db_pgerr(file_dbp, argp->pgno, ret);
+			goto out;
+		}
+		goto next2;
+	}
+	if (argp->opcode == DB_ADD_PAGE_COMPAT)
+		goto next1;
+
+	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn);
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Redo the relink. */
+		REC_DIRTY(mpf, &pagep);
+		pagep->lsn = *lsnp;
+	} else if (LOG_COMPARE(lsnp, &LSN(pagep)) == 0 && DB_UNDO(op)) {
+		/* Undo the relink. */
+		REC_DIRTY(mpf, &pagep);
+		pagep->next_pgno = argp->next;
+		pagep->prev_pgno = argp->prev;
+		pagep->lsn = argp->lsn;
+	}
+next1:	if ((ret = __memp_fput(mpf, pagep, 0)) != 0)
+		goto out;
+	pagep = NULL;
+
+next2:	if ((ret = __memp_fget(mpf, &argp->next, NULL, 0, &pagep)) != 0) {
+		if (DB_REDO(op)) {
+			ret = __db_pgerr(file_dbp, argp->next, ret);
+			goto out;
+		}
+		goto prev;
+	}
+	modified = 0;
+	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
+	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn_next);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn_next);
+	if ((argp->opcode == DB_REM_PAGE_COMPAT && cmp_p == 0 && DB_REDO(op)) ||
+	    (argp->opcode == DB_ADD_PAGE_COMPAT && cmp_n == 0 && DB_UNDO(op))) {
+		/* Redo the remove or undo the add. */
+		REC_DIRTY(mpf, &pagep);
+		pagep->prev_pgno = argp->prev;
+		modified = 1;
+	} else if ((argp->opcode == DB_REM_PAGE_COMPAT &&
+	    cmp_n == 0 && DB_UNDO(op)) ||
+	    (argp->opcode == DB_ADD_PAGE_COMPAT && cmp_p == 0 && DB_REDO(op))) {
+		/* Undo the remove or redo the add. */
+		REC_DIRTY(mpf, &pagep);
+		pagep->prev_pgno = argp->pgno;
+		modified = 1;
+	}
+	if (modified) {
+		if (DB_UNDO(op))
+			pagep->lsn = argp->lsn_next;
+		else
+			pagep->lsn = *lsnp;
+	}
+	if ((ret = __memp_fput(mpf, pagep, 0)) != 0)
+		goto out;
+	pagep = NULL;
+	if (argp->opcode == DB_ADD_PAGE_COMPAT)
+		goto done;
+
+prev:	if ((ret = __memp_fget(mpf, &argp->prev, NULL, 0, &pagep)) != 0) {
+		if (DB_REDO(op)) {
+			ret = __db_pgerr(file_dbp, argp->prev, ret);
+			goto out;
+		}
+		goto done;
+	}
+	modified = 0;
+	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn_prev);
+	CHECK_LSN(dbenv, op, cmp_p, &LSN(pagep), &argp->lsn_prev);
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Redo the relink. */
+		REC_DIRTY(mpf, &pagep);
+		pagep->next_pgno = argp->next;
+		modified = 1;
+	} else if (LOG_COMPARE(lsnp, &LSN(pagep)) == 0 && DB_UNDO(op)) {
+		/* Undo the relink. */
+		REC_DIRTY(mpf, &pagep);
+		pagep->next_pgno = argp->pgno;
+		modified = 1;
+	}
+	if (modified) {
+		if (DB_UNDO(op))
+			pagep->lsn = argp->lsn_prev;
+		else
+			pagep->lsn = *lsnp;
+	}
+	if ((ret = __memp_fput(mpf, pagep, 0)) != 0)
+		goto out;
+	pagep = NULL;
+
+done:	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	if (pagep != NULL)
+		(void)__memp_fput(mpf, pagep, 0);
+	REC_CLOSE;
+}
diff --git a/db/db/db_reclaim.c b/db/db/db_reclaim.c
index 4795b8caa..afa81f4bf 100644
--- a/db/db/db_reclaim.c
+++ b/db/db/db_reclaim.c
@@ -1,22 +1,16 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_reclaim.c,v 11.42 2004/06/10 04:46:44 ubell Exp $
+ * $Id: db_reclaim.c,v 12.8 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/btree.h"
 #include "dbinc/mp.h"
 
@@ -28,13 +22,14 @@
  * where did_put is a return value indicating if the page in question has
  * already been returned to the mpool.
  *
- * PUBLIC: int __db_traverse_big __P((DB *,
- * PUBLIC:     db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *));
+ * PUBLIC: int __db_traverse_big __P((DB *, db_pgno_t, DB_TXN *,
+ * PUBLIC:	int (*)(DB *, PAGE *, void *, int *), void *));
  */
 int
-__db_traverse_big(dbp, pgno, callback, cookie)
+__db_traverse_big(dbp, pgno, txn, callback, cookie)
 	DB *dbp;
 	db_pgno_t pgno;
+	DB_TXN *txn;
 	int (*callback) __P((DB *, PAGE *, void *, int *));
 	void *cookie;
 {
@@ -46,7 +41,7 @@ __db_traverse_big(dbp, pgno, callback, cookie)
 
 	do {
 		did_put = 0;
-		if ((ret = __memp_fget(mpf, &pgno, 0, &p)) != 0)
+		if ((ret = __memp_fget(mpf, &pgno, txn, 0, &p)) != 0)
 			return (ret);
 		/*
 		 * If we are freeing pages only process the overflow
@@ -88,7 +83,6 @@ __db_reclaim_callback(dbp, p, cookie, putp)
 	 * If we abort then the subdb may not be openable to undo
 	 * the free.
 	 */
-
 	if ((dbp->type == DB_BTREE || dbp->type == DB_RECNO) &&
 	    PGNO(p) == ((BTREE *)dbp->bt_internal)->bt_root)
 		return (0);
@@ -145,6 +139,8 @@ __db_truncate_callback(dbp, p, cookie, putp)
 		}
 		break;
 	case P_OVERFLOW:
+		if ((ret = __memp_dirty(mpf, &p, param->dbc->txn, 0)) != 0)
+			return (ret);
 		if (DBC_LOGGING(param->dbc)) {
 			if ((ret = __db_ovref_log(dbp, param->dbc->txn,
 			    &LSN(p), 0, p->pgno, -1, &LSN(p))) != 0)
@@ -202,15 +198,18 @@ __db_truncate_callback(dbp, p, cookie, putp)
 		if (PREV_PGNO(p) == PGNO_INVALID) {
 			type = P_HASH;
 
-reinit:			*putp = 0;
+reinit:			if ((ret =
+			    __memp_dirty(mpf, &p, param->dbc->txn, 0)) != 0)
+				return (ret);
+			*putp = 0;
 			if (DBC_LOGGING(param->dbc)) {
 				memset(&ldbt, 0, sizeof(ldbt));
 				memset(&ddbt, 0, sizeof(ddbt));
 				ldbt.data = p;
 				ldbt.size = P_OVERHEAD(dbp);
 				ldbt.size += p->entries * sizeof(db_indx_t);
-				ddbt.data = (u_int8_t *)p + p->hf_offset;
-				ddbt.size = dbp->pgsize - p->hf_offset;
+				ddbt.data = (u_int8_t *)p + HOFFSET(p);
+				ddbt.size = dbp->pgsize - HOFFSET(p);
 				if ((ret = __db_pg_init_log(dbp,
 				    param->dbc->txn, &LSN(p), 0,
 				    p->pgno, &ldbt, &ddbt)) != 0)
@@ -230,7 +229,7 @@ reinit:			*putp = 0;
 		if ((ret = __db_free(param->dbc, p)) != 0)
 			return (ret);
 	} else {
-		if ((ret = __memp_fput(mpf, p, DB_MPOOL_DIRTY)) != 0)
+		if ((ret = __memp_fput(mpf, p, 0)) != 0)
 			return (ret);
 		*putp = 1;
 	}
diff --git a/db/db/db_remove.c b/db/db/db_remove.c
index 5497c5e01..2201ec1e5 100644
--- a/db/db/db_remove.c
+++ b/db/db/db_remove.c
@@ -1,74 +1,85 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2001-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2001-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_remove.c,v 11.219 2004/09/16 17:55:17 margo Exp $
+ * $Id: db_remove.c,v 12.28 2006/09/19 15:06:58 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/fop.h"
 #include "dbinc/btree.h"
 #include "dbinc/hash.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/lock.h"
+#include "dbinc/mp.h"
+#include "dbinc/txn.h"
 
-static int __db_dbtxn_remove __P((DB *, DB_TXN *, const char *));
+static int __db_dbtxn_remove __P((DB *, DB_TXN *, const char *, const char *));
 static int __db_subdb_remove __P((DB *, DB_TXN *, const char *, const char *));
 
 /*
- * __dbenv_dbremove_pp
+ * __env_dbremove_pp
  *	DB_ENV->dbremove pre/post processing.
  *
- * PUBLIC: int __dbenv_dbremove_pp __P((DB_ENV *,
+ * PUBLIC: int __env_dbremove_pp __P((DB_ENV *,
  * PUBLIC:     DB_TXN *, const char *, const char *, u_int32_t));
  */
 int
-__dbenv_dbremove_pp(dbenv, txn, name, subdb, flags)
+__env_dbremove_pp(dbenv, txn, name, subdb, flags)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	const char *name, *subdb;
 	u_int32_t flags;
 {
 	DB *dbp;
+	DB_THREAD_INFO *ip;
 	int handle_check, ret, t_ret, txn_local;
 
+	dbp = NULL;
+	txn_local = 0;
+
 	PANIC_CHECK(dbenv);
 	ENV_ILLEGAL_BEFORE_OPEN(dbenv, "DB_ENV->dbremove");
 
-	/* Validate arguments. */
+	/*
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
+	 */
 	if ((ret = __db_fchk(dbenv, "DB->remove", flags, DB_AUTO_COMMIT)) != 0)
 		return (ret);
 
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __env_rep_enter(dbenv, 1)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
+
 	/*
 	 * Create local transaction as necessary, check for consistent
 	 * transaction usage.
 	 */
-	if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
+	if (IS_ENV_AUTO_COMMIT(dbenv, txn, flags)) {
 		if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
-			return (ret);
+			goto err;
 		txn_local = 1;
-	} else {
-		if (txn != NULL && !TXN_ON(dbenv))
-			return (__db_not_txn_env(dbenv));
-		txn_local = 0;
-	}
+	} else
+		if (txn != NULL && !TXN_ON(dbenv) &&
+		    (!CDB_LOCKING(dbenv) || !F_ISSET(txn, TXN_CDSGROUP))) {
+			ret = __db_not_txn_env(dbenv);
+			goto err;
+		}
+	LF_CLR(DB_AUTO_COMMIT);
 
 	if ((ret = db_create(&dbp, dbenv, 0)) != 0)
 		goto err;
 
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 1, txn != NULL)) != 0)
-		goto err;
-
 	ret = __db_remove_int(dbp, txn, name, subdb, flags);
 
 	if (txn_local) {
@@ -90,19 +101,27 @@ __dbenv_dbremove_pp(dbenv, txn, name, subdb, flags)
 		 dbp->lid = DB_LOCK_INVALIDID;
 	}
 
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
-
-err:	if (txn_local)
-		ret = __db_txn_auto_resolve(dbenv, txn, 0, ret);
+err:	if (txn_local && (t_ret =
+	    __db_txn_auto_resolve(dbenv, txn, 0, ret)) != 0 && ret == 0)
+		ret = t_ret;
 
 	/*
 	 * We never opened this dbp for real, so don't include a transaction
 	 * handle, and use NOSYNC to avoid calling into mpool.
+	 *
+	 * !!!
+	 * Note we're reversing the order of operations: we started the txn and
+	 * then opened the DB handle; we're resolving the txn and then closing
+	 * closing the DB handle -- it's safer.
 	 */
-	if ((t_ret = __db_close(dbp, NULL, DB_NOSYNC)) != 0 && ret == 0)
+	if (dbp != NULL &&
+	    (t_ret = __db_close(dbp, NULL, DB_NOSYNC)) != 0 && ret == 0)
+		ret = t_ret;
+
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
 		ret = t_ret;
 
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -120,7 +139,8 @@ __db_remove_pp(dbp, name, subdb, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
@@ -149,15 +169,21 @@ __db_remove_pp(dbp, name, subdb, flags)
 	if ((ret = __db_check_txn(dbp, NULL, DB_LOCK_INVALIDID, 0)) != 0)
 		return (ret);
 
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 1, 0)) != 0)
-		return (ret);
+	ENV_ENTER(dbenv, ip);
+
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __db_rep_enter(dbp, 1, 1, 0)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
 	/* Remove the file. */
 	ret = __db_remove(dbp, NULL, name, subdb, flags);
 
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
+
+err:	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -206,15 +232,23 @@ __db_remove_int(dbp, txn, name, subdb, flags)
 	dbenv = dbp->dbenv;
 	real_name = tmpname = NULL;
 
-	/* Handle subdatabase removes separately. */
-	if (subdb != NULL) {
+	if (name == NULL && subdb == NULL) {
+		__db_errx(dbenv, "Remove on temporary files invalid");
+		ret = EINVAL;
+		goto err;
+	}
+
+	if (name == NULL) {
+		MAKE_INMEM(dbp);
+		real_name = (char *)subdb;
+	} else if (subdb != NULL) {
 		ret = __db_subdb_remove(dbp, txn, name, subdb);
 		goto err;
 	}
 
 	/* Handle transactional file removes separately. */
-	if (txn != NULL) {
-		ret = __db_dbtxn_remove(dbp, txn, name);
+	if (IS_REAL_TXN(txn)) {
+		ret = __db_dbtxn_remove(dbp, txn, name, subdb);
 		goto err;
 	}
 
@@ -223,15 +257,16 @@ __db_remove_int(dbp, txn, name, subdb, flags)
 	 *
 	 * Find the real name of the file.
 	 */
-	if ((ret = __db_appname(dbenv,
-	    DB_APP_DATA, name, 0, NULL, &real_name)) != 0)
+	if (!F_ISSET(dbp, DB_AM_INMEM) && (ret =
+	    __db_appname(dbenv, DB_APP_DATA, name, 0, NULL, &real_name)) != 0)
 		goto err;
 
 	/*
-	 * If force is set, remove the temporary file.  Ignore errors because
-	 * the backup file might not exist.
+	 * If this is a file and force is set, remove the temporary file, which
+	 * may have been left around.  Ignore errors because the temporary file
+	 * might not exist.
 	 */
-	if (LF_ISSET(DB_FORCE) &&
+	if (!F_ISSET(dbp, DB_AM_INMEM) && LF_ISSET(DB_FORCE) &&
 	    (ret = __db_backup_name(dbenv, real_name, NULL, &tmpname)) == 0)
 		(void)__os_unlink(dbenv, tmpname);
 
@@ -242,10 +277,12 @@ __db_remove_int(dbp, txn, name, subdb, flags)
 	    (ret = dbp->db_am_remove(dbp, NULL, name, subdb)) != 0)
 		goto err;
 
-	ret = __fop_remove(dbenv, NULL, dbp->fileid, name, DB_APP_DATA,
+	ret = F_ISSET(dbp, DB_AM_INMEM) ?
+	    __db_inmem_remove(dbp, NULL, real_name) :
+	    __fop_remove(dbenv, NULL, dbp->fileid, name, DB_APP_DATA,
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE) ? DB_LOG_NOT_DURABLE : 0);
 
-err:	if (real_name != NULL)
+err:	if (!F_ISSET(dbp, DB_AM_INMEM) && real_name != NULL)
 		__os_free(dbenv, real_name);
 	if (tmpname != NULL)
 		__os_free(dbenv, tmpname);
@@ -253,6 +290,71 @@ err:	if (real_name != NULL)
 	return (ret);
 }
 
+/*
+ * __db_inmem_remove --
+ *	Removal of a named in-memory database.
+ *
+ * PUBLIC: int __db_inmem_remove __P((DB *, DB_TXN *, const char *));
+ */
+int
+__db_inmem_remove(dbp, txn, name)
+	DB *dbp;
+	DB_TXN *txn;
+	const char *name;
+{
+	DB_ENV *dbenv;
+	DB_LSN lsn;
+	DBT fid_dbt, name_dbt;
+	u_int32_t locker;
+	int ret;
+
+	dbenv = dbp->dbenv;
+	locker = DB_LOCK_INVALIDID;
+
+	DB_ASSERT(dbenv, name != NULL);
+
+	/* This had better exist if we are trying to do a remove. */
+	(void)__memp_set_flags(dbp->mpf, DB_MPOOL_NOFILE, 1);
+	if ((ret = __memp_fopen(dbp->mpf, NULL, name, 0, 0, 0)) != 0)
+		return (ret);
+	if ((ret = __memp_get_fileid(dbp->mpf, dbp->fileid)) != 0)
+		return (ret);
+	dbp->preserve_fid = 1;
+
+	if (LOCKING_ON(dbenv)) {
+		if (dbp->lid == DB_LOCK_INVALIDID &&
+		    (ret = __lock_id(dbenv, &dbp->lid, NULL)) != 0)
+			return (ret);
+		locker = txn == NULL ? dbp->lid : txn->txnid;
+	}
+
+	/*
+	 * In a transactional environment, we'll play the same game we play
+	 * for databases in the file system -- create a temporary database
+	 * and put it in with the current name and then rename this one to
+	 * another name.  We'll then use a commit-time event to remove the
+	 * entry.
+	 */
+	if ((ret =
+	    __fop_lock_handle(dbenv, dbp, locker, DB_LOCK_WRITE, NULL, 0)) != 0)
+		return (ret);
+
+	if (LOGGING_ON(dbenv)) {
+		if (txn != NULL && (ret =
+		    __txn_remevent(dbenv, txn, name, dbp->fileid, 1)) != 0)
+			return (ret);
+
+		DB_INIT_DBT(name_dbt, name, strlen(name) + 1);
+		DB_INIT_DBT(fid_dbt, dbp->fileid, DB_FILE_ID_LEN);
+		if ((ret = __crdel_inmem_remove_log(
+		    dbenv, txn, &lsn, 0, &name_dbt, &fid_dbt)) != 0)
+			return (ret);
+	}
+
+	return (!IS_REAL_TXN(txn) ?
+	    __memp_nameop(dbenv, dbp->fileid, NULL, name, NULL, 1) : 0);
+}
+
 /*
  * __db_subdb_remove --
  *	Remove a subdatabase.
@@ -323,10 +425,10 @@ err:
 }
 
 static int
-__db_dbtxn_remove(dbp, txn, name)
+__db_dbtxn_remove(dbp, txn, name, subdb)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name;
+	const char *name, *subdb;
 {
 	DB_ENV *dbenv;
 	int ret;
@@ -336,27 +438,32 @@ __db_dbtxn_remove(dbp, txn, name)
 	tmpname = NULL;
 
 	/*
-	 * This is a transactional rename, so we have to keep the name
+	 * This is a transactional remove, so we have to keep the name
 	 * of the file locked until the transaction commits.  As a result,
 	 * we implement remove by renaming the file to some other name
 	 * (which creates a dummy named file as a placeholder for the
 	 * file being rename/dremoved) and then deleting that file as
 	 * a delayed remove at commit.
 	 */
-	if ((ret = __db_backup_name(dbenv, name, txn, &tmpname)) != 0)
+	if ((ret = __db_backup_name(dbenv,
+	    F_ISSET(dbp, DB_AM_INMEM) ? subdb : name, txn, &tmpname)) != 0)
 		return (ret);
 
 	DB_TEST_RECOVERY(dbp, DB_TEST_PREDESTROY, ret, name);
 
-	if ((ret = __db_rename_int(dbp, txn, name, NULL, tmpname)) != 0)
+	if ((ret = __db_rename_int(dbp, txn, name, subdb, tmpname)) != 0)
 		goto err;
 
-	/* The internal removes will also translate into delayed removes. */
+	/*
+	 * The internal removes will also translate into delayed removes.
+	 */
 	if (dbp->db_am_remove != NULL &&
 	    (ret = dbp->db_am_remove(dbp, txn, tmpname, NULL)) != 0)
 		goto err;
 
-	ret = __fop_remove(dbenv, txn, dbp->fileid, tmpname, DB_APP_DATA,
+	ret = F_ISSET(dbp, DB_AM_INMEM) ?
+	     __db_inmem_remove(dbp, txn, tmpname) :
+	    __fop_remove(dbenv, txn, dbp->fileid, tmpname, DB_APP_DATA,
 	    F_ISSET(dbp, DB_AM_NOT_DURABLE) ? DB_LOG_NOT_DURABLE : 0);
 
 	DB_TEST_RECOVERY(dbp, DB_TEST_POSTDESTROY, ret, name);
diff --git a/db/db/db_rename.c b/db/db/db_rename.c
index 12f1f2276..e841542ca 100644
--- a/db/db/db_rename.c
+++ b/db/db/db_rename.c
@@ -1,96 +1,83 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2001-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2001-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_rename.c,v 11.216 2004/09/16 17:55:17 margo Exp $
+ * $Id: db_rename.c,v 12.20 2006/09/19 15:06:58 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/db_am.h"
 #include "dbinc/fop.h"
 #include "dbinc/lock.h"
 #include "dbinc/log.h"
 #include "dbinc/mp.h"
 
-static int __dbenv_dbrename __P((DB_ENV *,
-	       DB_TXN *, const char *, const char *, const char *, int));
 static int __db_subdb_rename __P((DB *,
 	       DB_TXN *, const char *, const char *, const char *));
 
 /*
- * __dbenv_dbrename_pp
+ * __env_dbrename_pp
  *	DB_ENV->dbrename pre/post processing.
  *
- * PUBLIC: int __dbenv_dbrename_pp __P((DB_ENV *, DB_TXN *,
+ * PUBLIC: int __env_dbrename_pp __P((DB_ENV *, DB_TXN *,
  * PUBLIC:     const char *, const char *, const char *, u_int32_t));
  */
 int
-__dbenv_dbrename_pp(dbenv, txn, name, subdb, newname, flags)
+__env_dbrename_pp(dbenv, txn, name, subdb, newname, flags)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	const char *name, *subdb, *newname;
 	u_int32_t flags;
 {
-	int ret, txn_local;
+	DB *dbp;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret, txn_local;
+
+	dbp = NULL;
+	txn_local = 0;
 
 	PANIC_CHECK(dbenv);
 	ENV_ILLEGAL_BEFORE_OPEN(dbenv, "DB_ENV->dbrename");
 
-	/* Validate arguments. */
+	/*
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
+	 */
 	if ((ret = __db_fchk(dbenv, "DB->rename", flags, DB_AUTO_COMMIT)) != 0)
 		return (ret);
 
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __env_rep_enter(dbenv, 1)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
+
 	/*
 	 * Create local transaction as necessary, check for consistent
 	 * transaction usage.
 	 */
-	if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
+	if (IS_ENV_AUTO_COMMIT(dbenv, txn, flags)) {
 		if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
-			return (ret);
+			goto err;
 		txn_local = 1;
-	} else {
-		if (txn != NULL && !TXN_ON(dbenv))
-			return (__db_not_txn_env(dbenv));
-		txn_local = 0;
-	}
-
-	ret = __dbenv_dbrename(dbenv, txn, name, subdb, newname, txn_local);
-
-	return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
-}
+	} else
+		if (txn != NULL && !TXN_ON(dbenv) &&
+		    (!CDB_LOCKING(dbenv) || !F_ISSET(txn, TXN_CDSGROUP))) {
+			ret = __db_not_txn_env(dbenv);
+			goto err;
+		}
 
-/*
- * __dbenv_dbrename
- *	DB_ENV->dbrename.
- */
-static int
-__dbenv_dbrename(dbenv, txn, name, subdb, newname, txn_local)
-	DB_ENV *dbenv;
-	DB_TXN *txn;
-	const char *name, *subdb, *newname;
-	int txn_local;
-{
-	DB *dbp;
-	int handle_check, ret, t_ret;
+	LF_CLR(DB_AUTO_COMMIT);
 
 	if ((ret = db_create(&dbp, dbenv, 0)) != 0)
-		return (ret);
-	if (txn != NULL)
-		F_SET(dbp, DB_AM_TXN);
-
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 1, txn != NULL)) != 0)
 		goto err;
 
 	ret = __db_rename_int(dbp, txn, name, subdb, newname);
@@ -105,22 +92,36 @@ __dbenv_dbrename(dbenv, txn, name, subdb, newname, txn_local)
 		dbp->lid = DB_LOCK_INVALIDID;
 	} else if (txn != NULL) {
 		/*
-		 * We created this handle locally so we need to close it
-		 * and clean it up.  Unfortunately, it's holding transactional
-		 * locks that need to persist until the end of transaction.
-		 * If we invalidate the locker id (dbp->lid), then the close
-		 * won't free these locks prematurely.
+		 * We created this handle locally so we need to close it and
+		 * clean it up.  Unfortunately, it's holding transactional
+		 * or CDS group locks that need to persist until the end of
+		 * transaction.  If we invalidate the locker id (dbp->lid),
+		 * then the close won't free these locks prematurely.
 		 */
 		 dbp->lid = DB_LOCK_INVALIDID;
 	}
 
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+err:	if (txn_local && (t_ret =
+	    __db_txn_auto_resolve(dbenv, txn, 0, ret)) != 0 && ret == 0)
+		ret = t_ret;
 
-err:
-	if ((t_ret = __db_close(dbp, txn, DB_NOSYNC)) != 0 && ret == 0)
+	/*
+	 * We never opened this dbp for real, so don't include a transaction
+	 * handle, and use NOSYNC to avoid calling into mpool.
+	 *
+	 * !!!
+	 * Note we're reversing the order of operations: we started the txn and
+	 * then opened the DB handle; we're resolving the txn and then closing
+	 * closing the DB handle -- it's safer.
+	 */
+	if (dbp != NULL &&
+	    (t_ret = __db_close(dbp, NULL, DB_NOSYNC)) != 0 && ret == 0)
+		ret = t_ret;
+
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
 		ret = t_ret;
 
+	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -138,7 +139,8 @@ __db_rename_pp(dbp, name, subdb, newname, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
 	handle_check = 0;
@@ -155,20 +157,20 @@ __db_rename_pp(dbp, name, subdb, newname, flags)
 	 * a database -- we'll destroy the handle, and the application won't
 	 * ever be able to close the database.
 	 */
-	if (F_ISSET(dbp, DB_AM_OPEN_CALLED)) {
-		ret = __db_mi_open(dbenv, "DB->rename", 1);
-		goto err;
-	}
+	if (F_ISSET(dbp, DB_AM_OPEN_CALLED))
+		return (__db_mi_open(dbenv, "DB->rename", 1));
 
 	/* Validate arguments. */
 	if ((ret = __db_fchk(dbenv, "DB->rename", flags, 0)) != 0)
-		goto err;
+		return (ret);
 
 	/* Check for consistent transaction usage. */
 	if ((ret = __db_check_txn(dbp, NULL, DB_LOCK_INVALIDID, 0)) != 0)
-		goto err;
+		return (ret);
+
+	ENV_ENTER(dbenv, ip);
 
-	handle_check = IS_REPLICATED(dbenv, dbp);
+	handle_check = IS_ENV_REPLICATED(dbenv);
 	if (handle_check && (ret = __db_rep_enter(dbp, 1, 1, 0)) != 0) {
 		handle_check = 0;
 		goto err;
@@ -177,9 +179,9 @@ __db_rename_pp(dbp, name, subdb, newname, flags)
 	/* Rename the file. */
 	ret = __db_rename(dbp, NULL, name, subdb, newname);
 
-err:	if (handle_check)
-		__env_db_rep_exit(dbenv);
-
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
+err:	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -222,26 +224,40 @@ __db_rename_int(dbp, txn, name, subdb, newname)
 {
 	DB_ENV *dbenv;
 	int ret;
-	char *real_name;
+	char *old, *real_name;
 
 	dbenv = dbp->dbenv;
 	real_name = NULL;
 
 	DB_TEST_RECOVERY(dbp, DB_TEST_PREDESTROY, ret, name);
 
-	if (subdb != NULL) {
+	if (name == NULL && subdb == NULL) {
+		__db_errx(dbenv, "Rename on temporary files invalid");
+		ret = EINVAL;
+		goto err;
+	}
+
+	if (name == NULL)
+		MAKE_INMEM(dbp);
+	else if (subdb != NULL) {
 		ret = __db_subdb_rename(dbp, txn, name, subdb, newname);
 		goto err;
 	}
 
 	/*
-	 * From here on down, this pertains to files.
+	 * From here on down, this pertains to files or in-memory databases.
 	 *
 	 * Find the real name of the file.
 	 */
-	if ((ret = __db_appname(dbenv,
-	    DB_APP_DATA, name, 0, NULL, &real_name)) != 0)
-		goto err;
+	if (F_ISSET(dbp, DB_AM_INMEM)) {
+		old = (char *)subdb;
+		real_name = (char *)subdb;
+	} else {
+		if ((ret = __db_appname(dbenv,
+		    DB_APP_DATA, name, 0, NULL, &real_name)) != 0)
+			goto err;
+		old = (char *)name;
+	}
 
 	if ((ret = __fop_remove_setup(dbp, txn, real_name, 0)) != 0)
 		goto err;
@@ -258,11 +274,11 @@ __db_rename_int(dbp, txn, name, subdb, newname)
 	 * create a temporary object as a placeholder.  This is all
 	 * taken care of in the fop layer.
 	 */
-	if (txn != NULL) {
-		if ((ret = __fop_dummy(dbp, txn, name, newname, 0)) != 0)
+	if (IS_REAL_TXN(txn)) {
+		if ((ret = __fop_dummy(dbp, txn, old, newname, 0)) != 0)
 			goto err;
 	} else {
-		if ((ret = __fop_dbrename(dbp, name, newname)) != 0)
+		if ((ret = __fop_dbrename(dbp, old, newname)) != 0)
 			goto err;
 	}
 
@@ -270,13 +286,13 @@ __db_rename_int(dbp, txn, name, subdb, newname)
 	 * I am pretty sure that we haven't gotten a dbreg id, so calling
 	 * dbreg_filelist_update is not necessary.
 	 */
-	DB_ASSERT(dbp->log_filename == NULL ||
+	DB_ASSERT(dbenv, dbp->log_filename == NULL ||
 	    dbp->log_filename->id == DB_LOGFILEID_INVALID);
 
 	DB_TEST_RECOVERY(dbp, DB_TEST_POSTDESTROY, ret, newname);
 
 DB_TEST_RECOVERY_LABEL
-err:	if (real_name != NULL)
+err:	if (!F_ISSET(dbp, DB_AM_INMEM) && real_name != NULL)
 		__os_free(dbenv, real_name);
 
 	return (ret);
@@ -320,7 +336,8 @@ __db_subdb_rename(dbp, txn, name, subdb, newname)
 	    MU_OPEN, NULL, 0)) != 0)
 		goto err;
 
-	if ((ret = __memp_fget(mdbp->mpf, &dbp->meta_pgno, 0, &meta)) != 0)
+	if ((ret = __memp_fget(mdbp->mpf, &dbp->meta_pgno,
+	    txn, 0, &meta)) != 0)
 		goto err;
 	memcpy(dbp->fileid, ((DBMETA *)meta)->uid, DB_FILE_ID_LEN);
 	if ((ret = __fop_lock_handle(dbenv,
diff --git a/db/db/db_ret.c b/db/db/db_ret.c
index 99421eccc..3de1776c6 100644
--- a/db/db/db_ret.c
+++ b/db/db/db_ret.c
@@ -1,20 +1,14 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_ret.c,v 11.26 2004/02/05 02:25:13 mjc Exp $
+ * $Id: db_ret.c,v 12.6 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
@@ -23,12 +17,13 @@
  * __db_ret --
  *	Build return DBT.
  *
- * PUBLIC: int __db_ret __P((DB *,
+ * PUBLIC: int __db_ret __P((DB *, DB_TXN *,
  * PUBLIC:    PAGE *, u_int32_t, DBT *, void **, u_int32_t *));
  */
 int
-__db_ret(dbp, h, indx, dbt, memp, memsize)
+__db_ret(dbp, txn, h, indx, dbt, memp, memsize)
 	DB *dbp;
+	DB_TXN *txn;
 	PAGE *h;
 	u_int32_t indx;
 	DBT *dbt;
@@ -47,7 +42,7 @@ __db_ret(dbp, h, indx, dbt, memp, memsize)
 		hk = P_ENTRY(dbp, h, indx);
 		if (HPAGE_PTYPE(hk) == H_OFFPAGE) {
 			memcpy(&ho, hk, sizeof(HOFFPAGE));
-			return (__db_goff(dbp, dbt,
+			return (__db_goff(dbp, txn, dbt,
 			    ho.tlen, ho.pgno, memp, memsize));
 		}
 		len = LEN_HKEYDATA(dbp, h, dbp->pgsize, indx);
@@ -59,7 +54,7 @@ __db_ret(dbp, h, indx, dbt, memp, memsize)
 		bk = GET_BKEYDATA(dbp, h, indx);
 		if (B_TYPE(bk->type) == B_OVERFLOW) {
 			bo = (BOVERFLOW *)bk;
-			return (__db_goff(dbp, dbt,
+			return (__db_goff(dbp, txn, dbt,
 			    bo->tlen, bo->pgno, memp, memsize));
 		}
 		len = bk->len;
@@ -118,17 +113,22 @@ __db_retcopy(dbenv, dbt, data, len, memp, memsize)
 	 * If the length we're going to copy is 0, the application-supplied
 	 * memory pointer is allowed to be NULL.
 	 */
-	if (F_ISSET(dbt, DB_DBT_MALLOC)) {
+	if (F_ISSET(dbt, DB_DBT_USERCOPY)) {
+		dbt->size = len;
+		return (len == 0 ? 0 : dbenv->dbt_usercopy(dbt, 0, data,
+		    len, DB_USERCOPY_SETDATA));
+
+	} else if (F_ISSET(dbt, DB_DBT_MALLOC))
 		ret = __os_umalloc(dbenv, len, &dbt->data);
-	} else if (F_ISSET(dbt, DB_DBT_REALLOC)) {
+	else if (F_ISSET(dbt, DB_DBT_REALLOC)) {
 		if (dbt->data == NULL || dbt->size == 0 || dbt->size < len)
 			ret = __os_urealloc(dbenv, len, &dbt->data);
 	} else if (F_ISSET(dbt, DB_DBT_USERMEM)) {
 		if (len != 0 && (dbt->data == NULL || dbt->ulen < len))
 			ret = DB_BUFFER_SMALL;
-	} else if (memp == NULL || memsize == NULL) {
+	} else if (memp == NULL || memsize == NULL)
 		ret = EINVAL;
-	} else {
+	else {
 		if (len != 0 && (*memsize == 0 || *memsize < len)) {
 			if ((ret = __os_realloc(dbenv, len, memp)) == 0)
 				*memsize = len;
diff --git a/db/db/db_setid.c b/db/db/db_setid.c
index fffba1c6d..3cbbb38ca 100644
--- a/db/db/db_setid.c
+++ b/db/db/db_setid.c
@@ -1,73 +1,142 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2000-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2000-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_setid.c,v 1.6 2004/09/24 13:41:08 bostic Exp $
+ * $Id: db_setid.c,v 12.16 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_swap.h"
 #include "dbinc/db_am.h"
+#include "dbinc/mp.h"
+
+static int __env_fileid_reset __P((DB_ENV *, const char *, int));
 
 /*
- * __db_fileid_reset --
- *	Reset the file IDs for every database in the file.
+ * __env_fileid_reset_pp --
+ *	DB_ENV->fileid_reset pre/post processing.
  *
- * PUBLIC: int __db_fileid_reset __P((DB_ENV *, char *, int));
+ * PUBLIC: int __env_fileid_reset_pp __P((DB_ENV *, const char *, u_int32_t));
  */
 int
-__db_fileid_reset(dbenv, name, passwd)
+__env_fileid_reset_pp(dbenv, name, flags)
 	DB_ENV *dbenv;
-	char *name;
-	int passwd;
+	const char *name;
+	u_int32_t flags;
+{
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
+
+	PANIC_CHECK(dbenv);
+	ENV_ILLEGAL_BEFORE_OPEN(dbenv, "DB_ENV->fileid_reset");
+
+	/*
+	 * !!!
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
+	 */
+	if (flags != 0 && flags != DB_ENCRYPT)
+		return (__db_ferr(dbenv, "DB_ENV->fileid_reset", 0));
+
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __env_rep_enter(dbenv, 1)) != 0)
+		goto err;
+
+	ret = __env_fileid_reset(dbenv, name, LF_ISSET(DB_ENCRYPT) ? 1 : 0);
+
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
+
+err:	ENV_LEAVE(dbenv, ip);
+	return (ret);
+}
+
+/*
+ * __env_fileid_reset --
+ *	Reset the file IDs for every database in the file.
+ */
+static int
+__env_fileid_reset(dbenv, name, encrypted)
+	DB_ENV *dbenv;
+	const char *name;
+	int encrypted;
 {
 	DB *dbp;
 	DBC *dbcp;
 	DBT key, data;
+	DB_FH *fhp;
 	DB_MPOOLFILE *mpf;
 	db_pgno_t pgno;
 	int t_ret, ret;
-	void *pagep;
+	size_t n;
 	char *real_name;
-	u_int8_t fileid[DB_FILE_ID_LEN];
+	u_int8_t fileid[DB_FILE_ID_LEN], mbuf[256];
+	void *pagep;
 
 	dbp = NULL;
 	dbcp = NULL;
+	fhp = NULL;
 	real_name = NULL;
 
 	/* Get the real backing file name. */
-	if ((ret = __db_appname(dbenv,
-	    DB_APP_DATA, name, 0, NULL, &real_name)) != 0)
+	if ((ret =
+	    __db_appname(dbenv, DB_APP_DATA, name, 0, NULL, &real_name)) != 0)
 		return (ret);
 
 	/* Get a new file ID. */
-	if ((ret = __os_fileid(dbenv, real_name, 1, fileid)) != 0) {
-		dbenv->err(dbenv, ret, "unable to get new file ID");
+	if ((ret = __os_fileid(dbenv, real_name, 1, fileid)) != 0)
 		goto err;
-	}
 
-	/* Create the DB object. */
-	if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
-		dbenv->err(dbenv, ret, "db_create");
+	/*
+	 * The user may have physically copied a file currently open in the
+	 * cache, which means if we open this file through the cache before
+	 * updating the file ID on page 0, we might connect to the file from
+	 * which the copy was made.
+	 *
+	 * !!!
+	 * This code depends on page 0 of the file not being encrypted.
+	 */
+	if ((ret = __os_open(dbenv, real_name, 0, 0, &fhp)) != 0)
+		goto err;
+	if ((ret = __os_read(dbenv, fhp, mbuf, sizeof(mbuf), &n)) != 0)
+		goto err;
+	if (n != sizeof(mbuf)) {
+		ret = EINVAL;
+		__db_errx(dbenv,
+		    "%s: unexpected file type or format", real_name);
 		goto err;
 	}
+	memcpy(((DBMETA *)mbuf)->uid, fileid, DB_FILE_ID_LEN);
+	if ((ret = __os_seek(dbenv, fhp, 0, 0, 0)) != 0)
+		goto err;
+	if ((ret = __os_write(dbenv, fhp, mbuf, 256, &n)) != 0)
+		goto err;
+	if ((ret = __os_fsync(dbenv, fhp)) != 0)
+		goto err;
+
+	/*
+	 * Page 0 of the file has an updated file ID, and we can open it in
+	 * the cache without connecting to a different, existing file.  Open
+	 * the file in the cache, and update the file IDs for subdatabases.
+	 * (No existing code, as far as I know, actually uses the file ID of
+	 * a subdatabase, but it's cleaner to get them all.)
+	 *
+	 * Create the DB object.
+	 */
+	if ((ret = db_create(&dbp, dbenv, 0)) != 0)
+		goto err;
 
 	/* If configured with a password, the databases are encrypted. */
-	if (passwd && (ret = dbp->set_flags(dbp, DB_ENCRYPT)) != 0) {
-		dbp->err(dbp, ret, "DB->set_flags: DB_ENCRYPT");
+	if (encrypted && (ret = __db_set_flags(dbp, DB_ENCRYPT)) != 0)
 		goto err;
-	}
 
 	/*
 	 * Open the DB file.
@@ -76,26 +145,9 @@ __db_fileid_reset(dbenv, name, passwd)
 	 * Note DB_RDWRMASTER flag, we need to open the master database file
 	 * for writing in this case.
 	 */
-	if ((ret = dbp->open(dbp,
-	    NULL, name, NULL, DB_UNKNOWN, DB_RDWRMASTER, 0)) != 0) {
-		dbp->err(dbp, ret, "DB->open: %s", name);
+	if ((ret = __db_open(dbp, NULL,
+	    name, NULL, DB_UNKNOWN, DB_RDWRMASTER, 0, PGNO_BASE_MD)) != 0)
 		goto err;
-	}
-
-	mpf = dbp->mpf;
-
-	pgno = PGNO_BASE_MD;
-	if ((ret = mpf->get(mpf, &pgno, 0, &pagep)) != 0) {
-		dbp->err(dbp, ret,
-		    "%s: DB_MPOOLFILE->get: %lu", name, (u_long)pgno);
-		goto err;
-	}
-	memcpy(((DBMETA *)pagep)->uid, fileid, DB_FILE_ID_LEN);
-	if ((ret = mpf->put(mpf, pagep, DB_MPOOL_DIRTY)) != 0) {
-		dbp->err(dbp, ret,
-		    "%s: DB_MPOOLFILE->put: %lu", name, (u_long)pgno);
-		goto err;
-	}
 
 	/*
 	 * If the database file doesn't support subdatabases, we only have
@@ -106,13 +158,12 @@ __db_fileid_reset(dbenv, name, passwd)
 	if (!F_ISSET(dbp, DB_AM_SUBDB))
 		goto err;
 
+	mpf = dbp->mpf;
 	memset(&key, 0, sizeof(key));
 	memset(&data, 0, sizeof(data));
-	if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) {
-		dbp->err(dbp, ret, "DB->cursor");
+	if ((ret = __db_cursor(dbp, NULL, &dbcp, 0)) != 0)
 		goto err;
-	}
-	while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0) {
+	while ((ret = __db_c_get(dbcp, &key, &data, DB_NEXT)) == 0) {
 		/*
 		 * XXX
 		 * We're handling actual data, not on-page meta-data, so it
@@ -121,33 +172,23 @@ __db_fileid_reset(dbenv, name, passwd)
 		 */
 		memcpy(&pgno, data.data, sizeof(db_pgno_t));
 		DB_NTOHL(&pgno);
-		if ((ret = mpf->get(mpf, &pgno, 0, &pagep)) != 0) {
-			dbp->err(dbp, ret,
-			    "%s: DB_MPOOLFILE->get: %lu", name, (u_long)pgno);
+		if ((ret = __memp_fget(mpf, &pgno, NULL,
+		    DB_MPOOL_DIRTY, &pagep)) != 0)
 			goto err;
-		}
 		memcpy(((DBMETA *)pagep)->uid, fileid, DB_FILE_ID_LEN);
-		if ((ret = mpf->put(mpf, pagep, DB_MPOOL_DIRTY)) != 0) {
-			dbp->err(dbp, ret,
-			    "%s: DB_MPOOLFILE->put: %lu", name, (u_long)pgno);
+		if ((ret = __memp_fput(mpf, pagep, 0)) != 0)
 			goto err;
-		}
 	}
 	if (ret == DB_NOTFOUND)
 		ret = 0;
-	else
-		dbp->err(dbp, ret, "DBcursor->get");
 
-err:	if (dbcp != NULL && (t_ret = dbcp->c_close(dbcp)) != 0) {
-		dbp->err(dbp, ret, "DBcursor->close");
-		if (ret == 0)
-			ret = t_ret;
-	}
-	if (dbp != NULL && (t_ret = dbp->close(dbp, 0)) != 0) {
-		dbenv->err(dbenv, ret, "DB->close");
-		if (ret == 0)
-			ret = t_ret;
-	}
+err:	if (dbcp != NULL && (t_ret = __db_c_close(dbcp)) != 0 && ret == 0)
+		ret = t_ret;
+	if (dbp != NULL && (t_ret = __db_close(dbp, NULL, 0)) != 0 && ret == 0)
+		ret = t_ret;
+	if (fhp != NULL &&
+	    (t_ret = __os_closehandle(dbenv, fhp)) != 0 && ret == 0)
+		ret = t_ret;
 	if (real_name != NULL)
 		__os_free(dbenv, real_name);
 
diff --git a/db/db/db_setlsn.c b/db/db/db_setlsn.c
index 5865798e5..acd4edfaa 100644
--- a/db/db/db_setlsn.c
+++ b/db/db/db_setlsn.c
@@ -1,35 +1,72 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2000-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2000-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_setlsn.c,v 1.2 2004/04/27 16:10:13 bostic Exp $
+ * $Id: db_setlsn.c,v 12.13 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
+#include "dbinc/mp.h"
+
+static int __env_lsn_reset __P((DB_ENV *, const char *, int));
 
 /*
- * __db_lsn_reset --
- *	Reset the LSNs for every page in the file.
+ * __env_lsn_reset_pp --
+ *	DB_ENV->lsn_reset pre/post processing.
  *
- * PUBLIC: int __db_lsn_reset __P((DB_ENV *, char *, int));
+ * PUBLIC: int __env_lsn_reset_pp __P((DB_ENV *, const char *, u_int32_t));
  */
 int
-__db_lsn_reset(dbenv, name, passwd)
+__env_lsn_reset_pp(dbenv, name, flags)
+	DB_ENV *dbenv;
+	const char *name;
+	u_int32_t flags;
+{
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
+
+	PANIC_CHECK(dbenv);
+	ENV_ILLEGAL_BEFORE_OPEN(dbenv, "DB_ENV->lsn_reset");
+
+	/*
+	 * !!!
+	 * The actual argument checking is simple, do it inline, outside of
+	 * the replication block.
+	 */
+	if (flags != 0 && flags != DB_ENCRYPT)
+		return (__db_ferr(dbenv, "DB_ENV->lsn_reset", 0));
+
+	ENV_ENTER(dbenv, ip);
+
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __env_rep_enter(dbenv, 1)) != 0)
+		goto err;
+
+	ret = __env_lsn_reset(dbenv, name, LF_ISSET(DB_ENCRYPT) ? 1 : 0);
+
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
+
+err:	ENV_LEAVE(dbenv, ip);
+	return (ret);
+}
+
+/*
+ * __env_lsn_reset --
+ *	Reset the LSNs for every page in the file.
+ */
+static int
+__env_lsn_reset(dbenv, name, encrypted)
 	DB_ENV *dbenv;
-	char *name;
-	int passwd;
+	const char *name;
+	int encrypted;
 {
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
@@ -38,16 +75,12 @@ __db_lsn_reset(dbenv, name, passwd)
 	int t_ret, ret;
 
 	/* Create the DB object. */
-	if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
-		dbenv->err(dbenv, ret, "db_create");
-		return (1);
-	}
+	if ((ret = db_create(&dbp, dbenv, 0)) != 0)
+		return (ret);
 
 	/* If configured with a password, the databases are encrypted. */
-	if (passwd && (ret = dbp->set_flags(dbp, DB_ENCRYPT)) != 0) {
-		dbp->err(dbp, ret, "DB->set_flags: DB_ENCRYPT");
+	if (encrypted && (ret = __db_set_flags(dbp, DB_ENCRYPT)) != 0)
 		goto err;
-	}
 
 	/*
 	 * Open the DB file.
@@ -56,28 +89,24 @@ __db_lsn_reset(dbenv, name, passwd)
 	 * Note DB_RDWRMASTER flag, we need to open the master database file
 	 * for writing in this case.
 	 */
-	if ((ret = dbp->open(dbp,
-	    NULL, name, NULL, DB_UNKNOWN, DB_RDWRMASTER, 0)) != 0) {
-		dbp->err(dbp, ret, "DB->open: %s", name);
+	if ((ret = __db_open(dbp, NULL,
+	    name, NULL, DB_UNKNOWN, DB_RDWRMASTER, 0, PGNO_BASE_MD)) != 0)
 		goto err;
-	}
 
 	/* Reset the LSN on every page of the database file. */
 	mpf = dbp->mpf;
-	for (pgno = 0; (ret = mpf->get(mpf, &pgno, 0, &pagep)) == 0; ++pgno) {
+	for (pgno = 0;
+	    (ret = __memp_fget(mpf, &pgno, NULL, DB_MPOOL_DIRTY, &pagep)) == 0;
+	    ++pgno) {
 		LSN_NOT_LOGGED(pagep->lsn);
-		if ((ret = mpf->put(mpf, pagep, DB_MPOOL_DIRTY)) != 0) {
-			dbp->err(dbp, ret, "DB_MPOOLFILE->put: %s", name);
+		if ((ret = __memp_fput(mpf, pagep, 0)) != 0)
 			goto err;
-		}
 	}
 
 	if (ret == DB_PAGE_NOTFOUND)
 		ret = 0;
-	else
-		dbp->err(dbp, ret, "DB_MPOOLFILE->get: %s", name);
 
-err:	if ((t_ret = dbp->close(dbp, 0)) != 0 && ret == 0)
+err:	if ((t_ret = __db_close(dbp, NULL, 0)) != 0 && ret == 0)
 		ret = t_ret;
-	return (ret == 0 ? 0 : 1);
+	return (ret);
 }
diff --git a/db/db/db_stati.c b/db/db/db_stati.c
index cd73b8ea4..2b1266717 100644
--- a/db/db/db_stati.c
+++ b/db/db/db_stati.c
@@ -1,38 +1,20 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_stati.c,v 11.123 2004/07/19 16:40:51 bostic Exp $
+ * $Id: db_stati.c,v 12.21 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#if TIME_WITH_SYS_TIME
-#include 
-#include 
-#else
-#if HAVE_SYS_TIME_H
-#include 
-#else
-#include 
-#endif
-#endif
-
-#include 
-#endif
-
 #include "db_int.h"
-
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/btree.h"
 #include "dbinc/hash.h"
 #include "dbinc/qam.h"
+#include "dbinc/lock.h"
 #include "dbinc/log.h"
 #include "dbinc/mp.h"
 
@@ -57,7 +39,8 @@ __db_stat_pp(dbp, txn, spp, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
@@ -67,17 +50,22 @@ __db_stat_pp(dbp, txn, spp, flags)
 	if ((ret = __db_stat_arg(dbp, flags)) != 0)
 		return (ret);
 
+	ENV_ENTER(dbenv, ip);
+
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0)
-		return (ret);
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
 	ret = __db_stat(dbp, txn, spp, flags);
 
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+err:	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -102,11 +90,11 @@ __db_stat(dbp, txn, spp, flags)
 
 	/* Acquire a cursor. */
 	if ((ret = __db_cursor(dbp, txn,
-	     &dbc, LF_ISSET(DB_DEGREE_2 | DB_DIRTY_READ))) != 0)
+	     &dbc, LF_ISSET(DB_READ_COMMITTED | DB_READ_UNCOMMITTED))) != 0)
 		return (ret);
 
 	DEBUG_LWRITE(dbc, NULL, "DB->stat", NULL, NULL, flags);
-	LF_CLR(DB_DEGREE_2 | DB_DIRTY_READ);
+	LF_CLR(DB_READ_COMMITTED | DB_READ_UNCOMMITTED);
 
 	switch (dbp->type) {
 	case DB_BTREE:
@@ -145,18 +133,11 @@ __db_stat_arg(dbp, flags)
 	dbenv = dbp->dbenv;
 
 	/* Check for invalid function flags. */
-	LF_CLR(DB_DEGREE_2 | DB_DIRTY_READ);
+	LF_CLR(DB_READ_COMMITTED | DB_READ_UNCOMMITTED);
 	switch (flags) {
 	case 0:
 	case DB_FAST_STAT:
-	case DB_CACHED_COUNTS:		/* Deprecated and undocumented. */
 		break;
-	case DB_RECORDCOUNT:		/* Deprecated and undocumented. */
-		if (dbp->type == DB_RECNO)
-			break;
-		if (dbp->type == DB_BTREE && F_ISSET(dbp, DB_AM_RECNUM))
-			break;
-		/* FALLTHROUGH */
 	default:
 		return (__db_ferr(dbenv, "DB->stat", 0));
 	}
@@ -176,7 +157,8 @@ __db_stat_print_pp(dbp, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
@@ -187,21 +169,26 @@ __db_stat_print_pp(dbp, flags)
 	 * !!!
 	 * The actual argument checking is simple, do it inline.
 	 */
-	if ((ret = __db_fchk(dbenv, "DB->stat_print",
-	    flags, DB_STAT_ALL | DB_STAT_CLEAR)) != 0)
+	if ((ret = __db_fchk(dbenv,
+	    "DB->stat_print", flags, DB_FAST_STAT | DB_STAT_ALL)) != 0)
 		return (ret);
 
+	ENV_ENTER(dbenv, ip);
+
 	/* Check for replication block. */
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0)
-		return (ret);
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
 
 	ret = __db_stat_print(dbp, flags);
 
 	/* Release replication block. */
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
+err:	ENV_LEAVE(dbenv, ip);
 	return (ret);
 }
 
@@ -216,17 +203,19 @@ __db_stat_print(dbp, flags)
 	DB *dbp;
 	u_int32_t flags;
 {
+	time_t now;
 	int ret;
+	char time_buf[CTIME_BUFLEN];
 
-	if (flags == 0 || LF_ISSET(DB_STAT_ALL)) {
-		ret = __db_print_stats(dbp, flags);
-		if (flags == 0 || ret != 0)
-			return (ret);
-	}
+	(void)time(&now);
+	__db_msg(dbp->dbenv, "%.24s\tLocal time", __db_ctime(&now, time_buf));
 
 	if (LF_ISSET(DB_STAT_ALL) && (ret = __db_print_all(dbp, flags)) != 0)
 		return (ret);
 
+	if ((ret = __db_print_stats(dbp, flags)) != 0)
+		return (ret);
+
 	return (0);
 }
 
@@ -284,40 +273,40 @@ __db_print_all(dbp, flags)
 	u_int32_t flags;
 {
 	static const FN fn[] = {
-		{ DB_AM_CHKSUM,		"DB_AM_CHKSUM" },
-		{ DB_AM_CL_WRITER,	"DB_AM_CL_WRITER" },
-		{ DB_AM_COMPENSATE,	"DB_AM_COMPENSATE" },
-		{ DB_AM_CREATED,	"DB_AM_CREATED" },
-		{ DB_AM_CREATED_MSTR,	"DB_AM_CREATED_MSTR" },
-		{ DB_AM_DBM_ERROR,	"DB_AM_DBM_ERROR" },
-		{ DB_AM_DELIMITER,	"DB_AM_DELIMITER" },
-		{ DB_AM_DIRTY,		"DB_AM_DIRTY" },
-		{ DB_AM_DISCARD,	"DB_AM_DISCARD" },
-		{ DB_AM_DUP,		"DB_AM_DUP" },
-		{ DB_AM_DUPSORT,	"DB_AM_DUPSORT" },
-		{ DB_AM_ENCRYPT,	"DB_AM_ENCRYPT" },
-		{ DB_AM_FIXEDLEN,	"DB_AM_FIXEDLEN" },
-		{ DB_AM_INMEM,		"DB_AM_INMEM" },
-		{ DB_AM_IN_RENAME,	"DB_AM_IN_RENAME" },
-		{ DB_AM_NOT_DURABLE,	"DB_AM_NOT_DURABLE" },
-		{ DB_AM_OPEN_CALLED,	"DB_AM_OPEN_CALLED" },
-		{ DB_AM_PAD,		"DB_AM_PAD" },
-		{ DB_AM_PGDEF,		"DB_AM_PGDEF" },
-		{ DB_AM_RDONLY,		"DB_AM_RDONLY" },
-		{ DB_AM_RECNUM,		"DB_AM_RECNUM" },
-		{ DB_AM_RECOVER,	"DB_AM_RECOVER" },
-		{ DB_AM_RENUMBER,	"DB_AM_RENUMBER" },
-		{ DB_AM_REPLICATION,	"DB_AM_REPLICATION" },
-		{ DB_AM_REVSPLITOFF,	"DB_AM_REVSPLITOFF" },
-		{ DB_AM_SECONDARY,	"DB_AM_SECONDARY" },
-		{ DB_AM_SNAPSHOT,	"DB_AM_SNAPSHOT" },
-		{ DB_AM_SUBDB,		"DB_AM_SUBDB" },
-		{ DB_AM_SWAP,		"DB_AM_SWAP" },
-		{ DB_AM_TXN,		"DB_AM_TXN" },
-		{ DB_AM_VERIFYING,	"DB_AM_VERIFYING" },
-		{ 0,			NULL }
+		{ DB_AM_CHKSUM,			"DB_AM_CHKSUM" },
+		{ DB_AM_CL_WRITER,		"DB_AM_CL_WRITER" },
+		{ DB_AM_COMPENSATE,		"DB_AM_COMPENSATE" },
+		{ DB_AM_CREATED,		"DB_AM_CREATED" },
+		{ DB_AM_CREATED_MSTR,		"DB_AM_CREATED_MSTR" },
+		{ DB_AM_DBM_ERROR,		"DB_AM_DBM_ERROR" },
+		{ DB_AM_DELIMITER,		"DB_AM_DELIMITER" },
+		{ DB_AM_DISCARD,		"DB_AM_DISCARD" },
+		{ DB_AM_DUP,			"DB_AM_DUP" },
+		{ DB_AM_DUPSORT,		"DB_AM_DUPSORT" },
+		{ DB_AM_ENCRYPT,		"DB_AM_ENCRYPT" },
+		{ DB_AM_FIXEDLEN,		"DB_AM_FIXEDLEN" },
+		{ DB_AM_INMEM,			"DB_AM_INMEM" },
+		{ DB_AM_IN_RENAME,		"DB_AM_IN_RENAME" },
+		{ DB_AM_NOT_DURABLE,		"DB_AM_NOT_DURABLE" },
+		{ DB_AM_OPEN_CALLED,		"DB_AM_OPEN_CALLED" },
+		{ DB_AM_PAD,			"DB_AM_PAD" },
+		{ DB_AM_PGDEF,			"DB_AM_PGDEF" },
+		{ DB_AM_RDONLY,			"DB_AM_RDONLY" },
+		{ DB_AM_READ_UNCOMMITTED,	"DB_AM_READ_UNCOMMITTED" },
+		{ DB_AM_RECNUM,			"DB_AM_RECNUM" },
+		{ DB_AM_RECOVER,		"DB_AM_RECOVER" },
+		{ DB_AM_RENUMBER,		"DB_AM_RENUMBER" },
+		{ DB_AM_REVSPLITOFF,		"DB_AM_REVSPLITOFF" },
+		{ DB_AM_SECONDARY,		"DB_AM_SECONDARY" },
+		{ DB_AM_SNAPSHOT,		"DB_AM_SNAPSHOT" },
+		{ DB_AM_SUBDB,			"DB_AM_SUBDB" },
+		{ DB_AM_SWAP,			"DB_AM_SWAP" },
+		{ DB_AM_TXN,			"DB_AM_TXN" },
+		{ DB_AM_VERIFYING,		"DB_AM_VERIFYING" },
+		{ 0,				NULL }
 	};
 	DB_ENV *dbenv;
+	char time_buf[CTIME_BUFLEN];
 
 	dbenv = dbp->dbenv;
 
@@ -331,7 +320,7 @@ __db_print_all(dbp, flags)
 	STAT_ISSET("DbEnv", dbp->dbenv);
 	STAT_STRING("Type", __db_dbtype_to_string(dbp->type));
 
-	__db_print_mutex(dbenv, NULL, dbp->mutexp, "Thread mutex", flags);
+	__mutex_print_debug_single(dbenv, "Thread mutex", dbp->mutex, flags);
 
 	STAT_STRING("File", dbp->fname);
 	STAT_STRING("Database", dbp->dname);
@@ -348,7 +337,7 @@ __db_print_all(dbp, flags)
 
 	__db_msg(dbenv,
 	    "%.24s\tReplication handle timestamp",
-	    dbp->timestamp == 0 ? "0" : ctime(&dbp->timestamp));
+	    dbp->timestamp == 0 ? "0" : __db_ctime(&dbp->timestamp, time_buf));
 
 	STAT_ISSET("Secondary callback", dbp->s_callback);
 	STAT_ISSET("Primary handle", dbp->s_primary);
@@ -389,23 +378,20 @@ __db_print_cursor(dbp)
 	__db_msg(dbenv, "DB handle cursors:");
 
 	ret = 0;
-	MUTEX_THREAD_LOCK(dbp->dbenv, dbp->mutexp);
+	MUTEX_LOCK(dbp->dbenv, dbp->mutex);
 	__db_msg(dbenv, "Active queue:");
-	for (dbc = TAILQ_FIRST(&dbp->active_queue);
-	    dbc != NULL; dbc = TAILQ_NEXT(dbc, links))
+	TAILQ_FOREACH(dbc, &dbp->active_queue, links)
 		if ((t_ret = __db_print_citem(dbc)) != 0 && ret == 0)
 			ret = t_ret;
 	__db_msg(dbenv, "Join queue:");
-	for (dbc = TAILQ_FIRST(&dbp->join_queue);
-	    dbc != NULL; dbc = TAILQ_NEXT(dbc, links))
+	TAILQ_FOREACH(dbc, &dbp->join_queue, links)
 		if ((t_ret = __db_print_citem(dbc)) != 0 && ret == 0)
 			ret = t_ret;
 	__db_msg(dbenv, "Free queue:");
-	for (dbc = TAILQ_FIRST(&dbp->free_queue);
-	    dbc != NULL; dbc = TAILQ_NEXT(dbc, links))
+	TAILQ_FOREACH(dbc, &dbp->free_queue, links)
 		if ((t_ret = __db_print_citem(dbc)) != 0 && ret == 0)
 			ret = t_ret;
-	MUTEX_THREAD_UNLOCK(dbp->dbenv, dbp->mutexp);
+	MUTEX_UNLOCK(dbp->dbenv, dbp->mutex);
 
 	return (ret);
 }
@@ -416,18 +402,18 @@ int __db_print_citem(dbc)
 {
 	static const FN fn[] = {
 		{ DBC_ACTIVE,		"DBC_ACTIVE" },
-		{ DBC_COMPENSATE,	"DBC_COMPENSATE" },
-		{ DBC_DEGREE_2,		"DBC_DEGREE_2" },
-		{ DBC_DIRTY_READ,	"DBC_DIRTY_READ" },
+		{ DBC_DONTLOCK,		"DBC_DONTLOCK" },
+		{ DBC_MULTIPLE,		"DBC_MULTIPLE" },
+		{ DBC_MULTIPLE_KEY,	"DBC_MULTIPLE_KEY" },
 		{ DBC_OPD,		"DBC_OPD" },
+		{ DBC_OWN_LID,		"DBC_OWN_LID" },
+		{ DBC_READ_COMMITTED,	"DBC_READ_COMMITTED" },
+		{ DBC_READ_UNCOMMITTED,	"DBC_READ_UNCOMMITTED" },
 		{ DBC_RECOVER,		"DBC_RECOVER" },
 		{ DBC_RMW,		"DBC_RMW" },
 		{ DBC_TRANSIENT,	"DBC_TRANSIENT" },
 		{ DBC_WRITECURSOR,	"DBC_WRITECURSOR" },
 		{ DBC_WRITER,		"DBC_WRITER" },
-		{ DBC_MULTIPLE,		"DBC_MULTIPLE" },
-		{ DBC_MULTIPLE_KEY,	"DBC_MULTIPLE_KEY" },
-		{ DBC_OWN_LID,		"DBC_OWN_LID" },
 		{ 0,			NULL }
 	};
 	DB *dbp;
@@ -438,16 +424,17 @@ int __db_print_citem(dbc)
 	dbenv = dbp->dbenv;
 	cp = dbc->internal;
 
-	STAT_HEX("DBC", dbc);
-	STAT_HEX("Associated dbp", dbc->dbp);
-	STAT_HEX("Associated txn", dbc->txn);
-	STAT_HEX("Internal", cp);
-	STAT_HEX("Default locker ID", dbc->lid);
+	STAT_POINTER("DBC", dbc);
+	STAT_POINTER("Associated dbp", dbc->dbp);
+	STAT_POINTER("Associated txn", dbc->txn);
+	STAT_POINTER("Internal", cp);
+	STAT_HEX("Default locker ID",
+	    dbc->lref == NULL ? 0 : ((DB_LOCKER *)dbc->lref)->id);
 	STAT_HEX("Locker", dbc->locker);
 	STAT_STRING("Type", __db_dbtype_to_string(dbc->dbtype));
 
-	STAT_HEX("Off-page duplicate cursor", cp->opd);
-	STAT_HEX("Referenced page", cp->page);
+	STAT_POINTER("Off-page duplicate cursor", cp->opd);
+	STAT_POINTER("Referenced page", cp->page);
 	STAT_ULONG("Root", cp->root);
 	STAT_ULONG("Page number", cp->pgno);
 	STAT_ULONG("Page index", cp->indx);
@@ -463,7 +450,7 @@ int __db_print_citem(dbc)
 		__ham_print_cursor(dbc);
 		break;
 	case DB_UNKNOWN:
-		DB_ASSERT(dbp->type != DB_UNKNOWN);
+		DB_ASSERT(dbenv, dbp->type != DB_UNKNOWN);
 		/* FALLTHROUGH */
 	case DB_QUEUE:
 	default:
diff --git a/db/db/db_truncate.c b/db/db/db_truncate.c
index 801f3712f..7e5e7124b 100644
--- a/db/db/db_truncate.c
+++ b/db/db/db_truncate.c
@@ -1,26 +1,21 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2001-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2001-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_truncate.c,v 11.201 2004/07/15 15:52:51 sue Exp $
+ * $Id: db_truncate.c,v 12.18 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/log.h"
 #include "dbinc/btree.h"
 #include "dbinc/hash.h"
 #include "dbinc/qam.h"
+#include "dbinc/lock.h"
+#include "dbinc/log.h"
 #include "dbinc/txn.h"
 
 static int __db_cursor_check __P((DB *));
@@ -38,57 +33,85 @@ __db_truncate_pp(dbp, txn, countp, flags)
 	u_int32_t *countp, flags;
 {
 	DB_ENV *dbenv;
-	int handle_check, ret, txn_local;
+	DB_THREAD_INFO *ip;
+	int handle_check, ret, t_ret, txn_local;
 
 	dbenv = dbp->dbenv;
+	txn_local = 0;
+	handle_check = 0;
 
 	PANIC_CHECK(dbenv);
+	STRIP_AUTO_COMMIT(flags);
 
 	/* Check for invalid flags. */
 	if (F_ISSET(dbp, DB_AM_SECONDARY)) {
-		__db_err(dbenv,
-		    "DBP->truncate forbidden on secondary indices");
+		__db_errx(dbenv,
+		    "DB->truncate forbidden on secondary indices");
 		return (EINVAL);
 	}
-	if ((ret =
-	    __db_fchk(dbenv, "DB->truncate", flags, DB_AUTO_COMMIT)) != 0)
+	if ((ret = __db_fchk(dbenv, "DB->truncate", flags, 0)) != 0)
 		return (ret);
 
+	ENV_ENTER(dbenv, ip);
+
 	/*
 	 * Make sure there are no active cursors on this db.  Since we drop
 	 * pages we cannot really adjust cursors.
 	 */
 	if (__db_cursor_check(dbp) != 0) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		     "DB->truncate not permitted with active cursors");
-		return (EINVAL);
+		goto err;
+	}
+
+#ifdef CONFIG_TEST
+	if (IS_REP_MASTER(dbenv))
+		DB_TEST_WAIT(dbenv, dbenv->test_check);
+#endif
+	/* Check for replication block. */
+	handle_check = IS_ENV_REPLICATED(dbenv);
+	if (handle_check &&
+	    (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
+		handle_check = 0;
+		goto err;
+	}
+
+	/*
+	 * Check for changes to a read-only database.
+	 * This must be after the replication block so that we
+	 * cannot race master/client state changes.
+	 */
+	if (DB_IS_READONLY(dbp)) {
+		ret = __db_rdonly(dbenv, "DB->truncate");
+		goto err;
 	}
 
 	/*
 	 * Create local transaction as necessary, check for consistent
 	 * transaction usage.
 	 */
-	txn_local = 0;
-	if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
-		if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
+	if (IS_DB_AUTO_COMMIT(dbp, txn)) {
+		if ((ret = __txn_begin(dbenv, NULL, &txn, 0)) != 0)
 			goto err;
 		txn_local = 1;
-		LF_CLR(DB_AUTO_COMMIT);
-	} else if (txn != NULL && !TXN_ON(dbenv)) {
-		ret = __db_not_txn_env(dbenv);
-		return (ret);
 	}
 
-	handle_check = IS_REPLICATED(dbenv, dbp);
-	if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
+	/* Check for consistent transaction usage. */
+	if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0)
 		goto err;
 
 	ret = __db_truncate(dbp, txn, countp);
 
-	if (handle_check)
-		__env_db_rep_exit(dbenv);
+err:	if (txn_local &&
+	    (t_ret = __db_txn_auto_resolve(dbenv, txn, 0, ret)) && ret == 0)
+		ret = t_ret;
+
+	/* Release replication block. */
+	if (handle_check && (t_ret = __env_db_rep_exit(dbenv)) != 0 && ret == 0)
+		ret = t_ret;
 
-err:	return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
+	ENV_LEAVE(dbenv, ip);
+	return (ret);
 }
 
 /*
@@ -119,8 +142,9 @@ __db_truncate(dbp, txn, countp)
 	 * processing to truncate so it will update the secondaries normally.
 	 */
 	if (dbp->type != DB_QUEUE && LIST_FIRST(&dbp->s_secondaries) != NULL) {
-		for (sdbp = __db_s_first(dbp);
-		    sdbp != NULL && ret == 0; ret = __db_s_next(&sdbp))
+		if ((ret = __db_s_first(dbp, &sdbp)) != 0)
+			return (ret);
+		for (; sdbp != NULL && ret == 0; ret = __db_s_next(&sdbp))
 			if ((ret = __db_truncate(sdbp, txn, &scount)) != 0)
 				break;
 		if (sdbp != NULL)
@@ -180,23 +204,22 @@ __db_cursor_check(dbp)
 
 	dbenv = dbp->dbenv;
 
-	MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp);
-	for (found = 0, ldbp = __dblist_get(dbenv, dbp->adj_fileid);
+	MUTEX_LOCK(dbenv, dbenv->mtx_dblist);
+	FIND_FIRST_DB_MATCH(dbenv, dbp, ldbp);
+	for (found = 0;
 	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
-	    ldbp = LIST_NEXT(ldbp, dblistlinks)) {
-		MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
-		for (dbc = TAILQ_FIRST(&ldbp->active_queue);
-		    dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) {
+	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
+		MUTEX_LOCK(dbenv, dbp->mutex);
+		TAILQ_FOREACH(dbc, &ldbp->active_queue, links)
 			if (IS_INITIALIZED(dbc)) {
 				found = 1;
 				break;
 			}
-		}
-		MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp);
+		MUTEX_UNLOCK(dbenv, dbp->mutex);
 		if (found == 1)
 			break;
 	}
-	MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp);
+	MUTEX_UNLOCK(dbenv, dbenv->mtx_dblist);
 
 	return (found);
 }
diff --git a/db/db/db_upg.c b/db/db/db_upg.c
index a41a1c49d..bb7107648 100644
--- a/db/db/db_upg.c
+++ b/db/db/db_upg.c
@@ -1,20 +1,14 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_upg.c,v 11.35 2004/03/24 20:37:35 bostic Exp $
+ * $Id: db_upg.c,v 12.8 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_swap.h"
@@ -41,6 +35,7 @@ static int (* const func_31_list[P_PAGETYPE_MAX])
 
 static int __db_page_pass __P((DB *, char *, u_int32_t, int (* const [])
 	       (DB *, char *, u_int32_t, DB_FH *, PAGE *, int *), DB_FH *));
+static int __db_set_lastpgno __P((DB *, char *, DB_FH *));
 
 /*
  * __db_upgrade_pp --
@@ -100,7 +95,7 @@ __db_upgrade(dbp, fname, flags)
 
 	/* Open the file. */
 	if ((ret = __os_open(dbenv, real_name, 0, 0, &fhp)) != 0) {
-		__db_err(dbenv, "%s: %s", real_name, db_strerror(ret));
+		__db_err(dbenv, ret, "%s", real_name);
 		return (ret);
 	}
 
@@ -126,8 +121,7 @@ __db_upgrade(dbp, fname, flags)
 			if ((ret =
 			    __bam_30_btreemeta(dbp, real_name, mbuf)) != 0)
 				goto err;
-			if ((ret = __os_seek(dbenv,
-			    fhp, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0)
+			if ((ret = __os_seek(dbenv, fhp, 0, 0, 0)) != 0)
 				goto err;
 			if ((ret = __os_write(dbenv, fhp, mbuf, 256, &n)) != 0)
 				goto err;
@@ -144,10 +138,14 @@ __db_upgrade(dbp, fname, flags)
 				goto err;
 			/* FALLTHROUGH */
 		case 8:
+			if ((ret =
+			     __db_set_lastpgno(dbp, real_name, fhp)) != 0)
+				goto err;
+			/* FALLTHROUGH */
 		case 9:
 			break;
 		default:
-			__db_err(dbenv, "%s: unsupported btree version: %lu",
+			__db_errx(dbenv, "%s: unsupported btree version: %lu",
 			    real_name, (u_long)((DBMETA *)mbuf)->version);
 			ret = DB_OLD_VERSION;
 			goto err;
@@ -164,8 +162,7 @@ __db_upgrade(dbp, fname, flags)
 			if ((ret =
 			    __ham_30_hashmeta(dbp, real_name, mbuf)) != 0)
 				goto err;
-			if ((ret = __os_seek(dbenv,
-			    fhp, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0)
+			if ((ret = __os_seek(dbenv, fhp, 0, 0, 0)) != 0)
 				goto err;
 			if ((ret = __os_write(dbenv, fhp, mbuf, 256, &n)) != 0)
 				goto err;
@@ -201,10 +198,14 @@ __db_upgrade(dbp, fname, flags)
 				goto err;
 			/* FALLTHROUGH */
 		case 7:
+			if ((ret =
+			     __db_set_lastpgno(dbp, real_name, fhp)) != 0)
+				goto err;
+			/* FALLTHROUGH */
 		case 8:
 			break;
 		default:
-			__db_err(dbenv, "%s: unsupported hash version: %lu",
+			__db_errx(dbenv, "%s: unsupported hash version: %lu",
 			    real_name, (u_long)((DBMETA *)mbuf)->version);
 			ret = DB_OLD_VERSION;
 			goto err;
@@ -224,8 +225,7 @@ __db_upgrade(dbp, fname, flags)
 		case 2:
 			if ((ret = __qam_32_qammeta(dbp, real_name, mbuf)) != 0)
 				return (ret);
-			if ((ret = __os_seek(dbenv,
-			    fhp, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0)
+			if ((ret = __os_seek(dbenv, fhp, 0, 0, 0)) != 0)
 				goto err;
 			if ((ret = __os_write(dbenv, fhp, mbuf, 256, &n)) != 0)
 				goto err;
@@ -234,7 +234,7 @@ __db_upgrade(dbp, fname, flags)
 		case 4:
 			break;
 		default:
-			__db_err(dbenv, "%s: unsupported queue version: %lu",
+			__db_errx(dbenv, "%s: unsupported queue version: %lu",
 			    real_name, (u_long)((DBMETA *)mbuf)->version);
 			ret = DB_OLD_VERSION;
 			goto err;
@@ -246,12 +246,12 @@ __db_upgrade(dbp, fname, flags)
 		case DB_BTREEMAGIC:
 		case DB_HASHMAGIC:
 		case DB_QAMMAGIC:
-			__db_err(dbenv,
+			__db_errx(dbenv,
 		"%s: DB->upgrade only supported on native byte-order systems",
 			    real_name);
 			break;
 		default:
-			__db_err(dbenv,
+			__db_errx(dbenv,
 			    "%s: unrecognized file type", real_name);
 			break;
 		}
@@ -307,8 +307,7 @@ __db_page_pass(dbp, real_name, flags, fl, fhp)
 		if (dbp->db_feedback != NULL)
 			dbp->db_feedback(
 			    dbp, DB_UPGRADE, (int)((i * 100)/pgno_last));
-		if ((ret = __os_seek(dbenv,
-		    fhp, dbp->pgsize, i, 0, 0, DB_OS_SEEK_SET)) != 0)
+		if ((ret = __os_seek(dbenv, fhp, i, dbp->pgsize, 0)) != 0)
 			break;
 		if ((ret = __os_read(dbenv, fhp, page, dbp->pgsize, &n)) != 0)
 			break;
@@ -317,8 +316,8 @@ __db_page_pass(dbp, real_name, flags, fl, fhp)
 		    (dbp, real_name, flags, fhp, page, &dirty)) != 0)
 			break;
 		if (dirty) {
-			if ((ret = __os_seek(dbenv,
-			    fhp, dbp->pgsize, i, 0, 0, DB_OS_SEEK_SET)) != 0)
+			if ((ret =
+			    __os_seek(dbenv, fhp, i, dbp->pgsize, 0)) != 0)
 				break;
 			if ((ret = __os_write(dbenv,
 			    fhp, page, dbp->pgsize, &n)) != 0)
@@ -352,13 +351,13 @@ __db_lastpgno(dbp, real_name, fhp, pgno_lastp)
 
 	if ((ret = __os_ioinfo(dbenv,
 	    real_name, fhp, &mbytes, &bytes, NULL)) != 0) {
-		__db_err(dbenv, "%s: %s", real_name, db_strerror(ret));
+		__db_err(dbenv, ret, "%s", real_name);
 		return (ret);
 	}
 
 	/* Page sizes have to be a power-of-two. */
 	if (bytes % dbp->pgsize != 0) {
-		__db_err(dbenv,
+		__db_errx(dbenv,
 		    "%s: file size not a multiple of the pagesize", real_name);
 		return (EINVAL);
 	}
@@ -368,3 +367,36 @@ __db_lastpgno(dbp, real_name, fhp, pgno_lastp)
 	*pgno_lastp = pgno_last;
 	return (0);
 }
+
+/*
+ * __db_set_lastpgno --
+ *	Update the meta->last_pgno field.
+ *
+ * Code assumes that we do not have checksums/crypto on the page.
+ */
+static int
+__db_set_lastpgno(dbp, real_name, fhp)
+	DB *dbp;
+	char *real_name;
+	DB_FH *fhp;
+{
+	DB_ENV *dbenv;
+	DBMETA meta;
+	int ret;
+	size_t n;
+
+	dbenv = dbp->dbenv;
+	if ((ret = __os_seek(dbenv, fhp, 0, 0, 0)) != 0)
+		return (ret);
+	if ((ret = __os_read(dbenv, fhp, &meta, sizeof(meta), &n)) != 0)
+		return (ret);
+	dbp->pgsize = meta.pagesize;
+	if ((ret = __db_lastpgno(dbp, real_name, fhp, &meta.last_pgno)) != 0)
+		return (ret);
+	if ((ret = __os_seek(dbenv, fhp, 0, 0, 0)) != 0)
+		return (ret);
+	if ((ret = __os_write(dbenv, fhp, &meta, sizeof(meta), &n)) != 0)
+		return (ret);
+
+	return (0);
+}
diff --git a/db/db/db_upg_opd.c b/db/db/db_upg_opd.c
index fcae089ad..41dec2696 100644
--- a/db/db/db_upg_opd.c
+++ b/db/db/db_upg_opd.c
@@ -1,20 +1,14 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_upg_opd.c,v 11.21 2004/03/19 16:10:26 bostic Exp $
+ * $Id: db_upg_opd.c,v 12.7 2006/08/24 14:45:16 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/btree.h"
@@ -24,16 +18,16 @@ static int __db_build_ri __P((DB *, DB_FH *, PAGE *, PAGE *, u_int32_t, int *));
 static int __db_up_ovref __P((DB *, DB_FH *, db_pgno_t));
 
 #define	GET_PAGE(dbp, fhp, pgno, page) {				\
-	if ((ret = __os_seek(dbp->dbenv,				\
-	    fhp, (dbp)->pgsize, pgno, 0, 0, DB_OS_SEEK_SET)) != 0)	\
+	if ((ret = __os_seek(						\
+	    dbp->dbenv, fhp, pgno, (dbp)->pgsize, 0)) != 0)		\
 		goto err;						\
 	if ((ret = __os_read(dbp->dbenv,				\
 	    fhp, page, (dbp)->pgsize, &n)) != 0)			\
 		goto err;						\
 }
 #define	PUT_PAGE(dbp, fhp, pgno, page) {				\
-	if ((ret = __os_seek(dbp->dbenv,				\
-	    fhp, (dbp)->pgsize, pgno, 0, 0, DB_OS_SEEK_SET)) != 0)	\
+	if ((ret = __os_seek(						\
+	    dbp->dbenv, fhp, pgno, (dbp)->pgsize, 0)) != 0)		\
 		goto err;						\
 	if ((ret = __os_write(dbp->dbenv,				\
 	    fhp, page, (dbp)->pgsize, &n)) != 0)			\
@@ -224,7 +218,7 @@ __db_build_bi(dbp, fhp, ipage, page, indx, nomemp)
 		p = P_ENTRY(dbp, ipage, indx);
 
 		bi.len = child_bi->len;
-		B_TSET(bi.type, child_bi->type, 0);
+		B_TSET(bi.type, child_bi->type);
 		bi.pgno = PGNO(page);
 		bi.nrecs = __bam_total(dbp, page);
 		memcpy(p, &bi, SSZA(BINTERNAL, data));
@@ -251,7 +245,7 @@ __db_build_bi(dbp, fhp, ipage, page, indx, nomemp)
 			p = P_ENTRY(dbp, ipage, indx);
 
 			bi.len = child_bk->len;
-			B_TSET(bi.type, child_bk->type, 0);
+			B_TSET(bi.type, child_bk->type);
 			bi.pgno = PGNO(page);
 			bi.nrecs = __bam_total(dbp, page);
 			memcpy(p, &bi, SSZA(BINTERNAL, data));
@@ -269,7 +263,7 @@ __db_build_bi(dbp, fhp, ipage, page, indx, nomemp)
 			p = P_ENTRY(dbp, ipage, indx);
 
 			bi.len = BOVERFLOW_SIZE;
-			B_TSET(bi.type, child_bk->type, 0);
+			B_TSET(bi.type, child_bk->type);
 			bi.pgno = PGNO(page);
 			bi.nrecs = __bam_total(dbp, page);
 			memcpy(p, &bi, SSZA(BINTERNAL, data));
diff --git a/db/db/db_vrfy.c b/db/db/db_vrfy.c
index d0cd22b6a..f502c35a9 100644
--- a/db/db/db_vrfy.c
+++ b/db/db/db_vrfy.c
@@ -1,23 +1,16 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2000-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2000-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_vrfy.c,v 1.138 2004/10/11 18:47:50 bostic Exp $
+ * $Id: db_vrfy.c,v 12.29 2006/09/07 20:05:26 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/db_swap.h"
 #include "dbinc/db_verify.h"
 #include "dbinc/btree.h"
@@ -120,26 +113,11 @@ __db_verify_internal(dbp, fname, dname, handle, callback, flags)
 		LF_SET(DB_UNREF);
 #endif
 
-	if ((ret = __db_verify_arg(dbp, dname, handle, flags)) != 0)
-		goto err;
-
-	/*
-	 * Forbid working in an environment that uses transactions or
-	 * locking;  we're going to be looking at the file freely,
-	 * and while we're not going to modify it, we aren't obeying
-	 * locking conventions either.
-	 */
-	if (TXN_ON(dbenv) || LOCKING_ON(dbenv) || LOGGING_ON(dbenv)) {
-		__db_err(dbenv,
-    "DB->verify may not be used with transactions, logging, or locking");
-		ret = EINVAL;
-		goto err;
-	}
-
-	ret = __db_verify(dbp, fname, dname, handle, callback, flags);
+	if ((ret = __db_verify_arg(dbp, dname, handle, flags)) == 0)
+		ret = __db_verify(dbp, fname, dname, handle, callback, flags);
 
 	/* Db.verify is a DB handle destructor. */
-err:	if ((t_ret = __db_close(dbp, NULL, 0)) != 0 && ret == 0)
+	if ((t_ret = __db_close(dbp, NULL, 0)) != 0 && ret == 0)
 		ret = t_ret;
 
 	return (ret);
@@ -176,7 +154,7 @@ __db_verify_arg(dbp, dname, handle, flags)
 		if (LF_ISSET(~(DB_AGGRESSIVE | DB_PRINTABLE | DB_SALVAGE)))
 			return (__db_ferr(dbenv, "DB->verify", 1));
 		if (handle == NULL) {
-			__db_err(dbenv,
+			__db_errx(dbenv,
 			    "DB_SALVAGE requires a an output handle");
 			return (EINVAL);
 		}
@@ -184,7 +162,7 @@ __db_verify_arg(dbp, dname, handle, flags)
 		if (LF_ISSET(DB_AGGRESSIVE | DB_PRINTABLE))
 			return (__db_ferr(dbenv, "DB->verify", 1));
 
-	/* 
+	/*
 	 * DB_ORDERCHKONLY is mutually exclusive with DB_SALVAGE and
 	 * DB_NOORDERCHK, and requires a database name.
 	 */
@@ -192,7 +170,7 @@ __db_verify_arg(dbp, dname, handle, flags)
 	    DB_ORDERCHKONLY, DB_SALVAGE | DB_NOORDERCHK)) != 0)
 		return (ret);
 	if (LF_ISSET(DB_ORDERCHKONLY) && dname == NULL) {
-		__db_err(dbenv, "DB_ORDERCHKONLY requires a database name");
+		__db_errx(dbenv, "DB_ORDERCHKONLY requires a database name");
 		return (EINVAL);
 	}
 	return (0);
@@ -223,14 +201,14 @@ __db_verify(dbp, name, subdb, handle, callback, flags)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
 	VRFY_DBINFO *vdp;
-	int has, isbad, ret, t_ret;
+	int has_subdbs, isbad, ret, t_ret;
 	char *real_name;
 
 	dbenv = dbp->dbenv;
 	fhp = NULL;
 	vdp = NULL;
 	real_name = NULL;
-	has = ret = isbad = 0;
+	has_subdbs = isbad = ret = 0;
 
 	F_SET(dbp, DB_AM_VERIFYING);
 
@@ -298,8 +276,8 @@ __db_verify(dbp, name, subdb, handle, callback, flags)
 	 * and the mpool--manually.
 	 */
 	if ((ret = __db_dbenv_setup(dbp, NULL,
-	    name, TXN_INVALID, DB_ODDFILESIZE | DB_RDONLY)) != 0)
-		return (ret);
+	    name, subdb, TXN_INVALID, DB_ODDFILESIZE | DB_RDONLY)) != 0)
+		goto err;
 
 	/*
 	 * Set our name in the Queue subsystem;  we may need it later
@@ -307,13 +285,14 @@ __db_verify(dbp, name, subdb, handle, callback, flags)
 	 */
 	if (dbp->type == DB_QUEUE &&
 	    (ret = __qam_set_ext_data(dbp, name)) != 0)
-		return (ret);
+		goto err;
 
 	/* Mark the dbp as opened, so that we correctly handle its close. */
 	F_SET(dbp, DB_AM_OPEN_CALLED);
 
 	/* Find out the page number of the last page in the database. */
-	__memp_last_pgno(dbp->mpf, &vdp->last_pgno);
+	if ((ret = __memp_last_pgno(dbp->mpf, &vdp->last_pgno)) != 0)
+		goto err;
 
 	/*
 	 * DB_ORDERCHKONLY is a special case;  our file consists of
@@ -337,27 +316,25 @@ __db_verify(dbp, name, subdb, handle, callback, flags)
 	 */
 	if (LF_ISSET(DB_SALVAGE)) {
 		if ((ret = __db_salvage_init(vdp)) != 0)
-			return (ret);
+			goto err;
 
 		/*
-		 * If we're not being aggressive, attempt to crack subdbs.
-		 * "has" will indicate whether the attempt has succeeded
+		 * If we're not being aggressive, attempt to crack subdatabases.
+		 * "has_subdbs" will indicate whether the attempt has succeeded
 		 * (even in part), meaning that we have some semblance of
-		 * subdbs;  on the walkpages pass, we print out
-		 * whichever data pages we have not seen.
+		 * subdatabases; on the walkpages pass, we print out whichever
+		 * data pages we have not seen.
 		 */
-		if (!LF_ISSET(DB_AGGRESSIVE) && (__db_salvage_subdbs(dbp,
-		    vdp, handle, callback, flags, &has)) != 0)
+		if (!LF_ISSET(DB_AGGRESSIVE) && __db_salvage_subdbs(
+		    dbp, vdp, handle, callback, flags, &has_subdbs) != 0)
 			isbad = 1;
 
 		/*
-		 * If we have subdatabases, we need to signal that if
-		 * any keys are found that don't belong to a subdatabase,
-		 * they'll need to have an "__OTHER__" subdatabase header
-		 * printed first.  Flag this.  Else, print a header for
-		 * the normal, non-subdb database.
+		 * If we have subdatabases, flag if any keys are found that
+		 * don't belong to a subdatabase -- they'll need to have an
+		 * "__OTHER__" subdatabase header printed first.
 		 */
-		if (has == 1)
+		if (has_subdbs)
 			F_SET(vdp, SALVAGE_PRINTHEADER);
 	}
 
@@ -392,12 +369,14 @@ __db_verify(dbp, name, subdb, handle, callback, flags)
 		__db_salvage_destroy(vdp);
 	}
 
-err:	if (LF_ISSET(DB_SALVAGE) &&
-	    (has == 0 || F_ISSET(vdp, SALVAGE_PRINTFOOTER)))
+	/* Don't display a footer for a database holding other databases. */
+	if (LF_ISSET(DB_SALVAGE) &&
+	    (!has_subdbs || F_ISSET(vdp, SALVAGE_PRINTFOOTER)))
 		(void)__db_prfooter(handle, callback);
 
+done: err:
 	/* Send feedback that we're done. */
-done:	if (!LF_ISSET(DB_SALVAGE) && dbp->db_feedback != NULL)
+	if (!LF_ISSET(DB_SALVAGE) && dbp->db_feedback != NULL)
 		dbp->db_feedback(dbp, DB_VERIFY, 100);
 
 	if (fhp != NULL &&
@@ -423,7 +402,7 @@ done:	if (!LF_ISSET(DB_SALVAGE) && dbp->db_feedback != NULL)
 
 	/* Make sure there's a public complaint if we found corruption. */
 	if (ret != 0)
-		__db_err(dbenv, "%s: %s", name, db_strerror(ret));
+		__db_err(dbenv, ret, "%s", name);
 
 	return (ret);
 }
@@ -456,17 +435,19 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags)
 	meta = (DBMETA *)mbuf;
 	dbp->type = DB_UNKNOWN;
 
+	if ((ret = __db_vrfy_getpageinfo(vdp, PGNO_BASE_MD, &pip)) != 0)
+		return (ret);
+
 	/*
 	 * Seek to the metadata page.
 	 * Note that if we're just starting a verification, dbp->pgsize
 	 * may be zero;  this is okay, as we want page zero anyway and
 	 * 0*0 == 0.
 	 */
-	if ((ret = __os_seek(dbenv, fhp, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0 ||
+	if ((ret = __os_seek(dbenv, fhp, 0, 0, 0)) != 0 ||
 	    (ret = __os_read(dbenv, fhp, mbuf, DBMETASIZE, &nr)) != 0) {
-		__db_err(dbenv,
-		    "Metadata page %lu cannot be read: %s",
-		    (u_long)PGNO_BASE_MD, db_strerror(ret));
+		__db_err(dbenv, ret,
+		    "Metadata page %lu cannot be read", (u_long)PGNO_BASE_MD);
 		return (ret);
 	}
 
@@ -573,6 +554,20 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags)
 		    (u_long)PGNO_BASE_MD, (u_long)meta->type));
 	}
 
+	/*
+	 * 26: Meta-flags.
+	 */
+	if (meta->metaflags != 0) {
+		if (meta->metaflags == DBMETA_CHKSUM)
+			F_SET(pip, VRFY_HAS_CHKSUM);
+		else {
+			isbad = 1;
+			EPRINT((dbenv,
+			    "Page %lu: bad meta-data flags value %#lx",
+			    (u_long)PGNO_BASE_MD, (u_long)meta->metaflags));
+		}
+	}
+
 	/*
 	 * 28-31: Free list page number.
 	 * We'll verify its sensibility when we do inter-page
@@ -587,8 +582,6 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags)
 	 * this one page.  We'll realloc later when we know how many
 	 * pages there are.
 	 */
-	if ((ret = __db_vrfy_getpageinfo(vdp, PGNO_BASE_MD, &pip)) != 0)
-		return (ret);
 	pip->pgno = PGNO_BASE_MD;
 	pip->type = meta->type;
 
@@ -638,9 +631,8 @@ __db_vrfy_walkpages(dbp, vdp, handle, callback, flags)
 
 	for (i = 0; i <= vdp->last_pgno; i++) {
 		/*
-		 * If DB_SALVAGE is set, we inspect our database of
-		 * completed pages, and skip any we've already printed in
-		 * the subdb pass.
+		 * If DB_SALVAGE is set, we inspect our database of completed
+		 * pages, and skip any we've already printed in the subdb pass.
 		 */
 		if (LF_ISSET(DB_SALVAGE) && (__db_salvage_isdone(vdp, i) != 0))
 			continue;
@@ -649,7 +641,7 @@ __db_vrfy_walkpages(dbp, vdp, handle, callback, flags)
 		 * If an individual page get fails, keep going if and only
 		 * if we're salvaging.
 		 */
-		if ((t_ret = __memp_fget(mpf, &i, 0, &h)) != 0) {
+		if ((t_ret = __memp_fget(mpf, &i, NULL, 0, &h)) != 0) {
 			if (ret == 0)
 				ret = t_ret;
 			if (LF_ISSET(DB_SALVAGE))
@@ -677,11 +669,8 @@ __db_vrfy_walkpages(dbp, vdp, handle, callback, flags)
 			 * DB_VERIFY_BAD, keep going;  listing more errors
 			 * may make it easier to diagnose problems and
 			 * determine the magnitude of the corruption.
-			 */
-
-			/*
-			 * Verify info common to all page
-			 * types.
+			 *
+			 * Verify info common to all page types.
 			 */
 			if (i != PGNO_BASE_MD) {
 				ret = __db_vrfy_common(dbp, vdp, h, i, flags);
@@ -895,9 +884,7 @@ __db_vrfy_structure(dbp, vdp, dbname, meta_pgno, flags)
 		goto err;
 	case DB_UNKNOWN:
 	default:
-		/* This should only happen if the verifier is somehow broken. */
-		DB_ASSERT(0);
-		ret = EINVAL;
+		ret = __db_unknown_path(dbenv, "__db_vrfy_structure");
 		goto err;
 	}
 
@@ -1038,29 +1025,25 @@ __db_vrfy_common(dbp, vdp, h, pgno, flags)
 
 	/*
 	 * Hash expands the table by leaving some pages between the
-	 * old last and the new last totally zeroed.  Its pgin function
-	 * should fix things, but we might not be using that (e.g. if
-	 * we're a subdatabase).
+	 * old last and the new last totally zeroed.  These pages may
+	 * not be all zero if they were used, freed and then reallocated.
 	 *
 	 * Queue will create sparse files if sparse record numbers are used.
 	 */
 	if (pgno != 0 && PGNO(h) == 0) {
+		F_SET(pip, VRFY_IS_ALLZEROES);
 		for (p = (u_int8_t *)h; p < (u_int8_t *)h + dbp->pgsize; p++)
 			if (*p != 0) {
-				EPRINT((dbenv,
-				    "Page %lu: partially zeroed page",
-				    (u_long)pgno));
-				ret = DB_VERIFY_BAD;
-				goto err;
+				F_CLR(pip, VRFY_IS_ALLZEROES);
+				break;
 			}
 		/*
-		 * It's totally zeroed;  mark it as a hash, and we'll
+		 * Mark it as a hash, and we'll
 		 * check that that makes sense structurally later.
 		 * (The queue verification doesn't care, since queues
 		 * don't really have much in the way of structure.)
 		 */
 		pip->type = P_HASH;
-		F_SET(pip, VRFY_IS_ALLZEROES);
 		ret = 0;
 		goto err;	/* well, not really an err. */
 	}
@@ -1278,9 +1261,7 @@ __db_vrfy_meta(dbp, vdp, meta, pgno, flags)
 		dbtype = DB_QUEUE;
 		break;
 	default:
-		/* The verifier should never let us get here. */
-		DB_ASSERT(0);
-		ret = EINVAL;
+		ret = __db_unknown_path(dbenv, "__db_vrfy_meta");
 		goto err;
 	}
 
@@ -1320,8 +1301,21 @@ __db_vrfy_meta(dbp, vdp, meta, pgno, flags)
 		    (u_long)pgno, (u_long)meta->pagesize));
 	}
 
-	/* free list */
+	/* Flags */
+	if (meta->metaflags != 0) {
+		if (meta->metaflags == DBMETA_CHKSUM)
+			F_SET(pip, VRFY_HAS_CHKSUM);
+		else {
+			isbad = 1;
+			EPRINT((dbenv,
+			    "Page %lu: bad meta-data flags value %#lx",
+			    (u_long)PGNO_BASE_MD, (u_long)meta->metaflags));
+		}
+	}
+
 	/*
+	 * Free list.
+	 *
 	 * If this is not the main, master-database meta page, it
 	 * should not have a free list.
 	 */
@@ -1372,9 +1366,9 @@ __db_vrfy_freelist(dbp, vdp, meta, flags)
 	db_pgno_t cur_pgno, next_pgno;
 	int p, ret, t_ret;
 
-	pgset = vdp->pgset;
-	DB_ASSERT(pgset != NULL);
 	dbenv = dbp->dbenv;
+	pgset = vdp->pgset;
+	DB_ASSERT(dbenv, pgset != NULL);
 
 	if ((ret = __db_vrfy_getpageinfo(vdp, meta, &pip)) != 0)
 		return (ret);
@@ -1583,12 +1577,13 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags)
 	if ((ret = __db_master_open(dbp, NULL, name, DB_RDONLY, 0, &mdbp)) != 0)
 		goto err;
 
-	memset(&key, 0, sizeof(key));
-	key.data = (void *)subdb;
-	key.size = (u_int32_t)strlen(subdb);
+	DB_INIT_DBT(key, subdb, strlen(subdb));
 	memset(&data, 0, sizeof(data));
-	if ((ret = __db_get(mdbp, NULL, &key, &data, 0)) != 0)
+	if ((ret = __db_get(mdbp, NULL, &key, &data, 0)) != 0) {
+		if (ret == DB_NOTFOUND)
+			ret = ENOENT;
 		goto err;
+	}
 
 	if (data.size != sizeof(db_pgno_t)) {
 		EPRINT((dbenv, "Subdatabase entry of invalid size"));
@@ -1604,7 +1599,7 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags)
 	 */
 	DB_NTOHL(&meta_pgno);
 
-	if ((ret = __memp_fget(mpf, &meta_pgno, 0, &h)) != 0)
+	if ((ret = __memp_fget(mpf, &meta_pgno, NULL, 0, &h)) != 0)
 		goto err;
 
 	if ((ret = __db_vrfy_pgset(dbenv, dbp->pgsize, &pgset)) != 0)
@@ -1625,7 +1620,7 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags)
 		    PGNO_INVALID, 0, DB_LOCK_INVALIDID, &pgsc)) != 0)
 			goto err;
 		while ((ret = __db_vrfy_pgset_next(pgsc, &p)) == 0) {
-			if ((ret = __memp_fget(mpf, &p, 0, &currpg)) != 0)
+			if ((ret = __memp_fget(mpf, &p, NULL, 0, &currpg)) != 0)
 				goto err;
 			if ((ret = __bam_vrfy_itemorder(dbp,
 			    NULL, currpg, p, NUM_ENT(currpg), 1,
@@ -1677,7 +1672,7 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags)
 			pgno = BS_TO_PAGE(bucket, hmeta->spares);
 			while (pgno != PGNO_INVALID) {
 				if ((ret = __memp_fget(mpf,
-				    &pgno, 0, &currpg)) != 0)
+				    &pgno, NULL, 0, &currpg)) != 0)
 					goto err;
 				if ((ret = __ham_vrfy_hashing(dbp,
 				    NUM_ENT(currpg), hmeta, bucket, pgno,
@@ -1729,8 +1724,21 @@ __db_salvage(dbp, vdp, pgno, h, handle, callback, flags)
 	int (*callback) __P((void *, const void *));
 	u_int32_t flags;
 {
-	int ret;
-	DB_ASSERT(LF_ISSET(DB_SALVAGE));
+	DB_ENV *dbenv;
+	VRFY_PAGEINFO *pip;
+	int keyflag, ret, t_ret;
+
+	dbenv = dbp->dbenv;
+	DB_ASSERT(dbenv, LF_ISSET(DB_SALVAGE));
+
+	/*
+	 * !!!
+	 * We dump record numbers when salvaging Queue databases, but not for
+	 * immutable Recno databases.  The problem is we can't figure out the
+	 * record number from the database page in the Recno case, while the
+	 * offset in the file is sufficient for Queue.
+	 */
+	keyflag = 0;
 
 	/* If we got this page in the subdb pass, we can safely skip it. */
 	if (__db_salvage_isdone(vdp, pgno))
@@ -1744,11 +1752,12 @@ __db_salvage(dbp, vdp, pgno, h, handle, callback, flags)
 		ret = __bam_vrfy_meta(dbp, vdp, (BTMETA *)h, pgno, flags);
 		break;
 	case P_QAMMETA:
+		keyflag = 1;
 		ret = __qam_vrfy_meta(dbp, vdp, (QMETA *)h, pgno, flags);
 		break;
 	case P_HASH:
-		return (__ham_salvage(dbp,
-		    vdp, pgno, h, handle, callback, flags));
+		return (__ham_salvage(
+		    dbp, vdp, pgno, h, handle, callback, flags));
 	case P_LBTREE:
 		return (__bam_salvage(dbp,
 		    vdp, pgno, P_LBTREE, h, handle, callback, NULL, flags));
@@ -1778,13 +1787,30 @@ __db_salvage(dbp, vdp, pgno, h, handle, callback, flags)
 	case P_IRECNO:
 	case __P_DUPLICATE:
 	default:
-		/* XXX: Should we be more aggressive here? */
+		/*
+		 * There's no need to display an error, the page type was
+		 * already checked and reported on.
+		 */
 		return (0);
 	}
+	if (ret != 0)
+		return (ret);
 
-	return (ret != 0 ? ret :
-	     __db_prheader(dbp, NULL, 0, 1,
-	     handle, callback, vdp, PGNO_BASE_MD));
+	/*
+	 * We have to display the dump header if it's a metadata page.  It's
+	 * our last chance as the page was marked "seen" in the vrfy routine,
+	 * and  we won't see the page again.  We don't display headers for
+	 * the first database in a multi-database file, that database simply
+	 * contains a list of subdatabases.
+	 */
+	if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0)
+		return (ret);
+	if (!F_ISSET(pip, VRFY_HAS_SUBDBS))
+		ret = __db_prheader(
+		    dbp, NULL, 0, keyflag, handle, callback, vdp, pgno);
+	if ((t_ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0 && ret == 0)
+		ret = t_ret;
+	return (ret);
 }
 
 /*
@@ -1800,34 +1826,39 @@ __db_salvage_unknowns(dbp, vdp, handle, callback, flags)
 	int (*callback) __P((void *, const void *));
 	u_int32_t flags;
 {
+	DBC *dbc;
 	DBT unkdbt, key, *dbt;
 	DB_ENV *dbenv;
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
 	db_pgno_t pgno;
 	u_int32_t pgtype;
-	int ret, err_ret;
+	int ret, t_ret;
 	void *ovflbuf;
 
+	dbc = NULL;
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
 
-	memset(&unkdbt, 0, sizeof(DBT));
-	unkdbt.size = (u_int32_t)strlen("UNKNOWN") + 1;
-	unkdbt.data = "UNKNOWN";
+	DB_INIT_DBT(unkdbt, "UNKNOWN", sizeof("UNKNOWN") - 1);
 
 	if ((ret = __os_malloc(dbenv, dbp->pgsize, &ovflbuf)) != 0)
 		return (ret);
 
-	err_ret = 0;
-	while ((ret = __db_salvage_getnext(vdp, &pgno, &pgtype)) == 0) {
-		dbt = NULL;
-
-		if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0) {
-			err_ret = ret;
+	/*
+	 * We make two passes -- in the first pass, skip SALVAGE_OVERFLOW
+	 * pages, because they may be referenced by the standard database
+	 * pages that we're resolving.
+	 */
+	while ((t_ret =
+	    __db_salvage_getnext(vdp, &dbc, &pgno, &pgtype, 1)) == 0) {
+		if ((t_ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0) {
+			if (ret == 0)
+				ret = t_ret;
 			continue;
 		}
 
+		dbt = NULL;
 		switch (pgtype) {
 		case SALVAGE_LDUP:
 		case SALVAGE_LRECNODUP:
@@ -1835,28 +1866,17 @@ __db_salvage_unknowns(dbp, vdp, handle, callback, flags)
 			/* FALLTHROUGH */
 		case SALVAGE_LBTREE:
 		case SALVAGE_LRECNO:
-			if ((ret = __bam_salvage(dbp, vdp, pgno, pgtype,
-			    h, handle, callback, dbt, flags)) != 0)
-				err_ret = ret;
+			if ((t_ret = __bam_salvage(dbp, vdp, pgno, pgtype,
+			    h, handle, callback, dbt, flags)) != 0 && ret == 0)
+				ret = t_ret;
 			break;
 		case SALVAGE_OVERFLOW:
-			/*
-			 * XXX:
-			 * This may generate multiple "UNKNOWN" keys in
-			 * a database with no dups.  What to do?
-			 */
-			if ((ret = __db_safe_goff(dbp,
-			    vdp, pgno, &key, &ovflbuf, flags)) != 0 ||
-			    (ret = __db_vrfy_prdbt(&key,
-			    0, " ", handle, callback, 0, vdp)) != 0 ||
-			    (ret = __db_vrfy_prdbt(&unkdbt,
-			    0, " ", handle, callback, 0, vdp)) != 0)
-				err_ret = ret;
+			DB_ASSERT(dbenv, 0);	/* Shouldn't ever happen. */
 			break;
 		case SALVAGE_HASH:
-			if ((ret = __ham_salvage(
-			    dbp, vdp, pgno, h, handle, callback, flags)) != 0)
-				err_ret = ret;
+			if ((t_ret = __ham_salvage(dbp, vdp,
+			    pgno, h, handle, callback, flags)) != 0 && ret == 0)
+				ret = t_ret;
 			break;
 		case SALVAGE_INVALID:
 		case SALVAGE_IGNORE:
@@ -1865,19 +1885,70 @@ __db_salvage_unknowns(dbp, vdp, handle, callback, flags)
 			 * Shouldn't happen, but if it does, just do what the
 			 * nice man says.
 			 */
-			DB_ASSERT(0);
+			DB_ASSERT(dbenv, 0);
 			break;
 		}
-		if ((ret = __memp_fput(mpf, h, 0)) != 0)
-			err_ret = ret;
+		if ((t_ret = __memp_fput(mpf, h, 0)) != 0 && ret == 0)
+			ret = t_ret;
 	}
 
-	__os_free(dbenv, ovflbuf);
+	/* We should have reached the end of the database. */
+	if (t_ret == DB_NOTFOUND)
+		t_ret = 0;
+	if (t_ret != 0 && ret == 0)
+		ret = t_ret;
+
+	/* Re-open the cursor so we traverse the database again. */
+	if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0)
+		ret = t_ret;
+	dbc = NULL;
+
+	/* Now, deal with any remaining overflow pages. */
+	while ((t_ret =
+	    __db_salvage_getnext(vdp, &dbc, &pgno, &pgtype, 0)) == 0) {
+		if ((t_ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0) {
+			if (ret == 0)
+				ret = t_ret;
+			continue;
+		}
+
+		switch (pgtype) {
+		case SALVAGE_OVERFLOW:
+			/*
+			 * XXX:
+			 * This may generate multiple "UNKNOWN" keys in
+			 * a database with no dups.  What to do?
+			 */
+			if ((t_ret = __db_safe_goff(dbp,
+			    vdp, pgno, &key, &ovflbuf, flags)) != 0 ||
+			    ((vdp->type == DB_BTREE || vdp->type == DB_HASH) &&
+			    (t_ret = __db_vrfy_prdbt(&unkdbt,
+			    0, " ", handle, callback, 0, vdp)) != 0) ||
+			    (t_ret = __db_vrfy_prdbt(
+			    &key, 0, " ", handle, callback, 0, vdp)) != 0)
+				if (ret == 0)
+					ret = t_ret;
+			break;
+		default:
+			DB_ASSERT(dbenv, 0);	/* Shouldn't ever happen. */
+			break;
+		}
+		if ((t_ret = __memp_fput(mpf, h, 0)) != 0 && ret == 0)
+			ret = t_ret;
+	}
+
+	/* We should have reached the end of the database. */
+	if (t_ret == DB_NOTFOUND)
+		t_ret = 0;
+	if (t_ret != 0 && ret == 0)
+		ret = t_ret;
 
-	if (err_ret != 0 && ret == 0)
-		ret = err_ret;
+	if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0)
+		ret = t_ret;
 
-	return (ret == DB_NOTFOUND ? 0 : ret);
+	__os_free(dbenv, ovflbuf);
+
+	return (ret);
 }
 
 /*
@@ -1916,7 +1987,7 @@ __db_vrfy_inpitem(dbp, h, pgno, i, is_btree, flags, himarkp, offsetp)
 
 	dbenv = dbp->dbenv;
 
-	DB_ASSERT(himarkp != NULL);
+	DB_ASSERT(dbenv, himarkp != NULL);
 	inp = P_INP(dbp, h);
 
 	/*
@@ -2108,7 +2179,7 @@ __db_salvage_duptree(dbp, vdp, pgno, key, handle, callback, flags)
 		return (DB_VERIFY_BAD);
 
 	/* We have a plausible page.  Try it. */
-	if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0)
+	if ((ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0)
 		return (ret);
 
 	switch (TYPE(h)) {
@@ -2157,95 +2228,87 @@ __db_salvage_subdbs(dbp, vdp, handle, callback, flags, hassubsp)
 	u_int32_t flags;
 	int *hassubsp;
 {
-	BTMETA *btmeta;
 	DB *pgset;
 	DBC *pgsc;
+	DB_ENV *dbenv;
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
+	VRFY_PAGEINFO *pip;
 	db_pgno_t p, meta_pgno;
-	int ret, err_ret;
+	int ret, t_ret;
+
+	*hassubsp = 0;
 
+	dbenv = dbp->dbenv;
 	pgset = NULL;
 	pgsc = NULL;
 	mpf = dbp->mpf;
-	err_ret = 0;
+	h = NULL;
+	pip = NULL;
+	ret = 0;
 
+	/*
+	 * Check to make sure the page is OK and find out if it contains
+	 * subdatabases.
+	 */
 	meta_pgno = PGNO_BASE_MD;
-	if ((ret = __memp_fget(mpf, &meta_pgno, 0, &h)) != 0)
-		return (ret);
-
-	if (TYPE(h) == P_BTREEMETA)
-		btmeta = (BTMETA *)h;
-	else {
-		/* Not a btree metadata, ergo no subdbs, so just return. */
-		ret = 0;
-		goto err;
-	}
-
-	/* If it's not a safe page, bail on the attempt. */
-	if ((ret = __db_vrfy_common(dbp, vdp, h, PGNO_BASE_MD, flags)) != 0 ||
-	   (ret = __bam_vrfy_meta(dbp, vdp, btmeta, PGNO_BASE_MD, flags)) != 0)
-		goto err;
-
-	if (!F_ISSET(&btmeta->dbmeta, BTM_SUBDB)) {
-		/* No subdbs, just return. */
-		ret = 0;
-		goto err;
+	if ((t_ret = __memp_fget(mpf, &meta_pgno, NULL, 0, &h)) == 0 &&
+	    (t_ret = __db_vrfy_common(dbp, vdp, h, PGNO_BASE_MD, flags)) == 0 &&
+	    (t_ret = __db_salvage(
+	    dbp, vdp, PGNO_BASE_MD, h, handle, callback, flags)) == 0 &&
+	    (t_ret = __db_vrfy_getpageinfo(vdp, 0, &pip)) == 0)
+		if (F_ISSET(pip, VRFY_HAS_SUBDBS))
+			*hassubsp = 1;
+	if (pip != NULL &&
+	    (t_ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0 && ret == 0)
+		ret = t_ret;
+	if (h != NULL) {
+		if ((t_ret = __memp_fput(mpf, h, 0)) != 0 && ret == 0)
+			ret = t_ret;
+		h = NULL;
 	}
-
-	/* We think we've got subdbs.  Mark it so. */
-	*hassubsp = 1;
-
-	if ((ret = __memp_fput(mpf, h, 0)) != 0)
+	if (ret != 0 || *hassubsp == 0)
 		return (ret);
 
 	/*
 	 * We have subdbs.  Try to crack them.
 	 *
-	 * To do so, get a set of leaf pages in the master
-	 * database, and then walk each of the valid ones, salvaging
-	 * subdbs as we go.  If any prove invalid, just drop them;  we'll
-	 * pick them up on a later pass.
+	 * To do so, get a set of leaf pages in the master database, and then
+	 * walk each of the valid ones, salvaging subdbs as we go.  If any
+	 * prove invalid, just drop them;  we'll pick them up on a later pass.
 	 */
-	if ((ret = __db_vrfy_pgset(dbp->dbenv, dbp->pgsize, &pgset)) != 0)
-		return (ret);
-	if ((ret =
-	    __db_meta2pgset(dbp, vdp, PGNO_BASE_MD, flags, pgset)) != 0)
+	if ((ret = __db_vrfy_pgset(dbenv, dbp->pgsize, &pgset)) != 0)
+		goto err;
+	if ((ret = __db_meta2pgset(dbp, vdp, PGNO_BASE_MD, flags, pgset)) != 0)
 		goto err;
-
 	if ((ret = __db_cursor(pgset, NULL, &pgsc, 0)) != 0)
 		goto err;
-	while ((ret = __db_vrfy_pgset_next(pgsc, &p)) == 0) {
-		if ((ret = __memp_fget(mpf, &p, 0, &h)) != 0) {
-			err_ret = ret;
-			continue;
+	while ((t_ret = __db_vrfy_pgset_next(pgsc, &p)) == 0) {
+		if ((t_ret = __memp_fget(mpf, &p, NULL, 0, &h)) == 0 &&
+		    (t_ret = __db_vrfy_common(dbp, vdp, h, p, flags)) == 0 &&
+		    (t_ret =
+		    __bam_vrfy(dbp, vdp, h, p, flags | DB_NOORDERCHK)) == 0)
+			t_ret = __db_salvage_subdbpg(
+			    dbp, vdp, h, handle, callback, flags);
+		if (t_ret != 0 && ret == 0)
+			ret = t_ret;
+		if (h != NULL) {
+			if ((t_ret = __memp_fput(mpf, h, 0)) != 0 && ret == 0)
+				ret = t_ret;
+			h = NULL;
 		}
-		if ((ret = __db_vrfy_common(dbp, vdp, h, p, flags)) != 0 ||
-		    (ret = __bam_vrfy(dbp,
-		    vdp, h, p, flags | DB_NOORDERCHK)) != 0)
-			goto nextpg;
-		if (TYPE(h) != P_LBTREE)
-			goto nextpg;
-		else if ((ret = __db_salvage_subdbpg(
-		    dbp, vdp, h, handle, callback, flags)) != 0)
-			err_ret = ret;
-nextpg:		if ((ret = __memp_fput(mpf, h, 0)) != 0)
-			err_ret = ret;
 	}
 
-	if (ret != DB_NOTFOUND)
-		goto err;
-	if ((ret = __db_c_close(pgsc)) != 0)
-		goto err;
-
-	ret = __db_close(pgset, NULL, 0);
-	return ((ret == 0 && err_ret != 0) ? err_ret : ret);
+	if (t_ret != DB_NOTFOUND && ret == 0)
+		ret = t_ret;
 
-err:	if (pgsc != NULL)
-		(void)__db_c_close(pgsc);
-	if (pgset != NULL)
-		(void)__db_close(pgset, NULL, 0);
-	(void)__memp_fput(mpf, h, 0);
+err:	if (pgsc != NULL && (t_ret = __db_c_close(pgsc)) != 0 && ret == 0)
+		ret = t_ret;
+	if (pgset != NULL &&
+	    (t_ret = __db_close(pgset, NULL, 0)) != 0 && ret ==0)
+		ret = t_ret;
+	if (h != NULL && (t_ret = __memp_fput(mpf, h, 0)) != 0 && ret == 0)
+		ret = t_ret;
 	return (ret);
 }
 
@@ -2333,8 +2396,8 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags)
 		DB_NTOHL(&meta_pgno);
 
 		/* If we can't get the subdb meta page, just skip the subdb. */
-		if (!IS_VALID_PGNO(meta_pgno) ||
-		    (ret = __memp_fget(mpf, &meta_pgno, 0, &subpg)) != 0) {
+		if (!IS_VALID_PGNO(meta_pgno) || (ret =
+		    __memp_fget(mpf, &meta_pgno, NULL, 0, &subpg)) != 0) {
 			err_ret = ret;
 			continue;
 		}
@@ -2395,7 +2458,8 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags)
 		if ((ret = __db_cursor(pgset, NULL, &pgsc, 0)) != 0)
 			goto err;
 		while ((ret = __db_vrfy_pgset_next(pgsc, &p)) == 0) {
-			if ((ret = __memp_fget(mpf, &p, 0, &subpg)) != 0) {
+			if ((ret =
+			    __memp_fget(mpf, &p, NULL, 0, &subpg)) != 0) {
 				err_ret = ret;
 				continue;
 			}
@@ -2446,7 +2510,7 @@ __db_meta2pgset(dbp, vdp, pgno, flags, pgset)
 
 	mpf = dbp->mpf;
 
-	if ((ret = __memp_fget(mpf, &pgno, 0, &h)) != 0)
+	if ((ret = __memp_fget(mpf, &pgno, NULL, 0, &h)) != 0)
 		return (ret);
 
 	switch (TYPE(h)) {
@@ -2495,8 +2559,8 @@ __db_guesspgsize(dbenv, fhp)
 		 * our previous guess; that last one was probably the page size.
 		 */
 		for (i = 1; i <= 3; i++) {
-			if (__os_seek(dbenv, fhp, guess,
-			    i, SSZ(DBMETA, type), 0, DB_OS_SEEK_SET) != 0)
+			if (__os_seek(
+			    dbenv, fhp, i, guess, SSZ(DBMETA, type)) != 0)
 				break;
 			if (__os_read(dbenv,
 			    fhp, &type, 1, &nr) != 0 || nr == 0)
diff --git a/db/db/db_vrfy_stub.c b/db/db/db_vrfy_stub.c
index 486802d7d..9bef99be0 100644
--- a/db/db/db_vrfy_stub.c
+++ b/db/db/db_vrfy_stub.c
@@ -1,18 +1,14 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_vrfy_stub.c,v 11.6 2004/06/14 15:23:32 bostic Exp $
+ * $Id: db_vrfy_stub.c,v 12.5 2006/08/24 14:45:16 bostic Exp $
  */
 
-#include "db_config.h"
-
 #ifndef HAVE_VERIFY
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-#endif
+#include "db_config.h"
 
 #include "db_int.h"
 #include "dbinc/db_page.h"
@@ -35,7 +31,7 @@ static int
 __db_novrfy(dbenv)
 	DB_ENV *dbenv;
 {
-	__db_err(dbenv,
+	__db_errx(dbenv,
 	    "library build did not include support for database verification");
 	return (DB_OPNOTSUP);
 }
diff --git a/db/db/db_vrfyutil.c b/db/db/db_vrfyutil.c
index f1034af1f..414814079 100644
--- a/db/db/db_vrfyutil.c
+++ b/db/db/db_vrfyutil.c
@@ -1,20 +1,14 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2000-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2000-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_vrfyutil.c,v 11.40 2004/10/11 18:47:50 bostic Exp $
+ * $Id: db_vrfyutil.c,v 12.12 2006/09/11 15:13:24 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_verify.h"
@@ -55,6 +49,10 @@ __db_vrfy_dbinfo_create(dbenv, pgsize, vdpp)
 	if ((ret = __db_set_pagesize(cdbp, pgsize)) != 0)
 		goto err;
 
+	/* If transactional, make sure we don't log. */
+	if (TXN_ON(dbenv) &&
+	    (ret = __db_set_flags(cdbp, DB_TXN_NOT_DURABLE)) != 0)
+		goto err;
 	if ((ret = __db_open(cdbp,
 	    NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600, PGNO_BASE_MD)) != 0)
 		goto err;
@@ -65,6 +63,11 @@ __db_vrfy_dbinfo_create(dbenv, pgsize, vdpp)
 	if ((ret = __db_set_pagesize(pgdbp, pgsize)) != 0)
 		goto err;
 
+	/* If transactional, make sure we don't log. */
+	if (TXN_ON(dbenv) &&
+	    (ret = __db_set_flags(pgdbp, DB_TXN_NOT_DURABLE)) != 0)
+		goto err;
+
 	if ((ret = __db_open(pgdbp,
 	    NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600, PGNO_BASE_MD)) != 0)
 		goto err;
@@ -102,13 +105,26 @@ __db_vrfy_dbinfo_destroy(dbenv, vdp)
 	DB_ENV *dbenv;
 	VRFY_DBINFO *vdp;
 {
-	VRFY_CHILDINFO *c, *d;
+	VRFY_CHILDINFO *c;
 	int t_ret, ret;
 
 	ret = 0;
 
-	for (c = LIST_FIRST(&vdp->subdbs); c != NULL; c = d) {
-		d = LIST_NEXT(c, links);
+	/*
+	 * Discard active page structures.  Ideally there wouldn't be any,
+	 * but in some error cases we may not have cleared them all out.
+	 */
+	while (LIST_FIRST(&vdp->activepips) != NULL)
+		if ((t_ret = __db_vrfy_putpageinfo(
+		    dbenv, vdp, LIST_FIRST(&vdp->activepips))) != 0) {
+			if (ret == 0)
+				ret = t_ret;
+			break;
+		}
+
+	/* Discard subdatabase list structures. */
+	while ((c = LIST_FIRST(&vdp->subdbs)) != NULL) {
+		LIST_REMOVE(c, links);
 		__os_free(NULL, c);
 	}
 
@@ -121,8 +137,6 @@ __db_vrfy_dbinfo_destroy(dbenv, vdp)
 	if ((t_ret = __db_close(vdp->pgset, NULL, 0)) != 0 && ret == 0)
 		ret = t_ret;
 
-	DB_ASSERT(LIST_FIRST(&vdp->activepips) == NULL);
-
 	if (vdp->extents != NULL)
 		__os_free(dbenv, vdp->extents);
 	__os_free(dbenv, vdp);
@@ -142,6 +156,7 @@ __db_vrfy_getpageinfo(vdp, pgno, pipp)
 	db_pgno_t pgno;
 	VRFY_PAGEINFO **pipp;
 {
+	DB_ENV *dbenv;
 	DBT key, data;
 	DB *pgdbp;
 	VRFY_PAGEINFO *pip;
@@ -166,14 +181,13 @@ __db_vrfy_getpageinfo(vdp, pgno, pipp)
 	 */
 
 	/* Case 1. */
-	for (pip = LIST_FIRST(&vdp->activepips); pip != NULL;
-	    pip = LIST_NEXT(pip, links))
+	LIST_FOREACH(pip, &vdp->activepips, links)
 		if (pip->pgno == pgno)
-			/* Found it. */
 			goto found;
 
 	/* Case 2. */
 	pgdbp = vdp->pgdbp;
+	dbenv = pgdbp->dbenv;
 	memset(&key, 0, sizeof(DBT));
 	memset(&data, 0, sizeof(DBT));
 	F_SET(&data, DB_DBT_MALLOC);
@@ -182,24 +196,21 @@ __db_vrfy_getpageinfo(vdp, pgno, pipp)
 
 	if ((ret = __db_get(pgdbp, NULL, &key, &data, 0)) == 0) {
 		/* Found it. */
-		DB_ASSERT(data.size == sizeof(VRFY_PAGEINFO));
+		DB_ASSERT(dbenv, data.size == sizeof(VRFY_PAGEINFO));
 		pip = data.data;
-		DB_ASSERT(pip->pi_refcount == 0);
 		LIST_INSERT_HEAD(&vdp->activepips, pip, links);
 		goto found;
 	} else if (ret != DB_NOTFOUND)	/* Something nasty happened. */
 		return (ret);
 
 	/* Case 3 */
-	if ((ret = __db_vrfy_pageinfo_create(pgdbp->dbenv, &pip)) != 0)
+	if ((ret = __db_vrfy_pageinfo_create(dbenv, &pip)) != 0)
 		return (ret);
 
 	LIST_INSERT_HEAD(&vdp->activepips, pip, links);
 found:	pip->pi_refcount++;
 
 	*pipp = pip;
-
-	DB_ASSERT(pip->pi_refcount > 0);
 	return (0);
 }
 
@@ -220,11 +231,6 @@ __db_vrfy_putpageinfo(dbenv, vdp, pip)
 	DB *pgdbp;
 	VRFY_PAGEINFO *p;
 	int ret;
-#ifdef DIAGNOSTIC
-	int found;
-
-	found = 0;
-#endif
 
 	if (--pip->pi_refcount > 0)
 		return (0);
@@ -241,22 +247,13 @@ __db_vrfy_putpageinfo(dbenv, vdp, pip)
 	if ((ret = __db_put(pgdbp, NULL, &key, &data, 0)) != 0)
 		return (ret);
 
-	for (p = LIST_FIRST(&vdp->activepips); p != NULL;
-	    p = LIST_NEXT(p, links))
-		if (p == pip) {
-#ifdef DIAGNOSTIC
-			found++;
-#endif
-			DB_ASSERT(p->pi_refcount == 0);
-			LIST_REMOVE(p, links);
+	LIST_FOREACH(p, &vdp->activepips, links)
+		if (p == pip)
 			break;
-		}
-#ifdef DIAGNOSTIC
-	DB_ASSERT(found == 1);
-#endif
+	if (p != NULL)
+		LIST_REMOVE(p, links);
 
-	DB_ASSERT(pip->pi_refcount == 0);
-	__os_ufree(dbenv, pip);
+	__os_ufree(dbenv, p);
 	return (0);
 }
 
@@ -281,6 +278,11 @@ __db_vrfy_pgset(dbenv, pgsize, dbpp)
 		return (ret);
 	if ((ret = __db_set_pagesize(dbp, pgsize)) != 0)
 		goto err;
+
+	/* If transactional, make sure we don't log. */
+	if (TXN_ON(dbenv) &&
+	    (ret = __db_set_flags(dbp, DB_TXN_NOT_DURABLE)) != 0)
+		goto err;
 	if ((ret = __db_open(dbp,
 	    NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600, PGNO_BASE_MD)) == 0)
 		*dbpp = dbp;
@@ -316,7 +318,7 @@ __db_vrfy_pgset_get(dbp, pgno, valp)
 	F_SET(&data, DB_DBT_USERMEM);
 
 	if ((ret = __db_get(dbp, NULL, &key, &data, 0)) == 0) {
-		DB_ASSERT(data.size == sizeof(int));
+		DB_ASSERT(dbp->dbenv, data.size == sizeof(int));
 	} else if (ret == DB_NOTFOUND)
 		val = 0;
 	else
@@ -353,7 +355,7 @@ __db_vrfy_pgset_inc(dbp, pgno)
 	F_SET(&data, DB_DBT_USERMEM);
 
 	if ((ret = __db_get(dbp, NULL, &key, &data, 0)) == 0) {
-		DB_ASSERT(data.size == sizeof(int));
+		DB_ASSERT(dbp->dbenv, data.size == sizeof(int));
 	} else if (ret != DB_NOTFOUND)
 		return (ret);
 
@@ -390,7 +392,7 @@ __db_vrfy_pgset_next(dbc, pgnop)
 	if ((ret = __db_c_get(dbc, &key, &data, DB_NEXT)) != 0)
 		return (ret);
 
-	DB_ASSERT(key.size == sizeof(db_pgno_t));
+	DB_ASSERT(dbc->dbp->dbenv, key.size == sizeof(db_pgno_t));
 	*pgnop = pgno;
 
 	return (0);
@@ -537,7 +539,7 @@ __db_vrfy_ccset(dbc, pgno, cipp)
 	if ((ret = __db_c_get(dbc, &key, &data, DB_SET)) != 0)
 		return (ret);
 
-	DB_ASSERT(data.size == sizeof(VRFY_CHILDINFO));
+	DB_ASSERT(dbc->dbp->dbenv, data.size == sizeof(VRFY_CHILDINFO));
 	*cipp = (VRFY_CHILDINFO *)data.data;
 
 	return (0);
@@ -565,7 +567,7 @@ __db_vrfy_ccnext(dbc, cipp)
 	if ((ret = __db_c_get(dbc, &key, &data, DB_NEXT_DUP)) != 0)
 		return (ret);
 
-	DB_ASSERT(data.size == sizeof(VRFY_CHILDINFO));
+	DB_ASSERT(dbc->dbp->dbenv, data.size == sizeof(VRFY_CHILDINFO));
 	*cipp = (VRFY_CHILDINFO *)data.data;
 
 	return (0);
@@ -595,11 +597,11 @@ __db_vrfy_ccclose(dbc)
  *	Constructor for VRFY_PAGEINFO;  allocates and initializes.
  */
 static int
-__db_vrfy_pageinfo_create(dbenv, pgipp)
+__db_vrfy_pageinfo_create(dbenv, pipp)
 	DB_ENV *dbenv;
-	VRFY_PAGEINFO **pgipp;
+	VRFY_PAGEINFO **pipp;
 {
-	VRFY_PAGEINFO *pgip;
+	VRFY_PAGEINFO *pip;
 	int ret;
 
 	/*
@@ -609,13 +611,11 @@ __db_vrfy_pageinfo_create(dbenv, pgipp)
 	 * used, and so we always allocate with __os_umalloc so we can free
 	 * with __os_ufree.
 	 */
-	if ((ret = __os_umalloc(dbenv, sizeof(VRFY_PAGEINFO), &pgip)) != 0)
+	if ((ret = __os_umalloc(dbenv, sizeof(VRFY_PAGEINFO), &pip)) != 0)
 		return (ret);
-	memset(pgip, 0, sizeof(VRFY_PAGEINFO));
+	memset(pip, 0, sizeof(VRFY_PAGEINFO));
 
-	DB_ASSERT(pgip->pi_refcount == 0);
-
-	*pgipp = pgip;
+	*pipp = pip;
 	return (0);
 }
 
@@ -668,16 +668,17 @@ __db_salvage_destroy(vdp)
  *	in this search, as well as the page we're returning.
  *
  * PUBLIC: int __db_salvage_getnext
- * PUBLIC:     __P((VRFY_DBINFO *, db_pgno_t *, u_int32_t *));
+ * PUBLIC:     __P((VRFY_DBINFO *, DBC **, db_pgno_t *, u_int32_t *, int));
  */
 int
-__db_salvage_getnext(vdp, pgnop, pgtypep)
+__db_salvage_getnext(vdp, dbcp, pgnop, pgtypep, skip_overflow)
 	VRFY_DBINFO *vdp;
+	DBC **dbcp;
 	db_pgno_t *pgnop;
 	u_int32_t *pgtypep;
+	int skip_overflow;
 {
 	DB *dbp;
-	DBC *dbc;
 	DBT key, data;
 	int ret;
 	u_int32_t pgtype;
@@ -687,30 +688,29 @@ __db_salvage_getnext(vdp, pgnop, pgtypep)
 	memset(&key, 0, sizeof(DBT));
 	memset(&data, 0, sizeof(DBT));
 
-	if ((ret = __db_cursor(dbp, NULL, &dbc, 0)) != 0)
+	if (*dbcp == NULL &&
+	    (ret = __db_cursor(dbp, NULL, dbcp, 0)) != 0)
 		return (ret);
 
-	while ((ret = __db_c_get(dbc, &key, &data, DB_NEXT)) == 0) {
-		DB_ASSERT(data.size == sizeof(u_int32_t));
+	while ((ret = __db_c_get(*dbcp, &key, &data, DB_NEXT)) == 0) {
+		DB_ASSERT(dbp->dbenv, data.size == sizeof(u_int32_t));
 		memcpy(&pgtype, data.data, sizeof(pgtype));
 
-		if ((ret = __db_c_del(dbc, 0)) != 0)
-			goto err;
-		if (pgtype != SALVAGE_IGNORE)
-			goto found;
-	}
+		if (skip_overflow && pgtype == SALVAGE_OVERFLOW)
+			continue;
 
-	/* No more entries--ret probably equals DB_NOTFOUND. */
+		if ((ret = __db_c_del(*dbcp, 0)) != 0)
+			return (ret);
+		if (pgtype != SALVAGE_IGNORE) {
+			DB_ASSERT(dbp->dbenv, key.size == sizeof(db_pgno_t));
+			DB_ASSERT(dbp->dbenv, data.size == sizeof(u_int32_t));
 
-	if (0) {
-found:		DB_ASSERT(key.size == sizeof(db_pgno_t));
-		DB_ASSERT(data.size == sizeof(u_int32_t));
-
-		*pgnop = *(db_pgno_t *)key.data;
-		*pgtypep = *(u_int32_t *)data.data;
+			*pgnop = *(db_pgno_t *)key.data;
+			*pgtypep = *(u_int32_t *)data.data;
+			break;
+		}
 	}
 
-err:	(void)__db_c_close(dbc);
 	return (ret);
 }
 
@@ -753,8 +753,7 @@ __db_salvage_isdone(vdp, pgno)
 	 * If it's there and is marked anything else, that's fine--we
 	 * want to mark it done.
 	 */
-	ret = __db_get(dbp, NULL, &key, &data, 0);
-	if (ret == 0) {
+	if ((ret = __db_get(dbp, NULL, &key, &data, 0)) == 0) {
 		/*
 		 * The key's already here.  Check and see if it's already
 		 * marked done.  If it is, return DB_KEYEXIST.  If it's not,
@@ -887,11 +886,12 @@ __db_vrfy_prdbt(dbtp, checkprint, prefix, handle, callback, is_recno, vdp)
 		 * Check and clear the SALVAGE_PRINTHEADER flag;  if
 		 * it was set, print a subdatabase header.
 		 */
-		if (F_ISSET(vdp, SALVAGE_PRINTHEADER))
+		if (F_ISSET(vdp, SALVAGE_PRINTHEADER)) {
 			(void)__db_prheader(
 			    NULL, "__OTHER__", 0, 0, handle, callback, vdp, 0);
-		F_CLR(vdp, SALVAGE_PRINTHEADER);
-		F_SET(vdp, SALVAGE_PRINTFOOTER);
+			F_CLR(vdp, SALVAGE_PRINTHEADER);
+			F_SET(vdp, SALVAGE_PRINTFOOTER);
+		}
 
 		/*
 		 * Even if the printable flag wasn't set by our immediate
diff --git a/db/db185/db185.c b/db/db185/db185.c
index 8399eac42..484b43676 100644
--- a/db/db185/db185.c
+++ b/db/db185/db185.c
@@ -1,27 +1,21 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db185.c,v 11.35 2004/03/24 20:37:35 bostic Exp $
+ * $Id: db185.c,v 12.7 2006/08/31 17:59:25 bostic Exp $
  */
 
 #include "db_config.h"
 
+#include "db_int.h"
+
 #ifndef lint
 static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
 #endif
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
-#include "db_int.h"
 #include "db185_int.h"
 
 static int	db185_close __P((DB185 *));
@@ -89,12 +83,6 @@ __db185_open(file, oflags, mode, type, openinfo)
 				(void)dbp->set_bt_minkey(dbp, bi->minkeypage);
 			if (bi->psize != 0)
 				(void)dbp->set_pagesize(dbp, bi->psize);
-			/*
-			 * !!!
-			 * Comparisons and prefix calls work because the DBT
-			 * structures in 1.85 and 2.0 have the same initial
-			 * fields.
-			 */
 			if (bi->prefix != NULL) {
 				db185p->prefix = bi->prefix;
 				dbp->set_bt_prefix(dbp, db185_prefix);
@@ -156,7 +144,8 @@ __db185_open(file, oflags, mode, type, openinfo)
 		 * that in DB 2.0, so do that cast.
 		 */
 		if (file != NULL) {
-			if (oflags & O_CREAT && __os_exists(file, NULL) != 0)
+			if (oflags & O_CREAT &&
+			    __os_exists(NULL, file, NULL) != 0)
 				if (__os_openhandle(NULL, file,
 				    oflags, mode, &fhp) == 0)
 					(void)__os_closehandle(NULL, fhp);
@@ -546,7 +535,14 @@ db185_compare(dbp, a, b)
 	DB *dbp;
 	const DBT *a, *b;
 {
-	return (((DB185 *)dbp->api_internal)->compare(a, b));
+	DBT185 a185, b185;
+
+	a185.data = a->data;
+	a185.size = a->size;
+	b185.data = b->data;
+	b185.size = b->size;
+
+	return (((DB185 *)dbp->api_internal)->compare(&a185, &b185));
 }
 
 /*
@@ -558,7 +554,14 @@ db185_prefix(dbp, a, b)
 	DB *dbp;
 	const DBT *a, *b;
 {
-	return (((DB185 *)dbp->api_internal)->prefix(a, b));
+	DBT185 a185, b185;
+
+	a185.data = a->data;
+	a185.size = a->size;
+	b185.data = b->data;
+	b185.size = b->size;
+
+	return (((DB185 *)dbp->api_internal)->prefix(&a185, &b185));
 }
 
 /*
diff --git a/db/db185/db185_int.in b/db/db185/db185_int.in
index f9bfdbba0..acc44c91a 100644
--- a/db/db185/db185_int.in
+++ b/db/db185/db185_int.in
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994, 1995, 1996
@@ -36,7 +36,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db185_int.in,v 11.14 2004/01/28 03:35:59 bostic Exp $
+ * $Id: db185_int.in,v 12.4 2006/08/24 14:45:17 bostic Exp $
  */
 
 #ifndef _DB185_INT_H_
@@ -82,8 +82,8 @@ typedef struct __db185 {
 	 */
 	DBC	  *dbc;			/* DB cursor. */
 					/* Various callback functions. */
-	int	  (*compare) __P((const DBT *, const DBT *));
-	size_t	  (*prefix) __P((const DBT *, const DBT *));
+	int	  (*compare) __P((const DBT185 *, const DBT185 *));
+	size_t	  (*prefix) __P((const DBT185 *, const DBT185 *));
 	u_int32_t (*hash) __P((const void *, size_t));
 } DB185;
 
@@ -96,9 +96,9 @@ typedef struct {
 	u_int32_t minkeypage;	/* minimum keys per page */
 	u_int32_t psize;	/* page size */
 	int	(*compare)	/* comparison function */
-	    __P((const DBT *, const DBT *));
+	    __P((const DBT185 *, const DBT185 *));
 	size_t	(*prefix)	/* prefix function */
-	    __P((const DBT *, const DBT *));
+	    __P((const DBT185 *, const DBT185 *));
 	int	lorder;		/* byte order */
 } BTREEINFO;
 
diff --git a/db/db_archive/db_archive.c b/db/db_archive/db_archive.c
index d5db42dee..48094e20f 100644
--- a/db/db_archive/db_archive.c
+++ b/db/db_archive/db_archive.c
@@ -1,33 +1,26 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_archive.c,v 11.46 2004/06/10 01:00:08 bostic Exp $
+ * $Id: db_archive.c,v 12.9 2006/08/26 09:23:00 bostic Exp $
  */
 
 #include "db_config.h"
 
+#include "db_int.h"
+
 #ifndef lint
 static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#include 
-#include 
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
 #endif
 
-#include "db_int.h"
-
 int main __P((int, char *[]));
 int usage __P((void));
-int version_check __P((const char *));
+int version_check __P((void));
+
+const char *progname;
 
 int
 main(argc, argv)
@@ -36,13 +29,17 @@ main(argc, argv)
 {
 	extern char *optarg;
 	extern int optind;
-	const char *progname = "db_archive";
 	DB_ENV	*dbenv;
 	u_int32_t flags;
 	int ch, exitval, ret, verbose;
 	char **file, *home, **list, *passwd;
 
-	if ((ret = version_check(progname)) != 0)
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
 		return (ret);
 
 	dbenv = NULL;
@@ -80,6 +77,12 @@ main(argc, argv)
 			printf("%s\n", db_version(NULL, NULL, NULL));
 			return (EXIT_SUCCESS);
 		case 'v':
+			/*
+			 * !!!
+			 * The verbose flag no longer actually does anything,
+			 * but it's left rather than adding it back at some
+			 * future date.
+			 */
 			verbose = 1;
 			break;
 		case '?':
@@ -117,8 +120,7 @@ main(argc, argv)
 	 * If attaching to a pre-existing environment fails, create a
 	 * private one and try again.
 	 */
-	if ((ret = dbenv->open(dbenv,
-	    home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 &&
+	if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
 	    (ret == DB_VERSION_MISMATCH ||
 	    (ret = dbenv->open(dbenv, home, DB_CREATE |
 	    DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) {
@@ -161,13 +163,12 @@ int
 usage()
 {
 	(void)fprintf(stderr,
-	    "usage: db_archive [-adlsVv] [-h home] [-P password]\n");
+	    "usage: %s [-adlsVv] [-h home] [-P password]\n", progname);
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
diff --git a/db/db_checkpoint/db_checkpoint.c b/db/db_checkpoint/db_checkpoint.c
index 538b66ddc..df0e5e286 100644
--- a/db/db_checkpoint/db_checkpoint.c
+++ b/db/db_checkpoint/db_checkpoint.c
@@ -1,47 +1,26 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_checkpoint.c,v 11.54 2004/03/24 15:13:12 bostic Exp $
+ * $Id: db_checkpoint.c,v 12.15 2006/08/26 09:23:25 bostic Exp $
  */
 
 #include "db_config.h"
 
+#include "db_int.h"
+
 #ifndef lint
 static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#if TIME_WITH_SYS_TIME
-#include 
-#include 
-#else
-#if HAVE_SYS_TIME_H
-#include 
-#else
-#include 
-#endif
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
 #endif
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#endif
-
-#include "db_int.h"
-#include "dbinc/db_page.h"
-#include "dbinc/db_am.h"
-
 int	 main __P((int, char *[]));
 int	 usage __P((void));
-int	 version_check __P((const char *));
+int	 version_check __P((void));
+
+const char *progname;
 
 int
 main(argc, argv)
@@ -51,14 +30,18 @@ main(argc, argv)
 	extern char *optarg;
 	extern int optind;
 	DB_ENV	*dbenv;
-	const char *progname = "db_checkpoint";
 	time_t now;
 	long argval;
 	u_int32_t flags, kbytes, minutes, seconds;
 	int ch, exitval, once, ret, verbose;
-	char *home, *logfile, *passwd;
+	char *home, *logfile, *passwd, time_buf[CTIME_BUFLEN];
+
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
 
-	if ((ret = version_check(progname)) != 0)
+	if ((ret = version_check()) != 0)
 		return (ret);
 
 	/*
@@ -86,7 +69,7 @@ main(argc, argv)
 			if (__db_getlong(NULL, progname,
 			    optarg, 1, (long)MAX_UINT32_T, &argval))
 				return (EXIT_FAILURE);
-			kbytes = argval;
+			kbytes = (u_int32_t)argval;
 			break;
 		case 'L':
 			logfile = optarg;
@@ -104,7 +87,7 @@ main(argc, argv)
 			if (__db_getlong(NULL, progname,
 			    optarg, 1, (long)MAX_UINT32_T, &argval))
 				return (EXIT_FAILURE);
-			minutes = argval;
+			minutes = (u_int32_t)argval;
 			break;
 		case 'V':
 			printf("%s\n", db_version(NULL, NULL, NULL));
@@ -126,7 +109,7 @@ main(argc, argv)
 		(void)fprintf(stderr,
 		    "%s: at least one of -1, -k and -p must be specified\n",
 		    progname);
-		return (EXIT_FAILURE);
+		return (usage());
 	}
 
 	/* Handle possible interruptions. */
@@ -154,18 +137,16 @@ main(argc, argv)
 		dbenv->err(dbenv, ret, "set_passwd");
 		goto shutdown;
 	}
-	/* Initialize the environment. */
-	if ((ret = dbenv->open(dbenv,
-	    home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0) {
-		dbenv->err(dbenv, ret, "open");
-		goto shutdown;
-	}
 
-	/* Register the standard pgin/pgout functions, in case we do I/O. */
-	if ((ret = dbenv->memp_register(
-	    dbenv, DB_FTYPE_SET, __db_pgin, __db_pgout)) != 0) {
-		dbenv->err(dbenv, ret,
-    "DB_ENV->memp_register: failed to register access method functions");
+	/*
+	 * If attaching to a pre-existing environment fails, create a
+	 * private one and try again.
+	 */
+	if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
+	    (!once || ret == DB_VERSION_MISMATCH ||
+	    (ret = dbenv->open(dbenv, home,
+	    DB_CREATE | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) {
+		dbenv->err(dbenv, ret, "DB_ENV->open");
 		goto shutdown;
 	}
 
@@ -178,7 +159,8 @@ main(argc, argv)
 	while (!__db_util_interrupted()) {
 		if (verbose) {
 			(void)time(&now);
-			dbenv->errx(dbenv, "checkpoint begin: %s", ctime(&now));
+			dbenv->errx(dbenv,
+		    "checkpoint begin: %s", __db_ctime(&now, time_buf));
 		}
 
 		if ((ret = dbenv->txn_checkpoint(dbenv,
@@ -190,7 +172,7 @@ main(argc, argv)
 		if (verbose) {
 			(void)time(&now);
 			dbenv->errx(dbenv,
-			    "checkpoint complete: %s", ctime(&now));
+		    "checkpoint complete: %s", __db_ctime(&now, time_buf));
 		}
 
 		if (once)
@@ -205,7 +187,7 @@ shutdown:	exitval = 1;
 
 	/* Clean up the logfile. */
 	if (logfile != NULL)
-		remove(logfile);
+		(void)remove(logfile);
 
 	/* Clean up the environment. */
 	if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
@@ -226,15 +208,13 @@ shutdown:	exitval = 1;
 int
 usage()
 {
-	(void)fprintf(stderr, "%s\n\t%s\n",
-	    "usage: db_checkpoint [-1Vv]",
+	(void)fprintf(stderr, "usage: %s [-1Vv]\n\t%s\n", progname,
 	    "[-h home] [-k kbytes] [-L file] [-P password] [-p min]");
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
diff --git a/db/db_deadlock/db_deadlock.c b/db/db_deadlock/db_deadlock.c
index cc91db25d..4e82bfef5 100644
--- a/db/db_deadlock/db_deadlock.c
+++ b/db/db_deadlock/db_deadlock.c
@@ -1,45 +1,26 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_deadlock.c,v 11.45 2004/03/24 15:13:12 bostic Exp $
+ * $Id: db_deadlock.c,v 12.13 2006/08/26 09:23:00 bostic Exp $
  */
 
 #include "db_config.h"
 
+#include "db_int.h"
+
 #ifndef lint
 static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#if TIME_WITH_SYS_TIME
-#include 
-#include 
-#else
-#if HAVE_SYS_TIME_H
-#include 
-#else
-#include 
-#endif
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
 #endif
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#endif
-
-#include "db_int.h"
-
 int main __P((int, char *[]));
 int usage __P((void));
-int version_check __P((const char *));
+int version_check __P((void));
+
+const char *progname;
 
 int
 main(argc, argv)
@@ -48,23 +29,27 @@ main(argc, argv)
 {
 	extern char *optarg;
 	extern int optind;
-	const char *progname = "db_deadlock";
 	DB_ENV  *dbenv;
 	u_int32_t atype;
 	time_t now;
 	u_long secs, usecs;
 	int ch, exitval, ret, verbose;
-	char *home, *logfile, *str;
+	char *home, *logfile, *passwd, *str, time_buf[CTIME_BUFLEN];
 
-	if ((ret = version_check(progname)) != 0)
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
 		return (ret);
 
 	dbenv = NULL;
 	atype = DB_LOCK_DEFAULT;
-	home = logfile = NULL;
+	home = logfile = passwd = NULL;
 	secs = usecs = 0;
 	exitval = verbose = 0;
-	while ((ch = getopt(argc, argv, "a:h:L:t:Vvw")) != EOF)
+	while ((ch = getopt(argc, argv, "a:h:L:P:t:Vv")) != EOF)
 		switch (ch) {
 		case 'a':
 			switch (optarg[0]) {
@@ -102,6 +87,15 @@ main(argc, argv)
 		case 'L':
 			logfile = optarg;
 			break;
+		case 'P':
+			passwd = strdup(optarg);
+			memset(optarg, 0, strlen(optarg));
+			if (passwd == NULL) {
+				fprintf(stderr, "%s: strdup: %s\n",
+				    progname, strerror(errno));
+				return (EXIT_FAILURE);
+			}
+			break;
 		case 't':
 			if ((str = strchr(optarg, '.')) != NULL) {
 				*str++ = '\0';
@@ -116,18 +110,12 @@ main(argc, argv)
 				return (usage());
 
 			break;
-
 		case 'V':
 			printf("%s\n", db_version(NULL, NULL, NULL));
 			return (EXIT_SUCCESS);
 		case 'v':
 			verbose = 1;
 			break;
-		case 'w':			/* Undocumented. */
-			/* Detect every 100ms (100000 us) when polling. */
-			secs = 0;
-			usecs = 100000;
-			break;
 		case '?':
 		default:
 			return (usage());
@@ -158,14 +146,19 @@ main(argc, argv)
 	dbenv->set_errfile(dbenv, stderr);
 	dbenv->set_errpfx(dbenv, progname);
 
+	if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
+	    passwd, DB_ENCRYPT_AES)) != 0) {
+		dbenv->err(dbenv, ret, "set_passwd");
+		goto shutdown;
+	}
+
 	if (verbose) {
 		(void)dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, 1);
 		(void)dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR, 1);
 	}
 
 	/* An environment is required. */
-	if ((ret =
-	    dbenv->open(dbenv, home, DB_INIT_LOCK | DB_USE_ENVIRON, 0)) != 0) {
+	if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0) {
 		dbenv->err(dbenv, ret, "open");
 		goto shutdown;
 	}
@@ -173,7 +166,8 @@ main(argc, argv)
 	while (!__db_util_interrupted()) {
 		if (verbose) {
 			(void)time(&now);
-			dbenv->errx(dbenv, "running at %.24s", ctime(&now));
+			dbenv->errx(dbenv,
+			    "running at %.24s", __db_ctime(&now, time_buf));
 		}
 
 		if ((ret = dbenv->lock_detect(dbenv, 0, atype, NULL)) != 0) {
@@ -202,6 +196,9 @@ shutdown:	exitval = 1;
 		    "%s: dbenv->close: %s\n", progname, db_strerror(ret));
 	}
 
+	if (passwd != NULL)
+		free(passwd);
+
 	/* Resend any caught signal. */
 	__db_util_sigresend();
 
@@ -211,15 +208,14 @@ shutdown:	exitval = 1;
 int
 usage()
 {
-	(void)fprintf(stderr, "%s\n\t%s\n",
-	    "usage: db_deadlock [-Vv]",
-	    "[-a e | m | n | o | W | w | y] [-h home] [-L file] [-t sec.usec]");
+	(void)fprintf(stderr,
+	    "usage: %s [-Vv] [-a e | m | n | o | W | w | y]\n\t%s\n", progname,
+	    "[-h home] [-L file] [-P password] [-t sec.usec]");
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
diff --git a/db/db_dump/db_dump.c b/db/db_dump/db_dump.c
index 732a4c62f..9202e53c7 100644
--- a/db/db_dump/db_dump.c
+++ b/db/db_dump/db_dump.c
@@ -1,39 +1,32 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_dump.c,v 11.99 2004/10/11 18:53:13 bostic Exp $
+ * $Id: db_dump.c,v 12.9 2006/08/26 09:23:01 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef lint
-static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
 
+#ifndef lint
+static const char copyright[] =
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
+#endif
+
 int	 db_init __P((DB_ENV *, char *, int, u_int32_t, int *));
 int	 dump_sub __P((DB_ENV *, DB *, char *, int, int));
 int	 is_sub __P((DB *, int *));
 int	 main __P((int, char *[]));
 int	 show_subs __P((DB *));
 int	 usage __P((void));
-int	 version_check __P((const char *));
+int	 version_check __P((void));
+
+const char *progname;
 
 int
 main(argc, argv)
@@ -42,7 +35,6 @@ main(argc, argv)
 {
 	extern char *optarg;
 	extern int optind;
-	const char *progname = "db_dump";
 	DB_ENV	*dbenv;
 	DB *dbp;
 	u_int32_t cache;
@@ -51,7 +43,12 @@ main(argc, argv)
 	int ret, Rflag, rflag, resize, subs;
 	char *dopt, *home, *passwd, *subname;
 
-	if ((ret = version_check(progname)) != 0)
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
 		return (ret);
 
 	dbenv = NULL;
@@ -223,7 +220,7 @@ retry:	if ((ret = db_env_create(&dbenv, 0)) != 0) {
 	}
 
 	if (dopt != NULL) {
-		if ((ret = __db_dumptree(dbp, dopt, NULL)) != 0) {
+		if ((ret = __db_dumptree(dbp, NULL, dopt, NULL)) != 0) {
 			dbp->err(dbp, ret, "__db_dumptree: %s", argv[0]);
 			goto err;
 		}
@@ -291,7 +288,7 @@ db_init(dbenv, home, is_salvage, cache, is_privatep)
 	 * We wish to use the buffer pool so our information is as up-to-date
 	 * as possible, even if the mpool cache hasn't been flushed.
 	 *
-	 * If we are not doing a salvage, we wish to use the DB_JOINENV flag;
+	 * If we are not doing a salvage, we want to join the environment;
 	 * if a locking system is present, this will let us use it and be
 	 * safe to run concurrently with other threads of control.  (We never
 	 * need to use transactions explicitly, as we're read-only.)  Note
@@ -305,8 +302,8 @@ db_init(dbenv, home, is_salvage, cache, is_privatep)
 	 * before we create our own.
 	 */
 	*is_privatep = 0;
-	if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON |
-	    (is_salvage ? DB_INIT_MPOOL : DB_JOINENV), 0)) == 0)
+	if ((ret = dbenv->open(dbenv, home,
+	    DB_USE_ENVIRON | (is_salvage ? DB_INIT_MPOOL : 0), 0)) == 0)
 		return (0);
 	if (ret == DB_VERSION_MISMATCH)
 		goto err;
@@ -490,15 +487,14 @@ show_subs(dbp)
 int
 usage()
 {
-	(void)fprintf(stderr, "%s\n\t%s\n",
-	    "usage: db_dump [-klNprRV]",
+	(void)fprintf(stderr, "usage: %s [-klNprRV]\n\t%s\n",
+	    progname,
     "[-d ahr] [-f output] [-h home] [-P password] [-s database] db_file");
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
diff --git a/db/db_dump185/db_dump185.c b/db/db_dump185/db_dump185.c
index 2fb3cc5ab..14968a3dd 100644
--- a/db/db_dump185/db_dump185.c
+++ b/db/db_dump185/db_dump185.c
@@ -1,15 +1,15 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_dump185.c,v 11.19 2004/01/28 03:36:00 bostic Exp $
+ * $Id: db_dump185.c,v 12.4 2006/08/26 09:23:04 bostic Exp $
  */
 
 #ifndef lint
 static char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
 #endif
 
 #include 
diff --git a/db/db_hotbackup/db_hotbackup.c b/db/db_hotbackup/db_hotbackup.c
new file mode 100644
index 000000000..6bafd3659
--- /dev/null
+++ b/db/db_hotbackup/db_hotbackup.c
@@ -0,0 +1,824 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
+ *
+ * $Id: db_hotbackup.c,v 1.30 2006/08/26 09:23:07 bostic Exp $
+ */
+
+#include "db_config.h"
+
+#include "db_int.h"
+#include "dbinc/log.h"
+#include "dbinc/db_page.h"
+#include "dbinc/qam.h"
+
+#ifndef lint
+static const char copyright[] =
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
+#endif
+
+enum which_open { OPEN_ORIGINAL, OPEN_HOT_BACKUP };
+
+int backup_dir_clean __P((DB_ENV *, char *, int *, int, int));
+int data_copy __P((DB_ENV *, const char *, const char *, const char *, int));
+int env_init __P((DB_ENV **,
+     char *, const char **, const char ***, char *, enum which_open));
+int main __P((int, char *[]));
+int read_data_dir __P((DB_ENV *, char *, char *, const char *, int, int));
+int read_log_dir __P((DB_ENV *, char *, char *, const char *, int *, int, int));
+int usage __P((void));
+int version_check __P((void));
+
+const char *progname;
+
+int
+main(argc, argv)
+	int argc;
+	char *argv[];
+{
+	extern char *optarg;
+	extern int optind;
+	time_t now;
+	DB_ENV *dbenv;
+	u_int data_cnt, data_next;
+	int ch, checkpoint, copy_min, db_config, exitval;
+	int remove_max, ret, update, verbose;
+	char *backup_dir, **data_dir, *home, *passwd;
+	const char **ddir, **dir, *log_dir;
+	char home_buf[DB_MAXPATHLEN], time_buf[CTIME_BUFLEN];
+
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
+		return (ret);
+
+	checkpoint = db_config = data_cnt =
+	    data_next = exitval = update = verbose = 0;
+	data_dir = NULL;
+	backup_dir = home = passwd = NULL;
+	log_dir = NULL;
+	copy_min = remove_max = 0;
+	while ((ch = getopt(argc, argv, "b:cDd:h:l:P:uVv")) != EOF)
+		switch (ch) {
+		case 'b':
+			backup_dir = optarg;
+			break;
+		case 'c':
+			checkpoint = 1;
+			break;
+		case 'D':
+			db_config = 1;
+			break;
+		case 'd':
+			/*
+			 * User can specify a list of directories -- keep an
+			 * array, leaving room for the trailing NULL.
+			 */
+			if (data_dir == NULL || data_next >= data_cnt - 2) {
+				data_cnt = data_cnt == 0 ? 20 : data_cnt * 2;
+				if ((data_dir = realloc(data_dir,
+				    data_cnt * sizeof(*data_dir))) == NULL) {
+					fprintf(stderr, "%s: %s\n",
+					    progname, strerror(errno));
+					return (EXIT_FAILURE);
+				}
+			}
+			data_dir[data_next++] = optarg;
+			break;
+		case 'h':
+			home = optarg;
+			break;
+		case 'l':
+			log_dir = optarg;
+			break;
+		case 'P':
+			passwd = strdup(optarg);
+			memset(optarg, 0, strlen(optarg));
+			if (passwd == NULL) {
+				fprintf(stderr, "%s: strdup: %s\n",
+				    progname, strerror(errno));
+				return (EXIT_FAILURE);
+			}
+			break;
+		case 'u':
+			update = 1;
+			break;
+		case 'V':
+			printf("%s\n", db_version(NULL, NULL, NULL));
+			return (EXIT_SUCCESS);
+		case 'v':
+			verbose = 1;
+			break;
+		case '?':
+		default:
+			return (usage());
+		}
+	argc -= optind;
+	argv += optind;
+
+	if (argc != 0)
+		return (usage());
+
+	if (db_config && (data_dir != NULL || log_dir != NULL)) {
+		fprintf(stderr,
+		     "%s: cannot specify -D and -d or -l\n", progname);
+		return (usage());
+	}
+
+	/* Handle possible interruptions. */
+	__db_util_siginit();
+
+	/*
+	 * The home directory defaults to the environment variable DB_HOME.
+	 * The log directory defaults to the home directory.
+	 *
+	 * We require a source database environment directory and a target
+	 * backup directory.
+	 */
+	if (home == NULL) {
+		home = home_buf;
+		if ((ret = __os_getenv(
+		    NULL, "DB_HOME", &home, sizeof(home_buf))) != 0) {
+			fprintf(stderr,
+		    "%s failed to get environment variable DB_HOME: %s\n",
+			    progname, db_strerror(ret));
+			return (EXIT_FAILURE);
+		}
+		/*
+		 * home set to NULL if __os_getenv failed to find DB_HOME.
+		 */
+	}
+	if (home == NULL) {
+		fprintf(stderr,
+		    "%s: no source database environment specified\n", progname);
+		return (usage());
+	}
+	if (backup_dir == NULL) {
+		fprintf(stderr,
+		    "%s: no target backup directory specified\n", progname);
+		return (usage());
+	}
+
+	/* NULL-terminate any list of data directories. */
+	if (data_dir != NULL)
+		data_dir[data_next] = NULL;
+
+	if (verbose) {
+		(void)time(&now);
+		printf("%s: hot backup started at %s",
+		    progname, __db_ctime(&now, time_buf));
+	}
+
+	ddir = NULL;
+	/* Open the source environment. */
+	if ((ret = env_init(&dbenv, home,
+	     (db_config || log_dir != NULL) ? &log_dir : NULL,
+	     db_config ? &ddir : NULL, passwd, OPEN_ORIGINAL)) != 0)
+		goto shutdown;
+
+	if (!db_config)
+		ddir = (const char **)data_dir;
+
+	if (log_dir == NULL)
+		log_dir = home;
+
+	if (db_config && __os_abspath(log_dir)) {
+		fprintf(stderr,
+	"%s: DB_CONFIG must not contain an absolute path for the log directory",
+		    progname);
+		goto shutdown;
+	}
+
+	/*
+	 * If the -c option is specified, checkpoint the source home
+	 * database environment, and remove any unnecessary log files.
+	 */
+	if (checkpoint) {
+		if (verbose)
+			printf("%s: %s: force checkpoint\n", progname, home);
+		if ((ret =
+		    dbenv->txn_checkpoint(dbenv, 0, 0, DB_FORCE)) != 0) {
+			dbenv->err(dbenv, ret, "DB_ENV->txn_checkpoint");
+			goto shutdown;
+		}
+		if (!update) {
+			if (verbose)
+				printf("%s: %s: remove unnecessary log files\n",
+				    progname, home);
+			if ((ret = dbenv->log_archive(dbenv,
+			     NULL, DB_ARCH_REMOVE)) != 0) {
+				dbenv->err(dbenv, ret, "DB_ENV->log_archive");
+				goto shutdown;
+			}
+		}
+	}
+
+	/*
+	 * If the target directory for the backup does not exist, create it
+	 * with mode read-write-execute for the owner.  Ignore errors here,
+	 * it's simpler and more portable to just always try the create.  If
+	 * there's a problem, we'll fail with reasonable errors later.
+	 */
+	(void)__os_mkdir(NULL, backup_dir, __db_omode("rwx------"));
+
+	/*
+	 * If the target directory for the backup does exist and the -u option
+	 * was specified, all log files in the target directory are removed;
+	 * if the -u option was not specified, all files in the target directory
+	 * are removed.
+	 */
+	if ((ret = backup_dir_clean(
+	    dbenv, backup_dir, &remove_max, update, verbose)) != 0)
+		goto shutdown;
+
+	/*
+	 * If the -u option was not specified, copy all database files found in
+	 * the database environment home directory, or any directory specified
+	 * using the -d option, into the target directory for the backup.
+	 */
+	if (!update) {
+		if (read_data_dir(dbenv, home,
+		     backup_dir, home, verbose, db_config) != 0)
+			goto shutdown;
+		if (ddir != NULL)
+			for (dir = &ddir[0]; *dir != NULL; ++dir) {
+				if (__os_abspath(*dir)) {
+					fprintf(stderr,
+     "%s: data directory '%s' is absolute path, not permitted with -D option\n",
+					     progname, *dir);
+					goto shutdown;
+				}
+				if (read_data_dir(dbenv, home,
+				     backup_dir, *dir, verbose, db_config) != 0)
+					goto shutdown;
+			}
+	}
+
+	/*
+	 * Copy all log files found in the directory specified by the -l option
+	 * (or in the database environment home directory, if no -l option was
+	 * specified), into the target directory for the backup.
+	 *
+	 * The log directory defaults to the home directory.
+	 */
+	if (read_log_dir(dbenv, db_config ? home : NULL,
+	     backup_dir, log_dir, ©_min, update, verbose) != 0)
+		goto shutdown;
+
+	/*
+	 * If we're updating a snapshot, the lowest-numbered log file copied
+	 * into the backup directory should be less than, or equal to, the
+	 * highest-numbered log file removed from the backup directory during
+	 * cleanup.
+	 */
+	if (update && remove_max < copy_min &&
+	     !(remove_max == 0 && copy_min == 1)) {
+		fprintf(stderr,
+		    "%s: the largest log file removed (%d) must be greater\n",
+		    progname, remove_max);
+		fprintf(stderr,
+		    "%s: than or equal the smallest log file copied (%d)\n",
+		    progname, copy_min);
+		goto shutdown;
+	}
+
+	/* Close the source environment. */
+	if ((ret = dbenv->close(dbenv, 0)) != 0) {
+		fprintf(stderr,
+		    "%s: dbenv->close: %s\n", progname, db_strerror(ret));
+		dbenv = NULL;
+		goto shutdown;
+	}
+	/* Perform catastrophic recovery on the hot backup. */
+	if (verbose)
+		printf("%s: %s: run catastrophic recovery\n",
+		    progname, backup_dir);
+	if ((ret = env_init(
+	    &dbenv, backup_dir, NULL, NULL, passwd, OPEN_HOT_BACKUP)) != 0)
+		goto shutdown;
+
+	/*
+	 * Remove any unnecessary log files from the hot backup.
+	 */
+	if (verbose)
+		printf("%s: %s: remove unnecessary log files\n",
+		    progname, backup_dir);
+	if ((ret =
+	    dbenv->log_archive(dbenv, NULL, DB_ARCH_REMOVE)) != 0) {
+		dbenv->err(dbenv, ret, "DB_ENV->log_archive");
+		goto shutdown;
+	}
+
+	if (0) {
+shutdown:	exitval = 1;
+	}
+	if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
+		exitval = 1;
+		fprintf(stderr,
+		    "%s: dbenv->close: %s\n", progname, db_strerror(ret));
+	}
+
+	if (data_dir != NULL)
+		free(data_dir);
+	if (passwd != NULL)
+		free(passwd);
+
+	if (exitval == 0) {
+		if (verbose) {
+			(void)time(&now);
+			printf("%s: hot backup completed at %s",
+			    progname, __db_ctime(&now, time_buf));
+		}
+	} else {
+		fprintf(stderr, "%s: HOT BACKUP FAILED!\n", progname);
+	}
+
+	/* Resend any caught signal. */
+	__db_util_sigresend();
+
+	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
+
+}
+
+/*
+ * env_init --
+ *	Open a database environment.
+ */
+int
+env_init(dbenvp, home, log_dir, data_dir, passwd, which)
+	DB_ENV **dbenvp;
+	char *home;
+	const char **log_dir, ***data_dir;
+	char *passwd;
+	enum which_open which;
+{
+	DB_ENV *dbenv;
+	int ret;
+
+	*dbenvp = NULL;
+
+	/*
+	 * Create an environment object and initialize it for error reporting.
+	 */
+	if ((ret = db_env_create(&dbenv, 0)) != 0) {
+		fprintf(stderr,
+		    "%s: db_env_create: %s\n", progname, db_strerror(ret));
+		return (1);
+	}
+
+	dbenv->set_errfile(dbenv, stderr);
+	setbuf(stderr, NULL);
+	dbenv->set_errpfx(dbenv, progname);
+	(void)setvbuf(stdout, NULL, _IOLBF, 0);
+
+	/*
+	 * If a log directory has been specified, and it's not the same as the
+	 * home directory, set it for the environment.
+	 */
+	if (log_dir != NULL && *log_dir != NULL && *log_dir != home &&
+	    (ret = dbenv->set_lg_dir(dbenv, *log_dir)) != 0) {
+		dbenv->err(dbenv, ret, "DB_ENV->set_lg_dir: %s", log_dir);
+		return (1);
+	}
+
+	/* Optionally set the password. */
+	if (passwd != NULL &&
+	    (ret = dbenv->set_encrypt(dbenv, passwd, DB_ENCRYPT_AES)) != 0) {
+		dbenv->err(dbenv, ret, "DB_ENV->set_encrypt");
+		return (1);
+	}
+
+	switch (which) {
+	case OPEN_ORIGINAL:
+		/*
+		 * Opening the database environment we're trying to back up.
+		 * We try to attach to a pre-existing environment; if that
+		 * fails, we create a private environment and try again.
+		 */
+		if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
+		    (ret == DB_VERSION_MISMATCH ||
+		    (ret = dbenv->open(dbenv, home, DB_CREATE |
+		    DB_INIT_LOG | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON,
+		    0)) != 0)) {
+			dbenv->err(dbenv, ret, "DB_ENV->open: %s", home);
+			return (1);
+		}
+		if (log_dir != NULL && *log_dir == NULL) {
+			(void)dbenv->get_lg_dir(dbenv, log_dir);
+			if (*log_dir == NULL)
+				*log_dir = home;
+		}
+		if (data_dir != NULL && *data_dir == NULL)
+			(void)dbenv->get_data_dirs(dbenv, data_dir);
+		break;
+	case OPEN_HOT_BACKUP:
+		/*
+		 * Opening the backup copy of the database environment.  We
+		 * better be the only user, we're running recovery.
+		 */
+		if ((ret = dbenv->open(dbenv, home, DB_CREATE |
+		    DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_PRIVATE |
+		    DB_RECOVER_FATAL | DB_USE_ENVIRON, 0)) != 0) {
+			dbenv->err(dbenv, ret, "DB_ENV->open: %s", home);
+			return (1);
+		}
+		break;
+	}
+
+	*dbenvp = dbenv;
+	return (0);
+}
+
+/*
+ * backup_dir_clean --
+ *	Clean out the backup directory.
+ */
+int
+backup_dir_clean(dbenv, backup_dir, remove_maxp, update, verbose)
+	DB_ENV *dbenv;
+	char *backup_dir;
+	int *remove_maxp, update, verbose;
+{
+	int cnt, fcnt, ret, v;
+	char **names, buf[DB_MAXPATHLEN];
+
+	/* Get a list of file names. */
+	if ((ret = __os_dirlist(dbenv, backup_dir, &names, &fcnt)) != 0) {
+		dbenv->err(dbenv, ret, "%s: directory read", backup_dir);
+		return (1);
+	}
+	for (cnt = fcnt; --cnt >= 0;) {
+		/*
+		 * Skip log files (if update wasn't specified).
+		 */
+		if (strncmp(names[cnt], LFPREFIX, sizeof(LFPREFIX) - 1)) {
+			if (update)
+				continue;
+		} else {
+			/* Track the highest-numbered log file removed. */
+			v = atoi(names[cnt] + sizeof(LFPREFIX) - 1);
+			if (*remove_maxp < v)
+				*remove_maxp = v;
+		}
+		if ((size_t)snprintf(buf, sizeof(buf),
+		    "%s/%s", backup_dir, names[cnt]) >= sizeof(buf)) {
+			dbenv->err(dbenv, ret,
+			    "%s/%s: path too long", backup_dir, names[cnt]);
+			return (1);
+		}
+		if (verbose)
+			printf("%s: removing %s\n", progname, buf);
+		if ((ret = remove(buf)) != 0) {
+			dbenv->err(dbenv, ret, "%s: remove", buf);
+			return (1);
+		}
+	}
+
+	__os_dirfree(dbenv, names, fcnt);
+
+	if (verbose && *remove_maxp != 0)
+		printf("%s: highest numbered log file removed: %d\n",
+		    progname, *remove_maxp);
+
+	return (0);
+}
+
+/*
+ * read_data_dir --
+ *	Read a directory looking for databases to copy.
+ */
+int
+read_data_dir(dbenv, home, backup_dir, dir, verbose, db_config)
+	DB_ENV *dbenv;
+	char *home, *backup_dir;
+	const char *dir;
+	int verbose, db_config;
+{
+	int cnt, fcnt, ret;
+	char *bd, **names;
+	char buf[DB_MAXPATHLEN], bbuf[DB_MAXPATHLEN];
+
+	bd = backup_dir;
+	if (db_config && dir != home) {
+		/* Build a path name to the destination. */
+		if ((size_t)(cnt = snprintf(bbuf, sizeof(bbuf),
+		      "%s/%s/", backup_dir, dir)) >= sizeof(buf)) {
+			dbenv->errx(dbenv,
+			     "%s/%s: path too long", backup_dir, dir);
+			return (1);
+		}
+		bd = bbuf;
+
+		/* Create the path. */
+		if ((ret = dbenv->set_intermediate_dir(
+		    dbenv, __db_omode("rwx------"), 0)) != 0 ||
+		    (ret = __db_mkpath(dbenv, bd)) != 0) {
+			dbenv->err(dbenv, ret, "%s: cannot create", bd);
+			return (1);
+		}
+		/* step on the trailing '/' */
+		bd[cnt] = '\0';
+
+		/* Build a path name to the source. */
+		if ((size_t)snprintf(buf, sizeof(buf),
+		    "%s/%s", home, dir) >= sizeof(buf)) {
+			dbenv->errx(dbenv,
+			    "%s/%s: path too long", home, dir);
+			return (1);
+		}
+		dir = buf;
+	}
+	/* Get a list of file names. */
+	if ((ret = __os_dirlist(dbenv, dir, &names, &fcnt)) != 0) {
+		dbenv->err(dbenv, ret, "%s: directory read", dir);
+		return (1);
+	}
+	for (cnt = fcnt; --cnt >= 0;) {
+		/*
+		 * Skip files in DB's name space (but not Queue
+		 * extent files, we need them).
+		 */
+		if (!strncmp(names[cnt], LFPREFIX, sizeof(LFPREFIX) - 1))
+			continue;
+		if (!strncmp(names[cnt],
+		    DB_REGION_PREFIX, sizeof(DB_REGION_PREFIX) - 1) &&
+		    strncmp(names[cnt],
+		    QUEUE_EXTENT_PREFIX, sizeof(QUEUE_EXTENT_PREFIX) - 1))
+			continue;
+
+		/*
+		 * Skip DB_CONFIG.
+		 */
+		if (!db_config &&
+		     !strncmp(names[cnt], "DB_CONFIG", sizeof("DB_CONFIG")))
+			continue;
+
+		/* Copy the file. */
+		if ((ret = data_copy(
+		    dbenv, names[cnt], dir, bd, verbose)) != 0)
+			return (1);
+	}
+
+	__os_dirfree(dbenv, names, fcnt);
+
+	return (0);
+}
+
+/*
+ * read_log_dir --
+ * *	Read a directory looking for log files to copy.  If home
+ * is passed then we are possibly using a log dir in the destination,
+ * following DB_CONFIG configuration.
+ */
+int
+read_log_dir(dbenv, home, backup_dir, log_dir, copy_minp, update, verbose)
+	DB_ENV *dbenv;
+	char *home, *backup_dir;
+	const char *log_dir;
+	int *copy_minp, update, verbose;
+{
+	u_int32_t aflag;
+	int cnt, ret, v;
+	char **begin, **names, *backupd;
+	const char *logd;
+	char from[DB_MAXPATHLEN], to[DB_MAXPATHLEN];
+
+	logd = log_dir;
+	backupd = backup_dir;
+	if (home != NULL && log_dir != home) {
+		if ((size_t)snprintf(from, sizeof(from),
+		    "%s/%s", home, log_dir) >= sizeof(from)) {
+			dbenv->errx(dbenv,
+			    "%s/%s: path too long", home, log_dir);
+			return (1);
+		}
+		logd = strdup(from);
+		if ((size_t)(cnt = snprintf(to, sizeof(to),
+		    "%s/%s/", backup_dir, log_dir)) >= sizeof(to)) {
+			dbenv->errx(dbenv,
+			    "%s/%s: path too long", backup_dir, log_dir);
+			return (1);
+		}
+		backupd = strdup(to);
+		/* Create the path. */
+		if ((ret = dbenv->set_intermediate_dir(
+		    dbenv, __db_omode("rwx------"), 0)) != 0 ||
+		    (ret = __db_mkpath(dbenv, backupd)) != 0) {
+			dbenv->err(dbenv, ret, "%s: cannot create", backupd);
+			return (1);
+		}
+		/* step on the trailing '/' */
+		backupd[cnt] = '\0';
+	}
+
+again:	aflag = DB_ARCH_LOG;
+
+	/*
+	 * If this is an update and we are deleting files, first process
+	 * those files that can be removed, then repeat with the rest.
+	 */
+	if (update)
+		aflag = 0;
+	/* Get a list of file names to be copied. */
+	if ((ret = dbenv->log_archive(dbenv, &names, aflag)) != 0) {
+		dbenv->err(dbenv, ret, "%s: log_archive", log_dir);
+		return (1);
+	}
+	if (names == NULL)
+		goto done;
+	begin = names;
+	for (; *names != NULL; names++) {
+		/* Track the lowest-numbered log file copied. */
+		v = atoi(*names + sizeof(LFPREFIX) - 1);
+		if (*copy_minp == 0 || *copy_minp > v)
+			*copy_minp = v;
+
+		if ((size_t)snprintf(from, sizeof(from),
+		    "%s/%s", logd, *names) >= sizeof(from)) {
+			dbenv->errx(dbenv,
+			    "%s/%s: path too long", log_dir, *names);
+			return (1);
+		}
+
+		/*
+		 * If we're going to remove the file, attempt to rename the
+		 * instead of copying and then removing.  The likely failure
+		 * is EXDEV (source and destination are on different volumes).
+		 * Fall back to a copy, regardless of the error.  We don't
+		 * worry about partial contents, the copy truncates the file
+		 * on open.
+		 */
+		if (update) {
+			if ((size_t)snprintf(to, sizeof(to),
+			    "%s/%s", backupd, *names) >= sizeof(to)) {
+				dbenv->errx(dbenv,
+				    "%s/%s: path too long", backupd, *names);
+				return (1);
+			}
+			if (rename(from, to) == 0) {
+				if (verbose)
+					printf("%s: moving %s to %s\n",
+					   progname, from, to);
+				continue;
+			}
+		}
+
+		/* Copy the file. */
+		if ((ret = data_copy(dbenv,
+		    *names, logd, backupd, verbose)) != 0)
+			return (1);
+
+		if (update) {
+			if (verbose)
+				printf("%s: removing %s\n", progname, from);
+			if ((ret = __os_unlink(dbenv, from)) != 0) {
+				dbenv->err(dbenv, ret,
+				     "unlink of %s failed", from);
+				return (1);
+			}
+		}
+
+	}
+
+	free(begin);
+done:	if (update) {
+		update = 0;
+		goto again;
+	}
+
+	if (verbose && *copy_minp != 0)
+		printf("%s: lowest numbered log file copied: %d\n",
+		    progname, *copy_minp);
+	if (logd != log_dir)
+		free((char *)logd);
+	if (backupd != backup_dir)
+		free(backupd);
+
+	return (0);
+}
+
+/*
+ * data_copy --
+ *	Copy a file into the backup directory.
+ */
+int
+data_copy(dbenv, file, from_dir, to_dir, verbose)
+	DB_ENV *dbenv;
+	const char *file, *from_dir, *to_dir;
+	int verbose;
+{
+	ssize_t nr, nw;
+	size_t offset;
+	int ret, rfd, wfd;
+	char *buf, *taddr;
+
+	ret = 0;
+	rfd = wfd = -1;
+
+	if (verbose)
+		printf("%s: copying %s/%s to %s/%s\n",
+		    progname, from_dir, file, to_dir, file);
+
+	/*
+	 * We MUST copy multiples of the page size, atomically, to ensure a
+	 * database page is not updated by another thread of control during
+	 * the copy.
+	 *
+	 * !!!
+	 * The current maximum page size for Berkeley DB is 64KB; we will have
+	 * to increase this value if the maximum page size is ever more than a
+	 * megabyte
+	 */
+	if ((buf = malloc(MEGABYTE)) == NULL) {
+		dbenv->err(dbenv,
+		    errno, "%lu buffer allocation", (u_long)MEGABYTE);
+		return (1);
+	}
+
+	/* Open the input file. */
+	if ((u_int32_t)snprintf(
+	    buf, MEGABYTE, "%s/%s", from_dir, file) >= MEGABYTE) {
+		dbenv->errx(dbenv, "%s/%s: path too long", from_dir, file);
+		goto err;
+	}
+	if ((rfd = open(buf, O_RDONLY, 0)) == -1) {
+		dbenv->err(dbenv, errno, "%s", buf);
+		goto err;
+	}
+
+	/* Open the output file. */
+	if ((u_int32_t)snprintf(
+	    buf, MEGABYTE, "%s/%s", to_dir, file) >= MEGABYTE) {
+		dbenv->errx(dbenv, "%s/%s: path too long", to_dir, file);
+		goto err;
+	}
+	if ((wfd = open(
+	    buf, O_CREAT | O_TRUNC | O_WRONLY, __db_omode(OWNER_RW))) == -1)
+		goto err;
+
+	/* Copy the data. */
+	while ((nr = read(rfd, buf, MEGABYTE)) > 0)
+		for (taddr = buf, offset = 0;
+		    offset < (size_t)nr; taddr += nw, offset += (size_t)nw) {
+			RETRY_CHK(((nw = write(wfd,
+			    taddr, (u_int)(nr - offset))) < 0 ? 1 : 0), ret);
+			if (ret != 0)
+				break;
+		}
+	if (nr == -1) {
+		dbenv->err(dbenv, errno, "%s/%s: read", from_dir, file);
+		goto err;
+	}
+
+	if (ret != 0) {
+		dbenv->err(dbenv, errno, "%s: write %s/%s", to_dir, file);
+		goto err;
+	}
+
+	if (0) {
+err:		ret = 1;
+	}
+	if (buf != NULL)
+		free(buf);
+
+	if (rfd != -1)
+		(void)close(rfd);
+
+	/* We may be running on a remote filesystem; force the flush. */
+	if (wfd != -1 && (fsync(wfd) != 0 || close(wfd) != 0)) {
+		dbenv->err(dbenv,
+		    errno, "%s: fsync %s/%s", to_dir, file);
+		ret = 1;
+	}
+	return (ret);
+}
+
+int
+usage()
+{
+	(void)fprintf(stderr, "usage: %s [-cDuVv]\n\t%s\n", progname,
+    "[-d data_dir ...] [-h home] [-l log_dir] [-P password] -b backup_dir");
+	return (EXIT_FAILURE);
+}
+
+int
+version_check()
+{
+	int v_major, v_minor, v_patch;
+
+	/* Make sure we're loaded with the right version of the DB library. */
+	(void)db_version(&v_major, &v_minor, &v_patch);
+	if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) {
+		fprintf(stderr,
+	"%s: version %d.%d doesn't match library version %d.%d\n",
+		    progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
+		    v_major, v_minor);
+		return (EXIT_FAILURE);
+	}
+	return (0);
+}
diff --git a/db/db_load/db_load.c b/db/db_load/db_load.c
index db0caf42d..5cdfc79e8 100644
--- a/db/db_load/db_load.c
+++ b/db/db_load/db_load.c
@@ -1,33 +1,23 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_load.c,v 11.100 2004/10/29 17:29:02 bostic Exp $
+ * $Id: db_load.c,v 12.18 2006/08/26 09:23:08 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef lint
-static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
 
+#ifndef lint
+static const char copyright[] =
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
+#endif
+
 typedef struct {			/* XXX: Globals. */
 	const char *progname;		/* Program name. */
 	char	*hdrbuf;		/* Input file header. */
@@ -42,7 +32,7 @@ typedef struct {			/* XXX: Globals. */
 	u_int32_t cache;		/* Env cache size. */
 } LDG;
 
-void	badend __P((DB_ENV *));
+int	badend __P((DB_ENV *));
 void	badnum __P((DB_ENV *));
 int	configure __P((DB_ENV *, DB *, char **, char **, int *));
 int	convprintable __P((DB_ENV *, char *, char **));
@@ -51,13 +41,14 @@ int	dbt_rdump __P((DB_ENV *, DBT *));
 int	dbt_rprint __P((DB_ENV *, DBT *));
 int	dbt_rrecno __P((DB_ENV *, DBT *, int));
 int	dbt_to_recno __P((DB_ENV *, DBT *, db_recno_t *));
-int	digitize __P((DB_ENV *, int, int *));
 int	env_create __P((DB_ENV **, LDG *));
 int	load __P((DB_ENV *, char *, DBTYPE, char **, u_int, LDG *, int *));
 int	main __P((int, char *[]));
 int	rheader __P((DB_ENV *, DB *, DBTYPE *, char **, int *, int *));
 int	usage __P((void));
-int	version_check __P((const char *));
+int	version_check __P((void));
+
+const char *progname;
 
 #define	G(f)	((LDG *)dbenv->app_private)->f
 
@@ -81,7 +72,15 @@ main(argc, argv)
 	int ch, existed, exitval, ret;
 	char **clist, **clp;
 
-	ldg.progname = "db_load";
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
+		return (ret);
+
+	ldg.progname = progname;
 	ldg.lineno = 0;
 	ldg.endodata = ldg.endofile = 0;
 	ldg.version = 1;
@@ -90,9 +89,6 @@ main(argc, argv)
 	ldg.home = NULL;
 	ldg.passwd = NULL;
 
-	if ((ret = version_check(ldg.progname)) != 0)
-		return (ret);
-
 	mode = NOTSET;
 	ldf = 0;
 	exitval = existed = 0;
@@ -218,11 +214,11 @@ main(argc, argv)
 	switch (mode) {
 	case FILEID_RESET:
 		exitval = dbenv->fileid_reset(
-		    dbenv, argv[0], ldf & LDF_PASSWORD ? 1 : 0);
+		    dbenv, argv[0], ldf & LDF_PASSWORD ? DB_ENCRYPT : 0);
 		break;
 	case LSN_RESET:
 		exitval = dbenv->lsn_reset(
-		    dbenv, argv[0], ldf & LDF_PASSWORD ? 1 : 0);
+		    dbenv, argv[0], ldf & LDF_PASSWORD ? DB_ENCRYPT : 0);
 		break;
 	case NOTSET:
 	case STANDARD_LOAD:
@@ -401,7 +397,7 @@ retry_db:
 	/* Open the DB file. */
 	if ((ret = dbp->open(dbp, NULL, name, subdb, dbtype,
 	    DB_CREATE | (TXN_ON(dbenv) ? DB_AUTO_COMMIT : 0),
-	    __db_omode("rwrwrw"))) != 0) {
+	    __db_omode("rw-rw-rw-"))) != 0) {
 		dbp->err(dbp, ret, "DB->open: %s", name);
 		goto err;
 	}
@@ -529,7 +525,7 @@ retry:		if (txn != NULL)
 		}
 	}
 done:	rval = 0;
-	DB_ASSERT(ctxn == NULL);
+	DB_ASSERT(dbenv, ctxn == NULL);
 	if (txn != NULL && (ret = txn->commit(txn, 0)) != 0) {
 		txn = NULL;
 		goto err;
@@ -537,7 +533,7 @@ done:	rval = 0;
 
 	if (0) {
 err:		rval = 1;
-		DB_ASSERT(ctxn == NULL);
+		DB_ASSERT(dbenv, ctxn == NULL);
 		if (txn != NULL)
 			(void)txn->abort(txn);
 	}
@@ -652,23 +648,22 @@ err:	dbenv->err(dbenv, ret, "DB_ENV->open");
 			if ((ret = dbp->set_flags(dbp, flag)) != 0) {	\
 				dbp->err(dbp, ret, "%s: set_flags: %s",	\
 				    G(progname), name);			\
-				return (1);				\
+				goto err;				\
 			}						\
 			break;						\
 		case '0':						\
 			break;						\
 		default:						\
 			badnum(dbenv);					\
-			return (1);					\
+			goto err;					\
 		}							\
 		continue;						\
 	}
 #define	NUMBER(name, value, keyword, func, t)				\
 	if (strcmp(name, keyword) == 0) {				\
-		if (__db_getlong(dbenv,					\
-		    NULL, value, 1, LONG_MAX, &val) != 0)		\
-			return (1);					\
-		if ((ret = dbp->func(dbp, (t)val)) != 0)		\
+		if ((ret = __db_getlong(dbenv,				\
+		    NULL, value, 0, LONG_MAX, &val)) != 0 ||		\
+		    (ret = dbp->func(dbp, (t)val)) != 0)		\
 			goto nameerr;					\
 		continue;						\
 	}
@@ -679,6 +674,26 @@ err:	dbenv->err(dbenv, ret, "DB_ENV->open");
 		continue;						\
 	}
 
+/*
+ * The code to check a command-line or input header argument against a list
+ * of configuration options.  It's #defined because it's used in two places
+ * and the two places have gotten out of sync more than once.
+ */
+#define	CONFIGURATION_LIST_COMPARE					\
+	NUMBER(name, value, "bt_minkey", set_bt_minkey, u_int32_t);	\
+	  FLAG(name, value, "chksum", DB_CHKSUM);			\
+	NUMBER(name, value, "db_lorder", set_lorder, int);		\
+	NUMBER(name, value, "db_pagesize", set_pagesize, u_int32_t);	\
+	  FLAG(name, value, "duplicates", DB_DUP);			\
+	  FLAG(name, value, "dupsort", DB_DUPSORT);			\
+	NUMBER(name, value, "extentsize", set_q_extentsize, u_int32_t);	\
+	NUMBER(name, value, "h_ffactor", set_h_ffactor, u_int32_t);	\
+	NUMBER(name, value, "h_nelem", set_h_nelem, u_int32_t);		\
+	NUMBER(name, value, "re_len", set_re_len, u_int32_t);		\
+	STRING(name, value, "re_pad", set_re_pad);			\
+	  FLAG(name, value, "recnum", DB_RECNUM);			\
+	  FLAG(name, value, "renumber", DB_RENUMBER)
+
 /*
  * configure --
  *	Handle command-line configuration options.
@@ -725,21 +740,7 @@ configure(dbenv, dbp, clp, subdbp, keysp)
 			continue;
 		}
 
-#ifdef notyet
-		NUMBER(name, value, "bt_maxkey", set_bt_maxkey, u_int32_t);
-#endif
-		NUMBER(name, value, "bt_minkey", set_bt_minkey, u_int32_t);
-		NUMBER(name, value, "db_lorder", set_lorder, int);
-		NUMBER(name, value, "db_pagesize", set_pagesize, u_int32_t);
-		FLAG(name, value, "chksum", DB_CHKSUM);
-		FLAG(name, value, "duplicates", DB_DUP);
-		FLAG(name, value, "dupsort", DB_DUPSORT);
-		NUMBER(name, value, "h_ffactor", set_h_ffactor, u_int32_t);
-		NUMBER(name, value, "h_nelem", set_h_nelem, u_int32_t);
-		NUMBER(name, value, "re_len", set_re_len, u_int32_t);
-		STRING(name, value, "re_pad", set_re_pad);
-		FLAG(name, value, "recnum", DB_RECNUM);
-		FLAG(name, value, "renumber", DB_RENUMBER);
+		CONFIGURATION_LIST_COMPARE;
 
 		dbp->errx(dbp,
 		    "unknown command-line configuration keyword \"%s\"", name);
@@ -749,7 +750,7 @@ configure(dbenv, dbp, clp, subdbp, keysp)
 
 nameerr:
 	dbp->err(dbp, ret, "%s: %s=%s", G(progname), name, value);
-	return (1);
+err:	return (1);
 }
 
 /*
@@ -771,7 +772,7 @@ rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp)
 
 	*dbtypep = DB_UNKNOWN;
 	*checkprintp = 0;
-	name = p = NULL;
+	name = NULL;
 
 	/*
 	 * We start with a smallish buffer;  most headers are small.
@@ -780,10 +781,8 @@ rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp)
 	buflen = 4096;
 	if (G(hdrbuf) == NULL) {
 		hdr = 0;
-		if ((buf = malloc(buflen)) == NULL) {
-memerr:			dbp->errx(dbp, "could not allocate buffer %d", buflen);
-			return (1);
-		}
+		if ((buf = malloc(buflen)) == NULL)
+			goto memerr;
 		G(hdrbuf) = buf;
 		G(origline) = G(lineno);
 	} else {
@@ -832,7 +831,6 @@ memerr:			dbp->errx(dbp, "could not allocate buffer %d", buflen);
 		start += linelen;
 
 		if (name != NULL) {
-			*p = '=';
 			free(name);
 			name = NULL;
 		}
@@ -916,22 +914,7 @@ memerr:			dbp->errx(dbp, "could not allocate buffer %d", buflen);
 			continue;
 		}
 
-#ifdef notyet
-		NUMBER(name, value, "bt_maxkey", set_bt_maxkey, u_int32_t);
-#endif
-		NUMBER(name, value, "bt_minkey", set_bt_minkey, u_int32_t);
-		NUMBER(name, value, "db_lorder", set_lorder, int);
-		NUMBER(name, value, "db_pagesize", set_pagesize, u_int32_t);
-		NUMBER(name, value, "extentsize", set_q_extentsize, u_int32_t);
-		FLAG(name, value, "chksum", DB_CHKSUM);
-		FLAG(name, value, "duplicates", DB_DUP);
-		FLAG(name, value, "dupsort", DB_DUPSORT);
-		NUMBER(name, value, "h_ffactor", set_h_ffactor, u_int32_t);
-		NUMBER(name, value, "h_nelem", set_h_nelem, u_int32_t);
-		NUMBER(name, value, "re_len", set_re_len, u_int32_t);
-		STRING(name, value, "re_pad", set_re_pad);
-		FLAG(name, value, "recnum", DB_RECNUM);
-		FLAG(name, value, "renumber", DB_RENUMBER);
+		CONFIGURATION_LIST_COMPARE;
 
 		dbp->errx(dbp,
 		    "unknown input-file header configuration keyword \"%s\"",
@@ -939,22 +922,70 @@ memerr:			dbp->errx(dbp, "could not allocate buffer %d", buflen);
 		goto err;
 	}
 	ret = 0;
+
 	if (0) {
 nameerr:	dbp->err(dbp, ret, "%s: %s=%s", G(progname), name, value);
-err:		ret = 1;
+		ret = 1;
 	}
 	if (0) {
 badfmt:		dbp->errx(dbp, "line %lu: unexpected format", G(lineno));
 		ret = 1;
 	}
-	if (name != NULL) {
-		if (p != NULL)
-			*p = '=';
-		free(name);
+	if (0) {
+memerr:		dbp->errx(dbp, "unable to allocate memory");
+err:		ret = 1;
 	}
+	if (name != NULL)
+		free(name);
 	return (ret);
 }
 
+/*
+ * Macro to convert a pair of hex bytes to a decimal value.
+ *
+ * !!!
+ * Note that this macro is side-effect safe.  This was done deliberately,
+ * callers depend on it.
+ */
+#define	DIGITIZE(store, v1, v2) {					\
+	char _v1, _v2;							\
+	_v1 = (v1);							\
+	_v2 = (v2);							\
+	if ((_v1) > 'f' || (_v2) > 'f')					\
+		return (badend(dbenv));					\
+	(store) =							\
+	((_v1) == '0' ? 0 :						\
+	((_v1) == '1' ? 1 :						\
+	((_v1) == '2' ? 2 :						\
+	((_v1) == '3' ? 3 :						\
+	((_v1) == '4' ? 4 :						\
+	((_v1) == '5' ? 5 :						\
+	((_v1) == '6' ? 6 :						\
+	((_v1) == '7' ? 7 :						\
+	((_v1) == '8' ? 8 :						\
+	((_v1) == '9' ? 9 :						\
+	((_v1) == 'a' ? 10 :						\
+	((_v1) == 'b' ? 11 :						\
+	((_v1) == 'c' ? 12 :						\
+	((_v1) == 'd' ? 13 :						\
+	((_v1) == 'e' ? 14 : 15))))))))))))))) << 4 |			\
+	((_v2) == '0' ? 0 :						\
+	((_v2) == '1' ? 1 :						\
+	((_v2) == '2' ? 2 :						\
+	((_v2) == '3' ? 3 :						\
+	((_v2) == '4' ? 4 :						\
+	((_v2) == '5' ? 5 :						\
+	((_v2) == '6' ? 6 :						\
+	((_v2) == '7' ? 7 :						\
+	((_v2) == '8' ? 8 :						\
+	((_v2) == '9' ? 9 :						\
+	((_v2) == 'a' ? 10 :						\
+	((_v2) == 'b' ? 11 :						\
+	((_v2) == 'c' ? 12 :						\
+	((_v2) == 'd' ? 13 :						\
+	((_v2) == 'e' ? 14 : 15)))))))))))))));				\
+}
+
 /*
  * convprintable --
  *	Convert a printable-encoded string into a newly allocated string.
@@ -973,8 +1004,7 @@ convprintable(dbenv, instr, outstrp)
 	DB_ENV *dbenv;
 	char *instr, **outstrp;
 {
-	char c, *outstr;
-	int e1, e2;
+	char *outstr;
 
 	/*
 	 * Just malloc a string big enough for the whole input string;
@@ -985,21 +1015,13 @@ convprintable(dbenv, instr, outstrp)
 
 	*outstrp = outstr;
 
-	e1 = e2 = 0;
 	for ( ; *instr != '\0'; instr++)
 		if (*instr == '\\') {
 			if (*++instr == '\\') {
 				*outstr++ = '\\';
 				continue;
 			}
-			c = digitize(dbenv, *instr, &e1) << 4;
-			c |= digitize(dbenv, *++instr, &e2);
-			if (e1 || e2) {
-				badend(dbenv);
-				return (EINVAL);
-			}
-
-			*outstr++ = c;
+			DIGITIZE(*outstr++, *instr, *++instr);
 		} else
 			*outstr++ = *instr;
 
@@ -1019,21 +1041,20 @@ dbt_rprint(dbenv, dbtp)
 {
 	u_int32_t len;
 	u_int8_t *p;
-	int c1, c2, e, escape, first;
+	int c1, c2, escape, first;
 	char buf[32];
 
 	++G(lineno);
 
 	first = 1;
-	e = escape = 0;
+	escape = 0;
 	for (p = dbtp->data, len = 0; (c1 = getchar()) != '\n';) {
 		if (c1 == EOF) {
 			if (len == 0) {
 				G(endofile) = G(endodata) = 1;
 				return (0);
 			}
-			badend(dbenv);
-			return (1);
+			return (badend(dbenv));
 		}
 		if (first) {
 			first = 0;
@@ -1042,10 +1063,8 @@ dbt_rprint(dbenv, dbtp)
 					buf[0] = c1;
 					if (fgets(buf + 1,
 					    sizeof(buf) - 1, stdin) == NULL ||
-					    strcmp(buf, "DATA=END\n") != 0) {
-						badend(dbenv);
-						return (1);
-					}
+					    strcmp(buf, "DATA=END\n") != 0)
+						return (badend(dbenv));
 					G(endodata) = 1;
 					return (0);
 				}
@@ -1054,14 +1073,9 @@ dbt_rprint(dbenv, dbtp)
 		}
 		if (escape) {
 			if (c1 != '\\') {
-				if ((c2 = getchar()) == EOF) {
-					badend(dbenv);
-					return (1);
-				}
-				c1 = digitize(dbenv,
-				    c1, &e) << 4 | digitize(dbenv, c2, &e);
-				if (e)
-					return (1);
+				if ((c2 = getchar()) == EOF)
+					return (badend(dbenv));
+				DIGITIZE(c1, c1, c2);
 			}
 			escape = 0;
 		} else
@@ -1097,21 +1111,19 @@ dbt_rdump(dbenv, dbtp)
 {
 	u_int32_t len;
 	u_int8_t *p;
-	int c1, c2, e, first;
+	int c1, c2, first;
 	char buf[32];
 
 	++G(lineno);
 
 	first = 1;
-	e = 0;
 	for (p = dbtp->data, len = 0; (c1 = getchar()) != '\n';) {
 		if (c1 == EOF) {
 			if (len == 0) {
 				G(endofile) = G(endodata) = 1;
 				return (0);
 			}
-			badend(dbenv);
-			return (1);
+			return (badend(dbenv));
 		}
 		if (first) {
 			first = 0;
@@ -1120,20 +1132,16 @@ dbt_rdump(dbenv, dbtp)
 					buf[0] = c1;
 					if (fgets(buf + 1,
 					    sizeof(buf) - 1, stdin) == NULL ||
-					    strcmp(buf, "DATA=END\n") != 0) {
-						badend(dbenv);
-						return (1);
-					}
+					    strcmp(buf, "DATA=END\n") != 0)
+						return (badend(dbenv));
 					G(endodata) = 1;
 					return (0);
 				}
 				continue;
 			}
 		}
-		if ((c2 = getchar()) == EOF) {
-			badend(dbenv);
-			return (1);
-		}
+		if ((c2 = getchar()) == EOF)
+			return (badend(dbenv));
 		if (len >= dbtp->ulen - 10) {
 			dbtp->ulen *= 2;
 			if ((dbtp->data =
@@ -1144,9 +1152,7 @@ dbt_rdump(dbenv, dbtp)
 			p = (u_int8_t *)dbtp->data + len;
 		}
 		++len;
-		*p++ = digitize(dbenv, c1, &e) << 4 | digitize(dbenv, c2, &e);
-		if (e)
-			return (1);
+		DIGITIZE(*p++, c1, c2);
 	}
 	dbtp->size = len;
 
@@ -1179,7 +1185,7 @@ dbt_rrecno(dbenv, dbtp, ishex)
 	}
 
 	if (buf[0] != ' ')
-		goto bad;
+		goto err;
 
 	/*
 	 * If we're expecting a hex key, do an in-place conversion
@@ -1195,22 +1201,22 @@ dbt_rrecno(dbenv, dbtp, ishex)
 			 * end-of-string conditions.
 			 */
 			if (*q++ != '3')
-				goto bad;
+				goto err;
 			if (*q == '\n' || *q == '\0')
-				goto bad;
+				goto err;
 			*p++ = *q++;
 		}
 		*p = '\0';
 	}
 
-	if (__db_getulong(dbenv, G(progname), buf + 1, 0, 0, &recno)) {
-bad:		badend(dbenv);
-		return (1);
-	}
+	if (__db_getulong(dbenv, G(progname), buf + 1, 0, 0, &recno))
+		goto err;
 
 	*((db_recno_t *)dbtp->data) = recno;
 	dbtp->size = sizeof(db_recno_t);
 	return (0);
+
+err:	return (badend(dbenv));
 }
 
 int
@@ -1227,42 +1233,6 @@ dbt_to_recno(dbenv, dbt, recnop)
 	return (__db_getulong(dbenv, G(progname), buf, 0, 0, (u_long *)recnop));
 }
 
-/*
- * digitize --
- *	Convert a character to an integer.
- */
-int
-digitize(dbenv, c, errorp)
-	DB_ENV *dbenv;
-	int c, *errorp;
-{
-	switch (c) {			/* Don't depend on ASCII ordering. */
-	case '0': return (0);
-	case '1': return (1);
-	case '2': return (2);
-	case '3': return (3);
-	case '4': return (4);
-	case '5': return (5);
-	case '6': return (6);
-	case '7': return (7);
-	case '8': return (8);
-	case '9': return (9);
-	case 'a': return (10);
-	case 'b': return (11);
-	case 'c': return (12);
-	case 'd': return (13);
-	case 'e': return (14);
-	case 'f': return (15);
-	default:			/* Not possible. */
-		break;
-	}
-
-	dbenv->errx(dbenv, "unexpected hexadecimal value");
-	*errorp = 1;
-
-	return (0);
-}
-
 /*
  * badnum --
  *	Display the bad number message.
@@ -1279,11 +1249,12 @@ badnum(dbenv)
  * badend --
  *	Display the bad end to input message.
  */
-void
+int
 badend(dbenv)
 	DB_ENV *dbenv;
 {
 	dbenv->errx(dbenv, "unexpected end of input data or key/data pair");
+	return (1);
 }
 
 /*
@@ -1293,17 +1264,16 @@ badend(dbenv)
 int
 usage()
 {
-	(void)fprintf(stderr, "%s\n\t%s\n",
-	    "usage: db_load [-nTV] [-c name=value] [-f file]",
+	(void)fprintf(stderr, "usage: %s %s\n\t%s\n", progname,
+	    "[-nTV] [-c name=value] [-f file]",
     "[-h home] [-P password] [-t btree | hash | recno | queue] db_file");
-	(void)fprintf(stderr, "%s\n",
-	    "usage: db_load -r lsn | fileid [-h home] [-P password] db_file");
+	(void)fprintf(stderr, "usage: %s %s\n",
+	    progname, "-r lsn | fileid [-h home] [-P password] db_file");
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
diff --git a/db/db_printlog/README b/db/db_printlog/README
index d62596429..eca5383cb 100644
--- a/db/db_printlog/README
+++ b/db/db_printlog/README
@@ -1,4 +1,4 @@
-# $Id: README,v 10.7 2004/09/24 00:43:16 bostic Exp $
+# $Id: README,v 12.0 2004/11/17 03:43:23 bostic Exp $
 
 Berkeley DB log dump utility.  This utility dumps out a DB log in human
 readable form, a record at a time, to assist in recovery and transaction
diff --git a/db/db_printlog/commit.awk b/db/db_printlog/commit.awk
index 66391d3fb..4f03fd2ce 100644
--- a/db/db_printlog/commit.awk
+++ b/db/db_printlog/commit.awk
@@ -1,4 +1,4 @@
-# $Id: commit.awk,v 10.2 1999/11/21 18:01:42 bostic Exp $
+# $Id: commit.awk,v 12.0 2004/11/17 03:43:24 bostic Exp $
 #
 # Output tid of committed transactions.
 
diff --git a/db/db_printlog/count.awk b/db/db_printlog/count.awk
index 1d5a29195..6a80cbe1b 100644
--- a/db/db_printlog/count.awk
+++ b/db/db_printlog/count.awk
@@ -1,4 +1,4 @@
-# $Id: count.awk,v 10.2 1999/11/21 18:01:42 bostic Exp $
+# $Id: count.awk,v 12.0 2004/11/17 03:43:24 bostic Exp $
 #
 # Print out the number of log records for transactions that we
 # encountered.
diff --git a/db/db_printlog/db_printlog.c b/db/db_printlog/db_printlog.c
index d06477160..1ef2896ee 100644
--- a/db/db_printlog/db_printlog.c
+++ b/db/db_printlog/db_printlog.c
@@ -1,29 +1,14 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_printlog.c,v 11.64 2004/06/17 17:35:17 bostic Exp $
+ * $Id: db_printlog.c,v 12.20 2006/08/26 09:23:10 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef lint
-static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/btree.h"
@@ -33,12 +18,27 @@ static const char copyright[] =
 #include "dbinc/qam.h"
 #include "dbinc/txn.h"
 
-int lsn_arg __P((const char *, char *, DB_LSN *));
+#ifndef lint
+static const char copyright[] =
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
+#endif
+
+int env_init_print __P((DB_ENV *, u_int32_t,
+    int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
+int env_init_print_42 __P((DB_ENV *,
+    int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
+int env_init_print_43 __P((DB_ENV *,
+    int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
+int env_init_print_45 __P((DB_ENV *,
+    int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
+int lsn_arg __P((char *, DB_LSN *));
 int main __P((int, char *[]));
 int open_rep_db __P((DB_ENV *, DB **, DBC **));
 int print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
 int usage __P((void));
-int version_check __P((const char *));
+int version_check __P((void));
+
+const char *progname;
 
 int
 main(argc, argv)
@@ -47,20 +47,24 @@ main(argc, argv)
 {
 	extern char *optarg;
 	extern int optind;
-	const char *progname = "db_printlog";
 	DB *dbp;
 	DBC *dbc;
 	DBT data, keydbt;
 	DB_ENV	*dbenv;
 	DB_LOGC *logc;
-	DB_LSN key, start, stop;
+	DB_LSN key, start, stop, verslsn;
 	size_t dtabsize;
-	u_int32_t logcflag;
+	u_int32_t logcflag, newversion, version;
 	int ch, cmp, exitval, nflag, rflag, ret, repflag;
 	int (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 	char *home, *passwd;
 
-	if ((ret = version_check(progname)) != 0)
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
 		return (ret);
 
 	dbp = NULL;
@@ -77,11 +81,13 @@ main(argc, argv)
 	while ((ch = getopt(argc, argv, "b:e:h:NP:rRV")) != EOF)
 		switch (ch) {
 		case 'b':
-			if (lsn_arg(progname, optarg, &start))
+			/* Don't use getsubopt(3), not all systems have it. */
+			if (lsn_arg(optarg, &start))
 				return (usage());
 			break;
 		case 'e':
-			if (lsn_arg(progname, optarg, &stop))
+			/* Don't use getsubopt(3), not all systems have it. */
+			if (lsn_arg(optarg, &stop))
 				return (usage());
 			break;
 		case 'h':
@@ -177,8 +183,7 @@ main(argc, argv)
 			dbenv->err(dbenv, ret, "DB_ENV->open");
 			goto shutdown;
 		}
-	} else if ((ret = dbenv->open(dbenv, home,
-	    DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 &&
+	} else if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
 	    (ret == DB_VERSION_MISMATCH ||
 	    (ret = dbenv->open(dbenv, home,
 	    DB_CREATE | DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) {
@@ -186,23 +191,6 @@ main(argc, argv)
 		goto shutdown;
 	}
 
-	/* Initialize print callbacks. */
-	if ((ret = __bam_init_print(dbenv, &dtab, &dtabsize)) != 0 ||
-	    (ret = __crdel_init_print(dbenv, &dtab, &dtabsize)) != 0 ||
-	    (ret = __db_init_print(dbenv, &dtab, &dtabsize)) != 0 ||
-	    (ret = __dbreg_init_print(dbenv, &dtab, &dtabsize)) != 0 ||
-	    (ret = __fop_init_print(dbenv, &dtab, &dtabsize)) != 0 ||
-#ifdef HAVE_HASH
-	    (ret = __ham_init_print(dbenv, &dtab, &dtabsize)) != 0 ||
-#endif
-#ifdef HAVE_QUEUE
-	    (ret = __qam_init_print(dbenv, &dtab, &dtabsize)) != 0 ||
-#endif
-	    (ret = __txn_init_print(dbenv, &dtab, &dtabsize)) != 0) {
-		dbenv->err(dbenv, ret, "callback: initialization");
-		goto shutdown;
-	}
-
 	/* Allocate a log cursor. */
 	if (repflag) {
 		if ((ret = open_rep_db(dbenv, &dbp, &dbc)) != 0)
@@ -221,6 +209,24 @@ main(argc, argv)
 	}
 	memset(&data, 0, sizeof(data));
 
+	/*
+	 * If we're using the repflag, we're immediately initializing
+	 * the print table.  Use the current version.  If we're printing
+	 * the log then initialize version to 0 so that we get the
+	 * correct version right away.
+	 */
+	if (repflag)
+		version = DB_LOGVERSION;
+	else
+		version = 0;
+	ZERO_LSN(verslsn);
+
+	/* Initialize print callbacks if repflag. */
+	if (repflag &&
+	    (ret = env_init_print(dbenv, version, &dtab, &dtabsize)) != 0) {
+		dbenv->err(dbenv, ret, "callback: initialization");
+		goto shutdown;
+	}
 	for (; !__db_util_interrupted(); logcflag = rflag ? DB_PREV : DB_NEXT) {
 		if (repflag) {
 			ret = dbc->c_get(dbc, &keydbt, &data, logcflag);
@@ -232,7 +238,7 @@ main(argc, argv)
 			if (ret == DB_NOTFOUND)
 				break;
 			dbenv->err(dbenv,
-			    ret, repflag ? "DB_LOGC->get" : "DBC->get");
+			    ret, repflag ? "DBC->get" : "DB_LOGC->get");
 			goto shutdown;
 		}
 
@@ -240,10 +246,30 @@ main(argc, argv)
 		 * We may have reached the end of the range we're displaying.
 		 */
 		if (!IS_ZERO_LSN(stop)) {
-			cmp = log_compare(&key, &stop);
+			cmp = LOG_COMPARE(&key, &stop);
 			if ((rflag && cmp < 0) || (!rflag && cmp > 0))
 				break;
 		}
+		if (!repflag && key.file != verslsn.file) {
+			/*
+			 * If our log file changed, we need to see if the
+			 * version of the log file changed as well.
+			 * If it changed, reset the print table.
+			 */
+			if ((ret = logc->version(logc, &newversion, 0)) != 0) {
+				dbenv->err(dbenv, ret, "DB_LOGC->version");
+				goto shutdown;
+			}
+			if (version != newversion) {
+				version = newversion;
+				if ((ret = env_init_print(dbenv, version,
+				    &dtab, &dtabsize)) != 0) {
+					dbenv->err(dbenv, ret,
+					    "callback: initialization");
+					goto shutdown;
+				}
+			}
+		}
 
 		ret = __db_dispatch(dbenv,
 		    dtab, dtabsize, &data, &key, DB_TXN_PRINT, NULL);
@@ -294,17 +320,154 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
+/*
+ * env_init_print --
+ */
+int
+env_init_print(dbenv, version, dtabp, dtabsizep)
+	DB_ENV *dbenv;
+	u_int32_t version;
+	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	size_t *dtabsizep;
+{
+	int ret;
+
+	/*
+	 * We need to prime the print table with the current print
+	 * functions.  Then we overwrite only specific entries based on
+	 * each previous version we support.
+	 */
+	if ((ret = env_init_print_45(dbenv, dtabp, dtabsizep)) != 0)
+		return (ret);
+
+	switch (version) {
+	/*
+	 * There are no log record/recovery differences between
+	 * 4.4 and 4.5.  The log version changed due to checksum.
+	 */
+	case DB_LOGVERSION_45:
+	case DB_LOGVERSION_44:
+		ret = 0;
+		break;
+	case DB_LOGVERSION_43:
+		ret = env_init_print_43(dbenv, dtabp, dtabsizep);
+		break;
+	case DB_LOGVERSION_42:
+		ret = env_init_print_42(dbenv, dtabp, dtabsizep);
+		break;
+	default:
+		__db_errx(dbenv, "Unknown version %lu", (u_long)version);
+		ret = EINVAL;
+		break;
+	}
+	return (ret);
+}
+
+int
+env_init_print_42(dbenv, dtabp, dtabsizep)
+	DB_ENV *dbenv;
+	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	size_t *dtabsizep;
+{
+	int ret;
+
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __db_relink_42_print, DB___db_relink_42)) != 0)
+		goto err;
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __db_pg_alloc_42_print, DB___db_pg_alloc_42)) != 0)
+		goto err;
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __db_pg_free_42_print, DB___db_pg_free_42)) != 0)
+		goto err;
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __db_pg_freedata_42_print, DB___db_pg_freedata_42)) != 0)
+		goto err;
+#if HAVE_HASH
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __ham_metagroup_42_print, DB___ham_metagroup_42)) != 0)
+		goto err;
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __ham_groupalloc_42_print, DB___ham_groupalloc_42)) != 0)
+		goto err;
+#endif
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __txn_ckp_42_print, DB___txn_ckp_42)) != 0)
+		goto err;
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __txn_regop_42_print, DB___txn_regop_42)) != 0)
+		goto err;
+err:
+	return (ret);
+}
+
+int
+env_init_print_43(dbenv, dtabp, dtabsizep)
+	DB_ENV *dbenv;
+	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	size_t *dtabsizep;
+{
+	int ret;
+
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __bam_relink_43_print, DB___bam_relink_43)) != 0)
+		goto err;
+	/*
+	 * We want to use the 4.2-based txn_regop record.
+	 */
+	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
+	    __txn_regop_42_print, DB___txn_regop_42)) != 0)
+		goto err;
+err:
+	return (ret);
+}
+
+/*
+ * env_init_print_45 --
+ *
+ */
+int
+env_init_print_45(dbenv, dtabp, dtabsizep)
+	DB_ENV *dbenv;
+	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	size_t *dtabsizep;
+{
+	int ret;
+
+	if ((ret = __bam_init_print(dbenv, dtabp, dtabsizep)) != 0)
+		goto err;
+	if ((ret = __crdel_init_print(dbenv, dtabp, dtabsizep)) != 0)
+		goto err;
+	if ((ret = __db_init_print(dbenv, dtabp, dtabsizep)) != 0)
+		goto err;
+	if ((ret = __dbreg_init_print(dbenv, dtabp, dtabsizep)) != 0)
+		goto err;
+	if ((ret = __fop_init_print(dbenv, dtabp, dtabsizep)) != 0)
+		goto err;
+#ifdef HAVE_HASH
+	if ((ret = __ham_init_print(dbenv, dtabp, dtabsizep)) != 0)
+		goto err;
+#endif
+#ifdef HAVE_QUEUE
+	if ((ret = __qam_init_print(dbenv, dtabp, dtabsizep)) != 0)
+		goto err;
+#endif
+	if ((ret = __txn_init_print(dbenv, dtabp, dtabsizep)) != 0)
+		goto err;
+err:
+	return (ret);
+}
+
 int
 usage()
 {
-	fprintf(stderr, "usage: db_printlog %s\n",
+	fprintf(stderr, "usage: %s %s\n", progname,
 	    "[-NrV] [-b file/offset] [-e file/offset] [-h home] [-P password]");
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
@@ -331,7 +494,7 @@ print_app_record(dbenv, dbt, lsnp, op)
 	int ch;
 	u_int32_t i, rectype;
 
-	DB_ASSERT(op == DB_TXN_PRINT);
+	DB_ASSERT(dbenv, op == DB_TXN_PRINT);
 
 	COMPQUIET(dbenv, NULL);
 	COMPQUIET(op, DB_TXN_PRINT);
@@ -378,7 +541,7 @@ open_rep_db(dbenv, dbpp, dbcp)
 
 	dbp = *dbpp;
 	if ((ret =
-	    dbp->open(dbp, NULL, "__db.rep.db", NULL, DB_BTREE, 0, 0)) != 0) {
+	    dbp->open(dbp, NULL, REPDBNAME, NULL, DB_BTREE, 0, 0)) != 0) {
 		dbenv->err(dbenv, ret, "DB->open");
 		goto err;
 	}
@@ -400,31 +563,24 @@ err:	if (*dbpp != NULL)
  *	Parse a LSN argument.
  */
 int
-lsn_arg(progname, optarg, lsnp)
-	const char *progname;
-	char *optarg;
+lsn_arg(arg, lsnp)
+	char *arg;
 	DB_LSN *lsnp;
 {
-	char *p;
 	u_long uval;
+	char *p;
 
 	/*
 	 * Expected format is: lsn.file/lsn.offset.
-	 *
-	 * Don't use getsubopt(3), some systems don't have it.
 	 */
-	if ((p = strchr(optarg, '/')) == NULL)
+	if ((p = strchr(arg, '/')) == NULL)
 		return (1);
 	*p = '\0';
 
-	if (__db_getulong(NULL, progname, optarg, 0, 0, &uval))
-		return (1);
-	if (uval > UINT32_MAX)
+	if (__db_getulong(NULL, progname, arg, 0, UINT32_MAX, &uval))
 		return (1);
 	lsnp->file = uval;
-	if (__db_getulong(NULL, progname, p + 1, 0, 0, &uval))
-		return (1);
-	if (uval > UINT32_MAX)
+	if (__db_getulong(NULL, progname, p + 1, 0, UINT32_MAX, &uval))
 		return (1);
 	lsnp->offset = uval;
 	return (0);
diff --git a/db/db_printlog/dbname.awk b/db/db_printlog/dbname.awk
index 41ef97a16..a864c95dd 100644
--- a/db/db_printlog/dbname.awk
+++ b/db/db_printlog/dbname.awk
@@ -1,4 +1,4 @@
-# $Id: dbname.awk,v 1.7 2003/11/21 20:00:03 ubell Exp $
+# $Id: dbname.awk,v 12.1 2005/03/23 04:56:51 ubell Exp $
 #
 # Take a comma-separated list of database names and spit out all the
 # log records that affect those databases.
@@ -58,6 +58,7 @@ NR == 1 {
 	} else if ($2 <= nreg && files[$2] == 1) {
 		printme = 1
 	}
+	myfile = -1;
 }
 
 /^\[/{
diff --git a/db/db_printlog/fileid.awk b/db/db_printlog/fileid.awk
index 020644039..853ba866c 100644
--- a/db/db_printlog/fileid.awk
+++ b/db/db_printlog/fileid.awk
@@ -1,4 +1,4 @@
-# $Id: fileid.awk,v 10.4 2000/07/17 22:07:17 ubell Exp $
+# $Id: fileid.awk,v 12.0 2004/11/17 03:43:25 bostic Exp $
 #
 # Take a comma-separated list of file numbers and spit out all the
 # log records that affect those file numbers.
diff --git a/db/db_printlog/logstat.awk b/db/db_printlog/logstat.awk
index 1009343eb..833864653 100644
--- a/db/db_printlog/logstat.awk
+++ b/db/db_printlog/logstat.awk
@@ -1,4 +1,4 @@
-# $Id: logstat.awk,v 1.1 2002/05/10 15:19:13 bostic Exp $
+# $Id: logstat.awk,v 12.0 2004/11/17 03:43:25 bostic Exp $
 #
 # Output accumulated log record count/size statistics.
 BEGIN {
diff --git a/db/db_printlog/pgno.awk b/db/db_printlog/pgno.awk
index 289fa853b..f58713523 100644
--- a/db/db_printlog/pgno.awk
+++ b/db/db_printlog/pgno.awk
@@ -1,4 +1,4 @@
-# $Id: pgno.awk,v 10.3 2000/07/17 22:07:17 ubell Exp $
+# $Id: pgno.awk,v 12.0 2004/11/17 03:43:25 bostic Exp $
 #
 # Take a comma-separated list of page numbers and spit out all the
 # log records that affect those page numbers.
diff --git a/db/db_printlog/range.awk b/db/db_printlog/range.awk
index 7abb410b4..045c7fb20 100644
--- a/db/db_printlog/range.awk
+++ b/db/db_printlog/range.awk
@@ -1,4 +1,4 @@
-# $Id: range.awk,v 10.2 1999/11/21 18:01:42 bostic Exp $
+# $Id: range.awk,v 12.0 2004/11/17 03:43:25 bostic Exp $
 #
 # Print out a range of the log
 
diff --git a/db/db_printlog/rectype.awk b/db/db_printlog/rectype.awk
index f30124cac..25b280085 100644
--- a/db/db_printlog/rectype.awk
+++ b/db/db_printlog/rectype.awk
@@ -1,4 +1,4 @@
-# $Id: rectype.awk,v 11.4 2004/04/19 09:36:58 bostic Exp $
+# $Id: rectype.awk,v 12.0 2004/11/17 03:43:25 bostic Exp $
 #
 # Print out a range of the log.
 # Command line should set RECTYPE to a comma separated list
diff --git a/db/db_printlog/status.awk b/db/db_printlog/status.awk
index a0c381ed9..a939431ef 100644
--- a/db/db_printlog/status.awk
+++ b/db/db_printlog/status.awk
@@ -1,4 +1,4 @@
-# $Id: status.awk,v 10.5 2004/09/24 00:43:17 bostic Exp $
+# $Id: status.awk,v 12.1 2006/02/15 20:35:26 ubell Exp $
 #
 # Read through db_printlog output and list all the transactions encountered
 # and whether they committed or aborted.
@@ -10,7 +10,7 @@
 BEGIN {
 	cur_txn = 0
 }
-/^\[/{
+/^\[.*]\[/{
 	in_regop = 0
 	if (status[$5] == 0) {
 		status[$5] = 1;
diff --git a/db/db_printlog/txn.awk b/db/db_printlog/txn.awk
index be8c44e10..12f283ebf 100644
--- a/db/db_printlog/txn.awk
+++ b/db/db_printlog/txn.awk
@@ -1,4 +1,4 @@
-# $Id: txn.awk,v 10.3 2000/07/17 22:07:17 ubell Exp $
+# $Id: txn.awk,v 12.0 2004/11/17 03:43:25 bostic Exp $
 #
 # Print out all the records for a comma-separated list of transaction ids.
 NR == 1 {
diff --git a/db/db_recover/db_recover.c b/db/db_recover/db_recover.c
index 75961f78c..4082279a8 100644
--- a/db/db_recover/db_recover.c
+++ b/db/db_recover/db_recover.c
@@ -1,44 +1,27 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_recover.c,v 11.41 2004/01/28 03:36:00 bostic Exp $
+ * $Id: db_recover.c,v 12.9 2006/08/26 09:23:13 bostic Exp $
  */
 
 #include "db_config.h"
 
+#include "db_int.h"
+
 #ifndef lint
 static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#if TIME_WITH_SYS_TIME
-#include 
-#include 
-#else
-#if HAVE_SYS_TIME_H
-#include 
-#else
-#include 
-#endif
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
 #endif
 
-#include 
-#include 
-#include 
-#endif
-
-#include "db_int.h"
-
 int main __P((int, char *[]));
-int read_timestamp __P((const char *, char *, time_t *));
+int read_timestamp __P((char *, time_t *));
 int usage __P((void));
-int version_check __P((const char *));
+int version_check __P((void));
+
+const char *progname;
 
 int
 main(argc, argv)
@@ -47,14 +30,18 @@ main(argc, argv)
 {
 	extern char *optarg;
 	extern int optind;
-	const char *progname = "db_recover";
 	DB_ENV	*dbenv;
 	time_t timestamp;
 	u_int32_t flags;
 	int ch, exitval, fatal_recover, ret, retain_env, verbose;
 	char *home, *passwd;
 
-	if ((ret = version_check(progname)) != 0)
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
 		return (ret);
 
 	home = passwd = NULL;
@@ -81,8 +68,7 @@ main(argc, argv)
 			}
 			break;
 		case 't':
-			if ((ret =
-			    read_timestamp(progname, optarg, ×tamp)) != 0)
+			if ((ret = read_timestamp(optarg, ×tamp)) != 0)
 				return (ret);
 			break;
 		case 'V':
@@ -142,10 +128,10 @@ main(argc, argv)
 	 * certainly use DB_CONFIG files in the directory.
 	 */
 	flags = 0;
-	LF_SET(DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG |
+	LF_SET(DB_CREATE | DB_INIT_LOG |
 	    DB_INIT_MPOOL | DB_INIT_TXN | DB_USE_ENVIRON);
 	LF_SET(fatal_recover ? DB_RECOVER_FATAL : DB_RECOVER);
-	LF_SET(retain_env ? 0 : DB_PRIVATE);
+	LF_SET(retain_env ? DB_INIT_LOCK : DB_PRIVATE);
 	if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0) {
 		dbenv->err(dbenv, ret, "DB_ENV->open");
 		goto shutdown;
@@ -204,8 +190,7 @@ shutdown:	exitval = 1;
  * SUCH DAMAGE.
  */
 int
-read_timestamp(progname, arg, timep)
-	const char *progname;
+read_timestamp(arg, timep)
 	char *arg;
 	time_t *timep;
 {
@@ -276,14 +261,13 @@ terr:		fprintf(stderr,
 int
 usage()
 {
-	(void)fprintf(stderr, "%s\n",
-"usage: db_recover [-ceVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]");
+	(void)fprintf(stderr, "usage: %s %s\n", progname,
+	    "[-ceVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]");
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
diff --git a/db/db_stat/db_stat.c b/db/db_stat/db_stat.c
index aa1918655..62fa01878 100644
--- a/db/db_stat/db_stat.c
+++ b/db/db_stat/db_stat.c
@@ -1,50 +1,31 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_stat.c,v 11.158 2004/07/15 18:26:48 ubell Exp $
+ * $Id: db_stat.c,v 12.14 2006/08/26 09:23:19 bostic Exp $
  */
 
 #include "db_config.h"
 
+#include "db_int.h"
+#include "dbinc/db_page.h"
+
 #ifndef lint
 static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#if TIME_WITH_SYS_TIME
-#include 
-#include 
-#else
-#if HAVE_SYS_TIME_H
-#include 
-#else
-#include 
-#endif
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
 #endif
 
-#include 
-#include 
-#include 
-#include 
-#endif
-
-#include "db_int.h"
-#include "dbinc/db_page.h"
-#include "dbinc/txn.h"
-
 typedef enum { T_NOTSET,
-    T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_REP, T_TXN } test_t;
+    T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_MUTEX, T_REP, T_TXN } test_t;
 
 int	 db_init __P((DB_ENV *, char *, test_t, u_int32_t, int *));
 int	 main __P((int, char *[]));
 int	 usage __P((void));
-int	 version_check __P((const char *));
+int	 version_check __P((void));
+
+const char *progname;
 
 int
 main(argc, argv)
@@ -53,28 +34,31 @@ main(argc, argv)
 {
 	extern char *optarg;
 	extern int optind;
-	const char *progname = "db_stat";
 	DB_ENV	*dbenv;
-	DB_BTREE_STAT *sp;
-	DB *alt_dbp, *dbp;
+	DB *dbp;
 	test_t ttype;
-	u_int32_t cache, env_flags, fast, flags;
+	u_int32_t cache, flags;
 	int ch, exitval;
 	int nflag, private, resize, ret;
 	char *db, *home, *p, *passwd, *subdb;
 
-	if ((ret = version_check(progname)) != 0)
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
 		return (ret);
 
 	dbenv = NULL;
 	dbp = NULL;
 	ttype = T_NOTSET;
 	cache = MEGABYTE;
-	exitval = fast = flags = nflag = private = 0;
+	exitval = flags = nflag = private = 0;
 	db = home = passwd = subdb = NULL;
-	env_flags = 0;
 
-	while ((ch = getopt(argc, argv, "C:cd:Eefh:L:lM:mNP:R:rs:tVZ")) != EOF)
+	while ((ch = getopt(argc,
+	    argv, "C:cd:Eefh:L:lM:mNP:R:rs:tVxX:Z")) != EOF)
 		switch (ch) {
 		case 'C': case 'c':
 			if (ttype != T_NOTSET && ttype != T_LOCK)
@@ -119,7 +103,10 @@ main(argc, argv)
 				LF_SET(DB_STAT_ALL);
 			break;
 		case 'f':
-			fast = DB_FAST_STAT;
+			if (ttype != T_NOTSET && ttype != T_DB)
+				goto argcombo;
+			ttype = T_DB;
+			LF_SET(DB_FAST_STAT);
 			break;
 		case 'h':
 			home = optarg;
@@ -194,13 +181,27 @@ main(argc, argv)
 argcombo:			fprintf(stderr,
 				    "%s: illegal option combination\n",
 				    progname);
-				return (EXIT_FAILURE);
+				return (usage());
 			}
 			ttype = T_TXN;
 			break;
 		case 'V':
 			printf("%s\n", db_version(NULL, NULL, NULL));
 			return (EXIT_SUCCESS);
+		case 'X': case 'x':
+			if (ttype != T_NOTSET && ttype != T_MUTEX)
+				goto argcombo;
+			ttype = T_MUTEX;
+			if (ch != 'x')
+				for (p = optarg; *p; ++p)
+					switch (*p) {
+						case 'A':
+							LF_SET(DB_STAT_ALL);
+							break;
+						default:
+							return (usage());
+					}
+			break;
 		case 'Z':
 			LF_SET(DB_STAT_CLEAR);
 			break;
@@ -216,18 +217,16 @@ argcombo:			fprintf(stderr,
 		if (db == NULL)
 			return (usage());
 		break;
-	case T_NOTSET:
-		return (usage());
-		/* NOTREACHED */
 	case T_ENV:
 	case T_LOCK:
 	case T_LOG:
 	case T_MPOOL:
+	case T_MUTEX:
 	case T_REP:
 	case T_TXN:
-		if (fast != 0)
-			return (usage());
 		break;
+	case T_NOTSET:
+		return (usage());
 	}
 
 	/* Handle possible interruptions. */
@@ -237,7 +236,7 @@ argcombo:			fprintf(stderr,
 	 * Create an environment object and initialize it for error
 	 * reporting.
 	 */
-retry:	if ((ret = db_env_create(&dbenv, env_flags)) != 0) {
+retry:	if ((ret = db_env_create(&dbenv, 0)) != 0) {
 		fprintf(stderr,
 		    "%s: db_env_create: %s\n", progname, db_strerror(ret));
 		goto err;
@@ -269,17 +268,26 @@ retry:	if ((ret = db_env_create(&dbenv, env_flags)) != 0) {
 
 	switch (ttype) {
 	case T_DB:
-		if (flags != 0)
-			return (usage());
-
 		/* Create the DB object and open the file. */
 		if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
 			dbenv->err(dbenv, ret, "db_create");
 			goto err;
 		}
 
-		if ((ret = dbp->open(dbp,
-		    NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) {
+		/*
+		 * We open the database for writing so we can update the cached
+		 * statistics, but it's OK to fail, we can open read-only and
+		 * proceed.
+		 *
+		 * Turn off error messages for now -- we can't open lots of
+		 * databases read-write (for example, master databases and
+		 * hash databases for which we don't know the hash function).
+		 */
+		dbenv->set_errfile(dbenv, NULL);
+		ret = dbp->open(dbp, NULL, db, subdb, DB_UNKNOWN, 0, 0);
+		dbenv->set_errfile(dbenv, stderr);
+		if (ret != 0 && (ret = dbp->open(
+		    dbp, NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) {
 			dbenv->err(dbenv, ret, "DB->open: %s", db);
 			goto err;
 		}
@@ -298,40 +306,6 @@ retry:	if ((ret = db_env_create(&dbenv, env_flags)) != 0) {
 			}
 		}
 
-		/*
-		 * See if we can open this db read/write to update counts.
-		 * If its a master-db then we cannot.  So check to see,
-		 * if its btree then it might be.
-		 */
-		if (subdb == NULL && dbp->type == DB_BTREE &&
-		    (ret = dbp->stat(dbp, NULL, &sp, DB_FAST_STAT)) != 0) {
-			dbenv->err(dbenv, ret, "DB->stat");
-			goto err;
-		}
-
-		if (subdb != NULL ||
-		    dbp->type != DB_BTREE ||
-		    (sp->bt_metaflags & BTM_SUBDB) == 0) {
-			if ((ret = db_create(&alt_dbp, dbenv, 0)) != 0) {
-				dbenv->err(dbenv, ret, "db_create");
-				goto err;
-			}
-			if ((ret = dbp->open(alt_dbp, NULL,
-			    db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) {
-				if (subdb == NULL)
-					dbenv->err(dbenv,
-					   ret, "DB->open: %s", db);
-				else
-					dbenv->err(dbenv,
-					   ret, "DB->open: %s:%s", db, subdb);
-				(void)alt_dbp->close(alt_dbp, DB_NOSYNC);
-				goto err;
-			}
-
-			(void)dbp->close(dbp, DB_NOSYNC);
-			dbp = alt_dbp;
-		}
-
 		if (dbp->stat_print(dbp, flags))
 			goto err;
 		break;
@@ -351,6 +325,10 @@ retry:	if ((ret = db_env_create(&dbenv, env_flags)) != 0) {
 		if (dbenv->memp_stat_print(dbenv, flags))
 			goto err;
 		break;
+	case T_MUTEX:
+		if (dbenv->mutex_stat_print(dbenv, flags))
+			goto err;
+		break;
 	case T_REP:
 		if (dbenv->rep_stat_print(dbenv, flags))
 			goto err;
@@ -412,8 +390,7 @@ db_init(dbenv, home, ttype, cache, is_private)
 	 * error, I think.
 	 */
 	*is_private = 0;
-	if ((ret =
-	    dbenv->open(dbenv, home, DB_JOINENV | DB_USE_ENVIRON, 0)) == 0)
+	if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) == 0)
 		return (0);
 	if (ret == DB_VERSION_MISMATCH)
 		goto err;
@@ -456,17 +433,16 @@ err:	dbenv->err(dbenv, ret, "DB_ENV->open");
 int
 usage()
 {
-	fprintf(stderr, "usage: db_stat %s\n",
+	fprintf(stderr, "usage: %s %s\n", progname,
 	    "-d file [-fN] [-h home] [-P password] [-s database]");
-	fprintf(stderr, "usage: db_stat %s\n\t%s\n",
-	    "[-cEelmNrtVZ] [-C Aclop]",
-	    "[-h home] [-L A] [-M A] [-P password] [-R A]");
+	fprintf(stderr, "usage: %s %s\n\t%s\n", progname,
+	    "[-cEelmNrtVxZ] [-C Aclop]",
+	    "[-h home] [-L A] [-M A] [-P password] [-R A] [-X A]");
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
diff --git a/db/db_stat/dd.sh b/db/db_stat/dd.sh
index d8bb7033f..eee34e61b 100644
--- a/db/db_stat/dd.sh
+++ b/db/db_stat/dd.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-#	$Id: dd.sh,v 1.3 2004/05/04 15:51:45 bostic Exp $
+#	$Id: dd.sh,v 12.1 2006/08/30 16:11:57 bostic Exp $
 #
 # Display environment's deadlocks based on "db_stat -Co" output.
 
@@ -22,13 +22,16 @@ else
 fi
 
 # Print out list of node wait states, and output cycles in the graph.
-egrep '\.*\' $1 | awk '{print $1 " " $7}' |
-while read l p; do
-	p=`egrep "\.*\[	 ][	 ]*$p$" $1 | awk '{print $1}'`
-	echo "$l $p"
+egrep '\.*\' $1 | awk '{print $1 " " $5 " " $7}' |
+while read l f p; do
+	for i in `egrep "\.*\<$f\>.*\.*\<$p\>" $1 |
+	    awk '{print $1}'`; do
+		echo "$l $i"
+	done
 done | tsort > /dev/null 2>$t1
 
 # Display the locks in a single cycle.
+c=1
 display_one() {
 	if [ -s $1 ]; then
 		echo "Deadlock #$c ============"
@@ -61,7 +64,6 @@ display_one() {
 # the child commits/aborts.  This means the deadlock where parent holds a
 # lock, thread A waits on parent, child waits on thread A won't be shown.
 if [ -s $t1 ]; then
-	c=1
 	:>$t2
 	while read a b; do
 		case $b in
diff --git a/db/db_upgrade/db_upgrade.c b/db/db_upgrade/db_upgrade.c
index 0f43be6ba..0d7319050 100644
--- a/db/db_upgrade/db_upgrade.c
+++ b/db/db_upgrade/db_upgrade.c
@@ -1,33 +1,26 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_upgrade.c,v 1.37 2004/06/10 01:00:09 bostic Exp $
+ * $Id: db_upgrade.c,v 12.9 2006/08/26 09:23:22 bostic Exp $
  */
 
 #include "db_config.h"
 
+#include "db_int.h"
+
 #ifndef lint
 static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#include 
-#include 
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
 #endif
 
-#include "db_int.h"
-
 int main __P((int, char *[]));
 int usage __P((void));
-int version_check __P((const char *));
+int version_check __P((void));
+
+const char *progname;
 
 int
 main(argc, argv)
@@ -36,21 +29,25 @@ main(argc, argv)
 {
 	extern char *optarg;
 	extern int optind;
-	const char *progname = "db_upgrade";
 	DB *dbp;
 	DB_ENV *dbenv;
 	u_int32_t flags;
-	int ch, exitval, nflag, ret, t_ret;
+	int ch, exitval, nflag, ret, t_ret, verbose;
 	char *home, *passwd;
 
-	if ((ret = version_check(progname)) != 0)
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
 		return (ret);
 
 	dbenv = NULL;
-	flags = nflag = 0;
+	flags = nflag = verbose = 0;
 	exitval = 0;
 	home = passwd = NULL;
-	while ((ch = getopt(argc, argv, "h:NP:sV")) != EOF)
+	while ((ch = getopt(argc, argv, "h:NP:sVv")) != EOF)
 		switch (ch) {
 		case 'h':
 			home = optarg;
@@ -73,6 +70,9 @@ main(argc, argv)
 		case 'V':
 			printf("%s\n", db_version(NULL, NULL, NULL));
 			return (EXIT_SUCCESS);
+		case 'v':
+			verbose = 1;
+			break;
 		case '?':
 		default:
 			return (usage());
@@ -120,8 +120,7 @@ main(argc, argv)
 	 * If attaching to a pre-existing environment fails, create a
 	 * private one and try again.
 	 */
-	if ((ret = dbenv->open(dbenv,
-	    home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 &&
+	if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
 	    (ret == DB_VERSION_MISMATCH ||
 	    (ret = dbenv->open(dbenv, home,
 	    DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON,
@@ -146,6 +145,13 @@ main(argc, argv)
 		}
 		if (ret != 0)
 			goto shutdown;
+		/*
+		 * People get concerned if they don't see a success message.
+		 * If verbose is set, give them one.
+		 */
+		if (verbose)
+			printf("%s: %s upgraded successfully\n",
+			    progname, argv[0]);
 	}
 
 	if (0) {
@@ -169,14 +175,13 @@ shutdown:	exitval = 1;
 int
 usage()
 {
-	fprintf(stderr, "%s\n",
-	    "usage: db_upgrade [-NsV] [-h home] [-P password] db_file ...");
+	fprintf(stderr, "usage: %s %s\n", progname,
+	    "[-NsVv] [-h home] [-P password] db_file ...");
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
diff --git a/db/db_verify/db_verify.c b/db/db_verify/db_verify.c
index 148ce1f8e..f09ebc4ff 100644
--- a/db/db_verify/db_verify.c
+++ b/db/db_verify/db_verify.c
@@ -1,33 +1,26 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_verify.c,v 1.49 2004/08/01 00:21:58 bostic Exp $
+ * $Id: db_verify.c,v 12.8 2006/08/26 09:23:23 bostic Exp $
  */
 
 #include "db_config.h"
 
+#include "db_int.h"
+
 #ifndef lint
 static const char copyright[] =
-    "Copyright (c) 1996-2004\nSleepycat Software Inc.  All rights reserved.\n";
-#endif
-
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#include 
-#include 
+    "Copyright (c) 1996-2006\nOracle Corporation.  All rights reserved.\n";
 #endif
 
-#include "db_int.h"
-
 int main __P((int, char *[]));
 int usage __P((void));
-int version_check __P((const char *));
+int version_check __P((void));
+
+const char *progname;
 
 int
 main(argc, argv)
@@ -36,7 +29,6 @@ main(argc, argv)
 {
 	extern char *optarg;
 	extern int optind;
-	const char *progname = "db_verify";
 	DB *dbp, *dbp1;
 	DB_ENV *dbenv;
 	u_int32_t flags, cache;
@@ -44,7 +36,12 @@ main(argc, argv)
 	int quiet, resize, ret;
 	char *home, *passwd;
 
-	if ((ret = version_check(progname)) != 0)
+	if ((progname = strrchr(argv[0], '/')) == NULL)
+		progname = argv[0];
+	else
+		++progname;
+
+	if ((ret = version_check()) != 0)
 		return (ret);
 
 	dbenv = NULL;
@@ -150,12 +147,24 @@ retry:	if ((ret = db_env_create(&dbenv, 0)) != 0) {
 		}
 	}
 
+	/*
+	 * Find out if we have a transactional environment so that we can
+	 * make sure that we don't open the verify database with logging
+	 * enabled.
+	 */
 	for (; !__db_util_interrupted() && argv[0] != NULL; ++argv) {
 		if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
 			dbenv->err(dbenv, ret, "%s: db_create", progname);
 			goto shutdown;
 		}
 
+		if (TXN_ON(dbenv) &&
+		    (ret = dbp->set_flags(dbp, DB_TXN_NOT_DURABLE)) != 0) {
+			dbenv->err(
+			    dbenv, ret, "%s: db_set_flags", progname);
+			goto shutdown;
+		}
+
 		/*
 		 * We create a 2nd dbp to this database to get its pagesize
 		 * because the dbp we're using for verify cannot be opened.
@@ -171,6 +180,13 @@ retry:	if ((ret = db_env_create(&dbenv, 0)) != 0) {
 				goto shutdown;
 			}
 
+			if (TXN_ON(dbenv) && (ret =
+			    dbp1->set_flags(dbp1, DB_TXN_NOT_DURABLE)) != 0) {
+				dbenv->err(
+				    dbenv, ret, "%s: db_set_flags", progname);
+				goto shutdown;
+			}
+
 			ret = dbp1->open(dbp1,
 			    NULL, argv[0], NULL, DB_UNKNOWN, DB_RDONLY, 0);
 
@@ -230,14 +246,13 @@ shutdown:	exitval = 1;
 int
 usage()
 {
-	fprintf(stderr, "%s\n",
-	    "usage: db_verify [-NoqV] [-h home] [-P password] db_file ...");
+	fprintf(stderr, "usage: %s %s\n", progname,
+	    "[-NoqV] [-h home] [-P password] db_file ...");
 	return (EXIT_FAILURE);
 }
 
 int
-version_check(progname)
-	const char *progname;
+version_check()
 {
 	int v_major, v_minor, v_patch;
 
diff --git a/db/dbinc/btree.h b/db/dbinc/btree.h
index d6bb2c839..e7b3998b4 100644
--- a/db/dbinc/btree.h
+++ b/db/dbinc/btree.h
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994, 1995, 1996
@@ -39,11 +39,15 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: btree.h,v 11.50 2004/07/22 21:52:57 bostic Exp $
+ * $Id: btree.h,v 12.12 2006/08/24 14:45:27 bostic Exp $
  */
 #ifndef	_DB_BTREE_H_
 #define	_DB_BTREE_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /* Forward structure declarations. */
 struct __btree;		typedef struct __btree BTREE;
 struct __cursor;	typedef struct __cursor BTREE_CURSOR;
@@ -74,6 +78,7 @@ struct __recno;		typedef struct __recno RECNO;
 /* Flags for __bam_stkrel(). */
 #define	STK_CLRDBC	0x01		/* Clear dbc->page reference. */
 #define	STK_NOLOCK	0x02		/* Don't retain locks. */
+#define	STK_PGONLY	0x04
 
 /* Flags for __ram_ca(). These get logged, so make the values explicit. */
 typedef enum {
@@ -97,30 +102,36 @@ typedef enum {
  * to return deleted entries.  To simplify both the mnemonic representation
  * and the code that checks for various cases, we construct a set of bitmasks.
  */
-#define	S_READ		0x00001		/* Read locks. */
-#define	S_WRITE		0x00002		/* Write locks. */
-
-#define	S_APPEND	0x00040		/* Append to the tree. */
-#define	S_DELNO		0x00080		/* Don't return deleted items. */
-#define	S_DUPFIRST	0x00100		/* Return first duplicate. */
-#define	S_DUPLAST	0x00200		/* Return last duplicate. */
-#define	S_EXACT		0x00400		/* Exact items only. */
-#define	S_PARENT	0x00800		/* Lock page pair. */
-#define	S_STACK		0x01000		/* Need a complete stack. */
-#define	S_PAST_EOF	0x02000		/* If doing insert search (or keyfirst
+#define	SR_READ		0x00001		/* Read locks. */
+#define	SR_WRITE	0x00002		/* Write locks. */
+
+#define	SR_APPEND	0x00040		/* Append to the tree. */
+#define	SR_DELNO	0x00080		/* Don't return deleted items. */
+#define	SR_DUPFIRST	0x00100		/* Return first duplicate. */
+#define	SR_DUPLAST	0x00200		/* Return last duplicate. */
+#define	SR_EXACT	0x00400		/* Exact items only. */
+#define	SR_PARENT	0x00800		/* Lock page pair. */
+#define	SR_STACK	0x01000		/* Need a complete stack. */
+#define	SR_PAST_EOF	0x02000		/* If doing insert search (or keyfirst
 					 * or keylast operations), or a split
 					 * on behalf of an insert, it's okay to
 					 * return an entry one past end-of-page.
 					 */
-#define	S_STK_ONLY	0x04000		/* Just return info in the stack */
-
-#define	S_DELETE	(S_WRITE | S_DUPFIRST | S_DELNO | S_EXACT | S_STACK)
-#define	S_FIND		(S_READ | S_DUPFIRST | S_DELNO)
-#define	S_FIND_WR	(S_WRITE | S_DUPFIRST | S_DELNO)
-#define	S_INSERT	(S_WRITE | S_DUPLAST | S_PAST_EOF | S_STACK)
-#define	S_KEYFIRST	(S_WRITE | S_DUPFIRST | S_PAST_EOF | S_STACK)
-#define	S_KEYLAST	(S_WRITE | S_DUPLAST | S_PAST_EOF | S_STACK)
-#define	S_WRPAIR	(S_WRITE | S_DUPLAST | S_PAST_EOF | S_PARENT)
+#define	SR_STK_ONLY	0x04000		/* Just return info in the stack */
+#define	SR_MAX		0x08000		/* Get the right most key */
+#define	SR_MIN		0x10000		/* Get the left most key */
+#define	SR_NEXT		0x20000		/* Get the page after this key */
+#define	SR_DEL		0x40000		/* Get the tree to delete this key. */
+#define	SR_START	0x80000		/* Level to start stack. */
+
+#define	SR_DELETE							\
+	(SR_WRITE | SR_DUPFIRST | SR_DELNO | SR_EXACT | SR_STACK)
+#define	SR_FIND		(SR_READ | SR_DUPFIRST | SR_DELNO)
+#define	SR_FIND_WR	(SR_WRITE | SR_DUPFIRST | SR_DELNO)
+#define	SR_INSERT	(SR_WRITE | SR_DUPLAST | SR_PAST_EOF | SR_STACK)
+#define	SR_KEYFIRST	(SR_WRITE | SR_DUPFIRST | SR_PAST_EOF | SR_STACK)
+#define	SR_KEYLAST	(SR_WRITE | SR_DUPLAST | SR_PAST_EOF | SR_STACK)
+#define	SR_WRPAIR	(SR_WRITE | SR_DUPLAST | SR_PAST_EOF | SR_PARENT)
 
 /*
  * Various routines pass around page references.  A page reference is
@@ -153,7 +164,7 @@ struct __epg {
 	if ((ret = ((c)->csp == (c)->esp ?				\
 	    __bam_stkgrow(dbenv, c) : 0)) == 0) {			\
 		(c)->csp->page = pagep;					\
-		(c)->csp->indx = page_indx;				\
+		(c)->csp->indx = (page_indx);				\
 		(c)->csp->entries = NUM_ENT(pagep);			\
 		(c)->csp->lock = l;					\
 		(c)->csp->lock_mode = mode;				\
@@ -166,10 +177,10 @@ struct __epg {
 } while (0)
 
 #define	BT_STK_NUM(dbenv, c, pagep, page_indx, ret) do {		\
-	if ((ret =							\
-	    (c)->csp == (c)->esp ? __bam_stkgrow(dbenv, c) : 0) == 0) {	\
+	if ((ret = ((c)->csp ==						\
+	    (c)->esp ? __bam_stkgrow(dbenv, c) : 0)) == 0) {		\
 		(c)->csp->page = NULL;					\
-		(c)->csp->indx = page_indx;				\
+		(c)->csp->indx = (page_indx);				\
 		(c)->csp->entries = NUM_ENT(pagep);			\
 		LOCK_INIT((c)->csp->lock);				\
 		(c)->csp->lock_mode = DB_LOCK_NG;			\
@@ -259,7 +270,6 @@ struct __btree {			/* Btree access method. */
 	db_pgno_t bt_meta;		/* Database meta-data page. */
 	db_pgno_t bt_root;		/* Database root page. */
 
-	u_int32_t bt_maxkey;		/* Maximum keys per page. */
 	u_int32_t bt_minkey;		/* Minimum keys per page. */
 
 					/* Btree comparison function. */
@@ -301,6 +311,7 @@ struct __btree {			/* Btree access method. */
 	FILE		*re_fp;		/* Source file handle. */
 	int		 re_eof;	/* Backing source file EOF reached. */
 	db_recno_t	 re_last;	/* Last record number read. */
+
 };
 
 /*
@@ -315,6 +326,16 @@ typedef enum {
 	DB_CA_SPLIT	= 4
 } db_ca_mode;
 
+/*
+ * Flags for __bam_pinsert.
+ */
+#define	BPI_SPACEONLY	0x01		/* Only check for space to update. */
+#define	BPI_NORECNUM	0x02		/* Not update the recnum on the left. */
+
+#if defined(__cplusplus)
+}
+#endif
+
 #include "dbinc_auto/btree_auto.h"
 #include "dbinc_auto/btree_ext.h"
 #include "dbinc/db_am.h"
diff --git a/db/dbinc/crypto.h b/db/dbinc/crypto.h
index 8eeebf81b..86c7a0b7d 100644
--- a/db/dbinc/crypto.h
+++ b/db/dbinc/crypto.h
@@ -1,15 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: crypto.h,v 1.12 2004/01/28 03:36:00 bostic Exp $
+ * $Id: crypto.h,v 12.5 2006/08/24 14:45:27 bostic Exp $
  */
 
 #ifndef	_DB_CRYPTO_H_
 #define	_DB_CRYPTO_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  * !!!
  * These are the internal representations of the algorithm flags.
@@ -56,7 +60,7 @@ struct __db_cipher {
 
 /*
  * Shared ciphering structure
- * No DB_MUTEX needed because all information is read-only after creation.
+ * No mutex needed because all information is read-only after creation.
  */
 typedef struct __cipher {
 	roff_t		passwd;		/* Offset to shared passwd */
@@ -75,4 +79,8 @@ typedef struct __aes_cipher {
 
 #include "dbinc_auto/crypto_ext.h"
 #endif /* HAVE_CRYPTO */
+
+#if defined(__cplusplus)
+}
+#endif
 #endif /* !_DB_CRYPTO_H_ */
diff --git a/db/dbinc/cxx_int.h b/db/dbinc/cxx_int.h
index d71ca25d0..bde013543 100644
--- a/db/dbinc/cxx_int.h
+++ b/db/dbinc/cxx_int.h
@@ -1,14 +1,14 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: cxx_int.h,v 11.25 2004/09/22 22:20:31 mjc Exp $
+ * $Id: cxx_int.h,v 12.4 2006/08/24 14:45:27 bostic Exp $
  */
 
-#ifndef _CXX_INT_H_
-#define	_CXX_INT_H_
+#ifndef _DB_CXX_INT_H_
+#define	_DB_CXX_INT_H_
 
 // private data structures known to the implementation only
 
@@ -27,7 +27,6 @@
 // for a wrapper class that has an underlying pointer representation.
 //
 #define	WRAPPED_CLASS(_WRAPPER_CLASS, _IMP_CLASS, _WRAPPED_TYPE)           \
-									   \
 	class _IMP_CLASS {};                                               \
 									   \
 	inline _WRAPPED_TYPE *unwrap(_WRAPPER_CLASS *val)                  \
@@ -74,4 +73,4 @@ WRAPPED_CLASS(DbTxn, DbTxnImp, DB_TXN)
 /* values for Db::flags_ */
 #define	DB_CXX_PRIVATE_ENV      0x00000001
 
-#endif /* !_CXX_INT_H_ */
+#endif /* !_DB_CXX_INT_H_ */
diff --git a/db/dbinc/db.in b/db/dbinc/db.in
index dc3d43594..19180e2c3 100644
--- a/db/dbinc/db.in
+++ b/db/dbinc/db.in
@@ -1,10 +1,10 @@
 /*
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db.in,v 11.463 2004/10/11 18:47:50 bostic Exp $
+ * $Id: db.in,v 12.108 2006/09/13 14:53:37 mjc Exp $
  *
  * db.h include file layout:
  *	General.
@@ -27,8 +27,11 @@
 @stdint_h_decl@
 @stddef_h_decl@
 #include 
+@unistd_h_decl@
+@thread_h_decl@
 #endif
 
+@platform_header@
 #if defined(__cplusplus)
 extern "C" {
 #endif
@@ -82,9 +85,7 @@ extern "C" {
  * (and we don't have to worry about systems that store floats in other than
  * power-of-2 numbers of bytes).  Additionally this fixes compilers that rewrite
  * structure assignments and ANSI C memcpy calls to be in-line instructions
- * that happen to require alignment.  Note: this alignment isn't sufficient for
- * mutexes, which depend on things like cache line alignment.  Mutex alignment
- * is handled separately, in mutex.h.
+ * that happen to require alignment.
  *
  * uintptr_t --
  * Unsigned type that's the same size as a pointer.  There are places where
@@ -101,6 +102,10 @@ extern "C" {
  */
 @db_seq_decl@
 
+/* Thread and process identification. */
+@db_threadid_t_decl@
+@pid_t_decl@
+
 /* Basic types that are exported or quasi-exported. */
 typedef	u_int32_t	db_pgno_t;	/* Page number type. */
 typedef	u_int16_t	db_indx_t;	/* Page offset type. */
@@ -127,6 +132,7 @@ typedef	uintptr_t	roff_t;
 struct __db;		typedef struct __db DB;
 struct __db_bt_stat;	typedef struct __db_bt_stat DB_BTREE_STAT;
 struct __db_cipher;	typedef struct __db_cipher DB_CIPHER;
+struct __db_compact;	typedef struct __db_compact DB_COMPACT;
 struct __db_dbt;	typedef struct __db_dbt DBT;
 struct __db_env;	typedef struct __db_env DB_ENV;
 struct __db_h_stat;	typedef struct __db_h_stat DB_HASH_STAT;
@@ -134,6 +140,8 @@ struct __db_ilock;	typedef struct __db_ilock DB_LOCK_ILOCK;
 struct __db_lock_stat;	typedef struct __db_lock_stat DB_LOCK_STAT;
 struct __db_lock_u;	typedef struct __db_lock_u DB_LOCK;
 struct __db_lockreq;	typedef struct __db_lockreq DB_LOCKREQ;
+struct __db_locktab;	typedef struct __db_locktab DB_LOCKTAB;
+struct __db_log;	typedef struct __db_log DB_LOG;
 struct __db_log_cursor;	typedef struct __db_log_cursor DB_LOGC;
 struct __db_log_stat;	typedef struct __db_log_stat DB_LOG_STAT;
 struct __db_lsn;	typedef struct __db_lsn DB_LSN;
@@ -141,13 +149,18 @@ struct __db_mpool;	typedef struct __db_mpool DB_MPOOL;
 struct __db_mpool_fstat;typedef struct __db_mpool_fstat DB_MPOOL_FSTAT;
 struct __db_mpool_stat;	typedef struct __db_mpool_stat DB_MPOOL_STAT;
 struct __db_mpoolfile;	typedef struct __db_mpoolfile DB_MPOOLFILE;
+struct __db_mutex_stat;	typedef struct __db_mutex_stat DB_MUTEX_STAT;
+struct __db_mutex_t;	typedef struct __db_mutex_t DB_MUTEX;
+struct __db_mutexmgr;	typedef struct __db_mutexmgr DB_MUTEXMGR;
 struct __db_preplist;	typedef struct __db_preplist DB_PREPLIST;
 struct __db_qam_stat;	typedef struct __db_qam_stat DB_QUEUE_STAT;
 struct __db_rep;	typedef struct __db_rep DB_REP;
 struct __db_rep_stat;	typedef struct __db_rep_stat DB_REP_STAT;
-struct __db_sequence;	typedef struct __db_sequence DB_SEQUENCE;
+struct __db_repmgr_site; \
+			typedef struct __db_repmgr_site DB_REPMGR_SITE;
 struct __db_seq_record; typedef struct __db_seq_record DB_SEQ_RECORD;
 struct __db_seq_stat;	typedef struct __db_seq_stat DB_SEQUENCE_STAT;
+struct __db_sequence;	typedef struct __db_sequence DB_SEQUENCE;
 struct __db_txn;	typedef struct __db_txn DB_TXN;
 struct __db_txn_active;	typedef struct __db_txn_active DB_TXN_ACTIVE;
 struct __db_txn_stat;	typedef struct __db_txn_stat DB_TXN_STAT;
@@ -158,13 +171,9 @@ struct __fh_t;		typedef struct __fh_t DB_FH;
 struct __fname;		typedef struct __fname FNAME;
 struct __key_range;	typedef struct __key_range DB_KEY_RANGE;
 struct __mpoolfile;	typedef struct __mpoolfile MPOOLFILE;
-struct __mutex_t;	typedef struct __mutex_t DB_MUTEX;
 
 /* Key/data structure -- a Data-Base Thang. */
 struct __db_dbt {
-	/*
-	 * data/size must be fields 1 and 2 for DB 1.85 compatibility.
-	 */
 	void	 *data;			/* Key/data */
 	u_int32_t size;			/* key/data length */
 
@@ -172,13 +181,16 @@ struct __db_dbt {
 	u_int32_t dlen;			/* RO: get/put record length. */
 	u_int32_t doff;			/* RO: get/put record offset. */
 
+	void *app_data;
+
 #define	DB_DBT_APPMALLOC	0x001	/* Callback allocated memory. */
 #define	DB_DBT_ISSET		0x002	/* Lower level calls set value. */
 #define	DB_DBT_MALLOC		0x004	/* Return in malloc'd memory. */
 #define	DB_DBT_PARTIAL		0x008	/* Partial put/get. */
 #define	DB_DBT_REALLOC		0x010	/* Return in realloc'd memory. */
-#define	DB_DBT_USERMEM		0x020	/* Return in user's memory. */
-#define	DB_DBT_DUPOK		0x040	/* Insert if duplicate. */
+#define	DB_DBT_USERCOPY		0x020	/* Use the user-supplied callback. */
+#define	DB_DBT_USERMEM		0x040	/* Return in user's memory. */
+#define	DB_DBT_DUPOK		0x080	/* Insert if duplicate. */
 	u_int32_t flags;
 };
 
@@ -188,17 +200,19 @@ struct __db_dbt {
  *	interface specific flags in this range.
  */
 #define	DB_CREATE	      0x0000001	/* Create file as necessary. */
-#define	DB_CXX_NO_EXCEPTIONS  0x0000002	/* C++: return error values. */
+#define	DB_DURABLE_UNKNOWN    0x0000002 /* Durability on open (internal). */
 #define	DB_FORCE	      0x0000004	/* Force (anything). */
-#define	DB_NOMMAP	      0x0000008	/* Don't mmap underlying file. */
-#define	DB_RDONLY	      0x0000010	/* Read-only (O_RDONLY). */
-#define	DB_RECOVER	      0x0000020	/* Run normal recovery. */
-#define	DB_THREAD	      0x0000040	/* Applications are threaded. */
-#define	DB_TRUNCATE	      0x0000080	/* Discard existing DB (O_TRUNC). */
-#define	DB_TXN_NOSYNC	      0x0000100	/* Do not sync log on commit. */
-#define	DB_TXN_NOT_DURABLE    0x0000200	/* Do not log changes. */
-#define	DB_USE_ENVIRON	      0x0000400	/* Use the environment. */
-#define	DB_USE_ENVIRON_ROOT   0x0000800	/* Use the environment if root. */
+#define	DB_MULTIVERSION	      0x0000008 /* Multiversion concurrency control. */
+#define	DB_NOMMAP	      0x0000010	/* Don't mmap underlying file. */
+#define	DB_RDONLY	      0x0000020	/* Read-only (O_RDONLY). */
+#define	DB_RECOVER	      0x0000040	/* Run normal recovery. */
+#define	DB_THREAD	      0x0000080	/* Applications are threaded. */
+#define	DB_TRUNCATE	      0x0000100	/* Discard existing DB (O_TRUNC). */
+#define	DB_TXN_NOSYNC	      0x0000200	/* Do not sync log on commit. */
+#define	DB_TXN_NOT_DURABLE    0x0000400	/* Do not log changes. */
+#define	DB_TXN_WRITE_NOSYNC   0x0000800	/* Write the log but don't sync. */
+#define	DB_USE_ENVIRON	      0x0001000	/* Use the environment. */
+#define	DB_USE_ENVIRON_ROOT   0x0002000	/* Use the environment if root. */
 
 /*
  * Common flags --
@@ -206,66 +220,84 @@ struct __db_dbt {
  *	interface specific flags in this range.
  *
  * DB_AUTO_COMMIT:
- *	DB_ENV->set_flags, DB->associate, DB->del, DB->put, DB->open,
- *	DB->remove, DB->rename, DB->truncate
- * DB_DEGREE_2:
+ *	DB_ENV->set_flags, DB->open
+ *      (Note: until the 4.3 release, legal to DB->associate, DB->del,
+ *	DB->put, DB->remove, DB->rename and DB->truncate, and others.)
+ * DB_READ_COMMITTED:
  *	DB->cursor, DB->get, DB->join, DBcursor->c_get, DB_ENV->txn_begin
- * DB_DIRTY_READ:
+ * DB_READ_UNCOMMITTED:
  *	DB->cursor, DB->get, DB->join, DB->open, DBcursor->c_get,
  *	DB_ENV->txn_begin
- * DB_NOAUTO_COMMIT
- *	DB->associate, DB->del, DB->put, DB->open,
- *	DB->remove, DB->rename, DB->truncate
+ * DB_TXN_SNAPSHOT:
+ *	DB_ENV->set_flags, DB_ENV->txn_begin, DB->cursor
  *
  * !!!
- * The DB_DIRTY_READ and DB_DEGREE_2 bit masks can't be changed without
- * also changing the masks for the flags that can be OR'd into DB
+ * The DB_READ_COMMITTED and DB_READ_UNCOMMITTED bit masks can't be changed
+ * without also changing the masks for the flags that can be OR'd into DB
  * access method and cursor operation values.
  */
-#define	DB_AUTO_COMMIT	      0x01000000/* Implied transaction. */
-#define	DB_DEGREE_2	      0x02000000/* Degree 2. */
-#define	DB_DIRTY_READ	      0x04000000/* Dirty Read. */
-#define	DB_NO_AUTO_COMMIT     0x08000000/* Override env-wide AUTOCOMMIT. */
+#define	DB_AUTO_COMMIT	      0x02000000/* Implied transaction. */
+
+#define	DB_READ_COMMITTED     0x04000000/* Degree 2 isolation. */
+#define	DB_DEGREE_2	      0x04000000/*	Historic name. */
+
+#define	DB_READ_UNCOMMITTED   0x08000000/* Degree 1 isolation. */
+#define	DB_DIRTY_READ	      0x08000000/*	Historic name. */
+
+#define	DB_TXN_SNAPSHOT	      0x10000000/* Snapshot isolation. */
 
 /*
- * Flags private to db_env_create.
+ * Flags common to db_env_create and db_create.
  */
-#define	DB_RPCCLIENT	      0x0000001	/* An RPC client environment. */
+#define	DB_CXX_NO_EXCEPTIONS  0x0000001	/* C++: return error values. */
+
+/*
+ * Flags private to db_env_create.
+ *	   Shared flags up to 0x0000001 */
+#define	DB_RPCCLIENT	      0x0000002	/* An RPC client environment. */
 
 /*
  * Flags private to db_create.
- */
-#define	DB_REP_CREATE	      0x0000001	/* Open of an internal rep database. */
+ *	   Shared flags up to 0x0000001 */
 #define	DB_XA_CREATE	      0x0000002	/* Open in an XA environment. */
 
 /*
  * Flags private to DB_ENV->open.
- *	   Shared flags up to 0x0000800 */
-#define	DB_INIT_CDB	      0x0001000	/* Concurrent Access Methods. */
-#define	DB_INIT_LOCK	      0x0002000	/* Initialize locking. */
-#define	DB_INIT_LOG	      0x0004000	/* Initialize logging. */
-#define	DB_INIT_MPOOL	      0x0008000	/* Initialize mpool. */
-#define	DB_INIT_REP	      0x0010000	/* Initialize replication. */
-#define	DB_INIT_TXN	      0x0020000	/* Initialize transactions. */
-#define	DB_JOINENV	      0x0040000	/* Initialize all subsystems present. */
-#define	DB_LOCKDOWN	      0x0080000	/* Lock memory into physical core. */
-#define	DB_PRIVATE	      0x0100000	/* DB_ENV is process local. */
-#define	DB_RECOVER_FATAL      0x0200000	/* Run catastrophic recovery. */
-#define	DB_SYSTEM_MEM	      0x0400000	/* Use system-backed memory. */
+ *	   Shared flags up to 0x0002000 */
+#define	DB_INIT_CDB	      0x0004000	/* Concurrent Access Methods. */
+#define	DB_INIT_LOCK	      0x0008000	/* Initialize locking. */
+#define	DB_INIT_LOG	      0x0010000	/* Initialize logging. */
+#define	DB_INIT_MPOOL	      0x0020000	/* Initialize mpool. */
+#define	DB_INIT_REP	      0x0040000	/* Initialize replication. */
+#define	DB_INIT_TXN	      0x0080000	/* Initialize transactions. */
+#define	DB_LOCKDOWN	      0x0100000	/* Lock memory into physical core. */
+#define	DB_PRIVATE	      0x0200000	/* DB_ENV is process local. */
+#define	DB_RECOVER_FATAL      0x0400000	/* Run catastrophic recovery. */
+#define	DB_REGISTER	      0x0800000	/* Multi-process registry. */
+#define	DB_SYSTEM_MEM	      0x1000000	/* Use system-backed memory. */
+
+#define	DB_JOINENV	      0x0	/* Compatibility. */
 
 /*
  * Flags private to DB->open.
- *	   Shared flags up to 0x0000800 */
-#define	DB_EXCL		      0x0001000	/* Exclusive open (O_EXCL). */
-#define	DB_FCNTL_LOCKING      0x0002000	/* UNDOC: fcntl(2) locking. */
-#define	DB_RDWRMASTER	      0x0004000	/* UNDOC: allow subdb master open R/W */
-#define	DB_WRITEOPEN	      0x0008000	/* UNDOC: open with write lock. */
+ *	   Shared flags up to 0x0002000 */
+#define	DB_EXCL		      0x0004000	/* Exclusive open (O_EXCL). */
+#define	DB_FCNTL_LOCKING      0x0008000	/* UNDOC: fcntl(2) locking. */
+#define	DB_NO_AUTO_COMMIT     0x0010000	/* Override env-wide AUTOCOMMIT. */
+#define	DB_RDWRMASTER	      0x0020000	/* UNDOC: allow subdb master open R/W */
+#define	DB_WRITEOPEN	      0x0040000	/* UNDOC: open with write lock. */
+
+/*
+ * Flags private to DB->associate.
+ *	   Shared flags up to 0x0002000 */
+#define	DB_IMMUTABLE_KEY      0x0004000	/* Secondary key is immutable. */
+/*	      Shared flags at 0x1000000 */
 
 /*
  * Flags private to DB_ENV->txn_begin.
- *	   Shared flags up to 0x0000800 */
-#define	DB_TXN_NOWAIT	      0x0001000	/* Do not wait for locks in this TXN. */
-#define	DB_TXN_SYNC	      0x0002000	/* Always sync log on commit. */
+ *	   Shared flags up to 0x0002000 */
+#define	DB_TXN_NOWAIT	      0x0004000	/* Do not wait for locks in this TXN. */
+#define	DB_TXN_SYNC	      0x0008000	/* Always sync log on commit. */
 
 /*
  * Flags private to DB_ENV->set_encrypt.
@@ -274,25 +306,25 @@ struct __db_dbt {
 
 /*
  * Flags private to DB_ENV->set_flags.
- *	   Shared flags up to 0x00000800 */
-#define	DB_CDB_ALLDB	      0x00001000/* Set CDB locking per environment. */
-#define	DB_DIRECT_DB	      0x00002000/* Don't buffer databases in the OS. */
-#define	DB_DIRECT_LOG	      0x00004000/* Don't buffer log files in the OS. */
-#define	DB_DSYNC_LOG	      0x00008000/* Set O_DSYNC on the log. */
-#define	DB_LOG_AUTOREMOVE     0x00010000/* Automatically remove log files. */
-#define	DB_LOG_INMEMORY       0x00020000/* Store logs in buffers in memory. */
-#define	DB_NOLOCKING	      0x00040000/* Set locking/mutex behavior. */
-#define	DB_NOPANIC	      0x00080000/* Set panic state per DB_ENV. */
-#define	DB_OVERWRITE	      0x00100000/* Overwrite unlinked region files. */
-#define	DB_PANIC_ENVIRONMENT  0x00200000/* Set panic state per environment. */
-#define	DB_REGION_INIT	      0x00400000/* Page-fault regions on open. */
-#define	DB_TIME_NOTGRANTED    0x00800000/* Return NOTGRANTED on timeout. */
-/*	      Shared flags at 0x01000000 */
+ *	   Shared flags up to 0x00002000 */
+#define	DB_CDB_ALLDB	      0x00004000/* Set CDB locking per environment. */
+#define	DB_DIRECT_DB	      0x00008000/* Don't buffer databases in the OS. */
+#define	DB_DIRECT_LOG	      0x00010000/* Don't buffer log files in the OS. */
+#define	DB_DSYNC_DB	      0x00020000/* Set O_DSYNC on the databases. */
+#define	DB_DSYNC_LOG	      0x00040000/* Set O_DSYNC on the log. */
+#define	DB_LOG_AUTOREMOVE     0x00080000/* Automatically remove log files. */
+#define	DB_LOG_INMEMORY       0x00100000/* Store logs in buffers in memory. */
+#define	DB_NOLOCKING	      0x00200000/* Set locking/mutex behavior. */
+#define	DB_NOPANIC	      0x00400000/* Set panic state per DB_ENV. */
+#define	DB_OVERWRITE	      0x00800000/* Overwrite unlinked region files. */
+#define	DB_PANIC_ENVIRONMENT  0x01000000/* Set panic state per environment. */
 /*	      Shared flags at 0x02000000 */
 /*	      Shared flags at 0x04000000 */
 /*	      Shared flags at 0x08000000 */
-#define	DB_TXN_WRITE_NOSYNC   0x10000000/* Write, don't sync, on txn commit. */
-#define	DB_YIELDCPU	      0x20000000/* Yield the CPU (a lot). */
+/*	      Shared flags at 0x10000000 */
+#define	DB_REGION_INIT	      0x20000000/* Page-fault regions on open. */
+#define	DB_TIME_NOTGRANTED    0x40000000/* Return NOTGRANTED on timeout. */
+#define	DB_YIELDCPU	      0x80000000/* Yield the CPU (a lot). */
 
 /*
  * Flags private to DB->set_feedback's callback.
@@ -300,38 +332,48 @@ struct __db_dbt {
 #define	DB_UPGRADE	      0x0000001	/* Upgrading. */
 #define	DB_VERIFY	      0x0000002	/* Verifying. */
 
+/*
+ * Flags private to DB->compact.
+ *	   Shared flags up to 0x00002000
+ */
+#define	DB_FREELIST_ONLY      0x00004000 /* Just sort and truncate. */
+#define	DB_FREE_SPACE         0x00008000 /* Free space . */
+#define	DB_COMPACT_FLAGS      \
+      (DB_FREELIST_ONLY | DB_FREE_SPACE)
+
 /*
  * Flags private to DB_MPOOLFILE->open.
- *	   Shared flags up to 0x0000800 */
-#define	DB_DIRECT	      0x0001000	/* Don't buffer the file in the OS. */
-#define	DB_DURABLE_UNKNOWN    0x0002000 /* internal: durability on open. */
-#define	DB_EXTENT	      0x0004000	/* internal: dealing with an extent. */
-#define	DB_ODDFILESIZE	      0x0008000	/* Truncate file to N * pgsize. */
+ *	   Shared flags up to 0x0002000 */
+#define	DB_DIRECT	      0x0004000	/* Don't buffer the file in the OS. */
+#define	DB_EXTENT	      0x0008000	/* internal: dealing with an extent. */
+#define	DB_ODDFILESIZE	      0x0010000	/* Truncate file to N * pgsize. */
 
 /*
  * Flags private to DB->set_flags.
- */
-#define	DB_CHKSUM	      0x0000001	/* Do checksumming */
-#define	DB_DUP		      0x0000002	/* Btree, Hash: duplicate keys. */
-#define	DB_DUPSORT	      0x0000004	/* Btree, Hash: duplicate keys. */
-#define	DB_ENCRYPT	      0x0000008	/* Btree, Hash: duplicate keys. */
-#define	DB_INORDER	      0x0000010	/* Queue: strict ordering on consume. */
-#define	DB_RECNUM	      0x0000020	/* Btree: record numbers. */
-#define	DB_RENUMBER	      0x0000040	/* Recno: renumber on insert/delete. */
-#define	DB_REVSPLITOFF	      0x0000080	/* Btree: turn off reverse splits. */
-#define	DB_SNAPSHOT	      0x0000100	/* Recno: snapshot the input. */
+ *	   Shared flags up to 0x00002000 */
+#define	DB_CHKSUM	      0x00004000 /* Do checksumming */
+#define	DB_DUP		      0x00008000 /* Btree, Hash: duplicate keys. */
+#define	DB_DUPSORT	      0x00010000 /* Btree, Hash: duplicate keys. */
+#define	DB_ENCRYPT	      0x00020000 /* Btree, Hash: duplicate keys. */
+#define	DB_INORDER	      0x00040000 /* Queue: strict ordering on consume */
+#define	DB_RECNUM	      0x00080000 /* Btree: record numbers. */
+#define	DB_RENUMBER	      0x00100000 /* Recno: renumber on insert/delete. */
+#define	DB_REVSPLITOFF	      0x00200000 /* Btree: turn off reverse splits. */
+#define	DB_SNAPSHOT	      0x00400000 /* Recno: snapshot the input. */
 
 /*
  * Flags private to the DB_ENV->stat_print, DB->stat and DB->stat_print methods.
  */
-#define	DB_STAT_ALL	      0x0000001	/* Print: Everything. */
-#define	DB_STAT_CLEAR	      0x0000002	/* Clear stat after returning values. */
-#define	DB_STAT_LOCK_CONF     0x0000004	/* Print: Lock conflict matrix. */
-#define	DB_STAT_LOCK_LOCKERS  0x0000008	/* Print: Lockers. */
-#define	DB_STAT_LOCK_OBJECTS  0x0000010	/* Print: Lock objects. */
-#define	DB_STAT_LOCK_PARAMS   0x0000020	/* Print: Lock parameters. */
-#define	DB_STAT_MEMP_HASH     0x0000040	/* Print: Mpool hash buckets. */
-#define	DB_STAT_SUBSYSTEM     0x0000080	/* Print: Subsystems too. */
+#define	DB_FAST_STAT	      0x0000001 /* Don't traverse the database. */
+#define	DB_STAT_ALL	      0x0000002	/* Print: Everything. */
+#define	DB_STAT_CLEAR	      0x0000004	/* Clear stat after returning values. */
+#define	DB_STAT_LOCK_CONF     0x0000008	/* Print: Lock conflict matrix. */
+#define	DB_STAT_LOCK_LOCKERS  0x0000010	/* Print: Lockers. */
+#define	DB_STAT_LOCK_OBJECTS  0x0000020	/* Print: Lock objects. */
+#define	DB_STAT_LOCK_PARAMS   0x0000040	/* Print: Lock parameters. */
+#define	DB_STAT_MEMP_HASH     0x0000080	/* Print: Mpool hash buckets. */
+#define	DB_STAT_NOERROR       0x0000100 /* Internal: continue on error. */
+#define	DB_STAT_SUBSYSTEM     0x0000200 /* Print: Subsystems too. */
 
 /*
  * Flags private to DB->join.
@@ -356,10 +398,45 @@ struct __db_dbt {
  */
 
 /*
- * Flags private to DB->set_rep_transport's send callback.
+ * Flags private to DB->rep_set_transport's send callback.
  */
-#define	DB_REP_NOBUFFER	      0x0000001	/* Do not buffer this message. */
-#define	DB_REP_PERMANENT      0x0000002	/* Important--app. may want to flush. */
+#define	DB_REP_ANYWHERE	      0x0000001	/* Message can be serviced anywhere. */
+#define	DB_REP_NOBUFFER	      0x0000002	/* Do not buffer this message. */
+#define	DB_REP_PERMANENT      0x0000004	/* Important--app. may want to flush. */
+#define	DB_REP_REREQUEST      0x0000008	/* This msg already been requested. */
+
+/*******************************************************
+ * Mutexes.
+ *******************************************************/
+typedef u_int32_t	db_mutex_t;
+
+/*
+ * Flag arguments for DbEnv.mutex_alloc, DbEnv.is_alive and for the
+ * DB_MUTEX structure.
+ */
+#define	DB_MUTEX_ALLOCATED	0x01	/* Mutex currently allocated. */
+#define	DB_MUTEX_LOCKED		0x02	/* Mutex currently locked. */
+#define	DB_MUTEX_LOGICAL_LOCK	0x04	/* Mutex backs a database lock. */
+#define	DB_MUTEX_PROCESS_ONLY	0x08	/* Mutex private to a process. */
+#define	DB_MUTEX_SELF_BLOCK	0x10	/* Must be able to block self. */
+
+struct __db_mutex_stat {
+	/* The following fields are maintained in the region's copy. */
+	u_int32_t st_mutex_align;	/* Mutex alignment */
+	u_int32_t st_mutex_tas_spins;	/* Mutex test-and-set spins */
+	u_int32_t st_mutex_cnt;		/* Mutex count */
+	u_int32_t st_mutex_free;	/* Available mutexes */
+	u_int32_t st_mutex_inuse;	/* Mutexes in use */
+	u_int32_t st_mutex_inuse_max;	/* Maximum mutexes ever in use */
+
+	/* The following fields are filled-in from other places. */
+	u_int32_t st_region_wait;	/* Region lock granted after wait. */
+	u_int32_t st_region_nowait;	/* Region lock granted without wait. */
+	roff_t	  st_regsize;		/* Region size. */
+};
+
+/* This is the length of the buffer passed to DB_ENV->thread_id_string() */
+#define	DB_THREADID_STRLEN	128
 
 /*******************************************************
  * Locking.
@@ -387,10 +464,9 @@ struct __db_dbt {
 #define	DB_LOCK_ABORT		0x001	/* Internal: Lock during abort. */
 #define	DB_LOCK_NOWAIT		0x002	/* Don't wait on unavailable lock. */
 #define	DB_LOCK_RECORD		0x004	/* Internal: record lock. */
-#define	DB_LOCK_REMOVE		0x008	/* Internal: flag object removed. */
-#define	DB_LOCK_SET_TIMEOUT	0x010	/* Internal: set lock timeout. */
-#define	DB_LOCK_SWITCH		0x020	/* Internal: switch existing lock. */
-#define	DB_LOCK_UPGRADE		0x040	/* Internal: upgrade existing lock. */
+#define	DB_LOCK_SET_TIMEOUT	0x008	/* Internal: set lock timeout. */
+#define	DB_LOCK_SWITCH		0x010	/* Internal: switch existing lock. */
+#define	DB_LOCK_UPGRADE		0x020	/* Internal: upgrade existing lock. */
 
 /*
  * Simple R/W lock modes and for multi-granularity intention locking.
@@ -408,7 +484,7 @@ typedef enum {
 	DB_LOCK_IWRITE=4,		/* Intent exclusive/write. */
 	DB_LOCK_IREAD=5,		/* Intent to share/read. */
 	DB_LOCK_IWR=6,			/* Intent to read and write. */
-	DB_LOCK_DIRTY=7,		/* Dirty Read. */
+	DB_LOCK_READ_UNCOMMITTED=7,	/* Degree 1 isolation. */
 	DB_LOCK_WWRITE=8		/* Was Written. */
 } db_lockmode_t;
 
@@ -437,12 +513,10 @@ typedef enum  {
 	DB_LSTAT_EXPIRED=2,		/* Lock has expired. */
 	DB_LSTAT_FREE=3,		/* Lock is unallocated. */
 	DB_LSTAT_HELD=4,		/* Lock is currently held. */
-	DB_LSTAT_NOTEXIST=5,		/* Object on which lock was waiting
-					 * was removed */
-	DB_LSTAT_PENDING=6,		/* Lock was waiting and has been
+	DB_LSTAT_PENDING=5,		/* Lock was waiting and has been
 					 * promoted; waiting for the owner
 					 * to run and upgrade it to held. */
-	DB_LSTAT_WAITING=7		/* Lock is on the wait queue. */
+	DB_LSTAT_WAITING=6		/* Lock is on the wait queue. */
 }db_status_t;
 
 /* Lock statistics structure. */
@@ -459,11 +533,12 @@ struct __db_lock_stat {
 	u_int32_t st_maxnlockers;	/* Maximum number of lockers so far. */
 	u_int32_t st_nobjects;		/* Current number of objects. */
 	u_int32_t st_maxnobjects;	/* Maximum number of objects so far. */
-	u_int32_t st_nconflicts;	/* Number of lock conflicts. */
 	u_int32_t st_nrequests;		/* Number of lock gets. */
 	u_int32_t st_nreleases;		/* Number of lock puts. */
-	u_int32_t st_nnowaits;		/* Number of requests that would have
-					   waited, but NOWAIT was set. */
+	u_int32_t st_nupgrade;		/* Number of lock upgrades. */
+	u_int32_t st_ndowngrade;	/* Number of lock downgrades. */
+	u_int32_t st_lock_wait;		/* Lock conflicts w/ subsequent wait */
+	u_int32_t st_lock_nowait;	/* Lock conflicts w/o subsequent wait */
 	u_int32_t st_ndeadlocks;	/* Number of lock deadlocks. */
 	db_timeout_t st_locktimeout;	/* Lock timeout. */
 	u_int32_t st_nlocktimeouts;	/* Number of lock timeouts. */
@@ -512,8 +587,8 @@ struct __db_lockreq {
 /*******************************************************
  * Logging.
  *******************************************************/
-#define	DB_LOGVERSION	10		/* Current log version. */
-#define	DB_LOGOLDVER	10		/* Oldest log version supported. */
+#define	DB_LOGVERSION	12		/* Current log version. */
+#define	DB_LOGOLDVER	8		/* Oldest log version supported. */
 #define	DB_LOGMAGIC	0x040988
 
 /* Flag values for DB_ENV->log_archive(). */
@@ -528,9 +603,7 @@ struct __db_lockreq {
 #define	DB_LOG_COMMIT		0x004	/* Flush supports a commit */
 #define	DB_LOG_NOCOPY		0x008	/* Don't copy data */
 #define	DB_LOG_NOT_DURABLE	0x010	/* Do not log; keep in memory */
-#define	DB_LOG_PERM		0x020	/* Flag record with REP_PERMANENT */
-#define	DB_LOG_RESEND		0x040	/* Resent log record */
-#define	DB_LOG_WRNOSYNC		0x080	/* Write, don't sync log_put */
+#define	DB_LOG_WRNOSYNC		0x020	/* Write, don't sync log_put */
 
 /*
  * A DB_LSN has two parts, a fileid which identifies a specific file, and an
@@ -571,8 +644,9 @@ struct __db_log_cursor {
 	u_int32_t c_prev;		/* Cursor: previous record's offset */
 
 	DBT	  c_dbt;		/* Return DBT. */
+	DB_LSN    p_lsn;		/* Persist LSN. */
+	u_int32_t p_version;		/* Persist version. */
 
-#define	DB_LOGC_BUF_SIZE	(32 * 1024)
 	u_int8_t *bp;			/* Allocated read buffer. */
 	u_int32_t bp_size;		/* Read buffer length in bytes. */
 	u_int32_t bp_rlen;		/* Read buffer valid data length. */
@@ -580,9 +654,11 @@ struct __db_log_cursor {
 
 	u_int32_t bp_maxrec;		/* Max record length in the log file. */
 
-					/* Methods. */
+	/* DB_LOGC PUBLIC HANDLE LIST BEGIN */
 	int (*close) __P((DB_LOGC *, u_int32_t));
 	int (*get) __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
+	int (*version) __P((DB_LOGC *, u_int32_t *, u_int32_t));
+	/* DB_LOGC PUBLIC HANDLE LIST END */
 
 #define	DB_LOG_DISK		0x01	/* Log record came from disk. */
 #define	DB_LOG_LOCKED		0x02	/* Log region already locked */
@@ -594,15 +670,17 @@ struct __db_log_cursor {
 struct __db_log_stat {
 	u_int32_t st_magic;		/* Log file magic number. */
 	u_int32_t st_version;		/* Log file version number. */
-	int	  st_mode;			/* Log file mode. */
+	int	  st_mode;		/* Log file permissions mode. */
 	u_int32_t st_lg_bsize;		/* Log buffer size. */
 	u_int32_t st_lg_size;		/* Log file size. */
+	u_int32_t st_record;		/* Records entered into the log. */
 	u_int32_t st_w_bytes;		/* Bytes to log. */
 	u_int32_t st_w_mbytes;		/* Megabytes to log. */
 	u_int32_t st_wc_bytes;		/* Bytes to log since checkpoint. */
 	u_int32_t st_wc_mbytes;		/* Megabytes to log since checkpoint. */
-	u_int32_t st_wcount;		/* Total writes to the log. */
+	u_int32_t st_wcount;		/* Total I/O writes to the log. */
 	u_int32_t st_wcount_fill;	/* Overflow writes to the log. */
+	u_int32_t st_rcount;		/* Total I/O reads from the log. */
 	u_int32_t st_scount;		/* Total syncs to the log. */
 	u_int32_t st_region_wait;	/* Region lock granted after wait. */
 	u_int32_t st_region_nowait;	/* Region lock granted without wait. */
@@ -616,26 +694,28 @@ struct __db_log_stat {
 };
 
 /*
- * We need to record the first log record of a transaction.
- * For user defined logging this macro returns the place to
- * put that information, if it is need in rlsnp, otherwise it
- * leaves it unchanged.
+ * We need to record the first log record of a transaction.  For user
+ * defined logging this macro returns the place to put that information,
+ * if it is need in rlsnp, otherwise it leaves it unchanged.  We also
+ * need to track the last record of the transaction, this returns the
+ * place to put that info.
  */
-#define	DB_SET_BEGIN_LSNP(txn, rlsnp)	((txn)->set_begin_lsnp(txn, rlsnp))
+#define	DB_SET_TXN_LSNP(txn, blsnp, llsnp)		\
+	((txn)->set_txn_lsnp(txn, blsnp, llsnp))
 
 /*******************************************************
  * Shared buffer cache (mpool).
  *******************************************************/
 /* Flag values for DB_MPOOLFILE->get. */
 #define	DB_MPOOL_CREATE		0x001	/* Create a page. */
-#define	DB_MPOOL_LAST		0x002	/* Return the last page. */
-#define	DB_MPOOL_NEW		0x004	/* Create a new page. */
+#define	DB_MPOOL_DIRTY		0x002	/* Get page for an update. */
+#define	DB_MPOOL_EDIT		0x004	/* Modify without copying. */
+#define	DB_MPOOL_FREE		0x008	/* Free page if present. */
+#define	DB_MPOOL_LAST		0x010	/* Return the last page. */
+#define	DB_MPOOL_NEW		0x020	/* Create a new page. */
 
 /* Flag values for DB_MPOOLFILE->put, DB_MPOOLFILE->set. */
-#define	DB_MPOOL_CLEAN		0x001	/* Page is not modified. */
-#define	DB_MPOOL_DIRTY		0x002	/* Page is modified. */
-#define	DB_MPOOL_DISCARD	0x004	/* Don't cache the page. */
-#define	DB_MPOOL_FREE		0x008	/* Free page if present. */
+#define	DB_MPOOL_DISCARD	0x001	/* Don't cache the page. */
 
 /* Flags values for DB_MPOOLFILE->set_flags. */
 #define	DB_MPOOL_NOFILE		0x001	/* Never open a backing file. */
@@ -692,17 +772,17 @@ struct __db_mpoolfile {
 	int32_t		lsn_offset;	/* LSN offset in page. */
 	u_int32_t	gbytes, bytes;	/* Maximum file size. */
 	DBT	       *pgcookie;	/* Byte-string passed to pgin/pgout. */
-	DB_CACHE_PRIORITY		/* Cache priority. */
-			priority;
+	int32_t		priority;	/* Cache priority. */
 
 	void	       *addr;		/* Address of mmap'd region. */
 	size_t		len;		/* Length of mmap'd region. */
 
 	u_int32_t	config_flags;	/* Flags to DB_MPOOLFILE->set_flags. */
 
-					/* Methods. */
+	/* DB_MPOOLFILE PUBLIC HANDLE LIST BEGIN */
 	int (*close) __P((DB_MPOOLFILE *, u_int32_t));
-	int (*get) __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *));
+	int (*get)
+	    __P((DB_MPOOLFILE *, db_pgno_t *, DB_TXN *, u_int32_t, void *));
 	int (*open) __P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t));
 	int (*put) __P((DB_MPOOLFILE *, void *, u_int32_t));
 	int (*set) __P((DB_MPOOLFILE *, void *, u_int32_t));
@@ -723,6 +803,7 @@ struct __db_mpoolfile {
 	int (*get_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY *));
 	int (*set_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY));
 	int (*sync) __P((DB_MPOOLFILE *));
+	/* DB_MPOOLFILE PUBLIC HANDLE LIST END */
 
 	/*
 	 * MP_FILEID_SET, MP_OPEN_CALLED and MP_READONLY do not need to be
@@ -734,8 +815,9 @@ struct __db_mpoolfile {
 	 */
 #define	MP_FILEID_SET	0x001		/* Application supplied a file ID. */
 #define	MP_FLUSH	0x002		/* Was opened to flush a buffer. */
-#define	MP_OPEN_CALLED	0x004		/* File opened. */
-#define	MP_READONLY	0x008		/* File is readonly. */
+#define	MP_MULTIVERSION	0x004		/* Opened for multiversion access. */
+#define	MP_OPEN_CALLED	0x008		/* File opened. */
+#define	MP_READONLY	0x010		/* File is readonly. */
 	u_int32_t  flags;
 };
 
@@ -767,14 +849,19 @@ struct __db_mpool_stat {
 	u_int32_t st_hash_examined;	/* Total hash entries searched. */
 	u_int32_t st_hash_nowait;	/* Hash lock granted with nowait. */
 	u_int32_t st_hash_wait;		/* Hash lock granted after wait. */
+	u_int32_t st_hash_max_nowait;	/* Max hash lock granted with nowait. */
 	u_int32_t st_hash_max_wait;	/* Max hash lock granted after wait. */
 	u_int32_t st_region_nowait;	/* Region lock granted with nowait. */
 	u_int32_t st_region_wait;	/* Region lock granted after wait. */
+	u_int32_t st_mvcc_frozen;		/* Buffers frozen. */
+	u_int32_t st_mvcc_thawed;		/* Buffers thawed. */
+	u_int32_t st_mvcc_freed;		/* Frozen buffers freed. */
 	u_int32_t st_alloc;		/* Number of page allocations. */
 	u_int32_t st_alloc_buckets;	/* Buckets checked during allocation. */
 	u_int32_t st_alloc_max_buckets;	/* Max checked during allocation. */
 	u_int32_t st_alloc_pages;	/* Pages checked during allocation. */
 	u_int32_t st_alloc_max_pages;	/* Max checked during allocation. */
+	u_int32_t st_io_wait;		/* Thread waited on buffer I/O. */
 };
 
 /* Mpool file statistics structure. */
@@ -818,12 +905,14 @@ typedef enum {
 struct __db_txn {
 	DB_TXNMGR	*mgrp;		/* Pointer to transaction manager. */
 	DB_TXN		*parent;	/* Pointer to transaction's parent. */
-	DB_LSN		last_lsn;	/* Lsn of last log write. */
+
 	u_int32_t	txnid;		/* Unique transaction id. */
-	u_int32_t	tid;		/* Thread id for use in MT XA. */
-	roff_t		off;		/* Detail structure within region. */
+	char		*name;		/* Transaction name */
+
+	db_threadid_t	tid;		/* Thread id for use in MT XA. */
+	void		*td;		/* Detail structure within region. */
 	db_timeout_t	lock_timeout;	/* Timeout for locks for this txn. */
-	db_timeout_t	expire;		/* Time this txn expires. */
+	db_timeout_t	expire;		/* Time transaction expires. */
 	void		*txn_list;	/* Undo information for parent. */
 
 	/*
@@ -841,6 +930,16 @@ struct __db_txn {
 		struct __db_txn **tqe_prev;
 	} xalinks;			/* Links active XA transactions. */
 
+	/*
+	 * !!!
+	 * Explicit representations of structures from queue.h.
+	 * TAILQ_HEAD(__kids, __db_txn) kids;
+	 */
+	struct __kids {
+		struct __db_txn *tqh_first;
+		struct __db_txn **tqh_last;
+	} kids;
+
 	/*
 	 * !!!
 	 * Explicit representations of structures from queue.h.
@@ -861,16 +960,6 @@ struct __db_txn {
 		struct __txn_logrec **stqh_last;
 	} logs;				/* Links deferred events. */
 
-	/*
-	 * !!!
-	 * Explicit representations of structures from queue.h.
-	 * TAILQ_HEAD(__kids, __db_txn) kids;
-	 */
-	struct __kids {
-		struct __db_txn *tqh_first;
-		struct __db_txn **tqh_last;
-	} kids;
-
 	/*
 	 * !!!
 	 * Explicit representations of structures from queue.h.
@@ -886,32 +975,44 @@ struct __db_txn {
 
 	u_int32_t	cursors;	/* Number of cursors open for txn */
 
-					/* Methods. */
+	/* DB_TXN PUBLIC HANDLE LIST BEGIN */
 	int	  (*abort) __P((DB_TXN *));
 	int	  (*commit) __P((DB_TXN *, u_int32_t));
 	int	  (*discard) __P((DB_TXN *, u_int32_t));
+	int	  (*get_name) __P((DB_TXN *, const char **));
 	u_int32_t (*id) __P((DB_TXN *));
 	int	  (*prepare) __P((DB_TXN *, u_int8_t *));
-	void	  (*set_begin_lsnp) __P((DB_TXN *txn, DB_LSN **));
+	int	  (*set_name) __P((DB_TXN *, const char *));
 	int	  (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t));
-
-#define	TXN_CHILDCOMMIT	0x001		/* Transaction that has committed. */
-#define	TXN_COMPENSATE	0x002		/* Compensating transaction. */
-#define	TXN_DEADLOCK	0x004		/* Transaction has deadlocked. */
-#define	TXN_DEGREE_2	0x008		/* Has degree 2 isolation. */
-#define	TXN_DIRTY_READ	0x010		/* Transaction does dirty reads. */
-#define	TXN_LOCKTIMEOUT	0x020		/* Transaction has a lock timeout. */
-#define	TXN_MALLOC	0x040		/* Structure allocated by TXN system. */
-#define	TXN_NOSYNC	0x080		/* Do not sync on prepare and commit. */
-#define	TXN_NOWAIT	0x100		/* Do not wait on locks. */
-#define	TXN_RESTORED	0x200		/* Transaction has been restored. */
-#define	TXN_SYNC	0x400		/* Sync on prepare and commit. */
+	/* DB_TXN PUBLIC HANDLE LIST END */
+
+	/* DB_TXN PRIVATE HANDLE LIST BEGIN */
+	void	  (*set_txn_lsnp) __P((DB_TXN *txn, DB_LSN **, DB_LSN **));
+	/* DB_TXN PRIVATE HANDLE LIST END */
+
+#define	TXN_CHILDCOMMIT		0x0001	/* Txn has committed. */
+#define	TXN_CDSGROUP		0x0002	/* CDS group handle. */
+#define	TXN_COMPENSATE		0x0004	/* Compensating transaction. */
+#define	TXN_DEADLOCK		0x0008	/* Txn has deadlocked. */
+#define	TXN_LOCKTIMEOUT		0x0010	/* Txn has a lock timeout. */
+#define	TXN_MALLOC		0x0020	/* Structure allocated by TXN system. */
+#define	TXN_NOSYNC		0x0040	/* Do not sync on prepare and commit. */
+#define	TXN_NOWAIT		0x0080	/* Do not wait on locks. */
+#define	TXN_PRIVATE		0x0100	/* Txn owned by cursor.. */
+#define	TXN_READ_COMMITTED	0x0200	/* Txn has degree 2 isolation. */
+#define	TXN_READ_UNCOMMITTED	0x0400	/* Txn has degree 1 isolation. */
+#define	TXN_RESTORED		0x0800	/* Txn has been restored. */
+#define	TXN_SNAPSHOT		0x1000	/* Snapshot Isolation. */
+#define	TXN_SYNC		0x2000	/* Write and sync on prepare/commit. */
+#define	TXN_WRITE_NOSYNC	0x4000	/* Write only on prepare/commit. */
 	u_int32_t	flags;
 };
 
+#define	TXN_SYNC_FLAGS (TXN_SYNC | TXN_NOSYNC | TXN_WRITE_NOSYNC)
+
 /*
  * Structure used for two phase commit interface.  Berkeley DB support for two
- * phase commit is compatible with the X/open XA interface.
+ * phase commit is compatible with the X/Open XA interface.
  *
  * The XA #define XIDDATASIZE defines the size of a global transaction ID.  We
  * have our own version here (for name space reasons) which must have the same
@@ -927,9 +1028,30 @@ struct __db_preplist {
 struct __db_txn_active {
 	u_int32_t txnid;		/* Transaction ID */
 	u_int32_t parentid;		/* Transaction ID of parent */
+	pid_t     pid;			/* Process owning txn ID */
+	db_threadid_t tid;		/* Thread owning txn ID */
+
 	DB_LSN	  lsn;			/* LSN when transaction began */
+
+	DB_LSN	  read_lsn;		/* Read LSN for MVCC */
+	u_int32_t mvcc_ref;		/* MVCC reference count */
+
+#define	TXN_ABORTED		1
+#define	TXN_COMMITTED		2
+#define	TXN_PREPARED		3
+#define	TXN_RUNNING		4
+	u_int32_t status;		/* Status of the transaction */
+
+#define	TXN_XA_ABORTED		1
+#define	TXN_XA_DEADLOCKED	2
+#define	TXN_XA_ENDED		3
+#define	TXN_XA_PREPARED		4
+#define	TXN_XA_STARTED		5
+#define	TXN_XA_SUSPENDED	6
 	u_int32_t xa_status;		/* XA status */
-	u_int8_t  xid[DB_XIDDATASIZE];	/* XA global transaction ID */
+
+	u_int8_t  xid[DB_XIDDATASIZE];	/* Global transaction ID */
+	char	  name[51];		/* 50 bytes of name, nul termination */
 };
 
 struct __db_txn_stat {
@@ -941,9 +1063,11 @@ struct __db_txn_stat {
 	u_int32_t st_nbegins;		/* number of begun transactions */
 	u_int32_t st_ncommits;		/* number of committed transactions */
 	u_int32_t st_nactive;		/* number of active transactions */
+	u_int32_t st_nsnapshot;		/* number of snapshot transactions */
 	u_int32_t st_nrestores;		/* number of restored transactions
 					   after recovery. */
 	u_int32_t st_maxnactive;	/* maximum active transactions */
+	u_int32_t st_maxnsnapshot;	/* maximum snapshot transactions */
 	DB_TXN_ACTIVE *st_txnarray;	/* array of active transactions */
 	u_int32_t st_region_wait;	/* Region lock granted after wait. */
 	u_int32_t st_region_nowait;	/* Region lock granted without wait. */
@@ -957,9 +1081,60 @@ struct __db_txn_stat {
 #define	DB_EID_BROADCAST	-1
 #define	DB_EID_INVALID		-2
 
-/* rep_start flags values */
-#define	DB_REP_CLIENT		0x001
-#define	DB_REP_MASTER		0x002
+/* rep_config flag values. */
+#define	DB_REP_CONF_BULK	0x0001	/* Bulk transfer. */
+#define	DB_REP_CONF_DELAYCLIENT	0x0002	/* Delay client synchronization. */
+#define	DB_REP_CONF_NOAUTOINIT	0x0004	/* No automatic client init. */
+#define	DB_REP_CONF_NOWAIT	0x0008	/* Don't wait, return error. */
+
+/*
+ * Operation code values for rep_start and/or repmgr_start.  Just one of the
+ * following values should be passed in the flags parameter.  (If we ever need
+ * additional, independent bit flags for these methods, we can start allocating
+ * them from the high-order byte of the flags word, as we currently do elsewhere
+ * for DB_AFTER through DB_WRITELOCK and DB_AUTO_COMMIT, etc.)
+ */
+#define	DB_REP_CLIENT			1
+#define	DB_REP_ELECTION			2
+#define	DB_REP_FULL_ELECTION		3
+#define	DB_REP_MASTER			4
+
+/* Acknowledgement policies. */
+#define	DB_REPMGR_ACKS_ALL		1
+#define	DB_REPMGR_ACKS_ALL_PEERS	2
+#define	DB_REPMGR_ACKS_NONE		3
+#define	DB_REPMGR_ACKS_ONE		4
+#define	DB_REPMGR_ACKS_ONE_PEER		5
+#define	DB_REPMGR_ACKS_QUORUM		6
+
+/* Replication Framework timeout configuration values. */
+#define	DB_REP_ACK_TIMEOUT	1
+#define	DB_REP_ELECTION_TIMEOUT 2
+#define	DB_REP_ELECTION_RETRY	3
+#define	DB_REP_CONNECTION_RETRY 4
+
+/* Event notification types. */
+#define	DB_EVENT_NO_SUCH_EVENT		0 /* out-of-band sentinel value */
+#define	DB_EVENT_PANIC			1
+#define	DB_EVENT_REP_CLIENT		2
+#define	DB_EVENT_REP_MASTER		3
+#define	DB_EVENT_REP_NEWMASTER		4
+#define	DB_EVENT_REP_STARTUPDONE	5
+#define	DB_EVENT_WRITE_FAILED		6
+
+/* Flag value for repmgr_add_remote_site. */
+#define	DB_REPMGR_PEER          0x01
+
+/* Replication Manager site status. */
+struct __db_repmgr_site {
+        int eid;
+        char *host;
+        u_int port;
+
+#define	DB_REPMGR_CONNECTED	0x01
+#define	DB_REPMGR_DISCONNECTED	0x02
+        u_int32_t status;
+};
 
 /* Replication statistics. */
 struct __db_rep_stat {
@@ -982,6 +1157,15 @@ struct __db_rep_stat {
 					   condition was detected.+ */
 	int st_env_id;			/* Current environment ID. */
 	int st_env_priority;		/* Current environment priority. */
+	u_int32_t st_bulk_fills;	/* Bulk buffer fills. */
+	u_int32_t st_bulk_overflows;	/* Bulk buffer overflows. */
+	u_int32_t st_bulk_records;	/* Bulk records stored. */
+	u_int32_t st_bulk_transfers;	/* Transfers of bulk buffers. */
+	u_int32_t st_client_rerequests;	/* Number of forced rerequests. */
+	u_int32_t st_client_svc_req;	/* Number of client service requests
+					   received by this client. */
+	u_int32_t st_client_svc_miss;	/* Number of client service requests
+					   missing on this client. */
 	u_int32_t st_gen;		/* Current generation number. */
 	u_int32_t st_egen;		/* Current election gen number. */
 	u_int32_t st_log_duplicated;	/* Log records received multiply.+ */
@@ -1024,7 +1208,13 @@ struct __db_rep_stat {
 	int st_election_status;		/* Current election status. */
 	u_int32_t st_election_tiebreaker;/* Election tiebreaker value. */
 	int st_election_votes;		/* Votes received in this round. */
+	u_int32_t st_election_sec;	/* Last election time seconds. */
+	u_int32_t st_election_usec;	/* Last election time useconds. */
 };
+
+/*******************************************************
+ * Sequences.
+ *******************************************************/
 /*
  * The storage record for a sequence.
  */
@@ -1034,6 +1224,7 @@ struct __db_seq_record {
 #define	DB_SEQ_INC		0x00000002	/* Increment sequence. */
 #define	DB_SEQ_RANGE_SET	0x00000004	/* Range set (internal). */
 #define	DB_SEQ_WRAP		0x00000008	/* Wrap sequence at min/max. */
+#define	DB_SEQ_WRAPPED		0x00000010	/* Just wrapped (internal). */
 	u_int32_t	flags;		/* Flags. */
 	db_seq_t	seq_value;	/* Current value. */
 	db_seq_t	seq_max;	/* Max permitted. */
@@ -1045,7 +1236,7 @@ struct __db_seq_record {
  */
 struct __db_sequence {
 	DB		*seq_dbp;	/* DB handle for this sequence. */
-	DB_MUTEX	*seq_mutexp;	/* Mutex if sequence is threaded. */
+	db_mutex_t	mtx_seq;	/* Mutex if sequence is threaded. */
 	DB_SEQ_RECORD	*seq_rp;	/* Pointer to current data. */
 	DB_SEQ_RECORD	seq_record;	/* Data from DB_SEQUENCE. */
 	int32_t		seq_cache_size; /* Number of values cached. */
@@ -1056,6 +1247,7 @@ struct __db_sequence {
 	/* API-private structure: used by C++ and Java. */
 	void		*api_internal;
 
+	/* DB_SEQUENCE PUBLIC HANDLE LIST BEGIN */
 	int		(*close) __P((DB_SEQUENCE *, u_int32_t));
 	int		(*get) __P((DB_SEQUENCE *,
 			      DB_TXN *, int32_t, db_seq_t *, u_int32_t));
@@ -1075,18 +1267,19 @@ struct __db_sequence {
 	int		(*stat) __P((DB_SEQUENCE *,
 			    DB_SEQUENCE_STAT **, u_int32_t));
 	int		(*stat_print) __P((DB_SEQUENCE *, u_int32_t));
+	/* DB_SEQUENCE PUBLIC HANDLE LIST END */
 };
 
 struct __db_seq_stat {
-	u_int32_t st_wait;	  /* Sequence lock granted without wait. */
-	u_int32_t st_nowait;	  /* Sequence lock granted after wait. */
-	db_seq_t  st_current;	  /* Current value in db. */
-	db_seq_t  st_value;	  /* Current cached value. */
-	db_seq_t  st_last_value;  /* Last cached value. */
-	db_seq_t  st_min;	  /* Minimum value. */
-	db_seq_t  st_max;	  /* Maximum value. */
-	int32_t   st_cache_size;  /* Cache size. */
-	u_int32_t st_flags;	  /* Flag value. */
+	u_int32_t st_wait;		/* Sequence lock granted w/o wait. */
+	u_int32_t st_nowait;		/* Sequence lock granted after wait. */
+	db_seq_t  st_current;		/* Current value in db. */
+	db_seq_t  st_value;		/* Current cached value. */
+	db_seq_t  st_last_value;	/* Last cached value. */
+	db_seq_t  st_min;		/* Minimum value. */
+	db_seq_t  st_max;		/* Maximum value. */
+	int32_t   st_cache_size;	/* Cache size. */
+	u_int32_t st_flags;		/* Flag value. */
 };
 
 /*******************************************************
@@ -1114,7 +1307,8 @@ typedef enum {
 #define	DB_QAMOLDVER	3		/* Oldest queue version supported. */
 #define	DB_QAMMAGIC	0x042253
 
-#define	DB_SEQUENCE_VERSION 1		/* Current sequence version. */
+#define	DB_SEQUENCE_VERSION 2		/* Current sequence version. */
+#define	DB_SEQUENCE_OLDVER  1		/* Oldest sequence version supported. */
 
 /*
  * DB access method and cursor operation values.  Each value is an operation
@@ -1123,62 +1317,56 @@ typedef enum {
 #define	DB_AFTER		 1	/* c_put() */
 #define	DB_APPEND		 2	/* put() */
 #define	DB_BEFORE		 3	/* c_put() */
-#define	DB_CACHED_COUNTS	 4	/* stat() */
-#define	DB_CONSUME		 5	/* get() */
-#define	DB_CONSUME_WAIT		 6	/* get() */
-#define	DB_CURRENT		 7	/* c_get(), c_put(), DB_LOGC->get() */
-#define	DB_FAST_STAT		 8	/* stat() */
-#define	DB_FIRST		 9	/* c_get(), DB_LOGC->get() */
-#define	DB_GET_BOTH		10	/* get(), c_get() */
-#define	DB_GET_BOTHC		11	/* c_get() (internal) */
-#define	DB_GET_BOTH_RANGE	12	/* get(), c_get() */
-#define	DB_GET_RECNO		13	/* c_get() */
-#define	DB_JOIN_ITEM		14	/* c_get(); do not do primary lookup */
-#define	DB_KEYFIRST		15	/* c_put() */
-#define	DB_KEYLAST		16	/* c_put() */
-#define	DB_LAST			17	/* c_get(), DB_LOGC->get() */
-#define	DB_NEXT			18	/* c_get(), DB_LOGC->get() */
-#define	DB_NEXT_DUP		19	/* c_get() */
-#define	DB_NEXT_NODUP		20	/* c_get() */
-#define	DB_NODUPDATA		21	/* put(), c_put() */
-#define	DB_NOOVERWRITE		22	/* put() */
-#define	DB_NOSYNC		23	/* close() */
-#define	DB_POSITION		24	/* c_dup() */
-#define	DB_PREV			25	/* c_get(), DB_LOGC->get() */
-#define	DB_PREV_NODUP		26	/* c_get(), DB_LOGC->get() */
-#define	DB_RECORDCOUNT		27	/* stat() */
-#define	DB_SET			28	/* c_get(), DB_LOGC->get() */
-#define	DB_SET_LOCK_TIMEOUT	29	/* set_timout() */
-#define	DB_SET_RANGE		30	/* c_get() */
-#define	DB_SET_RECNO		31	/* get(), c_get() */
-#define	DB_SET_TXN_NOW		32	/* set_timout() (internal) */
-#define	DB_SET_TXN_TIMEOUT	33	/* set_timout() */
-#define	DB_UPDATE_SECONDARY	34	/* c_get(), c_del() (internal) */
-#define	DB_WRITECURSOR		35	/* cursor() */
-#define	DB_WRITELOCK		36	/* cursor() (internal) */
+#define	DB_CONSUME		 4	/* get() */
+#define	DB_CONSUME_WAIT		 5	/* get() */
+#define	DB_CURRENT		 6	/* c_get(), c_put(), DB_LOGC->get() */
+#define	DB_FIRST		 7	/* c_get(), DB_LOGC->get() */
+#define	DB_GET_BOTH		 8	/* get(), c_get() */
+#define	DB_GET_BOTHC		 9	/* c_get() (internal) */
+#define	DB_GET_BOTH_RANGE	10	/* get(), c_get() */
+#define	DB_GET_RECNO		11	/* c_get() */
+#define	DB_JOIN_ITEM		12	/* c_get(); do not do primary lookup */
+#define	DB_KEYFIRST		13	/* c_put() */
+#define	DB_KEYLAST		14	/* c_put() */
+#define	DB_LAST			15	/* c_get(), DB_LOGC->get() */
+#define	DB_NEXT			16	/* c_get(), DB_LOGC->get() */
+#define	DB_NEXT_DUP		17	/* c_get() */
+#define	DB_NEXT_NODUP		18	/* c_get() */
+#define	DB_NODUPDATA		19	/* put(), c_put() */
+#define	DB_NOOVERWRITE		20	/* put() */
+#define	DB_NOSYNC		21	/* close() */
+#define	DB_POSITION		22	/* c_dup() */
+#define	DB_PREV			23	/* c_get(), DB_LOGC->get() */
+#define	DB_PREV_NODUP		24	/* c_get(), DB_LOGC->get() */
+#define	DB_SET			25	/* c_get(), DB_LOGC->get() */
+#define	DB_SET_LOCK_TIMEOUT	26	/* set_timout() */
+#define	DB_SET_RANGE		27	/* c_get() */
+#define	DB_SET_RECNO		28	/* get(), c_get() */
+#define	DB_SET_TXN_NOW		29	/* set_timout() (internal) */
+#define	DB_SET_TXN_TIMEOUT	30	/* set_timout() */
+#define	DB_UPDATE_SECONDARY	31	/* c_get(), c_del() (internal) */
+#define	DB_WRITECURSOR		32	/* cursor() */
+#define	DB_WRITELOCK		33	/* cursor() (internal) */
 
 /* This has to change when the max opcode hits 255. */
 #define	DB_OPFLAGS_MASK	0x000000ff	/* Mask for operations flags. */
 
 /*
  * Masks for flags that can be OR'd into DB access method and cursor
- * operation values.
+ * operation values.  Three top bits have already been taken:
  *
- *	DB_DIRTY_READ	0x04000000	   Dirty Read. */
-#define	DB_MULTIPLE	0x08000000	/* Return multiple data values. */
-#define	DB_MULTIPLE_KEY	0x10000000	/* Return multiple data/key pairs. */
-#define	DB_RMW		0x20000000	/* Acquire write flag immediately. */
+ * DB_AUTO_COMMIT	0x02000000
+ * DB_READ_COMMITTED	0x04000000
+ * DB_READ_UNCOMMITTED	0x08000000
+ */
+#define	DB_MULTIPLE	0x10000000	/* Return multiple data values. */
+#define	DB_MULTIPLE_KEY	0x20000000	/* Return multiple data/key pairs. */
+#define	DB_RMW		0x40000000	/* Acquire write lock immediately. */
 
 /*
  * DB (user visible) error return codes.
  *
  * !!!
- * For source compatibility with DB 2.X deadlock return (EAGAIN), use the
- * following:
- *	#include 
- *	#define DB_LOCK_DEADLOCK EAGAIN
- *
- * !!!
  * We don't want our error returns to conflict with other packages where
  * possible, so pick a base error value that's hopefully not common.  We
  * document that we own the error name space from -30,800 to -30,999.
@@ -1200,22 +1388,24 @@ typedef enum {
 #define	DB_REP_DUPMASTER	(-30986)/* There are two masters. */
 #define	DB_REP_HANDLE_DEAD	(-30985)/* Rolled back a commit. */
 #define	DB_REP_HOLDELECTION	(-30984)/* Time to hold an election. */
-#define	DB_REP_ISPERM		(-30983)/* Cached not written perm written.*/
-#define	DB_REP_NEWMASTER	(-30982)/* We have learned of a new master. */
-#define	DB_REP_NEWSITE		(-30981)/* New site entered system. */
-#define	DB_REP_NOTPERM		(-30980)/* Permanent log record not written. */
-#define	DB_REP_STARTUPDONE	(-30979)/* Client startup complete. */
-#define	DB_REP_UNAVAIL		(-30978)/* Site cannot currently be reached. */
-#define	DB_RUNRECOVERY		(-30977)/* Panic return. */
-#define	DB_SECONDARY_BAD	(-30976)/* Secondary index corrupt. */
-#define	DB_VERIFY_BAD		(-30975)/* Verify failed; bad format. */
-#define	DB_VERSION_MISMATCH	(-30974)/* Environment version mismatch. */
+#define	DB_REP_IGNORE		(-30983)/* This msg should be ignored.*/
+#define	DB_REP_ISPERM		(-30982)/* Cached not written perm written.*/
+#define	DB_REP_JOIN_FAILURE	(-30981)/* Unable to join replication group. */
+#define	DB_REP_LOCKOUT		(-30980)/* API/Replication lockout now. */
+#define	DB_REP_NEWMASTER	(-30979)/* We have learned of a new master. */
+#define	DB_REP_NEWSITE		(-30978)/* New site entered system. */
+#define	DB_REP_NOTPERM		(-30977)/* Permanent log record not written. */
+#define	DB_REP_UNAVAIL		(-30976)/* Site cannot currently be reached. */
+#define	DB_RUNRECOVERY		(-30975)/* Panic return. */
+#define	DB_SECONDARY_BAD	(-30974)/* Secondary index corrupt. */
+#define	DB_VERIFY_BAD		(-30973)/* Verify failed; bad format. */
+#define	DB_VERSION_MISMATCH	(-30972)/* Environment version mismatch. */
 
 /* DB (private) error return codes. */
 #define	DB_ALREADY_ABORTED	(-30899)
 #define	DB_DELETED		(-30898)/* Recovery file marked deleted. */
-#define	DB_LOCK_NOTEXIST	(-30897)/* Object to lock is gone. */
-#define	DB_NEEDSPLIT		(-30896)/* Page needs to be split. */
+#define	DB_NEEDSPLIT		(-30897)/* Page needs to be split. */
+#define	DB_REP_BULKOVF		(-30896)/* Rep bulk buffer overflow. */
 #define	DB_REP_EGENCHG		(-30895)/* Egen changed while in election. */
 #define	DB_REP_LOGREADY		(-30894)/* Rep log ready for recovery. */
 #define	DB_REP_PAGEDONE		(-30893)/* This page was already done. */
@@ -1249,7 +1439,7 @@ struct __db {
 
 	DB_MPOOLFILE *mpf;		/* Backing buffer pool. */
 
-	DB_MUTEX *mutexp;		/* Synchronization for free threading */
+	db_mutex_t mutex;		/* Synchronization for free threading */
 
 	char *fname, *dname;		/* File/database passed to DB->open. */
 	u_int32_t open_flags;		/* Flags passed to DB->open. */
@@ -1265,11 +1455,12 @@ struct __db {
 	u_int32_t lid;			/* Locker id for handle locking. */
 	u_int32_t cur_lid;		/* Current handle lock holder. */
 	u_int32_t associate_lid;	/* Locker id for DB->associate call. */
-	DB_LOCK	handle_lock;		/* Lock held on this handle. */
+	DB_LOCK	 handle_lock;		/* Lock held on this handle. */
 
 	u_int	 cl_id;			/* RPC: remote client id. */
 
 	time_t	 timestamp;		/* Handle timestamp for replication. */
+	u_int32_t fid_gen;		/* Rep generation number for fids. */
 
 	/*
 	 * Returned data memory for DB->get() and friends.
@@ -1299,11 +1490,11 @@ struct __db {
 	 *
 	 * !!!
 	 * Explicit representations of structures from queue.h.
-	 * LIST_ENTRY(__db) dblistlinks;
+	 * TAILQ_ENTRY(__db) dblistlinks;
 	 */
 	struct {
-		struct __db *le_next;
-		struct __db **le_prev;
+		struct __db *tqe_next;
+		struct __db **tqe_prev;
 	} dblistlinks;
 
 	/*
@@ -1365,6 +1556,11 @@ struct __db {
 	/* Reference to primary -- set in the secondary. */
 	DB	*s_primary;
 
+#define	DB_ASSOC_IMMUTABLE_KEY    0x00000001 /* Secondary key is immutable. */
+
+	/* Flags passed to associate -- set in the secondary. */
+	u_int32_t s_assoc_flags;
+
 	/* API-private structure: used by DB 1.85, C++, Java, Perl and Tcl */
 	void	*api_internal;
 
@@ -1374,19 +1570,19 @@ struct __db {
 	void	*q_internal;		/* Queue access method. */
 	void	*xa_internal;		/* XA. */
 
-					/* Methods. */
-	int  (*associate) __P((DB *, DB_TXN *, DB *, int (*)(DB *, const DBT *,
-		const DBT *, DBT *), u_int32_t));
+	/* DB PUBLIC HANDLE LIST BEGIN */
+	int  (*associate) __P((DB *, DB_TXN *, DB *,
+		int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
 	int  (*close) __P((DB *, u_int32_t));
+	int  (*compact) __P((DB *,
+		DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *));
 	int  (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
 	int  (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
-	int  (*dump) __P((DB *,
-		const char *, int (*)(void *, const void *), void *, int, int));
 	void (*err) __P((DB *, int, const char *, ...));
 	void (*errx) __P((DB *, const char *, ...));
 	int  (*fd) __P((DB *, int *));
 	int  (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
+	int  (*get_bt_minkey) __P((DB *, u_int32_t *));
 	int  (*get_byteswapped) __P((DB *, int *));
 	int  (*get_cachesize) __P((DB *, u_int32_t *, u_int32_t *, int *));
 	int  (*get_dbname) __P((DB *, const char **, const char **));
@@ -1395,77 +1591,78 @@ struct __db {
 	void (*get_errfile) __P((DB *, FILE **));
 	void (*get_errpfx) __P((DB *, const char **));
 	int  (*get_flags) __P((DB *, u_int32_t *));
+	int  (*get_h_ffactor) __P((DB *, u_int32_t *));
+	int  (*get_h_nelem) __P((DB *, u_int32_t *));
 	int  (*get_lorder) __P((DB *, int *));
+	DB_MPOOLFILE *(*get_mpf) __P((DB *));
+	void (*get_msgfile) __P((DB *, FILE **));
 	int  (*get_open_flags) __P((DB *, u_int32_t *));
 	int  (*get_pagesize) __P((DB *, u_int32_t *));
+	int  (*get_q_extentsize) __P((DB *, u_int32_t *));
+	int  (*get_re_delim) __P((DB *, int *));
+	int  (*get_re_len) __P((DB *, u_int32_t *));
+	int  (*get_re_pad) __P((DB *, int *));
+	int  (*get_re_source) __P((DB *, const char **));
 	int  (*get_transactional) __P((DB *));
 	int  (*get_type) __P((DB *, DBTYPE *));
 	int  (*join) __P((DB *, DBC **, DBC **, u_int32_t));
-	int  (*key_range) __P((DB *,
-		DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
-	int  (*open) __P((DB *, DB_TXN *,
-		const char *, const char *, DBTYPE, u_int32_t, int));
+	int  (*key_range)
+		__P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
+	int  (*open) __P((DB *,
+		DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int));
+	int  (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
 	int  (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
 	int  (*remove) __P((DB *, const char *, const char *, u_int32_t));
 	int  (*rename) __P((DB *,
-	    const char *, const char *, const char *, u_int32_t));
-	int  (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
-	int  (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
+		const char *, const char *, const char *, u_int32_t));
 	int  (*set_alloc) __P((DB *, void *(*)(size_t),
 		void *(*)(void *, size_t), void (*)(void *)));
+	int  (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
+	int  (*set_bt_compare)
+		__P((DB *, int (*)(DB *, const DBT *, const DBT *)));
+	int  (*set_bt_minkey) __P((DB *, u_int32_t));
+	int  (*set_bt_prefix)
+		__P((DB *, size_t (*)(DB *, const DBT *, const DBT *)));
 	int  (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int));
-	int  (*set_dup_compare) __P((DB *,
-	    int (*)(DB *, const DBT *, const DBT *)));
+	int  (*set_dup_compare)
+		__P((DB *, int (*)(DB *, const DBT *, const DBT *)));
 	int  (*set_encrypt) __P((DB *, const char *, u_int32_t));
 	void (*set_errcall) __P((DB *,
-	    void (*)(const DB_ENV *, const char *, const char *)));
+		void (*)(const DB_ENV *, const char *, const char *)));
 	void (*set_errfile) __P((DB *, FILE *));
 	void (*set_errpfx) __P((DB *, const char *));
 	int  (*set_feedback) __P((DB *, void (*)(DB *, int, int)));
 	int  (*set_flags) __P((DB *, u_int32_t));
+	int  (*set_h_ffactor) __P((DB *, u_int32_t));
+	int  (*set_h_hash)
+		__P((DB *, u_int32_t (*)(DB *, const void *, u_int32_t)));
+	int  (*set_h_nelem) __P((DB *, u_int32_t));
 	int  (*set_lorder) __P((DB *, int));
 	void (*set_msgcall) __P((DB *, void (*)(const DB_ENV *, const char *)));
-	void (*get_msgfile) __P((DB *, FILE **));
 	void (*set_msgfile) __P((DB *, FILE *));
 	int  (*set_pagesize) __P((DB *, u_int32_t));
 	int  (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int)));
-	int  (*stat) __P((DB *, DB_TXN *, void *, u_int32_t));
-	int  (*stat_print) __P((DB *, u_int32_t));
-	int  (*sync) __P((DB *, u_int32_t));
-	int  (*upgrade) __P((DB *, const char *, u_int32_t));
-	int  (*verify) __P((DB *,
-	    const char *, const char *, FILE *, u_int32_t));
-
-	int  (*get_bt_minkey) __P((DB *, u_int32_t *));
-	int  (*set_bt_compare) __P((DB *,
-	    int (*)(DB *, const DBT *, const DBT *)));
-	int  (*set_bt_maxkey) __P((DB *, u_int32_t));
-	int  (*set_bt_minkey) __P((DB *, u_int32_t));
-	int  (*set_bt_prefix) __P((DB *,
-	    size_t (*)(DB *, const DBT *, const DBT *)));
-
-	int  (*get_h_ffactor) __P((DB *, u_int32_t *));
-	int  (*get_h_nelem) __P((DB *, u_int32_t *));
-	int  (*set_h_ffactor) __P((DB *, u_int32_t));
-	int  (*set_h_hash) __P((DB *,
-	    u_int32_t (*)(DB *, const void *, u_int32_t)));
-	int  (*set_h_nelem) __P((DB *, u_int32_t));
-
-	int  (*get_re_delim) __P((DB *, int *));
-	int  (*get_re_len) __P((DB *, u_int32_t *));
-	int  (*get_re_pad) __P((DB *, int *));
-	int  (*get_re_source) __P((DB *, const char **));
+	int  (*set_q_extentsize) __P((DB *, u_int32_t));
 	int  (*set_re_delim) __P((DB *, int));
 	int  (*set_re_len) __P((DB *, u_int32_t));
 	int  (*set_re_pad) __P((DB *, int));
 	int  (*set_re_source) __P((DB *, const char *));
+	int  (*stat) __P((DB *, DB_TXN *, void *, u_int32_t));
+	int  (*stat_print) __P((DB *, u_int32_t));
+	int  (*sync) __P((DB *, u_int32_t));
+	int  (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
+	int  (*upgrade) __P((DB *, const char *, u_int32_t));
+	int  (*verify)
+		__P((DB *, const char *, const char *, FILE *, u_int32_t));
+	/* DB PUBLIC HANDLE LIST END */
 
-	int  (*get_q_extentsize) __P((DB *, u_int32_t *));
-	int  (*set_q_extentsize) __P((DB *, u_int32_t));
-
+	/* DB PRIVATE HANDLE LIST BEGIN */
+	int  (*dump) __P((DB *, const char *,
+		int (*)(void *, const void *), void *, int, int));
 	int  (*db_am_remove) __P((DB *, DB_TXN *, const char *, const char *));
 	int  (*db_am_rename) __P((DB *, DB_TXN *,
 	    const char *, const char *, const char *));
+	/* DB PRIVATE HANDLE LIST END */
 
 	/*
 	 * Never called; these are a place to save function pointers
@@ -1480,39 +1677,45 @@ struct __db {
 #define	DB_OK_RECNO	0x08
 	u_int32_t	am_ok;		/* Legal AM choices. */
 
-#define	DB_AM_CHKSUM		0x00000001 /* Checksumming. */
-#define	DB_AM_CL_WRITER		0x00000002 /* Allow writes in client replica. */
-#define	DB_AM_COMPENSATE	0x00000004 /* Created by compensating txn. */
-#define	DB_AM_CREATED		0x00000008 /* Database was created upon open. */
-#define	DB_AM_CREATED_MSTR	0x00000010 /* Encompassing file was created. */
-#define	DB_AM_DBM_ERROR		0x00000020 /* Error in DBM/NDBM database. */
-#define	DB_AM_DELIMITER		0x00000040 /* Variable length delimiter set. */
-#define	DB_AM_DIRTY		0x00000080 /* Support Dirty Reads. */
-#define	DB_AM_DISCARD		0x00000100 /* Discard any cached pages. */
-#define	DB_AM_DUP		0x00000200 /* DB_DUP. */
-#define	DB_AM_DUPSORT		0x00000400 /* DB_DUPSORT. */
-#define	DB_AM_ENCRYPT		0x00000800 /* Encryption. */
-#define	DB_AM_FIXEDLEN		0x00001000 /* Fixed-length records. */
-#define	DB_AM_INMEM		0x00002000 /* In-memory; no sync on close. */
-#define	DB_AM_INORDER		0x00004000 /* DB_INORDER. */
-#define	DB_AM_IN_RENAME		0x00008000 /* File is being renamed. */
-#define	DB_AM_NOT_DURABLE	0x00010000 /* Do not log changes. */
-#define	DB_AM_OPEN_CALLED	0x00020000 /* DB->open called. */
-#define	DB_AM_PAD		0x00040000 /* Fixed-length record pad. */
-#define	DB_AM_PGDEF		0x00080000 /* Page size was defaulted. */
-#define	DB_AM_RDONLY		0x00100000 /* Database is readonly. */
-#define	DB_AM_RECNUM		0x00200000 /* DB_RECNUM. */
-#define	DB_AM_RECOVER		0x00400000 /* DB opened by recovery routine. */
-#define	DB_AM_RENUMBER		0x00800000 /* DB_RENUMBER. */
-#define	DB_AM_REPLICATION	0x01000000 /* An internal replication file. */
-#define	DB_AM_REVSPLITOFF	0x02000000 /* DB_REVSPLITOFF. */
-#define	DB_AM_SECONDARY		0x04000000 /* Database is a secondary index. */
-#define	DB_AM_SNAPSHOT		0x08000000 /* DB_SNAPSHOT. */
-#define	DB_AM_SUBDB		0x10000000 /* Subdatabases supported. */
-#define	DB_AM_SWAP		0x20000000 /* Pages need to be byte-swapped. */
-#define	DB_AM_TXN		0x40000000 /* Opened in a transaction. */
-#define	DB_AM_VERIFYING		0x80000000 /* DB handle is in the verifier. */
-	u_int32_t orig_flags;		   /* Flags at  open, for refresh. */
+	/*
+	 * This field really ought to be an AM_FLAG, but we have
+	 * have run out of bits.  If/when we decide to split up
+	 * the flags, we can incorporate it.
+	 */
+	int	 preserve_fid;		/* Do not free fileid on close. */
+
+#define	DB_AM_CHKSUM		0x00000001 /* Checksumming */
+#define	DB_AM_CL_WRITER		0x00000002 /* Allow writes in client replica */
+#define	DB_AM_COMPENSATE	0x00000004 /* Created by compensating txn */
+#define	DB_AM_CREATED		0x00000008 /* Database was created upon open */
+#define	DB_AM_CREATED_MSTR	0x00000010 /* Encompassing file was created */
+#define	DB_AM_DBM_ERROR		0x00000020 /* Error in DBM/NDBM database */
+#define	DB_AM_DELIMITER		0x00000040 /* Variable length delimiter set */
+#define	DB_AM_DISCARD		0x00000080 /* Discard any cached pages */
+#define	DB_AM_DUP		0x00000100 /* DB_DUP */
+#define	DB_AM_DUPSORT		0x00000200 /* DB_DUPSORT */
+#define	DB_AM_ENCRYPT		0x00000400 /* Encryption */
+#define	DB_AM_FIXEDLEN		0x00000800 /* Fixed-length records */
+#define	DB_AM_INMEM		0x00001000 /* In-memory; no sync on close */
+#define	DB_AM_INORDER		0x00002000 /* DB_INORDER */
+#define	DB_AM_IN_RENAME		0x00004000 /* File is being renamed */
+#define	DB_AM_NOT_DURABLE	0x00008000 /* Do not log changes */
+#define	DB_AM_OPEN_CALLED	0x00010000 /* DB->open called */
+#define	DB_AM_PAD		0x00020000 /* Fixed-length record pad */
+#define	DB_AM_PGDEF		0x00040000 /* Page size was defaulted */
+#define	DB_AM_RDONLY		0x00080000 /* Database is readonly */
+#define	DB_AM_READ_UNCOMMITTED	0x00100000 /* Support degree 1 isolation */
+#define	DB_AM_RECNUM		0x00200000 /* DB_RECNUM */
+#define	DB_AM_RECOVER		0x00400000 /* DB opened by recovery routine */
+#define	DB_AM_RENUMBER		0x00800000 /* DB_RENUMBER */
+#define	DB_AM_REVSPLITOFF	0x01000000 /* DB_REVSPLITOFF */
+#define	DB_AM_SECONDARY		0x02000000 /* Database is a secondary index */
+#define	DB_AM_SNAPSHOT		0x04000000 /* DB_SNAPSHOT */
+#define	DB_AM_SUBDB		0x08000000 /* Subdatabases supported */
+#define	DB_AM_SWAP		0x10000000 /* Pages need to be byte-swapped */
+#define	DB_AM_TXN		0x20000000 /* Opened in a transaction */
+#define	DB_AM_VERIFYING		0x40000000 /* DB handle is in the verifier */
+	u_int32_t orig_flags;		   /* Flags at  open, for refresh */
 	u_int32_t flags;
 };
 
@@ -1614,7 +1817,7 @@ struct __dbc {
 	DBT	  my_rkey;		/* Space for returned [primary] key. */
 	DBT	  my_rdata;		/* Space for returned data. */
 
-	u_int32_t lid;			/* Default process' locker id. */
+	void	 *lref;			/* Reference to default locker. */
 	u_int32_t locker;		/* Locker for this operation. */
 	DBT	  lock_dbt;		/* DBT referencing lock. */
 	DB_LOCK_ILOCK lock;		/* Object to be locked. */
@@ -1626,15 +1829,17 @@ struct __dbc {
 
 	DBC_INTERNAL *internal;		/* Access method private. */
 
-	int (*c_close) __P((DBC *));	/* Methods: public. */
+	/* DBC PUBLIC HANDLE LIST BEGIN */
+	int (*c_close) __P((DBC *));
 	int (*c_count) __P((DBC *, db_recno_t *, u_int32_t));
 	int (*c_del) __P((DBC *, u_int32_t));
 	int (*c_dup) __P((DBC *, DBC **, u_int32_t));
 	int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t));
 	int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
 	int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t));
+	/* DBC PUBLIC HANDLE LIST END */
 
-					/* Methods: private. */
+	/* DBC PRIVATE HANDLE LIST BEGIN */
 	int (*c_am_bulk) __P((DBC *, DBT *, u_int32_t));
 	int (*c_am_close) __P((DBC *, db_pgno_t, int *));
 	int (*c_am_del) __P((DBC *));
@@ -1642,20 +1847,29 @@ struct __dbc {
 	int (*c_am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
 	int (*c_am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
 	int (*c_am_writelock) __P((DBC *));
+	/* DBC PRIVATE HANDLE LIST END */
 
-#define	DBC_ACTIVE	 0x0001		/* Cursor in use. */
-#define	DBC_COMPENSATE	 0x0002		/* Cursor compensating, don't lock. */
-#define	DBC_DEGREE_2	 0x0004		/* Cursor has degree 2 isolation. */
-#define	DBC_DIRTY_READ	 0x0008		/* Cursor supports dirty reads. */
-#define	DBC_OPD		 0x0010		/* Cursor references off-page dups. */
-#define	DBC_RECOVER	 0x0020		/* Recovery cursor; don't log/lock. */
-#define	DBC_RMW		 0x0040		/* Acquire write flag in read op. */
-#define	DBC_TRANSIENT	 0x0080		/* Cursor is transient. */
-#define	DBC_WRITECURSOR	 0x0100		/* Cursor may be used to write (CDB). */
-#define	DBC_WRITER	 0x0200		/* Cursor immediately writing (CDB). */
-#define	DBC_MULTIPLE	 0x0400		/* Return Multiple data. */
-#define	DBC_MULTIPLE_KEY 0x0800		/* Return Multiple keys and data. */
-#define	DBC_OWN_LID	 0x1000		/* Free lock id on destroy. */
+/*
+ * DBC_DONTLOCK and DBC_RECOVER are used during recovery and transaction
+ * abort.  If a transaction is being aborted or recovered then DBC_RECOVER
+ * will be set and locking and logging will be disabled on this cursor.  If
+ * we are performing a compensating transaction (e.g. free page processing)
+ * then DB_DONTLOCK will be set to inhibit locking, but logging will still
+ * be required. DB_DONTLOCK is also used if the whole database is locked.
+ */
+#define	DBC_ACTIVE		0x0001	/* Cursor in use. */
+#define	DBC_DONTLOCK		0x0002	/* Don't lock on this cursor. */
+#define	DBC_MULTIPLE		0x0004	/* Return Multiple data. */
+#define	DBC_MULTIPLE_KEY	0x0008	/* Return Multiple keys and data. */
+#define	DBC_OPD			0x0010	/* Cursor references off-page dups. */
+#define	DBC_OWN_LID		0x0020	/* Free lock id on destroy. */
+#define	DBC_READ_COMMITTED	0x0040	/* Cursor has degree 2 isolation. */
+#define	DBC_READ_UNCOMMITTED	0x0080	/* Cursor has degree 1 isolation. */
+#define	DBC_RECOVER		0x0100	/* Recovery cursor; don't log/lock. */
+#define	DBC_RMW			0x0200	/* Acquire write flag in read op. */
+#define	DBC_TRANSIENT		0x0400	/* Cursor is transient. */
+#define	DBC_WRITECURSOR		0x0800	/* Cursor may be used to write (CDB). */
+#define	DBC_WRITER		0x1000	/* Cursor immediately writing (CDB). */
 	u_int32_t flags;
 };
 
@@ -1674,7 +1888,6 @@ struct __db_bt_stat {
 	u_int32_t bt_nkeys;		/* Number of unique keys. */
 	u_int32_t bt_ndata;		/* Number of data items. */
 	u_int32_t bt_pagesize;		/* Page size. */
-	u_int32_t bt_maxkey;		/* Maxkey value. */
 	u_int32_t bt_minkey;		/* Minkey value. */
 	u_int32_t bt_re_len;		/* Fixed-length record length. */
 	u_int32_t bt_re_pad;		/* Fixed-length record pad. */
@@ -1691,6 +1904,21 @@ struct __db_bt_stat {
 	u_int32_t bt_over_pgfree;	/* Bytes free in overflow pages. */
 };
 
+struct __db_compact {
+	/* Input Parameters. */
+	u_int32_t	compact_fillpercent;	/* Desired fillfactor: 1-100 */
+	db_timeout_t	compact_timeout;	/* Lock timeout. */
+	u_int32_t	compact_pages;		/* Max pages to process. */
+	/* Output Stats. */
+	u_int32_t	compact_pages_free;	/* Number of pages freed. */
+	u_int32_t	compact_pages_examine;	/* Number of pages examine. */
+	u_int32_t	compact_levels;		/* Number of levels removed. */
+	u_int32_t	compact_deadlock;	/* Number of deadlocks. */
+	db_pgno_t	compact_pages_truncated; /* Pages truncated to OS. */
+	/* Internal. */
+	db_pgno_t	compact_truncate;	/* Page number for truncation */
+};
+
 /* Hash statistics structure. */
 struct __db_h_stat {
 	u_int32_t hash_magic;		/* Magic number. */
@@ -1750,12 +1978,19 @@ struct __db_env {
 					/* Other Callbacks. */
 	void (*db_feedback) __P((DB_ENV *, int, int));
 	void (*db_paniccall) __P((DB_ENV *, int));
+	void (*db_event_func) __P((DB_ENV *, u_int32_t, void *));
 
 					/* App-specified alloc functions. */
 	void *(*db_malloc) __P((size_t));
 	void *(*db_realloc) __P((void *, size_t));
 	void (*db_free) __P((void *));
 
+	/* Application callback to copy data to/from a custom data source. */
+#define	DB_USERCOPY_GETDATA	0x0001
+#define	DB_USERCOPY_SETDATA	0x0002
+	int (*dbt_usercopy)
+	    __P((DBT *, u_int32_t, void *, u_int32_t, u_int32_t));
+
 	/*
 	 * Currently, the verbose list is a bit field with room for 32
 	 * entries.  There's no reason that it needs to be limited, if
@@ -1763,8 +1998,9 @@ struct __db_env {
 	 */
 #define	DB_VERB_DEADLOCK	0x0001	/* Deadlock detection information. */
 #define	DB_VERB_RECOVERY	0x0002	/* Recovery information. */
-#define	DB_VERB_REPLICATION	0x0004	/* Replication information. */
-#define	DB_VERB_WAITSFOR	0x0008	/* Dump waits-for table. */
+#define	DB_VERB_REGISTER	0x0004	/* Dump waits-for table. */
+#define	DB_VERB_REPLICATION	0x0008	/* Replication information. */
+#define	DB_VERB_WAITSFOR	0x0010	/* Dump waits-for table. */
 	u_int32_t	 verbose;	/* Verbose output. */
 
 	void		*app_private;	/* Application-private handle. */
@@ -1772,6 +2008,19 @@ struct __db_env {
 	int (*app_dispatch)		/* User-specified recovery dispatch. */
 	    __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
 
+	/* Mutexes. */
+	u_int32_t	mutex_align;	/* Mutex alignment */
+	u_int32_t	mutex_cnt;	/* Number of mutexes to configure */
+	u_int32_t	mutex_inc;	/* Number of mutexes to add */
+	u_int32_t	mutex_tas_spins;/* Test-and-set spin count */
+
+	struct {
+		int	  alloc_id;	/* Allocation ID argument */
+		u_int32_t flags;	/* Flags argument */
+	} *mutex_iq;			/* Initial mutexes queue */
+	u_int		mutex_iq_next;	/* Count of initial mutexes */
+	u_int		mutex_iq_max;	/* Maximum initial mutexes */
+
 	/* Locking. */
 	u_int8_t	*lk_conflicts;	/* Two dimensional conflict matrix. */
 	int		 lk_modes;	/* Number of lock modes in table. */
@@ -1785,6 +2034,7 @@ struct __db_env {
 	u_int32_t	 lg_bsize;	/* Buffer size. */
 	u_int32_t	 lg_size;	/* Log file size. */
 	u_int32_t	 lg_regionmax;	/* Region size. */
+	int		 lg_filemode;	/* Log file permission mode. */
 
 	/* Memory pool. */
 	u_int32_t	 mp_gbytes;	/* Cachesize: GB. */
@@ -1796,20 +2046,21 @@ struct __db_env {
 	int				/* Sleep after writing max buffers. */
 			 mp_maxwrite_sleep;
 
-	/* Replication */
-	int		 rep_eid;	/* environment id. */
-	int		(*rep_send)	/* Send function. */
-			    __P((DB_ENV *, const DBT *, const DBT *,
-			    const DB_LSN *, int, u_int32_t));
-
 	/* Transactions. */
 	u_int32_t	 tx_max;	/* Maximum number of transactions. */
 	time_t		 tx_timestamp;	/* Recover to specific timestamp. */
 	db_timeout_t	 tx_timeout;	/* Timeout for transactions. */
 
+	/* Thread tracking. */
+	u_int32_t	thr_nbucket;	/* Number of hash buckets. */
+	u_int32_t	thr_max;	/* Max before garbage collection. */
+	void		*thr_hashtab;	/* Hash table of DB_THREAD_INFO. */
+
 	/*******************************************************
 	 * Private: owned by DB.
 	 *******************************************************/
+	pid_t		pid_cache;	/* Cached process ID. */
+
 					/* User files, paths. */
 	char		*db_home;	/* Database home. */
 	char		*db_log_dir;	/* Database log file directory. */
@@ -1821,12 +2072,28 @@ struct __db_env {
 
 	int		 db_mode;	/* Default open permissions. */
 	int		 dir_mode;	/* Intermediate directory perms. */
-	u_int32_t	 env_lid;	/* Locker ID in non-threaded handles. */
+	void		*env_lref;	/* Locker in non-threaded handles. */
 	u_int32_t	 open_flags;	/* Flags passed to DB_ENV->open. */
 
 	void		*reginfo;	/* REGINFO structure reference. */
 	DB_FH		*lockfhp;	/* fcntl(2) locking file handle. */
 
+	DB_FH		*registry;	/* DB_REGISTER file handle. */
+	u_int32_t	registry_off;	/*
+					 * Offset of our slot.  We can't use
+					 * off_t because its size depends on
+					 * build settings.
+					 */
+
+					/* Return IDs. */
+	void	       (*thread_id) __P((DB_ENV *, pid_t *, db_threadid_t *));
+					/* Return if IDs alive. */
+	int	       (*is_alive)
+			__P((DB_ENV *, pid_t, db_threadid_t, u_int32_t));
+					/* Format IDs into a string. */
+	char	       *(*thread_id_string)
+			__P((DB_ENV *, pid_t, db_threadid_t, char *));
+
 	int	      (**recover_dtab)	/* Dispatch table for recover funcs. */
 			    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 	size_t		 recover_dtab_size;
@@ -1838,7 +2105,6 @@ struct __db_env {
 	int		 db_ref;	/* DB reference count. */
 
 	long		 shm_key;	/* shmget(2) key. */
-	u_int32_t	 tas_spins;	/* test-and-set spins. */
 
 	/*
 	 * List of open DB handles for this DB_ENV, used for cursor
@@ -1851,11 +2117,12 @@ struct __db_env {
 	 *
 	 * !!!
 	 * Explicit representation of structure in queue.h.
-	 * LIST_HEAD(dblist, __db);
+	 * TAILQ_HEAD(__dblist, __db);
 	 */
-	DB_MUTEX	*dblist_mutexp;	/* Mutex. */
-	struct {
-		struct __db *lh_first;
+	db_mutex_t mtx_dblist;		/* Mutex. */
+	struct __dblist {
+		struct __db *tqh_first;
+		struct __db **tqh_last;
 	} dblist;
 
 	/*
@@ -1876,161 +2143,200 @@ struct __db_env {
 	} xa_txn;
 	int		 xa_rmid;	/* XA Resource Manager ID. */
 
-	/* API-private structure. */
-	void		*api1_internal;	/* C++, Perl API private */
-	void		*api2_internal;	/* Java API private */
-
 	char		*passwd;	/* Cryptography support. */
 	size_t		 passwd_len;
 	void		*crypto_handle;	/* Primary handle. */
-	DB_MUTEX	*mt_mutexp;	/* Mersenne Twister mutex. */
+	db_mutex_t	 mtx_mt;	/* Mersenne Twister mutex. */
 	int		 mti;		/* Mersenne Twister index. */
 	u_long		*mt;		/* Mersenne Twister state vector. */
 
-					/* DB_ENV Methods. */
+	/* API-private structure. */
+	void		*api1_internal;	/* C++, Perl API private */
+	void		*api2_internal;	/* Java API private */
+
+	DB_LOCKTAB	*lk_handle;	/* Lock handle. */
+	DB_LOG		*lg_handle;	/* Log handle. */
+	DB_MPOOL	*mp_handle;	/* Mpool handle. */
+	DB_MUTEXMGR	*mutex_handle;	/* Mutex handle. */
+	DB_REP		*rep_handle;	/* Replication handle. */
+	DB_TXNMGR	*tx_handle;	/* Txn handle. */
+
+	/* DB_ENV PUBLIC HANDLE LIST BEGIN */
+	int  (*cdsgroup_begin) __P((DB_ENV *, DB_TXN **));
 	int  (*close) __P((DB_ENV *, u_int32_t));
 	int  (*dbremove) __P((DB_ENV *,
 		DB_TXN *, const char *, const char *, u_int32_t));
-	int  (*dbrename) __P((DB_ENV *, DB_TXN *,
-		const char *, const char *, const char *, u_int32_t));
+	int  (*dbrename) __P((DB_ENV *,
+		DB_TXN *, const char *, const char *, const char *, u_int32_t));
 	void (*err) __P((const DB_ENV *, int, const char *, ...));
 	void (*errx) __P((const DB_ENV *, const char *, ...));
-	int  (*open) __P((DB_ENV *, const char *, u_int32_t, int));
-	int  (*remove) __P((DB_ENV *, const char *, u_int32_t));
-	int  (*stat_print) __P((DB_ENV *, u_int32_t));
-
-					/* House-keeping. */
-	int  (*fileid_reset) __P((DB_ENV *, char *, int));
-	int  (*is_bigendian) __P((void));
-	int  (*lsn_reset) __P((DB_ENV *, char *, int));
-	int  (*prdbt) __P((DBT *,
-		int, const char *, void *, int (*)(void *, const void *), int));
-
-					/* Setters/getters. */
-	int  (*set_alloc) __P((DB_ENV *, void *(*)(size_t),
-		void *(*)(void *, size_t), void (*)(void *)));
-	int  (*set_app_dispatch) __P((DB_ENV *,
-		int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
+	int  (*failchk) __P((DB_ENV *, u_int32_t));
+	int  (*fileid_reset) __P((DB_ENV *, const char *, u_int32_t));
+	int  (*get_cachesize) __P((DB_ENV *, u_int32_t *, u_int32_t *, int *));
 	int  (*get_data_dirs) __P((DB_ENV *, const char ***));
-	int  (*set_data_dir) __P((DB_ENV *, const char *));
 	int  (*get_encrypt_flags) __P((DB_ENV *, u_int32_t *));
-	int  (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t));
-	void (*set_errcall) __P((DB_ENV *,
-	    void (*)(const DB_ENV *, const char *, const char *)));
 	void (*get_errfile) __P((DB_ENV *, FILE **));
-	void (*set_errfile) __P((DB_ENV *, FILE *));
 	void (*get_errpfx) __P((DB_ENV *, const char **));
-	void (*set_errpfx) __P((DB_ENV *, const char *));
-	int  (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
 	int  (*get_flags) __P((DB_ENV *, u_int32_t *));
-	int  (*set_flags) __P((DB_ENV *, u_int32_t, int));
 	int  (*get_home) __P((DB_ENV *, const char **));
-	int  (*set_intermediate_dir) __P((DB_ENV *, int, u_int32_t));
-	int  (*get_open_flags) __P((DB_ENV *, u_int32_t *));
-	int  (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int)));
-	int  (*set_rpc_server) __P((DB_ENV *,
-		void *, const char *, long, long, u_int32_t));
-	int  (*get_shm_key) __P((DB_ENV *, long *));
-	int  (*set_shm_key) __P((DB_ENV *, long));
-	void (*set_msgcall) __P((DB_ENV *,
-		void (*)(const DB_ENV *, const char *)));
-	void (*get_msgfile) __P((DB_ENV *, FILE **));
-	void (*set_msgfile) __P((DB_ENV *, FILE *));
-	int  (*get_tas_spins) __P((DB_ENV *, u_int32_t *));
-	int  (*set_tas_spins) __P((DB_ENV *, u_int32_t));
-	int  (*get_tmp_dir) __P((DB_ENV *, const char **));
-	int  (*set_tmp_dir) __P((DB_ENV *, const char *));
-	int  (*get_verbose) __P((DB_ENV *, u_int32_t, int *));
-	int  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
-
-	void *lg_handle;		/* Log handle and methods. */
 	int  (*get_lg_bsize) __P((DB_ENV *, u_int32_t *));
-	int  (*set_lg_bsize) __P((DB_ENV *, u_int32_t));
 	int  (*get_lg_dir) __P((DB_ENV *, const char **));
-	int  (*set_lg_dir) __P((DB_ENV *, const char *));
+	int  (*get_lg_filemode) __P((DB_ENV *, int *));
 	int  (*get_lg_max) __P((DB_ENV *, u_int32_t *));
-	int  (*set_lg_max) __P((DB_ENV *, u_int32_t));
 	int  (*get_lg_regionmax) __P((DB_ENV *, u_int32_t *));
-	int  (*set_lg_regionmax) __P((DB_ENV *, u_int32_t));
-	int  (*log_archive) __P((DB_ENV *, char **[], u_int32_t));
-	int  (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t));
-	int  (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t));
-	int  (*log_flush) __P((DB_ENV *, const DB_LSN *));
-	int  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
-	int  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
-	int  (*log_stat_print) __P((DB_ENV *, u_int32_t));
-
-	void *lk_handle;		/* Lock handle and methods. */
 	int  (*get_lk_conflicts) __P((DB_ENV *, const u_int8_t **, int *));
-	int  (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int));
 	int  (*get_lk_detect) __P((DB_ENV *, u_int32_t *));
-	int  (*set_lk_detect) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max) __P((DB_ENV *, u_int32_t));
-	int  (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *));
-	int  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
 	int  (*get_lk_max_lockers) __P((DB_ENV *, u_int32_t *));
-	int  (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t));
+	int  (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *));
 	int  (*get_lk_max_objects) __P((DB_ENV *, u_int32_t *));
-	int  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
+	int  (*get_mp_max_openfd) __P((DB_ENV *, int *));
+	int  (*get_mp_max_write) __P((DB_ENV *, int *, int *));
+	int  (*get_mp_mmapsize) __P((DB_ENV *, size_t *));
+	void (*get_msgfile) __P((DB_ENV *, FILE **));
+	int  (*get_open_flags) __P((DB_ENV *, u_int32_t *));
+	int  (*get_shm_key) __P((DB_ENV *, long *));
+	int  (*get_timeout) __P((DB_ENV *, db_timeout_t *, u_int32_t));
+	int  (*get_tmp_dir) __P((DB_ENV *, const char **));
+	int  (*get_tx_max) __P((DB_ENV *, u_int32_t *));
+	int  (*get_tx_timestamp) __P((DB_ENV *, time_t *));
+	int  (*get_verbose) __P((DB_ENV *, u_int32_t, int *));
+	int  (*is_bigendian) __P((void));
 	int  (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, int *));
 	int  (*lock_get) __P((DB_ENV *,
 		u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
-	int  (*lock_put) __P((DB_ENV *, DB_LOCK *));
 	int  (*lock_id) __P((DB_ENV *, u_int32_t *));
 	int  (*lock_id_free) __P((DB_ENV *, u_int32_t));
+	int  (*lock_put) __P((DB_ENV *, DB_LOCK *));
 	int  (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
 	int  (*lock_stat_print) __P((DB_ENV *, u_int32_t));
 	int  (*lock_vec) __P((DB_ENV *,
 		u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
-
-	void *mp_handle;		/* Mpool handle and methods. */
-	int  (*get_cachesize) __P((DB_ENV *, u_int32_t *, u_int32_t *, int *));
-	int  (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int));
-	int  (*get_mp_mmapsize) __P((DB_ENV *, size_t *));
-	int  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
-	int  (*get_mp_max_openfd) __P((DB_ENV *, int *));
-	int  (*set_mp_max_openfd) __P((DB_ENV *, int));
-	int  (*get_mp_max_write) __P((DB_ENV *, int *, int *));
-	int  (*set_mp_max_write) __P((DB_ENV *, int, int));
+	int  (*log_archive) __P((DB_ENV *, char **[], u_int32_t));
+	int  (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t));
+	int  (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t));
+	int  (*log_flush) __P((DB_ENV *, const DB_LSN *));
+	int  (*log_printf) __P((DB_ENV *, DB_TXN *, const char *, ...));
+	int  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
+	int  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
+	int  (*log_stat_print) __P((DB_ENV *, u_int32_t));
+	int  (*lsn_reset) __P((DB_ENV *, const char *, u_int32_t));
 	int  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
-	int  (*memp_register) __P((DB_ENV *, int,
-		int (*)(DB_ENV *, db_pgno_t, void *, DBT *),
-		int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
+	int  (*memp_register) __P((DB_ENV *, int, int (*)(DB_ENV *,
+		db_pgno_t, void *, DBT *), int (*)(DB_ENV *,
+		db_pgno_t, void *, DBT *)));
 	int  (*memp_stat) __P((DB_ENV *,
 		DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
 	int  (*memp_stat_print) __P((DB_ENV *, u_int32_t));
 	int  (*memp_sync) __P((DB_ENV *, DB_LSN *));
 	int  (*memp_trickle) __P((DB_ENV *, int, int *));
-
-	void *rep_handle;		/* Replication handle and methods. */
-	int  (*rep_elect) __P((DB_ENV *, int, int, int,
-		u_int32_t, int *, u_int32_t));
+	int  (*mutex_alloc) __P((DB_ENV *, u_int32_t, db_mutex_t *));
+	int  (*mutex_free) __P((DB_ENV *, db_mutex_t));
+	int  (*mutex_get_align) __P((DB_ENV *, u_int32_t *));
+	int  (*mutex_get_increment) __P((DB_ENV *, u_int32_t *));
+	int  (*mutex_get_max) __P((DB_ENV *, u_int32_t *));
+	int  (*mutex_get_tas_spins) __P((DB_ENV *, u_int32_t *));
+	int  (*mutex_lock) __P((DB_ENV *, db_mutex_t));
+	int  (*mutex_set_align) __P((DB_ENV *, u_int32_t));
+	int  (*mutex_set_increment) __P((DB_ENV *, u_int32_t));
+	int  (*mutex_set_max) __P((DB_ENV *, u_int32_t));
+	int  (*mutex_set_tas_spins) __P((DB_ENV *, u_int32_t));
+	int  (*mutex_stat) __P((DB_ENV *, DB_MUTEX_STAT **, u_int32_t));
+	int  (*mutex_stat_print) __P((DB_ENV *, u_int32_t));
+	int  (*mutex_unlock) __P((DB_ENV *, db_mutex_t));
+	int  (*open) __P((DB_ENV *, const char *, u_int32_t, int));
+	int  (*remove) __P((DB_ENV *, const char *, u_int32_t));
+	int  (*rep_elect)
+		__P((DB_ENV *, int, int, int *, u_int32_t));
 	int  (*rep_flush) __P((DB_ENV *));
-	int  (*rep_process_message) __P((DB_ENV *, DBT *, DBT *,
-	    int *, DB_LSN *));
+	int  (*rep_get_config) __P((DB_ENV *, u_int32_t, int *));
+	int  (*rep_get_limit) __P((DB_ENV *, u_int32_t *, u_int32_t *));
+	int  (*rep_get_nsites) __P((DB_ENV *, int *));
+	int  (*rep_get_priority) __P((DB_ENV *, int *));
+	int  (*rep_get_timeout) __P((DB_ENV *, int, u_int32_t *));
+	int  (*rep_process_message)
+		__P((DB_ENV *, DBT *, DBT *, int *, DB_LSN *));
+	int  (*rep_set_config) __P((DB_ENV *, u_int32_t, int));
+	int  (*rep_set_limit) __P((DB_ENV *, u_int32_t, u_int32_t));
+	int  (*rep_set_nsites) __P((DB_ENV *, int));
+	int  (*rep_set_priority) __P((DB_ENV *, int));
+	int  (*rep_set_timeout) __P((DB_ENV *, int, db_timeout_t));
+	int  (*rep_set_transport) __P((DB_ENV *, int, int (*)(DB_ENV *,
+		const DBT *, const DBT *, const DB_LSN *, int, u_int32_t)));
 	int  (*rep_start) __P((DB_ENV *, DBT *, u_int32_t));
 	int  (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
 	int  (*rep_stat_print) __P((DB_ENV *, u_int32_t));
-	int  (*get_rep_limit) __P((DB_ENV *, u_int32_t *, u_int32_t *));
-	int  (*set_rep_limit) __P((DB_ENV *, u_int32_t, u_int32_t));
+	int  (*rep_sync) __P((DB_ENV *, u_int32_t));
+	int  (*repmgr_add_remote_site) __P((DB_ENV *, const char *, u_int,
+		int *, u_int32_t));
+	int  (*repmgr_get_ack_policy) __P((DB_ENV *, int *));
+	int  (*repmgr_set_ack_policy) __P((DB_ENV *, int));
+	int  (*repmgr_set_local_site) __P((DB_ENV *, const char *, u_int,
+		u_int32_t));
+	int  (*repmgr_site_list) __P((DB_ENV *, u_int *,
+		DB_REPMGR_SITE **));
+	int  (*repmgr_start) __P((DB_ENV *, int, u_int32_t));
+	int  (*set_alloc) __P((DB_ENV *, void *(*)(size_t),
+		void *(*)(void *, size_t), void (*)(void *)));
+	int  (*set_app_dispatch)
+		__P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
+	int  (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int));
+	int  (*set_data_dir) __P((DB_ENV *, const char *));
+	int  (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t));
+	void (*set_errcall) __P((DB_ENV *,
+		void (*)(const DB_ENV *, const char *, const char *)));
+	void (*set_errfile) __P((DB_ENV *, FILE *));
+	void (*set_errpfx) __P((DB_ENV *, const char *));
+	int  (*set_event_notify)
+		__P((DB_ENV *, void (*)(DB_ENV *, u_int32_t, void *)));
+	int  (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
+	int  (*set_flags) __P((DB_ENV *, u_int32_t, int));
+	int  (*set_intermediate_dir) __P((DB_ENV *, int, u_int32_t));
+	int  (*set_isalive) __P((DB_ENV *,
+		int (*)(DB_ENV *, pid_t, db_threadid_t, u_int32_t)));
+	int  (*set_lg_bsize) __P((DB_ENV *, u_int32_t));
+	int  (*set_lg_dir) __P((DB_ENV *, const char *));
+	int  (*set_lg_filemode) __P((DB_ENV *, int));
+	int  (*set_lg_max) __P((DB_ENV *, u_int32_t));
+	int  (*set_lg_regionmax) __P((DB_ENV *, u_int32_t));
+	int  (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int));
+	int  (*set_lk_detect) __P((DB_ENV *, u_int32_t));
+	int  (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t));
+	int  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
+	int  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
+	int  (*set_mp_max_openfd) __P((DB_ENV *, int));
+	int  (*set_mp_max_write) __P((DB_ENV *, int, int));
+	int  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
+	void (*set_msgcall)
+		__P((DB_ENV *, void (*)(const DB_ENV *, const char *)));
+	void (*set_msgfile) __P((DB_ENV *, FILE *));
+	int  (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int)));
 	int  (*set_rep_request) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*set_rep_transport) __P((DB_ENV *, int,
-		int (*) (DB_ENV *, const DBT *, const DBT *, const DB_LSN *,
-		int, u_int32_t)));
-
-	void *tx_handle;		/* Txn handle and methods. */
-	int  (*get_tx_max) __P((DB_ENV *, u_int32_t *));
+	int  (*set_rpc_server)
+		__P((DB_ENV *, void *, const char *, long, long, u_int32_t));
+	int  (*set_shm_key) __P((DB_ENV *, long));
+	int  (*set_thread_count) __P((DB_ENV *, u_int32_t));
+	int  (*set_thread_id) __P((DB_ENV *,
+		void (*)(DB_ENV *, pid_t *, db_threadid_t *)));
+	int  (*set_thread_id_string) __P((DB_ENV *,
+		char *(*)(DB_ENV *, pid_t, db_threadid_t, char *)));
+	int  (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t));
+	int  (*set_tmp_dir) __P((DB_ENV *, const char *));
 	int  (*set_tx_max) __P((DB_ENV *, u_int32_t));
-	int  (*get_tx_timestamp) __P((DB_ENV *, time_t *));
 	int  (*set_tx_timestamp) __P((DB_ENV *, time_t *));
+	int  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
+	int  (*stat_print) __P((DB_ENV *, u_int32_t));
 	int  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
 	int  (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
-	int  (*txn_recover) __P((DB_ENV *,
-		DB_PREPLIST *, long, long *, u_int32_t));
+	int  (*txn_recover)
+		__P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
 	int  (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
 	int  (*txn_stat_print) __P((DB_ENV *, u_int32_t));
-	int  (*get_timeout) __P((DB_ENV *, db_timeout_t *, u_int32_t));
-	int  (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t));
+	/* DB_ENV PUBLIC HANDLE LIST END */
+
+	/* DB_ENV PRIVATE HANDLE LIST BEGIN */
+	int  (*prdbt) __P((DBT *,
+		int, const char *, void *, int (*)(void *, const void *), int));
+	/* DB_ENV PRIVATE HANDLE LIST END */
 
 #define	DB_TEST_ELECTINIT	 1	/* after __rep_elect_init */
 #define	DB_TEST_ELECTVOTE1	 2	/* after sending VOTE1 */
@@ -2041,38 +2347,42 @@ struct __db_env {
 #define	DB_TEST_POSTSYNC	 7	/* after syncing the log */
 #define	DB_TEST_PREDESTROY	 8	/* before destroy op */
 #define	DB_TEST_PREOPEN		 9	/* before __os_open */
-#define	DB_TEST_SUBDB_LOCKS	 10	/* subdb locking tests */
+#define	DB_TEST_RECYCLE		 10	/* test rep and txn_recycle */
+#define	DB_TEST_SUBDB_LOCKS	 11	/* subdb locking tests */
 	int		 test_abort;	/* Abort value for testing. */
 	int		 test_check;	/* Checkpoint value for testing. */
 	int		 test_copy;	/* Copy value for testing. */
 
-#define	DB_ENV_AUTO_COMMIT	0x0000001 /* DB_AUTO_COMMIT. */
-#define	DB_ENV_CDB		0x0000002 /* DB_INIT_CDB. */
-#define	DB_ENV_CDB_ALLDB	0x0000004 /* CDB environment wide locking. */
-#define	DB_ENV_CREATE		0x0000008 /* DB_CREATE set. */
-#define	DB_ENV_DBLOCAL		0x0000010 /* DB_ENV allocated for private DB. */
-#define	DB_ENV_DIRECT_DB	0x0000020 /* DB_DIRECT_DB set. */
-#define	DB_ENV_DIRECT_LOG	0x0000040 /* DB_DIRECT_LOG set. */
-#define	DB_ENV_DSYNC_LOG	0x0000080 /* DB_DSYNC_LOG set. */
-#define	DB_ENV_FATAL		0x0000100 /* Doing fatal recovery in env. */
-#define	DB_ENV_LOCKDOWN		0x0000200 /* DB_LOCKDOWN set. */
-#define	DB_ENV_LOG_AUTOREMOVE   0x0000400 /* DB_LOG_AUTOREMOVE set. */
-#define	DB_ENV_LOG_INMEMORY     0x0000800 /* DB_LOG_INMEMORY set. */
-#define	DB_ENV_NOLOCKING	0x0001000 /* DB_NOLOCKING set. */
-#define	DB_ENV_NOMMAP		0x0002000 /* DB_NOMMAP set. */
-#define	DB_ENV_NOPANIC		0x0004000 /* Okay if panic set. */
-#define	DB_ENV_OPEN_CALLED	0x0008000 /* DB_ENV->open called. */
-#define	DB_ENV_OVERWRITE	0x0010000 /* DB_OVERWRITE set. */
-#define	DB_ENV_PRIVATE		0x0020000 /* DB_PRIVATE set. */
-#define	DB_ENV_REGION_INIT	0x0040000 /* DB_REGION_INIT set. */
-#define	DB_ENV_RPCCLIENT	0x0080000 /* DB_RPCCLIENT set. */
-#define	DB_ENV_RPCCLIENT_GIVEN	0x0100000 /* User-supplied RPC client struct */
-#define	DB_ENV_SYSTEM_MEM	0x0200000 /* DB_SYSTEM_MEM set. */
-#define	DB_ENV_THREAD		0x0400000 /* DB_THREAD set. */
-#define	DB_ENV_TIME_NOTGRANTED	0x0800000 /* DB_TIME_NOTGRANTED set. */
-#define	DB_ENV_TXN_NOSYNC	0x1000000 /* DB_TXN_NOSYNC set. */
-#define	DB_ENV_TXN_WRITE_NOSYNC	0x2000000 /* DB_TXN_WRITE_NOSYNC set. */
-#define	DB_ENV_YIELDCPU		0x4000000 /* DB_YIELDCPU set. */
+#define	DB_ENV_AUTO_COMMIT	0x00000001 /* DB_AUTO_COMMIT. */
+#define	DB_ENV_CDB		0x00000002 /* DB_INIT_CDB. */
+#define	DB_ENV_CDB_ALLDB	0x00000004 /* CDB environment wide locking. */
+#define	DB_ENV_CREATE		0x00000008 /* DB_CREATE set. */
+#define	DB_ENV_DBLOCAL		0x00000010 /* Environment for a private DB. */
+#define	DB_ENV_DIRECT_DB	0x00000020 /* DB_DIRECT_DB set. */
+#define	DB_ENV_DIRECT_LOG	0x00000040 /* DB_DIRECT_LOG set. */
+#define	DB_ENV_DSYNC_DB		0x00000080 /* DB_DSYNC_DB set. */
+#define	DB_ENV_DSYNC_LOG	0x00000100 /* DB_DSYNC_LOG set. */
+#define	DB_ENV_FATAL		0x00000200 /* Doing fatal recovery in env. */
+#define	DB_ENV_LOCKDOWN		0x00000400 /* DB_LOCKDOWN set. */
+#define	DB_ENV_LOG_AUTOREMOVE   0x00000800 /* DB_LOG_AUTOREMOVE set. */
+#define	DB_ENV_LOG_INMEMORY     0x00001000 /* DB_LOG_INMEMORY set. */
+#define	DB_ENV_MULTIVERSION	0x00002000 /* DB_MULTIVERSION set. */
+#define	DB_ENV_NOLOCKING	0x00004000 /* DB_NOLOCKING set. */
+#define	DB_ENV_NOMMAP		0x00008000 /* DB_NOMMAP set. */
+#define	DB_ENV_NOPANIC		0x00010000 /* Okay if panic set. */
+#define	DB_ENV_OPEN_CALLED	0x00020000 /* DB_ENV->open called. */
+#define	DB_ENV_OVERWRITE	0x00040000 /* DB_OVERWRITE set. */
+#define	DB_ENV_PRIVATE		0x00080000 /* DB_PRIVATE set. */
+#define	DB_ENV_REGION_INIT	0x00100000 /* DB_REGION_INIT set. */
+#define	DB_ENV_RPCCLIENT	0x00200000 /* DB_RPCCLIENT set. */
+#define	DB_ENV_RPCCLIENT_GIVEN	0x00400000 /* User-supplied RPC client struct */
+#define	DB_ENV_SYSTEM_MEM	0x00800000 /* DB_SYSTEM_MEM set. */
+#define	DB_ENV_THREAD		0x01000000 /* DB_THREAD set. */
+#define	DB_ENV_TIME_NOTGRANTED	0x02000000 /* DB_TIME_NOTGRANTED set. */
+#define	DB_ENV_TXN_NOSYNC	0x04000000 /* DB_TXN_NOSYNC set. */
+#define	DB_ENV_TXN_SNAPSHOT	0x08000000 /* DB_TXN_SNAPSHOT set. */
+#define	DB_ENV_TXN_WRITE_NOSYNC	0x10000000 /* DB_TXN_WRITE_NOSYNC set. */
+#define	DB_ENV_YIELDCPU		0x20000000 /* DB_YIELDCPU set. */
 	u_int32_t flags;
 };
 
@@ -2162,4 +2472,6 @@ typedef struct entry {
 #if defined(__cplusplus)
 }
 #endif
+
+@platform_footer@
 #endif /* !_DB_H_ */
diff --git a/db/dbinc/db_185.in b/db/dbinc/db_185.in
index 338455a60..bf3af8abb 100644
--- a/db/dbinc/db_185.in
+++ b/db/dbinc/db_185.in
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994
@@ -32,7 +32,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db_185.in,v 11.11 2004/01/28 03:36:01 bostic Exp $
+ * $Id: db_185.in,v 12.5 2006/08/24 14:45:28 bostic Exp $
  */
 
 #ifndef _DB_185_H_
@@ -42,6 +42,10 @@
 
 #include 
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  * XXX
  * Handle function prototypes and the keyword "const".  This steps on name
@@ -72,7 +76,7 @@
  * XXX
  * SGI/IRIX already has a pgno_t.
  */
-#ifdef	sgi
+#ifdef	__sgi
 #define	pgno_t	db_pgno_t
 #endif
 
@@ -166,4 +170,8 @@ typedef struct {
 /* Re-define the user's dbopen calls. */
 #define	dbopen __db185_open@DB_VERSION_UNIQUE_NAME@
 
+#if defined(__cplusplus)
+}
+#endif
+
 #endif /* !_DB_185_H_ */
diff --git a/db/dbinc/db_am.h b/db/dbinc/db_am.h
index ed1956c66..887255eb1 100644
--- a/db/dbinc/db_am.h
+++ b/db/dbinc/db_am.h
@@ -1,42 +1,61 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_am.h,v 11.78 2004/09/22 21:14:56 ubell Exp $
+ * $Id: db_am.h,v 12.17 2006/08/24 14:45:29 bostic Exp $
  */
 #ifndef _DB_AM_H_
 #define	_DB_AM_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
- * IS_AUTO_COMMIT --
- *	Test for local auto-commit flag or global flag with no local DbTxn
- *	handle.
+ * IS_ENV_AUTO_COMMIT --
+ *	Auto-commit test for enviroment operations: DbEnv::{open,remove,rename}
  */
-#define	IS_AUTO_COMMIT(dbenv, txn, flags)				\
+#define	IS_ENV_AUTO_COMMIT(dbenv, txn, flags)				\
 	(LF_ISSET(DB_AUTO_COMMIT) ||					\
 	    ((txn) == NULL && F_ISSET((dbenv), DB_ENV_AUTO_COMMIT) &&	\
 	    !LF_ISSET(DB_NO_AUTO_COMMIT)))
 
+/*
+ * IS_DB_AUTO_COMMIT --
+ *	Auto-commit test for database operations.
+ */
+#define	IS_DB_AUTO_COMMIT(dbp, txn)					\
+	    ((txn) == NULL && F_ISSET((dbp), DB_AM_TXN))
+
+/*
+ * STRIP_AUTO_COMMIT --
+ *	Releases after 4.3 no longer requires DB operations to specify the
+ *	AUTO_COMMIT flag, but the API continues to allow it to be specified.
+ */
+#define	STRIP_AUTO_COMMIT(f)	FLD_CLR((f), DB_AUTO_COMMIT)
+
 /* DB recovery operation codes. */
 #define	DB_ADD_DUP	1
 #define	DB_REM_DUP	2
 #define	DB_ADD_BIG	3
 #define	DB_REM_BIG	4
+#define	DB_ADD_PAGE_COMPAT	5	/* Compatibility for 4.2 db_relink */
+#define	DB_REM_PAGE_COMPAT	6	/* Compatibility for 4.2 db_relink */
 
 /*
  * Standard initialization and shutdown macros for all recovery functions.
  */
-#define	REC_INTRO(func, inc_count) do {					\
+#define	REC_INTRO(func, inc_count, do_cursor) do {			\
 	argp = NULL;							\
-	dbc = NULL;							\
 	file_dbp = NULL;						\
+	COMPQUIET(dbc, NULL);						\
 	/* mpf isn't used by all of the recovery functions. */		\
 	COMPQUIET(mpf, NULL);						\
 	if ((ret = func(dbenv, dbtp->data, &argp)) != 0)		\
 		goto out;						\
-	if ((ret = __dbreg_id_to_db(dbenv, argp->txnid,			\
+	if ((ret = __dbreg_id_to_db(dbenv, argp->txnp,			\
 	    &file_dbp, argp->fileid, inc_count)) != 0) {		\
 		if (ret	== DB_DELETED) {				\
 			ret = 0;					\
@@ -44,9 +63,11 @@
 		}							\
 		goto out;						\
 	}								\
-	if ((ret = __db_cursor(file_dbp, NULL, &dbc, 0)) != 0)		\
-		goto out;						\
-	F_SET(dbc, DBC_RECOVER);					\
+	if (do_cursor) {						\
+		if ((ret = __db_cursor(file_dbp, NULL, &dbc, 0)) != 0)	\
+			goto out;					\
+		F_SET(dbc, DBC_RECOVER);				\
+	}								\
 	mpf = file_dbp->mpf;						\
 } while (0)
 
@@ -80,7 +101,7 @@
  */
 #ifndef HAVE_FTRUNCATE
 #define	REC_FGET(mpf, pgno, pagep, cont)				\
-	if ((ret = __memp_fget(mpf, &(pgno), 0, pagep)) != 0) {		\
+	if ((ret = __memp_fget(mpf, &(pgno), NULL, 0, pagep)) != 0) {	\
 		if (ret != DB_PAGE_NOTFOUND || DB_REDO(op)) {		\
 			ret = __db_pgerr(file_dbp, pgno, ret);		\
 			goto out;					\
@@ -89,7 +110,7 @@
 	}
 #else
 #define	REC_FGET(mpf, pgno, pagep, cont)				\
-	if ((ret = __memp_fget(mpf, &(pgno), 0, pagep)) != 0) {		\
+	if ((ret = __memp_fget(mpf, &(pgno), NULL, 0, pagep)) != 0) {	\
 		if (ret != DB_PAGE_NOTFOUND) {				\
 			ret = __db_pgerr(file_dbp, pgno, ret);		\
 			goto out;					\
@@ -97,6 +118,11 @@
 			goto cont;					\
 	}
 #endif
+#define	REC_DIRTY(mpf, pagep)						\
+	if ((ret = __memp_dirty(mpf, pagep, NULL, DB_MPOOL_EDIT)) != 0) {\
+		ret = __db_pgerr(file_dbp, PGNO(*(pagep)), ret);	\
+		goto out;						\
+	}
 
 /*
  * Standard debugging macro for all recovery functions.
@@ -124,10 +150,10 @@
  * we don't tie up the internal pages of the tree longer than necessary.
  */
 #define	__LPUT(dbc, lock)						\
-	__ENV_LPUT((dbc)->dbp->dbenv, 					\
-	     lock, F_ISSET((dbc)->dbp, DB_AM_DIRTY) ? DB_LOCK_DOWNGRADE : 0)
-#define	__ENV_LPUT(dbenv, lock, flags)					\
-	(LOCK_ISSET(lock) ? __lock_put(dbenv, &(lock), flags) : 0)
+	__ENV_LPUT((dbc)->dbp->dbenv, lock)
+
+#define	__ENV_LPUT(dbenv, lock)						\
+	(LOCK_ISSET(lock) ? __lock_put(dbenv, &(lock)) : 0)
 
 /*
  * __TLPUT -- transactional lock put
@@ -147,6 +173,51 @@ typedef struct {
 	u_int32_t count;
 } db_trunc_param;
 
+/*
+ * A database should be required to be readonly if it's been explicitly
+ * specified as such or if we're a client in a replicated environment and
+ * we don't have the special "client-writer" designation.
+ */
+#define	DB_IS_READONLY(dbp)						\
+    (F_ISSET(dbp, DB_AM_RDONLY) ||					\
+    (IS_REP_CLIENT((dbp)->dbenv)))
+
+/*
+ * For portability, primary keys that are record numbers are stored in
+ * secondaries in the same byte order as the secondary database.  As a
+ * consequence, we need to swap the byte order of these keys before attempting
+ * to use them for lookups in the primary.  We also need to swap user-supplied
+ * primary keys that are used in secondary lookups (for example, with the
+ * DB_GET_BOTH flag on a secondary get).
+ */
+#include "dbinc/db_swap.h"
+
+#define	SWAP_IF_NEEDED(sdbp, pkey)					\
+	do {								\
+		if (((sdbp)->s_primary->type == DB_QUEUE ||		\
+		    (sdbp)->s_primary->type == DB_RECNO) &&		\
+		    F_ISSET((sdbp), DB_AM_SWAP))			\
+			P_32_SWAP((pkey)->data);			\
+	} while (0)
+
+/*
+ * Cursor adjustment:
+ *	Return the first DB handle in the sorted DB_ENV list of DB
+ *	handles that has a matching file ID.
+ */
+#define	FIND_FIRST_DB_MATCH(dbenv, dbp, tdbp) do {			\
+	for ((tdbp) = (dbp);						\
+	    TAILQ_PREV((tdbp), __dblist, dblistlinks) != NULL &&	\
+	    TAILQ_PREV((tdbp),						\
+		__dblist, dblistlinks)->adj_fileid == (dbp)->adj_fileid;\
+	    (tdbp) = TAILQ_PREV((tdbp), __dblist, dblistlinks))	\
+		;							\
+} while (0)
+
+#if defined(__cplusplus)
+}
+#endif
+
 #include "dbinc/db_dispatch.h"
 #include "dbinc_auto/db_auto.h"
 #include "dbinc_auto/crdel_auto.h"
diff --git a/db/dbinc/db_cxx.in b/db/dbinc/db_cxx.in
index 356145765..ca08f98d8 100644
--- a/db/dbinc/db_cxx.in
+++ b/db/dbinc/db_cxx.in
@@ -1,10 +1,10 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_cxx.in,v 11.147 2004/10/07 21:39:48 bostic Exp $
+ * $Id: db_cxx.in,v 12.28 2006/09/13 14:53:37 mjc Exp $
  */
 
 #ifndef _DB_CXX_H_
@@ -73,11 +73,9 @@ class DbLogc;                                    // forward
 class DbLsn;                                     // forward
 class DbMpoolFile;                               // forward
 class DbPreplist;                                // forward
-class Dbt;                                       // forward
-class DbTxn;                                     // forward
-class DbLock;                                    // forward
 class DbSequence;                                // forward
 class Dbt;                                       // forward
+class DbTxn;                                     // forward
 
 class DbMultipleIterator;                        // forward
 class DbMultipleKeyDataIterator;                 // forward
@@ -88,6 +86,7 @@ class DbException;                               // forward
 class DbDeadlockException;                       // forward
 class DbLockNotGrantedException;                 // forward
 class DbMemoryException;                         // forward
+class DbRepHandleDeadException;                  // forward
 class DbRunRecoveryException;                    // forward
 
 ////////////////////////////////////////////////////////////////
@@ -109,6 +108,7 @@ class DbRunRecoveryException;                    // forward
 // 4514: unreferenced inline function has been removed
 //       certain include files in MSVC define methods that are not called
 //
+#pragma warning(push)
 #pragma warning(disable: 4201 4514)
 
 #endif
@@ -178,8 +178,8 @@ class _exported Db
 	friend class DbEnv;
 
 public:
-	Db(DbEnv*, u_int32_t);      // create a Db object, then call open()
-	virtual ~Db();              // does *not* call close.
+	Db(DbEnv*, u_int32_t);      // Create a Db object.
+	virtual ~Db();              // Calls close() if the user hasn't.
 
 	// These methods exactly match those in the C interface.
 	//
@@ -187,6 +187,8 @@ public:
 	    int (*callback)(Db *, const Dbt *, const Dbt *, Dbt *),
 	    u_int32_t flags);
 	virtual int close(u_int32_t flags);
+	virtual int compact(DbTxn *txnid, Dbt *start, Dbt *stop,
+	    DB_COMPACT *c_data, u_int32_t flags, Dbt *end);
 	virtual int cursor(DbTxn *txnid, Dbc **cursorp, u_int32_t flags);
 	virtual int del(DbTxn *txnid, Dbt *key, u_int32_t flags);
 	virtual void err(int, const char *, ...);
@@ -204,17 +206,16 @@ public:
 	virtual int open(DbTxn *txnid,
 	    const char *, const char *subname, DBTYPE, u_int32_t, int);
 	virtual int pget(DbTxn *txnid, Dbt *key, Dbt *pkey, Dbt *data,
-		 u_int32_t flags);
+	    u_int32_t flags);
 	virtual int put(DbTxn *, Dbt *, Dbt *, u_int32_t);
 	virtual int remove(const char *, const char *, u_int32_t);
 	virtual int rename(const char *, const char *, const char *, u_int32_t);
 	virtual int set_alloc(db_malloc_fcn_type, db_realloc_fcn_type,
-		      db_free_fcn_type);
+	    db_free_fcn_type);
 	virtual void set_app_private(void *);
 	virtual int set_append_recno(int (*)(Db *, Dbt *, db_recno_t));
 	virtual int set_bt_compare(bt_compare_fcn_type); /*deprecated*/
 	virtual int set_bt_compare(int (*)(Db *, const Dbt *, const Dbt *));
-	virtual int set_bt_maxkey(u_int32_t);
 	virtual int get_bt_minkey(u_int32_t *);
 	virtual int set_bt_minkey(u_int32_t);
 	virtual int set_bt_prefix(bt_prefix_fcn_type); /*deprecated*/
@@ -226,7 +227,7 @@ public:
 	virtual int get_encrypt_flags(u_int32_t *);
 	virtual int set_encrypt(const char *, u_int32_t);
 	virtual void set_errcall(
-			void (*)(const DbEnv *, const char *, const char *));
+	    void (*)(const DbEnv *, const char *, const char *));
 	virtual void get_errfile(FILE **);
 	virtual void set_errfile(FILE *);
 	virtual void get_errpfx(const char **);
@@ -385,6 +386,7 @@ public:
 
 	// These methods match those in the C interface.
 	//
+	virtual int cdsgroup_begin(DbTxn **tid);
 	virtual int close(u_int32_t);
 	virtual int dbremove(DbTxn *txn, const char *name, const char *subdb,
 	    u_int32_t flags);
@@ -392,11 +394,15 @@ public:
 	    const char *newname, u_int32_t flags);
 	virtual void err(int, const char *, ...);
 	virtual void errx(const char *, ...);
+	virtual int failchk(u_int32_t);
+	virtual int fileid_reset(const char *, u_int32_t);
 	virtual void *get_app_private() const;
 	virtual int get_home(const char **);
 	virtual int get_open_flags(u_int32_t *);
 	virtual int open(const char *, u_int32_t, int);
 	virtual int remove(const char *, u_int32_t);
+	virtual int stat_print(u_int32_t flags);
+
 	virtual int set_alloc(db_malloc_fcn_type, db_realloc_fcn_type,
 			      db_free_fcn_type);
 	virtual void set_app_private(void *);
@@ -405,6 +411,9 @@ public:
 	virtual int get_data_dirs(const char ***);
 	virtual int set_data_dir(const char *);
 	virtual int get_encrypt_flags(u_int32_t *);
+	virtual int set_intermediate_dir(int, u_int32_t);
+	virtual int set_isalive(
+			int (*)(DbEnv *, pid_t, db_threadid_t, u_int32_t));
 	virtual int set_encrypt(const char *, u_int32_t);
 	virtual void set_errcall(
 			void (*)(const DbEnv *, const char *, const char *));
@@ -412,13 +421,18 @@ public:
 	virtual void set_errfile(FILE *);
 	virtual void get_errpfx(const char **);
 	virtual void set_errpfx(const char *);
+	virtual int set_event_notify(void (*)(DbEnv *, u_int32_t, void *));
 	virtual int get_flags(u_int32_t *);
 	virtual int set_flags(u_int32_t, int);
+	virtual bool is_bigendian();
+	virtual int lsn_reset(const char *, u_int32_t);
 	virtual int set_feedback(void (*)(DbEnv *, int, int));
 	virtual int get_lg_bsize(u_int32_t *);
 	virtual int set_lg_bsize(u_int32_t);
 	virtual int get_lg_dir(const char **);
 	virtual int set_lg_dir(const char *);
+	virtual int get_lg_filemode(int *);
+	virtual int set_lg_filemode(int);
 	virtual int get_lg_max(u_int32_t *);
 	virtual int set_lg_max(u_int32_t);
 	virtual int get_lg_regionmax(u_int32_t *);
@@ -427,7 +441,6 @@ public:
 	virtual int set_lk_conflicts(u_int8_t *, int);
 	virtual int get_lk_detect(u_int32_t *);
 	virtual int set_lk_detect(u_int32_t);
-	virtual int set_lk_max(u_int32_t);
 	virtual int get_lk_max_lockers(u_int32_t *);
 	virtual int set_lk_max_lockers(u_int32_t);
 	virtual int get_lk_max_locks(u_int32_t *);
@@ -436,6 +449,10 @@ public:
 	virtual int set_lk_max_objects(u_int32_t);
 	virtual int get_mp_mmapsize(size_t *);
 	virtual int set_mp_mmapsize(size_t);
+	virtual int get_mp_max_openfd(int *);
+	virtual int set_mp_max_openfd(int);
+	virtual int get_mp_max_write(int *, int *);
+	virtual int set_mp_max_write(int, int);
 	virtual void set_msgcall(void (*)(const DbEnv *, const char *));
 	virtual void get_msgfile(FILE **);
 	virtual void set_msgfile(FILE *);
@@ -447,8 +464,6 @@ public:
 	virtual int set_timeout(db_timeout_t, u_int32_t);
 	virtual int get_tmp_dir(const char **);
 	virtual int set_tmp_dir(const char *);
-	virtual int get_tas_spins(u_int32_t *);
-	virtual int set_tas_spins(u_int32_t);
 	virtual int get_tx_max(u_int32_t *);
 	virtual int set_tx_max(u_int32_t);
 	virtual int set_app_dispatch(int (*)(DbEnv *,
@@ -510,6 +525,7 @@ public:
 	virtual int log_file(DbLsn *lsn, char *namep, size_t len);
 	virtual int log_flush(const DbLsn *lsn);
 	virtual int log_put(DbLsn *lsn, const Dbt *data, u_int32_t flags);
+	virtual int log_printf(DbTxn *, const char *, ...);
 
 	virtual int log_stat(DB_LOG_STAT **spp, u_int32_t flags);
 	virtual int log_stat_print(u_int32_t flags);
@@ -526,6 +542,23 @@ public:
 	virtual int memp_sync(DbLsn *lsn);
 	virtual int memp_trickle(int pct, int *nwrotep);
 
+	// Mpool functions
+	//
+	virtual int mutex_alloc(u_int32_t, db_mutex_t *);
+	virtual int mutex_free(db_mutex_t);
+	virtual int mutex_get_align(u_int32_t *);
+	virtual int mutex_get_increment(u_int32_t *);
+	virtual int mutex_get_max(u_int32_t *);
+	virtual int mutex_get_tas_spins(u_int32_t *);
+	virtual int mutex_lock(db_mutex_t);
+	virtual int mutex_set_align(u_int32_t);
+	virtual int mutex_set_increment(u_int32_t);
+	virtual int mutex_set_max(u_int32_t);
+	virtual int mutex_set_tas_spins(u_int32_t);
+	virtual int mutex_stat(DB_MUTEX_STAT **, u_int32_t);
+	virtual int mutex_stat_print(u_int32_t);
+	virtual int mutex_unlock(db_mutex_t);
+
 	// Transaction functions
 	//
 	virtual int txn_begin(DbTxn *pid, DbTxn **tid, u_int32_t flags);
@@ -538,15 +571,41 @@ public:
 
 	// Replication functions
 	//
-	virtual int rep_elect(int, int, int, u_int32_t, int *, u_int32_t);
+	virtual int rep_elect(int, int, int *, u_int32_t);
+	virtual int rep_flush();
 	virtual int rep_process_message(Dbt *, Dbt *, int *, DbLsn *);
 	virtual int rep_start(Dbt *, u_int32_t);
 	virtual int rep_stat(DB_REP_STAT **statp, u_int32_t flags);
 	virtual int rep_stat_print(u_int32_t flags);
-	virtual int get_rep_limit(u_int32_t *, u_int32_t *);
-	virtual int set_rep_limit(u_int32_t, u_int32_t);
-	virtual int set_rep_transport(int, int (*)(DbEnv *,
+	virtual int rep_get_limit(u_int32_t *, u_int32_t *);
+	virtual int rep_set_limit(u_int32_t, u_int32_t);
+	virtual int rep_set_transport(int, int (*)(DbEnv *,
 	    const Dbt *, const Dbt *, const DbLsn *, int, u_int32_t));
+	virtual int set_rep_request(u_int32_t, u_int32_t);
+	virtual int set_thread_count(u_int32_t);
+	virtual int set_thread_id(void (*)(DbEnv *, pid_t *, db_threadid_t *));
+	virtual int set_thread_id_string(char *(*)(DbEnv *,
+	    pid_t, db_threadid_t, char *));
+	virtual int rep_set_config(u_int32_t which, int onoff);
+	virtual int rep_get_config(u_int32_t which, int *onoffp);
+	virtual int rep_sync(u_int32_t flags);
+
+	// Advanced replication functions
+	//
+	virtual int rep_get_nsites(int *n);
+	virtual int rep_set_nsites(int n);
+	virtual int rep_get_priority(int *priority);
+	virtual int rep_set_priority(int priority);
+	virtual int rep_get_timeout(int which, db_timeout_t *timeout);
+	virtual int rep_set_timeout(int which, db_timeout_t timeout);
+	virtual int repmgr_add_remote_site(const char * host, u_int16_t port,
+	    int *eidp, u_int32_t flags);
+	virtual int repmgr_get_ack_policy(int *policy);
+	virtual int repmgr_set_ack_policy(int policy);
+	virtual int repmgr_set_local_site(const char * host, u_int16_t port,
+	    u_int32_t flags);
+	virtual int repmgr_site_list(u_int *countp, DB_REPMGR_SITE **listp);
+	virtual int repmgr_start(int nthreads, u_int32_t flags);
 
 	// Conversion functions
 	//
@@ -581,15 +640,19 @@ public:
 				       db_recops op);
 	static void _paniccall_intercept(DB_ENV *env, int errval);
 	static void _feedback_intercept(DB_ENV *env, int opcode, int pct);
-	static int _rep_send_intercept(DB_ENV *env,
-				       const DBT *cntrl, const DBT *data,
-				       const DB_LSN *lsn, int id,
-				       u_int32_t flags);
+	static void  _event_func_intercept(DB_ENV *env, u_int32_t, void *);
+	static int _isalive_intercept(DB_ENV *env, pid_t pid,
+	    db_threadid_t thrid, u_int32_t flags);
+	static int _rep_send_intercept(DB_ENV *env, const DBT *cntrl,
+	    const DBT *data, const DB_LSN *lsn, int id, u_int32_t flags);
 	static void _stream_error_function(const DB_ENV *env,
-					   const char *prefix,
-					   const char *message);
+	    const char *prefix, const char *message);
 	static void _stream_message_function(const DB_ENV *env,
-					     const char *message);
+	    const char *message);
+	static void _thread_id_intercept(DB_ENV *env, pid_t *pidp,
+	    db_threadid_t *thridp);
+	static char *_thread_id_string_intercept(DB_ENV *env, pid_t pid,
+	    db_threadid_t thrid, char *buf);
 
 private:
 	void cleanup();
@@ -611,16 +674,17 @@ private:
 	__DB_STD(ostream) *message_stream_;
 
 	int (*app_dispatch_callback_)(DbEnv *, Dbt *, DbLsn *, db_recops);
+	int (*isalive_callback_)(DbEnv *, pid_t, db_threadid_t, u_int32_t);
 	void (*error_callback_)(const DbEnv *, const char *, const char *);
 	void (*feedback_callback_)(DbEnv *, int, int);
 	void (*message_callback_)(const DbEnv *, const char *);
 	void (*paniccall_callback_)(DbEnv *, int);
-	int (*pgin_callback_)(DbEnv *dbenv, db_pgno_t pgno,
-			      void *pgaddr, Dbt *pgcookie);
-	int (*pgout_callback_)(DbEnv *dbenv, db_pgno_t pgno,
-			       void *pgaddr, Dbt *pgcookie);
-	int (*rep_send_callback_)(DbEnv *,
-	    const Dbt *, const Dbt *, const DbLsn *, int, u_int32_t);
+	void (*event_func_callback_)(DbEnv *, u_int32_t, void *);
+	int (*rep_send_callback_)(DbEnv *, const Dbt *, const Dbt *,
+	    const DbLsn *, int, u_int32_t);
+	void (*thread_id_callback_)(DbEnv *, pid_t *, db_threadid_t *);
+	char *(*thread_id_string_callback_)(DbEnv *, pid_t, db_threadid_t,
+	    char *);
 };
 
 //
@@ -688,7 +752,7 @@ class _exported DbMpoolFile
 
 public:
 	int close(u_int32_t flags);
-	int get(db_pgno_t *pgnoaddr, u_int32_t flags, void *pagep);
+	int get(db_pgno_t *pgnoaddr, DbTxn *txn, u_int32_t flags, void *pagep);
 	int open(const char *file, u_int32_t flags, int mode, size_t pagesize);
 	int get_transactional(void);
 	int put(void *pgaddr, u_int32_t flags);
@@ -768,7 +832,7 @@ public:
 	int remove(DbTxn *txnid, u_int32_t flags);
 	int stat(DB_SEQUENCE_STAT **sp, u_int32_t flags);
 	int stat_print(u_int32_t flags);
-	
+
 	int get(DbTxn *txnid, int32_t delta, db_seq_t *retp, u_int32_t flags);
 	int get_cachesize(int32_t *sizep);
 	int set_cachesize(int32_t size);
@@ -825,7 +889,9 @@ public:
 	int commit(u_int32_t flags);
 	int discard(u_int32_t flags);
 	u_int32_t id();
+	int get_name(const char **namep);
 	int prepare(u_int8_t *gid);
+	int set_name(const char *name);
 	int set_timeout(db_timeout_t timeout, u_int32_t flags);
 
 	virtual DB_TXN *get_DB_TXN()
@@ -1072,6 +1138,20 @@ private:
 	Dbt *dbt_;
 };
 
+//
+// A specific sort of exception that occurs when a change of replication
+// master requires that all handles be re-opened.
+//
+class _exported DbRepHandleDeadException : public DbException
+{
+public:
+	virtual ~DbRepHandleDeadException() throw();
+	DbRepHandleDeadException(const char *description);
+
+	DbRepHandleDeadException(const DbRepHandleDeadException &);
+	DbRepHandleDeadException &operator = (const DbRepHandleDeadException &);
+};
+
 //
 // A specific sort of exception that occurs when
 // recovery is required before continuing DB activity.
@@ -1085,4 +1165,17 @@ public:
 	DbRunRecoveryException(const DbRunRecoveryException &);
 	DbRunRecoveryException &operator = (const DbRunRecoveryException &);
 };
+
+//
+// A specific sort of exception that occurs when
+
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+//
+// Restore default compiler warnings
+//
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
 #endif /* !_DB_CXX_H_ */
diff --git a/db/dbinc/db_dispatch.h b/db/dbinc/db_dispatch.h
index bbaff69db..c86f2c999 100644
--- a/db/dbinc/db_dispatch.h
+++ b/db/dbinc/db_dispatch.h
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1995, 1996
@@ -32,12 +32,16 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db_dispatch.h,v 11.38 2004/07/26 19:54:08 margo Exp $
+ * $Id: db_dispatch.h,v 12.8 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef _DB_DISPATCH_H_
 #define	_DB_DISPATCH_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  * Declarations and typedefs for the list of transaction IDs used during
  * recovery.  This is a generic list used to pass along whatever information
@@ -68,6 +72,7 @@ struct __db_txnhead {
 	LIST_HEAD(__db_headlink, __db_txnlist) head[1];
 };
 
+#define	DB_LSN_STACK_SIZE 4
 struct __db_txnlist {
 	db_txnlist_type type;
 	LIST_ENTRY(__db_txnlist) links;
@@ -78,9 +83,9 @@ struct __db_txnlist {
 			u_int32_t status;
 		} t;
 		struct {
-			u_int32_t ntxns;
-			u_int32_t maxn;
-			DB_LSN *lsn_array;
+			u_int32_t stack_size;
+			u_int32_t stack_indx;
+			DB_LSN *lsn_stack;
 		} l;
 		struct {
 			u_int32_t nentries;
@@ -94,16 +99,9 @@ struct __db_txnlist {
 	} u;
 };
 
-/*
- * Flag value for __db_txnlist_lsnadd. Distinguish whether we are replacing
- * an entry in the transaction list or adding a new one.
- */
-#define	TXNLIST_NEW	0x1
-
 /*
  * States for limbo list processing.
  */
-
 typedef enum {
 	LIMBO_NORMAL,		/* Normal processing. */
 	LIMBO_PREPARE,		/* We are preparing a transaction. */
@@ -112,4 +110,8 @@ typedef enum {
 	LIMBO_COMPENSATE	/* After recover to ts, generate log records. */
 } db_limbo_state;
 
+#if defined(__cplusplus)
+}
+#endif
+
 #endif /* !_DB_DISPATCH_H_ */
diff --git a/db/dbinc/db_int.in b/db/dbinc/db_int.in
index 522f2f728..7c3e085cf 100644
--- a/db/dbinc/db_int.in
+++ b/db/dbinc/db_int.in
@@ -1,26 +1,74 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_int.in,v 11.155 2004/10/28 16:07:38 ubell Exp $
+ * $Id: db_int.in,v 12.41 2006/09/19 15:06:59 bostic Exp $
  */
 
-#ifndef _DB_INTERNAL_H_
-#define	_DB_INTERNAL_H_
+#ifndef _DB_INT_H_
+#define	_DB_INT_H_
 
 /*******************************************************
- * System includes, db.h, a few general DB includes.  The DB includes are
- * here because it's OK if db_int.h includes queue structure declarations.
+ * Berkeley DB includes.
  *******************************************************/
 #ifndef NO_SYSTEM_INCLUDES
+#include 
+#ifdef DIAG_MVCC
+#include 
+#endif
+#include 
+
+#if defined(__INCLUDE_SELECT_H)
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
+#ifdef HAVE_VXWORKS
+#include 
+#endif
+#endif
+
+#if TIME_WITH_SYS_TIME
+#include 
+#include 
+#else
+#if HAVE_SYS_TIME_H
+#include 
+#else
+#include 
+#endif
+#endif
+
+#ifdef HAVE_VXWORKS
+#include 
+#else
+#include 
+#endif
+
+#if defined(__INCLUDE_NETWORKING)
+#include 
+#include 
+#include 
+#include 
+#endif
+
 #if defined(STDC_HEADERS) || defined(__cplusplus)
 #include 
 #else
 #include 
 #endif
+
+#include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #endif
 
 #include "db.h"
@@ -46,7 +94,7 @@ extern "C" {
 #endif
 #endif
 
-#if defined(HAVE_LONG_LONG) && defined(HAVE_UNSIGNED_LONG_LONG)
+#if defined(HAVE_64BIT_TYPES)
 #undef	INT64_MAX
 #undef	INT64_MIN
 #undef	UINT64_MAX
@@ -55,9 +103,6 @@ extern "C" {
 #define	INT64_MAX	_I64_MAX
 #define	INT64_MIN	_I64_MIN
 #define	UINT64_MAX	_UI64_MAX
-
-#define	INT64_FMT	"%l64d"
-#define	UINT64_FMT	"%l64u"
 #else
 /*
  * Override the system's 64-bit min/max constants.  AIX's 32-bit compiler can
@@ -67,11 +112,16 @@ extern "C" {
 #define	INT64_MAX	9223372036854775807LL
 #define	INT64_MIN	(-INT64_MAX-1)
 #define	UINT64_MAX	18446744073709551615ULL
-
-#define	INT64_FMT	"%lld"
-#define	UINT64_FMT	"%llu"
 #endif	/* DB_WIN32 */
-#endif	/* HAVE_LONG_LONG && HAVE_UNSIGNED_LONG_LONG */
+
+@INT64_FMT@
+@UINT64_FMT@
+#endif	/* HAVE_64BIT_TYPES */
+
+#undef	FALSE
+#define	FALSE		0
+#undef	TRUE
+#define	TRUE		(!FALSE)
 
 #define	MEGABYTE	1048576
 #define	GIGABYTE	1073741824
@@ -102,17 +152,17 @@ extern "C" {
 /* Align an integer to a specific boundary. */
 #undef	DB_ALIGN
 #define	DB_ALIGN(v, bound)						\
-	(((v) + (bound) - 1) & ~(((uintmax_t)bound) - 1))
+	(((v) + (bound) - 1) & ~(((uintmax_t)(bound)) - 1))
 
 /* Increment a pointer to a specific boundary. */
 #undef	ALIGNP_INC
 #define	ALIGNP_INC(p, bound)						\
-	(void *)(((uintptr_t)(p) + (bound) - 1) & ~(((uintptr_t)bound) - 1))
+	(void *)(((uintptr_t)(p) + (bound) - 1) & ~(((uintptr_t)(bound)) - 1))
 
 /* Decrement a pointer to a specific boundary. */
 #undef	ALIGNP_DEC
 #define	ALIGNP_DEC(p, bound)						\
-	(void *)((uintptr_t)(p) & ~(((uintptr_t)bound) - 1))
+	(void *)((uintptr_t)(p) & ~(((uintptr_t)(bound)) - 1))
 
 /*
  * Print an address as a u_long (a u_long is the largest type we can print
@@ -180,7 +230,7 @@ typedef struct __fn {
 	((int)((total) == 0 ? 0 : ((double)(v) * 100) / (total)))
 #define	DB_PCT_PG(v, total, pgsize)					\
 	((int)((total) == 0 ? 0 :					\
-	    100 - ((double)(v) * 100) / ((total) * (pgsize))))
+	    100 - ((double)(v) * 100) / (((double)total) * (pgsize))))
 
 /*
  * Structure used for callback message aggregation.
@@ -220,6 +270,8 @@ typedef struct __db_msgbuf {
 #define	STAT_LSN(msg, lsnp)						\
 	__db_msg(dbenv, "%lu/%lu\t%s",					\
 	    (u_long)(lsnp)->file, (u_long)(lsnp)->offset, msg)
+#define	STAT_POINTER(msg, v)						\
+	__db_msg(dbenv, "%#lx\t%s", P_TO_ULONG(v), msg)
 #define	STAT_STRING(msg, p) do {					\
 	const char *__p = p;	/* p may be a function call. */		\
 	__db_msg(dbenv, "%s\t%s", __p == NULL ? "!Set" : __p, msg);	\
@@ -227,6 +279,21 @@ typedef struct __db_msgbuf {
 #define	STAT_ULONG(msg, v)						\
 	__db_msg(dbenv, "%lu\t%s", (u_long)(v), msg)
 
+/*
+ * There are quite a few places in Berkeley DB where we want to initialize
+ * a DBT from a string or other random pointer type, using a length typed
+ * to size_t in most cases.  This macro avoids a lot of casting.  The macro
+ * comes in two flavors because we often want to clear the DBT first.
+ */
+#define	DB_SET_DBT(dbt, d, s)  do {					\
+	(dbt).data = (void *)(d);					\
+	(dbt).size = (u_int32_t)(s);					\
+} while (0)
+#define	DB_INIT_DBT(dbt, d, s)  do {					\
+	memset(&(dbt), 0, sizeof(dbt));					\
+	DB_SET_DBT(dbt, d, s);						\
+} while (0)
+
 /*******************************************************
  * API return values
  *******************************************************/
@@ -248,11 +315,11 @@ typedef struct __db_msgbuf {
 #define	DB_RETOK_LGGET(ret)	((ret) == 0 || (ret) == DB_NOTFOUND)
 #define	DB_RETOK_MPGET(ret)	((ret) == 0 || (ret) == DB_PAGE_NOTFOUND)
 #define	DB_RETOK_REPPMSG(ret)	((ret) == 0 || \
+				    (ret) == DB_REP_IGNORE || \
 				    (ret) == DB_REP_ISPERM || \
 				    (ret) == DB_REP_NEWMASTER || \
 				    (ret) == DB_REP_NEWSITE || \
-				    (ret) == DB_REP_NOTPERM || \
-				    (ret) == DB_REP_STARTUPDONE)
+				    (ret) == DB_REP_NOTPERM)
 
 /* Find a reasonable operation-not-supported error. */
 #ifdef	EOPNOTSUPP
@@ -273,8 +340,7 @@ typedef struct __db_msgbuf {
  * the real path length is, as it was traditionally stored in ,
  * and that file isn't always available.
  */
-#undef	MAXPATHLEN
-#define	MAXPATHLEN	1024
+#define	DB_MAXPATHLEN	1024
 
 #define	PATH_DOT	"."	/* Current working directory. */
 				/* Path separator character(s). */
@@ -292,21 +358,33 @@ typedef enum {
 } APPNAME;
 
 /*
+ * A set of macros to check if various functionality has been configured.
+ *
+ * ALIVE_ON	The is_alive function is configured.
  * CDB_LOCKING	CDB product locking.
  * CRYPTO_ON	Security has been configured.
  * LOCKING_ON	Locking has been configured.
  * LOGGING_ON	Logging has been configured.
+ * MUTEX_ON	Mutexes have been configured.
  * MPOOL_ON	Memory pool has been configured.
  * REP_ON	Replication has been configured.
  * RPC_ON	RPC has been configured.
  * TXN_ON	Transactions have been configured.
+ *
+ * REP_ON is more complex than most: if the BDB library was compiled without
+ * replication support, dbenv->rep_handle will be NULL; if the BDB library
+ * has replication support, but it was not configured, the region reference
+ * will be NULL.
  */
+#define	ALIVE_ON(dbenv)		((dbenv)->is_alive != NULL)
 #define	CDB_LOCKING(dbenv)	F_ISSET(dbenv, DB_ENV_CDB)
 #define	CRYPTO_ON(dbenv)	((dbenv)->crypto_handle != NULL)
 #define	LOCKING_ON(dbenv)	((dbenv)->lk_handle != NULL)
 #define	LOGGING_ON(dbenv)	((dbenv)->lg_handle != NULL)
 #define	MPOOL_ON(dbenv)		((dbenv)->mp_handle != NULL)
-#define	REP_ON(dbenv)		((dbenv)->rep_handle != NULL)
+#define	MUTEX_ON(dbenv)		((dbenv)->mutex_handle != NULL)
+#define	REP_ON(dbenv)							\
+	((dbenv)->rep_handle != NULL && (dbenv)->rep_handle->region != NULL)
 #define	RPC_ON(dbenv)		((dbenv)->cl_handle != NULL)
 #define	TXN_ON(dbenv)		((dbenv)->tx_handle != NULL)
 
@@ -323,8 +401,7 @@ typedef enum {
  * IS_RECOVERING: The system is running recovery.
  */
 #define	IS_RECOVERING(dbenv)						\
-	(LOGGING_ON(dbenv) &&						\
-	    F_ISSET((DB_LOG *)(dbenv)->lg_handle, DBLOG_RECOVER))
+	(LOGGING_ON(dbenv) && F_ISSET((dbenv)->lg_handle, DBLOG_RECOVER))
 
 /* Initialization methods are often illegal before/after open is called. */
 #define	ENV_ILLEGAL_AFTER_OPEN(dbenv, name)				\
@@ -338,10 +415,90 @@ typedef enum {
 #define	ENV_REQUIRES_CONFIG(dbenv, handle, i, flags)			\
 	if (handle == NULL)						\
 		return (__db_env_config(dbenv, i, flags));
+#define	ENV_REQUIRES_CONFIG_XX(dbenv, handle, i, flags)			\
+	if ((dbenv)->handle->region == NULL)				\
+		return (__db_env_config(dbenv, i, flags));
 #define	ENV_NOT_CONFIGURED(dbenv, handle, i, flags)			\
 	if (F_ISSET((dbenv), DB_ENV_OPEN_CALLED))			\
 		ENV_REQUIRES_CONFIG(dbenv, handle, i, flags)
 
+#define	ENV_ENTER(dbenv, ip) do {					\
+	int __ret;							\
+	if ((dbenv)->thr_hashtab == NULL)				\
+		ip = NULL;						\
+	else {								\
+		if ((__ret =						\
+		    __env_set_state(dbenv, &(ip), THREAD_ACTIVE)) != 0)	\
+			return (__ret);					\
+	}								\
+} while (0)
+
+#ifdef DIAGNOSTIC
+#define	ENV_LEAVE(dbenv, ip) do {					\
+	if ((ip) != NULL) {						\
+		DB_ASSERT(dbenv, ip->dbth_state == THREAD_ACTIVE);	\
+		(ip)->dbth_state = THREAD_OUT;				\
+	}								\
+} while (0)
+#else
+#define	ENV_LEAVE(dbenv, ip) do {					\
+	if ((ip) != NULL)						\
+		(ip)->dbth_state = THREAD_OUT;				\
+} while (0)
+#endif
+#ifdef DIAGNOSTIC
+#define	CHECK_THREAD(dbenv) do {					\
+	DB_THREAD_INFO *__ip;						\
+	if ((dbenv)->thr_hashtab != NULL) {				\
+		(void)__env_set_state(dbenv, &__ip, THREAD_DIAGNOSTIC);	\
+		DB_ASSERT(dbenv,					\
+		    __ip != NULL && __ip->dbth_state != THREAD_OUT);	\
+	}								\
+} while (0)
+#ifdef HAVE_STATISTICS
+#define	CHECK_MTX_THREAD(dbenv, mtx) do {				\
+	if (mtx->alloc_id != MTX_MUTEX_REGION &&			\
+	    mtx->alloc_id != MTX_ENV_REGION &&				\
+	    mtx->alloc_id != MTX_APPLICATION)				\
+		CHECK_THREAD(dbenv);					\
+} while (0)
+#else
+#define	CHECK_MTX_THREAD(dbenv, mtx)
+#endif
+#else
+#define	CHECK_THREAD(dbenv)
+#define	CHECK_MTX_THREAD(dbenv, mtx)
+#endif
+
+typedef enum {
+	THREAD_SLOT_NOT_IN_USE=0,
+	THREAD_OUT,
+	THREAD_ACTIVE,
+	THREAD_BLOCKED
+#ifdef DIAGNOSTIC
+	, THREAD_DIAGNOSTIC
+#endif
+} DB_THREAD_STATE;
+
+typedef struct __db_thread_info {
+	pid_t		dbth_pid;
+	db_threadid_t	dbth_tid;
+	DB_THREAD_STATE	dbth_state;
+	SH_TAILQ_ENTRY	dbth_links;
+} DB_THREAD_INFO;
+
+typedef struct __env_thread_info {
+	u_int32_t	thr_count;
+	u_int32_t	thr_max;
+	u_int32_t	thr_nbucket;
+	roff_t		thr_hashoff;
+} THREAD_INFO;
+
+#define	DB_EVENT(dbenv, e, einfo) do {					\
+	if ((dbenv)->db_event_func != NULL)				\
+		(dbenv)->db_event_func(dbenv, e, einfo);		\
+} while (0)
+
 /*******************************************************
  * Database Access Methods.
  *******************************************************/
@@ -350,7 +507,7 @@ typedef enum {
  *	The database handle is free-threaded (was opened with DB_THREAD).
  */
 #define	DB_IS_THREADED(dbp)						\
-	((dbp)->mutexp != NULL)
+	((dbp)->mutex != MUTEX_INVALID)
 
 /* Initialization methods are often illegal before/after open is called. */
 #define	DB_ILLEGAL_AFTER_OPEN(dbp, name)				\
@@ -398,9 +555,9 @@ typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
 #define	IS_INITIALIZED(dbc)	((dbc)->internal->pgno != PGNO_INVALID)
 
 /* Free the callback-allocated buffer, if necessary, hanging off of a DBT. */
-#define	FREE_IF_NEEDED(sdbp, dbt)					\
+#define	FREE_IF_NEEDED(dbenv, dbt)					\
 	if (F_ISSET((dbt), DB_DBT_APPMALLOC)) {				\
-		__os_ufree((sdbp)->dbenv, (dbt)->data);			\
+		__os_ufree((dbenv), (dbt)->data);			\
 		F_CLR((dbt), DB_DBT_APPMALLOC);				\
 	}
 
@@ -437,8 +594,10 @@ typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
 /*
  * File types for DB access methods.  Negative numbers are reserved to DB.
  */
-#define	DB_FTYPE_SET		-1	/* Call pgin/pgout functions. */
-#define	DB_FTYPE_NOTSET		 0	/* Don't call... */
+#define	DB_FTYPE_SET		-1		/* Call pgin/pgout functions. */
+#define	DB_FTYPE_NOTSET		 0		/* Don't call... */
+#define	DB_LSN_OFF_NOTSET	-1		/* Not yet set. */
+#define	DB_CLEARLEN_NOTSET	UINT32_MAX	/* Not yet set. */
 
 /* Structure used as the DB pgin/pgout pgcookie. */
 typedef struct __dbpginfo {
@@ -478,12 +637,25 @@ typedef struct __dbpginfo {
 #define	IS_NOT_LOGGED_LSN(LSN) \
 	((LSN).file == 0 && (LSN).offset == 1)
 
+/*
+ * LOG_COMPARE -- compare two LSNs.
+ */
+
+#define	LOG_COMPARE(lsn0, lsn1)						\
+    ((lsn0)->file != (lsn1)->file ?					\
+    ((lsn0)->file < (lsn1)->file ? -1 : 1) :				\
+    ((lsn0)->offset != (lsn1)->offset ?					\
+    ((lsn0)->offset < (lsn1)->offset ? -1 : 1) : 0))
+
+
 /*******************************************************
  * Txn.
  *******************************************************/
 #define	DB_NONBLOCK(C)	((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT))
 #define	NOWAIT_FLAG(txn) \
 	((txn) != NULL && F_ISSET((txn), TXN_NOWAIT) ? DB_LOCK_NOWAIT : 0)
+#define	IS_REAL_TXN(txn)						\
+	((txn) != NULL && !F_ISSET(txn, TXN_CDSGROUP))
 #define	IS_SUBTRANSACTION(txn)						\
 	((txn) != NULL && (txn)->parent != NULL)
 
@@ -526,10 +698,12 @@ typedef struct __dbpginfo {
 struct __db_reginfo_t;	typedef struct __db_reginfo_t REGINFO;
 struct __db_txnhead;	typedef struct __db_txnhead DB_TXNHEAD;
 struct __db_txnlist;	typedef struct __db_txnlist DB_TXNLIST;
-struct __vrfy_childinfo; typedef struct __vrfy_childinfo VRFY_CHILDINFO;
+struct __vrfy_childinfo;typedef struct __vrfy_childinfo VRFY_CHILDINFO;
 struct __vrfy_dbinfo;   typedef struct __vrfy_dbinfo VRFY_DBINFO;
 struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO;
 
+typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB;
+
 #if defined(__cplusplus)
 }
 #endif
@@ -541,11 +715,13 @@ struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO;
 
 #include "dbinc/globals.h"
 #include "dbinc/debug.h"
-#include "dbinc/mutex.h"
 #include "dbinc/region.h"
-#include "dbinc_auto/mutex_ext.h"	/* XXX: Include after region.h. */
 #include "dbinc_auto/env_ext.h"
+#include "dbinc/mutex.h"
 #include "dbinc/os.h"
+#ifdef HAVE_REPLICATION_THREADS
+#include "dbinc/repmgr.h"
+#endif
 #include "dbinc/rep.h"
 #include "dbinc_auto/clib_ext.h"
 #include "dbinc_auto/common_ext.h"
@@ -577,15 +753,18 @@ struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO;
  * We explicitly use LOGGING_ON/IS_REP_CLIENT here because we don't want to pull
  * in the log headers, which IS_RECOVERING (and thus DBENV_LOGGING) rely on, and
  * because DBC_RECOVER should be set anytime IS_RECOVERING would be true.
+ *
+ * If we're not in recovery (master - doing an abort a client applying
+ * a txn), then a client's only path through here is on an internal
+ * operation, and a master's only path through here is a transactional
+ * operation.  Detect if either is not the case.
  */
 #if defined(DIAGNOSTIC) || defined(DEBUG_ROP)  || defined(DEBUG_WOP)
-#define	DBC_LOGGING(dbc)						\
-	(LOGGING_ON((dbc)->dbp->dbenv) &&				\
-	    !F_ISSET((dbc), DBC_RECOVER) && !IS_REP_CLIENT((dbc)->dbp->dbenv))
+#define	DBC_LOGGING(dbc)	__dbc_logging(dbc)
 #else
 #define	DBC_LOGGING(dbc)						\
 	((dbc)->txn != NULL && LOGGING_ON((dbc)->dbp->dbenv) &&		\
 	    !F_ISSET((dbc), DBC_RECOVER) && !IS_REP_CLIENT((dbc)->dbp->dbenv))
 #endif
 
-#endif /* !_DB_INTERNAL_H_ */
+#endif /* !_DB_INT_H_ */
diff --git a/db/dbinc/db_join.h b/db/dbinc/db_join.h
index 3fea2ad2f..089972f6f 100644
--- a/db/dbinc/db_join.h
+++ b/db/dbinc/db_join.h
@@ -1,15 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1998-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1998-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- *	@(#)db_join.h	11.1 (Sleepycat) 7/25/99
+ * $Id: db_join.h,v 12.5 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef _DB_JOIN_H_
 #define	_DB_JOIN_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  * Joins use a join cursor that is similar to a regular DB cursor except
  * that it only supports c_get and c_close functionality.  Also, it does
@@ -28,4 +32,7 @@ typedef struct __join_cursor {
 	u_int32_t flags;
 } JOIN_CURSOR;
 
+#if defined(__cplusplus)
+}
+#endif
 #endif /* !_DB_JOIN_H_ */
diff --git a/db/dbinc/db_page.h b/db/dbinc/db_page.h
index 59a1292ff..4f2973cc3 100644
--- a/db/dbinc/db_page.h
+++ b/db/dbinc/db_page.h
@@ -1,10 +1,10 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_page.h,v 11.63 2004/09/17 22:00:27 mjc Exp $
+ * $Id: db_page.h,v 12.10 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef _DB_PAGE_H_
@@ -48,6 +48,8 @@ extern "C" {
 #define	P_QAMDATA	11	/* Queue data page. */
 #define	P_LDUP		12	/* Off-page duplicate leaf. */
 #define	P_PAGETYPE_MAX	13
+/* Flag to __db_new */
+#define	P_DONTEXTEND	0x8000	/* Don't allocate if there are no free pages. */
 
 /*
  * When we create pages in mpool, we ask mpool to clear some number of bytes
@@ -100,12 +102,12 @@ typedef struct _btmeta33 {
 #define	BTM_MASK	0x07f
 	DBMETA	dbmeta;		/* 00-71: Generic meta-data header. */
 
-	u_int32_t maxkey;	/* 72-75: Btree: Maxkey. */
+	u_int32_t unused1;	/* 72-75: Unused space. */
 	u_int32_t minkey;	/* 76-79: Btree: Minkey. */
 	u_int32_t re_len;	/* 80-83: Recno: fixed-length record length. */
 	u_int32_t re_pad;	/* 84-87: Recno: fixed-length record pad. */
 	u_int32_t root;		/* 88-91: Root page. */
-	u_int32_t unused[92];	/* 92-459: Unused space */
+	u_int32_t unused2[92];	/* 92-459: Unused space. */
 	u_int32_t crypto_magic;		/* 460-463: Crypto magic number */
 	u_int32_t trash[3];		/* 464-475: Trash space - Do not use */
 	u_int8_t iv[DB_IV_BYTES];	/* 476-495: Crypto IV */
@@ -268,7 +270,7 @@ typedef struct _db_page {
 	(F_ISSET((dbp), DB_AM_ENCRYPT) ? ((u_int8_t *)(pg) +		\
 	SIZEOF_PAGE + SSZA(PG_CRYPTO, chksum)) :			\
 	(F_ISSET((dbp), DB_AM_CHKSUM) ? ((u_int8_t *)(pg) +		\
-	SIZEOF_PAGE + SSZA(PG_CHKSUM, chksum))			\
+	SIZEOF_PAGE + SSZA(PG_CHKSUM, chksum))				\
 	: NULL))
 
 /* PAGE element macros. */
@@ -531,12 +533,9 @@ typedef struct _hoffdup {
 #define	B_DSET(t)	(t) |= B_DELETE
 #define	B_DISSET(t)	((t) & B_DELETE)
 
-#define	B_TYPE(t)	((t) & ~B_DELETE)
-#define	B_TSET(t, type, deleted) {					\
-	(t) = (type);							\
-	if (deleted)							\
-		B_DSET(t);						\
-}
+#define	B_TYPE(t)		((t) & ~B_DELETE)
+#define	B_TSET(t, type)	((t) = B_TYPE(type))
+#define	B_TSET_DELETED(t, type) ((t) = (type) | B_DELETE)
 
 /*
  * The first type is B_KEYDATA, represented by the BKEYDATA structure:
@@ -588,6 +587,14 @@ typedef struct _boverflow {
 #define	BOVERFLOW_PSIZE							\
 	(BOVERFLOW_SIZE + sizeof(db_indx_t))
 
+#define	BITEM_SIZE(bk)							\
+	(B_TYPE((bk)->type) != B_KEYDATA ? BOVERFLOW_SIZE :		\
+	BKEYDATA_SIZE((bk)->len))
+
+#define	BITEM_PSIZE(bk)							\
+	(B_TYPE((bk)->type) != B_KEYDATA ? BOVERFLOW_PSIZE :		\
+	BKEYDATA_PSIZE((bk)->len))
+
 /*
  * Btree leaf and hash page layouts group indices in sets of two, one for the
  * key and one for the data.  Everything else does it in sets of one to save
@@ -650,6 +657,11 @@ typedef struct _rinternal {
 #define	RINTERNAL_PSIZE							\
 	(RINTERNAL_SIZE + sizeof(db_indx_t))
 
+struct pglist {
+	db_pgno_t pgno;
+	DB_LSN lsn;
+};
+
 #if defined(__cplusplus)
 }
 #endif
diff --git a/db/dbinc/db_server_int.h b/db/dbinc/db_server_int.h
index eba36efcb..f93ba15ba 100644
--- a/db/dbinc/db_server_int.h
+++ b/db/dbinc/db_server_int.h
@@ -1,15 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2000-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2000-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_server_int.h,v 1.25 2004/01/28 03:36:02 bostic Exp $
+ * $Id: db_server_int.h,v 12.9 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef _DB_SERVER_INT_H_
 #define	_DB_SERVER_INT_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 #define	DB_SERVER_TIMEOUT	300	/* 5 minutes */
 #define	DB_SERVER_MAXTIMEOUT	1200	/* 20 minutes */
 #define	DB_SERVER_IDLETIMEOUT	86400	/* 1 day */
@@ -58,7 +62,7 @@ struct home_entry {
 DB_INIT_CDB | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL |		\
 DB_INIT_TXN | DB_JOINENV)
 
-#define	DB_SERVER_DBFLAGS	 (DB_DIRTY_READ | DB_NOMMAP | DB_RDONLY)
+#define	DB_SERVER_DBFLAGS	 (DB_NOMMAP | DB_RDONLY | DB_READ_UNCOMMITTED)
 #define	DB_SERVER_DBNOSHARE	 (DB_EXCL | DB_TRUNCATE)
 
 typedef struct ct_envdata ct_envdata;
@@ -135,14 +139,23 @@ extern int __dbsrv_verbose;
  * Assumes local variable 'replyp'.
  * NOTE: May 'return' from macro.
  */
-#define	ACTIVATE_CTP(ctp, id, type) {		\
-	(ctp) = get_tableent(id);		\
-	if ((ctp) == NULL) {			\
-		replyp->status = DB_NOSERVER_ID;\
-		return;				\
-	}					\
-	DB_ASSERT((ctp)->ct_type & (type));	\
-	__dbsrv_active(ctp);			\
+#define	ACTIVATE_CTP(ctp, id, type) {					\
+	(ctp) = get_tableent(id);					\
+	if ((ctp) == NULL) {						\
+		replyp->status = DB_NOSERVER_ID;			\
+		return;							\
+	}								\
+	/* We don't have a dbenv handle at this point. */		\
+	DB_ASSERT(NULL, (ctp)->ct_type & (type));			\
+	__dbsrv_active(ctp);						\
 }
 
+#define	FREE_IF_CHANGED(dbenv, p, orig) do {				\
+	if ((p) != NULL && (p) != (orig))				\
+		__os_ufree((dbenv), (p));				\
+} while (0)
+
+#if defined(__cplusplus)
+}
+#endif
 #endif	/* !_DB_SERVER_INT_H_ */
diff --git a/db/dbinc/db_swap.h b/db/dbinc/db_swap.h
index dcfac416a..1fc13b159 100644
--- a/db/dbinc/db_swap.h
+++ b/db/dbinc/db_swap.h
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994
@@ -32,12 +32,60 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: db_swap.h,v 11.11 2004/01/28 03:36:02 bostic Exp $
+ * $Id: db_swap.h,v 12.6 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef _DB_SWAP_H_
 #define	_DB_SWAP_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*
+ * Little endian <==> big endian 64-bit swap macros.
+ *	M_64_SWAP	swap a memory location
+ *	P_64_COPY	copy potentially unaligned 4 byte quantities
+ *	P_64_SWAP	swap a referenced memory location
+ */
+#undef	M_64_SWAP
+#define	M_64_SWAP(a) {							\
+	u_int64_t _tmp;							\
+	_tmp = (u_int64_t)a;						\
+	((u_int8_t *)&a)[0] = ((u_int8_t *)&_tmp)[7];			\
+	((u_int8_t *)&a)[1] = ((u_int8_t *)&_tmp)[6];			\
+	((u_int8_t *)&a)[2] = ((u_int8_t *)&_tmp)[5];			\
+	((u_int8_t *)&a)[3] = ((u_int8_t *)&_tmp)[4];			\
+	((u_int8_t *)&a)[4] = ((u_int8_t *)&_tmp)[3];			\
+	((u_int8_t *)&a)[5] = ((u_int8_t *)&_tmp)[2];			\
+	((u_int8_t *)&a)[6] = ((u_int8_t *)&_tmp)[1];			\
+	((u_int8_t *)&a)[7] = ((u_int8_t *)&_tmp)[0];			\
+}
+#undef	P_64_COPY
+#define	P_64_COPY(a, b) {						\
+	((u_int8_t *)b)[0] = ((u_int8_t *)a)[0];			\
+	((u_int8_t *)b)[1] = ((u_int8_t *)a)[1];			\
+	((u_int8_t *)b)[2] = ((u_int8_t *)a)[2];			\
+	((u_int8_t *)b)[3] = ((u_int8_t *)a)[3];			\
+	((u_int8_t *)b)[4] = ((u_int8_t *)a)[4];			\
+	((u_int8_t *)b)[5] = ((u_int8_t *)a)[5];			\
+	((u_int8_t *)b)[6] = ((u_int8_t *)a)[6];			\
+	((u_int8_t *)b)[7] = ((u_int8_t *)a)[7];			\
+}
+#undef	P_64_SWAP
+#define	P_64_SWAP(a) {							\
+	u_int64_t _tmp;							\
+	P_64_COPY(a, &_tmp);						\
+	((u_int8_t *)a)[0] = ((u_int8_t *)&_tmp)[7];			\
+	((u_int8_t *)a)[1] = ((u_int8_t *)&_tmp)[6];			\
+	((u_int8_t *)a)[2] = ((u_int8_t *)&_tmp)[5];			\
+	((u_int8_t *)a)[3] = ((u_int8_t *)&_tmp)[4];			\
+	((u_int8_t *)a)[4] = ((u_int8_t *)&_tmp)[3];			\
+	((u_int8_t *)a)[5] = ((u_int8_t *)&_tmp)[2];			\
+	((u_int8_t *)a)[6] = ((u_int8_t *)&_tmp)[1];			\
+	((u_int8_t *)a)[7] = ((u_int8_t *)&_tmp)[0];			\
+}
+
 /*
  * Little endian <==> big endian 32-bit swap macros.
  *	M_32_SWAP	swap a memory location
@@ -47,7 +95,7 @@
 #undef	M_32_SWAP
 #define	M_32_SWAP(a) {							\
 	u_int32_t _tmp;							\
-	_tmp = a;							\
+	_tmp = (u_int32_t)a;						\
 	((u_int8_t *)&a)[0] = ((u_int8_t *)&_tmp)[3];			\
 	((u_int8_t *)&a)[1] = ((u_int8_t *)&_tmp)[2];			\
 	((u_int8_t *)&a)[2] = ((u_int8_t *)&_tmp)[1];			\
@@ -123,4 +171,7 @@
 		P_32_SWAP(p);						\
 } while (0)
 
+#if defined(__cplusplus)
+}
+#endif
 #endif /* !_DB_SWAP_H_ */
diff --git a/db/dbinc/db_upgrade.h b/db/dbinc/db_upgrade.h
index e7ac0bc96..6e52859b5 100644
--- a/db/dbinc/db_upgrade.h
+++ b/db/dbinc/db_upgrade.h
@@ -1,15 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_upgrade.h,v 1.12 2004/01/28 03:36:02 bostic Exp $
+ * $Id: db_upgrade.h,v 12.4 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef _DB_UPGRADE_H_
 #define	_DB_UPGRADE_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  * This file defines the metadata pages from the previous release.
  * These structures are only used to upgrade old versions of databases.
@@ -239,4 +243,7 @@ typedef struct hashhdr {	/* Disk resident portion */
 	 */
 } HASHHDR;
 
+#if defined(__cplusplus)
+}
+#endif
 #endif /* !_DB_UPGRADE_H_ */
diff --git a/db/dbinc/db_verify.h b/db/dbinc/db_verify.h
index 528ba8f04..cc88d1c87 100644
--- a/db/dbinc/db_verify.h
+++ b/db/dbinc/db_verify.h
@@ -1,15 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1999-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1999-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: db_verify.h,v 1.34 2004/05/20 14:34:12 bostic Exp $
+ * $Id: db_verify.h,v 12.9 2006/09/08 21:57:14 bostic Exp $
  */
 
 #ifndef _DB_VERIFY_H_
 #define	_DB_VERIFY_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  * Structures and macros for the storage and retrieval of all information
  * needed for inter-page verification of a database.
@@ -21,15 +25,9 @@
  */
 #define	EPRINT(x) do {							\
 	if (!LF_ISSET(DB_SALVAGE))					\
-		__db_err x;						\
+		__db_errx x;						\
 } while (0)
 
-/* For fatal type errors--i.e., verifier bugs. */
-#define	TYPE_ERR_PRINT(dbenv, func, pgno, ptype)			\
-	EPRINT(((dbenv),						\
-	    "Page %lu: %s called on nonsensical page of type %lu",	\
-	    (u_long)(pgno), (func), (u_long)(ptype)));
-
 /* Complain about a totally zeroed page where we don't expect one. */
 #define	ZEROPG_ERR_PRINT(dbenv, pgno, str) do {				\
 	EPRINT(((dbenv), "Page %lu: %s is of inappropriate type %lu",	\
@@ -124,7 +122,8 @@ struct __vrfy_dbinfo {
 	u_int8_t	leaf_type;
 
 	/* Queue needs these to verify data pages in the first pass. */
-	u_int32_t	re_len;
+	u_int32_t	re_pad;		/* Record pad character. */
+	u_int32_t	re_len;		/* Record length. */
 	u_int32_t	rec_page;
 	u_int32_t	page_ext;
 	u_int32_t       first_recno;
@@ -165,9 +164,9 @@ struct __vrfy_pageinfo {
 	db_indx_t	entries;	/* Actual number of entries. */
 	u_int16_t	unused;
 	db_recno_t	rec_cnt;	/* Record count. */
+	u_int32_t	re_pad;		/* Record pad character. */
 	u_int32_t	re_len;		/* Record length. */
 	u_int32_t	bt_minkey;
-	u_int32_t	bt_maxkey;
 	u_int32_t	h_ffactor;
 	u_int32_t	h_nelem;
 
@@ -180,16 +179,17 @@ struct __vrfy_pageinfo {
 	u_int32_t	olen;
 
 #define	VRFY_DUPS_UNSORTED	0x0001	/* Have to flag the negative! */
-#define	VRFY_HAS_DUPS		0x0002
-#define	VRFY_HAS_DUPSORT	0x0004	/* Has the flag set. */
-#define	VRFY_HAS_SUBDBS		0x0008
+#define	VRFY_HAS_CHKSUM		0x0002
+#define	VRFY_HAS_DUPS		0x0004
+#define	VRFY_HAS_DUPSORT	0x0008	/* Has the flag set. */
 #define	VRFY_HAS_RECNUMS	0x0010
-#define	VRFY_INCOMPLETE		0x0020	/* Meta or item order checks incomp. */
-#define	VRFY_IS_ALLZEROES	0x0040	/* Hash page we haven't touched? */
-#define	VRFY_IS_FIXEDLEN	0x0080
-#define	VRFY_IS_RECNO		0x0100
-#define	VRFY_IS_RRECNO		0x0200
-#define	VRFY_OVFL_LEAFSEEN	0x0400
+#define	VRFY_HAS_SUBDBS		0x0020
+#define	VRFY_INCOMPLETE		0x0040	/* Meta or item order checks incomp. */
+#define	VRFY_IS_ALLZEROES	0x0080	/* Hash page we haven't touched? */
+#define	VRFY_IS_FIXEDLEN	0x0100
+#define	VRFY_IS_RECNO		0x0200
+#define	VRFY_IS_RRECNO		0x0400
+#define	VRFY_OVFL_LEAFSEEN	0x0800
 	u_int32_t	flags;
 
 	LIST_ENTRY(__vrfy_pageinfo) links;
@@ -213,4 +213,7 @@ struct __vrfy_childinfo {
 	LIST_ENTRY(__vrfy_childinfo) links;
 }; /* VRFY_CHILDINFO */
 
+#if defined(__cplusplus)
+}
+#endif
 #endif /* !_DB_VERIFY_H_ */
diff --git a/db/dbinc/debug.h b/db/dbinc/debug.h
index 068c8af2b..e47f3f614 100644
--- a/db/dbinc/debug.h
+++ b/db/dbinc/debug.h
@@ -1,10 +1,10 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1998-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1998-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: debug.h,v 11.44 2004/09/24 00:43:18 bostic Exp $
+ * $Id: debug.h,v 12.8 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef _DB_DEBUG_H_
@@ -33,10 +33,11 @@ extern "C" {
  *
  * Use __STDC__ rather than STDC_HEADERS, the #e construct is ANSI C specific.
  */
-#if defined(__STDC__) && defined(DIAGNOSTIC)
-#define	DB_ASSERT(e)	((e) ? (void)0 : __db_assert(#e, __FILE__, __LINE__))
+#if defined(DIAGNOSTIC) && defined(__STDC__)
+#define	DB_ASSERT(env, e)						\
+	((e) ? (void)0 : __db_assert(env, #e, __FILE__, __LINE__))
 #else
-#define	DB_ASSERT(e)
+#define	DB_ASSERT(env, e)
 #endif
 
 /*
@@ -45,9 +46,10 @@ extern "C" {
  * Unused, or not-used-yet variable.  We need to write and then read the
  * variable, some compilers are too bloody clever by half.
  */
-#define	COMPQUIET(n, v)							\
-	(n) = (v);							\
-	(n) = (n)
+#define	COMPQUIET(n, v)	do {					        \
+	(n) = (v);						        \
+	(n) = (n);						        \
+} while (0)
 
 /*
  * Purify and other run-time tools complain about uninitialized reads/writes
@@ -60,6 +62,17 @@ extern "C" {
 #define	UMRW_SET(v)
 #endif
 
+/*
+ * Errors are in one of two areas: a Berkeley DB error, or a system-level
+ * error.  We use db_strerror to translate the former and __os_strerror to
+ * translate the latter.
+ */
+typedef enum {
+	DB_ERROR_NOT_SET=0,
+	DB_ERROR_SET=1,
+	DB_ERROR_SYSTEM=2
+} db_error_set_t;
+
 /*
  * Message handling.  Use a macro instead of a function because va_list
  * references to variadic arguments cannot be reset to the beginning of the
@@ -209,6 +222,13 @@ extern "C" {
 		(flags) |= DB_LOCK_NOWAIT;				\
 } while (0)
 
+#define	DB_ENV_TEST_RECYCLE(env, ret) do {				\
+	if ((env)->test_copy == DB_TEST_RECYCLE) {			\
+		ret = 0;						\
+		goto db_tr_err;						\
+	}								\
+} while (0)
+
 #define	DB_ENV_TEST_RECOVERY(env, val, ret, name) do {			\
 	int __ret;							\
 	PANIC_CHECK((env));						\
@@ -247,15 +267,16 @@ extern "C" {
 
 #define	DB_TEST_RECOVERY_LABEL	db_tr_err:
 
-#define	DB_TEST_CHECKPOINT(env, val)					\
-	if ((val) != 0)							\
+#define	DB_TEST_WAIT(env, val)					\
+	if ((val) != 0)						\
 		__os_sleep((env), (u_long)(val), 0)
 #else
+#define	DB_ENV_TEST_RECYCLE(env, ret);
 #define	DB_TEST_SUBLOCKS(env, flags)
 #define	DB_ENV_TEST_RECOVERY(env, val, ret, name)
 #define	DB_TEST_RECOVERY(dbp, val, ret, name)
 #define	DB_TEST_RECOVERY_LABEL
-#define	DB_TEST_CHECKPOINT(env, val)
+#define	DB_TEST_WAIT(env, val)
 #endif
 
 #if defined(__cplusplus)
diff --git a/db/dbinc/fop.h b/db/dbinc/fop.h
index ef87ff6e2..33f919d22 100644
--- a/db/dbinc/fop.h
+++ b/db/dbinc/fop.h
@@ -1,16 +1,28 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2001-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2001-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: fop.h,v 11.5 2004/01/28 03:36:02 bostic Exp $
+ * $Id: fop.h,v 12.6 2006/08/24 14:45:29 bostic Exp $
  */
 
-#ifndef	_FOP_H_
-#define	_FOP_H_
+#ifndef	_DB_FOP_H_
+#define	_DB_FOP_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define	MAKE_INMEM(D) do {					\
+	F_SET((D), DB_AM_INMEM);				\
+	(void)__memp_set_flags((D)->mpf, DB_MPOOL_NOFILE, 1);	\
+} while (0)
 
 #include "dbinc_auto/fileops_auto.h"
 #include "dbinc_auto/fileops_ext.h"
 
-#endif /* !_FOP_H_ */
+#if defined(__cplusplus)
+}
+#endif
+#endif /* !_DB_FOP_H_ */
diff --git a/db/dbinc/globals.h b/db/dbinc/globals.h
index 95d96533a..3d68423ef 100644
--- a/db/dbinc/globals.h
+++ b/db/dbinc/globals.h
@@ -1,12 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: globals.h,v 11.9 2004/09/17 22:00:27 mjc Exp $
+ * $Id: globals.h,v 12.4 2006/08/24 14:45:29 bostic Exp $
  */
 
+#ifndef _DB_GLOBALS_H_
+#define	_DB_GLOBALS_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*******************************************************
  * Global variables.
  *
@@ -90,3 +97,8 @@ extern	DB_GLOBALS	__db_global_values;
 #endif
 
 #define	DB_GLOBAL(v)	__db_global_values.v
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* !_DB_GLOBALS_H_ */
diff --git a/db/dbinc/hash.h b/db/dbinc/hash.h
index 10059a5e0..acc608802 100644
--- a/db/dbinc/hash.h
+++ b/db/dbinc/hash.h
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993, 1994
@@ -39,12 +39,16 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: hash.h,v 11.28 2004/01/28 03:36:02 bostic Exp $
+ * $Id: hash.h,v 12.5 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef	_DB_HASH_H_
 #define	_DB_HASH_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /* Hash internal structure. */
 typedef struct hash_t {
 	db_pgno_t meta_pgno;	/* Page number of the meta data page. */
@@ -78,13 +82,12 @@ typedef struct cursor_t {
 
 #define	H_CONTINUE	0x0001		/* Join--search strictly fwd for data */
 #define	H_DELETED	0x0002		/* Cursor item is deleted. */
-#define	H_DIRTY		0x0004		/* Meta-data page needs to be written */
-#define	H_DUPONLY	0x0008		/* Dups only; do not change key. */
-#define	H_EXPAND	0x0010		/* Table expanded. */
-#define	H_ISDUP		0x0020		/* Cursor is within duplicate set. */
-#define	H_NEXT_NODUP	0x0040		/* Get next non-dup entry. */
-#define	H_NOMORE	0x0080		/* No more entries in bucket. */
-#define	H_OK		0x0100		/* Request succeeded. */
+#define	H_DUPONLY	0x0004		/* Dups only; do not change key. */
+#define	H_EXPAND	0x0008		/* Table expanded. */
+#define	H_ISDUP		0x0010		/* Cursor is within duplicate set. */
+#define	H_NEXT_NODUP	0x0020		/* Get next non-dup entry. */
+#define	H_NOMORE	0x0040		/* No more entries in bucket. */
+#define	H_OK		0x0080		/* Request succeeded. */
 	u_int32_t	flags;
 } HASH_CURSOR;
 
@@ -141,6 +144,10 @@ typedef enum {
 	DB_HAM_SPLIT = 6
 } db_ham_mode;
 
+#if defined(__cplusplus)
+}
+#endif
+
 #include "dbinc_auto/hash_auto.h"
 #include "dbinc_auto/hash_ext.h"
 #include "dbinc/db_am.h"
diff --git a/db/dbinc/hmac.h b/db/dbinc/hmac.h
index 439537927..5868d7bfb 100644
--- a/db/dbinc/hmac.h
+++ b/db/dbinc/hmac.h
@@ -1,15 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: hmac.h,v 1.5 2004/01/28 03:36:02 bostic Exp $
+ * $Id: hmac.h,v 12.4 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef	_DB_HMAC_H_
 #define	_DB_HMAC_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  * Algorithm specific information.
  */
@@ -28,5 +32,9 @@ typedef struct {
 #define	DB_MAC_MAGIC	"mac derivation key magic value"
 #define	DB_ENC_MAGIC	"encryption and decryption key value magic"
 
+#if defined(__cplusplus)
+}
+#endif
+
 #include "dbinc_auto/hmac_ext.h"
 #endif /* !_DB_HMAC_H_ */
diff --git a/db/dbinc/lock.h b/db/dbinc/lock.h
index e59abbff8..8d5a6a367 100644
--- a/db/dbinc/lock.h
+++ b/db/dbinc/lock.h
@@ -1,15 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: lock.h,v 11.53 2004/09/22 21:14:56 ubell Exp $
+ * $Id: lock.h,v 12.11 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef	_DB_LOCK_H_
 #define	_DB_LOCK_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 #define	DB_LOCK_DEFAULT_N	1000	/* Default # of locks in region. */
 
 /*
@@ -54,11 +58,21 @@ typedef struct {
 	((t1)->tv_sec > (t2)->tv_sec ||					\
 	((t1)->tv_sec == (t2)->tv_sec && (t1)->tv_usec > (t2)->tv_usec))
 
+/* Macros to lock/unlock the lock region as a whole. */
+#define	LOCK_SYSTEM_LOCK(dbenv)						\
+	MUTEX_LOCK(dbenv, ((DB_LOCKREGION *)				\
+	    (dbenv)->lk_handle->reginfo.primary)->mtx_region)
+#define	LOCK_SYSTEM_UNLOCK(dbenv)					\
+	MUTEX_UNLOCK(dbenv, ((DB_LOCKREGION *)				\
+	    (dbenv)->lk_handle->reginfo.primary)->mtx_region)
+
 /*
  * DB_LOCKREGION --
  *	The lock shared region.
  */
 typedef struct __db_lockregion {
+	db_mutex_t	mtx_region;	/* Region mutex. */
+
 	u_int32_t	need_dd;	/* flag for deadlock detector */
 	u_int32_t	detect;		/* run dd on every conflict */
 	db_timeval_t	next_timeout;	/* next time to expire a lock */
@@ -79,15 +93,9 @@ typedef struct __db_lockregion {
 
 	roff_t		conf_off;	/* offset of conflicts array */
 	roff_t		obj_off;	/* offset of object hash table */
-	roff_t		osynch_off;	/* offset of the object mutex table */
 	roff_t		locker_off;	/* offset of locker hash table */
-	roff_t		lsynch_off;	/* offset of the locker mutex table */
 
 	DB_LOCK_STAT	stat;		/* stats about locking. */
-
-#ifdef HAVE_MUTEX_SYSTEM_RESOURCES
-	roff_t		maint_off;	/* offset of region maintenance info */
-#endif
 } DB_LOCKREGION;
 
 /*
@@ -122,9 +130,15 @@ typedef struct __db_lockobj {
  */
 typedef struct __db_locker {
 	u_int32_t id;			/* Locker id. */
+
+	pid_t pid;			/* Process owning locker ID */
+	db_threadid_t tid;		/* Thread owning locker ID */
+
 	u_int32_t dd_id;		/* Deadlock detector id. */
+
 	u_int32_t nlocks;		/* Number of locks held. */
 	u_int32_t nwrites;		/* Number of write locks held. */
+
 	roff_t  master_locker;		/* Locker of master transaction. */
 	roff_t  parent_locker;		/* Parent of this child. */
 	SH_LIST_HEAD(_child) child_locker;	/* List of descendant txns;
@@ -152,13 +166,13 @@ typedef struct __db_locker {
  *	The primary library lock data structure (i.e., the one referenced
  * by the environment, as opposed to the internal one laid out in the region.)
  */
-typedef struct __db_locktab {
+struct __db_locktab {
 	DB_ENV		*dbenv;		/* Environment. */
 	REGINFO		 reginfo;	/* Region information. */
 	u_int8_t	*conflicts;	/* Pointer to conflict matrix. */
 	DB_HASHTAB	*obj_tab;	/* Beginning of object hash table. */
 	DB_HASHTAB	*locker_tab;	/* Beginning of locker hash table. */
-} DB_LOCKTAB;
+};
 
 /*
  * Test for conflicts.
@@ -175,7 +189,7 @@ struct __db_lock {
 	 * Wait on mutex to wait on lock.  You reference your own mutex with
 	 * ID 0 and others reference your mutex with ID 1.
 	 */
-	DB_MUTEX	mutex;
+	db_mutex_t	mtx_lock;
 
 	u_int32_t	holder;		/* Who holds this lock. */
 	u_int32_t	gen;		/* Generation count. */
@@ -195,10 +209,9 @@ struct __db_lock {
  *		      (used by __lock_put_internal).
  * DB_LOCK_UNLINK:    Remove from the locker links (used in checklocker).
  * Make sure that these do not conflict with the interface flags because
- * we pass some of those around (i.e., DB_LOCK_REMOVE).
+ * we pass some of those around.
  */
 #define	DB_LOCK_DOALL		0x010000
-#define	DB_LOCK_DOWNGRADE	0x020000
 #define	DB_LOCK_FREE		0x040000
 #define	DB_LOCK_NOPROMOTE	0x080000
 #define	DB_LOCK_UNLINK		0x100000
@@ -212,11 +225,20 @@ struct __db_lock {
 	ndx = __lock_ohash(obj) % (reg)->object_t_size
 #define	SHOBJECT_LOCK(lt, reg, shobj, ndx)				\
 	ndx = __lock_lhash(shobj) % (reg)->object_t_size
+
+/*
+ * __lock_locker_hash --
+ *	Hash function for entering lockers into the locker hash table.
+ *	Since these are simply 32-bit unsigned integers at the moment,
+ *	just return the locker value.
+ */
+#define	__lock_locker_hash(locker)	(locker)
 #define	LOCKER_LOCK(lt, reg, locker, ndx)				\
 	ndx = __lock_locker_hash(locker) % (reg)->locker_t_size;
 
-#define	LOCKREGION(dbenv, lt)  R_LOCK((dbenv), &((DB_LOCKTAB *)lt)->reginfo)
-#define	UNLOCKREGION(dbenv, lt)  R_UNLOCK((dbenv), &((DB_LOCKTAB *)lt)->reginfo)
+#if defined(__cplusplus)
+}
+#endif
 
 #include "dbinc_auto/lock_ext.h"
 #endif /* !_DB_LOCK_H_ */
diff --git a/db/dbinc/log.h b/db/dbinc/log.h
index 9a8690138..3acd1b7ec 100644
--- a/db/dbinc/log.h
+++ b/db/dbinc/log.h
@@ -1,14 +1,18 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: log.h,v 11.90 2004/10/15 16:59:39 bostic Exp $
+ * $Id: log.h,v 12.24 2006/08/24 14:45:29 bostic Exp $
  */
 
-#ifndef _LOG_H_
-#define	_LOG_H_
+#ifndef _DB_LOG_H_
+#define	_DB_LOG_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
 
 /*******************************************************
  * DBREG:
@@ -32,6 +36,7 @@ struct __fname {
 	SH_TAILQ_ENTRY q;		/* File name queue. */
 
 	int32_t   id;			/* Logging file id. */
+	int32_t   old_id;		/* Saved logging file id. */
 	DBTYPE	  s_type;		/* Saved DB type. */
 
 	roff_t	  name_off;		/* Name offset. */
@@ -42,20 +47,23 @@ struct __fname {
 					 * Txn ID of the DB create, stored so
 					 * we can log it at register time.
 					 */
-	int	  is_durable;		/* Is this file durable or not. */
+#define	DB_FNAME_NOTLOGGED	0x01	/* Log of close failed. */
+#define	DB_FNAME_DURABLE	0x02	/* File is durable. */
+	u_int32_t flags;
 };
 
 /* File open/close register log record opcodes. */
 #define	DBREG_CHKPNT	1		/* Checkpoint: file name/id dump. */
 #define	DBREG_CLOSE	2		/* File close. */
 #define	DBREG_OPEN	3		/* File open. */
-#define	DBREG_RCLOSE	4		/* File close after recovery. */
+#define	DBREG_PREOPEN	4		/* Open in mpool only. */
+#define	DBREG_RCLOSE	5		/* File close after recovery. */
+#define	DBREG_REOPEN	6		/* Open for in-memory database. */
 
 /*******************************************************
  * LOG:
  *	The log subsystem information.
  *******************************************************/
-struct __db_log;	typedef struct __db_log DB_LOG;
 struct __hdr;		typedef struct __hdr HDR;
 struct __log;		typedef struct __log LOG;
 struct __log_persist;	typedef struct __log_persist LOGP;
@@ -66,39 +74,42 @@ struct __log_persist;	typedef struct __log_persist LOGP;
 
 #define	LG_MAX_DEFAULT		(10 * MEGABYTE)	/* 10 MB. */
 #define	LG_MAX_INMEM		(256 * 1024)	/* 256 KB. */
-#define	LG_BSIZE_DEFAULT	(32 * 1024)	/* 32 KB. */
 #define	LG_BSIZE_INMEM		(1 * MEGABYTE)	/* 1 MB. */
-#define	LG_BASE_REGION_SIZE	(60 * 1024)	/* 60 KB. */
+
+/*
+ * Allocate a few bytes under a power-of-two value.  BDB doesn't care if it's
+ * a power-of-two or not, and requesting slightly under a power-of-two allows
+ * stupid allocators to avoid wasting space.
+ */
+#define	LG_BASE_REGION_SIZE	(65000)		/* 64KB - 536B */
+#define	LG_BSIZE_DEFAULT	(32000)		/* 32 KB - 768B */
+#define	LG_CURSOR_BUF_SIZE	(32000)		/* 32KB - 768B */
 
 /*
  * DB_LOG
  *	Per-process log structure.
  */
 struct __db_log {
-/*
- * These fields need to be protected for multi-threaded support.
- *
- * !!!
- * As this structure is allocated in per-process memory, the mutex may need
- * to be stored elsewhere on architectures unable to support mutexes in heap
- * memory, e.g., HP/UX 9.
- */
-	DB_MUTEX  *mutexp;		/* Mutex for thread protection. */
+	/*
+	 * These fields need to be protected for multi-threaded support.
+	 */
+	db_mutex_t mtx_dbreg;		/* Mutex for thread protection. */
 
 	DB_ENTRY *dbentry;		/* Recovery file-id mapping. */
 #define	DB_GROW_SIZE	64
-	int32_t dbentry_cnt;		/* Entries.  Grows by DB_GROW_SIZE. */
+	int32_t	dbentry_cnt;		/* Entries.  Grows by DB_GROW_SIZE. */
 
-/*
- * These fields are always accessed while the region lock is held, so they do
- * not have to be protected by the thread lock as well.
- */
+	/*
+	 * These fields are only accessed when the region lock is held, so
+	 * they do not have to be protected by the thread lock as well.
+	 */
 	u_int32_t lfname;		/* Log file "name". */
 	DB_FH	 *lfhp;			/* Log file handle. */
+	time_t	  lf_timestamp;		/* Log file timestamp. */
 
 	u_int8_t *bufp;			/* Region buffer. */
 
-/* These fields are not protected. */
+	/* These fields are not thread protected. */
 	DB_ENV	 *dbenv;		/* Reference to error information. */
 	REGINFO	  reginfo;		/* Region information. */
 
@@ -122,6 +133,21 @@ struct __hdr {
 	size_t	  size;			/* Size of header to use */
 };
 
+/*
+ * LOG_HDR_SUM -- XOR in prev and len
+ *	This helps avoids the race misreading the log while it
+ * it is being updated.
+ */
+#define	LOG_HDR_SUM(crypto, hdr, sum) do {				\
+	if (crypto) {							\
+		((u_int32_t *)sum)[0] ^= ((HDR *)hdr)->prev;		\
+		((u_int32_t *)sum)[1] ^= ((HDR *)hdr)->len;		\
+	} else {							\
+		((u_int32_t *)sum)[0] ^=				\
+		     ((HDR *)hdr)->prev ^ ((HDR *)hdr)->len;		\
+	}								\
+} while (0)
+
 /*
  * We use HDR internally, and then when we write out, we write out
  * prev, len, and then a 4-byte checksum if normal operation or
@@ -138,24 +164,28 @@ struct __log_persist {
 	u_int32_t version;		/* DB_LOGVERSION */
 
 	u_int32_t log_size;		/* Log file size. */
-	u_int32_t mode;			/* Log file mode. */
+	u_int32_t notused;		/* Historically the log file mode. */
 };
 
+/* Macros to lock/unlock the log region as a whole. */
+#define	LOG_SYSTEM_LOCK(dbenv)						\
+	MUTEX_LOCK(dbenv, ((LOG *)					\
+	    (dbenv)->lg_handle->reginfo.primary)->mtx_region)
+#define	LOG_SYSTEM_UNLOCK(dbenv)					\
+	MUTEX_UNLOCK(dbenv, ((LOG *)					\
+	    (dbenv)->lg_handle->reginfo.primary)->mtx_region)
+
 /*
  * LOG --
  *	Shared log region.  One of these is allocated in shared memory,
  *	and describes the log.
  */
 struct __log {
-	/*
-	 * Due to alignment constraints on some architectures (e.g. HP-UX),
-	 * DB_MUTEXes must be the first element of shalloced structures,
-	 * and as a corollary there can be only one per structure.  Thus,
-	 * flush_mutex_off points to a mutex in a separately-allocated chunk.
-	 */
-	DB_MUTEX fq_mutex;		/* Mutex guarding file name list. */
+	db_mutex_t mtx_region;		/* Region mutex. */
 
-	LOGP	 persist;		/* Persistent information. */
+	db_mutex_t mtx_filelist;	/* Mutex guarding file name list. */
+
+	LOGP	persist;		/* Persistent information. */
 
 	SH_TAILQ_HEAD(__fq1) fq;	/* List of file names. */
 	int32_t	fid_max;		/* Max fid allocated. */
@@ -185,28 +215,34 @@ struct __log {
 					   file. */
 
 	/*
-	 * Due to alignment constraints on some architectures (e.g. HP-UX),
-	 * DB_MUTEXes must be the first element of shalloced structures,
-	 * and as a corollary there can be only one per structure.  Thus,
-	 * flush_mutex_off points to a mutex in a separately-allocated chunk.
-	 *
 	 * The s_lsn LSN is the last LSN that we know is on disk, not just
 	 * written, but synced.  This field is protected by the flush mutex
 	 * rather than by the region mutex.
 	 */
-	int	  in_flush;		/* Log flush in progress. */
-	roff_t	  flush_mutex_off;	/* Mutex guarding flushing. */
-	DB_LSN	  s_lsn;		/* LSN of the last sync. */
+	db_mutex_t mtx_flush;		/* Mutex guarding flushing. */
+	int	   in_flush;		/* Log flush in progress. */
+	DB_LSN	   s_lsn;		/* LSN of the last sync. */
 
 	DB_LOG_STAT stat;		/* Log statistics. */
 
 	/*
-	 * !!! - NOTE that the next 7 fields, waiting_lsn, verify_lsn,
-	 * max_wait_lsn, maxperm_lsn, wait_recs, rcvd_recs,
-	 * and ready_lsn are NOT protected
-	 * by the log region lock.  They are protected by db_rep->db_mutexp.
-	 * If you need access to both, you must acquire db_rep->db_mutexp
-	 * before acquiring the log region lock.
+	 * This timestamp is updated anytime someone unlinks log
+	 * files.  This can happen when calling __log_vtruncate
+	 * or replication internal init when it unlinks log files.
+	 *
+	 * The timestamp is used so that other processes that might
+	 * have file handles to log files know to close/reopen them
+	 * so they're not potentially writing to now-removed files.
+	 */
+	time_t	   timestamp;		/* Log trunc timestamp. */
+
+	/*
+	 * !!!
+	 * NOTE: the next 11 fields, waiting_lsn, verify_lsn, max_wait_lsn,
+	 * maxperm_lsn, wait_recs, rcvd_recs, ready_lsn and bulk_* are NOT
+	 * protected by the log region lock.  They are protected by
+	 * REP->mtx_clientdb.  If you need access to both, you must acquire
+	 * REP->mtx_clientdb before acquiring the log region lock.
 	 *
 	 * The waiting_lsn is used by the replication system.  It is the
 	 * first LSN that we are holding without putting in the log, because
@@ -235,6 +271,16 @@ struct __log {
 	 * header), rather than to 0.
 	 */
 	DB_LSN	  ready_lsn;
+	/*
+	 * The bulk_buf is used by replication for bulk transfer.  While this
+	 * is protected by REP->mtx_clientdb, this doesn't contend with the
+	 * above fields because the above are used by clients and the bulk
+	 * fields below are used by a master.
+	 */
+	roff_t	  bulk_buf;		/* Bulk transfer buffer in region. */
+	uintptr_t bulk_off;		/* Current offset into bulk buffer. */
+	u_int32_t bulk_len;		/* Length of buffer. */
+	u_int32_t bulk_flags;		/* Bulk buffer flags. */
 
 	/*
 	 * During initialization, the log system walks forward through the
@@ -253,6 +299,8 @@ struct __log {
 	u_int32_t log_size;		/* Log file's size. */
 	u_int32_t log_nsize;		/* Next log file's size. */
 
+	int	  filemode;		/* Log file permissions mode. */
+
 	/*
 	 * DB_LOG_AUTOREMOVE and DB_LOG_INMEMORY: not protected by a mutex,
 	 * all we care about is if they're zero or non-zero.
@@ -272,12 +320,6 @@ struct __log {
 	 */
 	SH_TAILQ_HEAD(__logfile) logfiles;
 	SH_TAILQ_HEAD(__free_logfile) free_logfiles;
-
-#ifdef HAVE_MUTEX_SYSTEM_RESOURCES
-#define	LG_MAINT_SIZE	(sizeof(roff_t) * DB_MAX_HANDLES)
-
-	roff_t	  maint_off;		/* offset of region maintenance info */
-#endif
 };
 
 /*
@@ -285,7 +327,7 @@ struct __log {
  *	One of these is allocated for each transaction waiting to commit.
  */
 struct __db_commit {
-	DB_MUTEX	mutex;		/* Mutex for txn to wait on. */
+	db_mutex_t	mtx_txnwait;	/* Mutex for txn to wait on. */
 	DB_LSN		lsn;		/* LSN of commit record. */
 	SH_TAILQ_ENTRY	links;		/* Either on free or waiting list. */
 
@@ -309,16 +351,18 @@ struct __db_commit {
  */
 
 #ifdef HAVE_FTRUNCATE
-#define	CHECK_LSN(redo, cmp, lsn, prev)					\
+#define	CHECK_LSN(e, redo, cmp, lsn, prev)				\
 	if (DB_REDO(redo) && (cmp) < 0 &&				\
-	    !IS_NOT_LOGGED_LSN(*(lsn)) && !IS_ZERO_LSN(*(lsn))) {	\
-		ret = __db_check_lsn(dbenv, lsn, prev);			\
+	    ((!IS_NOT_LOGGED_LSN(*(lsn)) && !IS_ZERO_LSN(*(lsn))) ||	\
+	    IS_REP_CLIENT(e))) {					\
+		ret = __db_check_lsn(e, lsn, prev);			\
 		goto out;						\
 	}
 #else
-#define	CHECK_LSN(redo, cmp, lsn, prev)					\
-	if (DB_REDO(redo) && (cmp) < 0 && !IS_NOT_LOGGED_LSN(*(lsn))) {	\
-		ret = __db_check_lsn(dbenv, lsn, prev);			\
+#define	CHECK_LSN(e, redo, cmp, lsn, prev)				\
+	if (DB_REDO(redo) && (cmp) < 0 &&				\
+	    (!IS_NOT_LOGGED_LSN(*(lsn)) || IS_REP_CLIENT(e))) {		\
+		ret = __db_check_lsn(e, lsn, prev);			\
 		goto out;						\
 	}
 #endif
@@ -341,17 +385,19 @@ struct __db_filestart {
 /*
  * Internal macro to set pointer to the begin_lsn for generated
  * logging routines.  If begin_lsn is already set then do nothing.
+ * Return a pointer to the last lsn too.
  */
-#undef DB_SET_BEGIN_LSNP
-#define	DB_SET_BEGIN_LSNP(txn, rlsnp) do {				\
+#undef DB_SET_TXN_LSNP
+#define	DB_SET_TXN_LSNP(txn, blsnp, llsnp) do {				\
 	DB_LSN *__lsnp;							\
 	TXN_DETAIL *__td;						\
-	__td = R_ADDR(&(txn)->mgrp->reginfo, (txn)->off);		\
+	__td = (txn)->td;						\
+	*(llsnp) = &__td->last_lsn;					\
 	while (__td->parent != INVALID_ROFF)				\
 		__td = R_ADDR(&(txn)->mgrp->reginfo, __td->parent);	\
 	__lsnp = &__td->begin_lsn;					\
 	if (IS_ZERO_LSN(*__lsnp))					\
-		*(rlsnp) = __lsnp;					\
+		*(blsnp) = __lsnp;					\
 } while (0)
 
 /*
@@ -373,7 +419,11 @@ typedef enum {
 	DB_LV_OLD_UNREADABLE
 } logfile_validity;
 
+#if defined(__cplusplus)
+}
+#endif
+
 #include "dbinc_auto/dbreg_auto.h"
 #include "dbinc_auto/dbreg_ext.h"
 #include "dbinc_auto/log_ext.h"
-#endif /* !_LOG_H_ */
+#endif /* !_DB_LOG_H_ */
diff --git a/db/dbinc/mp.h b/db/dbinc/mp.h
index 871bd6df9..7c4bed813 100644
--- a/db/dbinc/mp.h
+++ b/db/dbinc/mp.h
@@ -1,16 +1,22 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: mp.h,v 11.61 2004/09/17 22:00:27 mjc Exp $
+ * $Id: mp.h,v 12.23 2006/09/07 15:11:26 mjc Exp $
  */
 
 #ifndef	_DB_MP_H_
 #define	_DB_MP_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 struct __bh;		typedef struct __bh BH;
+struct __bh_frozen;	typedef struct __bh_frozen_p BH_FROZEN_PAGE;
+struct __bh_frozen_a;	typedef struct __bh_frozen_a BH_FROZEN_ALLOC;
 struct __db_mpool_hash; typedef struct __db_mpool_hash DB_MPOOL_HASH;
 struct __db_mpreg;	typedef struct __db_mpreg DB_MPREG;
 struct __mpool;		typedef struct __mpool MPOOL;
@@ -42,9 +48,14 @@ typedef enum {
  */
 struct __db_mpool {
 	/* These fields need to be protected for multi-threaded support. */
-	DB_MUTEX   *mutexp;		/* Structure thread lock. */
+	db_mutex_t mutex;		/* Thread mutex. */
 
-					/* List of pgin/pgout routines. */
+	/*
+	 * DB_MPREG structure for the DB pgin/pgout routines.
+	 *
+	 * Linked list of application-specified pgin/pgout routines.
+	 */
+	DB_MPREG *pg_inout;
 	LIST_HEAD(__db_mpregh, __db_mpreg) dbregq;
 
 					/* List of DB_MPOOLFILE's. */
@@ -85,7 +96,8 @@ struct __db_mpreg {
  *	more frequent than a random data page.
  */
 #define	NCACHE(mp, mf_offset, pgno)					\
-	(((pgno) ^ ((u_int32_t)(mf_offset) >> 3)) % ((MPOOL *)mp)->nreg)
+	(((MPOOL *)mp)->nreg == 1 ? 0 :					\
+	(((pgno) ^ ((u_int32_t)(mf_offset) >> 3)) % ((MPOOL *)mp)->nreg))
 
 /*
  * NBUCKET --
@@ -102,6 +114,34 @@ struct __db_mpreg {
 #define	NBUCKET(mc, mf_offset, pgno)					\
 	(((pgno) ^ ((mf_offset) << 9)) % (mc)->htab_buckets)
 
+/*
+ * File hashing --
+ *	We hash each file to hash bucket based on its fileid
+ *	or, in the case of in memory files, its name.
+ */
+
+/* Number of file hash buckets, a small prime number */
+#define	MPOOL_FILE_BUCKETS	17
+
+#define	FHASH(id, len)	__ham_func5(NULL, id, (u_int32_t)(len))
+
+#define	FNBUCKET(id, len)						\
+	(FHASH(id, len) % MPOOL_FILE_BUCKETS)
+
+/* Macros to lock/unlock the mpool region as a whole. */
+#define	MPOOL_SYSTEM_LOCK(dbenv)					\
+	MUTEX_LOCK(dbenv, ((MPOOL *)					\
+	    (dbenv)->mp_handle->reginfo[0].primary)->mtx_region)
+#define	MPOOL_SYSTEM_UNLOCK(dbenv)					\
+	MUTEX_UNLOCK(dbenv, ((MPOOL *)					\
+	    (dbenv)->mp_handle->reginfo[0].primary)->mtx_region)
+
+/* Macros to lock/unlock a specific mpool region. */
+#define	MPOOL_REGION_LOCK(dbenv, infop)					\
+	MUTEX_LOCK(dbenv, ((MPOOL *)(infop)->primary)->mtx_region)
+#define	MPOOL_REGION_UNLOCK(dbenv, infop)				\
+	MUTEX_UNLOCK(dbenv, ((MPOOL *)(infop)->primary)->mtx_region)
+
 /*
  * MPOOL --
  *	Shared memory pool region.
@@ -117,6 +157,7 @@ struct __mpool {
 	 * the first of these pieces/files describes the entire pool, the
 	 * second only describe a piece of the cache.
 	 */
+	db_mutex_t	mtx_region;	/* Region mutex. */
 
 	/*
 	 * The lsn field and list of underlying MPOOLFILEs are thread protected
@@ -124,8 +165,6 @@ struct __mpool {
 	 */
 	DB_LSN	  lsn;			/* Maximum checkpoint LSN. */
 
-	SH_TAILQ_HEAD(__mpfq) mpfq;	/* List of MPOOLFILEs. */
-
 	/* Configuration information: protected by the region lock. */
 	size_t mp_mmapsize;		/* Maximum file size for mmap. */
 	int    mp_maxopenfd;		/* Maximum open file descriptors. */
@@ -140,10 +179,6 @@ struct __mpool {
 	u_int32_t nreg;			/* Number of underlying REGIONS. */
 	roff_t	  regids;		/* Array of underlying REGION Ids. */
 
-#ifdef HAVE_MUTEX_SYSTEM_RESOURCES
-	roff_t	  maint_off;		/* Maintenance information offset */
-#endif
-
 	/*
 	 * The following structure fields only describe the per-cache portion
 	 * of the region.
@@ -157,7 +192,9 @@ struct __mpool {
 	u_int32_t htab_buckets;	/* Number of hash table entries. */
 	roff_t	  htab;		/* Hash table offset. */
 	u_int32_t last_checked;	/* Last bucket checked for free. */
-	u_int32_t lru_count;		/* Counter for buffer LRU */
+	u_int32_t lru_count;	/* Counter for buffer LRU */
+
+	roff_t	  ftab;		/* Hash table of files. */
 
 	/*
 	 * The stat fields are generally not thread protected, and cannot be
@@ -173,26 +210,32 @@ struct __mpool {
 	 * if it changes.
 	 */
 	u_int32_t  put_counter;		/* Count of page put calls. */
+
+	/* Free frozen buffer headers, protected by the region lock. */
+	SH_TAILQ_HEAD(__free_frozen) free_frozen;
+
+	/* Allocated blocks of frozen buffer headers. */
+	SH_TAILQ_HEAD(__alloc_frozen) alloc_frozen;
 };
 
 struct __db_mpool_hash {
-	DB_MUTEX	hash_mutex;	/* Per-bucket mutex. */
+	db_mutex_t	mtx_hash;	/* Per-bucket mutex. */
+	db_mutex_t	mtx_io;		/* Buffer I/O mutex. */
 
 	DB_HASHTAB	hash_bucket;	/* Head of bucket. */
 
 	u_int32_t	hash_page_dirty;/* Count of dirty pages. */
 	u_int32_t	hash_priority;	/* Minimum priority of bucket buffer. */
 
-#ifdef	HPUX_MUTEX_PAD
-	/*
-	 * !!!
-	 * We allocate the mpool hash buckets as an array, which means that
-	 * they are not individually aligned.  This fails on one platform:
-	 * HPUX 10.20, where mutexes require 16 byte alignment.   This is a
-	 * grievous hack for that single platform.
-	 */
-	u_int8_t	pad[HPUX_MUTEX_PAD];
-#endif
+	u_int32_t	hash_io_wait;	/* Count of I/O waits. */
+	u_int32_t	hash_frozen;	/* Count of frozen buffers. */
+	u_int32_t	hash_thawed;	/* Count of thawed buffers. */
+	u_int32_t	hash_frozen_freed;/* Count of freed frozen buffers. */
+
+	DB_LSN		old_reader;	/* Oldest snapshot reader (cached). */
+
+#define	IO_WAITER	0x001		/* Thread is waiting on page. */
+	u_int32_t	flags;
 };
 
 /*
@@ -218,14 +261,33 @@ struct __db_mpool_hash {
  *	Shared DB_MPOOLFILE information.
  */
 struct __mpoolfile {
-	DB_MUTEX mutex;
+	db_mutex_t mutex;		/* MPOOLFILE mutex. */
 
 	/* Protected by MPOOLFILE mutex. */
 	u_int32_t mpf_cnt;		/* Ref count: DB_MPOOLFILEs. */
 	u_int32_t block_cnt;		/* Ref count: blocks in cache. */
+	db_pgno_t last_pgno;		/* Last page in the file. */
+	db_pgno_t last_flushed_pgno;	/* Last page flushed to disk. */
+	db_pgno_t orig_last_pgno;	/* Original last page in the file. */
+	db_pgno_t maxpgno;		/* Maximum page number. */
 
 	roff_t	  path_off;		/* File name location. */
 
+	/* Protected by hash bucket mutex. */
+	SH_TAILQ_ENTRY q;		/* List of MPOOLFILEs */
+
+	/*
+	 * The following are used for file compaction processing.
+	 * They are only used when a thread is in the process
+	 * of trying to move free pages to the end of the file.
+	 * Other threads may look here when freeing a page.
+	 * Protected by a lock on the metapage.
+	 */
+	u_int32_t free_ref;		/* Refcount to freelist. */
+	u_int32_t free_cnt;		/* Count of free pages. */
+	size_t	  free_size;		/* Allocated size of free list. */
+	roff_t	  free_list;		/* Offset to free list. */
+
 	/*
 	 * We normally don't lock the deadfile field when we read it since we
 	 * only care if the field is zero or non-zero.  We do lock on read when
@@ -233,11 +295,7 @@ struct __mpoolfile {
 	 */
 	int32_t	  deadfile;		/* Dirty pages can be discarded. */
 
-	/* Protected by mpool cache 0 region lock. */
-	SH_TAILQ_ENTRY q;		/* List of MPOOLFILEs */
-	db_pgno_t last_pgno;		/* Last page in the file. */
-	db_pgno_t orig_last_pgno;	/* Original last page in the file. */
-	db_pgno_t maxpgno;		/* Maximum page number. */
+	u_int32_t bucket;		/* hash bucket for this file. */
 
 	/*
 	 * None of the following fields are thread protected.
@@ -276,6 +334,7 @@ struct __mpoolfile {
 	int32_t	  file_written;		/* File was written. */
 	int32_t	  no_backing_file;	/* Never open a backing file. */
 	int32_t	  unlink_on_close;	/* Unlink file on last close. */
+	int32_t	  multiversion;		/* Number of DB_MULTIVERSION handles. */
 
 	/*
 	 * We do not protect the statistics in "stat" because of the cost of
@@ -316,31 +375,38 @@ struct __mpoolfile {
  * Flags to __memp_bh_free.
  */
 #define	BH_FREE_FREEMEM		0x01
-#define	BH_FREE_UNLOCKED	0x02
+#define	BH_FREE_REUSE		0x02
+#define	BH_FREE_UNLOCKED	0x04
 
 /*
  * BH --
  *	Buffer header.
  */
 struct __bh {
-	DB_MUTEX	mutex;		/* Buffer thread/process lock. */
-
 	u_int16_t	ref;		/* Reference count. */
 	u_int16_t	ref_sync;	/* Sync wait-for reference count. */
 
 #define	BH_CALLPGIN	0x001		/* Convert the page before use. */
-#define	BH_DIRTY	0x002		/* Page was modified. */
-#define	BH_DIRTY_CREATE	0x004		/* Page created, must be written. */
+#define	BH_DIRTY	0x002		/* Page is modified. */
+#define	BH_DIRTY_CREATE	0x004		/* Page is modified. */
 #define	BH_DISCARD	0x008		/* Page is useless. */
-#define	BH_LOCKED	0x010		/* Page is locked (I/O in progress). */
-#define	BH_TRASH	0x020		/* Page is garbage. */
+#define	BH_FREED	0x010		/* Page was freed. */
+#define	BH_FROZEN	0x020		/* Frozen buffer: allocate & re-read. */
+#define	BH_LOCKED	0x040		/* Page is locked (I/O in progress). */
+#define	BH_TRASH	0x080		/* Page is garbage. */
 	u_int16_t	flags;
 
 	u_int32_t	priority;	/* LRU priority. */
 	SH_TAILQ_ENTRY	hq;		/* MPOOL hash bucket queue. */
 
-	db_pgno_t pgno;			/* Underlying MPOOLFILE page number. */
-	roff_t	  mf_offset;		/* Associated MPOOLFILE offset. */
+	db_pgno_t	pgno;		/* Underlying MPOOLFILE page number. */
+	roff_t		mf_offset;	/* Associated MPOOLFILE offset. */
+
+	roff_t		td_off;		/* MVCC: creating TXN_DETAIL offset. */
+	SH_CHAIN_ENTRY	vc;		/* MVCC: version chain. */
+#ifdef DIAG_MVCC
+	u_int16_t	align_off;	/* Alignment offset for diagnostics.*/
+#endif
 
 	/*
 	 * !!!
@@ -352,5 +418,117 @@ struct __bh {
 	u_int8_t   buf[1];		/* Variable length data. */
 };
 
+/*
+ * BH_FROZEN_PAGE --
+ *	Data used to find a frozen buffer header.
+ */
+struct __bh_frozen_p {
+	BH header;
+	db_pgno_t	spgno;		/* Page number in freezer file. */
+};
+
+/*
+ * BH_FROZEN_ALLOC --
+ *	Frozen buffer headers are allocated a page at a time in general.  This
+ *	structure is allocated at the beginning of the page so that the
+ *	allocation chunks can be tracked and freed (for private environments).
+ */
+struct __bh_frozen_a {
+	SH_TAILQ_ENTRY links;
+};
+
+#define	MULTIVERSION(dbp)	((dbp)->mpf->mfp->multiversion)
+#define	IS_DIRTY(p)							\
+    F_ISSET((BH *)((u_int8_t *)(p) - SSZA(BH, buf)), BH_DIRTY)
+
+#define	BH_OWNER(dbenv, bhp)						\
+    ((TXN_DETAIL *)R_ADDR(&dbenv->tx_handle->reginfo, bhp->td_off))
+
+#define	BH_OWNED_BY(dbenv, bhp, txn)	((txn) != NULL &&		\
+    (bhp)->td_off != INVALID_ROFF &&					\
+    (txn)->td == BH_OWNER(dbenv, bhp))
+
+#define	BH_PRIORITY(bhp)						\
+    (SH_CHAIN_SINGLETON(bhp, vc) ? (bhp)->priority :			\
+     __memp_bh_priority(bhp))
+
+#define	VISIBLE_LSN(dbenv, bhp)						\
+    (&BH_OWNER(dbenv, bhp)->visible_lsn)
+
+#define	BH_OBSOLETE(bhp, old_lsn)	((SH_CHAIN_HASNEXT(bhp, vc) ?	\
+	LOG_COMPARE(&(old_lsn), VISIBLE_LSN(dbenv,			\
+	SH_CHAIN_NEXTP(bhp, vc, __bh))) :				\
+	(bhp->td_off == INVALID_ROFF ? 1 :				\
+	LOG_COMPARE(&(old_lsn), VISIBLE_LSN(dbenv, bhp)))) > 0)
+
+#define	MVCC_SKIP_CURADJ(dbc, pgno)					\
+    (dbc->txn != NULL && F_ISSET(dbc->txn, TXN_SNAPSHOT) &&		\
+    dbc->txn->td != NULL && __memp_skip_curadj(dbc, pgno))
+
+#if defined(DIAG_MVCC) && defined(HAVE_MPROTECT)
+#define	VM_PAGESIZE 4096
+#define	MVCC_BHSIZE(mfp, sz) do {					\
+	sz += VM_PAGESIZE + sizeof(BH);					\
+	if (mfp->stat.st_pagesize < VM_PAGESIZE)			\
+		sz += VM_PAGESIZE - mfp->stat.st_pagesize;		\
+} while (0)
+
+#define	MVCC_BHALIGN(mfp, p) do {					\
+	if (mfp != NULL) {						\
+		BH *__bhp;						\
+		void *__orig = (p);					\
+		p = ALIGNP_INC(p, VM_PAGESIZE);				\
+		if ((u_int8_t *)p < (u_int8_t *)__orig + sizeof(BH))	\
+			p = (u_int8_t *)p + VM_PAGESIZE;		\
+		__bhp = (BH *)((u_int8_t *)p - SSZA(BH, buf));		\
+		DB_ASSERT(dbenv,					\
+		    ((uintptr_t)__bhp->buf & (VM_PAGESIZE - 1)) == 0);	\
+		DB_ASSERT(dbenv,					\
+		    (u_int8_t *)__bhp >= (u_int8_t *)__orig);		\
+		DB_ASSERT(dbenv, (u_int8_t *)p + mfp->stat.st_pagesize <\
+		    (u_int8_t *)__orig + len);				\
+		__bhp->align_off =					\
+		    (u_int16_t)((u_int8_t *)__bhp - (u_int8_t *)__orig);\
+		p = __bhp;						\
+	}								\
+} while (0)
+
+#define	MVCC_BHUNALIGN(mfp, p) do {					\
+	if ((mfp) != NULL) {						\
+		BH *bhp = (BH *)(p);					\
+		(p) = ((u_int8_t *)bhp - bhp->align_off);		\
+	}								\
+} while (0)
+
+#ifdef linux
+#define	MVCC_MPROTECT(buf, sz, mode) do {				\
+	int __ret = mprotect((buf), (sz), (mode));			\
+	DB_ASSERT(dbenv, __ret == 0);					\
+} while (0)
+#else
+#define	MVCC_MPROTECT(buf, sz, mode) do {				\
+	if (!F_ISSET(dbenv, DB_ENV_PRIVATE | DB_ENV_SYSTEM_MEM)) {	\
+		int __ret = mprotect((buf), (sz), (mode));		\
+		DB_ASSERT(dbenv, __ret == 0);				\
+	}								\
+} while (0)
+#endif /* linux */
+
+#else /* defined(DIAG_MVCC) && defined(HAVE_MPROTECT) */
+#define	MVCC_BHSIZE(mfp, sz) do {} while (0)
+#define	MVCC_BHALIGN(mfp, p) do {} while (0)
+#define	MVCC_BHUNALIGN(mfp, p) do {} while (0)
+#define	MVCC_MPROTECT(buf, size, mode) do {} while (0)
+#endif
+
+/*
+ * Flags to __memp_ftruncate.
+ */
+#define	MP_TRUNC_RECOVER	0x01
+
+#if defined(__cplusplus)
+}
+#endif
+
 #include "dbinc_auto/mp_ext.h"
 #endif /* !_DB_MP_H_ */
diff --git a/db/dbinc/mutex.h b/db/dbinc/mutex.h
index 056d34bab..3adf150a0 100644
--- a/db/dbinc/mutex.h
+++ b/db/dbinc/mutex.h
@@ -1,296 +1,118 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: mutex.h,v 11.100 2004/10/05 14:41:12 mjc Exp $
+ * $Id: mutex.h,v 12.20 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef _DB_MUTEX_H_
 #define	_DB_MUTEX_H_
 
-/*
- * Some of the Berkeley DB ports require single-threading at various
- * places in the code.  In those cases, these #defines will be set.
- */
-#define	DB_BEGIN_SINGLE_THREAD
-#define	DB_END_SINGLE_THREAD
-
-/*********************************************************************
- * POSIX.1 pthreads interface.
- *********************************************************************/
-#ifdef HAVE_MUTEX_PTHREADS
-#include 
-
-#define	MUTEX_FIELDS							\
-	pthread_mutex_t mutex;		/* Mutex. */			\
-	pthread_cond_t  cond;		/* Condition variable. */
-#endif
-
-/*********************************************************************
- * Solaris lwp threads interface.
- *
- * !!!
- * We use LWP mutexes on Solaris instead of UI or POSIX mutexes (both of
- * which are available), for two reasons.  First, the Solaris C library
- * includes versions of the both UI and POSIX thread mutex interfaces, but
- * they are broken in that they don't support inter-process locking, and
- * there's no way to detect it, e.g., calls to configure the mutexes for
- * inter-process locking succeed without error.  So, we use LWP mutexes so
- * that we don't fail in fairly undetectable ways because the application
- * wasn't linked with the appropriate threads library.  Second, there were
- * bugs in SunOS 5.7 (Solaris 7) where if an application loaded the C library
- * before loading the libthread/libpthread threads libraries (e.g., by using
- * dlopen to load the DB library), the pwrite64 interface would be translated
- * into a call to pwrite and DB would drop core.
- *********************************************************************/
-#ifdef HAVE_MUTEX_SOLARIS_LWP
-/*
- * XXX
- * Don't change  to  -- although lwp.h is listed in the
- * Solaris manual page as the correct include to use, it causes the Solaris
- * compiler on SunOS 2.6 to fail.
- */
-#include 
-
-#define	MUTEX_FIELDS							\
-	lwp_mutex_t mutex;		/* Mutex. */			\
-	lwp_cond_t cond;		/* Condition variable. */
-#endif
-
-/*********************************************************************
- * Solaris/Unixware threads interface.
- *********************************************************************/
-#ifdef HAVE_MUTEX_UI_THREADS
-#include 
-#include 
-
-#define	MUTEX_FIELDS							\
-	mutex_t mutex;			/* Mutex. */			\
-	cond_t  cond;			/* Condition variable. */
-#endif
-
-/*********************************************************************
- * AIX C library functions.
- *********************************************************************/
-#ifdef HAVE_MUTEX_AIX_CHECK_LOCK
-#include 
-typedef int tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	sizeof(int)
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_INIT(x)	0
-#define	MUTEX_SET(x)	(!_check_lock(x, 0, 1))
-#define	MUTEX_UNSET(x)	_clear_lock(x, 0)
-#endif
-#endif
-
-/*********************************************************************
- * Apple/Darwin library functions.
- *********************************************************************/
-#ifdef HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY
-typedef u_int32_t tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	sizeof(int)
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-extern int _spin_lock_try(tsl_t *);
-extern void _spin_unlock(tsl_t *);
-#define	MUTEX_SET(tsl)          _spin_lock_try(tsl)
-#define	MUTEX_UNSET(tsl)        _spin_unlock(tsl)
-#define	MUTEX_INIT(tsl)         (MUTEX_UNSET(tsl), 0)
-#endif
-#endif
-
-/*********************************************************************
- * General C library functions (msemaphore).
- *
- * !!!
- * Check for HPPA as a special case, because it requires unusual alignment,
- * and doesn't support semaphores in malloc(3) or shmget(2) memory.
- *
- * !!!
- * Do not remove the MSEM_IF_NOWAIT flag.  The problem is that if a single
- * process makes two msem_lock() calls in a row, the second one returns an
- * error.  We depend on the fact that we can lock against ourselves in the
- * locking subsystem, where we set up a mutex so that we can block ourselves.
- * Tested on OSF1 v4.0.
- *********************************************************************/
-#ifdef HAVE_MUTEX_HPPA_MSEM_INIT
-#define	MUTEX_NO_MALLOC_LOCKS
-#define	MUTEX_NO_SHMGET_LOCKS
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	16
-#define	HPUX_MUTEX_PAD	 8
-#endif
-#endif
-
-#if defined(HAVE_MUTEX_MSEM_INIT) || defined(HAVE_MUTEX_HPPA_MSEM_INIT)
-#include 
-typedef msemaphore tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	sizeof(int)
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_INIT(x)	(msem_init(x, MSEM_UNLOCKED) <= (msemaphore *)0)
-#define	MUTEX_SET(x)	(!msem_lock(x, MSEM_IF_NOWAIT))
-#define	MUTEX_UNSET(x)	msem_unlock(x, 0)
-#endif
-#endif
-
-/*********************************************************************
- * Plan 9 library functions.
- *********************************************************************/
-#ifdef HAVE_MUTEX_PLAN9
-typedef Lock tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	sizeof(int)
-#endif
-
-#define	MUTEX_INIT(x)	(memset(x, 0, sizeof(Lock)), 0)
-#define	MUTEX_SET(x)	canlock(x)
-#define	MUTEX_UNSET(x)	unlock(x)
-#endif
-
-/*********************************************************************
- * Reliant UNIX C library functions.
- *********************************************************************/
-#ifdef HAVE_MUTEX_RELIANTUNIX_INITSPIN
-#include 
-typedef spinlock_t tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_INIT(x)	(initspin(x, 1), 0)
-#define	MUTEX_SET(x)	(cspinlock(x) == 0)
-#define	MUTEX_UNSET(x)	spinunlock(x)
-#endif
-#endif
-
-/*********************************************************************
- * General C library functions (POSIX 1003.1 sema_XXX).
- *
- * !!!
- * Never selected by autoconfig in this release (semaphore calls are known
- * to not work in Solaris 5.5).
- *********************************************************************/
-#ifdef HAVE_MUTEX_SEMA_INIT
-#include 
-typedef sema_t tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	 sizeof(int)
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*
+ * Mutexes are represented by unsigned, 32-bit integral values.  As the
+ * OOB value is 0, mutexes can be initialized by zero-ing out the memory
+ * in which they reside.
+ */
+#define	MUTEX_INVALID	0
+
+/*
+ * We track mutex allocations by ID.
+ */
+#define	MTX_APPLICATION		 1
+#define	MTX_DB_HANDLE		 2
+#define	MTX_ENV_DBLIST		 3
+#define	MTX_ENV_REGION		 4
+#define	MTX_LOCK_REGION		 5
+#define	MTX_LOGICAL_LOCK	 6
+#define	MTX_LOG_FILENAME	 7
+#define	MTX_LOG_FLUSH		 8
+#define	MTX_LOG_HANDLE		 9
+#define	MTX_LOG_REGION		10
+#define	MTX_MPOOLFILE_HANDLE	11
+#define	MTX_MPOOL_FH		12
+#define	MTX_MPOOL_FILE_BUCKET	13
+#define	MTX_MPOOL_HANDLE	14
+#define	MTX_MPOOL_HASH_BUCKET	15
+#define	MTX_MPOOL_IO		16
+#define	MTX_MPOOL_REGION	17
+#define	MTX_MUTEX_REGION	18
+#define	MTX_MUTEX_TEST		19
+#define	MTX_REP_DATABASE	20
+#define	MTX_REP_REGION		21
+#define	MTX_SEQUENCE		22
+#define	MTX_TWISTER		23
+#define	MTX_TXN_ACTIVE		24
+#define	MTX_TXN_CHKPT		25
+#define	MTX_TXN_COMMIT		26
+#define	MTX_TXN_MVCC		27
+#define	MTX_TXN_REGION		28
+#define	MTX_MAX_ENTRY		28
+
+/* Redirect mutex calls to the correct functions. */
+#if defined(HAVE_MUTEX_PTHREADS) ||					\
+    defined(HAVE_MUTEX_SOLARIS_LWP) ||					\
+    defined(HAVE_MUTEX_UI_THREADS)
+#define	__mutex_init(a, b, c)		__db_pthread_mutex_init(a, b, c)
+#define	__mutex_lock(a, b)		__db_pthread_mutex_lock(a, b)
+#define	__mutex_unlock(a, b)		__db_pthread_mutex_unlock(a, b)
+#define	__mutex_destroy(a, b)		__db_pthread_mutex_destroy(a, b)
 #endif
 
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_DESTROY(x) sema_destroy(x)
-#define	MUTEX_INIT(x)	 (sema_init(x, 1, USYNC_PROCESS, NULL) != 0)
-#define	MUTEX_SET(x)	 (sema_wait(x) == 0)
-#define	MUTEX_UNSET(x)	 sema_post(x)
-#endif
+#if defined(HAVE_MUTEX_WIN32) || defined(HAVE_MUTEX_WIN32_GCC)
+#define	__mutex_init(a, b, c)		__db_win32_mutex_init(a, b, c)
+#define	__mutex_lock(a, b)		__db_win32_mutex_lock(a, b)
+#define	__mutex_unlock(a, b)		__db_win32_mutex_unlock(a, b)
+#define	__mutex_destroy(a, b)		__db_win32_mutex_destroy(a, b)
 #endif
 
-/*********************************************************************
- * SGI C library functions.
- *********************************************************************/
-#ifdef HAVE_MUTEX_SGI_INIT_LOCK
-#include 
-typedef abilock_t tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	sizeof(int)
+#if defined(HAVE_MUTEX_FCNTL)
+#define	__mutex_init(a, b, c)		__db_fcntl_mutex_init(a, b, c)
+#define	__mutex_lock(a, b)		__db_fcntl_mutex_lock(a, b)
+#define	__mutex_unlock(a, b)		__db_fcntl_mutex_unlock(a, b)
+#define	__mutex_destroy(a, b)		__db_fcntl_mutex_destroy(a, b)
 #endif
 
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_INIT(x)	(init_lock(x) != 0)
-#define	MUTEX_SET(x)	(!acquire_lock(x))
-#define	MUTEX_UNSET(x)	release_lock(x)
-#endif
+#ifndef __mutex_init			/* Test-and-set is the default */
+#define	__mutex_init(a, b, c)		__db_tas_mutex_init(a, b, c)
+#define	__mutex_lock(a, b)		__db_tas_mutex_lock(a, b)
+#define	__mutex_unlock(a, b)		__db_tas_mutex_unlock(a, b)
+#define	__mutex_destroy(a, b)		__db_tas_mutex_destroy(a, b)
 #endif
 
-/*********************************************************************
- * Solaris C library functions.
+/*
+ * Lock/unlock a mutex.  If the mutex was never required, the thread of
+ * control can proceed without it.
  *
- * !!!
- * These are undocumented functions, but they're the only ones that work
- * correctly as far as we know.
- *********************************************************************/
-#ifdef HAVE_MUTEX_SOLARIS_LOCK_TRY
-#include 
-typedef lock_t tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	sizeof(int)
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_INIT(x)	0
-#define	MUTEX_SET(x)	_lock_try(x)
-#define	MUTEX_UNSET(x)	_lock_clear(x)
-#endif
-#endif
-
-/*********************************************************************
- * VMS.
- *********************************************************************/
-#ifdef HAVE_MUTEX_VMS
-#include ;
-#include 
-typedef volatile unsigned char tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN		sizeof(unsigned int)
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#ifdef __ALPHA
-#define	MUTEX_SET(tsl)		(!__TESTBITSSI(tsl, 0))
-#else /* __VAX */
-#define	MUTEX_SET(tsl)		(!(int)_BBSSI(0, tsl))
-#endif
-#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
+ * We never fail to acquire or release a mutex without panicing.  Simplify
+ * the macros to always return a panic value rather than saving the actual
+ * return value of the mutex routine.
+ */
+#define	MUTEX_LOCK(dbenv, mutex) do {					\
+	if ((mutex) != MUTEX_INVALID &&					\
+	    __mutex_lock(dbenv, mutex) != 0)				\
+		return (DB_RUNRECOVERY);				\
+} while (0)
+#define	MUTEX_UNLOCK(dbenv, mutex) do {					\
+	if ((mutex) != MUTEX_INVALID &&					\
+	    __mutex_unlock(dbenv, mutex) != 0)				\
+		return (DB_RUNRECOVERY);				\
+} while (0)
 
-/*********************************************************************
- * VxWorks
- * Use basic binary semaphores in VxWorks, as we currently do not need
- * any special features.  We do need the ability to single-thread the
- * entire system, however, because VxWorks doesn't support the open(2)
- * flag O_EXCL, the mechanism we normally use to single thread access
- * when we're first looking for a DB environment.
- *********************************************************************/
+/*
+ * Berkeley DB ports may require single-threading at places in the code.
+ */
 #ifdef HAVE_MUTEX_VXWORKS
 #include "taskLib.h"
-typedef SEM_ID tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN		sizeof(unsigned int)
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_SET(tsl)		(semTake((*tsl), WAIT_FOREVER) == OK)
-#define	MUTEX_UNSET(tsl)	(semGive((*tsl)))
-#define	MUTEX_INIT(tsl)							\
-	((*(tsl) = semBCreate(SEM_Q_FIFO, SEM_FULL)) == NULL)
-#define	MUTEX_DESTROY(tsl)	semDelete(*tsl)
-#endif
-
 /*
  * Use the taskLock() mutex to eliminate a race where two tasks are
  * trying to initialize the global lock at the same time.
  */
-#undef	DB_BEGIN_SINGLE_THREAD
 #define	DB_BEGIN_SINGLE_THREAD do {					\
 	if (DB_GLOBAL(db_global_init))					\
 		(void)semTake(DB_GLOBAL(db_global_lock), WAIT_FOREVER);	\
@@ -309,673 +131,22 @@ typedef SEM_ID tsl_t;
 		taskUnlock();						\
 	}								\
 } while (DB_GLOBAL(db_global_init) == 0)
-#undef	DB_END_SINGLE_THREAD
 #define	DB_END_SINGLE_THREAD	(void)semGive(DB_GLOBAL(db_global_lock))
 #endif
 
-/*********************************************************************
- * Win16
- *
- * Win16 spinlocks are simple because we cannot possibly be preempted.
- *
- * !!!
- * We should simplify this by always returning a no-need-to-lock lock
- * when we initialize the mutex.
- *********************************************************************/
-#ifdef HAVE_MUTEX_WIN16
-typedef unsigned int tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN		sizeof(unsigned int)
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_INIT(x)		0
-#define	MUTEX_SET(tsl)		(*(tsl) = 1)
-#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
-#endif
-#endif
-
-/*********************************************************************
- * Win32
- *********************************************************************/
-#if defined(HAVE_MUTEX_WIN32) || defined(HAVE_MUTEX_WIN32_GCC)
-#define	MUTEX_FIELDS							\
-	LONG tas;							\
-	LONG nwaiters;							\
-	u_int32_t id;	/* ID used for creating events */		\
-
-#if defined(LOAD_ACTUAL_MUTEX_CODE)
-#define	MUTEX_SET(tsl)		(!InterlockedExchange((PLONG)tsl, 1))
-#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-
-/*
- * From Intel's performance tuning documentation (and see SR #6975):
- * ftp://download.intel.com/design/perftool/cbts/appnotes/sse2/w_spinlock.pdf
- *
- * "For this reason, it is highly recommended that you insert the PAUSE
- * instruction into all spin-wait code immediately. Using the PAUSE
- * instruction does not affect the correctness of programs on existing
- * platforms, and it improves performance on Pentium 4 processor platforms."
- */
-#ifdef HAVE_MUTEX_WIN32
-#ifndef _WIN64
-#define	MUTEX_PAUSE		{__asm{_emit 0xf3}; __asm{_emit 0x90}}
-#endif
-#endif
-#ifdef HAVE_MUTEX_WIN32_GCC
-#define	MUTEX_PAUSE		asm volatile ("rep; nop" : : );
-#endif
-#endif
-#endif
-
-/*********************************************************************
- * 68K/gcc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_68K_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_SET_TEST	1		/* gcc/68K: 0 is clear, 1 is set. */
-
-#define	MUTEX_SET(tsl) ({						\
-	register tsl_t *__l = (tsl);					\
-	int __r;							\
-	    asm volatile("tas  %1; \n					\
-			  seq  %0"					\
-		: "=dm" (__r), "=m" (*__l)				\
-		: "1" (*__l)						\
-		);							\
-	__r & 1;							\
-})
-
-#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
- * ALPHA/gcc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY
-typedef u_int32_t tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	4
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-/*
- * For gcc/alpha.  Should return 0 if could not acquire the lock, 1 if
- * lock was acquired properly.
- */
-static inline int
-MUTEX_SET(tsl_t *tsl) {
-	register tsl_t *__l = tsl;
-	register tsl_t __r;
-	asm volatile(
-		"1:	ldl_l	%0,%2\n"
-		"	blbs	%0,2f\n"
-		"	or	$31,1,%0\n"
-		"	stl_c	%0,%1\n"
-		"	beq	%0,3f\n"
-		"	mb\n"
-		"	br	3f\n"
-		"2:	xor	%0,%0\n"
-		"3:"
-		: "=&r"(__r), "=m"(*__l) : "1"(*__l) : "memory");
-	return __r;
-}
-
-/*
- * Unset mutex. Judging by Alpha Architecture Handbook, the mb instruction
- * might be necessary before unlocking
- */
-static inline int
-MUTEX_UNSET(tsl_t *tsl) {
-	asm volatile("	mb\n");
-	return *tsl = 0;
-}
-
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
- * Tru64/cc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_TRU64_CC_ASSEMBLY
-typedef volatile u_int32_t tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	4
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#include 
-#define	MUTEX_SET(tsl)		(__LOCK_LONG_RETRY((tsl), 1) != 0)
-#define	MUTEX_UNSET(tsl)	(__UNLOCK_LONG(tsl))
-
-#define	MUTEX_INIT(tsl)		(MUTEX_UNSET(tsl), 0)
-#endif
-#endif
-
-/*********************************************************************
- * ARM/gcc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_ARM_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_SET_TEST	1		/* gcc/arm: 0 is clear, 1 is set. */
-
-#define	MUTEX_SET(tsl) ({						\
-	int __r;							\
-	asm volatile(							\
-		"swpb	%0, %1, [%2]\n\t"				\
-		"eor	%0, %0, #1\n\t"					\
-	    : "=&r" (__r)						\
-	    : "r" (1), "r" (tsl)					\
-	    );								\
-	__r & 1;							\
-})
-
-#define	MUTEX_UNSET(tsl)	(*(volatile tsl_t *)(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
- * HPPA/gcc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_HPPA_GCC_ASSEMBLY
-typedef u_int32_t tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	16
-#define	HPUX_MUTEX_PAD	 8
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-/*
- * The PA-RISC has a "load and clear" instead of a "test and set" instruction.
- * The 32-bit word used by that instruction must be 16-byte aligned.  We could
- * use the "aligned" attribute in GCC but that doesn't work for stack variables.
- */
-#define	MUTEX_SET(tsl) ({						\
-	register tsl_t *__l = (tsl);					\
-	int __r;							\
-	asm volatile("ldcws 0(%1),%0" : "=r" (__r) : "r" (__l));	\
-	__r & 1;							\
-})
-
-#define	MUTEX_UNSET(tsl)	(*(tsl) = -1)
-#define	MUTEX_INIT(tsl)		(MUTEX_UNSET(tsl), 0)
-#endif
-#endif
-
-/*********************************************************************
- * IA64/gcc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_IA64_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_SET_TEST	1		/* gcc/ia64: 0 is clear, 1 is set. */
-
-#define	MUTEX_SET(tsl) ({						\
-	register tsl_t *__l = (tsl);					\
-	long __r;							\
-	asm volatile("xchg1 %0=%1,%3" : "=r"(__r), "=m"(*__l) : "1"(*__l), "r"(1));\
-	__r ^ 1;							\
-})
-
-/*
- * Store through a "volatile" pointer so we get a store with "release"
- * semantics.
- */
-#define	MUTEX_UNSET(tsl)	(*(volatile unsigned char *)(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
- * PowerPC/gcc assembly.
- *********************************************************************/
-#if defined(HAVE_MUTEX_PPC_GCC_ASSEMBLY)
-typedef u_int32_t tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
 /*
- * The PowerPC does a sort of pseudo-atomic locking.  You set up a
- * 'reservation' on a chunk of memory containing a mutex by loading the
- * mutex value with LWARX.  If the mutex has an 'unlocked' (arbitrary)
- * value, you then try storing into it with STWCX.  If no other process or
- * thread broke your 'reservation' by modifying the memory containing the
- * mutex, then the STCWX succeeds; otherwise it fails and you try to get
- * a reservation again.
- *
- * While mutexes are explicitly 4 bytes, a 'reservation' applies to an
- * entire cache line, normally 32 bytes, aligned naturally.  If the mutex
- * lives near data that gets changed a lot, there's a chance that you'll
- * see more broken reservations than you might otherwise.  The only
- * situation in which this might be a problem is if one processor is
- * beating on a variable in the same cache block as the mutex while another
- * processor tries to acquire the mutex.  That's bad news regardless
- * because of the way it bashes caches, but if you can't guarantee that a
- * mutex will reside in a relatively quiescent cache line, you might
- * consider padding the mutex to force it to live in a cache line by
- * itself.  No, you aren't guaranteed that cache lines are 32 bytes.  Some
- * embedded processors use 16-byte cache lines, while some 64-bit
- * processors use 128-bit cache lines.  But assuming a 32-byte cache line
- * won't get you into trouble for now.
- *
- * If mutex locking is a bottleneck, then you can speed it up by adding a
- * regular LWZ load before the LWARX load, so that you can test for the
- * common case of a locked mutex without wasting cycles making a reservation.
- *
- * 'set' mutexes have the value 1, like on Intel; the returned value from
- * MUTEX_SET() is 1 if the mutex previously had its low bit clear, 0 otherwise.
+ * Single-threading defaults to a no-op.
  */
-#define	MUTEX_SET_TEST	1		/* gcc/ppc: 0 is clear, 1 is set. */
-
-static inline int
-MUTEX_SET(int *tsl)  {
-         int __r;
-         int __tmp = (int)tsl;
-    asm volatile (
-"0:                             \n\t"
-"       lwarx   %0,0,%2         \n\t"
-"       cmpwi   %0,0            \n\t"
-"       bne-    1f              \n\t"
-"       stwcx.  %2,0,%2         \n\t"
-"       isync                   \n\t"
-"       beq+    2f              \n\t"
-"       b       0b              \n\t"
-"1:                             \n\t"
-"       li      %1, 0           \n\t"
-"2:                             \n\t"
-         : "=&r" (__r), "=r" (tsl)
-         : "r" (__tmp)
-         : "cr0", "memory");
-         return (int)tsl;
-}
-
-static inline int
-MUTEX_UNSET(tsl_t *tsl) {
-         asm volatile("sync" : : : "memory");
-         return *tsl = 0;
-}
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
- * OS/390 C
- *********************************************************************/
-#ifdef HAVE_MUTEX_S390_CC_ASSEMBLY
-typedef int tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	sizeof(int)
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-/*
- * cs() is declared in  but is built in to the compiler.
- * Must use LANGLVL(EXTENDED) to get its declaration.
- */
-#define	MUTEX_SET(tsl)		(!cs(&zero, (tsl), 1))
-#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
- * S/390 32-bit assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_S390_GCC_ASSEMBLY
-typedef int tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_SET_TEST	1		/* gcc/S390: 0 is clear, 1 is set. */
-
-static inline int
-MUTEX_SET(tsl_t *tsl) {							\
-	register tsl_t *__l = (tsl);					\
-	int __r;							\
-  asm volatile(								\
-       "    la    1,%1\n"						\
-       "    lhi   0,1\n"						\
-       "    l     %0,%1\n"						\
-       "0:  cs    %0,0,0(1)\n"						\
-       "    jl    0b"							\
-       : "=&d" (__r), "+m" (*__l)					\
-       : : "0", "1", "cc");						\
-	return !__r;							\
-}
-
-#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
- * SCO/cc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY
-typedef unsigned char tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-/*
- * UnixWare has threads in libthread, but OpenServer doesn't (yet).
- */
-#define	MUTEX_SET_TEST	1		/* cc/x86: 0 is clear, 1 is set. */
-
-#if defined(__USLC__)
-asm int
-_tsl_set(void *tsl)
-{
-%mem tsl
-	movl	tsl, %ecx
-	movl	$1, %eax
-	lock
-	xchgb	(%ecx),%al
-	xorl	$1,%eax
-}
-#endif
-
-#define	MUTEX_SET(tsl)		_tsl_set(tsl)
-#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
- * Sparc/gcc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_SPARC_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-/*
- *
- * The ldstub instruction takes the location specified by its first argument
- * (a register containing a memory address) and loads its contents into its
- * second argument (a register) and atomically sets the contents the location
- * specified by its first argument to a byte of 1s.  (The value in the second
- * argument is never read, but only overwritten.)
- *
- * The stbar is needed for v8, and is implemented as membar #sync on v9,
- * so is functional there as well.  For v7, stbar may generate an illegal
- * instruction and we have no way to tell what we're running on.  Some
- * operating systems notice and skip this instruction in the fault handler.
- */
-#define	MUTEX_SET_TEST	1		/* gcc/sparc: 0 is clear, 1 is set. */
-
-#define	MUTEX_SET(tsl) ({						\
-	register tsl_t *__l = (tsl);					\
-	register tsl_t __r;						\
-	__asm__ volatile						\
-	    ("ldstub [%1],%0; stbar"					\
-	    : "=r"( __r) : "r" (__l));					\
-	!__r;								\
-})
-
-#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
- * UTS/cc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_UTS_CC_ASSEMBLY
-typedef int tsl_t;
-
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	sizeof(int)
-#endif
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_INIT(x)	0
-#define	MUTEX_SET(x)	(!uts_lock(x, 1))
-#define	MUTEX_UNSET(x)	(*(x) = 0)
-#endif
-#endif
-
-/*********************************************************************
- * x86/gcc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_X86_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#define	MUTEX_SET_TEST	1		/* gcc/x86: 0 is clear, 1 is set. */
-
-#define	MUTEX_SET(tsl) ({						\
-	register tsl_t *__l = (tsl);					\
-	int __r;							\
-	asm volatile("movl $1,%%eax; lock; xchgb %1,%%al; xorl $1,%%eax"\
-	    : "=&a" (__r), "=m" (*__l)					\
-	    : "1" (*__l)						\
-	    );								\
-	__r & 1;							\
-})
-
-#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
-#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
-
-/*
- * From Intel's performance tuning documentation (and see SR #6975):
- * ftp://download.intel.com/design/perftool/cbts/appnotes/sse2/w_spinlock.pdf
- *
- * "For this reason, it is highly recommended that you insert the PAUSE
- * instruction into all spin-wait code immediately. Using the PAUSE
- * instruction does not affect the correctness of programs on existing
- * platforms, and it improves performance on Pentium 4 processor platforms."
- */
-#define	MUTEX_PAUSE		asm volatile ("rep; nop" : : );
-#endif
-#endif
-
-/*
- * Mutex alignment defaults to one byte.
- *
- * !!!
- * Various systems require different alignments for mutexes (the worst we've
- * seen so far is 16-bytes on some HP architectures).  Malloc(3) is assumed
- * to return reasonable alignment, all other mutex users must ensure proper
- * alignment locally.
- */
-#ifndef	MUTEX_ALIGN
-#define	MUTEX_ALIGN	1
-#endif
-
-/*
- * Mutex destruction defaults to a no-op.
- */
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-#ifndef	MUTEX_DESTROY
-#define	MUTEX_DESTROY(x)
-#endif
-#endif
-
-/*
- * !!!
- * The flag arguments for __db_mutex_setup (and the underlying initialization
- * function for the mutex type, for example, __db_tas_mutex_init), and flags
- * stored in the DB_MUTEX structure are combined, and may not overlap.  Flags
- * to __db_mutex_setup:
- *
- * MUTEX_ALLOC:
- *	Use when the mutex to initialize needs to be allocated. The 'ptr'
- *	arg to __db_mutex_setup should be a DB_MUTEX ** whenever you use
- *	this flag.  If this flag is not set, the 'ptr' arg is a DB_MUTEX *.
- * MUTEX_NO_RECORD:
- *	Explicitly do not record the mutex in the region.  Otherwise the
- *	mutex will be recorded by default.  If you set this you need to
- *	understand why you don't need it recorded.  The *only* ones not
- *	recorded are those that are part of region structures that only
- *	get destroyed when the regions are destroyed.
- * MUTEX_NO_RLOCK:
- *	Explicitly do not lock the given region otherwise the region will
- *	be locked by default.
- * MUTEX_SELF_BLOCK:
- *	Set if self blocking mutex.
- * MUTEX_THREAD:
- *	Set if mutex is a thread-only mutex.
- */
-#define	MUTEX_ALLOC		0x0001	/* Allocate and init a mutex */
-#define	MUTEX_IGNORE		0x0002	/* Ignore, no lock required. */
-#define	MUTEX_INITED		0x0004	/* Mutex is successfully initialized */
-#define	MUTEX_LOGICAL_LOCK	0x0008	/* Mutex backs database lock. */
-#define	MUTEX_MPOOL		0x0010	/* Allocated from mpool. */
-#define	MUTEX_NO_RECORD		0x0020	/* Do not record lock */
-#define	MUTEX_NO_RLOCK		0x0040	/* Do not acquire region lock */
-#define	MUTEX_SELF_BLOCK	0x0080	/* Must block self. */
-#define	MUTEX_THREAD		0x0100	/* Thread-only mutex. */
-
-/* Mutex. */
-struct __mutex_t {
-#ifdef	HAVE_MUTEX_THREADS
-#ifdef	MUTEX_FIELDS
-	MUTEX_FIELDS
-#else
-	tsl_t	tas;			/* Test and set. */
-#endif
-	u_int32_t locked;		/* !0 if locked. */
-#else
-	u_int32_t off;			/* Byte offset to lock. */
-	u_int32_t pid;			/* Lock holder: 0 or process pid. */
+#ifndef DB_BEGIN_SINGLE_THREAD
+#define	DB_BEGIN_SINGLE_THREAD
 #endif
-	u_int32_t mutex_set_wait;	/* Granted after wait. */
-	u_int32_t mutex_set_nowait;	/* Granted without waiting. */
-	u_int32_t mutex_set_spin;	/* Granted without spinning. */
-	u_int32_t mutex_set_spins;	/* Total number of spins. */
-#ifdef HAVE_MUTEX_SYSTEM_RESOURCES
-	roff_t	  reg_off;		/* Shared lock info offset. */
+#ifndef DB_END_SINGLE_THREAD
+#define	DB_END_SINGLE_THREAD
 #endif
-	/*
-	 * Flags should be an unsigned integer even if it's not required by
-	 * the possible flags values, getting a single byte on some machines
-	 * is expensive, and the mutex structure is a MP hot spot.
-	 */
-	u_int32_t flags;		/* MUTEX_XXX */
-};
 
-/* Macro to clear mutex statistics. */
-#define	MUTEX_CLEAR(mp) {						\
-	(mp)->mutex_set_wait = (mp)->mutex_set_nowait = 0;		\
+#if defined(__cplusplus)
 }
-
-/* Redirect calls to the correct functions. */
-#ifdef HAVE_MUTEX_THREADS
-#if defined(HAVE_MUTEX_PTHREADS) ||					\
-    defined(HAVE_MUTEX_SOLARIS_LWP) ||					\
-    defined(HAVE_MUTEX_UI_THREADS)
-#define	__db_mutex_init_int(a, b, c, d)	__db_pthread_mutex_init(a, b, d)
-#define	__db_mutex_lock(a, b)		__db_pthread_mutex_lock(a, b)
-#define	__db_mutex_unlock(a, b)		__db_pthread_mutex_unlock(a, b)
-#define	__db_mutex_destroy(a)		__db_pthread_mutex_destroy(a)
-#else
-#if defined(HAVE_MUTEX_WIN32) || defined(HAVE_MUTEX_WIN32_GCC)
-#define	__db_mutex_init_int(a, b, c, d)	__db_win32_mutex_init(a, b, d)
-#define	__db_mutex_lock(a, b)		__db_win32_mutex_lock(a, b)
-#define	__db_mutex_unlock(a, b)		__db_win32_mutex_unlock(a, b)
-#define	__db_mutex_destroy(a)		__db_win32_mutex_destroy(a)
-#else
-#define	__db_mutex_init_int(a, b, c, d)	__db_tas_mutex_init(a, b, d)
-#define	__db_mutex_lock(a, b)		__db_tas_mutex_lock(a, b)
-#define	__db_mutex_unlock(a, b)		__db_tas_mutex_unlock(a, b)
-#define	__db_mutex_destroy(a)		__db_tas_mutex_destroy(a)
-#endif
 #endif
-#else
-#define	__db_mutex_init_int(a, b, c, d)	__db_fcntl_mutex_init(a, b, c)
-#define	__db_mutex_lock(a, b)		__db_fcntl_mutex_lock(a, b)
-#define	__db_mutex_unlock(a, b)		__db_fcntl_mutex_unlock(a, b)
-#define	__db_mutex_destroy(a)		__db_fcntl_mutex_destroy(a)
-#endif
-
-/* Redirect system resource calls to correct functions */
-#ifdef HAVE_MUTEX_SYSTEM_RESOURCES
-#define	__db_maintinit(a, b, c)		__db_shreg_maintinit(a, b, c)
-#define	__db_shlocks_clear(a, b, c)	__db_shreg_locks_clear(a, b, c)
-#define	__db_shlocks_destroy(a, b)	__db_shreg_locks_destroy(a, b)
-#define	__db_mutex_init(a, b, c, d, e, f)	\
-    __db_shreg_mutex_init(a, b, c, d, e, f)
-#else
-#define	__db_maintinit(a, b, c)
-#define	__db_shlocks_clear(a, b, c)
-#define	__db_shlocks_destroy(a, b)
-#define	__db_mutex_init(a, b, c, d, e, f)	__db_mutex_init_int(a, b, c, d)
-#endif
-
-/*
- * Lock/unlock a mutex.  If the mutex was marked as uninteresting, the thread
- * of control can proceed without it.
- *
- * If the lock is for threads-only, then it was optionally not allocated and
- * file handles aren't necessary, as threaded applications aren't supported by
- * fcntl(2) locking.
- */
-#ifdef DIAGNOSTIC
-	/*
-	 * XXX
-	 * We want to switch threads as often as possible.  Yield every time
-	 * we get a mutex to ensure contention.
-	 */
-#define	MUTEX_LOCK(dbenv, mp)						\
-	if (!F_ISSET((mp), MUTEX_IGNORE))				\
-		DB_ASSERT(__db_mutex_lock(dbenv, mp) == 0);		\
-	if (F_ISSET(dbenv, DB_ENV_YIELDCPU))				\
-		__os_yield(NULL, 1);
-#else
-#define	MUTEX_LOCK(dbenv, mp)						\
-	if (!F_ISSET((mp), MUTEX_IGNORE))				\
-		(void)__db_mutex_lock(dbenv, mp);
-#endif
-#define	MUTEX_UNLOCK(dbenv, mp)						\
-	if (!F_ISSET((mp), MUTEX_IGNORE))				\
-		(void)__db_mutex_unlock(dbenv, mp);
-#define	MUTEX_THREAD_LOCK(dbenv, mp)					\
-	if (mp != NULL)							\
-		MUTEX_LOCK(dbenv, mp)
-#define	MUTEX_THREAD_UNLOCK(dbenv, mp)					\
-	if (mp != NULL)							\
-		MUTEX_UNLOCK(dbenv, mp)
 
-/*
- * We use a single file descriptor for fcntl(2) locking, and (generally) the
- * object's offset in a shared region as the byte that we're locking.  So,
- * there's a (remote) possibility that two objects might have the same offsets
- * such that the locks could conflict, resulting in deadlock.  To avoid this
- * possibility, we offset the region offset by a small integer value, using a
- * different offset for each subsystem's locks.  Since all region objects are
- * suitably aligned, the offset guarantees that we don't collide with another
- * region's objects.
- */
-#define	DB_FCNTL_OFF_GEN	0		/* Everything else. */
-#define	DB_FCNTL_OFF_LOCK	1		/* Lock subsystem offset. */
-#define	DB_FCNTL_OFF_MPOOL	2		/* Mpool subsystem offset. */
-
-#ifdef HAVE_MUTEX_SYSTEM_RESOURCES
-/*
- * When the underlying mutexes require library (most likely heap) or system
- * resources, we have to clean up when we discard mutexes (for the library
- * resources) and both when discarding mutexes and after application failure
- * (for the mutexes requiring system resources).  This violates the rule that
- * we never look at a shared region after application failure, but we've no
- * other choice.  In those cases, the #define HAVE_MUTEX_SYSTEM_RESOURCES is
- * set.
- *
- * To support mutex release after application failure, allocate thread-handle
- * mutexes in shared memory instead of in the heap.  The number of slots we
- * allocate for this purpose isn't configurable, but this tends to be an issue
- * only on embedded systems where we don't expect large server applications.
- */
-#define	DB_MAX_HANDLES	100			/* Mutex slots for handles. */
-#endif
+#include "dbinc_auto/mutex_ext.h"
 #endif /* !_DB_MUTEX_H_ */
diff --git a/db/dbinc/mutex_int.h b/db/dbinc/mutex_int.h
new file mode 100644
index 000000000..74bc813e2
--- /dev/null
+++ b/db/dbinc/mutex_int.h
@@ -0,0 +1,851 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
+ *
+ * $Id: mutex_int.h,v 12.22 2006/08/24 14:45:29 bostic Exp $
+ */
+
+#ifndef _DB_MUTEX_INT_H_
+#define	_DB_MUTEX_INT_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*********************************************************************
+ * POSIX.1 pthreads interface.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_PTHREADS
+#include 
+
+#define	MUTEX_FIELDS							\
+	pthread_mutex_t mutex;		/* Mutex. */			\
+	pthread_cond_t  cond;		/* Condition variable. */
+#endif
+
+#ifdef HAVE_MUTEX_UI_THREADS
+#include 
+#endif
+
+/*********************************************************************
+ * Solaris lwp threads interface.
+ *
+ * !!!
+ * We use LWP mutexes on Solaris instead of UI or POSIX mutexes (both of
+ * which are available), for two reasons.  First, the Solaris C library
+ * includes versions of the both UI and POSIX thread mutex interfaces, but
+ * they are broken in that they don't support inter-process locking, and
+ * there's no way to detect it, e.g., calls to configure the mutexes for
+ * inter-process locking succeed without error.  So, we use LWP mutexes so
+ * that we don't fail in fairly undetectable ways because the application
+ * wasn't linked with the appropriate threads library.  Second, there were
+ * bugs in SunOS 5.7 (Solaris 7) where if an application loaded the C library
+ * before loading the libthread/libpthread threads libraries (e.g., by using
+ * dlopen to load the DB library), the pwrite64 interface would be translated
+ * into a call to pwrite and DB would drop core.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_SOLARIS_LWP
+/*
+ * XXX
+ * Don't change  to  -- although lwp.h is listed in the
+ * Solaris manual page as the correct include to use, it causes the Solaris
+ * compiler on SunOS 2.6 to fail.
+ */
+#include 
+
+#define	MUTEX_FIELDS							\
+	lwp_mutex_t mutex;		/* Mutex. */			\
+	lwp_cond_t cond;		/* Condition variable. */
+#endif
+
+/*********************************************************************
+ * Solaris/Unixware threads interface.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_UI_THREADS
+#include 
+#include 
+
+#define	MUTEX_FIELDS							\
+	mutex_t mutex;			/* Mutex. */			\
+	cond_t  cond;			/* Condition variable. */
+#endif
+
+/*********************************************************************
+ * AIX C library functions.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_AIX_CHECK_LOCK
+#include 
+typedef int tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define	MUTEX_INIT(x)	0
+#define	MUTEX_SET(x)	(!_check_lock(x, 0, 1))
+#define	MUTEX_UNSET(x)	_clear_lock(x, 0)
+#endif
+#endif
+
+/*********************************************************************
+ * Apple/Darwin library functions.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY
+typedef u_int32_t tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+extern int _spin_lock_try(tsl_t *);
+extern void _spin_unlock(tsl_t *);
+#define	MUTEX_SET(tsl)          _spin_lock_try(tsl)
+#define	MUTEX_UNSET(tsl)        _spin_unlock(tsl)
+#define	MUTEX_INIT(tsl)         (MUTEX_UNSET(tsl), 0)
+#endif
+#endif
+
+/*********************************************************************
+ * General C library functions (msemaphore).
+ *
+ * !!!
+ * Check for HPPA as a special case, because it requires unusual alignment,
+ * and doesn't support semaphores in malloc(3) or shmget(2) memory.
+ *
+ * !!!
+ * Do not remove the MSEM_IF_NOWAIT flag.  The problem is that if a single
+ * process makes two msem_lock() calls in a row, the second one returns an
+ * error.  We depend on the fact that we can lock against ourselves in the
+ * locking subsystem, where we set up a mutex so that we can block ourselves.
+ * Tested on OSF1 v4.0.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_HPPA_MSEM_INIT
+#define	MUTEX_ALIGN	16
+#endif
+
+#if defined(HAVE_MUTEX_MSEM_INIT) || defined(HAVE_MUTEX_HPPA_MSEM_INIT)
+#include 
+typedef msemaphore tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define	MUTEX_INIT(x)	(msem_init(x, MSEM_UNLOCKED) <= (msemaphore *)0)
+#define	MUTEX_SET(x)	(!msem_lock(x, MSEM_IF_NOWAIT))
+#define	MUTEX_UNSET(x)	msem_unlock(x, 0)
+#endif
+#endif
+
+/*********************************************************************
+ * Plan 9 library functions.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_PLAN9
+typedef Lock tsl_t;
+
+#define	MUTEX_INIT(x)	(memset(x, 0, sizeof(Lock)), 0)
+#define	MUTEX_SET(x)	canlock(x)
+#define	MUTEX_UNSET(x)	unlock(x)
+#endif
+
+/*********************************************************************
+ * Reliant UNIX C library functions.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_RELIANTUNIX_INITSPIN
+#include 
+typedef spinlock_t tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define	MUTEX_INIT(x)	(initspin(x, 1), 0)
+#define	MUTEX_SET(x)	(cspinlock(x) == 0)
+#define	MUTEX_UNSET(x)	spinunlock(x)
+#endif
+#endif
+
+/*********************************************************************
+ * General C library functions (POSIX 1003.1 sema_XXX).
+ *
+ * !!!
+ * Never selected by autoconfig in this release (semaphore calls are known
+ * to not work in Solaris 5.5).
+ *********************************************************************/
+#ifdef HAVE_MUTEX_SEMA_INIT
+#include 
+typedef sema_t tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define	MUTEX_DESTROY(x) sema_destroy(x)
+#define	MUTEX_INIT(x)	 (sema_init(x, 1, USYNC_PROCESS, NULL) != 0)
+#define	MUTEX_SET(x)	 (sema_wait(x) == 0)
+#define	MUTEX_UNSET(x)	 sema_post(x)
+#endif
+#endif
+
+/*********************************************************************
+ * SGI C library functions.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_SGI_INIT_LOCK
+#include 
+typedef abilock_t tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define	MUTEX_INIT(x)	(init_lock(x) != 0)
+#define	MUTEX_SET(x)	(!acquire_lock(x))
+#define	MUTEX_UNSET(x)	release_lock(x)
+#endif
+#endif
+
+/*********************************************************************
+ * Solaris C library functions.
+ *
+ * !!!
+ * These are undocumented functions, but they're the only ones that work
+ * correctly as far as we know.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_SOLARIS_LOCK_TRY
+#include 
+typedef lock_t tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define	MUTEX_INIT(x)	0
+#define	MUTEX_SET(x)	_lock_try(x)
+#define	MUTEX_UNSET(x)	_lock_clear(x)
+#endif
+#endif
+
+/*********************************************************************
+ * VMS.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_VMS
+#include 
+#include 
+typedef volatile unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#ifdef __ALPHA
+#define	MUTEX_SET(tsl)		(!__TESTBITSSI(tsl, 0))
+#else /* __VAX */
+#define	MUTEX_SET(tsl)		(!(int)_BBSSI(0, tsl))
+#endif
+#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * VxWorks
+ * Use basic binary semaphores in VxWorks, as we currently do not need
+ * any special features.  We do need the ability to single-thread the
+ * entire system, however, because VxWorks doesn't support the open(2)
+ * flag O_EXCL, the mechanism we normally use to single thread access
+ * when we're first looking for a DB environment.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_VXWORKS
+#include "taskLib.h"
+typedef SEM_ID tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define	MUTEX_SET(tsl)		(semTake((*tsl), WAIT_FOREVER) == OK)
+#define	MUTEX_UNSET(tsl)	(semGive((*tsl)))
+#define	MUTEX_INIT(tsl)							\
+	((*(tsl) = semBCreate(SEM_Q_FIFO, SEM_FULL)) == NULL)
+#define	MUTEX_DESTROY(tsl)	semDelete(*tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * Win16
+ *
+ * Win16 spinlocks are simple because we cannot possibly be preempted.
+ *
+ * !!!
+ * We should simplify this by always returning a no-need-to-lock lock
+ * when we initialize the mutex.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_WIN16
+typedef unsigned int tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define	MUTEX_INIT(x)		0
+#define	MUTEX_SET(tsl)		(*(tsl) = 1)
+#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
+#endif
+#endif
+
+/*********************************************************************
+ * Win32
+ *********************************************************************/
+#if defined(HAVE_MUTEX_WIN32) || defined(HAVE_MUTEX_WIN32_GCC)
+#define	MUTEX_FIELDS							\
+	LONG volatile tas;						\
+	LONG nwaiters;							\
+	u_int32_t id;	/* ID used for creating events */		\
+
+#if defined(LOAD_ACTUAL_MUTEX_CODE)
+#define	MUTEX_SET(tsl)		(!InterlockedExchange((PLONG)tsl, 1))
+#define	MUTEX_UNSET(tsl)	InterlockedExchange((PLONG)tsl, 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+
+/*
+ * From Intel's performance tuning documentation (and see SR #6975):
+ * ftp://download.intel.com/design/perftool/cbts/appnotes/sse2/w_spinlock.pdf
+ *
+ * "For this reason, it is highly recommended that you insert the PAUSE
+ * instruction into all spin-wait code immediately. Using the PAUSE
+ * instruction does not affect the correctness of programs on existing
+ * platforms, and it improves performance on Pentium 4 processor platforms."
+ */
+#ifdef HAVE_MUTEX_WIN32
+#ifndef _WIN64
+#define	MUTEX_PAUSE		{__asm{_emit 0xf3}; __asm{_emit 0x90}}
+#endif
+#endif
+#ifdef HAVE_MUTEX_WIN32_GCC
+#define	MUTEX_PAUSE		asm volatile ("rep; nop" : : );
+#endif
+#endif
+#endif
+
+/*********************************************************************
+ * 68K/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_68K_GCC_ASSEMBLY
+typedef unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/* gcc/68K: 0 is clear, 1 is set. */
+#define	MUTEX_SET(tsl) ({						\
+	register tsl_t *__l = (tsl);					\
+	int __r;							\
+	    asm volatile("tas  %1; \n					\
+			  seq  %0"					\
+		: "=dm" (__r), "=m" (*__l)				\
+		: "1" (*__l)						\
+		);							\
+	__r & 1;							\
+})
+
+#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * ALPHA/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY
+typedef u_int32_t tsl_t;
+
+#define	MUTEX_ALIGN	4
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ * For gcc/alpha.  Should return 0 if could not acquire the lock, 1 if
+ * lock was acquired properly.
+ */
+static inline int
+MUTEX_SET(tsl_t *tsl) {
+	register tsl_t *__l = tsl;
+	register tsl_t __r;
+	asm volatile(
+		"1:	ldl_l	%0,%2\n"
+		"	blbs	%0,2f\n"
+		"	or	$31,1,%0\n"
+		"	stl_c	%0,%1\n"
+		"	beq	%0,3f\n"
+		"	mb\n"
+		"	br	3f\n"
+		"2:	xor	%0,%0\n"
+		"3:"
+		: "=&r"(__r), "=m"(*__l) : "1"(*__l) : "memory");
+	return __r;
+}
+
+/*
+ * Unset mutex. Judging by Alpha Architecture Handbook, the mb instruction
+ * might be necessary before unlocking
+ */
+static inline int
+MUTEX_UNSET(tsl_t *tsl) {
+	asm volatile("	mb\n");
+	return *tsl = 0;
+}
+
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * Tru64/cc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_TRU64_CC_ASSEMBLY
+typedef volatile u_int32_t tsl_t;
+
+#define	MUTEX_ALIGN	4
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#include 
+#define	MUTEX_SET(tsl)		(__LOCK_LONG_RETRY((tsl), 1) != 0)
+#define	MUTEX_UNSET(tsl)	(__UNLOCK_LONG(tsl))
+
+#define	MUTEX_INIT(tsl)		(MUTEX_UNSET(tsl), 0)
+#endif
+#endif
+
+/*********************************************************************
+ * ARM/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_ARM_GCC_ASSEMBLY
+typedef unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/* gcc/arm: 0 is clear, 1 is set. */
+#define	MUTEX_SET(tsl) ({						\
+	int __r;							\
+	asm volatile(							\
+		"swpb	%0, %1, [%2]\n\t"				\
+		"eor	%0, %0, #1\n\t"					\
+	    : "=&r" (__r)						\
+	    : "r" (1), "r" (tsl)					\
+	    );								\
+	__r & 1;							\
+})
+
+#define	MUTEX_UNSET(tsl)	(*(volatile tsl_t *)(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * HPPA/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_HPPA_GCC_ASSEMBLY
+typedef u_int32_t tsl_t;
+
+#define	MUTEX_ALIGN	16
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ * The PA-RISC has a "load and clear" instead of a "test and set" instruction.
+ * The 32-bit word used by that instruction must be 16-byte aligned.  We could
+ * use the "aligned" attribute in GCC but that doesn't work for stack variables.
+ */
+#define	MUTEX_SET(tsl) ({						\
+	register tsl_t *__l = (tsl);					\
+	int __r;							\
+	asm volatile("ldcws 0(%1),%0" : "=r" (__r) : "r" (__l));	\
+	__r & 1;							\
+})
+
+#define	MUTEX_UNSET(tsl)        (*(volatile tsl_t *)(tsl) = -1)
+#define	MUTEX_INIT(tsl)		(MUTEX_UNSET(tsl), 0)
+#endif
+#endif
+
+/*********************************************************************
+ * IA64/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_IA64_GCC_ASSEMBLY
+typedef volatile unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/* gcc/ia64: 0 is clear, 1 is set. */
+#define	MUTEX_SET(tsl) ({						\
+	register tsl_t *__l = (tsl);					\
+	long __r;							\
+	asm volatile("xchg1 %0=%1,%2" :					\
+		     "=r"(__r), "+m"(*__l) : "r"(1));			\
+	__r ^ 1;							\
+})
+
+/*
+ * Store through a "volatile" pointer so we get a store with "release"
+ * semantics.
+ */
+#define	MUTEX_UNSET(tsl)	(*(tsl_t *)(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * PowerPC/gcc assembly.
+ *********************************************************************/
+#if defined(HAVE_MUTEX_PPC_GCC_ASSEMBLY)
+typedef u_int32_t tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ * The PowerPC does a sort of pseudo-atomic locking.  You set up a
+ * 'reservation' on a chunk of memory containing a mutex by loading the
+ * mutex value with LWARX.  If the mutex has an 'unlocked' (arbitrary)
+ * value, you then try storing into it with STWCX.  If no other process or
+ * thread broke your 'reservation' by modifying the memory containing the
+ * mutex, then the STCWX succeeds; otherwise it fails and you try to get
+ * a reservation again.
+ *
+ * While mutexes are explicitly 4 bytes, a 'reservation' applies to an
+ * entire cache line, normally 32 bytes, aligned naturally.  If the mutex
+ * lives near data that gets changed a lot, there's a chance that you'll
+ * see more broken reservations than you might otherwise.  The only
+ * situation in which this might be a problem is if one processor is
+ * beating on a variable in the same cache block as the mutex while another
+ * processor tries to acquire the mutex.  That's bad news regardless
+ * because of the way it bashes caches, but if you can't guarantee that a
+ * mutex will reside in a relatively quiescent cache line, you might
+ * consider padding the mutex to force it to live in a cache line by
+ * itself.  No, you aren't guaranteed that cache lines are 32 bytes.  Some
+ * embedded processors use 16-byte cache lines, while some 64-bit
+ * processors use 128-bit cache lines.  But assuming a 32-byte cache line
+ * won't get you into trouble for now.
+ *
+ * If mutex locking is a bottleneck, then you can speed it up by adding a
+ * regular LWZ load before the LWARX load, so that you can test for the
+ * common case of a locked mutex without wasting cycles making a reservation.
+ *
+ * gcc/ppc: 0 is clear, 1 is set.
+ */
+static inline int
+MUTEX_SET(int *tsl)  {
+        int __r;
+        asm volatile (
+"0:                             \n\t"
+"       lwarx   %0,0,%1         \n\t"
+"       cmpwi   %0,0            \n\t"
+"       bne-    1f              \n\t"
+"       stwcx.  %1,0,%1         \n\t"
+"       isync                   \n\t"
+"       beq+    2f              \n\t"
+"       b       0b              \n\t"
+"1:                             \n\t"
+"       li      %1,0            \n\t"
+"2:                             \n\t"
+         : "=&r" (__r), "+r" (tsl)
+         :
+         : "cr0", "memory");
+         return (int)tsl;
+}
+
+static inline int
+MUTEX_UNSET(tsl_t *tsl) {
+         asm volatile("sync" : : : "memory");
+         return *tsl = 0;
+}
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * OS/390 C
+ *********************************************************************/
+#ifdef HAVE_MUTEX_S390_CC_ASSEMBLY
+typedef int tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ * cs() is declared in  but is built in to the compiler.
+ * Must use LANGLVL(EXTENDED) to get its declaration.
+ */
+#define	MUTEX_SET(tsl)		(!cs(&zero, (tsl), 1))
+#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * S/390 32-bit assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_S390_GCC_ASSEMBLY
+typedef int tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/* gcc/S390: 0 is clear, 1 is set. */
+static inline int
+MUTEX_SET(tsl_t *tsl) {							\
+	register tsl_t *__l = (tsl);					\
+	int __r;							\
+  asm volatile(								\
+       "    la    1,%1\n"						\
+       "    lhi   0,1\n"						\
+       "    l     %0,%1\n"						\
+       "0:  cs    %0,0,0(1)\n"						\
+       "    jl    0b"							\
+       : "=&d" (__r), "+m" (*__l)					\
+       : : "0", "1", "cc");						\
+	return !__r;							\
+}
+
+#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * SCO/cc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY
+typedef unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ * UnixWare has threads in libthread, but OpenServer doesn't (yet).
+ *
+ * cc/x86: 0 is clear, 1 is set.
+ */
+#if defined(__USLC__)
+asm int
+_tsl_set(void *tsl)
+{
+%mem tsl
+	movl	tsl, %ecx
+	movl	$1, %eax
+	lock
+	xchgb	(%ecx),%al
+	xorl	$1,%eax
+}
+#endif
+
+#define	MUTEX_SET(tsl)		_tsl_set(tsl)
+#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * Sparc/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_SPARC_GCC_ASSEMBLY
+typedef unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ *
+ * The ldstub instruction takes the location specified by its first argument
+ * (a register containing a memory address) and loads its contents into its
+ * second argument (a register) and atomically sets the contents the location
+ * specified by its first argument to a byte of 1s.  (The value in the second
+ * argument is never read, but only overwritten.)
+ *
+ * The stbar is needed for v8, and is implemented as membar #sync on v9,
+ * so is functional there as well.  For v7, stbar may generate an illegal
+ * instruction and we have no way to tell what we're running on.  Some
+ * operating systems notice and skip this instruction in the fault handler.
+ *
+ * gcc/sparc: 0 is clear, 1 is set.
+ */
+#define	MUTEX_SET(tsl) ({						\
+	register tsl_t *__l = (tsl);					\
+	register tsl_t __r;						\
+	__asm__ volatile						\
+	    ("ldstub [%1],%0; stbar"					\
+	    : "=r"( __r) : "r" (__l));					\
+	!__r;								\
+})
+
+#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * UTS/cc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_UTS_CC_ASSEMBLY
+typedef int tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define	MUTEX_INIT(x)	0
+#define	MUTEX_SET(x)	(!uts_lock(x, 1))
+#define	MUTEX_UNSET(x)	(*(x) = 0)
+#endif
+#endif
+
+/*********************************************************************
+ * MIPS/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_MIPS_GCC_ASSEMBLY
+typedef u_int32_t tsl_t;
+
+#define MUTEX_ALIGN	4
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ * For gcc/MIPS.  Should return 0 if could not acquire the lock, 1 if
+ * lock was acquired properly.
+ */
+static inline int
+MUTEX_SET(tsl_t *tsl) {
+       register tsl_t *__l = tsl;
+       register tsl_t __r;
+       __asm__ __volatile__(
+               "       .set push           \n"
+               "       .set mips2          \n"
+               "       .set noreorder      \n"
+               "       .set nomacro        \n"
+               "1:     ll      %0,%1       \n"
+               "       bne     %0,$0,1f    \n"
+               "       xori    %0,%0,1     \n"
+               "       sc      %0,%1       \n"
+               "       beql    %0,$0,1b    \n"
+               "       xori    %0,1        \n"
+               "1:     .set pop              "
+               : "=&r" (__r), "+R" (*__l));
+       return __r;
+}
+
+#define	MUTEX_UNSET(tsl)        (*(volatile tsl_t *)(tsl) = 0)
+#define	MUTEX_INIT(tsl)         MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * x86/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_X86_GCC_ASSEMBLY
+typedef unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/* gcc/x86: 0 is clear, 1 is set. */
+#define	MUTEX_SET(tsl) ({						\
+	register tsl_t *__l = (tsl);					\
+	int __r;							\
+	asm volatile("movl $1,%%eax\n"					\
+		     "lock\n"						\
+		     "xchgb %1,%%al\n"					\
+		     "xorl $1,%%eax"					\
+	    : "=&a" (__r), "=m" (*__l)					\
+	    : "m1" (*__l)						\
+	    );								\
+	__r & 1;							\
+})
+
+#define	MUTEX_UNSET(tsl)        (*(volatile tsl_t *)(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+
+/*
+ * From Intel's performance tuning documentation (and see SR #6975):
+ * ftp://download.intel.com/design/perftool/cbts/appnotes/sse2/w_spinlock.pdf
+ *
+ * "For this reason, it is highly recommended that you insert the PAUSE
+ * instruction into all spin-wait code immediately. Using the PAUSE
+ * instruction does not affect the correctness of programs on existing
+ * platforms, and it improves performance on Pentium 4 processor platforms."
+ */
+#define	MUTEX_PAUSE		asm volatile ("rep; nop" : : );
+#endif
+#endif
+
+/*********************************************************************
+ * x86_64/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
+typedef unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/* gcc/x86_64: 0 is clear, 1 is set. */
+#define  MUTEX_SET(tsl) ({           					\
+	register tsl_t *__l = (tsl);          				\
+	int __r;              						\
+	asm volatile("mov $1,%%rax\n"					\
+		     "lock\n"						\
+		     "xchgb %1,%%al\n"					\
+		     "xor $1,%%rax"					\
+		: "=&a" (__r), "=m" (*__l)				\
+		: "1m" (*__l)						\
+		);							\
+	__r & 1;							\
+})
+
+#define	MUTEX_UNSET(tsl)	(*(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*
+ * Mutex alignment defaults to sizeof(unsigned int).
+ *
+ * !!!
+ * Various systems require different alignments for mutexes (the worst we've
+ * seen so far is 16-bytes on some HP architectures).  Malloc(3) is assumed
+ * to return reasonable alignment, all other mutex users must ensure proper
+ * alignment locally.
+ */
+#ifndef	MUTEX_ALIGN
+#define	MUTEX_ALIGN	sizeof(unsigned int)
+#endif
+
+/*
+ * Mutex destruction defaults to a no-op.
+ */
+#ifndef	MUTEX_DESTROY
+#define	MUTEX_DESTROY(x)
+#endif
+
+/*
+ * DB_MUTEXMGR --
+ *	The mutex manager encapsulates the mutex system.
+ */
+struct __db_mutexmgr {
+	/* These fields are never updated after creation, so not protected. */
+	DB_ENV	*dbenv;			/* Environment */
+	REGINFO	 reginfo;		/* Region information */
+
+	void	*mutex_array;		/* Base of the mutex array */
+};
+
+/* Macros to lock/unlock the mutex region as a whole. */
+#define	MUTEX_SYSTEM_LOCK(dbenv)					\
+	MUTEX_LOCK(dbenv, ((DB_MUTEXREGION *)				\
+	    (dbenv)->mutex_handle->reginfo.primary)->mtx_region)
+#define	MUTEX_SYSTEM_UNLOCK(dbenv)					\
+	MUTEX_UNLOCK(dbenv, ((DB_MUTEXREGION *)				\
+	    (dbenv)->mutex_handle->reginfo.primary)->mtx_region)
+
+/*
+ * DB_MUTEXREGION --
+ *	The primary mutex data structure in the shared memory region.
+ */
+typedef struct __db_mutexregion {
+	/* These fields are initialized at create time and never modified. */
+	roff_t		mutex_offset;	/* Offset of mutex array */
+	size_t		mutex_size;	/* Size of the aligned mutex */
+	roff_t		thread_off;	/* Offset of the thread area. */
+
+	db_mutex_t	mtx_region;	/* Region mutex. */
+
+	/* Protected using the region mutex. */
+	u_int32_t	mutex_next;	/* Next free mutex */
+
+	DB_MUTEX_STAT	stat;		/* Mutex statistics */
+} DB_MUTEXREGION;
+
+struct __db_mutex_t {			/* Mutex. */
+#ifdef MUTEX_FIELDS
+	MUTEX_FIELDS
+#endif
+#if !defined(MUTEX_FIELDS) && !defined(HAVE_MUTEX_FCNTL)
+	tsl_t		tas;		/* Test and set. */
+#endif
+	pid_t 		pid;		/* Process owning mutex */
+	db_threadid_t 	tid;		/* Thread owning mutex */
+
+	u_int32_t mutex_next_link;	/* Linked list of free mutexes. */
+
+#ifdef HAVE_STATISTICS
+	int	  alloc_id;		/* Allocation ID. */
+
+	u_int32_t mutex_set_wait;	/* Granted after wait. */
+	u_int32_t mutex_set_nowait;	/* Granted without waiting. */
+#endif
+
+	/*
+	 * A subset of the flag arguments for __mutex_alloc().
+	 *
+	 * Flags should be an unsigned integer even if it's not required by
+	 * the possible flags values, getting a single byte on some machines
+	 * is expensive, and the mutex structure is a MP hot spot.
+	 */
+	u_int32_t flags;		/* MUTEX_XXX */
+};
+
+/* Macro to get a reference to a specific mutex. */
+#define	MUTEXP_SET(indx)						\
+	(DB_MUTEX *)							\
+	    ((u_int8_t *)mtxmgr->mutex_array + (indx) * mtxregion->mutex_size);
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* !_DB_MUTEX_INT_H_ */
diff --git a/db/dbinc/os.h b/db/dbinc/os.h
index 24685a4a7..792c04dd9 100644
--- a/db/dbinc/os.h
+++ b/db/dbinc/os.h
@@ -1,10 +1,10 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: os.h,v 11.25 2004/09/22 03:40:20 bostic Exp $
+ * $Id: os.h,v 12.18 2006/09/05 15:02:30 mjc Exp $
  */
 
 #ifndef _DB_OS_H_
@@ -17,37 +17,66 @@ extern "C" {
 /* Number of times to retry system calls that return EINTR or EBUSY. */
 #define	DB_RETRY	100
 
+#ifdef __TANDEM
+/*
+ * OSS Tandem problem: fsync can return a Guardian file system error of 70,
+ * which has no symbolic name in OSS.  HP says to retry the fsync. [#12957]
+ */
+#define	RETRY_CHK(op, ret) do {						\
+	int __retries, __t_ret;						\
+	for ((ret) = 0, __retries = DB_RETRY;;) {			\
+		if ((op) == 0)						\
+			break;						\
+		(ret) = __os_get_syserr();				\
+		if (((__t_ret = __os_posix_err(ret)) == EAGAIN ||	\
+		    __t_ret == EBUSY || __t_ret == EINTR ||		\
+		    __t_ret == EIO || __t_ret == 70) && --__retries > 0)\
+			continue;					\
+		break;							\
+	}								\
+} while (0)
+#else
 #define	RETRY_CHK(op, ret) do {						\
-	int __retries = DB_RETRY;					\
-	do {								\
-		(ret) = (op);						\
-	} while ((ret) != 0 && (((ret) = __os_get_errno()) == EAGAIN ||	\
-	    (ret) == EBUSY || (ret) == EINTR) && --__retries > 0);	\
+	int __retries, __t_ret;						\
+	for ((ret) = 0, __retries = DB_RETRY;;) {			\
+		if ((op) == 0)						\
+			break;						\
+		(ret) = __os_get_syserr();				\
+		if (((__t_ret = __os_posix_err(ret)) == EAGAIN ||	\
+		    __t_ret == EBUSY || __t_ret == EINTR ||		\
+		    __t_ret == EIO) && --__retries > 0)			\
+			continue;					\
+		break;							\
+	}								\
+} while (0)
+#endif
+
+#define	RETRY_CHK_EINTR_ONLY(op, ret) do {				\
+	int __retries;							\
+	for ((ret) = 0, __retries = DB_RETRY;;) {			\
+		if ((op) == 0)						\
+			break;						\
+		(ret) = __os_get_syserr();				\
+		if (__os_posix_err(ret) == EINTR && --__retries > 0)	\
+			continue;					\
+		break;							\
+	}								\
 } while (0)
 
 /*
  * Flags understood by __os_open.
  */
-#define	DB_OSO_CREATE	0x0001		/* POSIX: O_CREAT */
-#define	DB_OSO_DIRECT	0x0002		/* Don't buffer the file in the OS. */
-#define	DB_OSO_DSYNC	0x0004		/* POSIX: O_DSYNC. */
-#define	DB_OSO_EXCL	0x0008		/* POSIX: O_EXCL */
-#define	DB_OSO_LOG	0x0010		/* Opening a log file. */
+#define	DB_OSO_ABSMODE	0x0001		/* Absolute mode specified. */
+#define	DB_OSO_CREATE	0x0002		/* POSIX: O_CREAT */
+#define	DB_OSO_DIRECT	0x0004		/* Don't buffer the file in the OS. */
+#define	DB_OSO_DSYNC	0x0008		/* POSIX: O_DSYNC. */
+#define	DB_OSO_EXCL	0x0010		/* POSIX: O_EXCL */
 #define	DB_OSO_RDONLY	0x0020		/* POSIX: O_RDONLY */
 #define	DB_OSO_REGION	0x0040		/* Opening a region file. */
 #define	DB_OSO_SEQ	0x0080		/* Expected sequential access. */
 #define	DB_OSO_TEMP	0x0100		/* Remove after last close. */
 #define	DB_OSO_TRUNC	0x0200		/* POSIX: O_TRUNC */
 
-/*
- * Seek options understood by __os_seek.
- */
-typedef enum {
-	DB_OS_SEEK_CUR,			/* POSIX: SEEK_CUR */
-	DB_OS_SEEK_END,			/* POSIX: SEEK_END */
-	DB_OS_SEEK_SET			/* POSIX: SEEK_SET */
-} DB_OS_SEEK;
-
 /*
  * We group certain seek/write calls into a single function so that we
  * can use pread(2)/pwrite(2) where they're available.
@@ -62,14 +91,15 @@ struct __fh_t {
 	 * across seek and read/write pairs, it does not protect the
 	 * the reference count, or any other fields in the structure.
 	 */
-	DB_MUTEX  *mutexp;		/* Mutex to lock. */
+	db_mutex_t mtx_fh;		/* Mutex to lock. */
 
-	int	  ref;			/* Reference count. */
+	int	ref;			/* Reference count. */
 
 #if defined(DB_WIN32)
-	HANDLE	  handle;		/* Windows/32 file handle. */
+	HANDLE	handle;			/* Windows/32 file handle. */
+	HANDLE	trunc_handle;		/* Handle for truncate calls. */
 #endif
-	int	  fd;			/* POSIX file descriptor. */
+	int	fd;			/* POSIX file descriptor. */
 
 	char	*name;			/* File name (ref DB_FH_UNLINK) */
 
@@ -87,6 +117,12 @@ struct __fh_t {
 	u_int8_t flags;
 };
 
+/* Standard 600 mode for __db_omode. */
+#define	OWNER_RW	"rw-------"
+
+/* Standard buffer size for ctime/ctime_r function calls. */
+#define	CTIME_BUFLEN	26
+
 #if defined(__cplusplus)
 }
 #endif
diff --git a/db/dbinc/qam.h b/db/dbinc/qam.h
index 43910d01d..b76c92cd2 100644
--- a/db/dbinc/qam.h
+++ b/db/dbinc/qam.h
@@ -1,15 +1,19 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1999-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1999-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: qam.h,v 11.49 2004/09/17 22:00:27 mjc Exp $
+ * $Id: qam.h,v 12.9 2006/08/24 14:45:29 bostic Exp $
  */
 
 #ifndef	_DB_QAM_H_
 #define	_DB_QAM_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  * QAM data elements: a status field and the data.
  */
@@ -69,8 +73,9 @@ struct __queue {
 };
 
 /* Format for queue extent names. */
-#define	QUEUE_EXTENT "%s%c__dbq.%s.%d"
-#define	QUEUE_EXTENT_HEAD "__dbq.%s."
+#define	QUEUE_EXTENT		"%s%c__dbq.%s.%d"
+#define	QUEUE_EXTENT_HEAD	"__dbq.%s."
+#define	QUEUE_EXTENT_PREFIX	"__dbq."
 
 typedef struct __qam_filelist {
 	DB_MPOOLFILE *mpf;
@@ -119,16 +124,16 @@ typedef struct __qam_filelist {
     ((QUEUE *)(dbp)->q_internal)->re_len, sizeof(u_int32_t)) * index))))
 
 #define	QAM_AFTER_CURRENT(meta, recno)					\
-    ((recno) > (meta)->cur_recno &&					\
+    ((recno) >= (meta)->cur_recno &&					\
     ((meta)->first_recno <= (meta)->cur_recno ||			\
     ((recno) < (meta)->first_recno &&					\
     (recno) - (meta)->cur_recno < (meta)->first_recno - (recno))))
 
 #define	QAM_BEFORE_FIRST(meta, recno)					\
     ((recno) < (meta)->first_recno &&					\
-    ((meta->first_recno <= (meta)->cur_recno ||				\
+    ((meta)->first_recno <= (meta)->cur_recno ||			\
     ((recno) > (meta)->cur_recno &&					\
-    (recno) - (meta)->cur_recno > (meta)->first_recno - (recno)))))
+    (recno) - (meta)->cur_recno > (meta)->first_recno - (recno))))
 
 #define	QAM_NOT_VALID(meta, recno)					\
     (recno == RECNO_OOB ||						\
@@ -141,18 +146,10 @@ typedef struct __qam_filelist {
 #define	QAM_SETCUR		0x02
 #define	QAM_TRUNCATE		0x04
 
-/*
- * Parameter to __qam_position.
- */
-typedef enum {
-	QAM_READ,
-	QAM_WRITE,
-	QAM_CONSUME
-} qam_position_mode;
-
 typedef enum {
 	QAM_PROBE_GET,
 	QAM_PROBE_PUT,
+	QAM_PROBE_DIRTY,
 	QAM_PROBE_MPF
 } qam_probe_mode;
 
@@ -165,11 +162,18 @@ typedef enum {
 	QAM_NAME_REMOVE
 } qam_name_op;
 
-#define	__qam_fget(dbp, pgnoaddr, flags, addrp) \
-	__qam_fprobe(dbp, *pgnoaddr, addrp, QAM_PROBE_GET, flags)
+#define	__qam_fget(dbp, pgnoaddr, lsnp, flags, addrp) \
+	__qam_fprobe(dbp, *pgnoaddr, lsnp, addrp, QAM_PROBE_GET, flags)
+
+#define	__qam_fput(dbp, pgno, addrp, flags) \
+	__qam_fprobe(dbp, pgno, NULL, addrp, QAM_PROBE_PUT, flags)
+
+#define	__qam_dirty(dbp, pgno, pagep, lsnp, flags) \
+	__qam_fprobe(dbp, pgno, lsnp, pagep, QAM_PROBE_DIRTY, flags)
 
-#define	__qam_fput(dbp, pageno, addrp, flags) \
-	__qam_fprobe(dbp, pageno, addrp, QAM_PROBE_PUT, flags)
+#if defined(__cplusplus)
+}
+#endif
 
 #include "dbinc_auto/qam_auto.h"
 #include "dbinc_auto/qam_ext.h"
diff --git a/db/dbinc/queue.h b/db/dbinc/queue.h
index bf09b12d7..d76f2019f 100644
--- a/db/dbinc/queue.h
+++ b/db/dbinc/queue.h
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
diff --git a/db/dbinc/region.h b/db/dbinc/region.h
index 98f6ea07b..d184f4418 100644
--- a/db/dbinc/region.h
+++ b/db/dbinc/region.h
@@ -1,10 +1,10 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1998-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1998-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: region.h,v 11.51 2004/10/15 16:59:39 bostic Exp $
+ * $Id: region.h,v 12.9 2006/08/24 14:45:30 bostic Exp $
  */
 
 #ifndef _DB_REGION_H_
@@ -24,16 +24,18 @@
  *	file mapped into memory (mmap, MapViewOfFile)
  *	system memory (shmget, CreateFileMapping)
  *
- * If the regions are private to a process, they're in malloc.  If they're
- * public, they're in file mapped memory, or, optionally, in system memory.
+ * By default, regions are created in filesystem-backed shared memory.  They
+ * can also be created in system shared memory (DB_SYSTEM_MEM), or, if private
+ * to a process, in heap memory (DB_PRIVATE).
+ *
  * Regions in the filesystem are named "__db.001", "__db.002" and so on.  If
- * we're not using a private environment allocated using malloc(3), the file
- * "__db.001" will always exist, as we use it to synchronize on the regions,
- * whether they exist in file mapped memory or system memory.
+ * we're not using a private environment allocated in heap, "__db.001" will
+ * always exist, as we use it to synchronize on the regions, whether they are
+ * in filesystem-backed memory or system memory.
  *
- * The file "__db.001" contains a REGENV structure and a linked list of some
- * number of REGION structures.  Each of the REGION structures describes and
- * locks one of the underlying shared regions used by DB.
+ * The file "__db.001" contains a REGENV structure and an array of REGION
+ * structures.  Each REGION structures describes an underlying chunk of
+ * shared memory.
  *
  *	__db.001
  *	+---------+
@@ -49,22 +51,32 @@
  *	|	  |   +----------+
  *	+---------+
  *
- * The only tricky part about manipulating the regions is correctly creating
- * or joining the REGENV file, i.e., __db.001.  We have to be absolutely sure
- * that only one process creates it, and that everyone else joins it without
- * seeing inconsistent data.  Once that region is created, we can use normal
- * shared locking procedures to do mutual exclusion for all other regions.
+ * The tricky part about manipulating the regions is creating or joining the
+ * database environment.  We have to be sure only a single thread of control
+ * creates and/or recovers a database environment.  All other threads should
+ * then join without seeing inconsistent data.
+ *
+ * We do this in two parts: first, we use the underlying O_EXCL flag to the
+ * open system call to serialize creation of the __db.001 file.  The thread
+ * of control creating that file then proceeds to create the remaining
+ * regions in the environment, including the mutex region.  Once the mutex
+ * region has been created, the creating thread of control fills in the
+ * __db.001 file's magic number.  Other threads of control (the ones that
+ * didn't create the __db.001 file), wait on the initialization of the
+ * __db.001 file's magic number.  After it has been initialized, all threads
+ * of control can proceed, using normal shared mutex locking procedures for
+ * exclusion.
  *
- * One of the REGION structures in the main environment region describes the
- * environment region itself.
+ * REGIONs are not moved or removed during the life of the environment, and
+ * so processes can have long-lived references to them.
  *
- * To lock a region, locate the REGION structure that describes it and acquire
- * the region's mutex.  There is one exception to this rule -- the lock for the
- * environment region itself is in the REGENV structure, and not in the REGION
- * that describes the environment region.  That's so that we can acquire a lock
- * without walking linked lists that could potentially change underneath us.
- * The REGION will not be moved or removed during the life of the region, and
- * so long-lived references to it can be held by the process.
+ * One of the REGION structures describes the environment region itself.
+ *
+ * The REGION array is not locked in any way.  It's an array so we don't have
+ * to manipulate data structures after a crash -- on some systems, we have to
+ * join and clean up the mutex region after application failure.  Using an
+ * array means we don't have to worry about broken links or other nastiness
+ * after the failure.
  *
  * All requests to create or join a region return a REGINFO structure, which
  * is held by the caller and used to open and subsequently close the reference
@@ -82,17 +94,19 @@
  * Although DB does not currently grow regions when they run out of memory, it
  * would be possible to do so.  To grow a region, allocate a new region of the
  * appropriate size, then copy the old region over it and insert the additional
- * space into the already existing shalloc arena.  Callers may have to fix up
- * local references, but that should be easy to do.  This failed in historic
- * versions of DB because the region lock lived in the mapped memory, and when
- * it was unmapped and remapped (or copied), threads could lose track of it.
- * Once we moved that lock into a region that is never unmapped, growing should
- * work.  That all said, current versions of DB don't implement region grow
- * because some systems don't support mutex copying, e.g., from OSF1 V4.0:
+ * memory into the already existing shalloc arena.  Region users must reset
+ * their base addresses and any local pointers into the memory, of course.
+ * This failed in historic versions of DB because the region mutexes lived in
+ * the mapped memory, and when it was unmapped and remapped (or copied),
+ * threads could lose track of it.  Also, some systems didn't support mutex
+ * copying, e.g., from OSF1 V4.0:
  *
  *	The address of an msemaphore structure may be significant.  If the
  *	msemaphore structure contains any value copied from an msemaphore
  *	structure at a different address, the result is undefined.
+ *
+ * All mutexes are now maintained in a separate region which is never unmapped,
+ * so growing regions should be possible.
  */
 
 #if defined(__cplusplus)
@@ -138,42 +152,55 @@ typedef struct __db_reg_env_ref {
 typedef struct __db_reg_env {
 	/*
 	 * !!!
-	 * The mutex must be the first entry in the structure to guarantee
-	 * correct alignment.
-	 */
-	DB_MUTEX   mutex;		/* Environment mutex. */
-
-	/*
+	 * The magic, panic, version and envid fields of the region are fixed
+	 * in size, the timestamp field is the first field which is variable
+	 * length.  These fields must never change in order, to guarantee we
+	 * can always read them, no matter what Berkeley DB release we have.
+	 *
 	 * !!!
-	 * Note, the magic and panic fields are NOT protected by any mutex,
-	 * and for this reason cannot be anything more complicated than a
-	 * zero/non-zero value.
+	 * The magic and panic fields are NOT protected by any mutex, and for
+	 * this reason cannot be anything more complicated than zero/non-zero.
 	 */
-	u_int32_t  magic;		/* Valid region magic number. */
-	u_int32_t  envid;		/* Unique environment ID. */
+	u_int32_t magic;		/* Valid region magic number. */
+	u_int32_t panic;		/* Environment is dead. */
 
-	int	   envpanic;		/* Environment is dead. */
+	u_int32_t majver;		/* Major DB version number. */
+	u_int32_t minver;		/* Minor DB version number. */
+	u_int32_t patchver;		/* Patch DB version number. */
 
-	int	   majver;		/* Major DB version number. */
-	int	   minver;		/* Minor DB version number. */
-	int	   patch;		/* Patch DB version number. */
+	u_int32_t envid;		/* Unique environment ID. */
 
-	u_int32_t  init_flags;		/* Flags the env was initialized with.*/
-	roff_t	   cipher_off;		/* Offset of cipher area */
+	time_t	  timestamp;		/* Creation time. */
 
-					/* List of regions. */
-	SH_LIST_HEAD(__db_regionh) regionq;
+	u_int32_t init_flags;		/* Flags environment initialized with.*/
 
+	/*
+	 * The mtx_regenv mutex protects the environment reference count and
+	 * memory allocation from the primary shared region (the crypto and
+	 * replication implementations allocate memory from the primary shared
+	 * region).  The rest of the fields are initialized at creation time,
+	 * and so don't need mutex protection.  The flags, op_timestamp and
+	 * rep_timestamp fields are used by replication only and are
+	 * protected * by the replication mutex.  The rep_timestamp is
+	 * is not protected when it is used in recovery as that is already
+	 * single threaded.
+	 */
+	db_mutex_t mtx_regenv;		/* Refcnt, region allocation mutex. */
 	u_int32_t  refcnt;		/* References to the environment. */
 
-	roff_t	   rep_off;		/* Offset of the replication area. */
+	u_int32_t region_cnt;		/* Number of REGIONs. */
+	roff_t	  region_off;		/* Offset of region array */
+
+	roff_t	  cipher_off;		/* Offset of cipher area */
+
+	roff_t	  rep_off;		/* Offset of the replication area. */
 #define	DB_REGENV_REPLOCKED	0x0001	/* Env locked for rep backup. */
-	u_int32_t  flags;		/* Shared environment flags. */
+	u_int32_t flags;		/* Shared environment flags. */
 #define	DB_REGENV_TIMEOUT	30	/* Backup timeout. */
-	time_t	   op_timestamp;	/* Timestamp for operations. */
-	time_t	   rep_timestamp;	/* Timestamp for rep db handles. */
+	time_t	  op_timestamp;		/* Timestamp for operations. */
+	time_t	  rep_timestamp;	/* Timestamp for rep db handles. */
 
-	size_t	   pad;			/* Guarantee that following memory is
+	size_t	pad;			/* Guarantee that following memory is
 					 * size_t aligned.  This is necessary
 					 * because we're going to store the
 					 * allocation region information there.
@@ -182,24 +209,15 @@ typedef struct __db_reg_env {
 
 /* Per-region shared region information. */
 typedef struct __db_region {
-	/*
-	 * !!!
-	 * The mutex must be the first entry in the structure to guarantee
-	 * correct alignment.
-	 */
-	DB_MUTEX   mutex;		/* Region mutex. */
+	u_int32_t	id;		/* Region id. */
+	reg_type_t	type;		/* Region type. */
 
-	SH_LIST_ENTRY q;		/* Linked list of REGIONs. */
+	roff_t	size_orig;		/* Region size in bytes (original). */
+	roff_t	size;			/* Region size in bytes (adjusted). */
 
-	reg_type_t type;		/* Region type. */
-	u_int32_t  id;			/* Region id. */
+	roff_t	primary;		/* Primary data structure offset. */
 
-	roff_t	   size_orig;		/* Region size in bytes (original). */
-	roff_t	   size;		/* Region size in bytes (adjusted). */
-
-	roff_t	   primary;		/* Primary data structure offset. */
-
-	long	   segid;		/* UNIX shmget(2), Win16 segment ID. */
+	long	segid;			/* UNIX shmget(2), Win16 segment ID. */
 } REGION;
 
 /*
@@ -232,26 +250,6 @@ struct __db_reginfo_t {		/* __db_r_attach IN parameters. */
 	u_int32_t   flags;
 };
 
-/*
- * Mutex maintenance information each subsystem region must keep track
- * of to manage resources adequately.
- */
-typedef struct __db_regmaint_stat_t {
-	u_int32_t	st_hint_hit;
-	u_int32_t	st_hint_miss;
-	u_int32_t	st_records;
-	u_int32_t	st_clears;
-	u_int32_t	st_destroys;
-	u_int32_t	st_max_locks;
-} REGMAINT_STAT;
-
-typedef struct __db_regmaint_t {
-	u_int32_t  reglocks;		/* Maximum # of mutexes we track. */
-	u_int32_t  regmutex_hint;	/* Hint for next slot */
-	REGMAINT_STAT stat;		/* Stats */
-	roff_t	   regmutexes[1];	/* Region mutexes in use. */
-} REGMAINT;
-
 /*
  * R_ADDR	Return a per-process address for a shared region offset.
  * R_OFFSET	Return a shared region offset for a per-process address.
@@ -263,40 +261,13 @@ typedef struct __db_regmaint_t {
 	(F_ISSET((reginfop)->dbenv, DB_ENV_PRIVATE) ? (roff_t)(p) :	\
 	(roff_t)((u_int8_t *)(p) - (u_int8_t *)(reginfop)->addr))
 
-/*
- * R_LOCK	Lock/unlock a region.
- * R_UNLOCK
- */
-#define	R_LOCK(dbenv, reginfo)						\
-	MUTEX_LOCK(dbenv, &(reginfo)->rp->mutex)
-#define	R_UNLOCK(dbenv, reginfo)					\
-	MUTEX_UNLOCK(dbenv, &(reginfo)->rp->mutex)
-
 /* PANIC_CHECK:	Check to see if the DB environment is dead. */
 #define	PANIC_CHECK(dbenv)						\
-	if (!F_ISSET((dbenv), DB_ENV_NOPANIC) &&			\
-	    (dbenv)->reginfo != NULL && ((REGENV *)			\
-	    ((REGINFO *)(dbenv)->reginfo)->primary)->envpanic != 0)	\
+	if ((dbenv)->reginfo != NULL && ((REGENV *)			\
+	    ((REGINFO *)(dbenv)->reginfo)->primary)->panic != 0 &&	\
+	    !F_ISSET((dbenv), DB_ENV_NOPANIC))				\
 		return (__db_panic_msg(dbenv));
 
-#define	PANIC_SET(dbenv, onoff)						\
-	if ((dbenv)->reginfo != NULL)					\
-		((REGENV *)((REGINFO *)					\
-		    (dbenv)->reginfo)->primary)->envpanic = (onoff);
-
-/*
- * All regions are created on 8K boundaries out of sheer paranoia, so we
- * don't make some underlying VM unhappy. Make sure we don't overflow or
- * underflow.
- */
-#define	OS_VMPAGESIZE		(8 * 1024)
-#define	OS_VMROUNDOFF(i) {						\
-	if ((i) <							\
-	    (UINT32_MAX - OS_VMPAGESIZE) + 1 || (i) < OS_VMPAGESIZE)	\
-		(i) += OS_VMPAGESIZE - 1;				\
-	(i) -= (i) % OS_VMPAGESIZE;					\
-}
-
 #if defined(__cplusplus)
 }
 #endif
diff --git a/db/dbinc/rep.h b/db/dbinc/rep.h
index ec1f290f4..f1ea36e2f 100644
--- a/db/dbinc/rep.h
+++ b/db/dbinc/rep.h
@@ -1,46 +1,107 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2001-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2001-2006
+ *	Oracle Corporation.  All rights reserved.
+ *
+ * $Id: rep.h,v 12.57 2006/09/12 01:06:35 alanb Exp $
  */
 
-#ifndef _REP_H_
-#define	_REP_H_
+#ifndef _DB_REP_H_
+#define	_DB_REP_H_
 
 #include "dbinc_auto/rep_auto.h"
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*
+ * Names of client temp databases.
+ */
+#define	REPDBNAME	"__db.rep.db"
+#define	REPPAGENAME     "__db.reppg.db"
+
+/*
+ * Message types
+ */
+#define	REP_INVALID	0	/* Invalid message type. */
 #define	REP_ALIVE	1	/* I am alive message. */
 #define	REP_ALIVE_REQ	2	/* Request for alive messages. */
 #define	REP_ALL_REQ	3	/* Request all log records greater than LSN. */
-#define	REP_DUPMASTER	4	/* Duplicate master detected; propagate. */
-#define	REP_FILE	5	/* Page of a database file. NOTUSED */
-#define	REP_FILE_FAIL	6	/* File requested does not exist. */
-#define	REP_FILE_REQ	7	/* Request for a database file. NOTUSED */
-#define	REP_LOG		8	/* Log record. */
-#define	REP_LOG_MORE	9	/* There are more log records to request. */
-#define	REP_LOG_REQ	10	/* Request for a log record. */
-#define	REP_MASTER_REQ	11	/* Who is the master */
-#define	REP_NEWCLIENT	12	/* Announces the presence of a new client. */
-#define	REP_NEWFILE	13	/* Announce a log file change. */
-#define	REP_NEWMASTER	14	/* Announces who the master is. */
-#define	REP_NEWSITE	15	/* Announces that a site has heard from a new
+#define	REP_BULK_LOG	4	/* Bulk transfer of log records. */
+#define	REP_BULK_PAGE	5	/* Bulk transfer of pages. */
+#define	REP_DUPMASTER	6	/* Duplicate master detected; propagate. */
+#define	REP_FILE	7	/* Page of a database file. NOTUSED */
+#define	REP_FILE_FAIL	8	/* File requested does not exist. */
+#define	REP_FILE_REQ	9	/* Request for a database file. NOTUSED */
+#define	REP_LOG		10	/* Log record. */
+#define	REP_LOG_MORE	11	/* There are more log records to request. */
+#define	REP_LOG_REQ	12	/* Request for a log record. */
+#define	REP_MASTER_REQ	13	/* Who is the master */
+#define	REP_NEWCLIENT	14	/* Announces the presence of a new client. */
+#define	REP_NEWFILE	15	/* Announce a log file change. */
+#define	REP_NEWMASTER	16	/* Announces who the master is. */
+#define	REP_NEWSITE	17	/* Announces that a site has heard from a new
 				 * site; like NEWCLIENT, but indirect.  A
 				 * NEWCLIENT message comes directly from the new
 				 * client while a NEWSITE comes indirectly from
 				 * someone who heard about a NEWSITE.
 				 */
-#define	REP_PAGE	16	/* Database page. */
-#define	REP_PAGE_FAIL	17	/* Requested page does not exist. */
-#define	REP_PAGE_MORE	18	/* There are more pages to request. */
-#define	REP_PAGE_REQ	19	/* Request for a database page. */
-#define	REP_UPDATE	20	/* Environment hotcopy information. */
-#define	REP_UPDATE_REQ	21	/* Request for hotcopy information. */
-#define	REP_VERIFY	22	/* A log record for verification. */
-#define	REP_VERIFY_FAIL	23	/* The client is outdated. */
-#define	REP_VERIFY_REQ	24	/* Request for a log record to verify. */
-#define	REP_VOTE1	25	/* Send out your information for an election. */
-#define	REP_VOTE2	26	/* Send a "you are master" vote. */
+#define	REP_PAGE	18	/* Database page. */
+#define	REP_PAGE_FAIL	19	/* Requested page does not exist. */
+#define	REP_PAGE_MORE	20	/* There are more pages to request. */
+#define	REP_PAGE_REQ	21	/* Request for a database page. */
+#define	REP_REREQUEST	22	/* Force rerequest. */
+#define	REP_UPDATE	23	/* Environment hotcopy information. */
+#define	REP_UPDATE_REQ	24	/* Request for hotcopy information. */
+#define	REP_VERIFY	25	/* A log record for verification. */
+#define	REP_VERIFY_FAIL	26	/* The client is outdated. */
+#define	REP_VERIFY_REQ	27	/* Request for a log record to verify. */
+#define	REP_VOTE1	28	/* Send out your information for an election. */
+#define	REP_VOTE2	29	/* Send a "you are master" vote. */
+
+/*
+ * Maximum message number for conversion tables.  Update this
+ * value as the largest message number above increases.
+ *
+ * !!!
+ * NOTE: When changing messages above, the two tables for upgrade support
+ * need adjusting.  They are in rep_record.c.
+ */
+#define	REP_MAX_MSG	29
+
+/*
+ * This is the list of client-to-client requests messages.
+ * We use this to decide if we're doing client-to-client and
+ * might need to send a rerequest.
+ */
+#define	REP_MSG_REQ(rectype)			\
+    (rectype == REP_ALL_REQ ||			\
+    rectype == REP_LOG_REQ ||			\
+    rectype == REP_PAGE_REQ ||			\
+    rectype == REP_VERIFY_REQ)
+
+/*
+ * Note that the version information should be at the beginning of the
+ * structure, so that we can rearrange the rest of it while letting the
+ * version checks continue to work.  DB_REPVERSION should be revved any time
+ * the rest of the structure changes or when the message numbers change.
+ *
+ * Define also, the corresponding log versions that are tied to the
+ * replication/release versions.  These are only used in replication
+ * and that is why they're defined here.
+ */
+#define	DB_LOGVERSION_42	8
+#define	DB_LOGVERSION_43	10
+#define	DB_LOGVERSION_44	11
+#define	DB_LOGVERSION_45	12
+#define	DB_REPVERSION_INVALID	0
+#define	DB_REPVERSION_42	1
+#define	DB_REPVERSION_43	2
+#define	DB_REPVERSION_44	3
+#define	DB_REPVERSION_45	3
+#define	DB_REPVERSION	3
 
 /*
  * REP_PRINT_MESSAGE
@@ -52,40 +113,42 @@
  * !!! This function assumes a local DB_MSGBUF variable called 'mb'.
  */
 #ifdef DIAGNOSTIC
-#define	REP_PRINT_MESSAGE(dbenv, eid, rp, str)				\
-	__rep_print_message(dbenv, eid, rp, str)
-#define RPRINT(e, r, x) do {						\
+#define	REP_PRINT_MESSAGE(dbenv, eid, rp, str, fl)			\
+	__rep_print_message(dbenv, eid, rp, str, fl)
+#define	RPRINT(e, x) do {						\
 	if (FLD_ISSET((e)->verbose, DB_VERB_REPLICATION)) {		\
 		DB_MSGBUF_INIT(&mb);					\
-		if ((e)->db_errpfx == NULL) {				\
-			if (F_ISSET((r), REP_F_CLIENT))			\
+		if ((e)->db_errpfx != NULL)				\
+			__db_msgadd((e), &mb, "%s: ", (e)->db_errpfx);	\
+		else if (REP_ON(e)) {					\
+			REP *_r = (e)->rep_handle->region;		\
+			if (F_ISSET(_r, REP_F_CLIENT))			\
 				__db_msgadd((e), &mb, "CLIENT: ");	\
-			else if (F_ISSET((r), REP_F_MASTER))		\
+			else if (F_ISSET((_r), REP_F_MASTER))		\
 				__db_msgadd((e), &mb, "MASTER: ");	\
 			else						\
 				__db_msgadd((e), &mb, "REP_UNDEF: ");	\
 		} else							\
-			__db_msgadd((e), &mb, "%s: ",(e)->db_errpfx);	\
+			__db_msgadd((e), &mb, "REP_UNDEF: ");		\
 		__db_msgadd x;						\
 		DB_MSGBUF_FLUSH((e), &mb);				\
 	}								\
-} while (0)	
+} while (0)
 #else
-#define	REP_PRINT_MESSAGE(dbenv, eid, rp, str)
-#define RPRINT(e, r, x)
+#define	REP_PRINT_MESSAGE(dbenv, eid, rp, str, fl)
+#define	RPRINT(e, x)
 #endif
 
 /*
  * Election gen file name
- *	The file contains an egen number for an election this client
- * has NOT participated in.  I.e. it is the number of a future
- * election.  We create it when we create the rep region, if it
- * doesn't already exist and initialize egen to 1.  If it does
- * exist, we read it when we create the rep region.  We write it
- * immediately before sending our VOTE1 in an election.  That way,
- * if a client has ever sent a vote for any election, the file is
- * already going to be updated to reflect a future election,
- * should it crash.
+ * The file contains an egen number for an election this client has NOT
+ * participated in.  I.e. it is the number of a future election.  We
+ * create it when we create the rep region, if it doesn't already exist
+ * and initialize egen to 1.  If it does exist, we read it when we create
+ * the rep region.  We write it immediately before sending our VOTE1 in
+ * an election.  That way, if a client has ever sent a vote for any
+ * election, the file is already going to be updated to reflect a future
+ * election, should it crash.
  */
 #define	REP_EGENNAME	"__db.rep.egen"
 
@@ -97,21 +160,24 @@ typedef enum {
 	REP_PG		/* Pg database. */
 } repdb_t;
 
-/* Shared replication structure. */
+/* Macros to lock/unlock the replication region as a whole. */
+#define	REP_SYSTEM_LOCK(dbenv)						\
+	MUTEX_LOCK(dbenv, (dbenv)->rep_handle->region->mtx_region)
+#define	REP_SYSTEM_UNLOCK(dbenv)					\
+	MUTEX_UNLOCK(dbenv, (dbenv)->rep_handle->region->mtx_region)
 
+/*
+ * REP --
+ * Shared replication structure.
+ */
 typedef struct __rep {
-	/*
-	 * Due to alignment constraints on some architectures (e.g. HP-UX),
-	 * DB_MUTEXes must be the first element of shalloced structures,
-	 * and as a corollary there can be only one per structure.  Thus,
-	 * db_mutex_off points to a mutex in a separately-allocated chunk.
-	 */
-	DB_MUTEX	mutex;		/* Region lock. */
-	roff_t		db_mutex_off;	/* Client database mutex. */
+	db_mutex_t	mtx_region;	/* Region mutex. */
+	db_mutex_t	mtx_clientdb;	/* Client database mutex. */
 	roff_t		tally_off;	/* Offset of the tally region. */
 	roff_t		v2tally_off;	/* Offset of the vote2 tally region. */
 	int		eid;		/* Environment id. */
 	int		master_id;	/* ID of the master site. */
+	u_int32_t	version;	/* Current replication version. */
 	u_int32_t	egen;		/* Replication election generation. */
 	u_int32_t	gen;		/* Replication generation number. */
 	u_int32_t	recover_gen;	/* Last generation number in log. */
@@ -119,6 +185,8 @@ typedef struct __rep {
 	int		nsites;		/* Number of sites in group. */
 	int		nvotes;		/* Number of votes needed. */
 	int		priority;	/* My priority in an election. */
+	int		config_nsites;
+	db_timeout_t	elect_timeout;
 	u_int32_t	gbytes;		/* Limit on data sent in single... */
 	u_int32_t	bytes;		/* __rep_process_message call. */
 #define	DB_REP_REQUEST_GAP	4
@@ -130,19 +198,20 @@ typedef struct __rep {
 	/* Status change information */
 	int		elect_th;	/* A thread is in rep_elect. */
 	u_int32_t	msg_th;		/* Number of callers in rep_proc_msg. */
-	int		start_th;	/* A thread is in rep_start. */
+	int		lockout_th;	/* A thread is in msg lockout. */
 	u_int32_t	handle_cnt;	/* Count of handles in library. */
 	u_int32_t	op_cnt;		/* Multi-step operation count.*/
 	int		in_recovery;	/* Running recovery now. */
 
 	/* Backup information. */
-	int		nfiles;		/* Number of files we have info on. */
-	int		curfile;	/* Current file we're getting. */
+	u_int32_t	nfiles;		/* Number of files we have info on. */
+	u_int32_t	curfile;	/* Current file we're getting. */
 	__rep_fileinfo_args	*curinfo;	/* Current file info ptr. */
 	void		*finfo;		/* Current file info buffer. */
 	void		*nextinfo;	/* Next file info buffer. */
 	void		*originfo;	/* Original file info buffer. */
 	DB_LSN		first_lsn;	/* Earliest LSN we need. */
+	u_int32_t	first_vers;	/* Log version of first log file. */
 	DB_LSN		last_lsn;	/* Latest LSN we need. */
 	db_pgno_t	ready_pg;	/* Next pg expected. */
 	db_pgno_t	waiting_pg;	/* First pg after gap. */
@@ -160,22 +229,32 @@ typedef struct __rep {
 	DB_LSN		w_lsn;		/* Winner LSN. */
 	u_int32_t	w_tiebreaker;	/* Winner tiebreaking value. */
 	int		votes;		/* Number of votes for this site. */
+	u_int32_t	esec;		/* Election start seconds. */
+	u_int32_t	eusec;		/* Election start useconds. */
 
 	/* Statistics. */
 	DB_REP_STAT	stat;
 
+	/* Configuration. */
+#define	REP_C_BULK		0x00001		/* Bulk transfer. */
+#define	REP_C_DELAYCLIENT	0x00002		/* Delay client sync-up. */
+#define	REP_C_NOAUTOINIT	0x00004		/* No auto initialization. */
+#define	REP_C_NOWAIT		0x00008		/* Immediate error return. */
+	u_int32_t	config;		/* Configuration flags. */
+
 #define	REP_F_CLIENT		0x00001		/* Client replica. */
-#define	REP_F_EPHASE1		0x00002		/* In phase 1 of election. */
-#define	REP_F_EPHASE2		0x00004		/* In phase 2 of election. */
-#define	REP_F_MASTER		0x00008		/* Master replica. */
-#define	REP_F_MASTERELECT	0x00010		/* Master elect */
-#define	REP_F_NOARCHIVE		0x00020		/* Rep blocks log_archive */
-#define	REP_F_READY		0x00040		/* Wait for txn_cnt to be 0. */
-#define	REP_F_RECOVER_LOG	0x00080		/* In recovery - log. */
-#define	REP_F_RECOVER_PAGE	0x00100		/* In recovery - pages. */
-#define	REP_F_RECOVER_UPDATE	0x00200		/* In recovery - files. */
-#define	REP_F_RECOVER_VERIFY	0x00400		/* In recovery - verify. */
-#define	REP_F_TALLY		0x00800		/* Tallied vote before elect. */
+#define	REP_F_DELAY		0x00002		/* Delaying client sync-up. */
+#define	REP_F_EPHASE1		0x00004		/* In phase 1 of election. */
+#define	REP_F_EPHASE2		0x00008		/* In phase 2 of election. */
+#define	REP_F_MASTER		0x00010		/* Master replica. */
+#define	REP_F_MASTERELECT	0x00020		/* Master elect */
+#define	REP_F_NOARCHIVE		0x00040		/* Rep blocks log_archive */
+#define	REP_F_READY		0x00080		/* Wait for txn_cnt to be 0. */
+#define	REP_F_RECOVER_LOG	0x00100		/* In recovery - log. */
+#define	REP_F_RECOVER_PAGE	0x00200		/* In recovery - pages. */
+#define	REP_F_RECOVER_UPDATE	0x00400		/* In recovery - files. */
+#define	REP_F_RECOVER_VERIFY	0x00800		/* In recovery - verify. */
+#define	REP_F_TALLY		0x01000		/* Tallied vote before elect. */
 	u_int32_t	flags;
 } REP;
 
@@ -184,47 +263,65 @@ typedef struct __rep {
  * REP_F_READY and all REP_F_RECOVER*.  This must change if the values
  * of the flags change.
  */
-#define	REP_F_RECOVER_MASK					\
-    (REP_F_READY | REP_F_RECOVER_LOG | REP_F_RECOVER_PAGE |	\
+#define	REP_F_RECOVER_MASK						\
+    (REP_F_READY | REP_F_RECOVER_LOG | REP_F_RECOVER_PAGE |		\
      REP_F_RECOVER_UPDATE | REP_F_RECOVER_VERIFY)
 
-#define	IN_ELECTION(R)		F_ISSET((R), REP_F_EPHASE1 | REP_F_EPHASE2)
+#define	IN_ELECTION(R)							\
+	F_ISSET((R), REP_F_EPHASE1 | REP_F_EPHASE2)
 #define	IN_ELECTION_TALLY(R) \
 	F_ISSET((R), REP_F_EPHASE1 | REP_F_EPHASE2 | REP_F_TALLY)
+#define	ELECTION_MAJORITY(n) (((n) / 2) + 1)
+
 #define	IS_REP_MASTER(dbenv)						\
-	(REP_ON(dbenv) && ((DB_REP *)(dbenv)->rep_handle)->region &&	\
-	    F_ISSET(((REP *)((DB_REP *)(dbenv)->rep_handle)->region),	\
-	    REP_F_MASTER))
+	(REP_ON(dbenv) &&						\
+	    F_ISSET(((REP *)(dbenv)->rep_handle->region), REP_F_MASTER))
 
 #define	IS_REP_CLIENT(dbenv)						\
-	(REP_ON(dbenv) && ((DB_REP *)(dbenv)->rep_handle)->region &&	\
-	    F_ISSET(((REP *)((DB_REP *)(dbenv)->rep_handle)->region),	\
-	    REP_F_CLIENT))
+	(REP_ON(dbenv) &&						\
+	    F_ISSET(((REP *)(dbenv)->rep_handle->region), REP_F_CLIENT))
 
 #define	IS_CLIENT_PGRECOVER(dbenv)					\
 	(IS_REP_CLIENT(dbenv) &&					\
-	    F_ISSET(((REP *)((DB_REP *)(dbenv)->rep_handle)->region),   \
-	    REP_F_RECOVER_PAGE))
+	    F_ISSET(((REP *)(dbenv)->rep_handle->region), REP_F_RECOVER_PAGE))
 
 /*
- * Macros to figure out if we need to do replication pre/post-amble
- * processing.
+ * Macros to figure out if we need to do replication pre/post-amble processing.
+ * Skip for specific DB handles owned by the replication layer, either because
+ * replication is running recovery or because it's a handle entirely owned by
+ * the replication code (replication opens its own databases to track state).
  */
-#define	IS_REPLICATED(E, D)						\
-	(!F_ISSET((D), DB_AM_RECOVER | DB_AM_REPLICATION) &&		\
-	REP_ON(E) && ((DB_REP *)((E)->rep_handle))->region != NULL &&	\
-	((DB_REP *)((E)->rep_handle))->region->flags != 0)
+#define	IS_ENV_REPLICATED(dbenv)					\
+	(REP_ON(dbenv) && (dbenv)->rep_handle->region->flags != 0)
 
-#define	IS_ENV_REPLICATED(E) (REP_ON(E) &&		\
-	((DB_REP *)((E)->rep_handle))->region != NULL &&		\
-	((DB_REP *)((E)->rep_handle))->region->flags != 0)
+/*
+ * Gap processing flags.  These provide control over the basic
+ * gap processing algorithm for some special cases.
+ */
+#define	REP_GAP_FORCE		0x001	/* Force a request for a gap. */
+#define	REP_GAP_REREQUEST	0x002	/* Gap request is a forced rerequest. */
+					/* REREQUEST is a superset of FORCE. */
+
+/*
+ * Basic pre/post-amble processing.
+ */
+#define	REPLICATION_WRAP(dbenv, func_call, ret) do {			\
+	int __rep_check, __t_ret;					\
+	__rep_check = IS_ENV_REPLICATED(dbenv) ? 1 : 0;			\
+	if (__rep_check && ((ret) = __env_rep_enter(dbenv, 0)) != 0)	\
+		return ((ret));						\
+	(ret) = func_call;						\
+	if (__rep_check &&						\
+	    (__t_ret = __env_db_rep_exit(dbenv)) != 0 && (ret) == 0)	\
+		(ret) = __t_ret;					\
+} while (0)
 
 /*
  * Per-process replication structure.
  *
  * There are 2 mutexes used in replication.
- * 1.  rep_mutexp - This protects the fields of the rep region above.
- * 2.  db_mutexp - This protects the per-process flags, and bookkeeping
+ * 1.  mtx_region - This protects the fields of the rep region above.
+ * 2.  mtx_clientdb - This protects the per-process flags, and bookkeeping
  * database and all of the components that maintain it.  Those
  * components include the following fields in the log region (see log.h):
  *	a. ready_lsn
@@ -233,50 +330,143 @@ typedef struct __rep {
  *	d. wait_recs
  *	e. rcvd_recs
  *	f. max_wait_lsn
- * These fields in the log region are NOT protected by the log
- * region lock at all.
+ * These fields in the log region are NOT protected by the log region lock at
+ * all.
  *
- * Note that the per-process flags should truly be protected by a
- * special per-process thread mutex, but it is currently set in so
- * isolated a manner that it didn't make sense to do so and in most
- * case we're already holding the db_mutexp anyway.
+ * Note that the per-process flags should truly be protected by a special
+ * per-process thread mutex, but it is currently set in so isolated a manner
+ * that it didn't make sense to do so and in most case we're already holding
+ * the mtx_clientdb anyway.
  *
- * The lock ordering protocol is that db_mutexp must be acquired
- * first and then either rep_mutexp, or the log region mutex may
- * be acquired if necessary.
+ * The lock ordering protocol is that mtx_clientdb must be acquired first and
+ * then either REP->mtx_region, or the LOG->mtx_region mutex may be acquired if
+ * necessary.
  */
 struct __db_rep {
-	DB_MUTEX	*rep_mutexp;	/* Mutex for rep region */
+	/*
+	 * Shared configuration information -- copied to and maintained in the
+	 * shared region as soon as the shared region is created.
+	 */
+	int		eid;		/* Environment ID. */
+
+	u_int32_t	gbytes;		/* Limit on data sent in single... */
+	u_int32_t	bytes;		/* __rep_process_message call. */
+
+	u_int32_t	request_gap;	/* # of records to receive before we
+					 * request a missing log record. */
+	u_int32_t	max_gap;	/* Maximum number of records before
+					 * requesting a missing log record. */
+
+	u_int32_t	config;		/* Configuration flags. */
+	int		config_nsites;
+	db_timeout_t	elect_timeout;
+	int		my_priority;
+	/*
+	 * End of shared configuration information.
+	 */
+
+	int		(*send)		/* Send function. */
+			    __P((DB_ENV *, const DBT *, const DBT *,
+			    const DB_LSN *, int, u_int32_t));
 
-	DB_MUTEX	*db_mutexp;	/* Mutex for bookkeeping database. */
 	DB		*rep_db;	/* Bookkeeping database. */
 
 	REP		*region;	/* In memory structure. */
+	u_int8_t	*bulk;		/* Shared memory bulk area. */
+
 #define	DBREP_OPENFILES		0x0001	/* This handle has opened files. */
 	u_int32_t	flags;		/* per-process flags. */
+
+#ifdef HAVE_REPLICATION_THREADS
+	/*
+	 * Replication Framework (repmgr) information.
+	 */
+	int		nthreads;
+	u_int32_t	init_policy;
+	int		perm_policy;
+	int		peer;	/* Site to use for C2C sync. */
+	db_timeout_t	ack_timeout;
+	db_timeout_t	election_retry_wait;
+	db_timeout_t	connection_retry_wait;
+
+	/* Repmgr's copies of rep stuff. */
+	int		master_eid;
+	u_int32_t	generation;
+
+	/* Thread synchronization. */
+	REPMGR_RUNNABLE *selector, **messengers, *elect_thread;
+	mgr_mutex_t	mutex;
+	cond_var_t	queue_nonempty, check_election;
+#ifdef DB_WIN32
+	ACK_WAITERS_TABLE *waiters;
+	HANDLE		signaler;
+	int		wsa_inited;
+#else
+	pthread_cond_t	ack_condition;
+	int		read_pipe, write_pipe;
+	int		chg_sig_handler;
+#endif
+
+	/* Operational stuff. */
+	REPMGR_SITE	*sites;		/* Array of known sites. */
+	u_int		site_cnt;	/* Array slots in use. */
+	u_int		site_max;	/* Total array slots allocated. */
+
+	CONNECTION_LIST	connections;
+	RETRY_Q_HEADER	retries;	/* Sites needing connection retry. */
+	REPMGR_QUEUE	*input_queue;
+
+	socket_t	listen_fd;
+	repmgr_netaddr_t my_addr;
+
+	int		finished;
+	int		done_one; /* TODO: rename */
+	int		found_master;
+
+/* The repertoire of operations we can ask election thread to perform: */
+#define	ELECT_ELECTION 1	/* Call for an election. */
+#define	ELECT_REPSTART 2	/* Call rep_start(CLIENT) to find a master. */
+#define	ELECT_FAILURE_ELECTION 3 /* Do election, adjusting nsites to account
+				    for a failed master. */
+	int		operation_needed; /* Next op for election thread. */
+#endif  /* HAVE_REPLICATION_THREADS */
 };
 
 /*
  * Control structure for replication communication infrastructure.
- *
- * Note that the version information should be at the beginning of the
- * structure, so that we can rearrange the rest of it while letting the
- * version checks continue to work.  DB_REPVERSION should be revved any time
- * the rest of the structure changes or when the message numbers change.
  */
-typedef struct __rep_control {
-#define	DB_REPVERSION	2
+typedef struct {
+#define	DB_REPVERSION	3
 	u_int32_t	rep_version;	/* Replication version number. */
 	u_int32_t	log_version;	/* Log version number. */
 
 	DB_LSN		lsn;		/* Log sequence number. */
 	u_int32_t	rectype;	/* Message type. */
 	u_int32_t	gen;		/* Generation number. */
+/*
+ * Define old DB_LOG_ values that we must support here.
+ */
+#define	DB_LOG_PERM_42_44	0x20
+#define	DB_LOG_RESEND_42_44	0x40
+
+#define	REPCTL_ELECTABLE	0x01	/* Upgraded client is electable. */
+#define	REPCTL_INIT		0x02	/* Internal init message. */
+#define	REPCTL_PERM		DB_LOG_PERM_42_44
+#define	REPCTL_RESEND		DB_LOG_RESEND_42_44
 	u_int32_t	flags;		/* log_put flag value. */
 } REP_CONTROL;
 
+/* Election vote information, 4.2 version.  Does not have nvotes. */
+typedef struct __rep_old_vote {
+	u_int32_t	egen;		/* Election generation. */
+	int		nsites;		/* Number of sites I've been in
+					 * communication with. */
+	int		priority;	/* My site's priority. */
+	u_int32_t	tiebreaker;	/* Tie-breaking quasi-random value. */
+} REP_OLD_VOTE_INFO;
+
 /* Election vote information. */
-typedef struct __rep_vote {
+typedef struct {
 	u_int32_t	egen;		/* Election generation. */
 	int		nsites;		/* Number of sites I've been in
 					 * communication with. */
@@ -285,18 +475,55 @@ typedef struct __rep_vote {
 	u_int32_t	tiebreaker;	/* Tie-breaking quasi-random value. */
 } REP_VOTE_INFO;
 
-typedef struct __rep_vtally {
+typedef struct {
 	u_int32_t	egen;		/* Voter's election generation. */
 	int		eid;		/* Voter's ID. */
 } REP_VTALLY;
 
+/*
+ * The REP_THROTTLE_ONLY flag is used to do throttle processing only.
+ * If set, it will only allow sending the REP_*_MORE message, but not
+ * the normal, non-throttled message.  It is used to support throttling
+ * with bulk transfer.
+ */
+/* Flags for __rep_send_throttle. */
+#define	REP_THROTTLE_ONLY	0x0001	/* Send _MORE message only. */
+
+/* Throttled message processing information. */
+typedef struct {
+	DB_LSN		lsn;		/* LSN of this record. */
+	DBT		*data_dbt;	/* DBT of this record. */
+	u_int32_t	gbytes;		/* This call's max gbytes sent. */
+	u_int32_t	bytes;		/* This call's max bytes sent. */
+	u_int32_t	type;		/* Record type. */
+} REP_THROTTLE;
+
+/* Bulk processing information. */
+/*
+ * !!!
+ * We use a uintptr_t for the offset.  We'd really like to use a ptrdiff_t
+ * since that really is what it is.  But ptrdiff_t is not portable and
+ * doesn't exist everywhere.
+ */
+typedef struct {
+	u_int8_t	*addr;		/* Address of bulk buffer. */
+	uintptr_t	*offp;		/* Ptr to current offset into buffer. */
+	u_int32_t	len;		/* Bulk buffer length. */
+	u_int32_t	type;		/* Item type in buffer (log, page). */
+	DB_LSN		lsn;		/* First LSN in buffer. */
+	int		eid;		/* ID of potential recipients. */
+#define	BULK_FORCE	0x001		/* Force buffer after this record. */
+#define	BULK_XMIT	0x002		/* Buffer in transit. */
+	u_int32_t	*flagsp;	/* Buffer flags. */
+} REP_BULK;
+
 /*
  * This structure takes care of representing a transaction.
  * It holds all the records, sorted by page number so that
  * we can obtain locks and apply updates in a deadlock free
  * order.
  */
-typedef struct __lsn_collection {
+typedef struct {
 	u_int nlsns;
 	u_int nalloc;
 	DB_LSN *array;
@@ -307,11 +534,15 @@ typedef struct __lsn_collection {
  * apply the updates for a single transaction or a collection of
  * transactions.
  */
-typedef struct _linfo {
+typedef struct {
 	int		n;
 	DB_LOCKREQ	*reqs;
 	DBT		*objs;
 } linfo_t;
 
+#if defined(__cplusplus)
+}
+#endif
+
 #include "dbinc_auto/rep_ext.h"
-#endif	/* !_REP_H_ */
+#endif	/* !_DB_REP_H_ */
diff --git a/db/dbinc/repmgr.h b/db/dbinc/repmgr.h
new file mode 100644
index 000000000..c027035f0
--- /dev/null
+++ b/db/dbinc/repmgr.h
@@ -0,0 +1,375 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2006
+ *	Oracle Corporation.  All rights reserved.
+ *
+ * $Id: repmgr.h,v 12.10 2006/09/19 14:14:07 mjc Exp $
+ */
+
+#ifndef _DB_REPMGR_H_
+#define	_DB_REPMGR_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*
+ * Replication Framework message types.  Normal replication messages are
+ * encapsulated in repmgr messages of type REP_MESSAGE.
+ */
+#define	REPMGR_ACK		1	/* Acknowledgement. */
+#define	REPMGR_HANDSHAKE	2	/* Connection establishment sequence. */
+#define	REPMGR_REP_MESSAGE	3	/* Normal replication message. */
+
+#ifdef DB_WIN32
+typedef SOCKET socket_t;
+typedef HANDLE thread_id_t;
+typedef HANDLE mgr_mutex_t;
+typedef HANDLE cond_var_t;
+typedef WSABUF db_iovec_t;
+#else
+typedef int socket_t;
+typedef pthread_t thread_id_t;
+typedef pthread_mutex_t mgr_mutex_t;
+typedef pthread_cond_t cond_var_t;
+typedef struct iovec db_iovec_t;
+#endif
+
+/*
+ * The system value is available from sysconf(_SC_HOST_NAME_MAX).
+ * Historically, the maximum host name was 256.
+ */
+#ifndef MAXHOSTNAMELEN
+#define	MAXHOSTNAMELEN	256
+#endif
+
+/* A buffer big enough for the string "site host.domain.com:65535". */
+#define	MAX_SITE_LOC_STRING (MAXHOSTNAMELEN+20)
+typedef char SITE_STRING_BUFFER[MAX_SITE_LOC_STRING+1];
+
+struct __repmgr_connection;
+    typedef struct __repmgr_connection REPMGR_CONNECTION;
+struct __repmgr_queue; typedef struct __repmgr_queue REPMGR_QUEUE;
+struct __queued_output; typedef struct __queued_output QUEUED_OUTPUT;
+struct __repmgr_retry; typedef struct __repmgr_retry REPMGR_RETRY;
+struct __repmgr_runnable; typedef struct __repmgr_runnable REPMGR_RUNNABLE;
+struct __repmgr_site; typedef struct __repmgr_site REPMGR_SITE;
+struct __ack_waiters_table;
+    typedef struct __ack_waiters_table ACK_WAITERS_TABLE;
+
+typedef TAILQ_HEAD(__repmgr_conn_list, __repmgr_connection) CONNECTION_LIST;
+typedef STAILQ_HEAD(__repmgr_out_q_head, __queued_output) OUT_Q_HEADER;
+typedef TAILQ_HEAD(__repmgr_retry_q, __repmgr_retry) RETRY_Q_HEADER;
+
+/* Information about threads managed by Replication Framework. */
+struct __repmgr_runnable {
+	DB_ENV *dbenv;
+	thread_id_t thread_id;
+	void *(*run) __P((void *));
+	int finished;
+};
+
+typedef struct {
+	u_int32_t tv_sec;
+	u_int32_t tv_usec;
+} repmgr_timeval_t;
+
+/*
+ * Information about pending connection establishment retry operations.
+ *
+ * We keep these in order by time.  This works, under the assumption that the
+ * DB_REP_CONNECTION_RETRY never changes once we get going (though that
+ * assumption is of course wrong, so this needs to be fixed).
+ *
+ * Usually, we put things onto the tail end of the list.  But when we add a new
+ * site while threads are running, we trigger its first connection attempt by
+ * scheduling a retry for "0" microseconds from now, putting its retry element
+ * at the head of the list instead.
+ *
+ * TODO: I think this can be fixed by defining "time" to be the time the element
+ * was added (with some convention like "0" meaning immediate), rather than the
+ * deadline time.
+ */
+struct __repmgr_retry {
+	TAILQ_ENTRY(__repmgr_retry) entries;
+	u_int eid;
+	repmgr_timeval_t time;
+};
+
+/*
+ * We use scatter/gather I/O for both reading and writing.  The largest number
+ * of buffers we ever try to use at once is 5, corresponding to the 5 segments
+ * of a message described in the "wire protocol" (repmgr_net.c).
+ */
+typedef struct {
+	db_iovec_t vectors[5];
+
+	/*
+	 * Index of the first iovec to be used.  Initially of course this is
+	 * zero.  But as we progress through partial I/O transfers, it ends up
+	 * pointing to the first iovec to be used on the next operation.
+	 */
+	int offset;
+
+	/*
+	 * Total number of pieces defined for this message; equal to the number
+	 * of times add_buffer and/or add_dbt were called to populate it.  We do
+	 * *NOT* revise this as we go along.  So subsequent I/O operations must
+	 * use count-offset to get the number of active vector pieces still
+	 * remaining.
+	 */
+	int count;
+
+	/*
+	 * Total number of bytes accounted for in all the pieces of this
+	 * message.  We do *NOT* revise this as we go along (though it's not
+	 * clear we shouldn't).
+	 */
+	size_t total_bytes;
+} REPMGR_IOVECS;
+
+typedef struct {
+	size_t length;		/* number of bytes in data */
+	int ref_count;		/* # of sites' send queues pointing to us */
+	u_int8_t data[1];	/* variable size data area */
+} REPMGR_FLAT;
+
+struct __queued_output {
+	STAILQ_ENTRY(__queued_output) entries;
+	REPMGR_FLAT *msg;
+	size_t offset;
+};
+
+/*
+ * The following is for input.  Once we know the sizes of the pieces of an
+ * incoming message, we can create this struct (and also the data areas for the
+ * pieces themselves, in the same memory allocation).  This is also the struct
+ * in which the message lives while it's waiting to be processed by message
+ * threads.
+ */
+typedef struct __repmgr_message {
+	STAILQ_ENTRY(__repmgr_message) entries;
+	int originating_eid;
+	DBT control, rec;
+} REPMGR_MESSAGE;
+
+typedef enum {
+	SIZES_PHASE,
+	DATA_PHASE
+} phase_t;
+
+/*
+ * If another site initiates a connection to us, when we receive it the
+ * connection state is immediately "connected".  But when we initiate the
+ * connection to another site, it first has to go through a "connecting" state,
+ * until the non-blocking connect() I/O operation completes successfully.
+ *     With an outgoing connection, we always know the associated site (and so
+ * we have a valid eid).  But with an incoming connection, we don't know the
+ * site until we get a handshake message, so until that time the eid is
+ * invalid.
+ */
+struct __repmgr_connection {
+	TAILQ_ENTRY(__repmgr_connection) entries;
+
+	int eid;		/* index into sites array in machtab */
+	socket_t fd;
+#ifdef DB_WIN32
+	WSAEVENT event_object;
+#endif
+#define	CONN_CONNECTING	0x01	/* nonblocking connect in progress */
+#define	CONN_DEFUNCT	0x02	/* socket close pending */
+	u_int32_t flags;
+
+	/*
+	 * Output: usually we just simply write messages right in line, in the
+	 * send() function's thread.  But if TCP doesn't have enough network
+	 * buffer space for us when we first try it, we instead allocate some
+	 * memory, and copy the message, and then send it as space becomes
+	 * available in our main select() thread.
+	 */
+	OUT_Q_HEADER outbound_queue;
+	int out_queue_length;
+
+	/*
+	 * Input: while we're reading a message, we keep track of what phase
+	 * we're in.  In both phases, we use a REPMGR_IOVECS to keep track of
+	 * our progress within the phase.  Depending upon the message type, we
+	 * end up with either a rep_message (which is a wrapper for the control
+	 * and rec DBTs), or a single generic DBT.
+	 *     Any time we're in DATA_PHASE, it means we have already received
+	 * the message header (consisting of msg_type and 2 sizes), and
+	 * therefore we have allocated buffer space to read the data.  (This is
+	 * important for resource clean-up.)
+	 */
+	phase_t		reading_phase;
+	REPMGR_IOVECS iovecs;
+
+	u_int8_t	msg_type;
+	u_int32_t	control_size_buf, rec_size_buf;
+
+	union {
+		REPMGR_MESSAGE *rep_message;
+		struct {
+			DBT cntrl, rec;
+		} repmgr_msg;
+	} input;
+};
+
+#ifdef HAVE_GETADDRINFO
+typedef struct addrinfo	ADDRINFO;
+#else
+/*
+ * Some windows platforms have getaddrinfo (Windows XP), some don't.  We don't
+ * support conditional compilation in our Windows build, so we always use our
+ * own getaddrinfo implementation.  Rename everything so that we don't collide
+ * with the system libraries.
+ */
+#undef	AI_PASSIVE
+#define	AI_PASSIVE	0x01
+#undef	AI_CANONNAME
+#define	AI_CANONNAME	0x02
+#undef	AI_NUMERICHOST
+#define	AI_NUMERICHOST	0x04
+
+typedef struct __addrinfo {
+	int ai_flags;		/* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
+	int ai_family;		/* PF_xxx */
+	int ai_socktype;	/* SOCK_xxx */
+	int ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+	size_t ai_addrlen;	/* length of ai_addr */
+	char *ai_canonname;	/* canonical name for nodename */
+	struct sockaddr *ai_addr;	/* binary address */
+	struct __addrinfo *ai_next;	/* next structure in linked list */
+} ADDRINFO;
+#endif /* HAVE_GETADDRINFO */
+
+typedef struct {
+	char *host;		/* Separately allocated copy of string. */
+	u_int16_t port;		/* Stored in plain old host-byte-order. */
+	ADDRINFO *address_list;
+	ADDRINFO *current;
+} repmgr_netaddr_t;
+
+/*
+ * Each site that we know about is either idle or connected.  If it's connected,
+ * we have a reference to a connection object; if it's idle, we have a reference
+ * to a retry object.
+ *     We store site objects in a simple array in the machtab, indexed by EID.
+ * (We allocate EID numbers for other sites simply according to their index
+ * within this array; we use the special value INT_MAX to represent our own
+ * EID.)
+ */
+struct __repmgr_site {
+	repmgr_netaddr_t net_addr;
+	DB_LSN max_ack;		/* Best ack we've heard from this site. */
+	int priority;
+
+#define	SITE_IDLE 1		/* Waiting til time to retry connecting. */
+#define	SITE_CONNECTED 2
+	int state;
+
+	union {
+		REPMGR_CONNECTION *conn; /* when CONNECTED */
+		REPMGR_RETRY *retry; /* when IDLE */
+	} ref;
+};
+
+/*
+ * Repmgr message formats.  We pass these in the "control" portion of a message.
+ * For an ack, we just let the "rec" part go unused.  But for a handshake, the
+ * "rec" part contains the variable-length host name (including terminating NUL
+ * character).
+ */
+typedef struct {
+	u_int32_t generation;
+	DB_LSN lsn;
+} DB_REPMGR_ACK;
+
+/*
+ * The hand-shake message is exchanged upon establishment of a connection.  The
+ * message protocol version number here refers to the connection as a whole.  In
+ * other words, it's an assertion that every message sent or received on this
+ * connection shall be of the specified version.  Since repmgr uses TCP, a
+ * reliable stream-oriented protocol, this assertion is meaningful.
+ */
+typedef struct {
+#define	DB_REPMGR_VERSION	1
+	u_int32_t version;
+	u_int16_t port;
+	u_int32_t priority;
+} DB_REPMGR_HANDSHAKE;
+
+/*
+ * We store site structs in a dynamically allocated, growable array, indexed by
+ * EID.  We allocate EID numbers for remote sites simply according to their
+ * index within this array.  We don't need (the same kind of) info for ourself
+ * (the local site), so we use an EID value that won't conflict with any valid
+ * array index.
+ */
+#define	SITE_FROM_EID(eid)	(&db_rep->sites[eid])
+#define	EID_FROM_SITE(s)	((int)((s) - (&db_rep->sites[0])))
+#define	IS_VALID_EID(e)		((e) >= 0)
+#define	SELF_EID		INT_MAX
+
+#define	IS_PEER_POLICY(p) ((p) == DB_REPMGR_ACKS_ALL_PEERS ||		\
+    (p) == DB_REPMGR_ACKS_QUORUM ||		\
+    (p) == DB_REPMGR_ACKS_ONE_PEER)
+
+#define	LOCK_MUTEX(m) do {						\
+	int __ret;							\
+	if ((__ret = __repmgr_lock_mutex(&(m))) != 0)			\
+		return (__ret);						\
+} while (0)
+
+#define	UNLOCK_MUTEX(m) do {						\
+	int __ret;							\
+	if ((__ret = __repmgr_unlock_mutex(&(m))) != 0)			\
+		return (__ret);						\
+} while (0)
+
+/* POSIX/Win32 socket (and other) portability. */
+#ifdef DB_WIN32
+#define	WOULDBLOCK		WSAEWOULDBLOCK
+#define	INPROGRESS		WSAEWOULDBLOCK
+
+#define	net_errno		WSAGetLastError()
+typedef int socklen_t;
+typedef char * sockopt_t;
+
+#define	iov_len len
+#define	iov_base buf
+
+typedef DWORD select_timeout_t;
+typedef DWORD threadsync_timeout_t;
+
+#define	REPMGR_SYNC_INITED(db_rep) (db_rep->waiters != NULL)
+#else
+
+#define	INVALID_SOCKET		-1
+#define	SOCKET_ERROR		-1
+#define	WOULDBLOCK		EWOULDBLOCK
+#define	INPROGRESS		EINPROGRESS
+
+#define	net_errno		errno
+typedef void * sockopt_t;
+
+#define	closesocket(fd)		close(fd)
+
+typedef struct timeval select_timeout_t;
+typedef struct timespec threadsync_timeout_t;
+
+#define	REPMGR_SYNC_INITED(db_rep) (db_rep->read_pipe >= 0)
+#endif
+
+/* Macros to proceed, as with a cursor, through the address_list: */
+#define	ADDR_LIST_CURRENT(na)	((na)->current)
+#define	ADDR_LIST_FIRST(na)	((na)->current = (na)->address_list)
+#define	ADDR_LIST_NEXT(na)	((na)->current = (na)->current->ai_next)
+
+#include "dbinc_auto/repmgr_ext.h"
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* !_DB_REPMGR_H_ */
diff --git a/db/dbinc/shqueue.h b/db/dbinc/shqueue.h
index 8d7e4eef9..ffaa15748 100644
--- a/db/dbinc/shqueue.h
+++ b/db/dbinc/shqueue.h
@@ -1,18 +1,18 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: shqueue.h,v 11.15 2004/03/24 20:37:37 bostic Exp $
+ * $Id: shqueue.h,v 12.9 2006/09/07 15:11:26 mjc Exp $
  */
 
-#ifndef	_SYS_SHQUEUE_H_
-#define	_SYS_SHQUEUE_H_
+#ifndef	_DB_SHQUEUE_H_
+#define	_DB_SHQUEUE_H_
 
 /*
- * This file defines two types of data structures: lists and tail queues
- * similarly to the include file .
+ * This file defines three types of data structures: chains, lists and
+ * tail queues similarly to the include file .
  *
  * The difference is that this set of macros can be used for structures that
  * reside in shared memory that may be mapped at different addresses in each
@@ -35,6 +35,70 @@
 extern "C" {
 #endif
 
+#define	SH_PTR_TO_OFF(src, dest)					\
+	((ssize_t)(((u_int8_t *)(dest)) - ((u_int8_t *)(src))))
+
+/*
+ * Shared memory chain definitions.
+ */
+#define	SH_CHAIN_ENTRY							\
+struct {								\
+	ssize_t sce_next;	/* relative offset to next element */	\
+	ssize_t sce_prev;	/* relative offset of prev element */	\
+}
+
+#define	SH_CHAIN_INIT(elm, field)					\
+	(elm)->field.sce_next = (elm)->field.sce_prev =	-1
+
+#define	SH_CHAIN_HASNEXT(elm, field)	((elm)->field.sce_next != -1)
+#define	SH_CHAIN_NEXTP(elm, field, type)				\
+    ((struct type *)((u_int8_t *)(elm) + (elm)->field.sce_next))
+#define	SH_CHAIN_NEXT(elm, field, type)	(SH_CHAIN_HASNEXT(elm, field) ?	\
+    SH_CHAIN_NEXTP(elm, field, type) : (struct type *)NULL)
+
+#define	SH_CHAIN_HASPREV(elm, field)	((elm)->field.sce_prev != -1)
+#define	SH_CHAIN_PREVP(elm, field, type)				\
+    ((struct type *)((u_int8_t *)(elm) + (elm)->field.sce_prev))
+#define	SH_CHAIN_PREV(elm, field, type)	(SH_CHAIN_HASPREV(elm, field) ?	\
+     SH_CHAIN_PREVP(elm, field, type) : (struct type *)NULL)
+
+#define	SH_CHAIN_SINGLETON(elm, field)					\
+    (!(SH_CHAIN_HASNEXT(elm, field) || SH_CHAIN_HASPREV(elm, field)))
+
+#define	SH_CHAIN_INSERT_AFTER(listelm, elm, field, type) do {		\
+	struct type *__next = SH_CHAIN_NEXT(listelm, field, type);	\
+	if (__next != NULL) {						\
+		(elm)->field.sce_next =	SH_PTR_TO_OFF(elm, __next);	\
+		__next->field.sce_prev = SH_PTR_TO_OFF(__next, elm);	\
+	} else								\
+		(elm)->field.sce_next = -1;				\
+	(elm)->field.sce_prev = SH_PTR_TO_OFF(elm, listelm);		\
+	(listelm)->field.sce_next = SH_PTR_TO_OFF(listelm, elm);	\
+} while (0)
+
+#define	SH_CHAIN_INSERT_BEFORE(listelm, elm, field, type) do {		\
+	struct type *__prev = SH_CHAIN_PREV(listelm, field, type);	\
+	if (__prev != NULL) {						\
+		(elm)->field.sce_prev = SH_PTR_TO_OFF(elm, __prev);	\
+		__prev->field.sce_next = SH_PTR_TO_OFF(__prev, elm);	\
+	} else								\
+		(elm)->field.sce_prev = -1;				\
+	(elm)->field.sce_next = SH_PTR_TO_OFF(elm, listelm);		\
+	(listelm)->field.sce_prev = SH_PTR_TO_OFF(listelm, elm);	\
+} while (0)
+
+#define	SH_CHAIN_REMOVE(elm, field, type) do {				\
+	struct type *__prev = SH_CHAIN_PREV(elm, field, type);		\
+	struct type *__next = SH_CHAIN_NEXT(elm, field, type);		\
+	if (__next != NULL)						\
+		__next->field.sce_prev = (__prev == NULL) ? -1 :	\
+		    SH_PTR_TO_OFF(__next, __prev);			\
+	if (__prev != NULL)						\
+		__prev->field.sce_next = (__next == NULL) ? -1 :	\
+		    SH_PTR_TO_OFF(__prev, __next);			\
+	SH_CHAIN_INIT(elm, field);					\
+} while (0)
+
 /*
  * Shared memory list definitions.
  */
@@ -55,7 +119,6 @@ struct {								\
 /*
  * Shared memory list functions.
  */
-
 #define	SH_LIST_EMPTY(head)						\
 	((head)->slh_first == -1)
 
@@ -82,16 +145,13 @@ struct {								\
 	((ssize_t *)(((u_int8_t *)(elm)) + (elm)->field.sle_prev))
 
 #define	SH_LIST_PREV(elm, field, type)					\
-	(struct type *)((ssize_t)elm - (*__SH_LIST_PREV_OFF(elm, field)))
+	(struct type *)((ssize_t)(elm) - (*__SH_LIST_PREV_OFF(elm, field)))
 
 #define	SH_LIST_FOREACH(var, head, field, type)				\
 	for ((var) = SH_LIST_FIRST((head), type);			\
-	    (var);							\
+	    (var) != NULL;						\
 	    (var) = SH_LIST_NEXT((var), field, type))
 
-#define	SH_PTR_TO_OFF(src, dest)					\
-	((ssize_t)(((u_int8_t *)(dest)) - ((u_int8_t *)(src))))
-
 /*
  * Given correct A.next: B.prev = SH_LIST_NEXT_TO_PREV(A)
  * in a list [A, B]
@@ -227,12 +287,14 @@ struct {								\
 #define	__SH_TAILQ_LAST_OFF(head)					\
 	((ssize_t *)(((u_int8_t *)(head)) + (head)->stqh_last))
 
-#define	SH_TAILQ_LAST(head, field, type)				\
-	(SH_TAILQ_EMPTY(head) ? NULL :				\
-	(struct type *)((ssize_t)(head) +				\
+#define	SH_TAILQ_LASTP(head, field, type)				\
+	((struct type *)((ssize_t)(head) +				\
 	 ((ssize_t)((head)->stqh_last) -				\
 	 ((ssize_t)SH_PTR_TO_OFF(SH_TAILQ_FIRST(head, type),		\
-		&(SH_TAILQ_FIRST(head, type)->field.stqe_next))))))
+		&(SH_TAILQ_FIRSTP(head, type)->field.stqe_next))))))
+
+#define	SH_TAILQ_LAST(head, field, type)				\
+	(SH_TAILQ_EMPTY(head) ? NULL : SH_TAILQ_LASTP(head, field, type))
 
 /*
  * Given correct A.next: B.prev = SH_TAILQ_NEXT_TO_PREV(A)
@@ -250,12 +312,12 @@ struct {								\
 
 #define	SH_TAILQ_FOREACH(var, head, field, type)			\
 	for ((var) = SH_TAILQ_FIRST((head), type);			\
-	    (var);							\
+	    (var) != NULL;						\
 	    (var) = SH_TAILQ_NEXT((var), field, type))
 
 #define	SH_TAILQ_FOREACH_REVERSE(var, head, field, type)		\
 	for ((var) = SH_TAILQ_LAST((head), field, type);		\
-	    (var);							\
+	    (var) != NULL;						\
 	    (var) = SH_TAILQ_PREV((head), (var), field, type))
 
 #define	SH_TAILQ_INIT(head) {						\
@@ -342,4 +404,4 @@ struct {								\
 #if defined(__cplusplus)
 }
 #endif
-#endif	/* !_SYS_SHQUEUE_H_ */
+#endif	/* !_DB_SHQUEUE_H_ */
diff --git a/db/dbinc/tcl_db.h b/db/dbinc/tcl_db.h
index f1adea5ae..4f589431b 100644
--- a/db/dbinc/tcl_db.h
+++ b/db/dbinc/tcl_db.h
@@ -1,20 +1,23 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1999-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1999-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: tcl_db.h,v 11.40 2004/09/22 03:40:20 bostic Exp $
+ * $Id: tcl_db.h,v 12.8 2006/08/24 14:45:30 bostic Exp $
  */
 
 #ifndef _DB_TCL_DB_H_
 #define	_DB_TCL_DB_H_
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 #define	MSG_SIZE 100		/* Message size */
 
 enum INFOTYPE {
-    I_ENV, I_DB, I_DBC, I_TXN, I_MP,
-    I_PG, I_LOCK, I_LOGC, I_NDBM, I_MUTEX, I_SEQ};
+    I_ENV, I_DB, I_DBC, I_TXN, I_MP, I_PG, I_LOCK, I_LOGC, I_NDBM, I_SEQ};
 
 #define	MAX_ID		8	/* Maximum number of sub-id's we need */
 #define	DBTCL_PREP	64	/* Size of txn_recover preplist */
@@ -22,33 +25,6 @@ enum INFOTYPE {
 #define	DBTCL_DBM	1
 #define	DBTCL_NDBM	2
 
-typedef struct _mutex_entry {
-	union {
-		struct {
-			DB_MUTEX	real_m;
-			int		real_val;
-		} r;
-		/*
-		 * This is here to make sure that each of the mutex structures
-		 * are 16-byte aligned, which is required on HP architectures.
-		 * The db_mutex_t structure might be >32 bytes itself, or the
-		 * real_val might push it over the 32 byte boundary.  The best
-		 * we can do is use a 48 byte boundary.
-		 */
-		char c[48];
-	} u;
-} _MUTEX_ENTRY;
-
-#define	m	u.r.real_m
-#define	val	u.r.real_val
-
-typedef struct _mutex_data {
-	DB_ENV		*env;
-	REGINFO		 reginfo;
-	_MUTEX_ENTRY	*marray;
-	size_t		 size;
-} _MUTEX_DATA;
-
 /*
  * Why use a home grown package over the Tcl_Hash functions?
  *
@@ -83,15 +59,14 @@ typedef struct dbtcl_info {
 	char *i_name;
 	enum INFOTYPE i_type;
 	union infop {
-		DB_ENV *envp;
-		void *anyp;
 		DB *dbp;
 		DBC *dbcp;
-		DB_TXN *txnp;
-		DB_MPOOLFILE *mp;
+		DB_ENV *envp;
 		DB_LOCK *lock;
-		_MUTEX_DATA *mutex;
 		DB_LOGC *logc;
+		DB_MPOOLFILE *mp;
+		DB_TXN *txnp;
+		void *anyp;
 	} un;
 	union data {
 		int anydata;
@@ -101,6 +76,7 @@ typedef struct dbtcl_info {
 	union data2 {
 		int anydata;
 		int pagesz;
+		DB_COMPACT *c_data;
 	} und2;
 	DBT i_lockobj;
 	FILE *i_err;
@@ -109,6 +85,7 @@ typedef struct dbtcl_info {
 	/* Callbacks--Tcl_Objs containing proc names */
 	Tcl_Obj *i_btcompare;
 	Tcl_Obj *i_dupcompare;
+	Tcl_Obj *i_event;
 	Tcl_Obj *i_hashproc;
 	Tcl_Obj *i_rep_send;
 	Tcl_Obj *i_second_call;
@@ -128,7 +105,6 @@ typedef struct dbtcl_info {
 #define	i_txnp un.txnp
 #define	i_mp un.mp
 #define	i_lock un.lock
-#define	i_mutex un.mutex
 #define	i_logc un.logc
 
 #define	i_data und.anydata
@@ -136,12 +112,12 @@ typedef struct dbtcl_info {
 #define	i_locker und.lockid
 #define	i_data2 und2.anydata
 #define	i_pgsz und2.pagesz
+#define	i_cdata und2.c_data
 
 #define	i_envtxnid i_otherid[0]
 #define	i_envmpid i_otherid[1]
 #define	i_envlockid i_otherid[2]
-#define	i_envmutexid i_otherid[3]
-#define	i_envlogcid i_otherid[4]
+#define	i_envlogcid i_otherid[3]
 
 #define	i_mppgid  i_otherid[0]
 
@@ -266,5 +242,9 @@ extern DBTCL_GLOBAL __dbtcl_global;
 #define	IS_HELP(s)						\
     (strcmp(Tcl_GetStringFromObj(s,NULL), "-?") == 0) ? TCL_OK : TCL_ERROR
 
+#if defined(__cplusplus)
+}
+#endif
+
 #include "dbinc_auto/tcl_ext.h"
 #endif /* !_DB_TCL_DB_H_ */
diff --git a/db/dbinc/txn.h b/db/dbinc/txn.h
index 514b740e8..4d0048809 100644
--- a/db/dbinc/txn.h
+++ b/db/dbinc/txn.h
@@ -1,17 +1,21 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: txn.h,v 11.54 2004/09/24 00:43:18 bostic Exp $
+ * $Id: txn.h,v 12.13 2006/08/24 14:45:30 bostic Exp $
  */
 
-#ifndef	_TXN_H_
-#define	_TXN_H_
+#ifndef	_DB_TXN_H_
+#define	_DB_TXN_H_
 
 #include "dbinc/xa.h"
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /* Operation parameters to the delayed commit processing code. */
 typedef enum {
 	TXN_CLOSE,		/* Close a DB handle whose close had failed. */
@@ -31,7 +35,7 @@ struct __txn_logrec;	typedef struct __txn_logrec DB_TXNLOGREC;
 #define	TXN_MAXIMUM	0xffffffff	/* Maximum number of txn ids. */
 #define	TXN_INVALID	0		/* Invalid transaction ID. */
 
-#define	DEF_MAX_TXNS	20		/* Default max transactions. */
+#define	DEF_MAX_TXNS	100		/* Default max transactions. */
 
 /*
  * Internal data maintained in shared memory for each transaction.
@@ -39,27 +43,35 @@ struct __txn_logrec;	typedef struct __txn_logrec DB_TXNLOGREC;
 typedef struct __txn_detail {
 	u_int32_t txnid;		/* current transaction id
 					   used to link free list also */
-	DB_LSN	last_lsn;		/* last lsn written for this txn */
-	DB_LSN	begin_lsn;		/* lsn of begin record */
+	pid_t pid;			/* Process owning txn */
+	db_threadid_t tid;		/* Thread owning txn */
+
+	DB_LSN	last_lsn;		/* Last LSN written for this txn. */
+	DB_LSN	begin_lsn;		/* LSN of begin record. */
 	roff_t	parent;			/* Offset of transaction's parent. */
+	roff_t	name;			/* Offset of txn name. */
+
+	DB_LSN	read_lsn;		/* Read LSN for MVCC. */
+	DB_LSN	visible_lsn;		/* LSN at which this transaction's
+					   changes are visible. */
+	db_mutex_t	mvcc_mtx;	/* Version mutex. */
+	u_int32_t	mvcc_ref;	/* Number of buffers created by this
+					   transaction still in cache.  */
 
-#define	TXN_RUNNING		1
-#define	TXN_ABORTED		2
-#define	TXN_PREPARED		3
-#define	TXN_COMMITTED		4
+	SH_TAILQ_HEAD(__tdkids)	kids;	/* Linked list of child txn detail. */
+	SH_TAILQ_ENTRY		klinks;
+
+	/* TXN_{ABORTED, COMMITTED PREPARED, RUNNING} */
 	u_int32_t status;		/* status of the transaction */
-#define	TXN_DTL_COLLECTED	0x1
-#define	TXN_DTL_RESTORED	0x2
-	u_int32_t flags;		/* collected during txn_recover */
-
-	SH_TAILQ_ENTRY	links;		/* free/active list */
-
-#define	TXN_XA_ABORTED		1
-#define	TXN_XA_DEADLOCKED	2
-#define	TXN_XA_ENDED		3
-#define	TXN_XA_PREPARED		4
-#define	TXN_XA_STARTED		5
-#define	TXN_XA_SUSPENDED	6
+
+#define	TXN_DTL_COLLECTED	0x1	/* collected during txn_recover */
+#define	TXN_DTL_RESTORED	0x2	/* prepared txn restored */
+#define	TXN_DTL_INMEMORY	0x4	/* uses in memory logs */
+	u_int32_t flags;
+
+	/* TXN_XA_{ABORTED, DEADLOCKED, ENDED, PREPARED, STARTED, SUSPENDED} */
+	SH_TAILQ_ENTRY	links;		/* active/free/snapshot list */
+
 	u_int32_t xa_status;		/* XA status */
 
 	/*
@@ -80,33 +92,40 @@ struct __db_txnmgr {
 	/*
 	 * These fields need to be protected for multi-threaded support.
 	 *
-	 * !!!
-	 * As this structure is allocated in per-process memory, the mutex may
-	 * need to be stored elsewhere on architectures unable to support
-	 * mutexes in heap memory, e.g., HP/UX 9.
+	 * Lock list of active transactions (including the content of each
+	 * TXN_DETAIL structure on the list).
 	 */
-	DB_MUTEX	*mutexp;	/* Lock list of active transactions
-					 * (including the content of each
-					 * TXN_DETAIL structure on the list).
-					 */
+	db_mutex_t mutex;
 					/* List of active transactions. */
 	TAILQ_HEAD(_chain, __db_txn)	txn_chain;
-	u_int32_t	 n_discards;	/* Number of txns discarded. */
 
-/* These fields are never updated after creation, and so not protected. */
-	DB_ENV		*dbenv;		/* Environment. */
-	REGINFO		 reginfo;	/* Region information. */
+	u_int32_t n_discards;		/* Number of txns discarded. */
+
+	/* These fields are never updated after creation, so not protected. */
+	DB_ENV	*dbenv;			/* Environment. */
+	REGINFO	 reginfo;		/* Region information. */
 };
 
+/* Macros to lock/unlock the transaction region as a whole. */
+#define	TXN_SYSTEM_LOCK(dbenv)						\
+	MUTEX_LOCK(dbenv, ((DB_TXNREGION *)				\
+	    (dbenv)->tx_handle->reginfo.primary)->mtx_region)
+#define	TXN_SYSTEM_UNLOCK(dbenv)					\
+	MUTEX_UNLOCK(dbenv, ((DB_TXNREGION *)				\
+	    (dbenv)->tx_handle->reginfo.primary)->mtx_region)
+
 /*
  * DB_TXNREGION --
  *	The primary transaction data structure in the shared memory region.
  */
 struct __db_txnregion {
+	db_mutex_t	mtx_region;	/* Region mutex. */
+
 	u_int32_t	maxtxns;	/* maximum number of active TXNs */
 	u_int32_t	last_txnid;	/* last transaction id given out */
 	u_int32_t	cur_maxid;	/* current max unused id. */
 
+	db_mutex_t	mtx_ckp;	/* Single thread checkpoints. */
 	DB_LSN		last_ckp;	/* lsn of the last checkpoint */
 	time_t		time_ckp;	/* time of last checkpoint */
 
@@ -116,11 +135,7 @@ struct __db_txnregion {
 	u_int32_t	flags;
 					/* active TXN list */
 	SH_TAILQ_HEAD(__active) active_txn;
-#ifdef HAVE_MUTEX_SYSTEM_RESOURCES
-#define	TXN_MAINT_SIZE	(sizeof(roff_t) * DB_MAX_HANDLES)
-
-	roff_t		maint_off;	/* offset of region maintenance info */
-#endif
+	SH_TAILQ_HEAD(__mvcc) mvcc_txn;
 };
 
 /*
@@ -209,7 +224,11 @@ struct __txn_logrec {
 #define	TXN_EXPECTED	5
 #define	TXN_UNEXPECTED	6
 
+#if defined(__cplusplus)
+}
+#endif
+
 #include "dbinc_auto/txn_auto.h"
 #include "dbinc_auto/txn_ext.h"
 #include "dbinc_auto/xa_ext.h"
-#endif /* !_TXN_H_ */
+#endif /* !_DB_TXN_H_ */
diff --git a/db/dbinc/xa.h b/db/dbinc/xa.h
index 71333c2c9..5768c58c9 100644
--- a/db/dbinc/xa.h
+++ b/db/dbinc/xa.h
@@ -1,18 +1,22 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1998-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1998-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: xa.h,v 11.7 2004/01/28 03:36:02 bostic Exp $
+ * $Id: xa.h,v 12.4 2006/08/24 14:45:30 bostic Exp $
  */
 /*
  * Start of xa.h header
  *
  * Define a symbol to prevent multiple inclusions of this header file
  */
-#ifndef	XA_H
-#define	XA_H
+#ifndef	_DB_XA_H_
+#define	_DB_XA_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
 
 /*
  * Transaction branch identification: XID and NULLXID:
@@ -173,7 +177,8 @@ struct xa_switch_t {
 #define	XAER_DUPID	-8		/* the XID already exists */
 #define	XAER_OUTSIDE	-9		/* resource manager doing work outside
 					transaction */
-#endif /* ifndef XA_H */
-/*
- * End of xa.h header
- */
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* !_DB_XA_H_ */
diff --git a/db/dbinc_auto/btree_auto.h b/db/dbinc_auto/btree_auto.h
index d9d4e47ad..d39ee3b08 100644
--- a/db/dbinc_auto/btree_auto.h
+++ b/db/dbinc_auto/btree_auto.h
@@ -5,7 +5,7 @@
 #define	DB___bam_split	62
 typedef struct ___bam_split_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	left;
@@ -23,7 +23,7 @@ typedef struct ___bam_split_args {
 #define	DB___bam_rsplit	63
 typedef struct ___bam_rsplit_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -37,7 +37,7 @@ typedef struct ___bam_rsplit_args {
 #define	DB___bam_adj	55
 typedef struct ___bam_adj_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -50,7 +50,7 @@ typedef struct ___bam_adj_args {
 #define	DB___bam_cadjust	56
 typedef struct ___bam_cadjust_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -63,7 +63,7 @@ typedef struct ___bam_cadjust_args {
 #define	DB___bam_cdel	57
 typedef struct ___bam_cdel_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -74,7 +74,7 @@ typedef struct ___bam_cdel_args {
 #define	DB___bam_repl	58
 typedef struct ___bam_repl_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -90,7 +90,7 @@ typedef struct ___bam_repl_args {
 #define	DB___bam_root	59
 typedef struct ___bam_root_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	meta_pgno;
@@ -101,7 +101,7 @@ typedef struct ___bam_root_args {
 #define	DB___bam_curadj	64
 typedef struct ___bam_curadj_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_ca_mode	mode;
@@ -116,7 +116,7 @@ typedef struct ___bam_curadj_args {
 #define	DB___bam_rcuradj	65
 typedef struct ___bam_rcuradj_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	ca_recno_arg	mode;
@@ -125,18 +125,60 @@ typedef struct ___bam_rcuradj_args {
 	u_int32_t	order;
 } __bam_rcuradj_args;
 
+#define	DB___bam_relink_43	147
+typedef struct ___bam_relink_43_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	db_pgno_t	pgno;
+	DB_LSN	lsn;
+	db_pgno_t	prev;
+	DB_LSN	lsn_prev;
+	db_pgno_t	next;
+	DB_LSN	lsn_next;
+} __bam_relink_43_args;
+
 #define	DB___bam_relink	147
 typedef struct ___bam_relink_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
-	DB_LSN	lsn;
+	db_pgno_t	new_pgno;
 	db_pgno_t	prev;
 	DB_LSN	lsn_prev;
 	db_pgno_t	next;
 	DB_LSN	lsn_next;
 } __bam_relink_args;
 
+#define	DB___bam_merge	148
+typedef struct ___bam_merge_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	db_pgno_t	pgno;
+	DB_LSN	lsn;
+	db_pgno_t	npgno;
+	DB_LSN	nlsn;
+	DBT	hdr;
+	DBT	data;
+	DBT	ind;
+} __bam_merge_args;
+
+#define	DB___bam_pgno	149
+typedef struct ___bam_pgno_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	db_pgno_t	pgno;
+	DB_LSN	lsn;
+	u_int32_t	indx;
+	db_pgno_t	opgno;
+	db_pgno_t	npgno;
+} __bam_pgno_args;
+
 #endif
diff --git a/db/dbinc_auto/btree_ext.h b/db/dbinc_auto/btree_ext.h
index 9acb14051..82916e84b 100644
--- a/db/dbinc_auto/btree_ext.h
+++ b/db/dbinc_auto/btree_ext.h
@@ -6,20 +6,21 @@
 extern "C" {
 #endif
 
-int __bam_cmp __P((DB *, const DBT *, PAGE *, u_int32_t, int (*)(DB *, const DBT *, const DBT *), int *));
+int __bam_compact __P((DB *, DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *));
+int __bam_cmp __P((DB *, DB_TXN *, const DBT *, PAGE *, u_int32_t, int (*)(DB *, const DBT *, const DBT *), int *));
 int __bam_defcmp __P((DB *, const DBT *, const DBT *));
 size_t __bam_defpfx __P((DB *, const DBT *, const DBT *));
 int __bam_pgin __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
 int __bam_pgout __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
 int __bam_mswap __P((PAGE *));
-int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int));
-int __ram_ca_delete __P((DB *, db_pgno_t));
+int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int, int *));
+int __ram_ca_delete __P((DB *, db_pgno_t, int *));
 int __bam_ca_di __P((DBC *, db_pgno_t, u_int32_t, int));
 int __bam_ca_dup __P((DBC *, u_int32_t, db_pgno_t, u_int32_t, db_pgno_t, u_int32_t));
 int __bam_ca_undodup __P((DB *, u_int32_t, db_pgno_t, u_int32_t, u_int32_t));
 int __bam_ca_rsplit __P((DBC *, db_pgno_t, db_pgno_t));
 int __bam_ca_split __P((DBC *, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, int));
-void __bam_ca_undosplit __P((DB *, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t));
+int __bam_ca_undosplit __P((DB *, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t));
 int __bam_c_init __P((DBC *, DBTYPE));
 int __bam_c_refresh __P((DBC *));
 int __bam_c_count __P((DBC *, db_recno_t *));
@@ -27,10 +28,12 @@ int __bam_c_dup __P((DBC *, DBC *));
 int __bam_bulk_overflow __P((DBC *, u_int32_t, db_pgno_t, u_int8_t *));
 int __bam_bulk_duplicates __P((DBC *, db_pgno_t, u_int8_t *, int32_t *, int32_t **, u_int8_t **, u_int32_t *, int));
 int __bam_c_rget __P((DBC *, DBT *));
+int  __bam_opd_exists __P((DBC *, db_pgno_t));
 int __bam_ditem __P((DBC *, PAGE *, u_int32_t));
 int __bam_adjindx __P((DBC *, PAGE *, u_int32_t, u_int32_t, int));
-int __bam_dpages __P((DBC *, EPG *));
-int __bam_relink __P((DBC *, PAGE *, PAGE **));
+int __bam_dpages __P((DBC *, int, int));
+int __bam_relink __P((DBC *, PAGE *, db_pgno_t));
+int __bam_pupdate __P((DBC *, PAGE *));
 int __bam_db_create __P((DB *));
 int __bam_db_close __P((DB *));
 void __bam_map_flags __P((DB *, u_int32_t *, u_int32_t *));
@@ -58,6 +61,9 @@ int __bam_root_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_curadj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_rcuradj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_relink_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __bam_merge_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __bam_pgno_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __bam_relink_43_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_reclaim __P((DB *, DB_TXN *));
 int __bam_truncate __P((DBC *, u_int32_t *));
 int __ram_open __P((DB *, DB_TXN *, const char *, db_pgno_t, u_int32_t));
@@ -65,17 +71,19 @@ int __ram_append __P((DBC *, DBT *, DBT *));
 int __ram_c_del __P((DBC *));
 int __ram_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
 int __ram_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-int __ram_ca __P((DBC *, ca_recno_arg));
+int __ram_ca __P((DBC *, ca_recno_arg, int *));
 int __ram_getno __P((DBC *, const DBT *, db_recno_t *, int));
 int __ram_writeback __P((DB *));
 int __bam_rsearch __P((DBC *, db_recno_t *, u_int32_t, int, int *));
 int __bam_adjust __P((DBC *, int32_t));
 int __bam_nrecs __P((DBC *, db_recno_t *));
 db_recno_t __bam_total __P((DB *, PAGE *));
+int __bam_get_root __P((DBC *, db_pgno_t, int, u_int32_t, int *));
 int __bam_search __P((DBC *, db_pgno_t, const DBT *, u_int32_t, int, db_recno_t *, int *));
 int __bam_stkrel __P((DBC *, u_int32_t));
 int __bam_stkgrow __P((DB_ENV *, BTREE_CURSOR *));
 int __bam_split __P((DBC *, void *, db_pgno_t *));
+int __bam_pinsert __P((DBC *, EPG *, PAGE *, PAGE *, int));
 int __bam_copy __P((DB *, PAGE *, PAGE *, u_int32_t, u_int32_t));
 int __bam_stat __P((DBC *, void *, u_int32_t));
 int __bam_stat_print __P((DBC *, u_int32_t));
@@ -113,8 +121,13 @@ int __bam_curadj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_ca_mode, db_pg
 int __bam_curadj_read __P((DB_ENV *, void *, __bam_curadj_args **));
 int __bam_rcuradj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, ca_recno_arg, db_pgno_t, db_recno_t, u_int32_t));
 int __bam_rcuradj_read __P((DB_ENV *, void *, __bam_rcuradj_args **));
-int __bam_relink_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *));
+int __bam_relink_43_read __P((DB_ENV *, void *, __bam_relink_43_args **));
+int __bam_relink_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, db_pgno_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *));
 int __bam_relink_read __P((DB_ENV *, void *, __bam_relink_args **));
+int __bam_merge_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, const DBT *, const DBT *, const DBT *));
+int __bam_merge_read __P((DB_ENV *, void *, __bam_merge_args **));
+int __bam_pgno_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t, db_pgno_t));
+int __bam_pgno_read __P((DB_ENV *, void *, __bam_pgno_args **));
 int __bam_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
 int __bam_split_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_rsplit_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
@@ -125,7 +138,10 @@ int __bam_repl_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_root_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_rcuradj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __bam_relink_43_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_relink_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __bam_merge_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __bam_pgno_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __bam_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
 
 #if defined(__cplusplus)
diff --git a/db/dbinc_auto/clib_ext.h b/db/dbinc_auto/clib_ext.h
index a471268e0..941152326 100644
--- a/db/dbinc_auto/clib_ext.h
+++ b/db/dbinc_auto/clib_ext.h
@@ -6,12 +6,40 @@
 extern "C" {
 #endif
 
+#ifndef HAVE_ABORT
+void abort __P((void));
+#endif
+#ifndef HAVE_ATOI
+int atoi __P((const char *));
+#endif
+#ifndef HAVE_ATOL
+long atol __P((const char *));
+#endif
+char *__db_ctime __P((const time_t *, char *));
+#if defined(HAVE_REPLICATION_THREADS)
+int __db_getaddrinfo __P((DB_ENV *, const char *, u_int, const char *, const ADDRINFO *, ADDRINFO **));
+#endif
+#if defined(HAVE_REPLICATION_THREADS)
+void __db_freeaddrinfo __P((DB_ENV *, ADDRINFO *));
+#endif
 #ifndef HAVE_GETCWD
 char *getcwd __P((char *, size_t));
 #endif
 #ifndef HAVE_GETOPT
 int getopt __P((int, char * const *, const char *));
 #endif
+#ifndef HAVE_ISALPHA
+int isalpha __P((int));
+#endif
+#ifndef HAVE_ISDIGIT
+int isdigit __P((int));
+#endif
+#ifndef HAVE_ISPRINT
+int isprint __P((int));
+#endif
+#ifndef HAVE_ISSPACE
+int isspace __P((int));
+#endif
 #ifndef HAVE_MEMCMP
 int memcmp __P((const void *, const void *, size_t));
 #endif
@@ -21,9 +49,22 @@ void *memcpy __P((void *, const void *, size_t));
 #ifndef HAVE_MEMMOVE
 void *memmove __P((void *, const void *, size_t));
 #endif
+#ifndef HAVE_PRINTF
+int printf __P((const char *, ...));
+#endif
+#ifndef HAVE_PRINTF
+int fprintf __P((FILE *, const char *, ...));
+#endif
+#ifndef HAVE_PRINTF
+int vfprintf __P((FILE *, const char *, va_list));
+#endif
 #ifndef HAVE_RAISE
 int raise __P((int));
 #endif
+#ifndef HAVE_RAND
+int rand __P((void));
+void srand __P((unsigned int));
+#endif
 #ifndef HAVE_SNPRINTF
 int snprintf __P((char *, size_t, const char *, ...));
 #endif
@@ -36,12 +77,36 @@ int strcasecmp __P((const char *, const char *));
 #ifndef HAVE_STRCASECMP
 int strncasecmp __P((const char *, const char *, size_t));
 #endif
+#ifndef HAVE_STRCAT
+char *strcat __P((char *, const char *));
+#endif
+#ifndef HAVE_STRCHR
+char *strchr __P((const char *,  int));
+#endif
 #ifndef HAVE_STRDUP
 char *strdup __P((const char *));
 #endif
 #ifndef HAVE_STRERROR
 char *strerror __P((int));
 #endif
+#ifndef HAVE_STRNCAT
+char *strncat __P((char *, const char *, size_t));
+#endif
+#ifndef HAVE_STRNCMP
+int strncmp __P((const char *, const char *, size_t));
+#endif
+#ifndef HAVE_STRRCHR
+char *strrchr __P((const char *, int));
+#endif
+#ifndef HAVE_STRSEP
+char *strsep __P((char **, const char *));
+#endif
+#ifndef HAVE_STRTOL
+long strtol __P((const char *, char **, int));
+#endif
+#ifndef HAVE_STRTOUL
+unsigned long strtoul __P((const char *, char **, int));
+#endif
 
 #if defined(__cplusplus)
 }
diff --git a/db/dbinc_auto/common_ext.h b/db/dbinc_auto/common_ext.h
index d9f05406d..8d90d72fe 100644
--- a/db/dbinc_auto/common_ext.h
+++ b/db/dbinc_auto/common_ext.h
@@ -9,6 +9,7 @@ extern "C" {
 int __crypto_region_init __P((DB_ENV *));
 int __db_isbigendian __P((void));
 int __db_byteorder __P((DB_ENV *, int));
+void __db_difftime __P((u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t *, u_int32_t *));
 int __db_fchk __P((DB_ENV *, const char *, u_int32_t, u_int32_t));
 int __db_fcchk __P((DB_ENV *, const char *, u_int32_t, u_int32_t, u_int32_t));
 int __db_ferr __P((const DB_ENV *, const char *, int));
@@ -16,27 +17,37 @@ int __db_fnl __P((const DB_ENV *, const char *));
 int __db_pgerr __P((DB *, db_pgno_t, int));
 int __db_pgfmt __P((DB_ENV *, db_pgno_t));
 #ifdef DIAGNOSTIC
-void __db_assert __P((const char *, const char *, int));
+void __db_assert __P((DB_ENV *, const char *, const char *, int));
 #endif
 int __db_panic_msg __P((DB_ENV *));
 int __db_panic __P((DB_ENV *, int));
-void __db_err __P((const DB_ENV *, const char *, ...)) __attribute__ ((__format__ (__printf__, 2, 3)));
-void __db_errcall __P((const DB_ENV *, int, int, const char *, va_list));
-void __db_errfile __P((const DB_ENV *, int, int, const char *, va_list));
+void __db_panic_set __P((DB_ENV *, int));
+char *__db_unknown_error __P((int));
+void __db_syserr __P((const DB_ENV *, int, const char *, ...)) __attribute__ ((__format__ (__printf__, 3, 4)));
+void __db_err __P((const DB_ENV *, int, const char *, ...)) __attribute__ ((__format__ (__printf__, 3, 4)));
+void __db_errx __P((const DB_ENV *, const char *, ...)) __attribute__ ((__format__ (__printf__, 2, 3)));
+void __db_errcall __P((const DB_ENV *, int, db_error_set_t, const char *, va_list));
+void __db_errfile __P((const DB_ENV *, int, db_error_set_t, const char *, va_list));
 void __db_msgadd __P((DB_ENV *, DB_MSGBUF *, const char *, ...)) __attribute__ ((__format__ (__printf__, 3, 4)));
 void __db_msg __P((const DB_ENV *, const char *, ...)) __attribute__ ((__format__ (__printf__, 2, 3)));
-void __db_logmsg __P((const DB_ENV *, DB_TXN *, const char *, u_int32_t, const char *, ...)) __attribute__ ((__format__ (__printf__, 5, 6)));
 int __db_unknown_flag __P((DB_ENV *, char *, u_int32_t));
 int __db_unknown_type __P((DB_ENV *, char *, DBTYPE));
+int __db_unknown_path __P((DB_ENV *, char *));
 int __db_check_txn __P((DB *, DB_TXN *, u_int32_t, int));
+int __db_txn_deadlock_err __P((DB_ENV *));
 int __db_not_txn_env __P((DB_ENV *));
 int __db_rec_toobig __P((DB_ENV *, u_int32_t, u_int32_t));
 int __db_rec_repl __P((DB_ENV *, u_int32_t, u_int32_t));
+int __dbc_logging __P((DBC *));
 int __db_check_lsn __P((DB_ENV *, DB_LSN *, DB_LSN *));
+int __db_rdonly __P((const DB_ENV *, const char *));
+int __db_space_err __P((const DB *));
+int __db_failed __P((const DB_ENV *, const char *, pid_t, db_threadid_t));
 int __db_getlong __P((DB_ENV *, const char *, char *, long, long, long *));
 int __db_getulong __P((DB_ENV *, const char *, char *, u_long, u_long, u_long *));
 void __db_idspace __P((u_int32_t *, int, u_int32_t *, u_int32_t *));
 u_int32_t __db_log2 __P((u_int32_t));
+int __db_mkpath __P((DB_ENV *, const char *));
 int __db_util_arg __P((char *, char *, int *, char ***));
 int __db_util_cache __P((DB *, u_int32_t *, int *));
 int __db_util_logset __P((const char *, char *));
diff --git a/db/dbinc_auto/crdel_auto.h b/db/dbinc_auto/crdel_auto.h
index bdae193fa..209dcb0b7 100644
--- a/db/dbinc_auto/crdel_auto.h
+++ b/db/dbinc_auto/crdel_auto.h
@@ -5,7 +5,7 @@
 #define	DB___crdel_metasub	142
 typedef struct ___crdel_metasub_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -13,4 +13,34 @@ typedef struct ___crdel_metasub_args {
 	DB_LSN	lsn;
 } __crdel_metasub_args;
 
+#define	DB___crdel_inmem_create	138
+typedef struct ___crdel_inmem_create_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	DBT	name;
+	DBT	fid;
+	u_int32_t	pgsize;
+} __crdel_inmem_create_args;
+
+#define	DB___crdel_inmem_rename	139
+typedef struct ___crdel_inmem_rename_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	DBT	oldname;
+	DBT	newname;
+	DBT	fid;
+} __crdel_inmem_rename_args;
+
+#define	DB___crdel_inmem_remove	140
+typedef struct ___crdel_inmem_remove_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	DBT	name;
+	DBT	fid;
+} __crdel_inmem_remove_args;
+
 #endif
diff --git a/db/dbinc_auto/db_auto.h b/db/dbinc_auto/db_auto.h
index c2edcedbc..dc6d5304e 100644
--- a/db/dbinc_auto/db_auto.h
+++ b/db/dbinc_auto/db_auto.h
@@ -5,7 +5,7 @@
 #define	DB___db_addrem	41
 typedef struct ___db_addrem_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	opcode;
 	int32_t	fileid;
@@ -20,7 +20,7 @@ typedef struct ___db_addrem_args {
 #define	DB___db_big	43
 typedef struct ___db_big_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	opcode;
 	int32_t	fileid;
@@ -36,7 +36,7 @@ typedef struct ___db_big_args {
 #define	DB___db_ovref	44
 typedef struct ___db_ovref_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -44,10 +44,25 @@ typedef struct ___db_ovref_args {
 	DB_LSN	lsn;
 } __db_ovref_args;
 
+#define	DB___db_relink_42	45
+typedef struct ___db_relink_42_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	u_int32_t	opcode;
+	int32_t	fileid;
+	db_pgno_t	pgno;
+	DB_LSN	lsn;
+	db_pgno_t	prev;
+	DB_LSN	lsn_prev;
+	db_pgno_t	next;
+	DB_LSN	lsn_next;
+} __db_relink_42_args;
+
 #define	DB___db_debug	47
 typedef struct ___db_debug_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	DBT	op;
 	int32_t	fileid;
@@ -59,17 +74,31 @@ typedef struct ___db_debug_args {
 #define	DB___db_noop	48
 typedef struct ___db_noop_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
 	DB_LSN	prevlsn;
 } __db_noop_args;
 
+#define	DB___db_pg_alloc_42	49
+typedef struct ___db_pg_alloc_42_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	DB_LSN	meta_lsn;
+	db_pgno_t	meta_pgno;
+	DB_LSN	page_lsn;
+	db_pgno_t	pgno;
+	u_int32_t	ptype;
+	db_pgno_t	next;
+} __db_pg_alloc_42_args;
+
 #define	DB___db_pg_alloc	49
 typedef struct ___db_pg_alloc_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	DB_LSN	meta_lsn;
@@ -81,10 +110,23 @@ typedef struct ___db_pg_alloc_args {
 	db_pgno_t	last_pgno;
 } __db_pg_alloc_args;
 
+#define	DB___db_pg_free_42	50
+typedef struct ___db_pg_free_42_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	db_pgno_t	pgno;
+	DB_LSN	meta_lsn;
+	db_pgno_t	meta_pgno;
+	DBT	header;
+	db_pgno_t	next;
+} __db_pg_free_42_args;
+
 #define	DB___db_pg_free	50
 typedef struct ___db_pg_free_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -98,14 +140,28 @@ typedef struct ___db_pg_free_args {
 #define	DB___db_cksum	51
 typedef struct ___db_cksum_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 } __db_cksum_args;
 
+#define	DB___db_pg_freedata_42	52
+typedef struct ___db_pg_freedata_42_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	db_pgno_t	pgno;
+	DB_LSN	meta_lsn;
+	db_pgno_t	meta_pgno;
+	DBT	header;
+	db_pgno_t	next;
+	DBT	data;
+} __db_pg_freedata_42_args;
+
 #define	DB___db_pg_freedata	52
 typedef struct ___db_pg_freedata_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -120,7 +176,7 @@ typedef struct ___db_pg_freedata_args {
 #define	DB___db_pg_prepare	53
 typedef struct ___db_pg_prepare_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -129,7 +185,7 @@ typedef struct ___db_pg_prepare_args {
 #define	DB___db_pg_new	54
 typedef struct ___db_pg_new_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -142,7 +198,7 @@ typedef struct ___db_pg_new_args {
 #define	DB___db_pg_init	60
 typedef struct ___db_pg_init_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -150,4 +206,18 @@ typedef struct ___db_pg_init_args {
 	DBT	data;
 } __db_pg_init_args;
 
+#define	DB___db_pg_sort	61
+typedef struct ___db_pg_sort_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	db_pgno_t	meta;
+	DB_LSN	meta_lsn;
+	db_pgno_t	last_free;
+	DB_LSN	last_lsn;
+	db_pgno_t	last_pgno;
+	DBT	list;
+} __db_pg_sort_args;
+
 #endif
diff --git a/db/dbinc_auto/db_ext.h b/db/dbinc_auto/db_ext.h
index c7124c350..141bd5149 100644
--- a/db/dbinc_auto/db_ext.h
+++ b/db/dbinc_auto/db_ext.h
@@ -8,19 +8,30 @@ extern "C" {
 
 int __crdel_metasub_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
 int __crdel_metasub_read __P((DB_ENV *, void *, __crdel_metasub_args **));
+int __crdel_inmem_create_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, const DBT *, const DBT *, u_int32_t));
+int __crdel_inmem_create_read __P((DB_ENV *, void *, __crdel_inmem_create_args **));
+int __crdel_inmem_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *));
+int __crdel_inmem_rename_read __P((DB_ENV *, void *, __crdel_inmem_rename_args **));
+int __crdel_inmem_remove_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *));
+int __crdel_inmem_remove_read __P((DB_ENV *, void *, __crdel_inmem_remove_args **));
 int __crdel_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
 int __crdel_metasub_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __crdel_inmem_create_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __crdel_inmem_rename_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __crdel_inmem_remove_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __crdel_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
 int __crdel_metasub_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __crdel_inmem_create_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __crdel_inmem_rename_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __crdel_inmem_remove_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_master_open __P((DB *, DB_TXN *, const char *, u_int32_t, int, DB **));
 int __db_master_update __P((DB *, DB *, DB_TXN *, const char *, DBTYPE, mu_action, const char *, u_int32_t));
-int __db_dbenv_setup __P((DB *, DB_TXN *, const char *, u_int32_t, u_int32_t));
+int __db_dbenv_setup __P((DB *, DB_TXN *, const char *, const char *, u_int32_t, u_int32_t));
 int __db_dbenv_mpool __P((DB *, const char *, u_int32_t));
 int __db_close __P((DB *, DB_TXN *, u_int32_t));
-int __db_refresh __P((DB *, DB_TXN *, u_int32_t, int *));
+int __db_refresh __P((DB *, DB_TXN *, u_int32_t, int *, int));
 int __db_log_page __P((DB *, DB_TXN *, DB_LSN *, db_pgno_t, PAGE *));
 int __db_backup_name __P((DB_ENV *, const char *, DB_TXN *, char **));
-DB *__dblist_get __P((DB_ENV *, u_int32_t));
 #ifdef CONFIG_TEST
 int __db_testcopy __P((DB_ENV *, DB *, const char *));
 #endif
@@ -36,16 +47,20 @@ int __db_big_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t,
 int __db_big_read __P((DB_ENV *, void *, __db_big_args **));
 int __db_ovref_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, int32_t, DB_LSN *));
 int __db_ovref_read __P((DB_ENV *, void *, __db_ovref_args **));
+int __db_relink_42_read __P((DB_ENV *, void *, __db_relink_42_args **));
 int __db_debug_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, int32_t, const DBT *, const DBT *, u_int32_t));
 int __db_debug_read __P((DB_ENV *, void *, __db_debug_args **));
 int __db_noop_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *));
 int __db_noop_read __P((DB_ENV *, void *, __db_noop_args **));
+int __db_pg_alloc_42_read __P((DB_ENV *, void *, __db_pg_alloc_42_args **));
 int __db_pg_alloc_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t, db_pgno_t));
 int __db_pg_alloc_read __P((DB_ENV *, void *, __db_pg_alloc_args **));
+int __db_pg_free_42_read __P((DB_ENV *, void *, __db_pg_free_42_args **));
 int __db_pg_free_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, db_pgno_t, db_pgno_t));
 int __db_pg_free_read __P((DB_ENV *, void *, __db_pg_free_args **));
 int __db_cksum_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t));
 int __db_cksum_read __P((DB_ENV *, void *, __db_cksum_args **));
+int __db_pg_freedata_42_read __P((DB_ENV *, void *, __db_pg_freedata_42_args **));
 int __db_pg_freedata_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, db_pgno_t, db_pgno_t, const DBT *));
 int __db_pg_freedata_read __P((DB_ENV *, void *, __db_pg_freedata_args **));
 int __db_pg_prepare_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t));
@@ -54,19 +69,26 @@ int __db_pg_new_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN
 int __db_pg_new_read __P((DB_ENV *, void *, __db_pg_new_args **));
 int __db_pg_init_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, const DBT *, const DBT *));
 int __db_pg_init_read __P((DB_ENV *, void *, __db_pg_init_args **));
+int __db_pg_sort_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *));
+int __db_pg_sort_read __P((DB_ENV *, void *, __db_pg_sort_args **));
 int __db_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
 int __db_addrem_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_big_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_ovref_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_relink_42_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_debug_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_noop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_pg_alloc_42_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_pg_alloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_pg_free_42_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_pg_free_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_cksum_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_pg_freedata_42_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_pg_freedata_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_pg_prepare_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_pg_new_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_pg_init_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_pg_sort_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
 int __db_c_close __P((DBC *));
 int __db_c_destroy __P((DBC *));
@@ -81,33 +103,31 @@ int __db_duperr __P((DB *, u_int32_t));
 int __db_c_secondary_get_pp __P((DBC *, DBT *, DBT *, u_int32_t));
 int __db_c_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
 int __db_c_del_primary __P((DBC *));
-DB *__db_s_first __P((DB *));
+int __db_s_first __P((DB *, DB **));
 int __db_s_next __P((DB **));
 int __db_s_done __P((DB *));
 u_int32_t __db_partsize __P((u_int32_t, DBT *));
+int __cdsgroup_begin __P((DB_ENV *, DB_TXN **));
 int __db_pgin __P((DB_ENV *, db_pgno_t, void *, DBT *));
 int __db_pgout __P((DB_ENV *, db_pgno_t, void *, DBT *));
 void __db_metaswap __P((PAGE *));
 int __db_byteswap __P((DB_ENV *, DB *, db_pgno_t, PAGE *, size_t, int));
-int __db_dispatch __P((DB_ENV *, int (**)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)), size_t, DBT *, DB_LSN *, db_recops, void *));
+int __db_dispatch __P((DB_ENV *, int (**)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)), size_t, DBT *, DB_LSN *, db_recops, DB_TXNHEAD *));
 int __db_add_recovery __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), u_int32_t));
-int __db_txnlist_init __P((DB_ENV *, u_int32_t, u_int32_t, DB_LSN *, void *));
-int __db_txnlist_add __P((DB_ENV *, void *, u_int32_t, u_int32_t, DB_LSN *));
-int __db_txnlist_remove __P((DB_ENV *, void *, u_int32_t));
-void __db_txnlist_ckp __P((DB_ENV *, void *, DB_LSN *));
-void __db_txnlist_end __P((DB_ENV *, void *));
-int __db_txnlist_find __P((DB_ENV *, void *, u_int32_t, u_int32_t *));
-int __db_txnlist_update __P((DB_ENV *, void *, u_int32_t, u_int32_t, DB_LSN *, u_int32_t *, int));
-int __db_txnlist_gen __P((DB_ENV *, void *, int, u_int32_t, u_int32_t));
-int __db_txnlist_lsnadd __P((DB_ENV *, void *, DB_LSN *, u_int32_t));
+int __db_txnlist_init __P((DB_ENV *, u_int32_t, u_int32_t, DB_LSN *, DB_TXNHEAD **));
+int __db_txnlist_add __P((DB_ENV *, DB_TXNHEAD *, u_int32_t, u_int32_t, DB_LSN *));
+int __db_txnlist_remove __P((DB_ENV *, DB_TXNHEAD *, u_int32_t));
+void __db_txnlist_ckp __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *));
+void __db_txnlist_end __P((DB_ENV *, DB_TXNHEAD *));
+int __db_txnlist_find __P((DB_ENV *, DB_TXNHEAD *, u_int32_t, u_int32_t *));
+int __db_txnlist_update __P((DB_ENV *, DB_TXNHEAD *, u_int32_t, u_int32_t, DB_LSN *, u_int32_t *, int));
+int __db_txnlist_gen __P((DB_ENV *, DB_TXNHEAD *, int, u_int32_t, u_int32_t));
+int __db_txnlist_lsnadd __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *));
+int __db_txnlist_lsnget __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *, u_int32_t));
 int __db_txnlist_lsninit __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *));
-#ifndef HAVE_FTRUNCATE
-int __db_add_limbo __P((DB_ENV *, void *, int32_t, db_pgno_t, int32_t));
-#endif
-#ifndef HAVE_FTRUNCATE
+int __db_add_limbo __P((DB_ENV *, DB_TXNHEAD *, int32_t, db_pgno_t, u_int32_t));
 int __db_do_the_limbo __P((DB_ENV *, DB_TXN *, DB_TXN *, DB_TXNHEAD *, db_limbo_state));
-#endif
-void __db_txnlist_print __P((void *));
+void __db_txnlist_print __P((DB_TXNHEAD *));
 int __db_ditem __P((DBC *, PAGE *, u_int32_t, u_int32_t));
 int __db_pitem __P((DBC *, PAGE *, u_int32_t, u_int32_t, DBT *, DBT *));
 int __db_associate_pp __P((DB *, DB_TXN *, DB *, int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
@@ -124,11 +144,11 @@ int __db_open_pp __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int3
 int __db_pget_pp __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
 int __db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
 int __db_put_pp __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+int __db_compact_pp __P((DB *, DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *));
 int __db_sync_pp __P((DB *, u_int32_t));
 int __db_c_close_pp __P((DBC *));
 int __db_c_count_pp __P((DBC *, db_recno_t *, u_int32_t));
 int __db_c_del_pp __P((DBC *, u_int32_t));
-int __db_c_del_arg __P((DBC *, u_int32_t));
 int __db_c_dup_pp __P((DBC *, DBC **, u_int32_t));
 int __db_c_get_pp __P((DBC *, DBT *, DBT *, u_int32_t));
 int __db_secondary_close_pp __P((DB *, u_int32_t));
@@ -136,11 +156,22 @@ int __db_c_pget_pp __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
 int __db_c_put_pp __P((DBC *, DBT *, DBT *, u_int32_t));
 int __db_txn_auto_init __P((DB_ENV *, DB_TXN **));
 int __db_txn_auto_resolve __P((DB_ENV *, DB_TXN *, int, int));
+int __dbt_usercopy __P((DB_ENV *, DBT *));
+void __dbt_userfree __P((DB_ENV *, DBT *, DBT *, DBT *));
 int __db_join __P((DB *, DBC **, DBC **, u_int32_t));
 int __db_join_close __P((DBC *));
 int __db_secondary_corrupt __P((DB *));
 int __db_new __P((DBC *, u_int32_t, PAGE **));
 int __db_free __P((DBC *, PAGE *));
+#ifdef HAVE_FTRUNCATE
+void __db_freelist_pos __P((db_pgno_t, db_pgno_t *, u_int32_t, u_int32_t *));
+#endif
+#ifdef HAVE_FTRUNCATE
+int __db_pg_truncate __P((DB_MPOOLFILE *, DB_TXN *, struct pglist *list, DB_COMPACT *, u_int32_t *, db_pgno_t *, DB_LSN *, int));
+#endif
+#ifdef HAVE_FTRUNCATE
+int __db_free_truncate __P((DB *, DB_TXN *, u_int32_t, DB_COMPACT *, struct pglist **, u_int32_t *, db_pgno_t *));
+#endif
 int __db_lprint __P((DBC *));
 int __db_lget __P((DBC *, int, db_pgno_t, db_lockmode_t, u_int32_t, DB_LOCK *));
 int __db_lput __P((DBC *, DB_LOCK *));
@@ -156,23 +187,23 @@ int __db_new_file __P((DB *, DB_TXN *, DB_FH *, const char *));
 int __db_init_subdb __P((DB *, DB *, const char *, DB_TXN *));
 int __db_chk_meta __P((DB_ENV *, DB *, DBMETA *, int));
 int __db_meta_setup __P((DB_ENV *, DB *, const char *, DBMETA *, u_int32_t, int));
-int __db_goff __P((DB *, DBT *, u_int32_t, db_pgno_t, void **, u_int32_t *));
+int __db_goff __P((DB *, DB_TXN *, DBT *, u_int32_t, db_pgno_t, void **, u_int32_t *));
 int __db_poff __P((DBC *, const DBT *, db_pgno_t *));
-int __db_ovref __P((DBC *, db_pgno_t, int32_t));
+int __db_ovref __P((DBC *, db_pgno_t));
 int __db_doff __P((DBC *, db_pgno_t));
-int __db_moff __P((DB *, const DBT *, db_pgno_t, u_int32_t, int (*)(DB *, const DBT *, const DBT *), int *));
+int __db_moff __P((DB *, DB_TXN *, const DBT *, db_pgno_t, u_int32_t, int (*)(DB *, const DBT *, const DBT *), int *));
 int __db_vrfy_overflow __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
 int __db_vrfy_ovfl_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, u_int32_t));
 int __db_safe_goff __P((DB *, VRFY_DBINFO *, db_pgno_t, DBT *, void *, u_int32_t));
 void __db_loadme __P((void));
-int __db_dumptree __P((DB *, char *, char *));
+int __db_dumptree __P((DB *, DB_TXN *, char *, char *));
 const FN * __db_get_flags_fn __P((void));
-int __db_prnpage __P((DB *, db_pgno_t));
+int __db_prnpage __P((DB *, DB_TXN *, db_pgno_t));
 int __db_prpage __P((DB *, PAGE *, u_int32_t));
 void __db_pr __P((DB_ENV *, DB_MSGBUF *, u_int8_t *, u_int32_t));
 void __db_prflags __P((DB_ENV *, DB_MSGBUF *, u_int32_t, const FN *, const char *, const char *));
 const char * __db_lockmode_to_string __P((db_lockmode_t));
-int __db_dumptree __P((DB *, char *, char *));
+int __db_dumptree __P((DB *, DB_TXN *, char *, char *));
 const FN * __db_get_flags_fn __P((void));
 int __db_dump_pp __P((DB *, const char *, int (*)(void *, const void *), void *, int, int));
 int __db_dump __P((DB *, const char *, int (*)(void *, const void *), void *, int, int));
@@ -193,21 +224,27 @@ int __db_pg_freedata_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *))
 int __db_cksum_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_pg_prepare_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __db_pg_init_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_traverse_big __P((DB *, db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *));
+int __db_pg_sort_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_pg_alloc_42_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_pg_free_42_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_pg_freedata_42_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_relink_42_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __db_traverse_big __P((DB *, db_pgno_t, DB_TXN *, int (*)(DB *, PAGE *, void *, int *), void *));
 int __db_reclaim_callback __P((DB *, PAGE *, void *, int *));
 int __db_truncate_callback __P((DB *, PAGE *, void *, int *));
-int __dbenv_dbremove_pp __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t));
+int __env_dbremove_pp __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t));
 int __db_remove_pp __P((DB *, const char *, const char *, u_int32_t));
 int __db_remove __P((DB *, DB_TXN *, const char *, const char *, u_int32_t));
 int __db_remove_int __P((DB *, DB_TXN *, const char *, const char *, u_int32_t));
-int __dbenv_dbrename_pp __P((DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t));
+int __db_inmem_remove __P((DB *, DB_TXN *, const char *));
+int __env_dbrename_pp __P((DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t));
 int __db_rename_pp __P((DB *, const char *, const char *, const char *, u_int32_t));
 int __db_rename __P((DB *, DB_TXN *, const char *, const char *, const char *));
 int __db_rename_int __P((DB *, DB_TXN *, const char *, const char *, const char *));
-int __db_ret __P((DB *, PAGE *, u_int32_t, DBT *, void **, u_int32_t *));
+int __db_ret __P((DB *, DB_TXN *, PAGE *, u_int32_t, DBT *, void **, u_int32_t *));
 int __db_retcopy __P((DB_ENV *, DBT *, void *, u_int32_t, void **, u_int32_t *));
-int __db_fileid_reset __P((DB_ENV *, char *, int));
-int __db_lsn_reset __P((DB_ENV *, char *, int));
+int __env_fileid_reset_pp __P((DB_ENV *, const char *, u_int32_t));
+int __env_lsn_reset_pp __P((DB_ENV *, const char *, u_int32_t));
 int __db_stat_pp __P((DB *, DB_TXN *, void *, u_int32_t));
 int __db_stat __P((DB *, DB_TXN *, void *, u_int32_t));
 int __db_stat_print_pp __P((DB *, u_int32_t));
@@ -243,7 +280,7 @@ int __db_vrfy_ccnext __P((DBC *, VRFY_CHILDINFO **));
 int __db_vrfy_ccclose __P((DBC *));
 int  __db_salvage_init __P((VRFY_DBINFO *));
 void  __db_salvage_destroy __P((VRFY_DBINFO *));
-int __db_salvage_getnext __P((VRFY_DBINFO *, db_pgno_t *, u_int32_t *));
+int __db_salvage_getnext __P((VRFY_DBINFO *, DBC **, db_pgno_t *, u_int32_t *, int));
 int __db_salvage_isdone __P((VRFY_DBINFO *, db_pgno_t));
 int __db_salvage_markdone __P((VRFY_DBINFO *, db_pgno_t));
 int __db_salvage_markneeded __P((VRFY_DBINFO *, db_pgno_t, u_int32_t));
diff --git a/db/dbinc_auto/dbreg_auto.h b/db/dbinc_auto/dbreg_auto.h
index 4d7d4a91b..a9722d0e9 100644
--- a/db/dbinc_auto/dbreg_auto.h
+++ b/db/dbinc_auto/dbreg_auto.h
@@ -5,7 +5,7 @@
 #define	DB___dbreg_register	2
 typedef struct ___dbreg_register_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	opcode;
 	DBT	name;
diff --git a/db/dbinc_auto/dbreg_ext.h b/db/dbinc_auto/dbreg_ext.h
index 5902b9db9..6e7aa8487 100644
--- a/db/dbinc_auto/dbreg_ext.h
+++ b/db/dbinc_auto/dbreg_ext.h
@@ -13,24 +13,27 @@ int __dbreg_get_id __P((DB *, DB_TXN *, int32_t *));
 int __dbreg_assign_id __P((DB *, int32_t));
 int __dbreg_revoke_id __P((DB *, int, int32_t));
 int __dbreg_close_id __P((DB *, DB_TXN *, u_int32_t));
+int __dbreg_log_close __P((DB_ENV *, FNAME *, DB_TXN *, u_int32_t));
+int __dbreg_log_id __P((DB *, DB_TXN *, int32_t, int));
 int __dbreg_register_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, int32_t, DBTYPE, db_pgno_t, u_int32_t));
 int __dbreg_register_read __P((DB_ENV *, void *, __dbreg_register_args **));
 int __dbreg_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
 int __dbreg_register_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __dbreg_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
 int __dbreg_register_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __dbreg_stat_print __P((DB_ENV *, u_int32_t));
 void __dbreg_print_fname __P((DB_ENV *, FNAME *));
-void __dbreg_print_dblist __P((DB_ENV *, u_int32_t));
 int __dbreg_add_dbentry __P((DB_ENV *, DB_LOG *, DB *, int32_t));
-void __dbreg_rem_dbentry __P((DB_LOG *, int32_t));
+int __dbreg_rem_dbentry __P((DB_LOG *, int32_t));
 int __dbreg_log_files __P((DB_ENV *));
 int __dbreg_close_files __P((DB_ENV *));
+int __dbreg_invalidate_files __P((DB_ENV *));
 int __dbreg_id_to_db __P((DB_ENV *, DB_TXN *, DB **, int32_t, int));
 int __dbreg_id_to_db_int __P((DB_ENV *, DB_TXN *, DB **, int32_t, int, int));
 int __dbreg_id_to_fname __P((DB_LOG *, int32_t, int, FNAME **));
 int __dbreg_fid_to_fname __P((DB_LOG *, u_int8_t *, int, FNAME **));
 int __dbreg_get_name __P((DB_ENV *, u_int8_t *, char **));
-int __dbreg_do_open __P((DB_ENV *, DB_TXN *, DB_LOG *, u_int8_t *, char *, DBTYPE, int32_t, db_pgno_t, void *, u_int32_t));
+int __dbreg_do_open __P((DB_ENV *, DB_TXN *, DB_LOG *, u_int8_t *, char *, DBTYPE, int32_t, db_pgno_t, void *, u_int32_t, u_int32_t));
 int __dbreg_lazy_id __P((DB *));
 
 #if defined(__cplusplus)
diff --git a/db/dbinc_auto/env_ext.h b/db/dbinc_auto/env_ext.h
index 03b3ae995..2e0882415 100644
--- a/db/dbinc_auto/env_ext.h
+++ b/db/dbinc_auto/env_ext.h
@@ -13,49 +13,60 @@ void __db_shalloc_free __P((REGINFO *, void *));
 size_t __db_shalloc_sizeof __P((void *));
 u_int32_t __db_tablesize __P((u_int32_t));
 void __db_hashinit __P((void *, u_int32_t));
-int __db_fileinit __P((DB_ENV *, DB_FH *, size_t, int));
-int __db_overwrite __P((DB_ENV *, const char *));
-int  __dbenv_set_alloc __P((DB_ENV *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *)));
-int __dbenv_get_encrypt_flags __P((DB_ENV *, u_int32_t *));
-int __dbenv_set_encrypt __P((DB_ENV *, const char *, u_int32_t));
-int  __dbenv_set_flags __P((DB_ENV *, u_int32_t, int));
-int  __dbenv_set_data_dir __P((DB_ENV *, const char *));
-int  __dbenv_set_intermediate_dir __P((DB_ENV *, int, u_int32_t));
-void __dbenv_set_errcall __P((DB_ENV *, void (*)(const DB_ENV *, const char *, const char *)));
-void __dbenv_get_errfile __P((DB_ENV *, FILE **));
-void __dbenv_set_errfile __P((DB_ENV *, FILE *));
-void __dbenv_get_errpfx __P((DB_ENV *, const char **));
-void __dbenv_set_errpfx __P((DB_ENV *, const char *));
-void __dbenv_set_msgcall __P((DB_ENV *, void (*)(const DB_ENV *, const char *)));
-void __dbenv_get_msgfile __P((DB_ENV *, FILE **));
-void __dbenv_set_msgfile __P((DB_ENV *, FILE *));
-int  __dbenv_set_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int)));
-int  __dbenv_set_shm_key __P((DB_ENV *, long));
-int  __dbenv_set_tas_spins __P((DB_ENV *, u_int32_t));
-int  __dbenv_set_tmp_dir __P((DB_ENV *, const char *));
-int  __dbenv_set_verbose __P((DB_ENV *, u_int32_t, int));
+int __env_read_db_config __P((DB_ENV *));
+int __env_failchk_pp __P((DB_ENV *, u_int32_t));
+int __env_thread_init __P((DB_ENV *, int));
+int __env_set_state __P((DB_ENV *, DB_THREAD_INFO **, DB_THREAD_STATE));
+char *__env_thread_id_string __P((DB_ENV *, pid_t, db_threadid_t, char *));
+int __db_file_extend __P((DB_ENV *, DB_FH *, size_t));
+int __db_file_multi_write __P((DB_ENV *, const char *));
+int __db_file_write __P((DB_ENV *, DB_FH *, u_int32_t, u_int32_t, int));
+void __db_env_destroy __P((DB_ENV *));
+int  __env_set_alloc __P((DB_ENV *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *)));
+int __env_get_encrypt_flags __P((DB_ENV *, u_int32_t *));
+int __env_set_encrypt __P((DB_ENV *, const char *, u_int32_t));
+int  __env_set_flags __P((DB_ENV *, u_int32_t, int));
+int  __env_set_data_dir __P((DB_ENV *, const char *));
+int  __env_set_intermediate_dir __P((DB_ENV *, int, u_int32_t));
+void __env_set_errcall __P((DB_ENV *, void (*)(const DB_ENV *, const char *, const char *)));
+void __env_get_errfile __P((DB_ENV *, FILE **));
+void __env_set_errfile __P((DB_ENV *, FILE *));
+void __env_get_errpfx __P((DB_ENV *, const char **));
+void __env_set_errpfx __P((DB_ENV *, const char *));
+void __env_set_msgcall __P((DB_ENV *, void (*)(const DB_ENV *, const char *)));
+void __env_get_msgfile __P((DB_ENV *, FILE **));
+void __env_set_msgfile __P((DB_ENV *, FILE *));
+int  __env_set_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int)));
+int  __env_set_shm_key __P((DB_ENV *, long));
+int  __env_set_tmp_dir __P((DB_ENV *, const char *));
+int  __env_set_verbose __P((DB_ENV *, u_int32_t, int));
 int __db_mi_env __P((DB_ENV *, const char *));
 int __db_mi_open __P((DB_ENV *, const char *, int));
 int __db_env_config __P((DB_ENV *, char *, u_int32_t));
-int __dbenv_open __P((DB_ENV *, const char *, u_int32_t, int));
-int __dbenv_remove __P((DB_ENV *, const char *, u_int32_t));
-int __dbenv_close_pp __P((DB_ENV *, u_int32_t));
-int __dbenv_close __P((DB_ENV *, int));
-int __dbenv_get_open_flags __P((DB_ENV *, u_int32_t *));
+int __env_open_pp __P((DB_ENV *, const char *, u_int32_t, int));
+int __env_open __P((DB_ENV *, const char *, u_int32_t, int));
+int __env_remove __P((DB_ENV *, const char *, u_int32_t));
+int __env_config __P((DB_ENV *, const char *, u_int32_t, int));
+int __env_close_pp __P((DB_ENV *, u_int32_t));
+int __env_close __P((DB_ENV *, int));
+int __env_get_open_flags __P((DB_ENV *, u_int32_t *));
 int __db_appname __P((DB_ENV *, APPNAME, const char *, u_int32_t, DB_FH **, char **));
-int __db_home __P((DB_ENV *, const char *, u_int32_t));
 int __db_apprec __P((DB_ENV *, DB_LSN *, DB_LSN *, int, u_int32_t));
 int    __log_backup __P((DB_ENV *, DB_LOGC *, DB_LSN *, DB_LSN *, u_int32_t));
 int __env_openfiles __P((DB_ENV *, DB_LOGC *, void *, DBT *, DB_LSN *, DB_LSN *, double, int));
+int __env_init_rec __P((DB_ENV *, u_int32_t));
 int __db_e_attach __P((DB_ENV *, u_int32_t *));
+int __db_e_golive __P((DB_ENV *));
 int __db_e_detach __P((DB_ENV *, int));
 int __db_e_remove __P((DB_ENV *, u_int32_t));
 int __db_r_attach __P((DB_ENV *, REGINFO *, size_t));
 int __db_r_detach __P((DB_ENV *, REGINFO *, int));
-int __dbenv_stat_print_pp __P((DB_ENV *, u_int32_t));
-void __db_print_fh __P((DB_ENV *, DB_FH *, u_int32_t));
+int __envreg_register __P((DB_ENV *, int *));
+int __envreg_unregister __P((DB_ENV *, int));
+int __envreg_xunlock __P((DB_ENV *));
+int __env_stat_print_pp __P((DB_ENV *, u_int32_t));
+void __db_print_fh __P((DB_ENV *, const char *, DB_FH *, u_int32_t));
 void __db_print_fileid __P((DB_ENV *, u_int8_t *, const char *));
-void __db_print_mutex __P((DB_ENV *, DB_MSGBUF *, DB_MUTEX *, const char *, u_int32_t));
 void __db_dl __P((DB_ENV *, const char *, u_long));
 void __db_dl_pct __P((DB_ENV *, const char *, u_long, int, const char *));
 void __db_dlbytes __P((DB_ENV *, const char *, u_long, u_long, u_long));
diff --git a/db/dbinc_auto/ext_def.in b/db/dbinc_auto/ext_def.in
index 37577a77e..f1952ba3d 100644
--- a/db/dbinc_auto/ext_def.in
+++ b/db/dbinc_auto/ext_def.in
@@ -57,6 +57,6 @@
 #define	__db_hsearch __db_hsearch@DB_VERSION_UNIQUE_NAME@
 #define	__db_hdestroy __db_hdestroy@DB_VERSION_UNIQUE_NAME@
 #endif
-#define db_xa_switch db_xa_switch@DB_VERSION_UNIQUE_NAME@
+#define	db_xa_switch db_xa_switch@DB_VERSION_UNIQUE_NAME@
 
 #endif /* !_DB_EXT_DEF_IN_ */
diff --git a/db/dbinc_auto/fileops_auto.h b/db/dbinc_auto/fileops_auto.h
index 12440264d..9b3a65649 100644
--- a/db/dbinc_auto/fileops_auto.h
+++ b/db/dbinc_auto/fileops_auto.h
@@ -5,7 +5,7 @@
 #define	DB___fop_create	143
 typedef struct ___fop_create_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	DBT	name;
 	u_int32_t	appname;
@@ -15,7 +15,7 @@ typedef struct ___fop_create_args {
 #define	DB___fop_remove	144
 typedef struct ___fop_remove_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	DBT	name;
 	DBT	fid;
@@ -25,7 +25,7 @@ typedef struct ___fop_remove_args {
 #define	DB___fop_write	145
 typedef struct ___fop_write_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	DBT	name;
 	u_int32_t	appname;
@@ -39,7 +39,7 @@ typedef struct ___fop_write_args {
 #define	DB___fop_rename	146
 typedef struct ___fop_rename_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	DBT	oldname;
 	DBT	newname;
@@ -50,7 +50,7 @@ typedef struct ___fop_rename_args {
 #define	DB___fop_file_remove	141
 typedef struct ___fop_file_remove_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	DBT	real_fid;
 	DBT	tmp_fid;
diff --git a/db/dbinc_auto/hash_auto.h b/db/dbinc_auto/hash_auto.h
index 5b5525363..8d9f93d0d 100644
--- a/db/dbinc_auto/hash_auto.h
+++ b/db/dbinc_auto/hash_auto.h
@@ -5,7 +5,7 @@
 #define	DB___ham_insdel	21
 typedef struct ___ham_insdel_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	opcode;
 	int32_t	fileid;
@@ -19,7 +19,7 @@ typedef struct ___ham_insdel_args {
 #define	DB___ham_newpage	22
 typedef struct ___ham_newpage_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	opcode;
 	int32_t	fileid;
@@ -34,7 +34,7 @@ typedef struct ___ham_newpage_args {
 #define	DB___ham_splitdata	24
 typedef struct ___ham_splitdata_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	u_int32_t	opcode;
@@ -46,7 +46,7 @@ typedef struct ___ham_splitdata_args {
 #define	DB___ham_replace	25
 typedef struct ___ham_replace_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -61,7 +61,7 @@ typedef struct ___ham_replace_args {
 #define	DB___ham_copypage	28
 typedef struct ___ham_copypage_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -73,10 +73,26 @@ typedef struct ___ham_copypage_args {
 	DBT	page;
 } __ham_copypage_args;
 
+#define	DB___ham_metagroup_42	29
+typedef struct ___ham_metagroup_42_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	u_int32_t	bucket;
+	db_pgno_t	mmpgno;
+	DB_LSN	mmetalsn;
+	db_pgno_t	mpgno;
+	DB_LSN	metalsn;
+	db_pgno_t	pgno;
+	DB_LSN	pagelsn;
+	u_int32_t	newalloc;
+} __ham_metagroup_42_args;
+
 #define	DB___ham_metagroup	29
 typedef struct ___ham_metagroup_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	u_int32_t	bucket;
@@ -90,23 +106,35 @@ typedef struct ___ham_metagroup_args {
 	db_pgno_t	last_pgno;
 } __ham_metagroup_args;
 
+#define	DB___ham_groupalloc_42	32
+typedef struct ___ham_groupalloc_42_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	int32_t	fileid;
+	DB_LSN	meta_lsn;
+	db_pgno_t	start_pgno;
+	u_int32_t	num;
+	db_pgno_t	free;
+} __ham_groupalloc_42_args;
+
 #define	DB___ham_groupalloc	32
 typedef struct ___ham_groupalloc_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	DB_LSN	meta_lsn;
 	db_pgno_t	start_pgno;
 	u_int32_t	num;
-	db_pgno_t	free;
+	db_pgno_t	unused;
 	db_pgno_t	last_pgno;
 } __ham_groupalloc_args;
 
 #define	DB___ham_curadj	33
 typedef struct ___ham_curadj_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_pgno_t	pgno;
@@ -121,7 +149,7 @@ typedef struct ___ham_curadj_args {
 #define	DB___ham_chgpg	34
 typedef struct ___ham_chgpg_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_ham_mode	mode;
diff --git a/db/dbinc_auto/hash_ext.h b/db/dbinc_auto/hash_ext.h
index 4869df741..f821675ae 100644
--- a/db/dbinc_auto/hash_ext.h
+++ b/db/dbinc_auto/hash_ext.h
@@ -24,8 +24,10 @@ int __ham_replace_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, u_int
 int __ham_replace_read __P((DB_ENV *, void *, __ham_replace_args **));
 int __ham_copypage_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, const DBT *));
 int __ham_copypage_read __P((DB_ENV *, void *, __ham_copypage_args **));
+int __ham_metagroup_42_read __P((DB_ENV *, void *, __ham_metagroup_42_args **));
 int __ham_metagroup_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t));
 int __ham_metagroup_read __P((DB_ENV *, void *, __ham_metagroup_args **));
+int __ham_groupalloc_42_read __P((DB_ENV *, void *, __ham_groupalloc_42_args **));
 int __ham_groupalloc_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t, db_pgno_t));
 int __ham_groupalloc_read __P((DB_ENV *, void *, __ham_groupalloc_args **));
 int __ham_curadj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t, int, int, u_int32_t));
@@ -38,7 +40,9 @@ int __ham_newpage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_splitdata_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_replace_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_copypage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __ham_metagroup_42_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_metagroup_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __ham_groupalloc_42_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_groupalloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_chgpg_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
@@ -57,7 +61,7 @@ u_int32_t __ham_func5 __P((DB *, const void *, u_int32_t));
 u_int32_t __ham_test __P((DB *, const void *, u_int32_t));
 int __ham_get_meta __P((DBC *));
 int __ham_release_meta __P((DBC *));
-int __ham_dirty_meta __P((DBC *));
+int __ham_dirty_meta __P((DBC *, u_int32_t));
 int __ham_db_create __P((DB *));
 int __ham_db_close __P((DB *));
 int __ham_get_h_ffactor __P((DB *, u_int32_t *));
@@ -83,7 +87,7 @@ int __ham_add_el __P((DBC *, const DBT *, const DBT *, int));
 void __ham_copy_item __P((DB *, PAGE *, u_int32_t, PAGE *));
 int __ham_add_ovflpage __P((DBC *, PAGE *, int, PAGE **));
 int __ham_get_cpage __P((DBC *, db_lockmode_t));
-int __ham_next_cpage __P((DBC *, db_pgno_t, int));
+int __ham_next_cpage __P((DBC *, db_pgno_t));
 int __ham_lock_bucket __P((DBC *, db_lockmode_t));
 void __ham_dpair __P((DB *, PAGE *, u_int32_t));
 int __ham_insdel_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
@@ -95,6 +99,8 @@ int __ham_metagroup_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_groupalloc_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_curadj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_chgpg_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __ham_metagroup_42_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __ham_groupalloc_42_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __ham_reclaim __P((DB *, DB_TXN *txn));
 int __ham_truncate __P((DBC *, u_int32_t *));
 int __ham_stat __P((DBC *, void *, u_int32_t));
diff --git a/db/dbinc_auto/hmac_ext.h b/db/dbinc_auto/hmac_ext.h
index d161a7291..1555abb01 100644
--- a/db/dbinc_auto/hmac_ext.h
+++ b/db/dbinc_auto/hmac_ext.h
@@ -6,9 +6,9 @@
 extern "C" {
 #endif
 
-void __db_chksum __P((u_int8_t *, size_t, u_int8_t *, u_int8_t *));
+void __db_chksum __P((void *, u_int8_t *, size_t, u_int8_t *, u_int8_t *));
 void __db_derive_mac __P((u_int8_t *, size_t, u_int8_t *));
-int __db_check_chksum __P((DB_ENV *, DB_CIPHER *, u_int8_t *, void *, size_t, int));
+int __db_check_chksum __P((DB_ENV *, void *, DB_CIPHER *, u_int8_t *, void *, size_t, int));
 void __db_SHA1Transform __P((u_int32_t *, unsigned char *));
 void __db_SHA1Init __P((SHA1_CTX *));
 void __db_SHA1Update __P((SHA1_CTX *, unsigned char *, size_t));
diff --git a/db/dbinc_auto/int_def.in b/db/dbinc_auto/int_def.in
index eb8756bf4..f88b35dd2 100644
--- a/db/dbinc_auto/int_def.in
+++ b/db/dbinc_auto/int_def.in
@@ -4,10 +4,22 @@
 
 #define	__crdel_metasub_log __crdel_metasub_log@DB_VERSION_UNIQUE_NAME@
 #define	__crdel_metasub_read __crdel_metasub_read@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_create_log __crdel_inmem_create_log@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_create_read __crdel_inmem_create_read@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_rename_log __crdel_inmem_rename_log@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_rename_read __crdel_inmem_rename_read@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_remove_log __crdel_inmem_remove_log@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_remove_read __crdel_inmem_remove_read@DB_VERSION_UNIQUE_NAME@
 #define	__crdel_init_recover __crdel_init_recover@DB_VERSION_UNIQUE_NAME@
 #define	__crdel_metasub_print __crdel_metasub_print@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_create_print __crdel_inmem_create_print@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_rename_print __crdel_inmem_rename_print@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_remove_print __crdel_inmem_remove_print@DB_VERSION_UNIQUE_NAME@
 #define	__crdel_init_print __crdel_init_print@DB_VERSION_UNIQUE_NAME@
 #define	__crdel_metasub_recover __crdel_metasub_recover@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_create_recover __crdel_inmem_create_recover@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_rename_recover __crdel_inmem_rename_recover@DB_VERSION_UNIQUE_NAME@
+#define	__crdel_inmem_remove_recover __crdel_inmem_remove_recover@DB_VERSION_UNIQUE_NAME@
 #define	__db_master_open __db_master_open@DB_VERSION_UNIQUE_NAME@
 #define	__db_master_update __db_master_update@DB_VERSION_UNIQUE_NAME@
 #define	__db_dbenv_setup __db_dbenv_setup@DB_VERSION_UNIQUE_NAME@
@@ -16,7 +28,6 @@
 #define	__db_refresh __db_refresh@DB_VERSION_UNIQUE_NAME@
 #define	__db_log_page __db_log_page@DB_VERSION_UNIQUE_NAME@
 #define	__db_backup_name __db_backup_name@DB_VERSION_UNIQUE_NAME@
-#define	__dblist_get __dblist_get@DB_VERSION_UNIQUE_NAME@
 #ifdef CONFIG_TEST
 #define	__db_testcopy __db_testcopy@DB_VERSION_UNIQUE_NAME@
 #endif
@@ -32,16 +43,20 @@
 #define	__db_big_read __db_big_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_ovref_log __db_ovref_log@DB_VERSION_UNIQUE_NAME@
 #define	__db_ovref_read __db_ovref_read@DB_VERSION_UNIQUE_NAME@
+#define	__db_relink_42_read __db_relink_42_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_debug_log __db_debug_log@DB_VERSION_UNIQUE_NAME@
 #define	__db_debug_read __db_debug_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_noop_log __db_noop_log@DB_VERSION_UNIQUE_NAME@
 #define	__db_noop_read __db_noop_read@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_alloc_42_read __db_pg_alloc_42_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_alloc_log __db_pg_alloc_log@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_alloc_read __db_pg_alloc_read@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_free_42_read __db_pg_free_42_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_free_log __db_pg_free_log@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_free_read __db_pg_free_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_cksum_log __db_cksum_log@DB_VERSION_UNIQUE_NAME@
 #define	__db_cksum_read __db_cksum_read@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_freedata_42_read __db_pg_freedata_42_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_freedata_log __db_pg_freedata_log@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_freedata_read __db_pg_freedata_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_prepare_log __db_pg_prepare_log@DB_VERSION_UNIQUE_NAME@
@@ -50,19 +65,26 @@
 #define	__db_pg_new_read __db_pg_new_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_init_log __db_pg_init_log@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_init_read __db_pg_init_read@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_sort_log __db_pg_sort_log@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_sort_read __db_pg_sort_read@DB_VERSION_UNIQUE_NAME@
 #define	__db_init_recover __db_init_recover@DB_VERSION_UNIQUE_NAME@
 #define	__db_addrem_print __db_addrem_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_big_print __db_big_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_ovref_print __db_ovref_print@DB_VERSION_UNIQUE_NAME@
+#define	__db_relink_42_print __db_relink_42_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_debug_print __db_debug_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_noop_print __db_noop_print@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_alloc_42_print __db_pg_alloc_42_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_alloc_print __db_pg_alloc_print@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_free_42_print __db_pg_free_42_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_free_print __db_pg_free_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_cksum_print __db_cksum_print@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_freedata_42_print __db_pg_freedata_42_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_freedata_print __db_pg_freedata_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_prepare_print __db_pg_prepare_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_new_print __db_pg_new_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_init_print __db_pg_init_print@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_sort_print __db_pg_sort_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_init_print __db_init_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_c_close __db_c_close@DB_VERSION_UNIQUE_NAME@
 #define	__db_c_destroy __db_c_destroy@DB_VERSION_UNIQUE_NAME@
@@ -81,6 +103,7 @@
 #define	__db_s_next __db_s_next@DB_VERSION_UNIQUE_NAME@
 #define	__db_s_done __db_s_done@DB_VERSION_UNIQUE_NAME@
 #define	__db_partsize __db_partsize@DB_VERSION_UNIQUE_NAME@
+#define	__cdsgroup_begin __cdsgroup_begin@DB_VERSION_UNIQUE_NAME@
 #define	__db_pgin __db_pgin@DB_VERSION_UNIQUE_NAME@
 #define	__db_pgout __db_pgout@DB_VERSION_UNIQUE_NAME@
 #define	__db_metaswap __db_metaswap@DB_VERSION_UNIQUE_NAME@
@@ -96,13 +119,10 @@
 #define	__db_txnlist_update __db_txnlist_update@DB_VERSION_UNIQUE_NAME@
 #define	__db_txnlist_gen __db_txnlist_gen@DB_VERSION_UNIQUE_NAME@
 #define	__db_txnlist_lsnadd __db_txnlist_lsnadd@DB_VERSION_UNIQUE_NAME@
+#define	__db_txnlist_lsnget __db_txnlist_lsnget@DB_VERSION_UNIQUE_NAME@
 #define	__db_txnlist_lsninit __db_txnlist_lsninit@DB_VERSION_UNIQUE_NAME@
-#ifndef HAVE_FTRUNCATE
 #define	__db_add_limbo __db_add_limbo@DB_VERSION_UNIQUE_NAME@
-#endif
-#ifndef HAVE_FTRUNCATE
 #define	__db_do_the_limbo __db_do_the_limbo@DB_VERSION_UNIQUE_NAME@
-#endif
 #define	__db_txnlist_print __db_txnlist_print@DB_VERSION_UNIQUE_NAME@
 #define	__db_ditem __db_ditem@DB_VERSION_UNIQUE_NAME@
 #define	__db_pitem __db_pitem@DB_VERSION_UNIQUE_NAME@
@@ -120,11 +140,11 @@
 #define	__db_pget_pp __db_pget_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_pget __db_pget@DB_VERSION_UNIQUE_NAME@
 #define	__db_put_pp __db_put_pp@DB_VERSION_UNIQUE_NAME@
+#define	__db_compact_pp __db_compact_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_sync_pp __db_sync_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_c_close_pp __db_c_close_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_c_count_pp __db_c_count_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_c_del_pp __db_c_del_pp@DB_VERSION_UNIQUE_NAME@
-#define	__db_c_del_arg __db_c_del_arg@DB_VERSION_UNIQUE_NAME@
 #define	__db_c_dup_pp __db_c_dup_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_c_get_pp __db_c_get_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_secondary_close_pp __db_secondary_close_pp@DB_VERSION_UNIQUE_NAME@
@@ -132,11 +152,22 @@
 #define	__db_c_put_pp __db_c_put_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_txn_auto_init __db_txn_auto_init@DB_VERSION_UNIQUE_NAME@
 #define	__db_txn_auto_resolve __db_txn_auto_resolve@DB_VERSION_UNIQUE_NAME@
+#define	__dbt_usercopy __dbt_usercopy@DB_VERSION_UNIQUE_NAME@
+#define	__dbt_userfree __dbt_userfree@DB_VERSION_UNIQUE_NAME@
 #define	__db_join __db_join@DB_VERSION_UNIQUE_NAME@
 #define	__db_join_close __db_join_close@DB_VERSION_UNIQUE_NAME@
 #define	__db_secondary_corrupt __db_secondary_corrupt@DB_VERSION_UNIQUE_NAME@
 #define	__db_new __db_new@DB_VERSION_UNIQUE_NAME@
 #define	__db_free __db_free@DB_VERSION_UNIQUE_NAME@
+#ifdef HAVE_FTRUNCATE
+#define	__db_freelist_pos __db_freelist_pos@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifdef HAVE_FTRUNCATE
+#define	__db_pg_truncate __db_pg_truncate@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifdef HAVE_FTRUNCATE
+#define	__db_free_truncate __db_free_truncate@DB_VERSION_UNIQUE_NAME@
+#endif
 #define	__db_lprint __db_lprint@DB_VERSION_UNIQUE_NAME@
 #define	__db_lget __db_lget@DB_VERSION_UNIQUE_NAME@
 #define	__db_lput __db_lput@DB_VERSION_UNIQUE_NAME@
@@ -189,21 +220,27 @@
 #define	__db_cksum_recover __db_cksum_recover@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_prepare_recover __db_pg_prepare_recover@DB_VERSION_UNIQUE_NAME@
 #define	__db_pg_init_recover __db_pg_init_recover@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_sort_recover __db_pg_sort_recover@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_alloc_42_recover __db_pg_alloc_42_recover@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_free_42_recover __db_pg_free_42_recover@DB_VERSION_UNIQUE_NAME@
+#define	__db_pg_freedata_42_recover __db_pg_freedata_42_recover@DB_VERSION_UNIQUE_NAME@
+#define	__db_relink_42_recover __db_relink_42_recover@DB_VERSION_UNIQUE_NAME@
 #define	__db_traverse_big __db_traverse_big@DB_VERSION_UNIQUE_NAME@
 #define	__db_reclaim_callback __db_reclaim_callback@DB_VERSION_UNIQUE_NAME@
 #define	__db_truncate_callback __db_truncate_callback@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_dbremove_pp __dbenv_dbremove_pp@DB_VERSION_UNIQUE_NAME@
+#define	__env_dbremove_pp __env_dbremove_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_remove_pp __db_remove_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_remove __db_remove@DB_VERSION_UNIQUE_NAME@
 #define	__db_remove_int __db_remove_int@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_dbrename_pp __dbenv_dbrename_pp@DB_VERSION_UNIQUE_NAME@
+#define	__db_inmem_remove __db_inmem_remove@DB_VERSION_UNIQUE_NAME@
+#define	__env_dbrename_pp __env_dbrename_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_rename_pp __db_rename_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_rename __db_rename@DB_VERSION_UNIQUE_NAME@
 #define	__db_rename_int __db_rename_int@DB_VERSION_UNIQUE_NAME@
 #define	__db_ret __db_ret@DB_VERSION_UNIQUE_NAME@
 #define	__db_retcopy __db_retcopy@DB_VERSION_UNIQUE_NAME@
-#define	__db_fileid_reset __db_fileid_reset@DB_VERSION_UNIQUE_NAME@
-#define	__db_lsn_reset __db_lsn_reset@DB_VERSION_UNIQUE_NAME@
+#define	__env_fileid_reset_pp __env_fileid_reset_pp@DB_VERSION_UNIQUE_NAME@
+#define	__env_lsn_reset_pp __env_lsn_reset_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_stat_pp __db_stat_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_stat __db_stat@DB_VERSION_UNIQUE_NAME@
 #define	__db_stat_print_pp __db_stat_print_pp@DB_VERSION_UNIQUE_NAME@
@@ -244,6 +281,7 @@
 #define	__db_salvage_markdone __db_salvage_markdone@DB_VERSION_UNIQUE_NAME@
 #define	__db_salvage_markneeded __db_salvage_markneeded@DB_VERSION_UNIQUE_NAME@
 #define	__db_vrfy_prdbt __db_vrfy_prdbt@DB_VERSION_UNIQUE_NAME@
+#define	__bam_compact __bam_compact@DB_VERSION_UNIQUE_NAME@
 #define	__bam_cmp __bam_cmp@DB_VERSION_UNIQUE_NAME@
 #define	__bam_defcmp __bam_defcmp@DB_VERSION_UNIQUE_NAME@
 #define	__bam_defpfx __bam_defpfx@DB_VERSION_UNIQUE_NAME@
@@ -265,10 +303,12 @@
 #define	__bam_bulk_overflow __bam_bulk_overflow@DB_VERSION_UNIQUE_NAME@
 #define	__bam_bulk_duplicates __bam_bulk_duplicates@DB_VERSION_UNIQUE_NAME@
 #define	__bam_c_rget __bam_c_rget@DB_VERSION_UNIQUE_NAME@
+#define	__bam_opd_exists __bam_opd_exists@DB_VERSION_UNIQUE_NAME@
 #define	__bam_ditem __bam_ditem@DB_VERSION_UNIQUE_NAME@
 #define	__bam_adjindx __bam_adjindx@DB_VERSION_UNIQUE_NAME@
 #define	__bam_dpages __bam_dpages@DB_VERSION_UNIQUE_NAME@
 #define	__bam_relink __bam_relink@DB_VERSION_UNIQUE_NAME@
+#define	__bam_pupdate __bam_pupdate@DB_VERSION_UNIQUE_NAME@
 #define	__bam_db_create __bam_db_create@DB_VERSION_UNIQUE_NAME@
 #define	__bam_db_close __bam_db_close@DB_VERSION_UNIQUE_NAME@
 #define	__bam_map_flags __bam_map_flags@DB_VERSION_UNIQUE_NAME@
@@ -296,6 +336,9 @@
 #define	__bam_curadj_recover __bam_curadj_recover@DB_VERSION_UNIQUE_NAME@
 #define	__bam_rcuradj_recover __bam_rcuradj_recover@DB_VERSION_UNIQUE_NAME@
 #define	__bam_relink_recover __bam_relink_recover@DB_VERSION_UNIQUE_NAME@
+#define	__bam_merge_recover __bam_merge_recover@DB_VERSION_UNIQUE_NAME@
+#define	__bam_pgno_recover __bam_pgno_recover@DB_VERSION_UNIQUE_NAME@
+#define	__bam_relink_43_recover __bam_relink_43_recover@DB_VERSION_UNIQUE_NAME@
 #define	__bam_reclaim __bam_reclaim@DB_VERSION_UNIQUE_NAME@
 #define	__bam_truncate __bam_truncate@DB_VERSION_UNIQUE_NAME@
 #define	__ram_open __ram_open@DB_VERSION_UNIQUE_NAME@
@@ -310,10 +353,12 @@
 #define	__bam_adjust __bam_adjust@DB_VERSION_UNIQUE_NAME@
 #define	__bam_nrecs __bam_nrecs@DB_VERSION_UNIQUE_NAME@
 #define	__bam_total __bam_total@DB_VERSION_UNIQUE_NAME@
+#define	__bam_get_root __bam_get_root@DB_VERSION_UNIQUE_NAME@
 #define	__bam_search __bam_search@DB_VERSION_UNIQUE_NAME@
 #define	__bam_stkrel __bam_stkrel@DB_VERSION_UNIQUE_NAME@
 #define	__bam_stkgrow __bam_stkgrow@DB_VERSION_UNIQUE_NAME@
 #define	__bam_split __bam_split@DB_VERSION_UNIQUE_NAME@
+#define	__bam_pinsert __bam_pinsert@DB_VERSION_UNIQUE_NAME@
 #define	__bam_copy __bam_copy@DB_VERSION_UNIQUE_NAME@
 #define	__bam_stat __bam_stat@DB_VERSION_UNIQUE_NAME@
 #define	__bam_stat_print __bam_stat_print@DB_VERSION_UNIQUE_NAME@
@@ -351,8 +396,13 @@
 #define	__bam_curadj_read __bam_curadj_read@DB_VERSION_UNIQUE_NAME@
 #define	__bam_rcuradj_log __bam_rcuradj_log@DB_VERSION_UNIQUE_NAME@
 #define	__bam_rcuradj_read __bam_rcuradj_read@DB_VERSION_UNIQUE_NAME@
+#define	__bam_relink_43_read __bam_relink_43_read@DB_VERSION_UNIQUE_NAME@
 #define	__bam_relink_log __bam_relink_log@DB_VERSION_UNIQUE_NAME@
 #define	__bam_relink_read __bam_relink_read@DB_VERSION_UNIQUE_NAME@
+#define	__bam_merge_log __bam_merge_log@DB_VERSION_UNIQUE_NAME@
+#define	__bam_merge_read __bam_merge_read@DB_VERSION_UNIQUE_NAME@
+#define	__bam_pgno_log __bam_pgno_log@DB_VERSION_UNIQUE_NAME@
+#define	__bam_pgno_read __bam_pgno_read@DB_VERSION_UNIQUE_NAME@
 #define	__bam_init_recover __bam_init_recover@DB_VERSION_UNIQUE_NAME@
 #define	__bam_split_print __bam_split_print@DB_VERSION_UNIQUE_NAME@
 #define	__bam_rsplit_print __bam_rsplit_print@DB_VERSION_UNIQUE_NAME@
@@ -363,14 +413,45 @@
 #define	__bam_root_print __bam_root_print@DB_VERSION_UNIQUE_NAME@
 #define	__bam_curadj_print __bam_curadj_print@DB_VERSION_UNIQUE_NAME@
 #define	__bam_rcuradj_print __bam_rcuradj_print@DB_VERSION_UNIQUE_NAME@
+#define	__bam_relink_43_print __bam_relink_43_print@DB_VERSION_UNIQUE_NAME@
 #define	__bam_relink_print __bam_relink_print@DB_VERSION_UNIQUE_NAME@
+#define	__bam_merge_print __bam_merge_print@DB_VERSION_UNIQUE_NAME@
+#define	__bam_pgno_print __bam_pgno_print@DB_VERSION_UNIQUE_NAME@
 #define	__bam_init_print __bam_init_print@DB_VERSION_UNIQUE_NAME@
+#ifndef HAVE_ABORT
+#define	abort abort@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_ATOI
+#define	atoi atoi@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_ATOL
+#define	atol atol@DB_VERSION_UNIQUE_NAME@
+#endif
+#define	__db_ctime __db_ctime@DB_VERSION_UNIQUE_NAME@
+#if defined(HAVE_REPLICATION_THREADS)
+#define	__db_getaddrinfo __db_getaddrinfo@DB_VERSION_UNIQUE_NAME@
+#endif
+#if defined(HAVE_REPLICATION_THREADS)
+#define	__db_freeaddrinfo __db_freeaddrinfo@DB_VERSION_UNIQUE_NAME@
+#endif
 #ifndef HAVE_GETCWD
 #define	getcwd getcwd@DB_VERSION_UNIQUE_NAME@
 #endif
 #ifndef HAVE_GETOPT
 #define	getopt getopt@DB_VERSION_UNIQUE_NAME@
 #endif
+#ifndef HAVE_ISALPHA
+#define	isalpha isalpha@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_ISDIGIT
+#define	isdigit isdigit@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_ISPRINT
+#define	isprint isprint@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_ISSPACE
+#define	isspace isspace@DB_VERSION_UNIQUE_NAME@
+#endif
 #ifndef HAVE_MEMCMP
 #define	memcmp memcmp@DB_VERSION_UNIQUE_NAME@
 #endif
@@ -380,9 +461,22 @@
 #ifndef HAVE_MEMMOVE
 #define	memmove memmove@DB_VERSION_UNIQUE_NAME@
 #endif
+#ifndef HAVE_PRINTF
+#define	printf printf@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_PRINTF
+#define	fprintf fprintf@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_PRINTF
+#define	vfprintf vfprintf@DB_VERSION_UNIQUE_NAME@
+#endif
 #ifndef HAVE_RAISE
 #define	raise raise@DB_VERSION_UNIQUE_NAME@
 #endif
+#ifndef HAVE_RAND
+#define	rand rand@DB_VERSION_UNIQUE_NAME@
+#define	srand srand@DB_VERSION_UNIQUE_NAME@
+#endif
 #ifndef HAVE_SNPRINTF
 #define	snprintf snprintf@DB_VERSION_UNIQUE_NAME@
 #endif
@@ -395,15 +489,40 @@
 #ifndef HAVE_STRCASECMP
 #define	strncasecmp strncasecmp@DB_VERSION_UNIQUE_NAME@
 #endif
+#ifndef HAVE_STRCAT
+#define	strcat strcat@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_STRCHR
+#define	strchr strchr@DB_VERSION_UNIQUE_NAME@
+#endif
 #ifndef HAVE_STRDUP
 #define	strdup strdup@DB_VERSION_UNIQUE_NAME@
 #endif
 #ifndef HAVE_STRERROR
 #define	strerror strerror@DB_VERSION_UNIQUE_NAME@
 #endif
+#ifndef HAVE_STRNCAT
+#define	strncat strncat@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_STRNCMP
+#define	strncmp strncmp@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_STRRCHR
+#define	strrchr strrchr@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_STRSEP
+#define	strsep strsep@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_STRTOL
+#define	strtol strtol@DB_VERSION_UNIQUE_NAME@
+#endif
+#ifndef HAVE_STRTOUL
+#define	strtoul strtoul@DB_VERSION_UNIQUE_NAME@
+#endif
 #define	__crypto_region_init __crypto_region_init@DB_VERSION_UNIQUE_NAME@
 #define	__db_isbigendian __db_isbigendian@DB_VERSION_UNIQUE_NAME@
 #define	__db_byteorder __db_byteorder@DB_VERSION_UNIQUE_NAME@
+#define	__db_difftime __db_difftime@DB_VERSION_UNIQUE_NAME@
 #define	__db_fchk __db_fchk@DB_VERSION_UNIQUE_NAME@
 #define	__db_fcchk __db_fcchk@DB_VERSION_UNIQUE_NAME@
 #define	__db_ferr __db_ferr@DB_VERSION_UNIQUE_NAME@
@@ -415,23 +534,33 @@
 #endif
 #define	__db_panic_msg __db_panic_msg@DB_VERSION_UNIQUE_NAME@
 #define	__db_panic __db_panic@DB_VERSION_UNIQUE_NAME@
+#define	__db_panic_set __db_panic_set@DB_VERSION_UNIQUE_NAME@
+#define	__db_unknown_error __db_unknown_error@DB_VERSION_UNIQUE_NAME@
+#define	__db_syserr __db_syserr@DB_VERSION_UNIQUE_NAME@
 #define	__db_err __db_err@DB_VERSION_UNIQUE_NAME@
+#define	__db_errx __db_errx@DB_VERSION_UNIQUE_NAME@
 #define	__db_errcall __db_errcall@DB_VERSION_UNIQUE_NAME@
 #define	__db_errfile __db_errfile@DB_VERSION_UNIQUE_NAME@
 #define	__db_msgadd __db_msgadd@DB_VERSION_UNIQUE_NAME@
 #define	__db_msg __db_msg@DB_VERSION_UNIQUE_NAME@
-#define	__db_logmsg __db_logmsg@DB_VERSION_UNIQUE_NAME@
 #define	__db_unknown_flag __db_unknown_flag@DB_VERSION_UNIQUE_NAME@
 #define	__db_unknown_type __db_unknown_type@DB_VERSION_UNIQUE_NAME@
+#define	__db_unknown_path __db_unknown_path@DB_VERSION_UNIQUE_NAME@
 #define	__db_check_txn __db_check_txn@DB_VERSION_UNIQUE_NAME@
+#define	__db_txn_deadlock_err __db_txn_deadlock_err@DB_VERSION_UNIQUE_NAME@
 #define	__db_not_txn_env __db_not_txn_env@DB_VERSION_UNIQUE_NAME@
 #define	__db_rec_toobig __db_rec_toobig@DB_VERSION_UNIQUE_NAME@
 #define	__db_rec_repl __db_rec_repl@DB_VERSION_UNIQUE_NAME@
+#define	__dbc_logging __dbc_logging@DB_VERSION_UNIQUE_NAME@
 #define	__db_check_lsn __db_check_lsn@DB_VERSION_UNIQUE_NAME@
+#define	__db_rdonly __db_rdonly@DB_VERSION_UNIQUE_NAME@
+#define	__db_space_err __db_space_err@DB_VERSION_UNIQUE_NAME@
+#define	__db_failed __db_failed@DB_VERSION_UNIQUE_NAME@
 #define	__db_getlong __db_getlong@DB_VERSION_UNIQUE_NAME@
 #define	__db_getulong __db_getulong@DB_VERSION_UNIQUE_NAME@
 #define	__db_idspace __db_idspace@DB_VERSION_UNIQUE_NAME@
 #define	__db_log2 __db_log2@DB_VERSION_UNIQUE_NAME@
+#define	__db_mkpath __db_mkpath@DB_VERSION_UNIQUE_NAME@
 #define	__db_util_arg __db_util_arg@DB_VERSION_UNIQUE_NAME@
 #define	__db_util_cache __db_util_cache@DB_VERSION_UNIQUE_NAME@
 #define	__db_util_logset __db_util_logset@DB_VERSION_UNIQUE_NAME@
@@ -470,18 +599,21 @@
 #define	__dbreg_assign_id __dbreg_assign_id@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_revoke_id __dbreg_revoke_id@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_close_id __dbreg_close_id@DB_VERSION_UNIQUE_NAME@
+#define	__dbreg_log_close __dbreg_log_close@DB_VERSION_UNIQUE_NAME@
+#define	__dbreg_log_id __dbreg_log_id@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_register_log __dbreg_register_log@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_register_read __dbreg_register_read@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_init_recover __dbreg_init_recover@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_register_print __dbreg_register_print@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_init_print __dbreg_init_print@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_register_recover __dbreg_register_recover@DB_VERSION_UNIQUE_NAME@
+#define	__dbreg_stat_print __dbreg_stat_print@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_print_fname __dbreg_print_fname@DB_VERSION_UNIQUE_NAME@
-#define	__dbreg_print_dblist __dbreg_print_dblist@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_add_dbentry __dbreg_add_dbentry@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_rem_dbentry __dbreg_rem_dbentry@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_log_files __dbreg_log_files@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_close_files __dbreg_close_files@DB_VERSION_UNIQUE_NAME@
+#define	__dbreg_invalidate_files __dbreg_invalidate_files@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_id_to_db __dbreg_id_to_db@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_id_to_db_int __dbreg_id_to_db_int@DB_VERSION_UNIQUE_NAME@
 #define	__dbreg_id_to_fname __dbreg_id_to_fname@DB_VERSION_UNIQUE_NAME@
@@ -496,49 +628,60 @@
 #define	__db_shalloc_sizeof __db_shalloc_sizeof@DB_VERSION_UNIQUE_NAME@
 #define	__db_tablesize __db_tablesize@DB_VERSION_UNIQUE_NAME@
 #define	__db_hashinit __db_hashinit@DB_VERSION_UNIQUE_NAME@
-#define	__db_fileinit __db_fileinit@DB_VERSION_UNIQUE_NAME@
-#define	__db_overwrite __db_overwrite@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_alloc __dbenv_set_alloc@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_get_encrypt_flags __dbenv_get_encrypt_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_encrypt __dbenv_set_encrypt@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_flags __dbenv_set_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_data_dir __dbenv_set_data_dir@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_intermediate_dir __dbenv_set_intermediate_dir@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_errcall __dbenv_set_errcall@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_get_errfile __dbenv_get_errfile@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_errfile __dbenv_set_errfile@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_get_errpfx __dbenv_get_errpfx@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_errpfx __dbenv_set_errpfx@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_msgcall __dbenv_set_msgcall@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_get_msgfile __dbenv_get_msgfile@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_msgfile __dbenv_set_msgfile@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_paniccall __dbenv_set_paniccall@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_shm_key __dbenv_set_shm_key@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_tas_spins __dbenv_set_tas_spins@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_tmp_dir __dbenv_set_tmp_dir@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_set_verbose __dbenv_set_verbose@DB_VERSION_UNIQUE_NAME@
+#define	__env_read_db_config __env_read_db_config@DB_VERSION_UNIQUE_NAME@
+#define	__env_failchk_pp __env_failchk_pp@DB_VERSION_UNIQUE_NAME@
+#define	__env_thread_init __env_thread_init@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_state __env_set_state@DB_VERSION_UNIQUE_NAME@
+#define	__env_thread_id_string __env_thread_id_string@DB_VERSION_UNIQUE_NAME@
+#define	__db_file_extend __db_file_extend@DB_VERSION_UNIQUE_NAME@
+#define	__db_file_multi_write __db_file_multi_write@DB_VERSION_UNIQUE_NAME@
+#define	__db_file_write __db_file_write@DB_VERSION_UNIQUE_NAME@
+#define	__db_env_destroy __db_env_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_alloc __env_set_alloc@DB_VERSION_UNIQUE_NAME@
+#define	__env_get_encrypt_flags __env_get_encrypt_flags@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_encrypt __env_set_encrypt@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_flags __env_set_flags@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_data_dir __env_set_data_dir@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_intermediate_dir __env_set_intermediate_dir@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_errcall __env_set_errcall@DB_VERSION_UNIQUE_NAME@
+#define	__env_get_errfile __env_get_errfile@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_errfile __env_set_errfile@DB_VERSION_UNIQUE_NAME@
+#define	__env_get_errpfx __env_get_errpfx@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_errpfx __env_set_errpfx@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_msgcall __env_set_msgcall@DB_VERSION_UNIQUE_NAME@
+#define	__env_get_msgfile __env_get_msgfile@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_msgfile __env_set_msgfile@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_paniccall __env_set_paniccall@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_shm_key __env_set_shm_key@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_tmp_dir __env_set_tmp_dir@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_verbose __env_set_verbose@DB_VERSION_UNIQUE_NAME@
 #define	__db_mi_env __db_mi_env@DB_VERSION_UNIQUE_NAME@
 #define	__db_mi_open __db_mi_open@DB_VERSION_UNIQUE_NAME@
 #define	__db_env_config __db_env_config@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_open __dbenv_open@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_remove __dbenv_remove@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_close_pp __dbenv_close_pp@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_close __dbenv_close@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_get_open_flags __dbenv_get_open_flags@DB_VERSION_UNIQUE_NAME@
+#define	__env_open_pp __env_open_pp@DB_VERSION_UNIQUE_NAME@
+#define	__env_open __env_open@DB_VERSION_UNIQUE_NAME@
+#define	__env_remove __env_remove@DB_VERSION_UNIQUE_NAME@
+#define	__env_config __env_config@DB_VERSION_UNIQUE_NAME@
+#define	__env_close_pp __env_close_pp@DB_VERSION_UNIQUE_NAME@
+#define	__env_close __env_close@DB_VERSION_UNIQUE_NAME@
+#define	__env_get_open_flags __env_get_open_flags@DB_VERSION_UNIQUE_NAME@
 #define	__db_appname __db_appname@DB_VERSION_UNIQUE_NAME@
-#define	__db_home __db_home@DB_VERSION_UNIQUE_NAME@
 #define	__db_apprec __db_apprec@DB_VERSION_UNIQUE_NAME@
 #define	__log_backup __log_backup@DB_VERSION_UNIQUE_NAME@
 #define	__env_openfiles __env_openfiles@DB_VERSION_UNIQUE_NAME@
+#define	__env_init_rec __env_init_rec@DB_VERSION_UNIQUE_NAME@
 #define	__db_e_attach __db_e_attach@DB_VERSION_UNIQUE_NAME@
+#define	__db_e_golive __db_e_golive@DB_VERSION_UNIQUE_NAME@
 #define	__db_e_detach __db_e_detach@DB_VERSION_UNIQUE_NAME@
 #define	__db_e_remove __db_e_remove@DB_VERSION_UNIQUE_NAME@
 #define	__db_r_attach __db_r_attach@DB_VERSION_UNIQUE_NAME@
 #define	__db_r_detach __db_r_detach@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_stat_print_pp __dbenv_stat_print_pp@DB_VERSION_UNIQUE_NAME@
+#define	__envreg_register __envreg_register@DB_VERSION_UNIQUE_NAME@
+#define	__envreg_unregister __envreg_unregister@DB_VERSION_UNIQUE_NAME@
+#define	__envreg_xunlock __envreg_xunlock@DB_VERSION_UNIQUE_NAME@
+#define	__env_stat_print_pp __env_stat_print_pp@DB_VERSION_UNIQUE_NAME@
 #define	__db_print_fh __db_print_fh@DB_VERSION_UNIQUE_NAME@
 #define	__db_print_fileid __db_print_fileid@DB_VERSION_UNIQUE_NAME@
-#define	__db_print_mutex __db_print_mutex@DB_VERSION_UNIQUE_NAME@
 #define	__db_dl __db_dl@DB_VERSION_UNIQUE_NAME@
 #define	__db_dl_pct __db_dl_pct@DB_VERSION_UNIQUE_NAME@
 #define	__db_dlbytes __db_dlbytes@DB_VERSION_UNIQUE_NAME@
@@ -595,8 +738,10 @@
 #define	__ham_replace_read __ham_replace_read@DB_VERSION_UNIQUE_NAME@
 #define	__ham_copypage_log __ham_copypage_log@DB_VERSION_UNIQUE_NAME@
 #define	__ham_copypage_read __ham_copypage_read@DB_VERSION_UNIQUE_NAME@
+#define	__ham_metagroup_42_read __ham_metagroup_42_read@DB_VERSION_UNIQUE_NAME@
 #define	__ham_metagroup_log __ham_metagroup_log@DB_VERSION_UNIQUE_NAME@
 #define	__ham_metagroup_read __ham_metagroup_read@DB_VERSION_UNIQUE_NAME@
+#define	__ham_groupalloc_42_read __ham_groupalloc_42_read@DB_VERSION_UNIQUE_NAME@
 #define	__ham_groupalloc_log __ham_groupalloc_log@DB_VERSION_UNIQUE_NAME@
 #define	__ham_groupalloc_read __ham_groupalloc_read@DB_VERSION_UNIQUE_NAME@
 #define	__ham_curadj_log __ham_curadj_log@DB_VERSION_UNIQUE_NAME@
@@ -609,7 +754,9 @@
 #define	__ham_splitdata_print __ham_splitdata_print@DB_VERSION_UNIQUE_NAME@
 #define	__ham_replace_print __ham_replace_print@DB_VERSION_UNIQUE_NAME@
 #define	__ham_copypage_print __ham_copypage_print@DB_VERSION_UNIQUE_NAME@
+#define	__ham_metagroup_42_print __ham_metagroup_42_print@DB_VERSION_UNIQUE_NAME@
 #define	__ham_metagroup_print __ham_metagroup_print@DB_VERSION_UNIQUE_NAME@
+#define	__ham_groupalloc_42_print __ham_groupalloc_42_print@DB_VERSION_UNIQUE_NAME@
 #define	__ham_groupalloc_print __ham_groupalloc_print@DB_VERSION_UNIQUE_NAME@
 #define	__ham_curadj_print __ham_curadj_print@DB_VERSION_UNIQUE_NAME@
 #define	__ham_chgpg_print __ham_chgpg_print@DB_VERSION_UNIQUE_NAME@
@@ -666,6 +813,8 @@
 #define	__ham_groupalloc_recover __ham_groupalloc_recover@DB_VERSION_UNIQUE_NAME@
 #define	__ham_curadj_recover __ham_curadj_recover@DB_VERSION_UNIQUE_NAME@
 #define	__ham_chgpg_recover __ham_chgpg_recover@DB_VERSION_UNIQUE_NAME@
+#define	__ham_metagroup_42_recover __ham_metagroup_42_recover@DB_VERSION_UNIQUE_NAME@
+#define	__ham_groupalloc_42_recover __ham_groupalloc_42_recover@DB_VERSION_UNIQUE_NAME@
 #define	__ham_reclaim __ham_reclaim@DB_VERSION_UNIQUE_NAME@
 #define	__ham_truncate __ham_truncate@DB_VERSION_UNIQUE_NAME@
 #define	__ham_stat __ham_stat@DB_VERSION_UNIQUE_NAME@
@@ -702,8 +851,10 @@
 #define	__lock_promote __lock_promote@DB_VERSION_UNIQUE_NAME@
 #define	__lock_detect_pp __lock_detect_pp@DB_VERSION_UNIQUE_NAME@
 #define	__lock_detect __lock_detect@DB_VERSION_UNIQUE_NAME@
+#define	__lock_failchk __lock_failchk@DB_VERSION_UNIQUE_NAME@
 #define	__lock_id_pp __lock_id_pp@DB_VERSION_UNIQUE_NAME@
 #define	__lock_id __lock_id@DB_VERSION_UNIQUE_NAME@
+#define	__lock_set_thread_id __lock_set_thread_id@DB_VERSION_UNIQUE_NAME@
 #define	__lock_id_free_pp __lock_id_free_pp@DB_VERSION_UNIQUE_NAME@
 #define	__lock_id_free __lock_id_free@DB_VERSION_UNIQUE_NAME@
 #define	__lock_id_set __lock_id_set@DB_VERSION_UNIQUE_NAME@
@@ -715,16 +866,22 @@
 #define	__lock_get_list __lock_get_list@DB_VERSION_UNIQUE_NAME@
 #define	__lock_list_print __lock_list_print@DB_VERSION_UNIQUE_NAME@
 #define	__lock_dbenv_create __lock_dbenv_create@DB_VERSION_UNIQUE_NAME@
-#define	__lock_dbenv_close __lock_dbenv_close@DB_VERSION_UNIQUE_NAME@
+#define	__lock_dbenv_destroy __lock_dbenv_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__lock_get_lk_conflicts __lock_get_lk_conflicts@DB_VERSION_UNIQUE_NAME@
+#define	__lock_set_lk_conflicts __lock_set_lk_conflicts@DB_VERSION_UNIQUE_NAME@
+#define	__lock_get_lk_detect __lock_get_lk_detect@DB_VERSION_UNIQUE_NAME@
 #define	__lock_set_lk_detect __lock_set_lk_detect@DB_VERSION_UNIQUE_NAME@
-#define	__lock_set_lk_max __lock_set_lk_max@DB_VERSION_UNIQUE_NAME@
+#define	__lock_get_lk_max_locks __lock_get_lk_max_locks@DB_VERSION_UNIQUE_NAME@
 #define	__lock_set_lk_max_locks __lock_set_lk_max_locks@DB_VERSION_UNIQUE_NAME@
+#define	__lock_get_lk_max_lockers __lock_get_lk_max_lockers@DB_VERSION_UNIQUE_NAME@
 #define	__lock_set_lk_max_lockers __lock_set_lk_max_lockers@DB_VERSION_UNIQUE_NAME@
+#define	__lock_get_lk_max_objects __lock_get_lk_max_objects@DB_VERSION_UNIQUE_NAME@
 #define	__lock_set_lk_max_objects __lock_set_lk_max_objects@DB_VERSION_UNIQUE_NAME@
+#define	__lock_get_env_timeout __lock_get_env_timeout@DB_VERSION_UNIQUE_NAME@
 #define	__lock_set_env_timeout __lock_set_env_timeout@DB_VERSION_UNIQUE_NAME@
 #define	__lock_open __lock_open@DB_VERSION_UNIQUE_NAME@
 #define	__lock_dbenv_refresh __lock_dbenv_refresh@DB_VERSION_UNIQUE_NAME@
-#define	__lock_region_destroy __lock_region_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__lock_region_mutex_count __lock_region_mutex_count@DB_VERSION_UNIQUE_NAME@
 #define	__lock_stat_pp __lock_stat_pp@DB_VERSION_UNIQUE_NAME@
 #define	__lock_stat_print_pp __lock_stat_print_pp@DB_VERSION_UNIQUE_NAME@
 #define	__lock_stat_print __lock_stat_print@DB_VERSION_UNIQUE_NAME@
@@ -734,42 +891,56 @@
 #define	__lock_inherit_timeout __lock_inherit_timeout@DB_VERSION_UNIQUE_NAME@
 #define	__lock_expires __lock_expires@DB_VERSION_UNIQUE_NAME@
 #define	__lock_expired __lock_expired@DB_VERSION_UNIQUE_NAME@
-#define	__lock_cmp __lock_cmp@DB_VERSION_UNIQUE_NAME@
-#define	__lock_locker_cmp __lock_locker_cmp@DB_VERSION_UNIQUE_NAME@
 #define	__lock_ohash __lock_ohash@DB_VERSION_UNIQUE_NAME@
 #define	__lock_lhash __lock_lhash@DB_VERSION_UNIQUE_NAME@
-#define	__lock_locker_hash __lock_locker_hash@DB_VERSION_UNIQUE_NAME@
 #define	__lock_nomem __lock_nomem@DB_VERSION_UNIQUE_NAME@
 #define	__log_open __log_open@DB_VERSION_UNIQUE_NAME@
 #define	__log_find __log_find@DB_VERSION_UNIQUE_NAME@
 #define	__log_valid __log_valid@DB_VERSION_UNIQUE_NAME@
 #define	__log_dbenv_refresh __log_dbenv_refresh@DB_VERSION_UNIQUE_NAME@
 #define	__log_get_cached_ckp_lsn __log_get_cached_ckp_lsn@DB_VERSION_UNIQUE_NAME@
-#define	__log_region_destroy __log_region_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__log_region_mutex_count __log_region_mutex_count@DB_VERSION_UNIQUE_NAME@
 #define	__log_vtruncate __log_vtruncate@DB_VERSION_UNIQUE_NAME@
 #define	__log_is_outdated __log_is_outdated@DB_VERSION_UNIQUE_NAME@
+#define	__log_zero __log_zero@DB_VERSION_UNIQUE_NAME@
 #define	__log_inmem_lsnoff __log_inmem_lsnoff@DB_VERSION_UNIQUE_NAME@
 #define	__log_inmem_newfile __log_inmem_newfile@DB_VERSION_UNIQUE_NAME@
 #define	__log_inmem_chkspace __log_inmem_chkspace@DB_VERSION_UNIQUE_NAME@
 #define	__log_inmem_copyout __log_inmem_copyout@DB_VERSION_UNIQUE_NAME@
 #define	__log_inmem_copyin __log_inmem_copyin@DB_VERSION_UNIQUE_NAME@
+#define	__log_set_version __log_set_version@DB_VERSION_UNIQUE_NAME@
+#define	__log_get_oldversion __log_get_oldversion@DB_VERSION_UNIQUE_NAME@
 #define	__log_archive_pp __log_archive_pp@DB_VERSION_UNIQUE_NAME@
+#define	__log_get_stable_lsn __log_get_stable_lsn@DB_VERSION_UNIQUE_NAME@
 #define	__log_autoremove __log_autoremove@DB_VERSION_UNIQUE_NAME@
+#define	__log_check_page_lsn __log_check_page_lsn@DB_VERSION_UNIQUE_NAME@
+#define	__log_printf_capi __log_printf_capi@DB_VERSION_UNIQUE_NAME@
+#define	__log_printf_pp __log_printf_pp@DB_VERSION_UNIQUE_NAME@
+#define	__log_printf __log_printf@DB_VERSION_UNIQUE_NAME@
 #define	__log_cursor_pp __log_cursor_pp@DB_VERSION_UNIQUE_NAME@
 #define	__log_cursor __log_cursor@DB_VERSION_UNIQUE_NAME@
 #define	__log_c_close __log_c_close@DB_VERSION_UNIQUE_NAME@
+#define	__log_c_version __log_c_version@DB_VERSION_UNIQUE_NAME@
 #define	__log_c_get __log_c_get@DB_VERSION_UNIQUE_NAME@
+#define	__log_rep_split __log_rep_split@DB_VERSION_UNIQUE_NAME@
 #define	__log_dbenv_create __log_dbenv_create@DB_VERSION_UNIQUE_NAME@
+#define	__log_dbenv_destroy __log_dbenv_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__log_get_lg_bsize __log_get_lg_bsize@DB_VERSION_UNIQUE_NAME@
 #define	__log_set_lg_bsize __log_set_lg_bsize@DB_VERSION_UNIQUE_NAME@
+#define	__log_get_lg_filemode __log_get_lg_filemode@DB_VERSION_UNIQUE_NAME@
+#define	__log_set_lg_filemode __log_set_lg_filemode@DB_VERSION_UNIQUE_NAME@
+#define	__log_get_lg_max __log_get_lg_max@DB_VERSION_UNIQUE_NAME@
 #define	__log_set_lg_max __log_set_lg_max@DB_VERSION_UNIQUE_NAME@
+#define	__log_get_lg_regionmax __log_get_lg_regionmax@DB_VERSION_UNIQUE_NAME@
 #define	__log_set_lg_regionmax __log_set_lg_regionmax@DB_VERSION_UNIQUE_NAME@
+#define	__log_get_lg_dir __log_get_lg_dir@DB_VERSION_UNIQUE_NAME@
 #define	__log_set_lg_dir __log_set_lg_dir@DB_VERSION_UNIQUE_NAME@
 #define	__log_get_flags __log_get_flags@DB_VERSION_UNIQUE_NAME@
 #define	__log_set_flags __log_set_flags@DB_VERSION_UNIQUE_NAME@
 #define	__log_check_sizes __log_check_sizes@DB_VERSION_UNIQUE_NAME@
 #define	__log_put_pp __log_put_pp@DB_VERSION_UNIQUE_NAME@
 #define	__log_put __log_put@DB_VERSION_UNIQUE_NAME@
-#define	__log_txn_lsn __log_txn_lsn@DB_VERSION_UNIQUE_NAME@
+#define	__log_current_lsn __log_current_lsn@DB_VERSION_UNIQUE_NAME@
 #define	__log_newfile __log_newfile@DB_VERSION_UNIQUE_NAME@
 #define	__log_flush_pp __log_flush_pp@DB_VERSION_UNIQUE_NAME@
 #define	__log_flush __log_flush@DB_VERSION_UNIQUE_NAME@
@@ -781,6 +952,7 @@
 #define	__log_stat_print_pp __log_stat_print_pp@DB_VERSION_UNIQUE_NAME@
 #define	__log_stat_print __log_stat_print@DB_VERSION_UNIQUE_NAME@
 #define	__memp_alloc __memp_alloc@DB_VERSION_UNIQUE_NAME@
+#define	__memp_free __memp_free@DB_VERSION_UNIQUE_NAME@
 #ifdef DIAGNOSTIC
 #define	__memp_check_order __memp_check_order@DB_VERSION_UNIQUE_NAME@
 #endif
@@ -809,28 +981,44 @@
 #define	__memp_fclose_pp __memp_fclose_pp@DB_VERSION_UNIQUE_NAME@
 #define	__memp_fclose __memp_fclose@DB_VERSION_UNIQUE_NAME@
 #define	__memp_mf_discard __memp_mf_discard@DB_VERSION_UNIQUE_NAME@
+#define	__memp_inmemlist __memp_inmemlist@DB_VERSION_UNIQUE_NAME@
 #define	__memp_fput_pp __memp_fput_pp@DB_VERSION_UNIQUE_NAME@
 #define	__memp_fput __memp_fput@DB_VERSION_UNIQUE_NAME@
 #define	__memp_fset_pp __memp_fset_pp@DB_VERSION_UNIQUE_NAME@
 #define	__memp_fset __memp_fset@DB_VERSION_UNIQUE_NAME@
+#define	__memp_dirty __memp_dirty@DB_VERSION_UNIQUE_NAME@
 #define	__memp_dbenv_create __memp_dbenv_create@DB_VERSION_UNIQUE_NAME@
+#define	__memp_dbenv_destroy __memp_dbenv_destroy@DB_VERSION_UNIQUE_NAME@
 #define	__memp_get_cachesize __memp_get_cachesize@DB_VERSION_UNIQUE_NAME@
 #define	__memp_set_cachesize __memp_set_cachesize@DB_VERSION_UNIQUE_NAME@
+#define	__memp_get_mp_max_openfd __memp_get_mp_max_openfd@DB_VERSION_UNIQUE_NAME@
 #define	__memp_set_mp_max_openfd __memp_set_mp_max_openfd@DB_VERSION_UNIQUE_NAME@
+#define	__memp_get_mp_max_write __memp_get_mp_max_write@DB_VERSION_UNIQUE_NAME@
 #define	__memp_set_mp_max_write __memp_set_mp_max_write@DB_VERSION_UNIQUE_NAME@
+#define	__memp_get_mp_mmapsize __memp_get_mp_mmapsize@DB_VERSION_UNIQUE_NAME@
 #define	__memp_set_mp_mmapsize __memp_set_mp_mmapsize@DB_VERSION_UNIQUE_NAME@
 #define	__memp_nameop __memp_nameop@DB_VERSION_UNIQUE_NAME@
-#define	__memp_get_refcnt __memp_get_refcnt@DB_VERSION_UNIQUE_NAME@
 #define	__memp_ftruncate __memp_ftruncate@DB_VERSION_UNIQUE_NAME@
+#define	__memp_alloc_freelist __memp_alloc_freelist@DB_VERSION_UNIQUE_NAME@
+#define	__memp_free_freelist __memp_free_freelist@DB_VERSION_UNIQUE_NAME@
+#define	__memp_get_freelist __memp_get_freelist@DB_VERSION_UNIQUE_NAME@
+#define	__memp_extend_freelist __memp_extend_freelist@DB_VERSION_UNIQUE_NAME@
+#define	__memp_bh_priority __memp_bh_priority@DB_VERSION_UNIQUE_NAME@
+#define	__memp_bucket_reorder __memp_bucket_reorder@DB_VERSION_UNIQUE_NAME@
+#define	__memp_bh_settxn __memp_bh_settxn@DB_VERSION_UNIQUE_NAME@
+#define	__memp_skip_curadj __memp_skip_curadj@DB_VERSION_UNIQUE_NAME@
+#define	__memp_bh_freeze __memp_bh_freeze@DB_VERSION_UNIQUE_NAME@
+#define	__memp_bh_thaw __memp_bh_thaw@DB_VERSION_UNIQUE_NAME@
 #define	__memp_open __memp_open@DB_VERSION_UNIQUE_NAME@
+#define	__memp_region_mutex_count __memp_region_mutex_count@DB_VERSION_UNIQUE_NAME@
 #define	__memp_dbenv_refresh __memp_dbenv_refresh@DB_VERSION_UNIQUE_NAME@
-#define	__memp_region_destroy __memp_region_destroy@DB_VERSION_UNIQUE_NAME@
 #define	__memp_register_pp __memp_register_pp@DB_VERSION_UNIQUE_NAME@
 #define	__memp_register __memp_register@DB_VERSION_UNIQUE_NAME@
 #define	__memp_stat_pp __memp_stat_pp@DB_VERSION_UNIQUE_NAME@
 #define	__memp_stat_print_pp __memp_stat_print_pp@DB_VERSION_UNIQUE_NAME@
 #define	__memp_stat_print __memp_stat_print@DB_VERSION_UNIQUE_NAME@
 #define	__memp_stat_hash __memp_stat_hash@DB_VERSION_UNIQUE_NAME@
+#define	__memp_walk_files __memp_walk_files@DB_VERSION_UNIQUE_NAME@
 #define	__memp_sync_pp __memp_sync_pp@DB_VERSION_UNIQUE_NAME@
 #define	__memp_sync __memp_sync@DB_VERSION_UNIQUE_NAME@
 #define	__memp_fsync_pp __memp_fsync_pp@DB_VERSION_UNIQUE_NAME@
@@ -839,14 +1027,40 @@
 #define	__memp_sync_int __memp_sync_int@DB_VERSION_UNIQUE_NAME@
 #define	__memp_mf_sync __memp_mf_sync@DB_VERSION_UNIQUE_NAME@
 #define	__memp_trickle_pp __memp_trickle_pp@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_alloc __mutex_alloc@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_alloc_int __mutex_alloc_int@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_free __mutex_free@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_free_int __mutex_free_int@DB_VERSION_UNIQUE_NAME@
+#define	__mut_failchk __mut_failchk@DB_VERSION_UNIQUE_NAME@
 #define	__db_fcntl_mutex_init __db_fcntl_mutex_init@DB_VERSION_UNIQUE_NAME@
 #define	__db_fcntl_mutex_lock __db_fcntl_mutex_lock@DB_VERSION_UNIQUE_NAME@
 #define	__db_fcntl_mutex_unlock __db_fcntl_mutex_unlock@DB_VERSION_UNIQUE_NAME@
 #define	__db_fcntl_mutex_destroy __db_fcntl_mutex_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_alloc_pp __mutex_alloc_pp@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_free_pp __mutex_free_pp@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_lock_pp __mutex_lock_pp@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_unlock_pp __mutex_unlock_pp@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_get_align __mutex_get_align@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_set_align __mutex_set_align@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_get_increment __mutex_get_increment@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_set_increment __mutex_set_increment@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_get_max __mutex_get_max@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_set_max __mutex_set_max@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_get_tas_spins __mutex_get_tas_spins@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_set_tas_spins __mutex_set_tas_spins@DB_VERSION_UNIQUE_NAME@
 #define	__db_pthread_mutex_init __db_pthread_mutex_init@DB_VERSION_UNIQUE_NAME@
 #define	__db_pthread_mutex_lock __db_pthread_mutex_lock@DB_VERSION_UNIQUE_NAME@
 #define	__db_pthread_mutex_unlock __db_pthread_mutex_unlock@DB_VERSION_UNIQUE_NAME@
 #define	__db_pthread_mutex_destroy __db_pthread_mutex_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_open __mutex_open@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_dbenv_refresh __mutex_dbenv_refresh@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_resource_return __mutex_resource_return@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_stat __mutex_stat@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_stat_print __mutex_stat_print@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_print_debug_single __mutex_print_debug_single@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_print_debug_stats __mutex_print_debug_stats@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_set_wait_info __mutex_set_wait_info@DB_VERSION_UNIQUE_NAME@
+#define	__mutex_clear __mutex_clear@DB_VERSION_UNIQUE_NAME@
 #define	__db_tas_mutex_init __db_tas_mutex_init@DB_VERSION_UNIQUE_NAME@
 #define	__db_tas_mutex_lock __db_tas_mutex_lock@DB_VERSION_UNIQUE_NAME@
 #define	__db_tas_mutex_unlock __db_tas_mutex_unlock@DB_VERSION_UNIQUE_NAME@
@@ -855,12 +1069,6 @@
 #define	__db_win32_mutex_lock __db_win32_mutex_lock@DB_VERSION_UNIQUE_NAME@
 #define	__db_win32_mutex_unlock __db_win32_mutex_unlock@DB_VERSION_UNIQUE_NAME@
 #define	__db_win32_mutex_destroy __db_win32_mutex_destroy@DB_VERSION_UNIQUE_NAME@
-#define	__db_mutex_setup __db_mutex_setup@DB_VERSION_UNIQUE_NAME@
-#define	__db_mutex_free __db_mutex_free@DB_VERSION_UNIQUE_NAME@
-#define	__db_shreg_locks_clear __db_shreg_locks_clear@DB_VERSION_UNIQUE_NAME@
-#define	__db_shreg_locks_destroy __db_shreg_locks_destroy@DB_VERSION_UNIQUE_NAME@
-#define	__db_shreg_mutex_init __db_shreg_mutex_init@DB_VERSION_UNIQUE_NAME@
-#define	__db_shreg_maintinit __db_shreg_maintinit@DB_VERSION_UNIQUE_NAME@
 #define	__os_abspath __os_abspath@DB_VERSION_UNIQUE_NAME@
 #define	__os_umalloc __os_umalloc@DB_VERSION_UNIQUE_NAME@
 #define	__os_urealloc __os_urealloc@DB_VERSION_UNIQUE_NAME@
@@ -873,30 +1081,38 @@
 #define	__ua_memcpy __ua_memcpy@DB_VERSION_UNIQUE_NAME@
 #define	__os_clock __os_clock@DB_VERSION_UNIQUE_NAME@
 #define	__os_fs_notzero __os_fs_notzero@DB_VERSION_UNIQUE_NAME@
+#define	__os_support_direct_io __os_support_direct_io@DB_VERSION_UNIQUE_NAME@
+#define	__os_support_db_register __os_support_db_register@DB_VERSION_UNIQUE_NAME@
+#define	__os_support_replication __os_support_replication@DB_VERSION_UNIQUE_NAME@
 #define	__os_dirlist __os_dirlist@DB_VERSION_UNIQUE_NAME@
 #define	__os_dirfree __os_dirfree@DB_VERSION_UNIQUE_NAME@
 #define	__os_get_errno_ret_zero __os_get_errno_ret_zero@DB_VERSION_UNIQUE_NAME@
 #define	__os_get_errno __os_get_errno@DB_VERSION_UNIQUE_NAME@
+#define	__os_get_neterr __os_get_neterr@DB_VERSION_UNIQUE_NAME@
+#define	__os_get_syserr __os_get_syserr@DB_VERSION_UNIQUE_NAME@
 #define	__os_set_errno __os_set_errno@DB_VERSION_UNIQUE_NAME@
+#define	__os_strerror __os_strerror@DB_VERSION_UNIQUE_NAME@
+#define	__os_posix_err __os_posix_err@DB_VERSION_UNIQUE_NAME@
 #define	__os_fileid __os_fileid@DB_VERSION_UNIQUE_NAME@
+#define	__os_fdlock __os_fdlock@DB_VERSION_UNIQUE_NAME@
 #define	__os_fsync __os_fsync@DB_VERSION_UNIQUE_NAME@
+#define	__os_zerofill __os_zerofill@DB_VERSION_UNIQUE_NAME@
+#define	__os_getenv __os_getenv@DB_VERSION_UNIQUE_NAME@
 #define	__os_openhandle __os_openhandle@DB_VERSION_UNIQUE_NAME@
 #define	__os_closehandle __os_closehandle@DB_VERSION_UNIQUE_NAME@
-#define	__os_id __os_id@DB_VERSION_UNIQUE_NAME@
-#define	__os_unique_id __os_unique_id@DB_VERSION_UNIQUE_NAME@
 #define	__os_r_sysattach __os_r_sysattach@DB_VERSION_UNIQUE_NAME@
 #define	__os_r_sysdetach __os_r_sysdetach@DB_VERSION_UNIQUE_NAME@
 #define	__os_mapfile __os_mapfile@DB_VERSION_UNIQUE_NAME@
 #define	__os_unmapfile __os_unmapfile@DB_VERSION_UNIQUE_NAME@
+#define	__os_mkdir __os_mkdir@DB_VERSION_UNIQUE_NAME@
 #define	__db_oflags __db_oflags@DB_VERSION_UNIQUE_NAME@
 #define	__db_omode __db_omode@DB_VERSION_UNIQUE_NAME@
-#define	__db_shm_mode __db_shm_mode@DB_VERSION_UNIQUE_NAME@
-#define	__os_have_direct __os_have_direct@DB_VERSION_UNIQUE_NAME@
 #define	__os_open __os_open@DB_VERSION_UNIQUE_NAME@
 #define	__os_open_extend __os_open_extend@DB_VERSION_UNIQUE_NAME@
 #ifdef HAVE_QNX
 #define	__os_shmname __os_shmname@DB_VERSION_UNIQUE_NAME@
 #endif
+#define	__os_id __os_id@DB_VERSION_UNIQUE_NAME@
 #define	__os_r_attach __os_r_attach@DB_VERSION_UNIQUE_NAME@
 #define	__os_r_detach __os_r_detach@DB_VERSION_UNIQUE_NAME@
 #define	__os_rename __os_rename@DB_VERSION_UNIQUE_NAME@
@@ -905,25 +1121,27 @@
 #define	__os_io __os_io@DB_VERSION_UNIQUE_NAME@
 #define	__os_read __os_read@DB_VERSION_UNIQUE_NAME@
 #define	__os_write __os_write@DB_VERSION_UNIQUE_NAME@
+#define	__os_physwrite __os_physwrite@DB_VERSION_UNIQUE_NAME@
 #define	__os_seek __os_seek@DB_VERSION_UNIQUE_NAME@
 #define	__os_sleep __os_sleep@DB_VERSION_UNIQUE_NAME@
 #define	__os_spin __os_spin@DB_VERSION_UNIQUE_NAME@
-#define	__os_yield __os_yield@DB_VERSION_UNIQUE_NAME@
 #define	__os_exists __os_exists@DB_VERSION_UNIQUE_NAME@
 #define	__os_ioinfo __os_ioinfo@DB_VERSION_UNIQUE_NAME@
 #define	__os_tmpdir __os_tmpdir@DB_VERSION_UNIQUE_NAME@
 #define	__os_truncate __os_truncate@DB_VERSION_UNIQUE_NAME@
+#define	__os_unique_id __os_unique_id@DB_VERSION_UNIQUE_NAME@
 #define	__os_region_unlink __os_region_unlink@DB_VERSION_UNIQUE_NAME@
 #define	__os_unlink __os_unlink@DB_VERSION_UNIQUE_NAME@
+#define	__os_yield __os_yield@DB_VERSION_UNIQUE_NAME@
 #define	__os_is_winnt __os_is_winnt@DB_VERSION_UNIQUE_NAME@
-#define	__os_have_direct __os_have_direct@DB_VERSION_UNIQUE_NAME@
-#define	__os_unlink __os_unlink@DB_VERSION_UNIQUE_NAME@
+#define	__os_get_neterr __os_get_neterr@DB_VERSION_UNIQUE_NAME@
 #define	__qam_position __qam_position@DB_VERSION_UNIQUE_NAME@
 #define	__qam_pitem __qam_pitem@DB_VERSION_UNIQUE_NAME@
 #define	__qam_append __qam_append@DB_VERSION_UNIQUE_NAME@
 #define	__qam_c_dup __qam_c_dup@DB_VERSION_UNIQUE_NAME@
 #define	__qam_c_init __qam_c_init@DB_VERSION_UNIQUE_NAME@
 #define	__qam_truncate __qam_truncate@DB_VERSION_UNIQUE_NAME@
+#define	__qam_delete __qam_delete@DB_VERSION_UNIQUE_NAME@
 #define	__qam_incfirst_log __qam_incfirst_log@DB_VERSION_UNIQUE_NAME@
 #define	__qam_incfirst_read __qam_incfirst_read@DB_VERSION_UNIQUE_NAME@
 #define	__qam_mvptr_log __qam_mvptr_log@DB_VERSION_UNIQUE_NAME@
@@ -986,34 +1204,61 @@
 #define	__rep_update_req __rep_update_req@DB_VERSION_UNIQUE_NAME@
 #define	__rep_page_req __rep_page_req@DB_VERSION_UNIQUE_NAME@
 #define	__rep_update_setup __rep_update_setup@DB_VERSION_UNIQUE_NAME@
+#define	__rep_bulk_page __rep_bulk_page@DB_VERSION_UNIQUE_NAME@
 #define	__rep_page __rep_page@DB_VERSION_UNIQUE_NAME@
 #define	__rep_page_fail __rep_page_fail@DB_VERSION_UNIQUE_NAME@
+#define	__rep_init_cleanup __rep_init_cleanup@DB_VERSION_UNIQUE_NAME@
 #define	__rep_pggap_req __rep_pggap_req@DB_VERSION_UNIQUE_NAME@
-#define	__rep_loggap_req __rep_loggap_req@DB_VERSION_UNIQUE_NAME@
 #define	__rep_finfo_alloc __rep_finfo_alloc@DB_VERSION_UNIQUE_NAME@
+#define	__rep_elect __rep_elect@DB_VERSION_UNIQUE_NAME@
+#define	__rep_vote1 __rep_vote1@DB_VERSION_UNIQUE_NAME@
+#define	__rep_vote2 __rep_vote2@DB_VERSION_UNIQUE_NAME@
+#define	__rep_elect_master __rep_elect_master@DB_VERSION_UNIQUE_NAME@
+#define	__rep_allreq __rep_allreq@DB_VERSION_UNIQUE_NAME@
+#define	__rep_log __rep_log@DB_VERSION_UNIQUE_NAME@
+#define	__rep_bulk_log __rep_bulk_log@DB_VERSION_UNIQUE_NAME@
+#define	__rep_logreq __rep_logreq@DB_VERSION_UNIQUE_NAME@
+#define	__rep_loggap_req __rep_loggap_req@DB_VERSION_UNIQUE_NAME@
+#define	__rep_logready __rep_logready@DB_VERSION_UNIQUE_NAME@
 #define	__rep_dbenv_create __rep_dbenv_create@DB_VERSION_UNIQUE_NAME@
-#define	__rep_open __rep_open@DB_VERSION_UNIQUE_NAME@
+#define	__rep_dbenv_destroy __rep_dbenv_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__rep_get_config __rep_get_config@DB_VERSION_UNIQUE_NAME@
+#define	__rep_set_config __rep_set_config@DB_VERSION_UNIQUE_NAME@
+#define	__rep_start __rep_start@DB_VERSION_UNIQUE_NAME@
 #define	__rep_client_dbinit __rep_client_dbinit@DB_VERSION_UNIQUE_NAME@
-#define	__rep_elect_master __rep_elect_master@DB_VERSION_UNIQUE_NAME@
+#define	__rep_get_limit __rep_get_limit@DB_VERSION_UNIQUE_NAME@
+#define	__rep_set_limit __rep_set_limit@DB_VERSION_UNIQUE_NAME@
+#define	__rep_set_nsites __rep_set_nsites@DB_VERSION_UNIQUE_NAME@
+#define	__rep_get_nsites __rep_get_nsites@DB_VERSION_UNIQUE_NAME@
+#define	__rep_set_priority __rep_set_priority@DB_VERSION_UNIQUE_NAME@
+#define	__rep_get_priority __rep_get_priority@DB_VERSION_UNIQUE_NAME@
+#define	__rep_set_timeout __rep_set_timeout@DB_VERSION_UNIQUE_NAME@
+#define	__rep_get_timeout __rep_get_timeout@DB_VERSION_UNIQUE_NAME@
+#define	__rep_get_request __rep_get_request@DB_VERSION_UNIQUE_NAME@
+#define	__rep_set_request __rep_set_request@DB_VERSION_UNIQUE_NAME@
+#define	__rep_set_transport __rep_set_transport@DB_VERSION_UNIQUE_NAME@
+#define	__rep_flush __rep_flush@DB_VERSION_UNIQUE_NAME@
+#define	__rep_sync __rep_sync@DB_VERSION_UNIQUE_NAME@
 #define	__rep_process_message __rep_process_message@DB_VERSION_UNIQUE_NAME@
+#define	__rep_apply __rep_apply@DB_VERSION_UNIQUE_NAME@
 #define	__rep_process_txn __rep_process_txn@DB_VERSION_UNIQUE_NAME@
-#define	__rep_tally __rep_tally@DB_VERSION_UNIQUE_NAME@
-#define	__rep_cmp_vote __rep_cmp_vote@DB_VERSION_UNIQUE_NAME@
-#define	__rep_cmp_vote2 __rep_cmp_vote2@DB_VERSION_UNIQUE_NAME@
 #define	__rep_check_doreq __rep_check_doreq@DB_VERSION_UNIQUE_NAME@
-#define	__rep_lockout __rep_lockout@DB_VERSION_UNIQUE_NAME@
-#define	__rep_region_init __rep_region_init@DB_VERSION_UNIQUE_NAME@
+#define	__rep_open __rep_open@DB_VERSION_UNIQUE_NAME@
 #define	__rep_region_destroy __rep_region_destroy@DB_VERSION_UNIQUE_NAME@
 #define	__rep_dbenv_refresh __rep_dbenv_refresh@DB_VERSION_UNIQUE_NAME@
-#define	__rep_dbenv_close __rep_dbenv_close@DB_VERSION_UNIQUE_NAME@
+#define	__rep_close __rep_close@DB_VERSION_UNIQUE_NAME@
 #define	__rep_preclose __rep_preclose@DB_VERSION_UNIQUE_NAME@
+#define	__rep_closefiles __rep_closefiles@DB_VERSION_UNIQUE_NAME@
 #define	__rep_write_egen __rep_write_egen@DB_VERSION_UNIQUE_NAME@
 #define	__rep_stat_pp __rep_stat_pp@DB_VERSION_UNIQUE_NAME@
 #define	__rep_stat_print_pp __rep_stat_print_pp@DB_VERSION_UNIQUE_NAME@
 #define	__rep_stat_print __rep_stat_print@DB_VERSION_UNIQUE_NAME@
+#define	__rep_bulk_message __rep_bulk_message@DB_VERSION_UNIQUE_NAME@
+#define	__rep_send_bulk __rep_send_bulk@DB_VERSION_UNIQUE_NAME@
+#define	__rep_bulk_alloc __rep_bulk_alloc@DB_VERSION_UNIQUE_NAME@
+#define	__rep_bulk_free __rep_bulk_free@DB_VERSION_UNIQUE_NAME@
 #define	__rep_send_message __rep_send_message@DB_VERSION_UNIQUE_NAME@
 #define	__rep_new_master __rep_new_master@DB_VERSION_UNIQUE_NAME@
-#define	__rep_is_client __rep_is_client@DB_VERSION_UNIQUE_NAME@
 #define	__rep_noarchive __rep_noarchive@DB_VERSION_UNIQUE_NAME@
 #define	__rep_send_vote __rep_send_vote@DB_VERSION_UNIQUE_NAME@
 #define	__rep_elect_done __rep_elect_done@DB_VERSION_UNIQUE_NAME@
@@ -1024,8 +1269,92 @@
 #define	__op_rep_enter __op_rep_enter@DB_VERSION_UNIQUE_NAME@
 #define	__op_rep_exit __op_rep_exit@DB_VERSION_UNIQUE_NAME@
 #define	__rep_get_gen __rep_get_gen@DB_VERSION_UNIQUE_NAME@
+#define	__rep_lockout_api __rep_lockout_api@DB_VERSION_UNIQUE_NAME@
+#define	__rep_lockout_msg __rep_lockout_msg@DB_VERSION_UNIQUE_NAME@
+#define	__rep_send_throttle __rep_send_throttle@DB_VERSION_UNIQUE_NAME@
+#define	__rep_msg_to_old __rep_msg_to_old@DB_VERSION_UNIQUE_NAME@
+#define	__rep_msg_from_old __rep_msg_from_old@DB_VERSION_UNIQUE_NAME@
 #define	__rep_print_message __rep_print_message@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_envrpcserver __dbcl_envrpcserver@DB_VERSION_UNIQUE_NAME@
+#define	__rep_verify __rep_verify@DB_VERSION_UNIQUE_NAME@
+#define	__rep_verify_fail __rep_verify_fail@DB_VERSION_UNIQUE_NAME@
+#define	__rep_verify_req __rep_verify_req@DB_VERSION_UNIQUE_NAME@
+#define	__rep_verify_match __rep_verify_match@DB_VERSION_UNIQUE_NAME@
+#define	__rep_log_backup __rep_log_backup@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_init_election __repmgr_init_election@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_become_master __repmgr_become_master@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_start __repmgr_start@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_close __repmgr_close@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_set_ack_policy __repmgr_set_ack_policy@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_get_ack_policy __repmgr_get_ack_policy@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_dbenv_create __repmgr_dbenv_create@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_dbenv_destroy __repmgr_dbenv_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_stop_threads __repmgr_stop_threads@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_set_local_site __repmgr_set_local_site@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_add_remote_site __repmgr_add_remote_site@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_msg_thread __repmgr_msg_thread@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_stash_generation __repmgr_stash_generation@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_send __repmgr_send@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_send_one __repmgr_send_one@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_is_permanent __repmgr_is_permanent@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_bust_connection __repmgr_bust_connection@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_cleanup_connection __repmgr_cleanup_connection@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_find_site __repmgr_find_site@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_pack_netaddr __repmgr_pack_netaddr@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_getaddr __repmgr_getaddr@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_add_site __repmgr_add_site@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_net_create __repmgr_net_create@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_listen __repmgr_listen@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_net_close __repmgr_net_close@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_net_destroy __repmgr_net_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_thread_start __repmgr_thread_start@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_thread_join __repmgr_thread_join@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_set_nonblocking __repmgr_set_nonblocking@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_wake_waiting_senders __repmgr_wake_waiting_senders@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_await_ack __repmgr_await_ack@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_compute_wait_deadline __repmgr_compute_wait_deadline@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_init_sync __repmgr_init_sync@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_close_sync __repmgr_close_sync@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_net_init __repmgr_net_init@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_lock_mutex __repmgr_lock_mutex@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_unlock_mutex __repmgr_unlock_mutex@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_signal __repmgr_signal@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_wake_main_thread __repmgr_wake_main_thread@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_writev __repmgr_writev@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_readv __repmgr_readv@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_timeval_diff_current __repmgr_timeval_diff_current@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_select_loop __repmgr_select_loop@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_queue_create __repmgr_queue_create@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_queue_destroy __repmgr_queue_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_queue_get __repmgr_queue_get@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_queue_put __repmgr_queue_put@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_queue_size __repmgr_queue_size@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_select_thread __repmgr_select_thread@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_accept __repmgr_accept@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_retry_connections __repmgr_retry_connections@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_first_try_connections __repmgr_first_try_connections@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_connect_site __repmgr_connect_site@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_send_handshake __repmgr_send_handshake@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_read_from_site __repmgr_read_from_site@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_write_some __repmgr_write_some@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_site_list __repmgr_site_list@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_print_stats __repmgr_print_stats@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_schedule_connection_attempt __repmgr_schedule_connection_attempt@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_reset_for_reading __repmgr_reset_for_reading@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_new_connection __repmgr_new_connection@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_new_site __repmgr_new_site@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_cleanup_netaddr __repmgr_cleanup_netaddr@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_iovec_init __repmgr_iovec_init@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_add_buffer __repmgr_add_buffer@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_add_dbt __repmgr_add_dbt@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_update_consumed __repmgr_update_consumed@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_prepare_my_addr __repmgr_prepare_my_addr@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_timeval_cmp __repmgr_timeval_cmp@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_get_nsites __repmgr_get_nsites@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_thread_failure __repmgr_thread_failure@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_format_eid_loc __repmgr_format_eid_loc@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_format_site_loc __repmgr_format_site_loc@DB_VERSION_UNIQUE_NAME@
+#define	__repmgr_wsa_init __repmgr_wsa_init@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_set_rpc_server __dbcl_env_set_rpc_server@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_close_wrap __dbcl_env_close_wrap@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_open_wrap __dbcl_env_open_wrap@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_open_wrap __dbcl_db_open_wrap@DB_VERSION_UNIQUE_NAME@
@@ -1036,192 +1365,88 @@
 #define	__dbcl_c_refresh __dbcl_c_refresh@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_c_setup __dbcl_c_setup@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_dbclose_common __dbcl_dbclose_common@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_env_alloc __dbcl_env_alloc@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_app_dispatch __dbcl_set_app_dispatch@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_env_get_cachesize __dbcl_env_get_cachesize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_env_cachesize __dbcl_env_cachesize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_env_close __dbcl_env_close@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbenv_illegal __dbcl_dbenv_illegal@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_create __dbcl_env_create@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_data_dirs __dbcl_get_data_dirs@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_data_dir __dbcl_set_data_dir@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_cdsgroup_begin __dbcl_env_cdsgroup_begin@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_close __dbcl_env_close@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_dbremove __dbcl_env_dbremove@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_dbrename __dbcl_env_dbrename@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_get_cachesize __dbcl_env_get_cachesize@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_get_encrypt_flags __dbcl_env_get_encrypt_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_env_encrypt __dbcl_env_encrypt@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_env_set_feedback __dbcl_env_set_feedback@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_get_flags __dbcl_env_get_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_env_flags __dbcl_env_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_lg_bsize __dbcl_get_lg_bsize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lg_bsize __dbcl_set_lg_bsize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_lg_dir __dbcl_get_lg_dir@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lg_dir __dbcl_set_lg_dir@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_lg_max __dbcl_get_lg_max@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lg_max __dbcl_set_lg_max@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_lg_regionmax __dbcl_get_lg_regionmax@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lg_regionmax __dbcl_set_lg_regionmax@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_lk_conflicts __dbcl_get_lk_conflicts@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lk_conflict __dbcl_set_lk_conflict@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_lk_detect __dbcl_get_lk_detect@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lk_detect __dbcl_set_lk_detect@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lk_max __dbcl_set_lk_max@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_lk_max_locks __dbcl_get_lk_max_locks@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lk_max_locks __dbcl_set_lk_max_locks@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_lk_max_lockers __dbcl_get_lk_max_lockers@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lk_max_lockers __dbcl_set_lk_max_lockers@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_lk_max_objects __dbcl_get_lk_max_objects@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_lk_max_objects __dbcl_set_lk_max_objects@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_mp_max_openfd __dbcl_get_mp_max_openfd@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_mp_max_openfd __dbcl_set_mp_max_openfd@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_mp_max_write __dbcl_get_mp_max_write@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_mp_max_write __dbcl_set_mp_max_write@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_mp_mmapsize __dbcl_get_mp_mmapsize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_mp_mmapsize __dbcl_set_mp_mmapsize@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_get_home __dbcl_env_get_home@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_get_open_flags __dbcl_env_get_open_flags@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_open __dbcl_env_open@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_env_paniccall __dbcl_env_paniccall@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_remove __dbcl_env_remove@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_shm_key __dbcl_get_shm_key@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_shm_key __dbcl_set_shm_key@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_tas_spins __dbcl_get_tas_spins@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_tas_spins __dbcl_set_tas_spins@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_timeout __dbcl_get_timeout@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_timeout __dbcl_set_timeout@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_tmp_dir __dbcl_get_tmp_dir@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_tmp_dir __dbcl_set_tmp_dir@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_tx_max __dbcl_get_tx_max@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_tx_max __dbcl_set_tx_max@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_tx_timestamp __dbcl_get_tx_timestamp@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_tx_timestamp __dbcl_set_tx_timestamp@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_get_verbose __dbcl_get_verbose@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_set_verbose __dbcl_set_verbose@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_abort __dbcl_txn_abort@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_begin __dbcl_txn_begin@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_checkpoint __dbcl_txn_checkpoint@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_commit __dbcl_txn_commit@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_discard __dbcl_txn_discard@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_prepare __dbcl_txn_prepare@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_recover __dbcl_txn_recover@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_stat __dbcl_txn_stat@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_timeout __dbcl_txn_timeout@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_rep_elect __dbcl_rep_elect@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_rep_flush __dbcl_rep_flush@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_rep_process_message __dbcl_rep_process_message@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_rep_get_limit __dbcl_rep_get_limit@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_rep_set_limit __dbcl_rep_set_limit@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_rep_set_request __dbcl_rep_set_request@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_rep_set_rep_transport __dbcl_rep_set_rep_transport@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_rep_start __dbcl_rep_start@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_rep_stat __dbcl_rep_stat@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_alloc __dbcl_db_alloc@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_set_cachesize __dbcl_env_set_cachesize@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_set_encrypt __dbcl_env_set_encrypt@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_set_flags __dbcl_env_set_flags@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_txn_begin __dbcl_env_txn_begin@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_txn_recover __dbcl_env_txn_recover@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_create __dbcl_db_create@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_associate __dbcl_db_associate@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_bt_compare __dbcl_db_bt_compare@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_bt_maxkey __dbcl_db_bt_maxkey@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_get_bt_minkey __dbcl_db_get_bt_minkey@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_bt_minkey __dbcl_db_bt_minkey@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_bt_prefix __dbcl_db_bt_prefix@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_set_append_recno __dbcl_db_set_append_recno@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_get_cachesize __dbcl_db_get_cachesize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_cachesize __dbcl_db_cachesize@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_close __dbcl_db_close@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_create __dbcl_db_create@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_cursor __dbcl_db_cursor@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_del __dbcl_db_del@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_dup_compare __dbcl_db_dup_compare@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_get __dbcl_db_get@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_get_bt_minkey __dbcl_db_get_bt_minkey@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_get_dbname __dbcl_db_get_dbname@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_encrypt_flags __dbcl_db_get_encrypt_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_encrypt __dbcl_db_encrypt@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_get_extentsize __dbcl_db_get_extentsize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_extentsize __dbcl_db_extentsize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_fd __dbcl_db_fd@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_feedback __dbcl_db_feedback@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_flags __dbcl_db_get_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_flags __dbcl_db_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_get __dbcl_db_get@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_get_name __dbcl_db_get_name@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_get_open_flags __dbcl_db_get_open_flags@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_h_ffactor __dbcl_db_get_h_ffactor@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_h_ffactor __dbcl_db_h_ffactor@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_h_hash __dbcl_db_h_hash@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_h_nelem __dbcl_db_get_h_nelem@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_h_nelem __dbcl_db_h_nelem@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_key_range __dbcl_db_key_range@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_lorder __dbcl_db_get_lorder@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_lorder __dbcl_db_lorder@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_open __dbcl_db_open@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_get_open_flags __dbcl_db_get_open_flags@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_pagesize __dbcl_db_get_pagesize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_pagesize __dbcl_db_pagesize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_panic __dbcl_db_panic@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_pget __dbcl_db_pget@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_put __dbcl_db_put@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_get_q_extentsize __dbcl_db_get_q_extentsize@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_re_delim __dbcl_db_get_re_delim@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_re_delim __dbcl_db_re_delim@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_re_len __dbcl_db_get_re_len@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_re_len __dbcl_db_re_len@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_re_pad __dbcl_db_re_pad@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_re_pad __dbcl_db_get_re_pad@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_get_re_source __dbcl_db_get_re_source@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_re_source __dbcl_db_re_source@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_join __dbcl_db_join@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_key_range __dbcl_db_key_range@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_open __dbcl_db_open@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_pget __dbcl_db_pget@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_put __dbcl_db_put@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_remove __dbcl_db_remove@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_rename __dbcl_db_rename@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_bt_minkey __dbcl_db_set_bt_minkey@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_encrypt __dbcl_db_set_encrypt@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_flags __dbcl_db_set_flags@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_h_ffactor __dbcl_db_set_h_ffactor@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_h_nelem __dbcl_db_set_h_nelem@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_lorder __dbcl_db_set_lorder@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_pagesize __dbcl_db_set_pagesize@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_q_extentsize __dbcl_db_set_q_extentsize@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_re_delim __dbcl_db_set_re_delim@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_re_len __dbcl_db_set_re_len@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_db_set_re_pad __dbcl_db_set_re_pad@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_stat __dbcl_db_stat@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_sync __dbcl_db_sync@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_truncate __dbcl_db_truncate@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_upgrade __dbcl_db_upgrade@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_verify __dbcl_db_verify@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_cursor __dbcl_db_cursor@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_db_join __dbcl_db_join@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_close __dbcl_dbc_close@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_count __dbcl_dbc_count@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_del __dbcl_dbc_del@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_dup __dbcl_dbc_dup@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_get __dbcl_dbc_get@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_pget __dbcl_dbc_pget@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_put __dbcl_dbc_put@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_lock_detect __dbcl_lock_detect@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_lock_get __dbcl_lock_get@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_lock_id __dbcl_lock_id@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_lock_id_free __dbcl_lock_id_free@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_lock_put __dbcl_lock_put@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_lock_stat __dbcl_lock_stat@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_lock_vec __dbcl_lock_vec@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_log_archive __dbcl_log_archive@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_log_cursor __dbcl_log_cursor@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_log_file __dbcl_log_file@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_log_flush __dbcl_log_flush@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_log_put __dbcl_log_put@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_log_stat __dbcl_log_stat@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_register __dbcl_memp_register@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_stat __dbcl_memp_stat@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_sync __dbcl_memp_sync@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_trickle __dbcl_memp_trickle@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_fget __dbcl_memp_fget@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_fopen __dbcl_memp_fopen@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_fput __dbcl_memp_fput@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_fset __dbcl_memp_fset@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_get_clear_len __dbcl_memp_get_clear_len@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_set_clear_len __dbcl_memp_set_clear_len@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_get_fileid __dbcl_memp_get_fileid@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_set_fileid __dbcl_memp_set_fileid@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_get_flags __dbcl_memp_get_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_set_flags __dbcl_memp_set_flags@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_get_ftype __dbcl_memp_get_ftype@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_set_ftype __dbcl_memp_set_ftype@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_get_lsn_offset __dbcl_memp_get_lsn_offset@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_set_lsn_offset __dbcl_memp_set_lsn_offset@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_get_maxsize __dbcl_memp_get_maxsize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_set_maxsize __dbcl_memp_set_maxsize@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_get_pgcookie __dbcl_memp_get_pgcookie@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_set_pgcookie __dbcl_memp_set_pgcookie@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_get_priority __dbcl_memp_get_priority@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_set_priority __dbcl_memp_set_priority@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_memp_fsync __dbcl_memp_fsync@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_close __dbcl_dbc_c_close@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_count __dbcl_dbc_c_count@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_del __dbcl_dbc_c_del@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_dup __dbcl_dbc_c_dup@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_get __dbcl_dbc_c_get@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_pget __dbcl_dbc_c_pget@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_put __dbcl_dbc_c_put@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_txn_abort __dbcl_txn_abort@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_txn_commit __dbcl_txn_commit@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_txn_discard __dbcl_txn_discard@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_txn_prepare __dbcl_txn_prepare@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbp_init __dbcl_dbp_init@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_init __dbcl_dbc_init@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbenv_init __dbcl_dbenv_init@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_txn_init __dbcl_txn_init@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_create_ret __dbcl_env_create_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_open_ret __dbcl_env_open_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_env_remove_ret __dbcl_env_remove_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_txn_abort_ret __dbcl_txn_abort_ret@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_begin_ret __dbcl_txn_begin_ret@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_txn_begin_ret __dbcl_env_txn_begin_ret@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_cdsgroup_begin_ret __dbcl_env_cdsgroup_begin_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_txn_commit_ret __dbcl_txn_commit_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_txn_discard_ret __dbcl_txn_discard_ret@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_txn_recover_ret __dbcl_txn_recover_ret@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_env_txn_recover_ret __dbcl_env_txn_recover_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_close_ret __dbcl_db_close_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_create_ret __dbcl_db_create_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_get_ret __dbcl_db_get_ret@DB_VERSION_UNIQUE_NAME@
@@ -1235,66 +1460,66 @@
 #define	__dbcl_db_truncate_ret __dbcl_db_truncate_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_cursor_ret __dbcl_db_cursor_ret@DB_VERSION_UNIQUE_NAME@
 #define	__dbcl_db_join_ret __dbcl_db_join_ret@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_close_ret __dbcl_dbc_close_ret@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_count_ret __dbcl_dbc_count_ret@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_dup_ret __dbcl_dbc_dup_ret@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_get_ret __dbcl_dbc_get_ret@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_pget_ret __dbcl_dbc_pget_ret@DB_VERSION_UNIQUE_NAME@
-#define	__dbcl_dbc_put_ret __dbcl_dbc_put_ret@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_close_ret __dbcl_dbc_c_close_ret@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_count_ret __dbcl_dbc_c_count_ret@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_dup_ret __dbcl_dbc_c_dup_ret@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_get_ret __dbcl_dbc_c_get_ret@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_pget_ret __dbcl_dbc_c_pget_ret@DB_VERSION_UNIQUE_NAME@
+#define	__dbcl_dbc_c_put_ret __dbcl_dbc_c_put_ret@DB_VERSION_UNIQUE_NAME@
 #define	__env_get_cachesize_proc __env_get_cachesize_proc@DB_VERSION_UNIQUE_NAME@
-#define	__env_cachesize_proc __env_cachesize_proc@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_cachesize_proc __env_set_cachesize_proc@DB_VERSION_UNIQUE_NAME@
+#define	__env_cdsgroup_begin_proc __env_cdsgroup_begin_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_close_proc __env_close_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_create_proc __env_create_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_dbremove_proc __env_dbremove_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_dbrename_proc __env_dbrename_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_get_encrypt_flags_proc __env_get_encrypt_flags_proc@DB_VERSION_UNIQUE_NAME@
-#define	__env_encrypt_proc __env_encrypt_proc@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_encrypt_proc __env_set_encrypt_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_get_flags_proc __env_get_flags_proc@DB_VERSION_UNIQUE_NAME@
-#define	__env_flags_proc __env_flags_proc@DB_VERSION_UNIQUE_NAME@
+#define	__env_set_flags_proc __env_set_flags_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_get_home_proc __env_get_home_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_get_open_flags_proc __env_get_open_flags_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_open_proc __env_open_proc@DB_VERSION_UNIQUE_NAME@
 #define	__env_remove_proc __env_remove_proc@DB_VERSION_UNIQUE_NAME@
 #define	__txn_abort_proc __txn_abort_proc@DB_VERSION_UNIQUE_NAME@
-#define	__txn_begin_proc __txn_begin_proc@DB_VERSION_UNIQUE_NAME@
+#define	__env_txn_begin_proc __env_txn_begin_proc@DB_VERSION_UNIQUE_NAME@
 #define	__txn_commit_proc __txn_commit_proc@DB_VERSION_UNIQUE_NAME@
 #define	__txn_discard_proc __txn_discard_proc@DB_VERSION_UNIQUE_NAME@
 #define	__txn_prepare_proc __txn_prepare_proc@DB_VERSION_UNIQUE_NAME@
-#define	__txn_recover_proc __txn_recover_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_bt_maxkey_proc __db_bt_maxkey_proc@DB_VERSION_UNIQUE_NAME@
+#define	__env_txn_recover_proc __env_txn_recover_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_associate_proc __db_associate_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_bt_minkey_proc __db_get_bt_minkey_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_bt_minkey_proc __db_bt_minkey_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_bt_minkey_proc __db_set_bt_minkey_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_close_proc __db_close_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_create_proc __db_create_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_del_proc __db_del_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_encrypt_flags_proc __db_get_encrypt_flags_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_encrypt_proc __db_encrypt_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_get_extentsize_proc __db_get_extentsize_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_extentsize_proc __db_extentsize_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_encrypt_proc __db_set_encrypt_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_get_q_extentsize_proc __db_get_q_extentsize_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_q_extentsize_proc __db_set_q_extentsize_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_flags_proc __db_get_flags_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_flags_proc __db_flags_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_flags_proc __db_set_flags_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_proc __db_get_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_h_ffactor_proc __db_get_h_ffactor_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_h_ffactor_proc __db_h_ffactor_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_h_ffactor_proc __db_set_h_ffactor_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_h_nelem_proc __db_get_h_nelem_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_h_nelem_proc __db_h_nelem_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_h_nelem_proc __db_set_h_nelem_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_key_range_proc __db_key_range_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_lorder_proc __db_get_lorder_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_lorder_proc __db_lorder_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_get_name_proc __db_get_name_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_lorder_proc __db_set_lorder_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_get_dbname_proc __db_get_dbname_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_open_flags_proc __db_get_open_flags_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_open_proc __db_open_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_pagesize_proc __db_get_pagesize_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_pagesize_proc __db_pagesize_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_pagesize_proc __db_set_pagesize_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_pget_proc __db_pget_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_put_proc __db_put_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_re_delim_proc __db_get_re_delim_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_re_delim_proc __db_re_delim_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_re_delim_proc __db_set_re_delim_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_re_len_proc __db_get_re_len_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_re_len_proc __db_re_len_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_re_len_proc __db_set_re_len_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_get_re_pad_proc __db_get_re_pad_proc@DB_VERSION_UNIQUE_NAME@
-#define	__db_re_pad_proc __db_re_pad_proc@DB_VERSION_UNIQUE_NAME@
+#define	__db_set_re_pad_proc __db_set_re_pad_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_remove_proc __db_remove_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_rename_proc __db_rename_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_stat_proc __db_stat_proc@DB_VERSION_UNIQUE_NAME@
@@ -1302,15 +1527,14 @@
 #define	__db_truncate_proc __db_truncate_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_cursor_proc __db_cursor_proc@DB_VERSION_UNIQUE_NAME@
 #define	__db_join_proc __db_join_proc@DB_VERSION_UNIQUE_NAME@
-#define	__dbc_close_proc __dbc_close_proc@DB_VERSION_UNIQUE_NAME@
-#define	__dbc_count_proc __dbc_count_proc@DB_VERSION_UNIQUE_NAME@
-#define	__dbc_del_proc __dbc_del_proc@DB_VERSION_UNIQUE_NAME@
-#define	__dbc_dup_proc __dbc_dup_proc@DB_VERSION_UNIQUE_NAME@
-#define	__dbc_get_proc __dbc_get_proc@DB_VERSION_UNIQUE_NAME@
-#define	__dbc_pget_proc __dbc_pget_proc@DB_VERSION_UNIQUE_NAME@
-#define	__dbc_put_proc __dbc_put_proc@DB_VERSION_UNIQUE_NAME@
+#define	__dbc_c_close_proc __dbc_c_close_proc@DB_VERSION_UNIQUE_NAME@
+#define	__dbc_c_count_proc __dbc_c_count_proc@DB_VERSION_UNIQUE_NAME@
+#define	__dbc_c_del_proc __dbc_c_del_proc@DB_VERSION_UNIQUE_NAME@
+#define	__dbc_c_dup_proc __dbc_c_dup_proc@DB_VERSION_UNIQUE_NAME@
+#define	__dbc_c_get_proc __dbc_c_get_proc@DB_VERSION_UNIQUE_NAME@
+#define	__dbc_c_pget_proc __dbc_c_pget_proc@DB_VERSION_UNIQUE_NAME@
+#define	__dbc_c_put_proc __dbc_c_put_proc@DB_VERSION_UNIQUE_NAME@
 #define	__dbsrv_settimeout __dbsrv_settimeout@DB_VERSION_UNIQUE_NAME@
-#define	__dbsrv_timeout __dbsrv_timeout@DB_VERSION_UNIQUE_NAME@
 #define	__dbclear_ctp __dbclear_ctp@DB_VERSION_UNIQUE_NAME@
 #define	__dbdel_ctp __dbdel_ctp@DB_VERSION_UNIQUE_NAME@
 #define	new_ct_ent new_ct_ent@DB_VERSION_UNIQUE_NAME@
@@ -1320,7 +1544,7 @@
 #define	__dbsrv_active __dbsrv_active@DB_VERSION_UNIQUE_NAME@
 #define	__db_close_int __db_close_int@DB_VERSION_UNIQUE_NAME@
 #define	__dbc_close_int __dbc_close_int@DB_VERSION_UNIQUE_NAME@
-#define	__dbenv_close_int __dbenv_close_int@DB_VERSION_UNIQUE_NAME@
+#define	__env_close_int __env_close_int@DB_VERSION_UNIQUE_NAME@
 #define	get_fullhome get_fullhome@DB_VERSION_UNIQUE_NAME@
 #define	__seq_stat __seq_stat@DB_VERSION_UNIQUE_NAME@
 #define	__seq_stat_print __seq_stat_print@DB_VERSION_UNIQUE_NAME@
@@ -1336,11 +1560,16 @@
 #define	ndbm_Cmd ndbm_Cmd@DB_VERSION_UNIQUE_NAME@
 #define	_DbInfoDelete _DbInfoDelete@DB_VERSION_UNIQUE_NAME@
 #define	db_Cmd db_Cmd@DB_VERSION_UNIQUE_NAME@
+#define	tcl_CompactStat tcl_CompactStat@DB_VERSION_UNIQUE_NAME@
+#define	tcl_rep_send tcl_rep_send@DB_VERSION_UNIQUE_NAME@
 #define	dbc_Cmd dbc_Cmd@DB_VERSION_UNIQUE_NAME@
 #define	env_Cmd env_Cmd@DB_VERSION_UNIQUE_NAME@
 #define	tcl_EnvRemove tcl_EnvRemove@DB_VERSION_UNIQUE_NAME@
+#define	tcl_EnvIdReset tcl_EnvIdReset@DB_VERSION_UNIQUE_NAME@
+#define	tcl_EnvLsnReset tcl_EnvLsnReset@DB_VERSION_UNIQUE_NAME@
 #define	tcl_EnvVerbose tcl_EnvVerbose@DB_VERSION_UNIQUE_NAME@
 #define	tcl_EnvAttr tcl_EnvAttr@DB_VERSION_UNIQUE_NAME@
+#define	tcl_EventNotify tcl_EventNotify@DB_VERSION_UNIQUE_NAME@
 #define	tcl_EnvSetFlags tcl_EnvSetFlags@DB_VERSION_UNIQUE_NAME@
 #define	tcl_EnvTest tcl_EnvTest@DB_VERSION_UNIQUE_NAME@
 #define	tcl_EnvGetEncryptFlags tcl_EnvGetEncryptFlags@DB_VERSION_UNIQUE_NAME@
@@ -1362,6 +1591,7 @@
 #define	_ReturnSetup _ReturnSetup@DB_VERSION_UNIQUE_NAME@
 #define	_ErrorSetup _ErrorSetup@DB_VERSION_UNIQUE_NAME@
 #define	_ErrorFunc _ErrorFunc@DB_VERSION_UNIQUE_NAME@
+#define	_EventFunc _EventFunc@DB_VERSION_UNIQUE_NAME@
 #define	_GetLsn _GetLsn@DB_VERSION_UNIQUE_NAME@
 #define	_GetUInt32 _GetUInt32@DB_VERSION_UNIQUE_NAME@
 #define	_GetFlagsList _GetFlagsList@DB_VERSION_UNIQUE_NAME@
@@ -1385,43 +1615,49 @@
 #define	tcl_MpTrickle tcl_MpTrickle@DB_VERSION_UNIQUE_NAME@
 #define	tcl_Mp tcl_Mp@DB_VERSION_UNIQUE_NAME@
 #define	tcl_MpStat tcl_MpStat@DB_VERSION_UNIQUE_NAME@
+#define	tcl_RepConfig tcl_RepConfig@DB_VERSION_UNIQUE_NAME@
+#define	tcl_RepGetConfig tcl_RepGetConfig@DB_VERSION_UNIQUE_NAME@
 #define	tcl_RepElect tcl_RepElect@DB_VERSION_UNIQUE_NAME@
 #define	tcl_RepFlush tcl_RepFlush@DB_VERSION_UNIQUE_NAME@
+#define	tcl_RepSync tcl_RepSync@DB_VERSION_UNIQUE_NAME@
 #define	tcl_RepLimit tcl_RepLimit@DB_VERSION_UNIQUE_NAME@
 #define	tcl_RepRequest tcl_RepRequest@DB_VERSION_UNIQUE_NAME@
+#define	tcl_RepTransport tcl_RepTransport@DB_VERSION_UNIQUE_NAME@
 #define	tcl_RepStart tcl_RepStart@DB_VERSION_UNIQUE_NAME@
 #define	tcl_RepProcessMessage tcl_RepProcessMessage@DB_VERSION_UNIQUE_NAME@
 #define	tcl_RepStat tcl_RepStat@DB_VERSION_UNIQUE_NAME@
+#define	tcl_RepMgr tcl_RepMgr@DB_VERSION_UNIQUE_NAME@
 #define	seq_Cmd seq_Cmd@DB_VERSION_UNIQUE_NAME@
 #define	_TxnInfoDelete _TxnInfoDelete@DB_VERSION_UNIQUE_NAME@
 #define	tcl_TxnCheckpoint tcl_TxnCheckpoint@DB_VERSION_UNIQUE_NAME@
 #define	tcl_Txn tcl_Txn@DB_VERSION_UNIQUE_NAME@
+#define	tcl_CDSGroup tcl_CDSGroup@DB_VERSION_UNIQUE_NAME@
 #define	tcl_TxnStat tcl_TxnStat@DB_VERSION_UNIQUE_NAME@
 #define	tcl_TxnTimeout tcl_TxnTimeout@DB_VERSION_UNIQUE_NAME@
 #define	tcl_TxnRecover tcl_TxnRecover@DB_VERSION_UNIQUE_NAME@
 #define	bdb_RandCommand bdb_RandCommand@DB_VERSION_UNIQUE_NAME@
-#define	tcl_Mutex tcl_Mutex@DB_VERSION_UNIQUE_NAME@
 #define	__txn_begin_pp __txn_begin_pp@DB_VERSION_UNIQUE_NAME@
 #define	__txn_begin __txn_begin@DB_VERSION_UNIQUE_NAME@
 #define	__txn_xa_begin __txn_xa_begin@DB_VERSION_UNIQUE_NAME@
+#define	__txn_recycle_id __txn_recycle_id@DB_VERSION_UNIQUE_NAME@
 #define	__txn_compensate_begin __txn_compensate_begin@DB_VERSION_UNIQUE_NAME@
+#define	__txn_continue __txn_continue@DB_VERSION_UNIQUE_NAME@
 #define	__txn_commit __txn_commit@DB_VERSION_UNIQUE_NAME@
 #define	__txn_abort __txn_abort@DB_VERSION_UNIQUE_NAME@
-#define	__txn_discard __txn_discard@DB_VERSION_UNIQUE_NAME@
+#define	__txn_discard_int __txn_discard_int@DB_VERSION_UNIQUE_NAME@
 #define	__txn_prepare __txn_prepare@DB_VERSION_UNIQUE_NAME@
 #define	__txn_id __txn_id@DB_VERSION_UNIQUE_NAME@
+#define	__txn_get_name __txn_get_name@DB_VERSION_UNIQUE_NAME@
+#define	__txn_set_name __txn_set_name@DB_VERSION_UNIQUE_NAME@
 #define	__txn_set_timeout __txn_set_timeout@DB_VERSION_UNIQUE_NAME@
-#define	__txn_checkpoint_pp __txn_checkpoint_pp@DB_VERSION_UNIQUE_NAME@
-#define	__txn_checkpoint __txn_checkpoint@DB_VERSION_UNIQUE_NAME@
-#define	__txn_getactive __txn_getactive@DB_VERSION_UNIQUE_NAME@
-#define	__txn_getckp __txn_getckp@DB_VERSION_UNIQUE_NAME@
 #define	__txn_activekids __txn_activekids@DB_VERSION_UNIQUE_NAME@
 #define	__txn_force_abort __txn_force_abort@DB_VERSION_UNIQUE_NAME@
 #define	__txn_preclose __txn_preclose@DB_VERSION_UNIQUE_NAME@
 #define	__txn_reset __txn_reset@DB_VERSION_UNIQUE_NAME@
-#define	__txn_updateckp __txn_updateckp@DB_VERSION_UNIQUE_NAME@
+#define	__txn_regop_42_read __txn_regop_42_read@DB_VERSION_UNIQUE_NAME@
 #define	__txn_regop_log __txn_regop_log@DB_VERSION_UNIQUE_NAME@
 #define	__txn_regop_read __txn_regop_read@DB_VERSION_UNIQUE_NAME@
+#define	__txn_ckp_42_read __txn_ckp_42_read@DB_VERSION_UNIQUE_NAME@
 #define	__txn_ckp_log __txn_ckp_log@DB_VERSION_UNIQUE_NAME@
 #define	__txn_ckp_read __txn_ckp_read@DB_VERSION_UNIQUE_NAME@
 #define	__txn_child_log __txn_child_log@DB_VERSION_UNIQUE_NAME@
@@ -1431,21 +1667,34 @@
 #define	__txn_recycle_log __txn_recycle_log@DB_VERSION_UNIQUE_NAME@
 #define	__txn_recycle_read __txn_recycle_read@DB_VERSION_UNIQUE_NAME@
 #define	__txn_init_recover __txn_init_recover@DB_VERSION_UNIQUE_NAME@
+#define	__txn_regop_42_print __txn_regop_42_print@DB_VERSION_UNIQUE_NAME@
 #define	__txn_regop_print __txn_regop_print@DB_VERSION_UNIQUE_NAME@
+#define	__txn_ckp_42_print __txn_ckp_42_print@DB_VERSION_UNIQUE_NAME@
 #define	__txn_ckp_print __txn_ckp_print@DB_VERSION_UNIQUE_NAME@
 #define	__txn_child_print __txn_child_print@DB_VERSION_UNIQUE_NAME@
 #define	__txn_xa_regop_print __txn_xa_regop_print@DB_VERSION_UNIQUE_NAME@
 #define	__txn_recycle_print __txn_recycle_print@DB_VERSION_UNIQUE_NAME@
 #define	__txn_init_print __txn_init_print@DB_VERSION_UNIQUE_NAME@
+#define	__txn_checkpoint_pp __txn_checkpoint_pp@DB_VERSION_UNIQUE_NAME@
+#define	__txn_checkpoint __txn_checkpoint@DB_VERSION_UNIQUE_NAME@
+#define	__txn_getactive __txn_getactive@DB_VERSION_UNIQUE_NAME@
+#define	__txn_getckp __txn_getckp@DB_VERSION_UNIQUE_NAME@
+#define	__txn_updateckp __txn_updateckp@DB_VERSION_UNIQUE_NAME@
+#define	__txn_failchk __txn_failchk@DB_VERSION_UNIQUE_NAME@
 #define	__txn_dbenv_create __txn_dbenv_create@DB_VERSION_UNIQUE_NAME@
+#define	__txn_dbenv_destroy __txn_dbenv_destroy@DB_VERSION_UNIQUE_NAME@
+#define	__txn_get_tx_max __txn_get_tx_max@DB_VERSION_UNIQUE_NAME@
 #define	__txn_set_tx_max __txn_set_tx_max@DB_VERSION_UNIQUE_NAME@
+#define	__txn_get_tx_timestamp __txn_get_tx_timestamp@DB_VERSION_UNIQUE_NAME@
+#define	__txn_set_tx_timestamp __txn_set_tx_timestamp@DB_VERSION_UNIQUE_NAME@
 #define	__txn_regop_recover __txn_regop_recover@DB_VERSION_UNIQUE_NAME@
 #define	__txn_xa_regop_recover __txn_xa_regop_recover@DB_VERSION_UNIQUE_NAME@
 #define	__txn_ckp_recover __txn_ckp_recover@DB_VERSION_UNIQUE_NAME@
 #define	__txn_child_recover __txn_child_recover@DB_VERSION_UNIQUE_NAME@
 #define	__txn_restore_txn __txn_restore_txn@DB_VERSION_UNIQUE_NAME@
 #define	__txn_recycle_recover __txn_recycle_recover@DB_VERSION_UNIQUE_NAME@
-#define	__txn_continue __txn_continue@DB_VERSION_UNIQUE_NAME@
+#define	__txn_regop_42_recover __txn_regop_42_recover@DB_VERSION_UNIQUE_NAME@
+#define	__txn_ckp_42_recover __txn_ckp_42_recover@DB_VERSION_UNIQUE_NAME@
 #define	__txn_map_gid __txn_map_gid@DB_VERSION_UNIQUE_NAME@
 #define	__txn_recover_pp __txn_recover_pp@DB_VERSION_UNIQUE_NAME@
 #define	__txn_recover __txn_recover@DB_VERSION_UNIQUE_NAME@
@@ -1454,8 +1703,10 @@
 #define	__txn_open __txn_open@DB_VERSION_UNIQUE_NAME@
 #define	__txn_findlastckp __txn_findlastckp@DB_VERSION_UNIQUE_NAME@
 #define	__txn_dbenv_refresh __txn_dbenv_refresh@DB_VERSION_UNIQUE_NAME@
-#define	__txn_region_destroy __txn_region_destroy@DB_VERSION_UNIQUE_NAME@
 #define	__txn_id_set __txn_id_set@DB_VERSION_UNIQUE_NAME@
+#define	__txn_oldest_reader __txn_oldest_reader@DB_VERSION_UNIQUE_NAME@
+#define	__txn_add_buffer __txn_add_buffer@DB_VERSION_UNIQUE_NAME@
+#define	__txn_remove_buffer __txn_remove_buffer@DB_VERSION_UNIQUE_NAME@
 #define	__txn_stat_pp __txn_stat_pp@DB_VERSION_UNIQUE_NAME@
 #define	__txn_stat_print_pp __txn_stat_print_pp@DB_VERSION_UNIQUE_NAME@
 #define	__txn_stat_print __txn_stat_print@DB_VERSION_UNIQUE_NAME@
@@ -1473,7 +1724,7 @@
 #define	__db_unmap_rmid __db_unmap_rmid@DB_VERSION_UNIQUE_NAME@
 #define	__db_map_xid __db_map_xid@DB_VERSION_UNIQUE_NAME@
 #define	__db_unmap_xid __db_unmap_xid@DB_VERSION_UNIQUE_NAME@
-#define __db_global_values __db_global_values@DB_VERSION_UNIQUE_NAME@
-#define __db_jump __db_jump@DB_VERSION_UNIQUE_NAME@
+#define	__db_global_values __db_global_values@DB_VERSION_UNIQUE_NAME@
+#define	__db_jump __db_jump@DB_VERSION_UNIQUE_NAME@
 
 #endif /* !_DB_INT_DEF_IN_ */
diff --git a/db/dbinc_auto/lock_ext.h b/db/dbinc_auto/lock_ext.h
index 4b3ab4905..f84f27483 100644
--- a/db/dbinc_auto/lock_ext.h
+++ b/db/dbinc_auto/lock_ext.h
@@ -12,14 +12,16 @@ int __lock_get_pp __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_
 int __lock_get __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
 int  __lock_get_internal __P((DB_LOCKTAB *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, db_timeout_t, DB_LOCK *));
 int  __lock_put_pp __P((DB_ENV *, DB_LOCK *));
-int  __lock_put __P((DB_ENV *, DB_LOCK *, u_int32_t));
+int  __lock_put __P((DB_ENV *, DB_LOCK *));
 int __lock_downgrade __P((DB_ENV *, DB_LOCK *, db_lockmode_t, u_int32_t));
 int __lock_locker_is_parent __P((DB_ENV *, u_int32_t, u_int32_t, int *));
-int __lock_promote __P((DB_LOCKTAB *, DB_LOCKOBJ *, u_int32_t));
+int __lock_promote __P((DB_LOCKTAB *, DB_LOCKOBJ *, int *, u_int32_t));
 int __lock_detect_pp __P((DB_ENV *, u_int32_t, u_int32_t, int *));
 int __lock_detect __P((DB_ENV *, u_int32_t, int *));
+int __lock_failchk __P((DB_ENV *));
 int __lock_id_pp __P((DB_ENV *, u_int32_t *));
-int  __lock_id __P((DB_ENV *, u_int32_t *));
+int  __lock_id __P((DB_ENV *, u_int32_t *, DB_LOCKER **));
+void __lock_set_thread_id __P((DB_LOCKER *, pid_t, db_threadid_t));
 int __lock_id_free_pp __P((DB_ENV *, u_int32_t));
 int  __lock_id_free __P((DB_ENV *, u_int32_t));
 int __lock_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
@@ -30,17 +32,23 @@ void __lock_freelocker __P((DB_LOCKTAB *, DB_LOCKREGION *, DB_LOCKER *, u_int32_
 int __lock_fix_list __P((DB_ENV *, DBT *, u_int32_t));
 int __lock_get_list __P((DB_ENV *, u_int32_t, u_int32_t, db_lockmode_t, DBT *));
 void __lock_list_print __P((DB_ENV *, DBT *));
-void __lock_dbenv_create __P((DB_ENV *));
-int __lock_dbenv_close __P((DB_ENV *));
+int __lock_dbenv_create __P((DB_ENV *));
+void __lock_dbenv_destroy __P((DB_ENV *));
+int __lock_get_lk_conflicts __P((DB_ENV *, const u_int8_t **, int *));
+int __lock_set_lk_conflicts __P((DB_ENV *, u_int8_t *, int));
+int __lock_get_lk_detect __P((DB_ENV *, u_int32_t *));
 int __lock_set_lk_detect __P((DB_ENV *, u_int32_t));
-int __lock_set_lk_max __P((DB_ENV *, u_int32_t));
+int __lock_get_lk_max_locks __P((DB_ENV *, u_int32_t *));
 int __lock_set_lk_max_locks __P((DB_ENV *, u_int32_t));
+int __lock_get_lk_max_lockers __P((DB_ENV *, u_int32_t *));
 int __lock_set_lk_max_lockers __P((DB_ENV *, u_int32_t));
+int __lock_get_lk_max_objects __P((DB_ENV *, u_int32_t *));
 int __lock_set_lk_max_objects __P((DB_ENV *, u_int32_t));
+int __lock_get_env_timeout __P((DB_ENV *, db_timeout_t *, u_int32_t));
 int __lock_set_env_timeout __P((DB_ENV *, db_timeout_t, u_int32_t));
 int __lock_open __P((DB_ENV *));
 int __lock_dbenv_refresh __P((DB_ENV *));
-void __lock_region_destroy __P((DB_ENV *, REGINFO *));
+u_int32_t __lock_region_mutex_count __P((DB_ENV *));
 int __lock_stat_pp __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
 int __lock_stat_print_pp __P((DB_ENV *, u_int32_t));
 int  __lock_stat_print __P((DB_ENV *, u_int32_t));
@@ -50,11 +58,8 @@ int __lock_set_timeout_internal __P((DB_ENV *, u_int32_t, db_timeout_t, u_int32_
 int __lock_inherit_timeout __P(( DB_ENV *, u_int32_t, u_int32_t));
 void __lock_expires __P((DB_ENV *, db_timeval_t *, db_timeout_t));
 int __lock_expired __P((DB_ENV *, db_timeval_t *, db_timeval_t *));
-int __lock_cmp __P((const DBT *, DB_LOCKOBJ *));
-int __lock_locker_cmp __P((u_int32_t, DB_LOCKER *));
 u_int32_t __lock_ohash __P((const DBT *));
 u_int32_t __lock_lhash __P((DB_LOCKOBJ *));
-u_int32_t __lock_locker_hash __P((u_int32_t));
 int __lock_nomem __P((DB_ENV *, const char *));
 
 #if defined(__cplusplus)
diff --git a/db/dbinc_auto/log_ext.h b/db/dbinc_auto/log_ext.h
index c1fbd211b..a231bc23e 100644
--- a/db/dbinc_auto/log_ext.h
+++ b/db/dbinc_auto/log_ext.h
@@ -8,35 +8,52 @@ extern "C" {
 
 int __log_open __P((DB_ENV *));
 int __log_find __P((DB_LOG *, int, u_int32_t *, logfile_validity *));
-int __log_valid __P((DB_LOG *, u_int32_t, int, DB_FH **, u_int32_t, logfile_validity *));
+int __log_valid __P((DB_LOG *, u_int32_t, int, DB_FH **, u_int32_t, logfile_validity *, u_int32_t *));
 int __log_dbenv_refresh __P((DB_ENV *));
-void __log_get_cached_ckp_lsn __P((DB_ENV *, DB_LSN *));
-void __log_region_destroy __P((DB_ENV *, REGINFO *));
+int __log_get_cached_ckp_lsn __P((DB_ENV *, DB_LSN *));
+u_int32_t __log_region_mutex_count __P((DB_ENV *));
 int __log_vtruncate __P((DB_ENV *, DB_LSN *, DB_LSN *, DB_LSN *));
 int __log_is_outdated __P((DB_ENV *, u_int32_t, int *));
+int __log_zero __P((DB_ENV *, DB_LSN *, DB_LSN *));
 int __log_inmem_lsnoff __P((DB_LOG *, DB_LSN *, size_t *));
 int __log_inmem_newfile __P((DB_LOG *, u_int32_t));
 int __log_inmem_chkspace __P((DB_LOG *, size_t));
 void __log_inmem_copyout __P((DB_LOG *, size_t, void *, size_t));
 void __log_inmem_copyin __P((DB_LOG *, size_t, void *, size_t));
+void __log_set_version __P((DB_ENV *, u_int32_t));
+int __log_get_oldversion __P((DB_ENV *, u_int32_t *));
 int __log_archive_pp __P((DB_ENV *, char **[], u_int32_t));
+int __log_get_stable_lsn __P((DB_ENV *, DB_LSN *));
 void __log_autoremove __P((DB_ENV *));
+int __log_check_page_lsn __P((DB_ENV *, DB *, DB_LSN *));
+int __log_printf_capi __P((DB_ENV *, DB_TXN *, const char *, ...)) __attribute__ ((__format__ (__printf__, 3, 4)));
+int __log_printf_pp __P((DB_ENV *, DB_TXN *, const char *, va_list));
+int __log_printf __P((DB_ENV *, DB_TXN *, const char *, ...)) __attribute__ ((__format__ (__printf__, 3, 4)));
 int __log_cursor_pp __P((DB_ENV *, DB_LOGC **, u_int32_t));
 int __log_cursor __P((DB_ENV *, DB_LOGC **));
 int __log_c_close __P((DB_LOGC *));
+int __log_c_version __P((DB_LOGC *, u_int32_t *));
 int __log_c_get __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
-void __log_dbenv_create __P((DB_ENV *));
+int __log_rep_split __P((DB_ENV *, REP_CONTROL *, DBT *, DB_LSN *, DB_LSN *));
+int __log_dbenv_create __P((DB_ENV *));
+void __log_dbenv_destroy __P((DB_ENV *));
+int __log_get_lg_bsize __P((DB_ENV *, u_int32_t *));
 int __log_set_lg_bsize __P((DB_ENV *, u_int32_t));
+int __log_get_lg_filemode __P((DB_ENV *, int *));
+int __log_set_lg_filemode __P((DB_ENV *, int));
+int __log_get_lg_max __P((DB_ENV *, u_int32_t *));
 int __log_set_lg_max __P((DB_ENV *, u_int32_t));
+int __log_get_lg_regionmax __P((DB_ENV *, u_int32_t *));
 int __log_set_lg_regionmax __P((DB_ENV *, u_int32_t));
+int __log_get_lg_dir __P((DB_ENV *, const char **));
 int __log_set_lg_dir __P((DB_ENV *, const char *));
 void __log_get_flags __P((DB_ENV *, u_int32_t *));
 void __log_set_flags __P((DB_ENV *, u_int32_t, int));
 int __log_check_sizes __P((DB_ENV *, u_int32_t, u_int32_t));
 int __log_put_pp __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
 int __log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
-void __log_txn_lsn __P((DB_ENV *, DB_LSN *, u_int32_t *, u_int32_t *));
-int __log_newfile __P((DB_LOG *, DB_LSN *, u_int32_t));
+int __log_current_lsn __P((DB_ENV *, DB_LSN *, u_int32_t *, u_int32_t *));
+int __log_newfile __P((DB_LOG *, DB_LSN *, u_int32_t, u_int32_t));
 int __log_flush_pp __P((DB_ENV *, const DB_LSN *));
 int __log_flush __P((DB_ENV *, const DB_LSN *));
 int __log_flush_int __P((DB_LOG *, const DB_LSN *, int));
diff --git a/db/dbinc_auto/mp_ext.h b/db/dbinc_auto/mp_ext.h
index ada970431..13e6b1be1 100644
--- a/db/dbinc_auto/mp_ext.h
+++ b/db/dbinc_auto/mp_ext.h
@@ -7,15 +7,16 @@ extern "C" {
 #endif
 
 int __memp_alloc __P((DB_MPOOL *, REGINFO *, MPOOLFILE *, size_t, roff_t *, void *));
+void __memp_free __P((REGINFO *, MPOOLFILE *, void *));
 #ifdef DIAGNOSTIC
-void __memp_check_order __P((DB_MPOOL_HASH *));
+void __memp_check_order __P((DB_ENV *, DB_MPOOL_HASH *));
 #endif
 int __memp_bhwrite __P((DB_MPOOL *, DB_MPOOL_HASH *, MPOOLFILE *, BH *, int));
-int __memp_pgread __P((DB_MPOOLFILE *, DB_MUTEX *, BH *, int));
+int __memp_pgread __P((DB_MPOOLFILE *, DB_MPOOL_HASH *, BH *, int));
 int __memp_pg __P((DB_MPOOLFILE *, BH *, int));
-void __memp_bhfree __P((DB_MPOOL *, DB_MPOOL_HASH *, BH *, u_int32_t));
-int __memp_fget_pp __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *));
-int __memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *));
+int __memp_bhfree __P((DB_MPOOL *, DB_MPOOL_HASH *, BH *, u_int32_t));
+int __memp_fget_pp __P((DB_MPOOLFILE *, db_pgno_t *, DB_TXN *, u_int32_t, void *));
+int __memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, DB_TXN *, u_int32_t, void *));
 int __memp_fcreate_pp __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
 int __memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **));
 int __memp_set_clear_len __P((DB_MPOOLFILE *, u_int32_t));
@@ -27,7 +28,7 @@ int __memp_get_ftype __P((DB_MPOOLFILE *, int *));
 int __memp_set_ftype __P((DB_MPOOLFILE *, int));
 int __memp_set_lsn_offset __P((DB_MPOOLFILE *, int32_t));
 int __memp_set_pgcookie __P((DB_MPOOLFILE *, DBT *));
-void __memp_last_pgno __P((DB_MPOOLFILE *, db_pgno_t *));
+int __memp_last_pgno __P((DB_MPOOLFILE *, db_pgno_t *));
 char * __memp_fn __P((DB_MPOOLFILE *));
 char * __memp_fns __P((DB_MPOOL *, MPOOLFILE *));
 int __memp_fopen_pp __P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t));
@@ -35,35 +36,51 @@ int __memp_fopen __P((DB_MPOOLFILE *, MPOOLFILE *, const char *, u_int32_t, int,
 int __memp_fclose_pp __P((DB_MPOOLFILE *, u_int32_t));
 int __memp_fclose __P((DB_MPOOLFILE *, u_int32_t));
 int __memp_mf_discard __P((DB_MPOOL *, MPOOLFILE *));
+int __memp_inmemlist __P((DB_ENV *, char ***, int *));
 int __memp_fput_pp __P((DB_MPOOLFILE *, void *, u_int32_t));
 int __memp_fput __P((DB_MPOOLFILE *, void *, u_int32_t));
 int __memp_fset_pp __P((DB_MPOOLFILE *, void *, u_int32_t));
 int __memp_fset __P((DB_MPOOLFILE *, void *, u_int32_t));
-void __memp_dbenv_create __P((DB_ENV *));
+int __memp_dirty __P((DB_MPOOLFILE *, void *, DB_TXN *, u_int32_t));
+int __memp_dbenv_create __P((DB_ENV *));
+void __memp_dbenv_destroy __P((DB_ENV *));
 int __memp_get_cachesize __P((DB_ENV *, u_int32_t *, u_int32_t *, int *));
 int __memp_set_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int));
+int __memp_get_mp_max_openfd __P((DB_ENV *, int *));
 int __memp_set_mp_max_openfd __P((DB_ENV *, int));
+int __memp_get_mp_max_write __P((DB_ENV *, int *, int *));
 int __memp_set_mp_max_write __P((DB_ENV *, int, int));
+int __memp_get_mp_mmapsize __P((DB_ENV *, size_t *));
 int __memp_set_mp_mmapsize __P((DB_ENV *, size_t));
-int __memp_nameop __P((DB_ENV *, u_int8_t *, const char *, const char *, const char *));
-int __memp_get_refcnt __P((DB_ENV *, u_int8_t *, u_int32_t *));
+int __memp_nameop __P((DB_ENV *, u_int8_t *, const char *, const char *, const char *, int));
 int __memp_ftruncate __P((DB_MPOOLFILE *, db_pgno_t, u_int32_t));
+int __memp_alloc_freelist __P((DB_MPOOLFILE *, u_int32_t, db_pgno_t **));
+int __memp_free_freelist __P((DB_MPOOLFILE *));
+int __memp_get_freelist __P(( DB_MPOOLFILE *, u_int32_t *, db_pgno_t **));
+int __memp_extend_freelist __P(( DB_MPOOLFILE *, u_int32_t , db_pgno_t **));
+u_int32_t __memp_bh_priority __P((BH *));
+void __memp_bucket_reorder __P((DB_ENV *, DB_MPOOL_HASH *, BH *));
+int __memp_bh_settxn __P((DB_MPOOL *, MPOOLFILE *mfp, BH *, void *));
+int __memp_skip_curadj __P((DBC *, db_pgno_t));
+int __memp_bh_freeze __P((DB_MPOOL *, REGINFO *, DB_MPOOL_HASH *, BH *, int *));
+int __memp_bh_thaw __P((DB_MPOOL *, REGINFO *, DB_MPOOL_HASH *, BH *, BH *));
 int __memp_open __P((DB_ENV *));
+u_int32_t __memp_region_mutex_count __P((DB_ENV *));
 int __memp_dbenv_refresh __P((DB_ENV *));
-void __memp_region_destroy __P((DB_ENV *, REGINFO *));
 int __memp_register_pp __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_t, void *, DBT *), int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
 int __memp_register __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_t, void *, DBT *), int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
 int __memp_stat_pp __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
 int __memp_stat_print_pp __P((DB_ENV *, u_int32_t));
 int  __memp_stat_print __P((DB_ENV *, u_int32_t));
 void __memp_stat_hash __P((REGINFO *, MPOOL *, u_int32_t *));
+int __memp_walk_files __P((DB_ENV *, MPOOL *, int (*) __P((DB_ENV *, MPOOLFILE *, void *, u_int32_t *, u_int32_t)), void *, u_int32_t *, u_int32_t));
 int __memp_sync_pp __P((DB_ENV *, DB_LSN *));
 int __memp_sync __P((DB_ENV *, DB_LSN *));
 int __memp_fsync_pp __P((DB_MPOOLFILE *));
 int __memp_fsync __P((DB_MPOOLFILE *));
 int __mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **));
 int __memp_sync_int __P((DB_ENV *, DB_MPOOLFILE *, u_int32_t, db_sync_op, u_int32_t *));
-int __memp_mf_sync __P((DB_MPOOL *, MPOOLFILE *));
+int __memp_mf_sync __P((DB_MPOOL *, MPOOLFILE *, int));
 int __memp_trickle_pp __P((DB_ENV *, int, int *));
 
 #if defined(__cplusplus)
diff --git a/db/dbinc_auto/mutex_ext.h b/db/dbinc_auto/mutex_ext.h
index a40f04d55..7b06e67d1 100644
--- a/db/dbinc_auto/mutex_ext.h
+++ b/db/dbinc_auto/mutex_ext.h
@@ -6,28 +6,48 @@
 extern "C" {
 #endif
 
-int __db_fcntl_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
-int __db_fcntl_mutex_lock __P((DB_ENV *, DB_MUTEX *));
-int __db_fcntl_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
-int __db_fcntl_mutex_destroy __P((DB_MUTEX *));
-int __db_pthread_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
-int __db_pthread_mutex_lock __P((DB_ENV *, DB_MUTEX *));
-int __db_pthread_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
-int __db_pthread_mutex_destroy __P((DB_MUTEX *));
-int __db_tas_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
-int __db_tas_mutex_lock __P((DB_ENV *, DB_MUTEX *));
-int __db_tas_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
-int __db_tas_mutex_destroy __P((DB_MUTEX *));
-int __db_win32_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
-int __db_win32_mutex_lock __P((DB_ENV *, DB_MUTEX *));
-int __db_win32_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
-int __db_win32_mutex_destroy __P((DB_MUTEX *));
-int __db_mutex_setup __P((DB_ENV *, REGINFO *, void *, u_int32_t));
-void __db_mutex_free __P((DB_ENV *, REGINFO *, DB_MUTEX *));
-void __db_shreg_locks_clear __P((DB_MUTEX *, REGINFO *, REGMAINT *));
-void __db_shreg_locks_destroy __P((REGINFO *, REGMAINT *));
-int __db_shreg_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t, u_int32_t, REGINFO *, REGMAINT *));
-void __db_shreg_maintinit __P((REGINFO *, void *addr, size_t));
+int __mutex_alloc __P((DB_ENV *, int, u_int32_t, db_mutex_t *));
+int __mutex_alloc_int __P((DB_ENV *, int, int, u_int32_t, db_mutex_t *));
+int __mutex_free __P((DB_ENV *, db_mutex_t *));
+int __mutex_free_int __P((DB_ENV *, int, db_mutex_t *));
+int __mut_failchk __P((DB_ENV *));
+int __db_fcntl_mutex_init __P((DB_ENV *, db_mutex_t, u_int32_t));
+int __db_fcntl_mutex_lock __P((DB_ENV *, db_mutex_t));
+int __db_fcntl_mutex_unlock __P((DB_ENV *, db_mutex_t));
+int __db_fcntl_mutex_destroy __P((DB_ENV *, db_mutex_t));
+int __mutex_alloc_pp __P((DB_ENV *, u_int32_t, db_mutex_t *));
+int __mutex_free_pp __P((DB_ENV *, db_mutex_t));
+int __mutex_lock_pp __P((DB_ENV *, db_mutex_t));
+int __mutex_unlock_pp __P((DB_ENV *, db_mutex_t));
+int __mutex_get_align __P((DB_ENV *, u_int32_t *));
+int __mutex_set_align __P((DB_ENV *, u_int32_t));
+int __mutex_get_increment __P((DB_ENV *, u_int32_t *));
+int __mutex_set_increment __P((DB_ENV *, u_int32_t));
+int __mutex_get_max __P((DB_ENV *, u_int32_t *));
+int __mutex_set_max __P((DB_ENV *, u_int32_t));
+int __mutex_get_tas_spins __P((DB_ENV *, u_int32_t *));
+int __mutex_set_tas_spins __P((DB_ENV *, u_int32_t));
+int __db_pthread_mutex_init __P((DB_ENV *, db_mutex_t, u_int32_t));
+int __db_pthread_mutex_lock __P((DB_ENV *, db_mutex_t));
+int __db_pthread_mutex_unlock __P((DB_ENV *, db_mutex_t));
+int __db_pthread_mutex_destroy __P((DB_ENV *, db_mutex_t));
+int __mutex_open __P((DB_ENV *));
+int __mutex_dbenv_refresh __P((DB_ENV *));
+void __mutex_resource_return __P((DB_ENV *, REGINFO *));
+int __mutex_stat __P((DB_ENV *, DB_MUTEX_STAT **, u_int32_t));
+int __mutex_stat_print __P((DB_ENV *, u_int32_t));
+void __mutex_print_debug_single __P((DB_ENV *, const char *, db_mutex_t, u_int32_t));
+void __mutex_print_debug_stats __P((DB_ENV *, DB_MSGBUF *, db_mutex_t, u_int32_t));
+void __mutex_set_wait_info __P((DB_ENV *, db_mutex_t, u_int32_t *, u_int32_t *));
+void __mutex_clear __P((DB_ENV *, db_mutex_t));
+int __db_tas_mutex_init __P((DB_ENV *, db_mutex_t, u_int32_t));
+int __db_tas_mutex_lock __P((DB_ENV *, db_mutex_t));
+int __db_tas_mutex_unlock __P((DB_ENV *, db_mutex_t));
+int __db_tas_mutex_destroy __P((DB_ENV *, db_mutex_t));
+int __db_win32_mutex_init __P((DB_ENV *, db_mutex_t, u_int32_t));
+int __db_win32_mutex_lock __P((DB_ENV *, db_mutex_t));
+int __db_win32_mutex_unlock __P((DB_ENV *, db_mutex_t));
+int __db_win32_mutex_destroy __P((DB_ENV *, db_mutex_t));
 
 #if defined(__cplusplus)
 }
diff --git a/db/dbinc_auto/os_ext.h b/db/dbinc_auto/os_ext.h
index a26958501..2481c42b8 100644
--- a/db/dbinc_auto/os_ext.h
+++ b/db/dbinc_auto/os_ext.h
@@ -18,51 +18,60 @@ void __os_free __P((DB_ENV *, void *));
 void *__ua_memcpy __P((void *, const void *, size_t));
 void __os_clock __P((DB_ENV *, u_int32_t *, u_int32_t *));
 int __os_fs_notzero __P((void));
+int __os_support_direct_io __P((void));
+int __os_support_db_register __P((void));
+int __os_support_replication __P((void));
 int __os_dirlist __P((DB_ENV *, const char *, char ***, int *));
 void __os_dirfree __P((DB_ENV *, char **, int));
 int __os_get_errno_ret_zero __P((void));
 int __os_get_errno __P((void));
+int __os_get_neterr __P((void));
+int __os_get_syserr __P((void));
 void __os_set_errno __P((int));
+char *__os_strerror __P((int, char *, size_t));
+int __os_posix_err __P((int));
 int __os_fileid __P((DB_ENV *, const char *, int, u_int8_t *));
+int __os_fdlock __P((DB_ENV *, DB_FH *, off_t, int, int));
 int __os_fsync __P((DB_ENV *, DB_FH *));
+int __os_zerofill __P((DB_ENV *, DB_FH *));
+int __os_getenv __P((DB_ENV *, const char *, char **, size_t));
 int __os_openhandle __P((DB_ENV *, const char *, int, int, DB_FH **));
 int __os_closehandle __P((DB_ENV *, DB_FH *));
-void __os_id __P((u_int32_t *));
-void __os_unique_id __P((DB_ENV *, u_int32_t *));
 int __os_r_sysattach __P((DB_ENV *, REGINFO *, REGION *));
 int __os_r_sysdetach __P((DB_ENV *, REGINFO *, int));
 int __os_mapfile __P((DB_ENV *, char *, DB_FH *, size_t, int, void **));
 int __os_unmapfile __P((DB_ENV *, void *, size_t));
+int __os_mkdir __P((DB_ENV *, const char *, int));
 u_int32_t __db_oflags __P((int));
 int __db_omode __P((const char *));
-int __db_shm_mode __P((DB_ENV *));
-int __os_have_direct __P((void));
 int __os_open __P((DB_ENV *, const char *, u_int32_t, int, DB_FH **));
 int __os_open_extend __P((DB_ENV *, const char *, u_int32_t, u_int32_t, int, DB_FH **));
 #ifdef HAVE_QNX
 int __os_shmname __P((DB_ENV *, const char *, char **));
 #endif
+void __os_id __P((DB_ENV *, pid_t *, db_threadid_t*));
 int __os_r_attach __P((DB_ENV *, REGINFO *, REGION *));
 int __os_r_detach __P((DB_ENV *, REGINFO *, int));
 int __os_rename __P((DB_ENV *, const char *, const char *, u_int32_t));
 int __os_isroot __P((void));
 char *__db_rpath __P((const char *));
-int __os_io __P((DB_ENV *, int, DB_FH *, db_pgno_t, u_int32_t, u_int8_t *, size_t *));
+int __os_io __P((DB_ENV *, int, DB_FH *, db_pgno_t, u_int32_t, u_int32_t, u_int32_t, u_int8_t *, size_t *));
 int __os_read __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
 int __os_write __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
-int __os_seek __P((DB_ENV *, DB_FH *, u_int32_t, db_pgno_t, u_int32_t, int, DB_OS_SEEK));
+int __os_physwrite __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
+int __os_seek __P((DB_ENV *, DB_FH *, db_pgno_t, u_int32_t, u_int32_t));
 void __os_sleep __P((DB_ENV *, u_long, u_long));
-void __os_spin __P((DB_ENV *));
-void __os_yield __P((DB_ENV*, u_long));
-int __os_exists __P((const char *, int *));
+u_int32_t __os_spin __P((DB_ENV *));
+int __os_exists __P((DB_ENV *, const char *, int *));
 int __os_ioinfo __P((DB_ENV *, const char *, DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *));
 int __os_tmpdir __P((DB_ENV *, u_int32_t));
 int __os_truncate __P((DB_ENV *, DB_FH *, db_pgno_t, u_int32_t));
+void __os_unique_id __P((DB_ENV *, u_int32_t *));
 int __os_region_unlink __P((DB_ENV *, const char *));
 int __os_unlink __P((DB_ENV *, const char *));
+void __os_yield __P((DB_ENV *));
 int __os_is_winnt __P((void));
-int __os_have_direct __P((void));
-int __os_unlink __P((DB_ENV *, const char *));
+int __os_get_neterr __P((void));
 
 #if defined(__cplusplus)
 }
diff --git a/db/dbinc_auto/qam_auto.h b/db/dbinc_auto/qam_auto.h
index 655c6d028..3b80956a2 100644
--- a/db/dbinc_auto/qam_auto.h
+++ b/db/dbinc_auto/qam_auto.h
@@ -5,7 +5,7 @@
 #define	DB___qam_incfirst	84
 typedef struct ___qam_incfirst_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	db_recno_t	recno;
@@ -15,7 +15,7 @@ typedef struct ___qam_incfirst_args {
 #define	DB___qam_mvptr	85
 typedef struct ___qam_mvptr_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	opcode;
 	int32_t	fileid;
@@ -30,7 +30,7 @@ typedef struct ___qam_mvptr_args {
 #define	DB___qam_del	79
 typedef struct ___qam_del_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	DB_LSN	lsn;
@@ -42,7 +42,7 @@ typedef struct ___qam_del_args {
 #define	DB___qam_add	80
 typedef struct ___qam_add_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	DB_LSN	lsn;
@@ -57,7 +57,7 @@ typedef struct ___qam_add_args {
 #define	DB___qam_delext	83
 typedef struct ___qam_delext_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	int32_t	fileid;
 	DB_LSN	lsn;
diff --git a/db/dbinc_auto/qam_ext.h b/db/dbinc_auto/qam_ext.h
index 98ca31c03..4c0571f1d 100644
--- a/db/dbinc_auto/qam_ext.h
+++ b/db/dbinc_auto/qam_ext.h
@@ -6,12 +6,13 @@
 extern "C" {
 #endif
 
-int __qam_position __P((DBC *, db_recno_t *, qam_position_mode, int *));
+int __qam_position __P((DBC *, db_recno_t *, db_lockmode_t, u_int32_t, int *));
 int __qam_pitem __P((DBC *,  QPAGE *, u_int32_t, db_recno_t, DBT *));
 int __qam_append __P((DBC *, DBT *, DBT *));
 int __qam_c_dup __P((DBC *, DBC *));
 int __qam_c_init __P((DBC *));
 int __qam_truncate __P((DBC *, u_int32_t *));
+int __qam_delete __P((DBC *,  DBT *));
 int __qam_incfirst_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_recno_t, db_pgno_t));
 int __qam_incfirst_read __P((DB_ENV *, void *, __qam_incfirst_args **));
 int __qam_mvptr_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_recno_t, db_recno_t, db_recno_t, db_recno_t, DB_LSN *, db_pgno_t));
@@ -31,7 +32,7 @@ int __qam_delext_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __qam_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
 int __qam_mswap __P((PAGE *));
 int __qam_pgin_out __P((DB_ENV *, db_pgno_t, void *, DBT *));
-int __qam_fprobe __P((DB *, db_pgno_t, void *, qam_probe_mode, u_int32_t));
+int __qam_fprobe __P((DB *, db_pgno_t, DB_TXN *, void *, qam_probe_mode, u_int32_t));
 int __qam_fclose __P((DB *, db_pgno_t));
 int __qam_fremove __P((DB *, db_pgno_t));
 int __qam_sync __P((DB *));
diff --git a/db/dbinc_auto/rep_auto.h b/db/dbinc_auto/rep_auto.h
index 5e8b7818c..4a566e3da 100644
--- a/db/dbinc_auto/rep_auto.h
+++ b/db/dbinc_auto/rep_auto.h
@@ -4,14 +4,15 @@
 #define	__rep_AUTO_H
 typedef struct ___rep_update_args {
 	DB_LSN	first_lsn;
-	int	num_files;
+	u_int32_t	first_vers;
+	u_int32_t	num_files;
 } __rep_update_args;
 
 typedef struct ___rep_fileinfo_args {
-	size_t	pgsize;
+	u_int32_t	pgsize;
 	db_pgno_t	pgno;
 	db_pgno_t	max_pgno;
-	int	filenum;
+	u_int32_t	filenum;
 	int32_t	id;
 	u_int32_t	type;
 	u_int32_t	flags;
diff --git a/db/dbinc_auto/rep_ext.h b/db/dbinc_auto/rep_ext.h
index 13486c735..9430a895c 100644
--- a/db/dbinc_auto/rep_ext.h
+++ b/db/dbinc_auto/rep_ext.h
@@ -6,52 +6,89 @@
 extern "C" {
 #endif
 
-int __rep_update_buf __P((u_int8_t *, size_t, size_t *, DB_LSN *, int));
+int __rep_update_buf __P((u_int8_t *, size_t, size_t *, DB_LSN *, u_int32_t, u_int32_t));
 int __rep_update_read __P((DB_ENV *, void *, void **, __rep_update_args **));
-int __rep_fileinfo_buf __P((u_int8_t *, size_t, size_t *, size_t, db_pgno_t, db_pgno_t, int, int32_t, u_int32_t, u_int32_t, const DBT *, const DBT *));
+int __rep_fileinfo_buf __P((u_int8_t *, size_t, size_t *, u_int32_t, db_pgno_t, db_pgno_t, u_int32_t, int32_t, u_int32_t, u_int32_t, const DBT *, const DBT *));
 int __rep_fileinfo_read __P((DB_ENV *, void *, void **, __rep_fileinfo_args **));
 int __rep_update_req __P((DB_ENV *, int));
 int __rep_page_req __P((DB_ENV *, int, DBT *));
 int __rep_update_setup __P((DB_ENV *, int, REP_CONTROL *, DBT *));
+int __rep_bulk_page __P((DB_ENV *, int, REP_CONTROL *, DBT *));
 int __rep_page __P((DB_ENV *, int, REP_CONTROL *, DBT *));
 int __rep_page_fail __P((DB_ENV *, int, DBT *));
-int __rep_pggap_req __P((DB_ENV *, REP *, __rep_fileinfo_args *, int));
-void __rep_loggap_req __P((DB_ENV *, REP *, DB_LSN *, int));
+int __rep_init_cleanup __P((DB_ENV *, REP *, int));
+int __rep_pggap_req __P((DB_ENV *, REP *, __rep_fileinfo_args *, u_int32_t));
 int __rep_finfo_alloc __P((DB_ENV *, __rep_fileinfo_args *, __rep_fileinfo_args **));
-void __rep_dbenv_create __P((DB_ENV *));
-int __rep_open __P((DB_ENV *));
-int __rep_client_dbinit __P((DB_ENV *, int, repdb_t));
+int __rep_elect __P((DB_ENV *, int, int, int *, u_int32_t));
+int __rep_vote1 __P((DB_ENV *, REP_CONTROL *, DBT *, int *));
+int __rep_vote2 __P((DB_ENV *, DBT *, int *));
 void __rep_elect_master __P((DB_ENV *, REP *, int *));
+int __rep_allreq __P((DB_ENV *, REP_CONTROL *, int));
+int __rep_log __P((DB_ENV *, REP_CONTROL *, DBT *, time_t, DB_LSN *));
+int __rep_bulk_log __P((DB_ENV *, REP_CONTROL *, DBT *, time_t, DB_LSN *));
+int __rep_logreq __P((DB_ENV *, REP_CONTROL *, DBT *, int));
+int __rep_loggap_req __P((DB_ENV *, REP *, DB_LSN *, u_int32_t));
+int __rep_logready __P((DB_ENV *, REP *, time_t, DB_LSN *));
+int __rep_dbenv_create __P((DB_ENV *));
+void __rep_dbenv_destroy __P((DB_ENV *));
+int __rep_get_config __P((DB_ENV *, u_int32_t, int *));
+int __rep_set_config __P((DB_ENV *, u_int32_t, int));
+int __rep_start __P((DB_ENV *, DBT *, u_int32_t));
+int __rep_client_dbinit __P((DB_ENV *, int, repdb_t));
+int __rep_get_limit __P((DB_ENV *, u_int32_t *, u_int32_t *));
+int __rep_set_limit __P((DB_ENV *, u_int32_t, u_int32_t));
+int __rep_set_nsites __P((DB_ENV *, int));
+int __rep_get_nsites __P((DB_ENV *, int *));
+int __rep_set_priority __P((DB_ENV *, int));
+int __rep_get_priority __P((DB_ENV *, int *));
+int __rep_set_timeout __P((DB_ENV *, int, db_timeout_t));
+int __rep_get_timeout __P((DB_ENV *, int, db_timeout_t *));
+int __rep_get_request __P((DB_ENV *, u_int32_t *, u_int32_t *));
+int __rep_set_request __P((DB_ENV *, u_int32_t, u_int32_t));
+int __rep_set_transport __P((DB_ENV *, int, int (*)(DB_ENV *, const DBT *, const DBT *, const DB_LSN *, int, u_int32_t)));
+int __rep_flush __P((DB_ENV *));
+int __rep_sync __P((DB_ENV *, u_int32_t));
 int __rep_process_message __P((DB_ENV *, DBT *, DBT *, int *, DB_LSN *));
+int __rep_apply __P((DB_ENV *, REP_CONTROL *, DBT *, DB_LSN *, int *, DB_LSN *));
 int __rep_process_txn __P((DB_ENV *, DBT *));
-int __rep_tally __P((DB_ENV *, REP *, int, int *, u_int32_t, roff_t));
-void __rep_cmp_vote __P((DB_ENV *, REP *, int *, DB_LSN *, int, u_int32_t, u_int32_t));
-int __rep_cmp_vote2 __P((DB_ENV *, REP *, int, u_int32_t));
 int __rep_check_doreq __P((DB_ENV *, REP *));
-void __rep_lockout __P((DB_ENV *, DB_REP *, REP *, u_int32_t));
-int __rep_region_init __P((DB_ENV *));
+int __rep_open __P((DB_ENV *));
 int __rep_region_destroy __P((DB_ENV *));
 void __rep_dbenv_refresh __P((DB_ENV *));
-int __rep_dbenv_close __P((DB_ENV *));
-int __rep_preclose __P((DB_ENV *, int));
+int __rep_close __P((DB_ENV *));
+int __rep_preclose __P((DB_ENV *));
+int __rep_closefiles __P((DB_ENV *));
 int __rep_write_egen __P((DB_ENV *, u_int32_t));
 int __rep_stat_pp __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
 int __rep_stat_print_pp __P((DB_ENV *, u_int32_t));
 int __rep_stat_print __P((DB_ENV *, u_int32_t));
-int __rep_send_message __P((DB_ENV *, int, u_int32_t, DB_LSN *, const DBT *, u_int32_t));
+int __rep_bulk_message __P((DB_ENV *, REP_BULK *, REP_THROTTLE *, DB_LSN *, const DBT *, u_int32_t));
+int __rep_send_bulk __P((DB_ENV *, REP_BULK *, u_int32_t));
+int __rep_bulk_alloc __P((DB_ENV *, REP_BULK *, int, uintptr_t *, u_int32_t *, u_int32_t));
+int __rep_bulk_free __P((DB_ENV *, REP_BULK *, u_int32_t));
+int __rep_send_message __P((DB_ENV *, int, u_int32_t, DB_LSN *, const DBT *, u_int32_t, u_int32_t));
 int __rep_new_master __P((DB_ENV *, REP_CONTROL *, int));
-int __rep_is_client __P((DB_ENV *));
 int __rep_noarchive __P((DB_ENV *));
-void __rep_send_vote __P((DB_ENV *, DB_LSN *, int, int, int, u_int32_t, u_int32_t, int, u_int32_t));
+void __rep_send_vote __P((DB_ENV *, DB_LSN *, int, int, int, u_int32_t, u_int32_t, int, u_int32_t, u_int32_t));
 void __rep_elect_done __P((DB_ENV *, REP *));
 int __rep_grow_sites __P((DB_ENV *dbenv, int nsites));
-void __env_rep_enter __P((DB_ENV *));
-void __env_db_rep_exit __P((DB_ENV *));
+int __env_rep_enter __P((DB_ENV *, int));
+int __env_db_rep_exit __P((DB_ENV *));
 int __db_rep_enter __P((DB *, int, int, int));
-void __op_rep_enter __P((DB_ENV *));
-void __op_rep_exit __P((DB_ENV *));
-void __rep_get_gen __P((DB_ENV *, u_int32_t *));
-void __rep_print_message __P((DB_ENV *, int, REP_CONTROL *, char *));
+int __op_rep_enter __P((DB_ENV *));
+int __op_rep_exit __P((DB_ENV *));
+int __rep_get_gen __P((DB_ENV *, u_int32_t *));
+int __rep_lockout_api __P((DB_ENV *, REP *));
+int __rep_lockout_msg __P((DB_ENV *, REP *, u_int32_t));
+int __rep_send_throttle __P((DB_ENV *, int, REP_THROTTLE *, u_int32_t));
+u_int32_t __rep_msg_to_old __P((u_int32_t, u_int32_t));
+u_int32_t __rep_msg_from_old __P((u_int32_t, u_int32_t));
+void __rep_print_message __P((DB_ENV *, int, REP_CONTROL *, char *, u_int32_t));
+int __rep_verify __P((DB_ENV *, REP_CONTROL *, DBT *, int, time_t));
+int __rep_verify_fail __P((DB_ENV *, REP_CONTROL *, int));
+int __rep_verify_req __P((DB_ENV *, REP_CONTROL *, int));
+int __rep_verify_match __P((DB_ENV *, DB_LSN *, time_t));
+int __rep_log_backup __P((DB_ENV *, REP *, DB_LOGC *, DB_LSN *));
 
 #if defined(__cplusplus)
 }
diff --git a/db/dbinc_auto/repmgr_ext.h b/db/dbinc_auto/repmgr_ext.h
new file mode 100644
index 000000000..78979b987
--- /dev/null
+++ b/db/dbinc_auto/repmgr_ext.h
@@ -0,0 +1,87 @@
+/* DO NOT EDIT: automatically built by dist/s_include. */
+#ifndef	_repmgr_ext_h_
+#define	_repmgr_ext_h_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+int __repmgr_init_election __P((DB_ENV *, int));
+int __repmgr_become_master __P((DB_ENV *));
+int __repmgr_start __P((DB_ENV *, int, u_int32_t));
+int __repmgr_close __P((DB_ENV *));
+int __repmgr_set_ack_policy __P((DB_ENV *, int));
+int __repmgr_get_ack_policy __P((DB_ENV *, int *));
+int __repmgr_dbenv_create __P((DB_ENV *, DB_REP *));
+void __repmgr_dbenv_destroy __P((DB_ENV *, DB_REP *));
+int __repmgr_stop_threads __P((DB_ENV *));
+int __repmgr_set_local_site __P((DB_ENV *, const char *, u_int, u_int32_t));
+int __repmgr_add_remote_site __P((DB_ENV *, const char *, u_int, int *, u_int32_t));
+void *__repmgr_msg_thread __P((void *));
+int __repmgr_stash_generation __P((DB_ENV *));
+int __repmgr_send __P((DB_ENV *, const DBT *, const DBT *, const DB_LSN *, int, u_int32_t));
+int __repmgr_send_one __P((DB_ENV *, REPMGR_CONNECTION *, u_int, const DBT *, const DBT *));
+int __repmgr_is_permanent __P((DB_ENV *, const DB_LSN *));
+int __repmgr_bust_connection __P((DB_ENV *, REPMGR_CONNECTION *, int));
+void __repmgr_cleanup_connection __P((DB_ENV *, REPMGR_CONNECTION *));
+int __repmgr_find_site __P((DB_ENV *, const char *, u_int));
+int __repmgr_pack_netaddr __P((DB_ENV *, const char *, u_int, ADDRINFO *, repmgr_netaddr_t *));
+int __repmgr_getaddr __P((DB_ENV *, const char *, u_int, int, ADDRINFO **));
+int __repmgr_add_site __P((DB_ENV *, const char *, u_int, REPMGR_SITE **));
+int __repmgr_net_create __P((DB_ENV *, DB_REP *));
+int __repmgr_listen __P((DB_ENV *));
+int __repmgr_net_close __P((DB_ENV *));
+void __repmgr_net_destroy __P((DB_ENV *, DB_REP *));
+int __repmgr_thread_start __P((DB_ENV *, REPMGR_RUNNABLE *));
+int __repmgr_thread_join __P((REPMGR_RUNNABLE *));
+int __repmgr_set_nonblocking __P((socket_t));
+int __repmgr_wake_waiting_senders __P((DB_ENV *));
+int __repmgr_await_ack __P((DB_ENV *, const DB_LSN *));
+void __repmgr_compute_wait_deadline __P((DB_ENV*, struct timespec *, db_timeout_t));
+int __repmgr_init_sync __P((DB_ENV *, DB_REP *));
+int __repmgr_close_sync __P((DB_ENV *));
+int __repmgr_net_init __P((DB_ENV *, DB_REP *));
+int __repmgr_lock_mutex __P((mgr_mutex_t *));
+int __repmgr_unlock_mutex __P((mgr_mutex_t *));
+int __repmgr_signal __P((cond_var_t *));
+int __repmgr_wake_main_thread __P((DB_ENV*));
+int __repmgr_writev __P((socket_t, db_iovec_t *, int, size_t *));
+int __repmgr_readv __P((socket_t, db_iovec_t *, int, size_t *));
+void __repmgr_timeval_diff_current __P((DB_ENV *, repmgr_timeval_t *, select_timeout_t *));
+int __repmgr_select_loop __P((DB_ENV *));
+int __repmgr_queue_create __P((DB_ENV *, DB_REP *));
+void __repmgr_queue_destroy __P((DB_ENV *));
+int __repmgr_queue_get __P((DB_ENV *, REPMGR_MESSAGE **));
+int __repmgr_queue_put __P((DB_ENV *, REPMGR_MESSAGE *));
+int __repmgr_queue_size __P((DB_ENV *));
+void *__repmgr_select_thread __P((void *));
+int __repmgr_accept __P((DB_ENV *));
+int __repmgr_retry_connections __P((DB_ENV *));
+int __repmgr_first_try_connections __P((DB_ENV *));
+int __repmgr_connect_site __P((DB_ENV *, u_int eid));
+int __repmgr_send_handshake __P((DB_ENV *, REPMGR_CONNECTION *));
+int __repmgr_read_from_site __P((DB_ENV *, REPMGR_CONNECTION *));
+int __repmgr_write_some __P((DB_ENV *, REPMGR_CONNECTION *));
+int __repmgr_site_list __P((DB_ENV *, u_int *, DB_REPMGR_SITE **));
+int __repmgr_print_stats __P((DB_ENV *));
+int __repmgr_schedule_connection_attempt __P((DB_ENV *, u_int, int));
+void __repmgr_reset_for_reading __P((REPMGR_CONNECTION *));
+int __repmgr_new_connection __P((DB_ENV *, REPMGR_CONNECTION **, socket_t, u_int32_t));
+int __repmgr_new_site __P((DB_ENV *, REPMGR_SITE**, const repmgr_netaddr_t *, int));
+void __repmgr_cleanup_netaddr __P((DB_ENV *, repmgr_netaddr_t *));
+void __repmgr_iovec_init __P((REPMGR_IOVECS *));
+void __repmgr_add_buffer __P((REPMGR_IOVECS *, void *, size_t));
+void __repmgr_add_dbt __P((REPMGR_IOVECS *, const DBT *));
+int __repmgr_update_consumed __P((REPMGR_IOVECS *, size_t));
+int __repmgr_prepare_my_addr __P((DB_ENV *, DBT *));
+int __repmgr_timeval_cmp __P((repmgr_timeval_t *, repmgr_timeval_t *));
+u_int __repmgr_get_nsites __P((DB_REP *));
+void __repmgr_thread_failure __P((DB_ENV *, int));
+char *__repmgr_format_eid_loc __P((DB_REP *, int, char *));
+char *__repmgr_format_site_loc __P((REPMGR_SITE *, char *));
+int __repmgr_wsa_init __P((DB_ENV *));
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* !_repmgr_ext_h_ */
diff --git a/db/dbinc_auto/rpc_client_ext.h b/db/dbinc_auto/rpc_client_ext.h
index b58047136..a578bbcd1 100644
--- a/db/dbinc_auto/rpc_client_ext.h
+++ b/db/dbinc_auto/rpc_client_ext.h
@@ -6,7 +6,7 @@
 extern "C" {
 #endif
 
-int __dbcl_envrpcserver __P((DB_ENV *, void *, const char *, long, long, u_int32_t));
+int __dbcl_env_set_rpc_server __P((DB_ENV *, void *, const char *, long, long, u_int32_t));
 int __dbcl_env_close_wrap __P((DB_ENV *, u_int32_t));
 int __dbcl_env_open_wrap __P((DB_ENV *, const char *, u_int32_t, int));
 int __dbcl_db_open_wrap __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int));
@@ -17,192 +17,88 @@ void __dbcl_txn_setup __P((DB_ENV *, DB_TXN *, DB_TXN *, u_int32_t));
 void __dbcl_c_refresh __P((DBC *));
 int __dbcl_c_setup __P((u_int, DB *, DBC **));
 int __dbcl_dbclose_common __P((DB *));
-int __dbcl_env_alloc __P((DB_ENV *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *)));
-int __dbcl_set_app_dispatch __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
-int __dbcl_env_get_cachesize __P((DB_ENV *, u_int32_t *, u_int32_t *, int *));
-int __dbcl_env_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int));
-int __dbcl_env_close __P((DB_ENV *, u_int32_t));
+int __dbcl_dbenv_illegal __P((DB_ENV *));
 int __dbcl_env_create __P((DB_ENV *, long));
-int __dbcl_get_data_dirs __P((DB_ENV *, const char ***));
-int __dbcl_set_data_dir __P((DB_ENV *, const char *));
+int __dbcl_env_cdsgroup_begin __P((DB_ENV *, DB_TXN **));
+int __dbcl_env_close __P((DB_ENV *, u_int32_t));
 int __dbcl_env_dbremove __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t));
 int __dbcl_env_dbrename __P((DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t));
+int __dbcl_env_get_cachesize __P((DB_ENV *, u_int32_t *, u_int32_t *, int *));
 int __dbcl_env_get_encrypt_flags __P((DB_ENV *, u_int32_t *));
-int __dbcl_env_encrypt __P((DB_ENV *, const char *, u_int32_t));
-int __dbcl_env_set_feedback __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
 int __dbcl_env_get_flags __P((DB_ENV *, u_int32_t *));
-int __dbcl_env_flags __P((DB_ENV *, u_int32_t, int));
-int __dbcl_get_lg_bsize __P((DB_ENV *, u_int32_t *));
-int __dbcl_set_lg_bsize __P((DB_ENV *, u_int32_t));
-int __dbcl_get_lg_dir __P((DB_ENV *, const char * *));
-int __dbcl_set_lg_dir __P((DB_ENV *, const char *));
-int __dbcl_get_lg_max __P((DB_ENV *, u_int32_t *));
-int __dbcl_set_lg_max __P((DB_ENV *, u_int32_t));
-int __dbcl_get_lg_regionmax __P((DB_ENV *, u_int32_t *));
-int __dbcl_set_lg_regionmax __P((DB_ENV *, u_int32_t));
-int __dbcl_get_lk_conflicts __P((DB_ENV *, const u_int8_t **, int *));
-int __dbcl_set_lk_conflict __P((DB_ENV *, u_int8_t *, int));
-int __dbcl_get_lk_detect __P((DB_ENV *, u_int32_t *));
-int __dbcl_set_lk_detect __P((DB_ENV *, u_int32_t));
-int __dbcl_set_lk_max __P((DB_ENV *, u_int32_t));
-int __dbcl_get_lk_max_locks __P((DB_ENV *, u_int32_t *));
-int __dbcl_set_lk_max_locks __P((DB_ENV *, u_int32_t));
-int __dbcl_get_lk_max_lockers __P((DB_ENV *, u_int32_t *));
-int __dbcl_set_lk_max_lockers __P((DB_ENV *, u_int32_t));
-int __dbcl_get_lk_max_objects __P((DB_ENV *, u_int32_t *));
-int __dbcl_set_lk_max_objects __P((DB_ENV *, u_int32_t));
-int __dbcl_get_mp_max_openfd __P((DB_ENV *, int *));
-int __dbcl_set_mp_max_openfd __P((DB_ENV *, int));
-int __dbcl_get_mp_max_write __P((DB_ENV *, int *, int *));
-int __dbcl_set_mp_max_write __P((DB_ENV *, int, int));
-int __dbcl_get_mp_mmapsize __P((DB_ENV *, size_t *));
-int __dbcl_set_mp_mmapsize __P((DB_ENV *, size_t));
 int __dbcl_env_get_home __P((DB_ENV *, const char * *));
 int __dbcl_env_get_open_flags __P((DB_ENV *, u_int32_t *));
 int __dbcl_env_open __P((DB_ENV *, const char *, u_int32_t, int));
-int __dbcl_env_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int)));
 int __dbcl_env_remove __P((DB_ENV *, const char *, u_int32_t));
-int __dbcl_get_shm_key __P((DB_ENV *, long *));
-int __dbcl_set_shm_key __P((DB_ENV *, long));
-int __dbcl_get_tas_spins __P((DB_ENV *, u_int32_t *));
-int __dbcl_set_tas_spins __P((DB_ENV *, u_int32_t));
-int __dbcl_get_timeout __P((DB_ENV *, u_int32_t *, u_int32_t));
-int __dbcl_set_timeout __P((DB_ENV *, u_int32_t, u_int32_t));
-int __dbcl_get_tmp_dir __P((DB_ENV *, const char * *));
-int __dbcl_set_tmp_dir __P((DB_ENV *, const char *));
-int __dbcl_get_tx_max __P((DB_ENV *, u_int32_t *));
-int __dbcl_set_tx_max __P((DB_ENV *, u_int32_t));
-int __dbcl_get_tx_timestamp __P((DB_ENV *, time_t *));
-int __dbcl_set_tx_timestamp __P((DB_ENV *, time_t *));
-int __dbcl_get_verbose __P((DB_ENV *, u_int32_t, int *));
-int __dbcl_set_verbose __P((DB_ENV *, u_int32_t, int));
-int __dbcl_txn_abort __P((DB_TXN *));
-int __dbcl_txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
-int __dbcl_txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
-int __dbcl_txn_commit __P((DB_TXN *, u_int32_t));
-int __dbcl_txn_discard __P((DB_TXN *, u_int32_t));
-int __dbcl_txn_prepare __P((DB_TXN *, u_int8_t *));
-int __dbcl_txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
-int __dbcl_txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
-int __dbcl_txn_timeout __P((DB_TXN *, u_int32_t, u_int32_t));
-int __dbcl_rep_elect __P((DB_ENV *, int, int, int, u_int32_t, int *, u_int32_t));
-int __dbcl_rep_flush __P((DB_ENV *));
-int __dbcl_rep_process_message __P((DB_ENV *, DBT *, DBT *, int *, DB_LSN *));
-int __dbcl_rep_get_limit __P((DB_ENV *, u_int32_t *, u_int32_t *));
-int __dbcl_rep_set_limit __P((DB_ENV *, u_int32_t, u_int32_t));
-int __dbcl_rep_set_request __P((DB_ENV *, u_int32_t, u_int32_t));
-int __dbcl_rep_set_rep_transport __P((DB_ENV *, int, int (*)(DB_ENV *, const DBT *, const DBT *, const DB_LSN *, int, u_int32_t)));
-int __dbcl_rep_start __P((DB_ENV *, DBT *, u_int32_t));
-int __dbcl_rep_stat __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
-int __dbcl_db_alloc __P((DB *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *)));
+int __dbcl_env_set_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int));
+int __dbcl_env_set_encrypt __P((DB_ENV *, const char *, u_int32_t));
+int __dbcl_env_set_flags __P((DB_ENV *, u_int32_t, int));
+int __dbcl_env_txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
+int __dbcl_env_txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
+int __dbcl_db_create __P((DB *, DB_ENV *, u_int32_t));
 int __dbcl_db_associate __P((DB *, DB_TXN *, DB *, int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
-int __dbcl_db_bt_compare __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
-int __dbcl_db_bt_maxkey __P((DB *, u_int32_t));
-int __dbcl_db_get_bt_minkey __P((DB *, u_int32_t *));
-int __dbcl_db_bt_minkey __P((DB *, u_int32_t));
-int __dbcl_db_bt_prefix __P((DB *, size_t(*)(DB *, const DBT *, const DBT *)));
-int __dbcl_db_set_append_recno __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
-int __dbcl_db_get_cachesize __P((DB *, u_int32_t *, u_int32_t *, int *));
-int __dbcl_db_cachesize __P((DB *, u_int32_t, u_int32_t, int));
 int __dbcl_db_close __P((DB *, u_int32_t));
-int __dbcl_db_create __P((DB *, DB_ENV *, u_int32_t));
+int __dbcl_db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
 int __dbcl_db_del __P((DB *, DB_TXN *, DBT *, u_int32_t));
-int __dbcl_db_dup_compare __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
+int __dbcl_db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+int __dbcl_db_get_bt_minkey __P((DB *, u_int32_t *));
+int __dbcl_db_get_dbname __P((DB *, const char * *, const char * *));
 int __dbcl_db_get_encrypt_flags __P((DB *, u_int32_t *));
-int __dbcl_db_encrypt __P((DB *, const char *, u_int32_t));
-int __dbcl_db_get_extentsize __P((DB *, u_int32_t *));
-int __dbcl_db_extentsize __P((DB *, u_int32_t));
-int __dbcl_db_fd __P((DB *, int *));
-int __dbcl_db_feedback __P((DB *, void (*)(DB *, int, int)));
 int __dbcl_db_get_flags __P((DB *, u_int32_t *));
-int __dbcl_db_flags __P((DB *, u_int32_t));
-int __dbcl_db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-int __dbcl_db_get_name __P((DB *, const char * *, const char * *));
-int __dbcl_db_get_open_flags __P((DB *, u_int32_t *));
 int __dbcl_db_get_h_ffactor __P((DB *, u_int32_t *));
-int __dbcl_db_h_ffactor __P((DB *, u_int32_t));
-int __dbcl_db_h_hash __P((DB *, u_int32_t(*)(DB *, const void *, u_int32_t)));
 int __dbcl_db_get_h_nelem __P((DB *, u_int32_t *));
-int __dbcl_db_h_nelem __P((DB *, u_int32_t));
-int __dbcl_db_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
 int __dbcl_db_get_lorder __P((DB *, int *));
-int __dbcl_db_lorder __P((DB *, int));
-int __dbcl_db_open __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int));
+int __dbcl_db_get_open_flags __P((DB *, u_int32_t *));
 int __dbcl_db_get_pagesize __P((DB *, u_int32_t *));
-int __dbcl_db_pagesize __P((DB *, u_int32_t));
-int __dbcl_db_panic __P((DB *, void (*)(DB_ENV *, int)));
-int __dbcl_db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
-int __dbcl_db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+int __dbcl_db_get_q_extentsize __P((DB *, u_int32_t *));
 int __dbcl_db_get_re_delim __P((DB *, int *));
-int __dbcl_db_re_delim __P((DB *, int));
 int __dbcl_db_get_re_len __P((DB *, u_int32_t *));
-int __dbcl_db_re_len __P((DB *, u_int32_t));
-int __dbcl_db_re_pad __P((DB *, int));
 int __dbcl_db_get_re_pad __P((DB *, int *));
-int __dbcl_db_get_re_source __P((DB *, const char * *));
-int __dbcl_db_re_source __P((DB *, const char *));
+int __dbcl_db_join __P((DB *, DBC **, DBC **, u_int32_t));
+int __dbcl_db_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
+int __dbcl_db_open __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int));
+int __dbcl_db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
+int __dbcl_db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
 int __dbcl_db_remove __P((DB *, const char *, const char *, u_int32_t));
 int __dbcl_db_rename __P((DB *, const char *, const char *, const char *, u_int32_t));
+int __dbcl_db_set_bt_minkey __P((DB *, u_int32_t));
+int __dbcl_db_set_encrypt __P((DB *, const char *, u_int32_t));
+int __dbcl_db_set_flags __P((DB *, u_int32_t));
+int __dbcl_db_set_h_ffactor __P((DB *, u_int32_t));
+int __dbcl_db_set_h_nelem __P((DB *, u_int32_t));
+int __dbcl_db_set_lorder __P((DB *, int));
+int __dbcl_db_set_pagesize __P((DB *, u_int32_t));
+int __dbcl_db_set_q_extentsize __P((DB *, u_int32_t));
+int __dbcl_db_set_re_delim __P((DB *, int));
+int __dbcl_db_set_re_len __P((DB *, u_int32_t));
+int __dbcl_db_set_re_pad __P((DB *, int));
 int __dbcl_db_stat __P((DB *, DB_TXN *, void *, u_int32_t));
 int __dbcl_db_sync __P((DB *, u_int32_t));
 int __dbcl_db_truncate __P((DB *, DB_TXN *, u_int32_t  *, u_int32_t));
-int __dbcl_db_upgrade __P((DB *, const char *, u_int32_t));
-int __dbcl_db_verify __P((DB *, const char *, const char *, FILE *, u_int32_t));
-int __dbcl_db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
-int __dbcl_db_join __P((DB *, DBC **, DBC **, u_int32_t));
-int __dbcl_dbc_close __P((DBC *));
-int __dbcl_dbc_count __P((DBC *, db_recno_t *, u_int32_t));
-int __dbcl_dbc_del __P((DBC *, u_int32_t));
-int __dbcl_dbc_dup __P((DBC *, DBC **, u_int32_t));
-int __dbcl_dbc_get __P((DBC *, DBT *, DBT *, u_int32_t));
-int __dbcl_dbc_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
-int __dbcl_dbc_put __P((DBC *, DBT *, DBT *, u_int32_t));
-int __dbcl_lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, int *));
-int __dbcl_lock_get __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
-int __dbcl_lock_id __P((DB_ENV *, u_int32_t *));
-int __dbcl_lock_id_free __P((DB_ENV *, u_int32_t));
-int __dbcl_lock_put __P((DB_ENV *, DB_LOCK *));
-int __dbcl_lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
-int __dbcl_lock_vec __P((DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
-int __dbcl_log_archive __P((DB_ENV *, char ***, u_int32_t));
-int __dbcl_log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t));
-int __dbcl_log_file __P((DB_ENV *, const DB_LSN *, char *, size_t));
-int __dbcl_log_flush __P((DB_ENV *, const DB_LSN *));
-int __dbcl_log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
-int __dbcl_log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
-int __dbcl_memp_register __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_t, void *, DBT *), int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
-int __dbcl_memp_stat __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
-int __dbcl_memp_sync __P((DB_ENV *, DB_LSN *));
-int __dbcl_memp_trickle __P((DB_ENV *, int, int *));
-int __dbcl_memp_fget __P((DB_MPOOLFILE *, u_int32_t *, u_int32_t, void *));
-int __dbcl_memp_fopen __P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t));
-int __dbcl_memp_fput __P((DB_MPOOLFILE *, void *, u_int32_t));
-int __dbcl_memp_fset __P((DB_MPOOLFILE *, void *, u_int32_t));
-int __dbcl_memp_get_clear_len __P((DB_MPOOLFILE *, u_int32_t *));
-int __dbcl_memp_set_clear_len __P((DB_MPOOLFILE *, u_int32_t));
-int __dbcl_memp_get_fileid __P((DB_MPOOLFILE *, u_int8_t *));
-int __dbcl_memp_set_fileid __P((DB_MPOOLFILE *, u_int8_t *));
-int __dbcl_memp_get_flags __P((DB_MPOOLFILE *, u_int32_t *));
-int __dbcl_memp_set_flags __P((DB_MPOOLFILE *, u_int32_t, int));
-int __dbcl_memp_get_ftype __P((DB_MPOOLFILE *, int *));
-int __dbcl_memp_set_ftype __P((DB_MPOOLFILE *, int));
-int __dbcl_memp_get_lsn_offset __P((DB_MPOOLFILE *, int32_t *));
-int __dbcl_memp_set_lsn_offset __P((DB_MPOOLFILE *, int32_t));
-int __dbcl_memp_get_maxsize __P((DB_MPOOLFILE *, u_int32_t *, u_int32_t *));
-int __dbcl_memp_set_maxsize __P((DB_MPOOLFILE *, u_int32_t, u_int32_t));
-int __dbcl_memp_get_pgcookie __P((DB_MPOOLFILE *, DBT *));
-int __dbcl_memp_set_pgcookie __P((DB_MPOOLFILE *, DBT *));
-int __dbcl_memp_get_priority __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY *));
-int __dbcl_memp_set_priority __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY));
-int __dbcl_memp_fsync __P((DB_MPOOLFILE *));
+int __dbcl_dbc_c_close __P((DBC *));
+int __dbcl_dbc_c_count __P((DBC *, db_recno_t *, u_int32_t));
+int __dbcl_dbc_c_del __P((DBC *, u_int32_t));
+int __dbcl_dbc_c_dup __P((DBC *, DBC **, u_int32_t));
+int __dbcl_dbc_c_get __P((DBC *, DBT *, DBT *, u_int32_t));
+int __dbcl_dbc_c_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
+int __dbcl_dbc_c_put __P((DBC *, DBT *, DBT *, u_int32_t));
+int __dbcl_txn_abort __P((DB_TXN *));
+int __dbcl_txn_commit __P((DB_TXN *, u_int32_t));
+int __dbcl_txn_discard __P((DB_TXN *, u_int32_t));
+int __dbcl_txn_prepare __P((DB_TXN *, u_int8_t *));
+void __dbcl_dbp_init __P((DB *));
+void __dbcl_dbc_init __P((DBC *));
+void __dbcl_dbenv_init __P((DB_ENV *));
+void __dbcl_txn_init __P((DB_TXN *));
 int __dbcl_env_create_ret __P((DB_ENV *, long, __env_create_reply *));
 int __dbcl_env_open_ret __P((DB_ENV *, const char *, u_int32_t, int, __env_open_reply *));
 int __dbcl_env_remove_ret __P((DB_ENV *, const char *, u_int32_t, __env_remove_reply *));
 int __dbcl_txn_abort_ret __P((DB_TXN *, __txn_abort_reply *));
-int __dbcl_txn_begin_ret __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t, __txn_begin_reply *));
+int __dbcl_env_txn_begin_ret __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t, __env_txn_begin_reply *));
+int __dbcl_env_cdsgroup_begin_ret __P((DB_ENV *, DB_TXN **, __env_cdsgroup_begin_reply *));
 int __dbcl_txn_commit_ret __P((DB_TXN *, u_int32_t, __txn_commit_reply *));
 int __dbcl_txn_discard_ret __P((DB_TXN *, u_int32_t, __txn_discard_reply *));
-int __dbcl_txn_recover_ret __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t, __txn_recover_reply *));
+int __dbcl_env_txn_recover_ret __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t, __env_txn_recover_reply *));
 int __dbcl_db_close_ret __P((DB *, u_int32_t, __db_close_reply *));
 int __dbcl_db_create_ret __P((DB *, DB_ENV *, u_int32_t, __db_create_reply *));
 int __dbcl_db_get_ret __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t, __db_get_reply *));
@@ -216,12 +112,12 @@ int __dbcl_db_stat_ret __P((DB *, DB_TXN *, void *, u_int32_t, __db_stat_reply *
 int __dbcl_db_truncate_ret __P((DB *, DB_TXN *, u_int32_t  *, u_int32_t, __db_truncate_reply *));
 int __dbcl_db_cursor_ret __P((DB *, DB_TXN *, DBC **, u_int32_t, __db_cursor_reply *));
 int __dbcl_db_join_ret __P((DB *, DBC **, DBC **, u_int32_t, __db_join_reply *));
-int __dbcl_dbc_close_ret __P((DBC *, __dbc_close_reply *));
-int __dbcl_dbc_count_ret __P((DBC *, db_recno_t *, u_int32_t, __dbc_count_reply *));
-int __dbcl_dbc_dup_ret __P((DBC *, DBC **, u_int32_t, __dbc_dup_reply *));
-int __dbcl_dbc_get_ret __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_get_reply *));
-int __dbcl_dbc_pget_ret __P((DBC *, DBT *, DBT *, DBT *, u_int32_t, __dbc_pget_reply *));
-int __dbcl_dbc_put_ret __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_put_reply *));
+int __dbcl_dbc_c_close_ret __P((DBC *, __dbc_c_close_reply *));
+int __dbcl_dbc_c_count_ret __P((DBC *, db_recno_t *, u_int32_t, __dbc_c_count_reply *));
+int __dbcl_dbc_c_dup_ret __P((DBC *, DBC **, u_int32_t, __dbc_c_dup_reply *));
+int __dbcl_dbc_c_get_ret __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_c_get_reply *));
+int __dbcl_dbc_c_pget_ret __P((DBC *, DBT *, DBT *, DBT *, u_int32_t, __dbc_c_pget_reply *));
+int __dbcl_dbc_c_put_ret __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_c_put_reply *));
 
 #if defined(__cplusplus)
 }
diff --git a/db/dbinc_auto/rpc_server_ext.h b/db/dbinc_auto/rpc_server_ext.h
index 6d8cbc71f..589aef156 100644
--- a/db/dbinc_auto/rpc_server_ext.h
+++ b/db/dbinc_auto/rpc_server_ext.h
@@ -6,76 +6,75 @@
 extern "C" {
 #endif
 
-void __env_get_cachesize_proc __P((long, __env_get_cachesize_reply *));
-void __env_cachesize_proc __P((long, u_int32_t, u_int32_t, u_int32_t, __env_cachesize_reply *));
-void __env_close_proc __P((long, u_int32_t, __env_close_reply *));
+void __env_get_cachesize_proc __P((u_int, __env_get_cachesize_reply *));
+void __env_set_cachesize_proc __P((u_int, u_int32_t, u_int32_t, u_int32_t, __env_set_cachesize_reply *));
+void __env_cdsgroup_begin_proc __P((u_int, __env_cdsgroup_begin_reply *));
+void __env_close_proc __P((u_int, u_int32_t, __env_close_reply *));
 void __env_create_proc __P((u_int32_t, __env_create_reply *));
-void __env_dbremove_proc __P((long, long, char *, char *, u_int32_t, __env_dbremove_reply *));
-void __env_dbrename_proc __P((long, long, char *, char *, char *, u_int32_t, __env_dbrename_reply *));
-void __env_get_encrypt_flags_proc __P((long, __env_get_encrypt_flags_reply *));
-void __env_encrypt_proc __P((long, char *, u_int32_t, __env_encrypt_reply *));
-void __env_get_flags_proc __P((long, __env_get_flags_reply *));
-void __env_flags_proc __P((long, u_int32_t, u_int32_t, __env_flags_reply *));
-void __env_get_home_proc __P((long, __env_get_home_reply *));
-void __env_get_open_flags_proc __P((long, __env_get_open_flags_reply *));
-void __env_open_proc __P((long, char *, u_int32_t, u_int32_t, __env_open_reply *));
-void __env_remove_proc __P((long, char *, u_int32_t, __env_remove_reply *));
-void __txn_abort_proc __P((long, __txn_abort_reply *));
-void __txn_begin_proc __P((long, long, u_int32_t, __txn_begin_reply *));
-void __txn_commit_proc __P((long, u_int32_t, __txn_commit_reply *));
-void __txn_discard_proc __P((long, u_int32_t, __txn_discard_reply *));
-void __txn_prepare_proc __P((long, u_int8_t *, __txn_prepare_reply *));
-void __txn_recover_proc __P((long, u_int32_t, u_int32_t, __txn_recover_reply *, int *));
-void __db_bt_maxkey_proc __P((long, u_int32_t, __db_bt_maxkey_reply *));
-void __db_associate_proc __P((long, long, long, u_int32_t, __db_associate_reply *));
-void __db_get_bt_minkey_proc __P((long, __db_get_bt_minkey_reply *));
-void __db_bt_minkey_proc __P((long, u_int32_t, __db_bt_minkey_reply *));
-void __db_close_proc __P((long, u_int32_t, __db_close_reply *));
-void __db_create_proc __P((long, u_int32_t, __db_create_reply *));
-void __db_del_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_del_reply *));
-void __db_get_encrypt_flags_proc __P((long, __db_get_encrypt_flags_reply *));
-void __db_encrypt_proc __P((long, char *, u_int32_t, __db_encrypt_reply *));
-void __db_get_extentsize_proc __P((long, __db_get_extentsize_reply *));
-void __db_extentsize_proc __P((long, u_int32_t, __db_extentsize_reply *));
-void __db_get_flags_proc __P((long, __db_get_flags_reply *));
-void __db_flags_proc __P((long, u_int32_t, __db_flags_reply *));
-void __db_get_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_get_reply *, int *));
-void __db_get_h_ffactor_proc __P((long, __db_get_h_ffactor_reply *));
-void __db_h_ffactor_proc __P((long, u_int32_t, __db_h_ffactor_reply *));
-void __db_get_h_nelem_proc __P((long, __db_get_h_nelem_reply *));
-void __db_h_nelem_proc __P((long, u_int32_t, __db_h_nelem_reply *));
-void __db_key_range_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_key_range_reply *));
-void __db_get_lorder_proc __P((long, __db_get_lorder_reply *));
-void __db_lorder_proc __P((long, u_int32_t, __db_lorder_reply *));
-void __db_get_name_proc __P((long, __db_get_name_reply *));
-void __db_get_open_flags_proc __P((long, __db_get_open_flags_reply *));
-void __db_open_proc __P((long, long, char *, char *, u_int32_t, u_int32_t, u_int32_t, __db_open_reply *));
-void __db_get_pagesize_proc __P((long, __db_get_pagesize_reply *));
-void __db_pagesize_proc __P((long, u_int32_t, __db_pagesize_reply *));
-void __db_pget_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_pget_reply *, int *));
-void __db_put_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_put_reply *, int *));
-void __db_get_re_delim_proc __P((long, __db_get_re_delim_reply *));
-void __db_re_delim_proc __P((long, u_int32_t, __db_re_delim_reply *));
-void __db_get_re_len_proc __P((long, __db_get_re_len_reply *));
-void __db_re_len_proc __P((long, u_int32_t, __db_re_len_reply *));
-void __db_get_re_pad_proc __P((long, __db_get_re_pad_reply *));
-void __db_re_pad_proc __P((long, u_int32_t, __db_re_pad_reply *));
-void __db_remove_proc __P((long, char *, char *, u_int32_t, __db_remove_reply *));
-void __db_rename_proc __P((long, char *, char *, char *, u_int32_t, __db_rename_reply *));
-void __db_stat_proc __P((long, long, u_int32_t, __db_stat_reply *, int *));
-void __db_sync_proc __P((long, u_int32_t, __db_sync_reply *));
-void __db_truncate_proc __P((long, long, u_int32_t, __db_truncate_reply *));
-void __db_cursor_proc __P((long, long, u_int32_t, __db_cursor_reply *));
-void __db_join_proc __P((long, u_int32_t *, u_int32_t, u_int32_t, __db_join_reply *));
-void __dbc_close_proc __P((long, __dbc_close_reply *));
-void __dbc_count_proc __P((long, u_int32_t, __dbc_count_reply *));
-void __dbc_del_proc __P((long, u_int32_t, __dbc_del_reply *));
-void __dbc_dup_proc __P((long, u_int32_t, __dbc_dup_reply *));
-void __dbc_get_proc __P((long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __dbc_get_reply *, int *));
-void __dbc_pget_proc __P((long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __dbc_pget_reply *, int *));
-void __dbc_put_proc __P((long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __dbc_put_reply *, int *));
+void __env_dbremove_proc __P((u_int, u_int, char *, char *, u_int32_t, __env_dbremove_reply *));
+void __env_dbrename_proc __P((u_int, u_int, char *, char *, char *, u_int32_t, __env_dbrename_reply *));
+void __env_get_encrypt_flags_proc __P((u_int, __env_get_encrypt_flags_reply *));
+void __env_set_encrypt_proc __P((u_int, char *, u_int32_t, __env_set_encrypt_reply *));
+void __env_get_flags_proc __P((u_int, __env_get_flags_reply *));
+void __env_set_flags_proc __P((u_int, u_int32_t, u_int32_t, __env_set_flags_reply *));
+void __env_get_home_proc __P((u_int, __env_get_home_reply *));
+void __env_get_open_flags_proc __P((u_int, __env_get_open_flags_reply *));
+void __env_open_proc __P((u_int, char *, u_int32_t, u_int32_t, __env_open_reply *));
+void __env_remove_proc __P((u_int, char *, u_int32_t, __env_remove_reply *));
+void __txn_abort_proc __P((u_int, __txn_abort_reply *));
+void __env_txn_begin_proc __P((u_int, u_int, u_int32_t, __env_txn_begin_reply *));
+void __txn_commit_proc __P((u_int, u_int32_t, __txn_commit_reply *));
+void __txn_discard_proc __P((u_int, u_int32_t, __txn_discard_reply *));
+void __txn_prepare_proc __P((u_int, u_int8_t *, __txn_prepare_reply *));
+void __env_txn_recover_proc __P((u_int, u_int32_t, u_int32_t, __env_txn_recover_reply *, int *));
+void __db_associate_proc __P((u_int, u_int, u_int, u_int32_t, __db_associate_reply *));
+void __db_get_bt_minkey_proc __P((u_int, __db_get_bt_minkey_reply *));
+void __db_set_bt_minkey_proc __P((u_int, u_int32_t, __db_set_bt_minkey_reply *));
+void __db_close_proc __P((u_int, u_int32_t, __db_close_reply *));
+void __db_create_proc __P((u_int, u_int32_t, __db_create_reply *));
+void __db_del_proc __P((u_int, u_int, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_del_reply *));
+void __db_get_encrypt_flags_proc __P((u_int, __db_get_encrypt_flags_reply *));
+void __db_set_encrypt_proc __P((u_int, char *, u_int32_t, __db_set_encrypt_reply *));
+void __db_get_q_extentsize_proc __P((u_int, __db_get_q_extentsize_reply *));
+void __db_set_q_extentsize_proc __P((u_int, u_int32_t, __db_set_q_extentsize_reply *));
+void __db_get_flags_proc __P((u_int, __db_get_flags_reply *));
+void __db_set_flags_proc __P((u_int, u_int32_t, __db_set_flags_reply *));
+void __db_get_proc __P((u_int, u_int, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_get_reply *, int *));
+void __db_get_h_ffactor_proc __P((u_int, __db_get_h_ffactor_reply *));
+void __db_set_h_ffactor_proc __P((u_int, u_int32_t, __db_set_h_ffactor_reply *));
+void __db_get_h_nelem_proc __P((u_int, __db_get_h_nelem_reply *));
+void __db_set_h_nelem_proc __P((u_int, u_int32_t, __db_set_h_nelem_reply *));
+void __db_key_range_proc __P((u_int, u_int, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_key_range_reply *));
+void __db_get_lorder_proc __P((u_int, __db_get_lorder_reply *));
+void __db_set_lorder_proc __P((u_int, u_int32_t, __db_set_lorder_reply *));
+void __db_get_dbname_proc __P((u_int, __db_get_dbname_reply *));
+void __db_get_open_flags_proc __P((u_int, __db_get_open_flags_reply *));
+void __db_open_proc __P((u_int, u_int, char *, char *, u_int32_t, u_int32_t, u_int32_t, __db_open_reply *));
+void __db_get_pagesize_proc __P((u_int, __db_get_pagesize_reply *));
+void __db_set_pagesize_proc __P((u_int, u_int32_t, __db_set_pagesize_reply *));
+void __db_pget_proc __P((u_int, u_int, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_pget_reply *, int *));
+void __db_put_proc __P((u_int, u_int, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_put_reply *, int *));
+void __db_get_re_delim_proc __P((u_int, __db_get_re_delim_reply *));
+void __db_set_re_delim_proc __P((u_int, u_int32_t, __db_set_re_delim_reply *));
+void __db_get_re_len_proc __P((u_int, __db_get_re_len_reply *));
+void __db_set_re_len_proc __P((u_int, u_int32_t, __db_set_re_len_reply *));
+void __db_get_re_pad_proc __P((u_int, __db_get_re_pad_reply *));
+void __db_set_re_pad_proc __P((u_int, u_int32_t, __db_set_re_pad_reply *));
+void __db_remove_proc __P((u_int, char *, char *, u_int32_t, __db_remove_reply *));
+void __db_rename_proc __P((u_int, char *, char *, char *, u_int32_t, __db_rename_reply *));
+void __db_stat_proc __P((u_int, u_int, u_int32_t, __db_stat_reply *, int *));
+void __db_sync_proc __P((u_int, u_int32_t, __db_sync_reply *));
+void __db_truncate_proc __P((u_int, u_int, u_int32_t, __db_truncate_reply *));
+void __db_cursor_proc __P((u_int, u_int, u_int32_t, __db_cursor_reply *));
+void __db_join_proc __P((u_int, u_int32_t *, u_int32_t, u_int32_t, __db_join_reply *));
+void __dbc_c_close_proc __P((u_int, __dbc_c_close_reply *));
+void __dbc_c_count_proc __P((u_int, u_int32_t, __dbc_c_count_reply *));
+void __dbc_c_del_proc __P((u_int, u_int32_t, __dbc_c_del_reply *));
+void __dbc_c_dup_proc __P((u_int, u_int32_t, __dbc_c_dup_reply *));
+void __dbc_c_get_proc __P((u_int, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __dbc_c_get_reply *, int *));
+void __dbc_c_pget_proc __P((u_int, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __dbc_c_pget_reply *, int *));
+void __dbc_c_put_proc __P((u_int, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __dbc_c_put_reply *, int *));
 void __dbsrv_settimeout __P((ct_entry *, u_int32_t));
-void __dbsrv_timeout __P((int));
 void __dbclear_ctp __P((ct_entry *));
 void __dbdel_ctp __P((ct_entry *));
 ct_entry *new_ct_ent __P((int *));
@@ -85,7 +84,7 @@ ct_entry *__dbsrv_shareenv __P((ct_entry *, home_entry *, u_int32_t));
 void __dbsrv_active __P((ct_entry *));
 int __db_close_int __P((long, u_int32_t));
 int __dbc_close_int __P((ct_entry *));
-int __dbenv_close_int __P((long, u_int32_t, int));
+int __env_close_int __P((long, u_int32_t, int));
 home_entry *get_fullhome __P((char *));
 
 #if defined(__cplusplus)
diff --git a/db/dbinc_auto/tcl_ext.h b/db/dbinc_auto/tcl_ext.h
index d147bd4f8..e5395c539 100644
--- a/db/dbinc_auto/tcl_ext.h
+++ b/db/dbinc_auto/tcl_ext.h
@@ -16,11 +16,16 @@ int bdb_DbmCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*, int, DBM *));
 int ndbm_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
 void _DbInfoDelete __P((Tcl_Interp *, DBTCL_INFO *));
 int db_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+int tcl_CompactStat __P((Tcl_Interp *, DBTCL_INFO *));
+int tcl_rep_send __P((DB_ENV *, const DBT *, const DBT *, const DB_LSN *, int, u_int32_t));
 int dbc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
 int env_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
 int tcl_EnvRemove __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
+int tcl_EnvIdReset __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+int tcl_EnvLsnReset __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 int tcl_EnvVerbose __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *, Tcl_Obj *));
 int tcl_EnvAttr __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+int tcl_EventNotify  __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *, DBTCL_INFO *));
 int tcl_EnvSetFlags __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *, Tcl_Obj *));
 int tcl_EnvTest __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 int tcl_EnvGetEncryptFlags __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
@@ -42,11 +47,12 @@ int _GetGlobPrefix __P((char *, char **));
 int _ReturnSetup __P((Tcl_Interp *, int, int, char *));
 int _ErrorSetup __P((Tcl_Interp *, int, char *));
 void _ErrorFunc __P((const DB_ENV *, CONST char *, const char *));
+void _EventFunc __P((DB_ENV *, u_int32_t, void *));
 int _GetLsn __P((Tcl_Interp *, Tcl_Obj *, DB_LSN *));
 int _GetUInt32 __P((Tcl_Interp *, Tcl_Obj *, u_int32_t *));
 Tcl_Obj *_GetFlagsList __P((Tcl_Interp *, u_int32_t, const FN *));
 void _debug_check  __P((void));
-int _CopyObjBytes  __P((Tcl_Interp *, Tcl_Obj *obj, void **, u_int32_t *, int *));
+int _CopyObjBytes  __P((Tcl_Interp *, Tcl_Obj *obj, void *, u_int32_t *, int *));
 int tcl_LockDetect __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 int tcl_LockGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 int tcl_LockStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
@@ -65,22 +71,27 @@ int tcl_MpSync __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 int tcl_MpTrickle __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 int tcl_Mp __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
 int tcl_MpStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+int tcl_RepConfig __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *));
+int tcl_RepGetConfig __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *));
 int tcl_RepElect __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
 int tcl_RepFlush __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+int tcl_RepSync __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
 int tcl_RepLimit __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
 int tcl_RepRequest __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+int tcl_RepTransport  __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *, DBTCL_INFO *));
 int tcl_RepStart __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
 int tcl_RepProcessMessage __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
 int tcl_RepStat __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+int tcl_RepMgr __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
 int seq_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
 void _TxnInfoDelete __P((Tcl_Interp *, DBTCL_INFO *));
 int tcl_TxnCheckpoint __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 int tcl_Txn __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
+int tcl_CDSGroup __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
 int tcl_TxnStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 int tcl_TxnTimeout __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 int tcl_TxnRecover __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
 int bdb_RandCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
-int tcl_Mutex __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
 
 #if defined(__cplusplus)
 }
diff --git a/db/dbinc_auto/txn_auto.h b/db/dbinc_auto/txn_auto.h
index 2611df15e..ec3eb2081 100644
--- a/db/dbinc_auto/txn_auto.h
+++ b/db/dbinc_auto/txn_auto.h
@@ -2,20 +2,42 @@
 
 #ifndef	__txn_AUTO_H
 #define	__txn_AUTO_H
+#define	DB___txn_regop_42	10
+typedef struct ___txn_regop_42_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	u_int32_t	opcode;
+	int32_t	timestamp;
+	DBT	locks;
+} __txn_regop_42_args;
+
 #define	DB___txn_regop	10
 typedef struct ___txn_regop_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	opcode;
 	int32_t	timestamp;
+	u_int32_t	envid;
 	DBT	locks;
 } __txn_regop_args;
 
+#define	DB___txn_ckp_42	11
+typedef struct ___txn_ckp_42_args {
+	u_int32_t type;
+	DB_TXN *txnp;
+	DB_LSN prev_lsn;
+	DB_LSN	ckp_lsn;
+	DB_LSN	last_ckp;
+	int32_t	timestamp;
+	u_int32_t	rep_gen;
+} __txn_ckp_42_args;
+
 #define	DB___txn_ckp	11
 typedef struct ___txn_ckp_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	DB_LSN	ckp_lsn;
 	DB_LSN	last_ckp;
@@ -27,7 +49,7 @@ typedef struct ___txn_ckp_args {
 #define	DB___txn_child	12
 typedef struct ___txn_child_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	child;
 	DB_LSN	c_lsn;
@@ -36,7 +58,7 @@ typedef struct ___txn_child_args {
 #define	DB___txn_xa_regop	13
 typedef struct ___txn_xa_regop_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	opcode;
 	DBT	xid;
@@ -50,7 +72,7 @@ typedef struct ___txn_xa_regop_args {
 #define	DB___txn_recycle	14
 typedef struct ___txn_recycle_args {
 	u_int32_t type;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN prev_lsn;
 	u_int32_t	min;
 	u_int32_t	max;
diff --git a/db/dbinc_auto/txn_ext.h b/db/dbinc_auto/txn_ext.h
index 94ca6f332..48ba76efc 100644
--- a/db/dbinc_auto/txn_ext.h
+++ b/db/dbinc_auto/txn_ext.h
@@ -9,24 +9,25 @@ extern "C" {
 int __txn_begin_pp __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
 int __txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
 int __txn_xa_begin __P((DB_ENV *, DB_TXN *));
-int __txn_compensate_begin __P((DB_ENV *, DB_TXN **txnp));
+int __txn_recycle_id __P((DB_ENV *));
+int __txn_compensate_begin __P((DB_ENV *, DB_TXN **));
+void __txn_continue __P((DB_ENV *, DB_TXN *, TXN_DETAIL *));
 int __txn_commit __P((DB_TXN *, u_int32_t));
 int __txn_abort __P((DB_TXN *));
-int __txn_discard __P((DB_TXN *, u_int32_t flags));
+int __txn_discard_int __P((DB_TXN *, u_int32_t flags));
 int __txn_prepare __P((DB_TXN *, u_int8_t *));
 u_int32_t __txn_id __P((DB_TXN *));
+int __txn_get_name __P((DB_TXN *, const char **));
+int __txn_set_name __P((DB_TXN *, const char *));
 int  __txn_set_timeout __P((DB_TXN *, db_timeout_t, u_int32_t));
-int __txn_checkpoint_pp __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
-int __txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
-void __txn_getactive __P((DB_ENV *, DB_LSN *));
-int __txn_getckp __P((DB_ENV *, DB_LSN *));
 int __txn_activekids __P((DB_ENV *, u_int32_t, DB_TXN *));
 int __txn_force_abort __P((DB_ENV *, u_int8_t *));
 int __txn_preclose __P((DB_ENV *));
 int __txn_reset __P((DB_ENV *));
-void __txn_updateckp __P((DB_ENV *, DB_LSN *));
-int __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, const DBT *));
+int __txn_regop_42_read __P((DB_ENV *, void *, __txn_regop_42_args **));
+int __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, u_int32_t, const DBT *));
 int __txn_regop_read __P((DB_ENV *, void *, __txn_regop_args **));
+int __txn_ckp_42_read __P((DB_ENV *, void *, __txn_ckp_42_args **));
 int __txn_ckp_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, DB_LSN *, int32_t, u_int32_t, u_int32_t));
 int __txn_ckp_read __P((DB_ENV *, void *, __txn_ckp_args **));
 int __txn_child_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, DB_LSN *));
@@ -36,21 +37,34 @@ int __txn_xa_regop_read __P((DB_ENV *, void *, __txn_xa_regop_args **));
 int __txn_recycle_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, u_int32_t));
 int __txn_recycle_read __P((DB_ENV *, void *, __txn_recycle_args **));
 int __txn_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
+int __txn_regop_42_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __txn_ckp_42_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_ckp_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_child_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_xa_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_recycle_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-void __txn_dbenv_create __P((DB_ENV *));
+int __txn_checkpoint_pp __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
+int __txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
+int __txn_getactive __P((DB_ENV *, DB_LSN *));
+int __txn_getckp __P((DB_ENV *, DB_LSN *));
+int __txn_updateckp __P((DB_ENV *, DB_LSN *));
+int __txn_failchk __P((DB_ENV *));
+int __txn_dbenv_create __P((DB_ENV *));
+void __txn_dbenv_destroy __P((DB_ENV *));
+int __txn_get_tx_max __P((DB_ENV *, u_int32_t *));
 int __txn_set_tx_max __P((DB_ENV *, u_int32_t));
+int __txn_get_tx_timestamp __P((DB_ENV *, time_t *));
+int __txn_set_tx_timestamp __P((DB_ENV *, time_t *));
 int __txn_regop_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_xa_regop_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_ckp_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_child_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_restore_txn __P((DB_ENV *, DB_LSN *, __txn_xa_regop_args *));
 int __txn_recycle_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-void __txn_continue __P((DB_ENV *, DB_TXN *, TXN_DETAIL *, size_t));
+int __txn_regop_42_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+int __txn_ckp_42_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
 int __txn_map_gid __P((DB_ENV *, u_int8_t *, TXN_DETAIL **, roff_t *));
 int __txn_recover_pp __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
 int __txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
@@ -59,13 +73,15 @@ int __txn_openfiles __P((DB_ENV *, DB_LSN *, int));
 int __txn_open __P((DB_ENV *));
 int __txn_findlastckp __P((DB_ENV *, DB_LSN *, DB_LSN *));
 int __txn_dbenv_refresh __P((DB_ENV *));
-void __txn_region_destroy __P((DB_ENV *, REGINFO *));
 int __txn_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
+int __txn_oldest_reader __P((DB_ENV *, DB_LSN *));
+int __txn_add_buffer __P((DB_ENV *, TXN_DETAIL *));
+int __txn_remove_buffer __P((DB_ENV *, TXN_DETAIL *, db_mutex_t));
 int __txn_stat_pp __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
 int __txn_stat_print_pp __P((DB_ENV *, u_int32_t));
 int  __txn_stat_print __P((DB_ENV *, u_int32_t));
 int __txn_closeevent __P((DB_ENV *, DB_TXN *, DB *));
-int __txn_remevent __P((DB_ENV *, DB_TXN *, const char *, u_int8_t*));
+int __txn_remevent __P((DB_ENV *, DB_TXN *, const char *, u_int8_t *, int));
 void __txn_remrem __P((DB_ENV *, DB_TXN *, const char *));
 int __txn_lockevent __P((DB_ENV *, DB_TXN *, DB *, DB_LOCK *, u_int32_t));
 void __txn_remlock __P((DB_ENV *, DB_TXN *, DB_LOCK *, u_int32_t));
diff --git a/db/dbinc_auto/xa_ext.h b/db/dbinc_auto/xa_ext.h
index 3247b5bb7..272d4cdbd 100644
--- a/db/dbinc_auto/xa_ext.h
+++ b/db/dbinc_auto/xa_ext.h
@@ -12,7 +12,7 @@ int __db_rmid_to_env __P((int rmid, DB_ENV **envp));
 int __db_xid_to_txn __P((DB_ENV *, XID *, roff_t *));
 int __db_map_rmid __P((int, DB_ENV *));
 int __db_unmap_rmid __P((int));
-int __db_map_xid __P((DB_ENV *, XID *, size_t));
+int __db_map_xid __P((DB_ENV *, XID *, TXN_DETAIL *));
 void __db_unmap_xid __P((DB_ENV *, XID *, size_t));
 
 #if defined(__cplusplus)
diff --git a/db/dbm/dbm.c b/db/dbm/dbm.c
index 842b8d0a4..0093ce703 100644
--- a/db/dbm/dbm.c
+++ b/db/dbm/dbm.c
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1990, 1993
@@ -39,19 +39,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: dbm.c,v 11.18 2004/05/10 21:26:47 bostic Exp $
+ * $Id: dbm.c,v 12.8 2006/08/24 14:45:31 bostic Exp $
  */
 
+#define	DB_DBM_HSEARCH	1
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
-#define	DB_DBM_HSEARCH	1
 #include "db_int.h"
 
 /*
@@ -98,7 +91,7 @@ __db_dbm_init(file)
 	if (__cur_db != NULL)
 		dbm_close(__cur_db);
 	if ((__cur_db =
-	    dbm_open(file, O_CREAT | O_RDWR, __db_omode("rw----"))) != NULL)
+	    dbm_open(file, O_CREAT | O_RDWR, __db_omode(OWNER_RW))) != NULL)
 		return (0);
 	if ((__cur_db = dbm_open(file, O_RDONLY, 0)) != NULL)
 		return (0);
@@ -123,7 +116,8 @@ __db_dbm_fetch(key)
 
 	if (__cur_db == NULL) {
 		__db_no_open();
-		item.dptr = 0;
+		item.dptr = NULL;
+		item.dsize = 0;
 		return (item);
 	}
 	return (dbm_fetch(__cur_db, key));
@@ -136,7 +130,8 @@ __db_dbm_firstkey()
 
 	if (__cur_db == NULL) {
 		__db_no_open();
-		item.dptr = 0;
+		item.dptr = NULL;
+		item.dsize = 0;
 		return (item);
 	}
 	return (dbm_firstkey(__cur_db));
@@ -152,7 +147,8 @@ __db_dbm_nextkey(key)
 
 	if (__cur_db == NULL) {
 		__db_no_open();
-		item.dptr = 0;
+		item.dptr = NULL;
+		item.dsize = 0;
 		return (item);
 	}
 	return (dbm_nextkey(__cur_db));
@@ -204,7 +200,7 @@ __db_ndbm_open(file, oflags, mode)
 	DB *dbp;
 	DBC *dbc;
 	int ret;
-	char path[MAXPATHLEN];
+	char path[DB_MAXPATHLEN];
 
 	/*
 	 * !!!
@@ -282,10 +278,8 @@ __db_ndbm_fetch(dbm, key)
 
 	dbc = (DBC *)dbm;
 
-	memset(&_key, 0, sizeof(DBT));
+	DB_INIT_DBT(_key, key.dptr, key.dsize);
 	memset(&_data, 0, sizeof(DBT));
-	_key.size = (u_int32_t)key.dsize;
-	_key.data = key.dptr;
 
 	/*
 	 * Note that we can't simply use the dbc we have to do a c_get/SET,
@@ -394,9 +388,7 @@ __db_ndbm_delete(dbm, key)
 
 	dbc = (DBC *)dbm;
 
-	memset(&_key, 0, sizeof(DBT));
-	_key.data = key.dptr;
-	_key.size = (u_int32_t)key.dsize;
+	DB_INIT_DBT(_key, key.dptr, key.dsize);
 
 	if ((ret = dbc->dbp->del(dbc->dbp, NULL, &_key, 0)) == 0)
 		return (0);
@@ -428,13 +420,8 @@ __db_ndbm_store(dbm, key, data, flags)
 
 	dbc = (DBC *)dbm;
 
-	memset(&_key, 0, sizeof(DBT));
-	_key.data = key.dptr;
-	_key.size = (u_int32_t)key.dsize;
-
-	memset(&_data, 0, sizeof(DBT));
-	_data.data = data.dptr;
-	_data.size = (u_int32_t)data.dsize;
+	DB_INIT_DBT(_key, key.dptr, key.dsize);
+	DB_INIT_DBT(_data, data.dptr, data.dsize);
 
 	if ((ret = dbc->dbp->put(dbc->dbp, NULL,
 	    &_key, &_data, flags == DBM_INSERT ? DB_NOOVERWRITE : 0)) == 0)
diff --git a/db/dbreg/dbreg.c b/db/dbreg/dbreg.c
index 930c8bb7a..edc4599be 100644
--- a/db/dbreg/dbreg.c
+++ b/db/dbreg/dbreg.c
@@ -1,27 +1,21 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: dbreg.c,v 11.90 2004/10/15 16:59:39 bostic Exp $
+ * $Id: dbreg.c,v 12.20 2006/08/24 14:45:31 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/log.h"
 #include "dbinc/txn.h"
 #include "dbinc/db_am.h"
 
-static int __dbreg_push_id __P((DB_ENV *, int32_t));
+static int __dbreg_push_id __P((DB_ENV *, DB *, int32_t));
 static int __dbreg_pop_id __P((DB_ENV *, int32_t *));
 static int __dbreg_pluck_id __P((DB_ENV *, int32_t));
 
@@ -60,9 +54,9 @@ static int __dbreg_pluck_id __P((DB_ENV *, int32_t));
  *	region list so they can get logged on checkpoints.
  *
  *	An FNAME that may/does have a valid id must be accessed under
- *	protection of the fq_mutex, with the following exception:
+ *	protection of the mtx_filelist, with the following exception:
  *
- *	We don't want to have to grab the fq_mutex on every log
+ *	We don't want to have to grab the mtx_filelist on every log
  *	record, and it should be safe not to do so when we're just
  *	looking at the id, because once allocated, the id should
  *	not change under a handle until the handle is closed.
@@ -114,7 +108,7 @@ __dbreg_setup(dbp, name, create_txnid)
 	namep = NULL;
 
 	/* Allocate an FNAME and, if necessary, a buffer for the name itself. */
-	R_LOCK(dbenv, infop);
+	LOG_SYSTEM_LOCK(dbenv);
 	if ((ret = __db_shalloc(infop, sizeof(FNAME), 0, &fnp)) != 0)
 		goto err;
 	memset(fnp, 0, sizeof(FNAME));
@@ -127,13 +121,13 @@ __dbreg_setup(dbp, name, create_txnid)
 	} else
 		fnp->name_off = INVALID_ROFF;
 
-	R_UNLOCK(dbenv, infop);
+	LOG_SYSTEM_UNLOCK(dbenv);
 
 	/*
 	 * Fill in all the remaining info that we'll need later to register
 	 * the file, if we use it for logging.
 	 */
-	fnp->id = DB_LOGFILEID_INVALID;
+	fnp->id = fnp->old_id = DB_LOGFILEID_INVALID;
 	fnp->s_type = dbp->type;
 	memcpy(fnp->ufid, dbp->fileid, DB_FILE_ID_LEN);
 	fnp->meta_pgno = dbp->meta_pgno;
@@ -143,9 +137,9 @@ __dbreg_setup(dbp, name, create_txnid)
 
 	return (0);
 
-err:	R_UNLOCK(dbenv, infop);
+err:	LOG_SYSTEM_UNLOCK(dbenv);
 	if (ret == ENOMEM)
-		__db_err(dbenv,
+		__db_errx(dbenv,
     "Logging region out of memory; you may need to increase its size");
 
 	return (ret);
@@ -175,16 +169,16 @@ __dbreg_teardown(dbp)
 	 * We may not have an FNAME if we were never opened.  This is not an
 	 * error.
 	 */
-	if (fnp == NULL)
+	if (fnp == NULL || F_ISSET(fnp, DB_FNAME_NOTLOGGED))
 		return (0);
 
-	DB_ASSERT(fnp->id == DB_LOGFILEID_INVALID);
+	DB_ASSERT(dbenv, fnp->id == DB_LOGFILEID_INVALID);
 
-	R_LOCK(dbenv, infop);
+	LOG_SYSTEM_LOCK(dbenv);
 	if (fnp->name_off != INVALID_ROFF)
 		__db_shalloc_free(infop, R_ADDR(infop, fnp->name_off));
 	__db_shalloc_free(infop, fnp);
-	R_UNLOCK(dbenv, infop);
+	LOG_SYSTEM_UNLOCK(dbenv);
 
 	dbp->log_filename = NULL;
 
@@ -216,22 +210,22 @@ __dbreg_new_id(dbp, txn)
 	lp = dblp->reginfo.primary;
 	fnp = dbp->log_filename;
 
-	/* The fq_mutex protects the FNAME list and id management. */
-	MUTEX_LOCK(dbenv, &lp->fq_mutex);
+	/* The mtx_filelist protects the FNAME list and id management. */
+	MUTEX_LOCK(dbenv, lp->mtx_filelist);
 	if (fnp->id != DB_LOGFILEID_INVALID) {
-		MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+		MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 		return (0);
 	}
 	if ((ret = __dbreg_get_id(dbp, txn, &id)) == 0)
 		fnp->id = id;
-	MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+	MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 	return (ret);
 }
 
 /*
  * __dbreg_get_id --
  *	Assign an unused dbreg id to this database handle.
- *	Assume the caller holds the fq_mutex locked.  Assume the
+ *	Assume the caller holds the mtx_filelist locked.  Assume the
  *	caller will set the fnp->id field with the id we return.
  *
  * PUBLIC: int __dbreg_get_id __P((DB *, DB_TXN *, int32_t *));
@@ -242,10 +236,8 @@ __dbreg_get_id(dbp, txn, idp)
 	DB_TXN *txn;
 	int32_t *idp;
 {
-	DBT fid_dbt, r_name;
 	DB_ENV *dbenv;
 	DB_LOG *dblp;
-	DB_LSN unused;
 	FNAME *fnp;
 	LOG *lp;
 	int32_t id;
@@ -269,7 +261,9 @@ __dbreg_get_id(dbp, txn, idp)
 	if (id == DB_LOGFILEID_INVALID)
 		id = lp->fid_max++;
 
-	fnp->is_durable = !F_ISSET(dbp, DB_AM_NOT_DURABLE);
+	/* If the file is durable (i.e., not, not-durable), mark it as such. */
+	if (!F_ISSET(dbp, DB_AM_NOT_DURABLE))
+		F_SET(fnp, DB_FNAME_DURABLE);
 
 	/* Hook the FNAME into the list of open files. */
 	SH_TAILQ_INSERT_HEAD(&lp->fq, fnp, q, __fname);
@@ -278,21 +272,11 @@ __dbreg_get_id(dbp, txn, idp)
 	 * Log the registry.  We should only request a new ID in situations
 	 * where logging is reasonable.
 	 */
-	DB_ASSERT(!F_ISSET(dbp, DB_AM_RECOVER));
+	DB_ASSERT(dbenv, !F_ISSET(dbp, DB_AM_RECOVER));
 
-	memset(&fid_dbt, 0, sizeof(fid_dbt));
-	memset(&r_name, 0, sizeof(r_name));
-	if (fnp->name_off != INVALID_ROFF) {
-		r_name.data = R_ADDR(&dblp->reginfo, fnp->name_off);
-		r_name.size = (u_int32_t)strlen((char *)r_name.data) + 1;
-	}
-	fid_dbt.data = dbp->fileid;
-	fid_dbt.size = DB_FILE_ID_LEN;
-	if ((ret = __dbreg_register_log(dbenv, txn, &unused,
-	    F_ISSET(dbp, DB_AM_NOT_DURABLE) ? DB_LOG_NOT_DURABLE : 0,
-	    DBREG_OPEN, r_name.size == 0 ? NULL : &r_name, &fid_dbt, id,
-	    fnp->s_type, fnp->meta_pgno, fnp->create_txnid)) != 0)
+	if ((ret = __dbreg_log_id(dbp, txn, id, 0)) != 0)
 		goto err;
+
 	/*
 	 * Once we log the create_txnid, we need to make sure we never
 	 * log it again (as might happen if this is a replication client
@@ -300,8 +284,8 @@ __dbreg_get_id(dbp, txn, idp)
 	 */
 	fnp->create_txnid = TXN_INVALID;
 
-	DB_ASSERT(dbp->type == fnp->s_type);
-	DB_ASSERT(dbp->meta_pgno == fnp->meta_pgno);
+	DB_ASSERT(dbenv, dbp->type == fnp->s_type);
+	DB_ASSERT(dbenv, dbp->meta_pgno == fnp->meta_pgno);
 
 	if ((ret = __dbreg_add_dbentry(dbenv, dblp, dbp, id)) != 0)
 		goto err;
@@ -345,11 +329,11 @@ __dbreg_assign_id(dbp, id)
 	close_dbp = NULL;
 	close_fnp = NULL;
 
-	/* The fq_mutex protects the FNAME list and id management. */
-	MUTEX_LOCK(dbenv, &lp->fq_mutex);
+	/* The mtx_filelist protects the FNAME list and id management. */
+	MUTEX_LOCK(dbenv, lp->mtx_filelist);
 
 	/* We should only call this on DB handles that have no ID. */
-	DB_ASSERT(fnp->id == DB_LOGFILEID_INVALID);
+	DB_ASSERT(dbenv, fnp->id == DB_LOGFILEID_INVALID);
 
 	/*
 	 * Make sure there isn't already a file open with this ID. There can
@@ -358,8 +342,8 @@ __dbreg_assign_id(dbp, id)
 	 */
 	if (__dbreg_id_to_fname(dblp, id, 1, &close_fnp) == 0) {
 		/*
-		 * We want to save off any dbp we have open with this id.
-		 * We can't safely close it now, because we hold the fq_mutex,
+		 * We want to save off any dbp we have open with this id.  We
+		 * can't safely close it now, because we hold the mtx_filelist,
 		 * but we should be able to rely on it being open in this
 		 * process, and we're running recovery, so no other thread
 		 * should muck with it if we just put off closing it until
@@ -391,7 +375,9 @@ cont:	if ((ret = __dbreg_pluck_id(dbenv, id)) != 0)
 
 	/* Now go ahead and assign the id to our dbp. */
 	fnp->id = id;
-	fnp->is_durable = !F_ISSET(dbp, DB_AM_NOT_DURABLE);
+	/* If the file is durable (i.e., not, not-durable), mark it as such. */
+	if (!F_ISSET(dbp, DB_AM_NOT_DURABLE))
+		F_SET(fnp, DB_FNAME_DURABLE);
 	SH_TAILQ_INSERT_HEAD(&lp->fq, fnp, q, __fname);
 
 	/*
@@ -402,7 +388,7 @@ cont:	if ((ret = __dbreg_pluck_id(dbenv, id)) != 0)
 	if ((ret = __dbreg_add_dbentry(dbenv, dblp, dbp, id)) != 0)
 		(void)__dbreg_revoke_id(dbp, 1, id);
 
-err:	MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+err:	MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 
 	/* There's nothing useful that our caller can do if this close fails. */
 	if (close_dbp != NULL)
@@ -435,6 +421,7 @@ __dbreg_revoke_id(dbp, have_lock, force_id)
 	dblp = dbenv->lg_handle;
 	lp = dblp->reginfo.primary;
 	fnp = dbp->log_filename;
+	ret = 0;
 
 	/* If we lack an ID, this is a null-op. */
 	if (fnp == NULL)
@@ -447,26 +434,38 @@ __dbreg_revoke_id(dbp, have_lock, force_id)
 	 */
 	if (force_id != DB_LOGFILEID_INVALID)
 		id = force_id;
-	else if (fnp->id == DB_LOGFILEID_INVALID)
-		return (0);
-	else
+	else if (fnp->id == DB_LOGFILEID_INVALID) {
+		if (fnp->old_id == DB_LOGFILEID_INVALID)
+			return (0);
+		id = fnp->old_id;
+	} else
 		id = fnp->id;
 	if (!have_lock)
-		MUTEX_LOCK(dbenv, &lp->fq_mutex);
+		MUTEX_LOCK(dbenv, lp->mtx_filelist);
 
 	fnp->id = DB_LOGFILEID_INVALID;
+	fnp->old_id = DB_LOGFILEID_INVALID;
 
 	/* Remove the FNAME from the list of open files. */
 	SH_TAILQ_REMOVE(&lp->fq, fnp, q, __fname);
 
-	/* Remove this id from the dbentry table. */
-	__dbreg_rem_dbentry(dblp, id);
-
-	/* Push this id onto the free list. */
-	ret = __dbreg_push_id(dbenv, id);
+	/*
+	 * Remove this id from the dbentry table and push it onto the
+	 * free list.
+	 */
+	if ((ret = __dbreg_rem_dbentry(dblp, id)) == 0) {
+		/*
+		 * If we are not in recovery but the file was opened
+		 * for a recovery operation, then this process aborted
+		 * a transaction for another process and the id may
+		 * still be in use, so don't reuse this id.
+		 */
+		if (!F_ISSET(dbp, DB_AM_RECOVER) || IS_RECOVERING(dbenv))
+			ret = __dbreg_push_id(dbenv, dbp, id);
+	}
 
 	if (!have_lock)
-		MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+		MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 	return (ret);
 }
 
@@ -483,10 +482,8 @@ __dbreg_close_id(dbp, txn, op)
 	DB_TXN *txn;
 	u_int32_t op;
 {
-	DBT fid_dbt, r_name, *dbtp;
 	DB_ENV *dbenv;
 	DB_LOG *dblp;
-	DB_LSN r_unused;
 	FNAME *fnp;
 	LOG *lp;
 	int ret;
@@ -497,10 +494,48 @@ __dbreg_close_id(dbp, txn, op)
 	fnp = dbp->log_filename;
 
 	/* If we lack an ID, this is a null-op. */
-	if (fnp == NULL || fnp->id == DB_LOGFILEID_INVALID)
+	if (fnp == NULL)
 		return (0);
 
-	MUTEX_LOCK(dbenv, &lp->fq_mutex);
+	if (fnp->id == DB_LOGFILEID_INVALID)
+		return (__dbreg_revoke_id(dbp, 0, DB_LOGFILEID_INVALID));
+
+	MUTEX_LOCK(dbenv, lp->mtx_filelist);
+
+	if ((ret = __dbreg_log_close(dbenv, fnp, txn, op)) != 0)
+		goto err;
+	ret = __dbreg_revoke_id(dbp, 1, DB_LOGFILEID_INVALID);
+
+err:	MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
+	return (ret);
+}
+
+/*
+ * __dbreg_log_close --
+ *
+ * Log a close of a database.  Called when closing a file or when a
+ * replication client is becoming a master.  That closes all the
+ * files it previously had open.
+ *
+ * Assumes caller holds the lp->mutex_filelist lock already.
+ *
+ * PUBLIC: int __dbreg_log_close __P((DB_ENV *, FNAME *,
+ * PUBLIC:    DB_TXN *, u_int32_t));
+ */
+int
+__dbreg_log_close(dbenv, fnp, txn, op)
+	DB_ENV *dbenv;
+	FNAME *fnp;
+	DB_TXN *txn;
+	u_int32_t op;
+{
+	DB_LOG *dblp;
+	DBT fid_dbt, r_name, *dbtp;
+	DB_LSN r_unused;
+	int ret;
+
+	dblp = dbenv->lg_handle;
+	ret = 0;
 
 	if (fnp->name_off == INVALID_ROFF)
 		dbtp = NULL;
@@ -515,14 +550,22 @@ __dbreg_close_id(dbp, txn, op)
 	fid_dbt.data = fnp->ufid;
 	fid_dbt.size = DB_FILE_ID_LEN;
 	if ((ret = __dbreg_register_log(dbenv, txn, &r_unused,
-	    F_ISSET(dbp, DB_AM_NOT_DURABLE) ? DB_LOG_NOT_DURABLE : 0,
+	    F_ISSET(fnp, DB_FNAME_DURABLE) ? 0 : DB_LOG_NOT_DURABLE,
 	    op, dbtp, &fid_dbt, fnp->id,
-	    fnp->s_type, fnp->meta_pgno, TXN_INVALID)) != 0)
-		goto err;
-
-	ret = __dbreg_revoke_id(dbp, 1, DB_LOGFILEID_INVALID);
-
-err:	MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+	    fnp->s_type, fnp->meta_pgno, TXN_INVALID)) != 0) {
+		/*
+		 * We are trying to close, but the log write failed.
+		 * Unfortunately, close needs to plow forward, because
+		 * the application can't do anything with the handle.
+		 * Make the entry in the shared memory region so that
+		 * when we close the environment, we know that this
+		 * happened.  Also, make sure we remove this from the
+		 * per-process table, so that we don't try to close it
+		 * later.
+		 */
+		F_SET(fnp, DB_FNAME_NOTLOGGED);
+		(void)__dbreg_rem_dbentry(dblp, fnp->id);
+	}
 	return (ret);
 }
 
@@ -533,15 +576,17 @@ err:	MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
  * process keeps open files in an array by ID.)  Push them to the stack and
  * pop them from it, managing memory as appropriate.
  *
- * The stack is protected by the fq_mutex, and in both functions we assume
- * that this is already locked.
+ * The stack is protected by the mtx_filelist, and both functions assume it
+ * is already locked.
  */
 static int
-__dbreg_push_id(dbenv, id)
+__dbreg_push_id(dbenv, dbp, id)
 	DB_ENV *dbenv;
+	DB *dbp;
 	int32_t id;
 {
 	DB_LOG *dblp;
+	DB_REP *db_rep;
 	LOG *lp;
 	REGINFO *infop;
 	int32_t *stack, *newstack;
@@ -550,34 +595,37 @@ __dbreg_push_id(dbenv, id)
 	dblp = dbenv->lg_handle;
 	infop = &dblp->reginfo;
 	lp = infop->primary;
+	db_rep = dbenv->rep_handle;
 
-	if (lp->free_fid_stack == INVALID_ROFF) {
-		stack = NULL;
-		DB_ASSERT(lp->free_fids_alloced == 0);
-	} else
-		stack = R_ADDR(infop, lp->free_fid_stack);
-
+	/*
+	 * If our fid generation in replication has changed, this fid should
+	 * not be pushed back onto the stack.
+	 */
+	if (REP_ON(dbenv) && ((REP *)db_rep->region)->gen != dbp->fid_gen)
+		return (0);
 	/* Check if we have room on the stack. */
-	if (lp->free_fids_alloced <= lp->free_fids + 1) {
-		R_LOCK(dbenv, infop);
+	if (lp->free_fid_stack == INVALID_ROFF ||
+	    lp->free_fids_alloced <= lp->free_fids + 1) {
+		LOG_SYSTEM_LOCK(dbenv);
 		if ((ret = __db_shalloc(infop,
 		    (lp->free_fids_alloced + 20) * sizeof(u_int32_t), 0,
 		    &newstack)) != 0) {
-			R_UNLOCK(dbenv, infop);
+			LOG_SYSTEM_UNLOCK(dbenv);
 			return (ret);
 		}
 
-		if (stack != NULL) {
+		if (lp->free_fid_stack != INVALID_ROFF) {
+			stack = R_ADDR(infop, lp->free_fid_stack);
 			memcpy(newstack, stack,
 			    lp->free_fids_alloced * sizeof(u_int32_t));
 			__db_shalloc_free(infop, stack);
 		}
-		stack = newstack;
-		lp->free_fid_stack = R_OFFSET(infop, stack);
+		lp->free_fid_stack = R_OFFSET(infop, newstack);
 		lp->free_fids_alloced += 20;
-		R_UNLOCK(dbenv, infop);
+		LOG_SYSTEM_UNLOCK(dbenv);
 	}
 
+	stack = R_ADDR(infop, lp->free_fid_stack);
 	stack[lp->free_fids++] = id;
 	return (0);
 }
@@ -611,7 +659,7 @@ __dbreg_pop_id(dbenv, id)
  * be on the stack.
  *
  * Returns success whether or not the particular id was found, and like
- * push and pop, assumes that the fq_mutex is locked.
+ * push and pop, assumes that the mtx_filelist is locked.
  */
 static int
 __dbreg_pluck_id(dbenv, id)
@@ -644,3 +692,73 @@ __dbreg_pluck_id(dbenv, id)
 
 	return (0);
 }
+
+/*
+ * __dbreg_log_id --
+ *	Used for in-memory named files.  They are created in mpool and
+ * are given id's early in the open process so that we can read and
+ * create pages in the mpool for the files.  However, at the time that
+ * the mpf is created, the file may not be fully created and/or its
+ * meta-data may not be fully known, so we can't do a full dbregister.
+ * This is a routine exported that will log a complete dbregister
+ * record that will allow for both recovery and replication.
+ *
+ * PUBLIC: int __dbreg_log_id __P((DB *, DB_TXN *, int32_t, int));
+ */
+int
+__dbreg_log_id(dbp, txn, id, needlock)
+	DB *dbp;
+	DB_TXN *txn;
+	int32_t id;
+	int needlock;
+{
+	DBT fid_dbt, r_name;
+	DB_ENV *dbenv;
+	DB_LOG *dblp;
+	DB_LSN unused;
+	FNAME *fnp;
+	LOG *lp;
+	u_int32_t op;
+	int ret;
+
+	dbenv = dbp->dbenv;
+	dblp = dbenv->lg_handle;
+	lp = dblp->reginfo.primary;
+	fnp = dbp->log_filename;
+
+	/* Verify that the fnp has been initialized. */
+	if (fnp->s_type == DB_UNKNOWN) {
+		memcpy(fnp->ufid, dbp->fileid, DB_FILE_ID_LEN);
+		fnp->s_type = dbp->type;
+	}
+
+	/*
+	 * Log the registry.  We should only request a new ID in situations
+	 * where logging is reasonable.
+	 */
+	memset(&fid_dbt, 0, sizeof(fid_dbt));
+	memset(&r_name, 0, sizeof(r_name));
+
+	if (needlock)
+		MUTEX_LOCK(dbenv, lp->mtx_filelist);
+
+	if (fnp->name_off != INVALID_ROFF) {
+		r_name.data = R_ADDR(&dblp->reginfo, fnp->name_off);
+		r_name.size = (u_int32_t)strlen((char *)r_name.data) + 1;
+	}
+
+	fid_dbt.data = dbp->fileid;
+	fid_dbt.size = DB_FILE_ID_LEN;
+
+	op = !F_ISSET(dbp, DB_AM_OPEN_CALLED) ? DBREG_PREOPEN :
+	    (F_ISSET(dbp, DB_AM_INMEM) ? DBREG_REOPEN : DBREG_OPEN);
+	ret = __dbreg_register_log(dbenv, txn, &unused,
+	    F_ISSET(dbp, DB_AM_NOT_DURABLE) ? DB_LOG_NOT_DURABLE : 0,
+	    op, r_name.size == 0 ? NULL : &r_name, &fid_dbt, id,
+	    fnp->s_type, fnp->meta_pgno, fnp->create_txnid);
+
+	if (needlock)
+		MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
+
+	return (ret);
+}
diff --git a/db/dbreg/dbreg.src b/db/dbreg/dbreg.src
index ff3fc2923..6f229e287 100644
--- a/db/dbreg/dbreg.src
+++ b/db/dbreg/dbreg.src
@@ -1,22 +1,15 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: dbreg.src,v 10.26 2004/06/17 17:35:17 bostic Exp $
+ * $Id: dbreg.src,v 12.5 2006/08/24 14:45:31 bostic Exp $
  */
 
 PREFIX	__dbreg
 DBPRIVATE
 
-INCLUDE #ifndef NO_SYSTEM_INCLUDES
-INCLUDE #include 
-INCLUDE
-INCLUDE #include 
-INCLUDE #include 
-INCLUDE #endif
-INCLUDE
 INCLUDE #include "db_int.h"
 INCLUDE #include "dbinc/crypto.h"
 INCLUDE #include "dbinc/db_page.h"
@@ -35,7 +28,7 @@ INCLUDE
  * ftype: database type
  * id: transaction id of the subtransaction that created the fs object
  */
-BEGIN register		2
+BEGIN register		42	2
 ARG	opcode		u_int32_t	lu
 DBT	name		DBT		s
 DBT	uid		DBT		s
diff --git a/db/dbreg/dbreg_auto.c b/db/dbreg/dbreg_auto.c
index a9cc5f704..519786c14 100644
--- a/db/dbreg/dbreg_auto.c
+++ b/db/dbreg/dbreg_auto.c
@@ -2,13 +2,6 @@
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/crypto.h"
 #include "dbinc/db_page.h"
@@ -23,11 +16,11 @@
  * PUBLIC:     int32_t, DBTYPE, db_pgno_t, u_int32_t));
  */
 int
-__dbreg_register_log(dbenv, txnid, ret_lsnp, flags,
+__dbreg_register_log(dbenv, txnp, ret_lsnp, flags,
     opcode, name, uid, fileid, ftype, meta_pgno,
     id)
 	DB_ENV *dbenv;
-	DB_TXN *txnid;
+	DB_TXN *txnp;
 	DB_LSN *ret_lsnp;
 	u_int32_t flags;
 	u_int32_t opcode;
@@ -55,29 +48,30 @@ __dbreg_register_log(dbenv, txnid, ret_lsnp, flags,
 	ret = 0;
 
 	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
-		if (txnid == NULL)
+		if (txnp == NULL)
+			return (0);
+		if (txnp == NULL)
 			return (0);
 		is_durable = 0;
 	} else
 		is_durable = 1;
 
-	if (txnid == NULL) {
+	if (txnp == NULL) {
 		txn_num = 0;
 		lsnp = &null_lsn;
 		null_lsn.file = null_lsn.offset = 0;
 	} else {
-		if (TAILQ_FIRST(&txnid->kids) != NULL &&
-		    (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+		if (TAILQ_FIRST(&txnp->kids) != NULL &&
+		    (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
 			return (ret);
 		/*
 		 * We need to assign begin_lsn while holding region mutex.
 		 * That assignment is done inside the DbEnv->log_put call,
 		 * so pass in the appropriate memory location to be filled
 		 * in by the log_put code.
-		*/
-		DB_SET_BEGIN_LSNP(txnid, &rlsnp);
-		txn_num = txnid->txnid;
-		lsnp = &txnid->last_lsn;
+		 */
+		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+		txn_num = txnp->txnid;
 	}
 
 	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
@@ -94,7 +88,7 @@ __dbreg_register_log(dbenv, txnid, ret_lsnp, flags,
 		logrec.size += npad;
 	}
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret =
 		    __os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
 			return (ret);
@@ -168,12 +162,13 @@ __dbreg_register_log(dbenv, txnid, ret_lsnp, flags,
 	memcpy(bp, &uinttmp, sizeof(uinttmp));
 	bp += sizeof(uinttmp);
 
-	DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+	DB_ASSERT(dbenv,
+	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
 
-	if (is_durable || txnid == NULL) {
+	if (is_durable || txnp == NULL) {
 		if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
-		    flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
-			txnid->last_lsn = *rlsnp;
+		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+			*lsnp = *rlsnp;
 			if (rlsnp != ret_lsnp)
 				 *ret_lsnp = *rlsnp;
 		}
@@ -192,20 +187,21 @@ __dbreg_register_log(dbenv, txnid, ret_lsnp, flags,
 #else
 		ret = 0;
 #endif
-		STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
 		LSN_NOT_LOGGED(*ret_lsnp);
 	}
 
 #ifdef LOG_DIAGNOSTIC
 	if (ret != 0)
 		(void)__dbreg_register_print(dbenv,
-		    (DBT *)&logrec, ret_lsnp, NULL, NULL);
+		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
 #endif
 
 #ifdef DIAGNOSTIC
 	__os_free(dbenv, logrec.data);
 #else
-	if (is_durable || txnid == NULL)
+	if (is_durable || txnp == NULL)
 		__os_free(dbenv, logrec.data);
 #endif
 	return (ret);
@@ -230,13 +226,14 @@ __dbreg_register_read(dbenv, recbuf, argpp)
 	    sizeof(__dbreg_register_args) + sizeof(DB_TXN), &argp)) != 0)
 		return (ret);
 	bp = recbuf;
-	argp->txnid = (DB_TXN *)&argp[1];
+	argp->txnp = (DB_TXN *)&argp[1];
+	memset(argp->txnp, 0, sizeof(DB_TXN));
 
 	memcpy(&argp->type, bp, sizeof(argp->type));
 	bp += sizeof(argp->type);
 
-	memcpy(&argp->txnid->txnid,  bp, sizeof(argp->txnid->txnid));
-	bp += sizeof(argp->txnid->txnid);
+	memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+	bp += sizeof(argp->txnp->txnid);
 
 	memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
 	bp += sizeof(DB_LSN);
diff --git a/db/dbreg/dbreg_autop.c b/db/dbreg/dbreg_autop.c
index 3889b357d..b2e12e2d4 100644
--- a/db/dbreg/dbreg_autop.c
+++ b/db/dbreg/dbreg_autop.c
@@ -2,13 +2,6 @@
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/crypto.h"
 #include "dbinc/db_page.h"
@@ -34,20 +27,18 @@ __dbreg_register_print(dbenv, dbtp, lsnp, notused2, notused3)
 	int ch;
 	int ret;
 
-	notused2 = DB_TXN_ABORT;
+	notused2 = DB_TXN_PRINT;
 	notused3 = NULL;
 
 	if ((ret = __dbreg_register_read(dbenv, dbtp->data, &argp)) != 0)
 		return (ret);
 	(void)printf(
-	    "[%lu][%lu]__dbreg_register%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
-	    (u_long)lsnp->file,
-	    (u_long)lsnp->offset,
+    "[%lu][%lu]__dbreg_register%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
+	    (u_long)lsnp->file, (u_long)lsnp->offset,
 	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
 	    (u_long)argp->type,
-	    (u_long)argp->txnid->txnid,
-	    (u_long)argp->prev_lsn.file,
-	    (u_long)argp->prev_lsn.offset);
+	    (u_long)argp->txnp->txnid,
+	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
 	(void)printf("\topcode: %lu\n", (u_long)argp->opcode);
 	(void)printf("\tname: ");
 	for (i = 0; i < argp->name.size; i++) {
diff --git a/db/dbreg/dbreg_rec.c b/db/dbreg/dbreg_rec.c
index 07b175a1f..180239842 100644
--- a/db/dbreg/dbreg_rec.c
+++ b/db/dbreg/dbreg_rec.c
@@ -1,8 +1,8 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
  */
 /*
  * Copyright (c) 1995, 1996
@@ -32,23 +32,15 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: dbreg_rec.c,v 11.133 2004/09/24 00:43:18 bostic Exp $
+ * $Id: dbreg_rec.c,v 12.17 2006/09/07 20:05:28 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
-#include "dbinc/db_shash.h"
 #include "dbinc/db_am.h"
 #include "dbinc/log.h"
-#include "dbinc/mp.h"
 #include "dbinc/txn.h"
 
 static int __dbreg_open_file __P((DB_ENV *,
@@ -84,11 +76,19 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 		goto out;
 
 	switch (argp->opcode) {
+	case DBREG_REOPEN:
+	case DBREG_PREOPEN:
 	case DBREG_OPEN:
+		/*
+		 * In general, we redo the open on REDO and abort on UNDO.
+		 * However, a reopen is a second instance of an open of
+		 * in-memory files and we don't want to close them yet
+		 * on abort, so just skip that here.
+		 */
 		if ((DB_REDO(op) ||
 		    op == DB_TXN_OPENFILES || op == DB_TXN_POPENFILES))
 			do_open = 1;
-		else
+		else if (argp->opcode != DBREG_REOPEN)
 			do_close = 1;
 		break;
 	case DBREG_CLOSE:
@@ -117,9 +117,8 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 			do_open = 1;
 		break;
 	default:
-		DB_ASSERT(0);
-		ret = EINVAL;
-		break;
+		ret = __db_unknown_path(dbenv, "__dbreg_register_recover");
+		goto out;
 	}
 
 	if (do_open) {
@@ -137,7 +136,7 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 		 */
 		ret = __dbreg_open_file(dbenv,
 		    op == DB_TXN_ABORT || op == DB_TXN_POPENFILES ?
-		    argp->txnid : NULL, argp, info);
+		    argp->txnp : NULL, argp, info);
 		if (ret == DB_PAGE_NOTFOUND && argp->meta_pgno != PGNO_BASE_MD)
 			ret = ENOENT;
 		if (ret == ENOENT || ret == EINVAL) {
@@ -149,7 +148,7 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 			 * for that case and possibly retry.
 			 */
 			if (op == DB_TXN_FORWARD_ROLL &&
-			    argp->txnid != 0 &&
+			    argp->txnp != 0 &&
 			    dblp->dbentry[argp->fileid].deleted) {
 				dblp->dbentry[argp->fileid].deleted = 0;
 				ret =
@@ -172,7 +171,9 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 	if (do_close) {
 		/*
 		 * If we are undoing an open, or redoing a close,
-		 * then we need to close the file.
+		 * then we need to close the file.  If we are simply
+		 * revoking then we just need to grab the DBP and revoke
+		 * the log id.
 		 *
 		 * If the file is deleted, then we can just ignore this close.
 		 * Otherwise, we should usually have a valid dbp we should
@@ -181,7 +182,7 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 		 * fact, not have the file open, and that's OK.
 		 */
 		do_rem = 0;
-		MUTEX_THREAD_LOCK(dbenv, dblp->mutexp);
+		MUTEX_LOCK(dbenv, dblp->mtx_dbreg);
 		if (argp->fileid < dblp->dbentry_cnt) {
 			/*
 			 * Typically, closes should match an open which means
@@ -205,13 +206,12 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 				if ((DB_REDO(op) &&
 				    argp->opcode != DBREG_RCLOSE) ||
 				    argp->opcode == DBREG_CHKPNT) {
-					__db_err(dbenv,
-					    "Improper file close at %lu/%lu",
+					__db_errx(dbenv,
+				    "Warning: Improper file close at %lu/%lu",
 					    (u_long)lsnp->file,
 					    (u_long)lsnp->offset);
-					ret = EINVAL;
 				}
-				MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+				MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 				goto done;
 			}
 
@@ -228,7 +228,7 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 				 */
 				do_rem = F_ISSET(dbp, DB_AM_RECOVER) ||
 				    op == DB_TXN_ABORT;
-				MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+				MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 				if (op == DB_TXN_ABORT)
 					(void)__dbreg_close_id(dbp,
 					    NULL, DBREG_RCLOSE);
@@ -236,11 +236,13 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 					(void)__dbreg_revoke_id(dbp, 0,
 					    DB_LOGFILEID_INVALID);
 			} else if (dbe->deleted) {
-				MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
-				__dbreg_rem_dbentry(dblp, argp->fileid);
+				MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
+				if ((ret = __dbreg_rem_dbentry(
+				    dblp, argp->fileid)) != 0)
+					goto out;
 			}
 		} else
-			MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+			MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 
 		/*
 		 * During recovery, all files are closed.  On an abort, we only
@@ -262,7 +264,7 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 		if (do_rem && dbp != NULL) {
 			if (argp->id != TXN_INVALID) {
 				if ((ret = __db_txnlist_find(dbenv,
-				    info, argp->txnid->txnid, &status))
+				    info, argp->txnp->txnid, &status))
 				    != DB_NOTFOUND && ret != 0)
 					goto out;
 				if (ret == DB_NOTFOUND || status != TXN_COMMIT)
@@ -273,7 +275,7 @@ __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 			if (op == DB_TXN_ABORT &&
 			    !F_ISSET(dbp, DB_AM_RECOVER)) {
 				if ((t_ret = __db_refresh(dbp,
-				    NULL, DB_NOSYNC, NULL)) != 0 && ret == 0)
+				    NULL, DB_NOSYNC, NULL, 0)) != 0 && ret == 0)
 					ret = t_ret;
 			} else {
 				if (op == DB_TXN_APPLY &&
@@ -311,27 +313,29 @@ __dbreg_open_file(dbenv, txn, argp, info)
 	u_int32_t id, status;
 	int ret;
 
-	dblp = (DB_LOG *)dbenv->lg_handle;
+	dblp = dbenv->lg_handle;
 
 	/*
 	 * When we're opening, we have to check that the name we are opening
 	 * is what we expect.  If it's not, then we close the old file and
 	 * open the new one.
 	 */
-	MUTEX_THREAD_LOCK(dbenv, dblp->mutexp);
-	if (argp->fileid < dblp->dbentry_cnt)
+	MUTEX_LOCK(dbenv, dblp->mtx_dbreg);
+	if (argp->fileid != DB_LOGFILEID_INVALID &&
+	    argp->fileid < dblp->dbentry_cnt)
 		dbe = &dblp->dbentry[argp->fileid];
 	else
 		dbe = NULL;
 
 	if (dbe != NULL) {
 		if (dbe->deleted) {
-			MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+			MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 			return (ENOENT);
 		}
 
 		/*
-		 * At the end of OPENFILES, we may have a file open.  The
+		 * At the end of OPENFILES, we may have a file open.  If this
+		 * is a reopen, then we will always close and reopen.  If the
 		 * open was part of a committed transaction, so it doesn't
 		 * get undone.  However, if the fileid was previously used,
 		 * we'll see a close that may need to get undone.  There are
@@ -342,11 +346,12 @@ __dbreg_open_file(dbenv, txn, argp, info)
 		 * which case it should never be opened during recovery.
 		 */
 		if ((dbp = dbe->dbp) != NULL) {
-			if (dbp->meta_pgno != argp->meta_pgno ||
+			if (argp->opcode == DBREG_REOPEN ||
+			    dbp->meta_pgno != argp->meta_pgno ||
 			    argp->name.size == 0 ||
 			    memcmp(dbp->fileid, argp->uid.data,
 			    DB_FILE_ID_LEN) != 0) {
-				MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+				MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 				(void)__dbreg_revoke_id(dbp, 0,
 				    DB_LOGFILEID_INVALID);
 				if (F_ISSET(dbp, DB_AM_RECOVER))
@@ -359,8 +364,8 @@ __dbreg_open_file(dbenv, txn, argp, info)
 			 * dbp from an openfiles pass, in which case, what's
 			 * here had better be the same dbp.
 			 */
-			DB_ASSERT(dbe->dbp == dbp);
-			MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+			DB_ASSERT(dbenv, dbe->dbp == dbp);
+			MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 
 			/*
 			 * This is a successful open.  We need to record that
@@ -375,7 +380,7 @@ __dbreg_open_file(dbenv, txn, argp, info)
 		}
 	}
 
-	MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+	MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 
 reopen:
 	/*
@@ -402,6 +407,6 @@ reopen:
 	}
 
 	return (__dbreg_do_open(dbenv,
-	    txn, dblp, argp->uid.data, argp->name.data,
-	    argp->ftype, argp->fileid, argp->meta_pgno, info, argp->id));
+	    txn, dblp, argp->uid.data, argp->name.data, argp->ftype,
+	    argp->fileid, argp->meta_pgno, info, argp->id, argp->opcode));
 }
diff --git a/db/dbreg/dbreg_stat.c b/db/dbreg/dbreg_stat.c
index dd53b77c3..c19adc688 100644
--- a/db/dbreg/dbreg_stat.c
+++ b/db/dbreg/dbreg_stat.c
@@ -1,19 +1,14 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: dbreg_stat.c,v 11.48 2004/10/15 16:59:41 bostic Exp $
+ * $Id: dbreg_stat.c,v 12.9 2006/08/24 14:45:32 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
@@ -21,6 +16,28 @@
 #include "dbinc/txn.h"
 
 #ifdef HAVE_STATISTICS
+static int __dbreg_print_dblist __P((DB_ENV *, u_int32_t));
+
+/*
+ * __dbreg_stat_print --
+ *	Print the dbreg statistics.
+ *
+ * PUBLIC: int __dbreg_stat_print __P((DB_ENV *, u_int32_t));
+ */
+int
+__dbreg_stat_print(dbenv, flags)
+	DB_ENV *dbenv;
+	u_int32_t flags;
+{
+	int ret;
+
+	if (LF_ISSET(DB_STAT_ALL) &&
+	    (ret = __dbreg_print_dblist(dbenv, flags)) != 0)
+		return (ret);
+
+	return (0);
+}
+
 /*
  * __dbreg_print_fname --
  *	Display the contents of an FNAME structure.
@@ -32,22 +49,26 @@ __dbreg_print_fname(dbenv, fnp)
 	DB_ENV *dbenv;
 	FNAME *fnp;
 {
+	static const FN fn[] = {
+		{ DB_FNAME_DURABLE,	"DB_FNAME_DURABLE" },
+		{ DB_FNAME_NOTLOGGED,	"DB_FNAME_NOTLOGGED" },
+		{ 0,			NULL }
+	};
+
 	__db_msg(dbenv, "%s", DB_GLOBAL(db_line));
 	__db_msg(dbenv, "DB handle FNAME contents:");
 	STAT_LONG("log ID", fnp->id);
 	STAT_ULONG("Meta pgno", fnp->meta_pgno);
 	__db_print_fileid(dbenv, fnp->ufid, "\tFile ID");
 	STAT_ULONG("create txn", fnp->create_txnid);
-	STAT_LONG("durable", fnp->is_durable);
+	__db_prflags(dbenv, NULL, fnp->flags, fn, NULL, "\tFlags");
 }
 
 /*
  * __dbreg_print_dblist --
  *	Display the DB_ENV's list of files.
- *
- * PUBLIC: void __dbreg_print_dblist __P((DB_ENV *, u_int32_t));
  */
-void
+static int
 __dbreg_print_dblist(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
@@ -64,13 +85,14 @@ __dbreg_print_dblist(dbenv, flags)
 
 	__db_msg(dbenv, "%s", DB_GLOBAL(db_line));
 	__db_msg(dbenv, "LOG FNAME list:");
-	__db_print_mutex(dbenv, NULL, &lp->fq_mutex, "File name mutex", flags);
+	__mutex_print_debug_single(
+	    dbenv, "File name mutex", lp->mtx_filelist, flags);
 
 	STAT_LONG("Fid max", lp->fid_max);
 
-	MUTEX_LOCK(dbenv, &lp->fq_mutex);
-	for (first = 1, fnp = SH_TAILQ_FIRST(&lp->fq, __fname);
-	    fnp != NULL; fnp = SH_TAILQ_NEXT(fnp, q, __fname)) {
+	MUTEX_LOCK(dbenv, lp->mtx_filelist);
+	first = 1;
+	SH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname) {
 		if (first) {
 			first = 0;
 			__db_msg(dbenv,
@@ -92,6 +114,8 @@ __dbreg_print_dblist(dbenv, flags)
 		    dbp == NULL ? "No DBP" : "DBP", del, P_TO_ULONG(dbp),
 		    (u_long)(dbp == NULL ? 0 : dbp->flags));
 	}
-	MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+	MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
+
+	return (0);
 }
 #endif
diff --git a/db/dbreg/dbreg_util.c b/db/dbreg/dbreg_util.c
index 6f1cc9297..5037810c1 100644
--- a/db/dbreg/dbreg_util.c
+++ b/db/dbreg/dbreg_util.c
@@ -1,23 +1,20 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1997-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 1997-2006
+ *	Oracle Corporation.  All rights reserved.
  *
- * $Id: dbreg_util.c,v 11.50 2004/10/15 16:59:41 bostic Exp $
+ * $Id: dbreg_util.c,v 12.20 2006/09/09 14:28:22 bostic Exp $
  */
 
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
+#include "dbinc/fop.h"
 #include "dbinc/log.h"
+#include "dbinc/mp.h"
 #include "dbinc/txn.h"
 
 static int __dbreg_check_master __P((DB_ENV *, u_int8_t *, char *));
@@ -40,7 +37,7 @@ __dbreg_add_dbentry(dbenv, dblp, dbp, ndx)
 
 	ret = 0;
 
-	MUTEX_THREAD_LOCK(dbenv, dblp->mutexp);
+	MUTEX_LOCK(dbenv, dblp->mtx_dbreg);
 
 	/*
 	 * Check if we need to grow the table.  Note, ndx is 0-based (the
@@ -61,11 +58,11 @@ __dbreg_add_dbentry(dbenv, dblp, dbp, ndx)
 		dblp->dbentry_cnt = i;
 	}
 
-	DB_ASSERT(dblp->dbentry[ndx].dbp == NULL);
+	DB_ASSERT(dbenv, dblp->dbentry[ndx].dbp == NULL);
 	dblp->dbentry[ndx].deleted = dbp == NULL;
 	dblp->dbentry[ndx].dbp = dbp;
 
-err:	MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+err:	MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 	return (ret);
 }
 
@@ -73,19 +70,21 @@ err:	MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
  * __dbreg_rem_dbentry
  *	Remove an entry from the DB entry table.
  *
- * PUBLIC: void __dbreg_rem_dbentry __P((DB_LOG *, int32_t));
+ * PUBLIC: int __dbreg_rem_dbentry __P((DB_LOG *, int32_t));
  */
-void
+int
 __dbreg_rem_dbentry(dblp, ndx)
 	DB_LOG *dblp;
 	int32_t ndx;
 {
-	MUTEX_THREAD_LOCK(dblp->dbenv, dblp->mutexp);
+	MUTEX_LOCK(dblp->dbenv, dblp->mtx_dbreg);
 	if (dblp->dbentry_cnt > ndx) {
 		dblp->dbentry[ndx].dbp = NULL;
 		dblp->dbentry[ndx].deleted = 0;
 	}
-	MUTEX_THREAD_UNLOCK(dblp->dbenv, dblp->mutexp);
+	MUTEX_UNLOCK(dblp->dbenv, dblp->mtx_dbreg);
+
+	return (0);
 }
 
 /*
@@ -110,11 +109,12 @@ __dbreg_log_files(dbenv)
 
 	ret = 0;
 
-	MUTEX_LOCK(dbenv, &lp->fq_mutex);
-
-	for (fnp = SH_TAILQ_FIRST(&lp->fq, __fname);
-	    fnp != NULL; fnp = SH_TAILQ_NEXT(fnp, q, __fname)) {
+	MUTEX_LOCK(dbenv, lp->mtx_filelist);
 
+	SH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname) {
+		/* This id was revoked by a switch in replication master. */
+		if (fnp->id == DB_LOGFILEID_INVALID)
+			continue;
 		if (fnp->name_off == INVALID_ROFF)
 			dbtp = NULL;
 		else {
@@ -136,14 +136,14 @@ __dbreg_log_files(dbenv)
 		 */
 		if ((ret = __dbreg_register_log(dbenv,
 		    NULL, &r_unused,
-		    fnp->is_durable ? 0 : DB_LOG_NOT_DURABLE,
+		    F_ISSET(fnp, DB_FNAME_DURABLE) ? 0 : DB_LOG_NOT_DURABLE,
 		    F_ISSET(dblp, DBLOG_RECOVER) ? DBREG_RCLOSE : DBREG_CHKPNT,
 		    dbtp, &fid_dbt, fnp->id, fnp->s_type, fnp->meta_pgno,
 		    TXN_INVALID)) != 0)
 			break;
 	}
 
-	MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+	MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 
 	return (ret);
 }
@@ -173,7 +173,8 @@ __dbreg_close_files(dbenv)
 
 	dblp = dbenv->lg_handle;
 	ret = 0;
-	MUTEX_THREAD_LOCK(dbenv, dblp->mutexp);
+
+	MUTEX_LOCK(dbenv, dblp->mtx_dbreg);
 	for (i = 0; i < dblp->dbentry_cnt; i++) {
 		/*
 		 * We only want to close dbps that recovery opened.  Any
@@ -182,6 +183,12 @@ __dbreg_close_files(dbenv)
 		 * Before doing so, we need to revoke their log fileids
 		 * so that we don't end up leaving around FNAME entries
 		 * for dbps that shouldn't have them.
+		 *
+		 * Any FNAME entries that were marked NOTLOGGED had the
+		 * log write fail while they were being closed.  Since it's
+		 * too late to be logging now we flag that as a failure
+		 * so recovery will be run.  This will get returned by
+		 * __dbreg_revoke_id.
 		 */
 		if ((dbp = dblp->dbentry[i].dbp) != NULL) {
 			/*
@@ -195,7 +202,7 @@ __dbreg_close_files(dbenv)
 			 * we're in this loop anyway--we're in the process of
 			 * making all outstanding dbps invalid.
 			 */
-			MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+			MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 			if (F_ISSET(dbp, DB_AM_RECOVER))
 				t_ret = __db_close(dbp,
 				     NULL, dbp->mpf == NULL ? DB_NOSYNC : 0);
@@ -204,13 +211,52 @@ __dbreg_close_files(dbenv)
 				     dbp, 0, DB_LOGFILEID_INVALID);
 			if (ret == 0)
 				ret = t_ret;
-			MUTEX_THREAD_LOCK(dbenv, dblp->mutexp);
+			MUTEX_LOCK(dbenv, dblp->mtx_dbreg);
 		}
 
 		dblp->dbentry[i].deleted = 0;
 		dblp->dbentry[i].dbp = NULL;
 	}
-	MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+	MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
+	return (ret);
+}
+
+/*
+ * __dbreg_invalidate_files --
+ *	Invalidate files when we change replication roles.  Save the
+ * id so that another process will be able to clean up the information
+ * when it notices.
+ *
+ * PUBLIC: int __dbreg_invalidate_files __P((DB_ENV *));
+ */
+int
+__dbreg_invalidate_files(dbenv)
+	DB_ENV *dbenv;
+{
+	DB_LOG *dblp;
+	FNAME *fnp;
+	LOG *lp;
+	int ret;
+
+	/* If we haven't initialized logging, we have nothing to do. */
+	if (!LOGGING_ON(dbenv))
+		return (0);
+
+	dblp = dbenv->lg_handle;
+	lp = dblp->reginfo.primary;
+
+	ret = 0;
+	MUTEX_LOCK(dbenv, lp->mtx_filelist);
+	SH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname) {
+		if (fnp->id != DB_LOGFILEID_INVALID) {
+			if ((ret = __dbreg_log_close(dbenv,
+			    fnp, NULL, DBREG_RCLOSE)) != 0)
+				goto err;
+			fnp->old_id = fnp->id;
+			fnp->id = DB_LOGFILEID_INVALID;
+		}
+	}
+err:	MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 	return (ret);
 }
 
@@ -261,7 +307,7 @@ __dbreg_id_to_db_int(dbenv, txn, dbpp, ndx, inc, tryopen)
 	dblp = dbenv->lg_handle;
 	COMPQUIET(inc, 0);
 
-	MUTEX_THREAD_LOCK(dbenv, dblp->mutexp);
+	MUTEX_LOCK(dbenv, dblp->mtx_dbreg);
 
 	/*
 	 * Under XA, a process different than the one issuing DB operations
@@ -277,12 +323,12 @@ __dbreg_id_to_db_int(dbenv, txn, dbpp, ndx, inc, tryopen)
 		}
 
 		/*
-		 * __dbreg_id_to_fname acquires the region's fq_mutex,
-		 * which we can't safely acquire while we hold the thread lock.
-		 * We no longer need it anyway--the dbentry table didn't
-		 * have what we needed.
+		 * __dbreg_id_to_fname acquires the mtx_filelist mutex, which
+		 * we can't safely acquire while we hold the thread lock.  We
+		 * no longer need it anyway--the dbentry table didn't have what
+		 * we needed.
 		 */
-		MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+		MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 
 		if (__dbreg_id_to_fname(dblp, ndx, 0, &fname) != 0)
 			/*
@@ -294,11 +340,11 @@ __dbreg_id_to_db_int(dbenv, txn, dbpp, ndx, inc, tryopen)
 			return (ENOENT);
 
 		/*
-		 * Note that we're relying on fname not to change, even
-		 * though we released the mutex that protects it (fq_mutex)
-		 * inside __dbreg_id_to_fname.  This should be a safe
-		 * assumption, because the other process that has the file
-		 * open shouldn't be closing it while we're trying to abort.
+		 * Note that we're relying on fname not to change, even though
+		 * we released the mutex that protects it (mtx_filelist) inside
+		 * __dbreg_id_to_fname.  This should be a safe assumption, the
+		 * other process that has the file open shouldn't be closing it
+		 * while we're trying to abort.
 		 */
 		name = R_ADDR(&dblp->reginfo, fname->name_off);
 
@@ -313,7 +359,7 @@ __dbreg_id_to_db_int(dbenv, txn, dbpp, ndx, inc, tryopen)
 		 */
 		if ((ret = __dbreg_do_open(dbenv, txn, dblp,
 		    fname->ufid, name, fname->s_type,
-		    ndx, fname->meta_pgno, NULL, 0)) != 0)
+		    ndx, fname->meta_pgno, NULL, 0, DBREG_OPEN)) != 0)
 			return (ret);
 
 		*dbpp = dblp->dbentry[ndx].dbp;
@@ -331,8 +377,20 @@ __dbreg_id_to_db_int(dbenv, txn, dbpp, ndx, inc, tryopen)
 	/* It's an error if we don't have a corresponding writeable DB. */
 	if ((*dbpp = dblp->dbentry[ndx].dbp) == NULL)
 		ret = ENOENT;
+	else
+		/*
+		 * If we are in recovery, then set that the file has
+		 * been written.  It is possible to run recovery,
+		 * find all the pages in their post update state
+		 * in the OS buffer pool, put a checkpoint in the log
+		 * and then crash the system without forcing the pages
+		 * to disk. If this is an in-memory file, we may not have
+		 * an mpf yet.
+		 */
+		if ((*dbpp)->mpf != NULL && (*dbpp)->mpf->mfp != NULL)
+			(*dbpp)->mpf->mfp->file_written = 1;
 
-err:	MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
+err:	MUTEX_UNLOCK(dbenv, dblp->mtx_dbreg);
 	return (ret);
 }
 
@@ -361,17 +419,15 @@ __dbreg_id_to_fname(dblp, id, have_lock, fnamep)
 	ret = -1;
 
 	if (!have_lock)
-		MUTEX_LOCK(dbenv, &lp->fq_mutex);
-	for (fnp = SH_TAILQ_FIRST(&lp->fq, __fname);
-	    fnp != NULL; fnp = SH_TAILQ_NEXT(fnp, q, __fname)) {
+		MUTEX_LOCK(dbenv, lp->mtx_filelist);
+	SH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname)
 		if (fnp->id == id) {
 			*fnamep = fnp;
 			ret = 0;
 			break;
 		}
-	}
 	if (!have_lock)
-		MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+		MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 
 	return (ret);
 }
@@ -400,17 +456,15 @@ __dbreg_fid_to_fname(dblp, fid, have_lock, fnamep)
 	ret = -1;
 
 	if (!have_lock)
-		MUTEX_LOCK(dbenv, &lp->fq_mutex);
-	for (fnp = SH_TAILQ_FIRST(&lp->fq, __fname);
-	    fnp != NULL; fnp = SH_TAILQ_NEXT(fnp, q, __fname)) {
+		MUTEX_LOCK(dbenv, lp->mtx_filelist);
+	SH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname)
 		if (memcmp(fnp->ufid, fid, DB_FILE_ID_LEN) == 0) {
 			*fnamep = fnp;
 			ret = 0;
 			break;
 		}
-	}
 	if (!have_lock)
-		MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+		MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 
 	return (ret);
 }
@@ -448,11 +502,12 @@ __dbreg_get_name(dbenv, fid, namep)
  *	Open files referenced in the log.  This is the part of the open that
  * is not protected by the thread mutex.
  * PUBLIC: int __dbreg_do_open __P((DB_ENV *, DB_TXN *, DB_LOG *, u_int8_t *,
- * PUBLIC:     char *, DBTYPE, int32_t, db_pgno_t, void *, u_int32_t));
+ * PUBLIC:     char *, DBTYPE, int32_t, db_pgno_t, void *, u_int32_t,
+ * PUBLIC:     u_int32_t));
  */
 int
 __dbreg_do_open(dbenv,
-    txn, lp, uid, name, ftype, ndx, meta_pgno, info, id)
+    txn, lp, uid, name, ftype, ndx, meta_pgno, info, id, opcode)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	DB_LOG *lp;
@@ -462,12 +517,16 @@ __dbreg_do_open(dbenv,
 	int32_t ndx;
 	db_pgno_t meta_pgno;
 	void *info;
-	u_int32_t id;
+	u_int32_t id, opcode;
 {
 	DB *dbp;
 	u_int32_t cstat, ret_stat;
 	int ret;
+	char *dname, *fname;
 
+	cstat = TXN_EXPECTED;
+	fname = name;
+	dname = NULL;
 	if ((ret = db_create(&dbp, lp->dbenv, 0)) != 0)
 		return (ret);
 
@@ -490,9 +549,24 @@ __dbreg_do_open(dbenv,
 		memcpy(dbp->fileid, uid, DB_FILE_ID_LEN);
 		dbp->meta_pgno = meta_pgno;
 	}
-	if ((ret = __db_open(dbp, txn, name, NULL,
-	    ftype, DB_ODDFILESIZE, __db_omode("rw----"), meta_pgno)) == 0) {
+	if (opcode == DBREG_PREOPEN) {
+		dbp->type = ftype;
+		if ((ret = __dbreg_setup(dbp, name, id)) != 0)
+			goto err;
+		MAKE_INMEM(dbp);
+		goto skip_open;
+	}
+
+	if (opcode == DBREG_REOPEN) {
+		MAKE_INMEM(dbp);
+		fname = NULL;
+		dname = name;
+	}
 
+	if ((ret = __db_open(dbp, txn, fname, dname, ftype,
+	    DB_DURABLE_UNKNOWN | DB_ODDFILESIZE,
+	    __db_omode(OWNER_RW), meta_pgno)) == 0) {
+skip_open:
 		/*
 		 * Verify that we are opening the same file that we were
 		 * referring to when we wrote this log record.
@@ -500,7 +574,7 @@ __dbreg_do_open(dbenv,
 		if ((meta_pgno != PGNO_BASE_MD &&
 		    __dbreg_check_master(dbenv, uid, name) != 0) ||
 		    memcmp(uid, dbp->fileid, DB_FILE_ID_LEN) != 0)
-			cstat = TXN_IGNORE;
+			cstat = TXN_UNEXPECTED;
 		else
 			cstat = TXN_EXPECTED;
 
@@ -518,7 +592,7 @@ __dbreg_do_open(dbenv,
 			ret = __db_txnlist_update(dbenv,
 			    info, id, cstat, NULL, &ret_stat, 1);
 
-err:		if (cstat == TXN_IGNORE)
+err:		if (cstat == TXN_UNEXPECTED)
 			goto not_right;
 		return (ret);
 	} else if (ret == ENOENT) {
@@ -547,8 +621,8 @@ __dbreg_check_master(dbenv, uid, name)
 	if ((ret = db_create(&dbp, dbenv, 0)) != 0)
 		return (ret);
 	F_SET(dbp, DB_AM_RECOVER);
-	ret = __db_open(dbp,
-	    NULL, name, NULL, DB_BTREE, 0, __db_omode("rw----"), PGNO_BASE_MD);
+	ret = __db_open(dbp, NULL,
+	    name, NULL, DB_BTREE, 0, __db_omode(OWNER_RW), PGNO_BASE_MD);
 
 	if (ret == 0 && memcmp(uid, dbp->fileid, DB_FILE_ID_LEN) != 0)
 		ret = EINVAL;
@@ -569,6 +643,10 @@ __dbreg_check_master(dbenv, uid, name)
  * at this point we have no way of knowing whether the log record that incited
  * us to call this will be part of a committed transaction.
  *
+ *	We first revoke any old id this handle may have had.  That can happen
+ * if a master becomes a client and then becomes a master again and
+ * there are other processes with valid open handles to this env.
+ *
  * PUBLIC: int __dbreg_lazy_id __P((DB *));
  */
 int
@@ -585,20 +663,28 @@ __dbreg_lazy_id(dbp)
 
 	dbenv = dbp->dbenv;
 
-	DB_ASSERT(IS_REP_MASTER(dbenv));
+	DB_ASSERT(dbenv, IS_REP_MASTER(dbenv));
 
 	dbenv = dbp->dbenv;
 	dblp = dbenv->lg_handle;
 	lp = dblp->reginfo.primary;
 	fnp = dbp->log_filename;
 
-	/* The fq_mutex protects the FNAME list and id management. */
-	MUTEX_LOCK(dbenv, &lp->fq_mutex);
+	/* The mtx_filelist protects the FNAME list and id management. */
+	MUTEX_LOCK(dbenv, lp->mtx_filelist);
 	if (fnp->id != DB_LOGFILEID_INVALID) {
-		MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+		MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 		return (0);
 	}
 	id = DB_LOGFILEID_INVALID;
+	/*
+	 * When we became master we moved the fnp->id to old_id in
+	 * every FNAME structure that was open.  If our id was changed,
+	 * we need to revoke and give back that id.
+	 */
+	if (fnp->old_id != DB_LOGFILEID_INVALID &&
+	    (ret = __dbreg_revoke_id(dbp, 1, DB_LOGFILEID_INVALID)) != 0)
+		goto err;
 	if ((ret = __txn_begin(dbenv, NULL, &txn, 0)) != 0)
 		goto err;
 
@@ -612,7 +698,7 @@ __dbreg_lazy_id(dbp)
 
 	/*
 	 * All DB related logging routines check the id value *without*
-	 * holding the fq_mutex to know whether we need to call
+	 * holding the mtx_filelist to know whether we need to call
 	 * dbreg_lazy_id to begin with.  We must set the ID after a
 	 * *successful* commit so that there is no possibility of a second
 	 * modification call finding a valid ID in the dbp before the
@@ -624,6 +710,6 @@ __dbreg_lazy_id(dbp)
 err:
 	if (ret != 0 && id != DB_LOGFILEID_INVALID)
 		(void)__dbreg_revoke_id(dbp, 1, id);
-	MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
+	MUTEX_UNLOCK(dbenv, lp->mtx_filelist);
 	return (ret);
 }
diff --git a/db/dist/Makefile.in b/db/dist/Makefile.in
index cf484b6bf..190103e6b 100644
--- a/db/dist/Makefile.in
+++ b/db/dist/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 11.264 2004/11/01 21:55:33 mark Exp $
+# $Id: Makefile.in,v 12.79 2006/09/13 14:53:38 mjc Exp $
 
 srcdir=	@srcdir@/..
 builddir=.
@@ -22,15 +22,15 @@ transform=@program_transform_name@
 ##################################################
 # Paths for standard user-level commands.
 ##################################################
+AR=	@AR@
+CHMOD=	@CHMOD@
+CP=	@CP@
+LN=	@LN@
+MKDIR=	@MKDIR@
+RANLIB=	@RANLIB@
+RM=	@RM@
 SHELL=	@db_cv_path_sh@
-ar=	@db_cv_path_ar@
-chmod=	@db_cv_path_chmod@
-cp=	@db_cv_path_cp@
-ln=	@db_cv_path_ln@
-mkdir=	@db_cv_path_mkdir@
-ranlib=	@db_cv_path_ranlib@
-rm=	@db_cv_path_rm@
-strip=	@db_cv_path_strip@
+STRIP=	@STRIP@
 
 ##################################################
 # General library information.
@@ -51,14 +51,14 @@ CPPFLAGS=	-I$(builddir) -I$(srcdir) @CPPFLAGS@
 ##################################################
 # C API.
 ##################################################
-CFLAGS=	 	-c $(CPPFLAGS) @CFLAGS@
+CFLAGS=		-c $(CPPFLAGS) @CFLAGS@
 CC=		@MAKEFILE_CC@
 CCLINK=		@MAKEFILE_CCLINK@ @CFLAGS@
 
 LDFLAGS=	@LDFLAGS@
-LIBS=		@LIBS@
+LIBS=		@LIBSO_LIBS@
 TEST_LIBS=	@TEST_LIBS@
-LIBSO_LIBS=	@LIBSO_LIBS@
+LIBCSO_LIBS=	@LIBCSO_LIBS@ @LIBSO_LIBS@
 
 libdb_base=	libdb
 libdb=		$(libdb_base).a
@@ -77,7 +77,7 @@ CXXFLAGS=	-c $(CPPFLAGS) @CXXFLAGS@
 CXX=		@MAKEFILE_CXX@
 CXXLINK=	@MAKEFILE_CXXLINK@ @CXXFLAGS@
 XSOLINK=	@MAKEFILE_XSOLINK@ @CXXFLAGS@
-LIBXSO_LIBS=	@LIBXSO_LIBS@
+LIBXSO_LIBS=	@LIBXSO_LIBS@ @LIBSO_LIBS@
 
 libcxx_base=	libdb_cxx
 libcxx=		$(libcxx_base).a
@@ -93,25 +93,20 @@ libxso_major=	$(libcxx_base)-$(LIBMAJOR)@SOSUFFIX@
 # Java support is optional and requires shared librarires.
 ##################################################
 CLASSPATH=	$(JAVA_CLASSTOP)
-LIBJSO_LIBS=	@LIBJSO_LIBS@
+LIBJSO_LIBS=	@LIBJSO_LIBS@ @LIBSO_LIBS@
+SWIGCFLAGS=	@SWIGCFLAGS@
 
 JAR=		@JAR@
 JAVAC=		env CLASSPATH="$(CLASSPATH)" @JAVAC@
 JAVACFLAGS=	@JAVACFLAGS@
 JAVA_CLASSTOP=	./classes
-JAVA_RPCCLASSTOP=./classes.rpc
 JAVA_EXCLASSTOP=./classes.ex
-JAVA_DBREL=	com/sleepycat/db
-JAVA_EXREL=	com/sleepycat/examples
-JAVA_RPCREL=	com/sleepycat/db/rpcserver
 JAVA_SRCDIR=	$(srcdir)/java/src
-JAVA_EXDIR=	$(srcdir)/examples_java/src/com/sleepycat/examples
-JAVA_RPCDIR=	$(srcdir)/rpc_server/java
+JAVA_EXDIR=	$(srcdir)/examples_java/src
 JAVA_SLEEPYCAT=	$(srcdir)/java/src/com/sleepycat
 
 libj_jarfile=	db.jar
 libj_exjarfile=	dbexamples.jar
-rpc_jarfile=	dbsvc.jar
 libjso_base=	libdb_java
 libjso=		$(libjso_base)-$(LIBVERSION)@JMODSUFFIX@
 libjso_static=	$(libjso_base)-$(LIBVERSION).a
@@ -125,8 +120,8 @@ libjso_g=	$(libjso_base)-$(LIBVERSION)_g@JMODSUFFIX@
 #
 # Tcl support is optional and requires shared libraries.
 ##################################################
-TCFLAGS=	@TCFLAGS@
-LIBTSO_LIBS=	@LIBTSO_LIBS@
+TCL_INCLUDE_SPEC=	@TCL_INCLUDE_SPEC@
+LIBTSO_LIBS=	@LIBTSO_LIBS@ @LIBSO_LIBS@
 libtso_base=	libdb_tcl
 libtso=		$(libtso_base)-$(LIBVERSION)@MODSUFFIX@
 libtso_static=	$(libtso_base)-$(LIBVERSION).a
@@ -158,7 +153,7 @@ BTREE_OBJS=\
 	bt_compare@o@ bt_conv@o@ bt_curadj@o@ bt_cursor@o@ bt_delete@o@ \
 	bt_method@o@ bt_open@o@ bt_put@o@ bt_rec@o@ bt_reclaim@o@ \
 	bt_recno@o@ bt_rsearch@o@ bt_search@o@ bt_split@o@ bt_stat@o@ \
-	bt_upgrade@o@ btree_auto@o@
+	bt_compact@o@ bt_upgrade@o@ btree_auto@o@
 BTREE_VRFY_OBJS=\
 	db_ovfl_vrfy@o@ db_vrfy@o@ db_vrfyutil@o@ bt_verify@o@
 HASH_OBJS=\
@@ -173,40 +168,49 @@ QUEUE_OBJS=\
 QUEUE_VRFY_OBJS=\
 	qam_verify@o@
 REP_OBJS=\
-	rep_auto@o@ rep_backup@o@ rep_method@o@ rep_record@o@ rep_region@o@ \
-	rep_stat@o@ rep_util@o@
+	rep_auto@o@ rep_backup@o@ rep_elect@o@ rep_log@o@ rep_method@o@ \
+	rep_record@o@ rep_region@o@ rep_stat@o@ rep_util@o@ rep_verify@o@
+REPMGR_OBJS=\
+	getaddrinfo@o@\
+	repmgr_elect@o@ repmgr_method@o@ repmgr_msg@o@ repmgr_net@o@ \
+	repmgr_posix@o@ repmgr_queue@o@ repmgr_sel@o@ repmgr_stat@o@ \
+	repmgr_util@o@
 PRINT_OBJS=\
 	btree_autop@o@ crdel_autop@o@ db_autop@o@ dbreg_autop@o@ \
 	fileops_autop@o@ hash_autop@o@ qam_autop@o@ rep_autop@o@ \
 	txn_autop@o@
 
 C_OBJS= @ADDITIONAL_OBJS@ @REPLACEMENT_OBJS@ @CRYPTO_OBJS@ @RPC_CLIENT_OBJS@ \
-	crdel_auto@o@ crdel_rec@o@ db@o@ db_am@o@ db_auto@o@ \
-	db_byteorder@o@ db_cam@o@ db_conv@o@ db_dispatch@o@ db_dup@o@ \
-	db_err@o@ db_getlong@o@ db_idspace@o@ db_iface@o@ db_join@o@ \
-	db_log2@o@ db_meta@o@ db_method@o@ db_open@o@ db_overflow@o@ \
-	db_pr@o@ db_rec@o@ db_reclaim@o@ db_rename@o@ db_remove@o@ \
-	db_ret@o@ db_salloc@o@ db_setid@o@ db_setlsn@o@ db_shash@o@ \
-	db_stati@o@ db_truncate@o@ db_upg@o@ db_upg_opd@o@ dbm@o@ \
-	dbreg@o@ dbreg_auto@o@ dbreg_rec@o@ dbreg_stat@o@ dbreg_util@o@ \
-	env_file@o@ env_method@o@ env_open@o@ env_recover@o@ \
-	env_region@o@ env_stat@o@ fileops_auto@o@ fop_basic@o@ \
+	crdel_auto@o@ crdel_rec@o@ ctime@o@ db@o@ db_am@o@ db_auto@o@ \
+	db_byteorder@o@ db_cam@o@ db_cds@o@ db_clock@o@ db_conv@o@ \
+	db_dispatch@o@ db_dup@o@ db_err@o@ db_getlong@o@ db_idspace@o@ \
+	db_iface@o@ db_join@o@ db_log2@o@ db_meta@o@ db_method@o@ db_open@o@ \
+	db_overflow@o@ db_pr@o@ db_rec@o@ db_reclaim@o@ db_remove@o@ \
+	db_rename@o@ db_ret@o@ db_salloc@o@ db_setid@o@ db_setlsn@o@ \
+	db_shash@o@ db_stati@o@ db_truncate@o@ db_upg@o@ db_upg_opd@o@ \
+	dbm@o@ dbreg@o@ dbreg_auto@o@ dbreg_rec@o@ dbreg_stat@o@ \
+	dbreg_util@o@ env_config@o@ env_failchk@o@ env_file@o@ \
+	env_method@o@ env_open@o@ env_recover@o@ env_region@o@ \
+	env_register@o@ env_stat@o@ fileops_auto@o@ fop_basic@o@ \
 	fop_rec@o@ fop_util@o@ hash_func@o@ hmac@o@ hsearch@o@ lock@o@ \
-	lock_deadlock@o@ lock_id@o@ lock_list@o@ lock_method@o@ \
-	lock_region@o@ lock_stat@o@ lock_timer@o@ lock_util@o@ log@o@ \
-	log_archive@o@ log_compare@o@ log_get@o@ log_method@o@ \
-	log_put@o@ log_stat@o@ mp_alloc@o@ mp_bh@o@ mp_fget@o@ \
-	mp_fmethod@o@ mp_fopen@o@ mp_fput@o@ mp_fset@o@ mp_method@o@ \
-	mp_region@o@ mp_register@o@ mp_stat@o@ mp_sync@o@ mp_trickle@o@ \
-	mutex@o@ os_abs@o@ os_alloc@o@ os_clock@o@ os_config@o@ \
-	os_dir@o@ os_errno@o@ os_fid@o@ os_fsync@o@ os_handle@o@ \
-	os_id@o@ os_map@o@ os_method@o@ os_oflags@o@ os_open@o@ \
-	os_region@o@ os_rename@o@ os_root@o@ os_rpath@o@ os_rw@o@ \
-	os_seek@o@ os_sleep@o@ os_spin@o@ os_stat@o@ os_tmpdir@o@ \
-	os_truncate@o@ os_unlink@o@ sha1@o@ seq_stat@o@ sequence@o@ \
-	snprintf@o@ txn@o@ txn_auto@o@ txn_method@o@ txn_rec@o@ \
-	txn_recover@o@ txn_region@o@ txn_stat@o@ txn_util@o@ xa@o@ \
-	xa_db@o@ xa_map@o@
+	lock_deadlock@o@ lock_failchk@o@ lock_id@o@ lock_list@o@ \
+	lock_method@o@ lock_region@o@ lock_stat@o@ lock_timer@o@ \
+	lock_util@o@ log@o@ log_archive@o@ log_compare@o@ log_debug@o@ \
+	log_get@o@ log_method@o@ log_put@o@ log_stat@o@ mkpath@o@ \
+	mp_alloc@o@ mp_bh@o@ mp_fget@o@ mp_fmethod@o@ mp_fopen@o@ \
+	mp_fput@o@ mp_fset@o@ mp_method@o@ mp_mvcc@o@ mp_region@o@ \
+	mp_register@o@ mp_stat@o@ mp_sync@o@ mp_trickle@o@ mut_alloc@o@ \
+	mut_failchk@o@ mut_method@o@ mut_region@o@ mut_stat@o@ os_abs@o@ \
+	os_alloc@o@ os_clock@o@ os_config@o@ os_dir@o@ os_errno@o@ \
+	os_fid@o@ os_flock@o@ os_fsync@o@ os_fzero@o@ os_getenv@o@ \
+	os_handle@o@ os_map@o@ os_method@o@ os_mkdir@o@ os_oflags@o@ \
+	os_open@o@ os_pid@o@ os_region@o@ os_rename@o@ os_root@o@ \
+	os_rpath@o@ os_rw@o@ os_seek@o@ os_sleep@o@ os_spin@o@ \
+	os_stat@o@ os_tmpdir@o@ os_truncate@o@ os_uid@o@ os_unlink@o@ \
+	os_yield@o@ seq_stat@o@ sequence@o@ sha1@o@ snprintf@o@ txn@o@ \
+	txn_auto@o@ txn_chkpt@o@ txn_failchk@o@ txn_method@o@ \
+	txn_rec@o@ txn_recover@o@ txn_region@o@ txn_stat@o@ \
+	txn_util@o@ xa@o@ xa_db@o@ xa_map@o@
 
 CXX_OBJS=\
 	cxx_db@o@ cxx_dbc@o@ cxx_dbt@o@ cxx_env@o@ cxx_except@o@ cxx_lock@o@ \
@@ -225,6 +229,7 @@ JAVA_DBSRCS=\
 	$(JAVA_SLEEPYCAT)/bind/EntryBinding.java \
 	$(JAVA_SLEEPYCAT)/bind/RecordNumberBinding.java \
 	$(JAVA_SLEEPYCAT)/bind/serial/ClassCatalog.java \
+	$(JAVA_SLEEPYCAT)/bind/serial/SerialBase.java \
 	$(JAVA_SLEEPYCAT)/bind/serial/SerialBinding.java \
 	$(JAVA_SLEEPYCAT)/bind/serial/SerialInput.java \
 	$(JAVA_SLEEPYCAT)/bind/serial/SerialOutput.java \
@@ -245,7 +250,10 @@ JAVA_DBSRCS=\
 	$(JAVA_SLEEPYCAT)/bind/tuple/MarshalledTupleEntry.java \
 	$(JAVA_SLEEPYCAT)/bind/tuple/MarshalledTupleKeyEntity.java \
 	$(JAVA_SLEEPYCAT)/bind/tuple/ShortBinding.java \
+	$(JAVA_SLEEPYCAT)/bind/tuple/SortedDoubleBinding.java \
+	$(JAVA_SLEEPYCAT)/bind/tuple/SortedFloatBinding.java \
 	$(JAVA_SLEEPYCAT)/bind/tuple/StringBinding.java \
+	$(JAVA_SLEEPYCAT)/bind/tuple/TupleBase.java \
 	$(JAVA_SLEEPYCAT)/bind/tuple/TupleBinding.java \
 	$(JAVA_SLEEPYCAT)/bind/tuple/TupleInput.java \
 	$(JAVA_SLEEPYCAT)/bind/tuple/TupleInputBinding.java \
@@ -255,14 +263,14 @@ JAVA_DBSRCS=\
 	$(JAVA_SLEEPYCAT)/bind/tuple/TupleTupleKeyCreator.java \
 	$(JAVA_SLEEPYCAT)/bind/tuple/TupleTupleMarshalledBinding.java \
 	$(JAVA_SLEEPYCAT)/bind/tuple/TupleTupleMarshalledKeyCreator.java \
+	$(JAVA_SLEEPYCAT)/collections/BaseIterator.java \
+	$(JAVA_SLEEPYCAT)/collections/BlockIterator.java \
 	$(JAVA_SLEEPYCAT)/collections/CurrentTransaction.java \
 	$(JAVA_SLEEPYCAT)/collections/DataCursor.java \
 	$(JAVA_SLEEPYCAT)/collections/DataView.java \
-	$(JAVA_SLEEPYCAT)/collections/KeyRange.java \
-	$(JAVA_SLEEPYCAT)/collections/KeyRangeException.java \
 	$(JAVA_SLEEPYCAT)/collections/MapEntryParameter.java \
+	$(JAVA_SLEEPYCAT)/collections/MyRangeCursor.java \
 	$(JAVA_SLEEPYCAT)/collections/PrimaryKeyAssigner.java \
-	$(JAVA_SLEEPYCAT)/collections/RangeCursor.java \
 	$(JAVA_SLEEPYCAT)/collections/StoredCollection.java \
 	$(JAVA_SLEEPYCAT)/collections/StoredCollections.java \
 	$(JAVA_SLEEPYCAT)/collections/StoredContainer.java \
@@ -288,6 +296,8 @@ JAVA_DBSRCS=\
 	$(JAVA_SLEEPYCAT)/db/CacheFileStats.java \
 	$(JAVA_SLEEPYCAT)/db/CacheStats.java \
 	$(JAVA_SLEEPYCAT)/db/CheckpointConfig.java \
+	$(JAVA_SLEEPYCAT)/db/CompactConfig.java \
+	$(JAVA_SLEEPYCAT)/db/CompactStats.java \
 	$(JAVA_SLEEPYCAT)/db/Cursor.java \
 	$(JAVA_SLEEPYCAT)/db/CursorConfig.java \
 	$(JAVA_SLEEPYCAT)/db/Database.java \
@@ -300,6 +310,8 @@ JAVA_DBSRCS=\
 	$(JAVA_SLEEPYCAT)/db/Environment.java \
 	$(JAVA_SLEEPYCAT)/db/EnvironmentConfig.java \
 	$(JAVA_SLEEPYCAT)/db/ErrorHandler.java \
+	$(JAVA_SLEEPYCAT)/db/EventHandler.java \
+	$(JAVA_SLEEPYCAT)/db/EventType.java \
 	$(JAVA_SLEEPYCAT)/db/FeedbackHandler.java \
 	$(JAVA_SLEEPYCAT)/db/HashStats.java \
 	$(JAVA_SLEEPYCAT)/db/Hasher.java \
@@ -320,19 +332,33 @@ JAVA_DBSRCS=\
 	$(JAVA_SLEEPYCAT)/db/LogStats.java \
 	$(JAVA_SLEEPYCAT)/db/MemoryException.java \
 	$(JAVA_SLEEPYCAT)/db/MessageHandler.java \
+	$(JAVA_SLEEPYCAT)/db/MultipleNIODataEntry.java \
+	$(JAVA_SLEEPYCAT)/db/MultipleKeyNIODataEntry.java \
+	$(JAVA_SLEEPYCAT)/db/MultipleRecnoNIODataEntry.java \
 	$(JAVA_SLEEPYCAT)/db/MultipleDataEntry.java \
 	$(JAVA_SLEEPYCAT)/db/MultipleEntry.java \
 	$(JAVA_SLEEPYCAT)/db/MultipleKeyDataEntry.java \
 	$(JAVA_SLEEPYCAT)/db/MultipleRecnoDataEntry.java \
+	$(JAVA_SLEEPYCAT)/db/MutexStats.java \
 	$(JAVA_SLEEPYCAT)/db/OperationStatus.java \
 	$(JAVA_SLEEPYCAT)/db/PanicHandler.java \
 	$(JAVA_SLEEPYCAT)/db/PreparedTransaction.java \
 	$(JAVA_SLEEPYCAT)/db/QueueStats.java \
 	$(JAVA_SLEEPYCAT)/db/RecordNumberAppender.java \
 	$(JAVA_SLEEPYCAT)/db/RecoveryOperation.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationConfig.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationDuplicateMasterException.java \
 	$(JAVA_SLEEPYCAT)/db/ReplicationHandleDeadException.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationHoldElectionException.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationHostAddress.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationJoinFailureException.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationLockoutException.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationManagerAckPolicy.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationManagerStartPolicy.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationSiteUnavailableException.java \
 	$(JAVA_SLEEPYCAT)/db/ReplicationStats.java \
 	$(JAVA_SLEEPYCAT)/db/ReplicationStatus.java \
+	$(JAVA_SLEEPYCAT)/db/ReplicationTimeoutType.java \
 	$(JAVA_SLEEPYCAT)/db/ReplicationTransport.java \
 	$(JAVA_SLEEPYCAT)/db/RunRecoveryException.java \
 	$(JAVA_SLEEPYCAT)/db/SecondaryConfig.java \
@@ -347,8 +373,8 @@ JAVA_DBSRCS=\
 	$(JAVA_SLEEPYCAT)/db/TransactionConfig.java \
 	$(JAVA_SLEEPYCAT)/db/TransactionStats.java \
 	$(JAVA_SLEEPYCAT)/db/VerifyConfig.java \
+	$(JAVA_SLEEPYCAT)/db/VersionMismatchException.java \
 	$(JAVA_SLEEPYCAT)/db/internal/Db.java \
-	$(JAVA_SLEEPYCAT)/db/internal/DbClient.java \
 	$(JAVA_SLEEPYCAT)/db/internal/DbConstants.java \
 	$(JAVA_SLEEPYCAT)/db/internal/DbEnv.java \
 	$(JAVA_SLEEPYCAT)/db/internal/DbLock.java \
@@ -365,8 +391,12 @@ JAVA_DBSRCS=\
 	$(JAVA_SLEEPYCAT)/util/FastInputStream.java \
 	$(JAVA_SLEEPYCAT)/util/FastOutputStream.java \
 	$(JAVA_SLEEPYCAT)/util/IOExceptionWrapper.java \
+	$(JAVA_SLEEPYCAT)/util/PackedInteger.java \
 	$(JAVA_SLEEPYCAT)/util/RuntimeExceptionWrapper.java \
-	$(JAVA_SLEEPYCAT)/util/UtfOps.java
+	$(JAVA_SLEEPYCAT)/util/UtfOps.java \
+	$(JAVA_SLEEPYCAT)/util/keyrange/KeyRange.java \
+	$(JAVA_SLEEPYCAT)/util/keyrange/KeyRangeException.java \
+	$(JAVA_SLEEPYCAT)/util/keyrange/RangeCursor.java
 
 JAVA_EXSRCS=\
 	$(JAVA_EXDIR)/collections/access/AccessExample.java \
@@ -452,6 +482,7 @@ JAVA_EXSRCS=\
 	$(JAVA_EXDIR)/db/AccessExample.java \
 	$(JAVA_EXDIR)/db/BtRecExample.java \
 	$(JAVA_EXDIR)/db/BulkAccessExample.java \
+	$(JAVA_EXDIR)/db/BulkAccessNIOExample.java \
 	$(JAVA_EXDIR)/db/EnvExample.java \
 	$(JAVA_EXDIR)/db/GettingStarted/ExampleDatabaseLoad.java \
 	$(JAVA_EXDIR)/db/GettingStarted/ExampleDatabaseRead.java \
@@ -463,7 +494,14 @@ JAVA_EXSRCS=\
 	$(JAVA_EXDIR)/db/LockExample.java \
 	$(JAVA_EXDIR)/db/RPCExample.java \
 	$(JAVA_EXDIR)/db/SequenceExample.java \
-	$(JAVA_EXDIR)/db/TpcbExample.java
+	$(JAVA_EXDIR)/db/TpcbExample.java \
+	$(JAVA_EXDIR)/db/repquote/RepConfig.java \
+	$(JAVA_EXDIR)/db/repquote/RepQuoteEnvironment.java \
+	$(JAVA_EXDIR)/db/repquote/RepQuoteExample.java \
+	$(JAVA_EXDIR)/db/txn/DBWriter.java \
+	$(JAVA_EXDIR)/db/txn/PayloadData.java \
+	$(JAVA_EXDIR)/db/txn/TxnGuide.java \
+	$(JAVA_EXDIR)/db/txn/TxnGuideInMemory.java
 
 TCL_OBJS=\
 	tcl_compat@o@ tcl_db@o@ tcl_db_pkg@o@ tcl_dbcursor@o@ tcl_env@o@ \
@@ -482,162 +520,10 @@ RPC_CXXSRV_OBJS=\
 	db_server_cxxproc@o@ db_server_cxxutil@o@ db_server_svc@o@ \
 	gen_db_server@o@
 
-RPC_JAVASRV_SRCS=\
-	$(JAVA_RPCDIR)/AssociateCallbacks.java \
-	$(JAVA_RPCDIR)/Dispatcher.java \
-	$(JAVA_RPCDIR)/FreeList.java \
-	$(JAVA_RPCDIR)/JoinCursorAdapter.java \
-	$(JAVA_RPCDIR)/LocalIterator.java \
-	$(JAVA_RPCDIR)/RpcDb.java \
-	$(JAVA_RPCDIR)/RpcDbEnv.java \
-	$(JAVA_RPCDIR)/RpcDbTxn.java \
-	$(JAVA_RPCDIR)/RpcDbc.java \
-	$(JAVA_RPCDIR)/Server.java \
-	$(JAVA_RPCDIR)/Timer.java \
-	$(JAVA_RPCDIR)/Util.java \
-	$(JAVA_RPCDIR)/gen/ServerStubs.java \
-	$(JAVA_RPCDIR)/gen/__db_associate_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_associate_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_bt_maxkey_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_bt_maxkey_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_bt_minkey_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_bt_minkey_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_close_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_close_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_create_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_create_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_cursor_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_cursor_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_del_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_del_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_encrypt_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_encrypt_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_extentsize_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_extentsize_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_flags_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_flags_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_bt_minkey_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_bt_minkey_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_encrypt_flags_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_encrypt_flags_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_extentsize_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_extentsize_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_flags_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_flags_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_h_ffactor_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_h_ffactor_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_h_nelem_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_h_nelem_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_lorder_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_lorder_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_name_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_name_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_open_flags_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_open_flags_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_pagesize_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_pagesize_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_re_delim_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_re_delim_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_re_len_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_re_len_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_re_pad_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_get_re_pad_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_get_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_h_ffactor_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_h_ffactor_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_h_nelem_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_h_nelem_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_join_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_join_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_key_range_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_key_range_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_lorder_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_lorder_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_open_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_open_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_pagesize_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_pagesize_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_pget_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_pget_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_put_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_put_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_re_delim_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_re_delim_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_re_len_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_re_len_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_re_pad_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_re_pad_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_remove_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_remove_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_rename_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_rename_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_stat_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_stat_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_sync_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_sync_reply.java \
-	$(JAVA_RPCDIR)/gen/__db_truncate_msg.java \
-	$(JAVA_RPCDIR)/gen/__db_truncate_reply.java \
-	$(JAVA_RPCDIR)/gen/__dbc_close_msg.java \
-	$(JAVA_RPCDIR)/gen/__dbc_close_reply.java \
-	$(JAVA_RPCDIR)/gen/__dbc_count_msg.java \
-	$(JAVA_RPCDIR)/gen/__dbc_count_reply.java \
-	$(JAVA_RPCDIR)/gen/__dbc_del_msg.java \
-	$(JAVA_RPCDIR)/gen/__dbc_del_reply.java \
-	$(JAVA_RPCDIR)/gen/__dbc_dup_msg.java \
-	$(JAVA_RPCDIR)/gen/__dbc_dup_reply.java \
-	$(JAVA_RPCDIR)/gen/__dbc_get_msg.java \
-	$(JAVA_RPCDIR)/gen/__dbc_get_reply.java \
-	$(JAVA_RPCDIR)/gen/__dbc_pget_msg.java \
-	$(JAVA_RPCDIR)/gen/__dbc_pget_reply.java \
-	$(JAVA_RPCDIR)/gen/__dbc_put_msg.java \
-	$(JAVA_RPCDIR)/gen/__dbc_put_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_cachesize_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_cachesize_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_close_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_close_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_create_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_create_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_dbremove_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_dbremove_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_dbrename_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_dbrename_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_encrypt_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_encrypt_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_flags_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_flags_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_get_cachesize_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_get_cachesize_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_get_encrypt_flags_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_get_encrypt_flags_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_get_flags_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_get_flags_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_get_home_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_get_home_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_get_open_flags_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_get_open_flags_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_open_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_open_reply.java \
-	$(JAVA_RPCDIR)/gen/__env_remove_msg.java \
-	$(JAVA_RPCDIR)/gen/__env_remove_reply.java \
-	$(JAVA_RPCDIR)/gen/__txn_abort_msg.java \
-	$(JAVA_RPCDIR)/gen/__txn_abort_reply.java \
-	$(JAVA_RPCDIR)/gen/__txn_begin_msg.java \
-	$(JAVA_RPCDIR)/gen/__txn_begin_reply.java \
-	$(JAVA_RPCDIR)/gen/__txn_commit_msg.java \
-	$(JAVA_RPCDIR)/gen/__txn_commit_reply.java \
-	$(JAVA_RPCDIR)/gen/__txn_discard_msg.java \
-	$(JAVA_RPCDIR)/gen/__txn_discard_reply.java \
-	$(JAVA_RPCDIR)/gen/__txn_prepare_msg.java \
-	$(JAVA_RPCDIR)/gen/__txn_prepare_reply.java \
-	$(JAVA_RPCDIR)/gen/__txn_recover_msg.java \
-	$(JAVA_RPCDIR)/gen/__txn_recover_reply.java \
-	$(JAVA_RPCDIR)/gen/db_server.java
-
 UTIL_PROGS=\
 	@ADDITIONAL_PROGS@ \
-	db_archive db_checkpoint db_deadlock db_dump db_load db_printlog \
-	db_recover db_stat db_upgrade db_verify
+	db_archive db_checkpoint db_deadlock db_dump db_hotbackup \
+	db_load db_printlog db_recover db_stat db_upgrade db_verify
 
 ##################################################
 # List of files installed into the library directory.
@@ -674,7 +560,7 @@ LIB_INSTALL_FILE_LIST=\
 ##################################################
 all: @BUILD_TARGET@
 
-install-strip install: all @INSTALL_TARGET@
+install: all @INSTALL_TARGET@
 
 ##################################################
 # Library and standard utilities build.
@@ -686,33 +572,33 @@ $(libdb): $(DEF_LIB)
 
 # Real static C library.
 $(libdb_version): $(C_OBJS)
-	$(ar) cr $@ $(C_OBJS)
-	test ! -f $(ranlib) || $(ranlib) $@
-	$(rm) -f $(libdb)
-	$(ln) -s $(libdb_version) $(libdb)
+	$(AR) cr $@ $(C_OBJS)
+	test "$(RANLIB)" = "none" || $(RANLIB) $@
+	$(RM) -f $(libdb)
+	$(LN) -s $(libdb_version) $(libdb)
 
 # Shared C library.
 $(libso_target): $(C_OBJS)
-	$(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) $(LIBSO_LIBS)
-	$(rm) -f $(libdb)
-	$(ln) -s .libs/$(libdb_version) $(libdb)
+	$(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) $(LIBCSO_LIBS)
+	$(RM) -f $(libdb)
+	$(LN) -s .libs/$(libdb_version) $(libdb)
 
 # Static C++ library named libdb_cxx.a.
 $(libcxx): $(DEF_LIB_CXX)
 
 # Real static C++ library.
 $(libcxx_version): $(CXX_OBJS) $(C_OBJS)
-	$(ar) cr $@ $(CXX_OBJS) $(C_OBJS)
-	test ! -f $(ranlib) || $(ranlib) $@
-	$(rm) -f $(libcxx)
-	$(ln) -s $(libcxx_version) $(libcxx)
+	$(AR) cr $@ $(CXX_OBJS) $(C_OBJS)
+	test "$(RANLIB)" = "none" || $(RANLIB) $@
+	$(RM) -f $(libcxx)
+	$(LN) -s $(libcxx_version) $(libcxx)
 
 # Shared C++ library.
 $(libxso_target): $(CXX_OBJS) $(C_OBJS)
 	$(XSOLINK) $(SOFLAGS) $(LDFLAGS) \
 	    -o $@ $(CXX_OBJS) $(C_OBJS) $(LIBXSO_LIBS)
-	$(rm) -f $(libcxx)
-	$(ln) -s .libs/$(libcxx_version) $(libcxx)
+	$(RM) -f $(libcxx)
+	$(LN) -s .libs/$(libcxx_version) $(libcxx)
 
 # Shared Java library.
 $(libjso_target): $(JAVA_OBJS) $(C_OBJS)
@@ -732,26 +618,19 @@ java:	$(libj_jarfile) $(libj_exjarfile)
 
 $(libj_jarfile): $(JAVA_DBSRCS)
 	@test -d $(JAVA_CLASSTOP) || \
-	   ($(mkdir) -p $(JAVA_CLASSTOP) && $(chmod) $(dmode) $(JAVA_CLASSTOP))
+	   ($(MKDIR) -p $(JAVA_CLASSTOP) && \
+	   $(CHMOD) $(dmode) $(JAVA_CLASSTOP))
 	$(JAVAC) -d $(JAVA_CLASSTOP) $(JAVACFLAGS) $(JAVA_DBSRCS)
 	cd $(JAVA_CLASSTOP) && $(JAR) cf ../$(libj_jarfile) ./com/sleepycat
 
 $(libj_exjarfile): $(libj_jarfile) $(JAVA_EXSRCS)
 	@test -d $(JAVA_EXCLASSTOP) || \
-	   ($(mkdir) -p $(JAVA_EXCLASSTOP) && \
-		$(chmod) $(dmode) $(JAVA_EXCLASSTOP))
+	   ($(MKDIR) -p $(JAVA_EXCLASSTOP) && \
+		$(CHMOD) $(dmode) $(JAVA_EXCLASSTOP))
 	$(JAVAC) -classpath $(libj_jarfile) -d $(JAVA_EXCLASSTOP) \
 		$(JAVACFLAGS) $(JAVA_EXSRCS)
 	cd $(JAVA_EXCLASSTOP) && $(JAR) cf ../$(libj_exjarfile) .
 
-$(rpc_jarfile): $(libj_jarfile) $(RPC_JAVASRV_SRCS)
-	@test -d $(JAVA_RPCCLASSTOP) || \
-	   ($(mkdir) -p $(JAVA_RPCCLASSTOP) && \
-	       $(chmod) $(dmode) $(JAVA_RPCCLASSTOP))
-	env CLASSPATH=$(CLASSPATH):$(JAVA_RPCDIR)/oncrpc.jar \
-	    @JAVAC@ -d $(JAVA_RPCCLASSTOP) $(JAVACFLAGS) $(RPC_JAVASRV_SRCS)
-	cd $(JAVA_RPCCLASSTOP) && $(JAR) cf ../$(rpc_jarfile) $(JAVA_RPCREL)
-
 ##################################################
 # Utilities
 ##################################################
@@ -765,14 +644,6 @@ berkeley_db_cxxsvc: $(RPC_CXXSRV_OBJS) util_log@o@ $(DEF_LIB_CXX)
 	    $(RPC_CXXSRV_OBJS) util_log@o@ $(DEF_LIB_CXX) $(LIBS)
 	$(POSTLINK) $@
 
-berkeley_db_javasvc: $(rpc_jarfile)
-	echo "#!/bin/sh" > $@
-	echo CLASSPATH="$(CLASSPATH):$(rpc_jarfile):$(JAVA_RPCDIR)/oncrpc.jar" >> $@
-	echo LD_LIBRARY_PATH=.libs >> $@
-	echo export CLASSPATH LD_LIBRARY_PATH >> $@
-	echo exec java com.sleepycat.db.rpcserver.Server \$$@ >> $@
-	chmod +x $@
-
 db_archive: db_archive@o@ util_sig@o@ $(DEF_LIB)
 	$(CCLINK) -o $@ $(LDFLAGS) \
 	    db_archive@o@ util_sig@o@ $(DEF_LIB) $(LIBS)
@@ -797,6 +668,11 @@ db_dump185: db_dump185@o@ @REPLACEMENT_OBJS@
 	$(CCLINK) -o $@ $(LDFLAGS) db_dump185@o@ @REPLACEMENT_OBJS@ $(DB185LIB)
 	$(POSTLINK) $@
 
+db_hotbackup: db_hotbackup@o@ util_sig@o@ $(DEF_LIB)
+	$(CCLINK) -o $@ $(LDFLAGS) \
+	    db_hotbackup@o@ util_sig@o@ $(DEF_LIB) $(LIBS)
+	$(POSTLINK) $@
+
 db_load: db_load@o@ util_cache@o@ util_sig@o@ $(DEF_LIB)
 	$(CCLINK) -o $@ $(LDFLAGS) \
 	    db_load@o@ util_cache@o@ util_sig@o@ $(DEF_LIB) $(LIBS)
@@ -837,118 +713,119 @@ uninstall: uninstall_include uninstall_lib uninstall_utilities uninstall_docs
 
 install_setup:
 	@test -d $(DESTDIR)$(prefix) || \
-	    ($(mkdir) -p $(DESTDIR)$(prefix) && \
-	    $(chmod) $(dmode) $(DESTDIR)$(prefix))
+	    ($(MKDIR) -p $(DESTDIR)$(prefix) && \
+	    $(CHMOD) $(dmode) $(DESTDIR)$(prefix))
 
 INCDOT=	db.h db_cxx.h @ADDITIONAL_INCS@
 install_include:
 	@echo "Installing DB include files: $(DESTDIR)$(includedir) ..."
 	@test -d $(DESTDIR)$(includedir) || \
-	    ($(mkdir) -p $(DESTDIR)$(includedir) && \
-	    $(chmod) $(dmode) $(DESTDIR)$(includedir))
-	@cd $(DESTDIR)$(includedir) && $(rm) -f $(INCDOT)
-	@$(cp) -p $(INCDOT) $(DESTDIR)$(includedir)
-	@cd $(DESTDIR)$(includedir) && $(chmod) $(fmode) $(INCDOT)
+	    ($(MKDIR) -p $(DESTDIR)$(includedir) && \
+	    $(CHMOD) $(dmode) $(DESTDIR)$(includedir))
+	@cd $(DESTDIR)$(includedir) && $(RM) -f $(INCDOT)
+	@$(CP) -p $(INCDOT) $(DESTDIR)$(includedir)
+	@cd $(DESTDIR)$(includedir) && $(CHMOD) $(fmode) $(INCDOT)
 
 uninstall_include:
-	@cd $(DESTDIR)$(includedir) && $(rm) -f $(INCDOT)
+	@cd $(DESTDIR)$(includedir) && $(RM) -f $(INCDOT)
 
 install_lib:
 	@echo "Installing DB library: $(DESTDIR)$(libdir) ..."
 	@test -d $(DESTDIR)$(libdir) || \
-	    ($(mkdir) -p $(DESTDIR)$(libdir) && \
-	    $(chmod) $(dmode) $(DESTDIR)$(libdir))
-	@cd $(DESTDIR)$(libdir) && $(rm) -f $(LIB_INSTALL_FILE_LIST)
+	    ($(MKDIR) -p $(DESTDIR)$(libdir) && \
+	    $(CHMOD) $(dmode) $(DESTDIR)$(libdir))
+	@cd $(DESTDIR)$(libdir) && $(RM) -f $(LIB_INSTALL_FILE_LIST)
 	@$(INSTALLER) @INSTALL_LIBS@ $(DESTDIR)$(libdir)
 	@(cd $(DESTDIR)$(libdir) && \
-	    test -f $(libso) && $(ln) -s $(libso) $(libso_default); \
-	    test -f $(libso) && $(ln) -s $(libso) $(libso_major); \
-	    test -f $(libxso) && $(ln) -s $(libxso) $(libxso_default); \
-	    test -f $(libxso) && $(ln) -s $(libxso) $(libxso_major); \
-	    test -f $(libtso) && $(ln) -s $(libtso) $(libtso_default); \
-	    test -f $(libtso) && $(ln) -s $(libtso) $(libtso_major); \
-	    test -f $(libjso) && $(ln) -s $(libjso) $(libjso_default); \
-	    test -f $(libjso) && $(ln) -s $(libjso) $(libjso_major); \
-	    test -f $(libjso) && $(ln) -s $(libjso) $(libjso_g)) || true
+	    test -f $(libso) && $(LN) -s $(libso) $(libso_default); \
+	    test -f $(libso) && $(LN) -s $(libso) $(libso_major); \
+	    test -f $(libxso) && $(LN) -s $(libxso) $(libxso_default); \
+	    test -f $(libxso) && $(LN) -s $(libxso) $(libxso_major); \
+	    test -f $(libtso) && $(LN) -s $(libtso) $(libtso_default); \
+	    test -f $(libtso) && $(LN) -s $(libtso) $(libtso_major); \
+	    test -f $(libjso) && $(LN) -s $(libjso) $(libjso_default); \
+	    test -f $(libjso) && $(LN) -s $(libjso) $(libjso_major); \
+	    test -f $(libjso) && $(LN) -s $(libjso) $(libjso_g)) || exit 0
 	@(test -f $(libj_jarfile) && \
-	    $(cp) $(libj_jarfile) $(DESTDIR)$(libdir) && \
-	    $(chmod) $(fmode) $(DESTDIR)$(libdir)/$(libj_jarfile)) || true
+	    $(CP) $(libj_jarfile) $(DESTDIR)$(libdir) && \
+	    $(CHMOD) $(fmode) $(DESTDIR)$(libdir)/$(libj_jarfile)) || exit 0
 
 uninstall_lib:
-	@cd $(DESTDIR)$(libdir) && $(rm) -f $(LIB_INSTALL_FILE_LIST)
+	@cd $(DESTDIR)$(libdir) && $(RM) -f $(LIB_INSTALL_FILE_LIST)
 
 install_utilities:
 	@echo "Installing DB utilities: $(DESTDIR)$(bindir) ..."
 	@test -d $(DESTDIR)$(bindir) || \
-	    ($(mkdir) -p $(DESTDIR)$(bindir) && \
-	    $(chmod) $(dmode) $(DESTDIR)$(bindir))
+	    ($(MKDIR) -p $(DESTDIR)$(bindir) && \
+	    $(CHMOD) $(dmode) $(DESTDIR)$(bindir))
 	@for i in $(UTIL_PROGS); do \
-		$(rm) -f $(DESTDIR)$(bindir)/$$i $(DESTDIR)$(bindir)/$$i.exe; \
-		test -f $$i.exe && i=$$i.exe || true; \
+		test -f $$i.exe && i=$$i.exe || i=$$i; \
+		$(RM) -f $(DESTDIR)$(bindir)/$$i; \
 		$(INSTALLER) $$i $(DESTDIR)$(bindir)/$$i; \
-		test -f $(strip) && $(strip) $(DESTDIR)$(bindir)/$$i || true; \
-		$(chmod) $(emode) $(DESTDIR)$(bindir)/$$i; \
+		test "$(STRIP)" = "none" || $(STRIP) $(DESTDIR)$(bindir)/$$i; \
+		$(CHMOD) $(emode) $(DESTDIR)$(bindir)/$$i; \
 	done
 
 uninstall_utilities:
 	@(cd $(DESTDIR)$(bindir); for i in $(UTIL_PROGS); do \
-		$(rm) -f $$i $$i.exe; \
+		$(RM) -f $$i $$i.exe; \
 	done)
 
-DOCLIST=api_c api_cxx api_tcl collections gsg images index.html java ref \
-	sleepycat utility
+DOCLIST=api_c api_cxx api_tcl collections gsg gsg_db_rep gsg_txn images \
+	index.html java license ref utility
 
 install_docs:
 	@echo "Installing documentation: $(DESTDIR)$(docdir) ..."
 	@test -d $(DESTDIR)$(docdir) || \
-	    ($(mkdir) -p $(DESTDIR)$(docdir) && \
-	    $(chmod) $(dmode) $(DESTDIR)$(docdir))
-	@cd $(DESTDIR)$(docdir) && $(rm) -rf $(DOCLIST)
-	@cd $(srcdir)/docs && $(cp) -pr $(DOCLIST) $(DESTDIR)$(docdir)/
+	    ($(MKDIR) -p $(DESTDIR)$(docdir) && \
+	    $(CHMOD) $(dmode) $(DESTDIR)$(docdir))
+	@cd $(DESTDIR)$(docdir) && $(RM) -rf $(DOCLIST)
+	@cd $(srcdir)/docs && $(CP) -pr $(DOCLIST) $(DESTDIR)$(docdir)/
 
 uninstall_docs:
-	@cd $(docdir) && $(rm) -rf $(DESTDIR)$(DOCLIST)
+	@cd $(DESTDIR)$(docdir) && $(RM) -rf $(DOCLIST)
 
 ##################################################
 # Remaining standard Makefile targets.
 ##################################################
 CLEAN_LIST=\
-	bench_001 berkeley_db_cxxsvc berkeley_db_javasvc berkeley_db_svc \
-	db_dump185 db_perf dbs ex_access ex_apprec ex_btrec ex_dbclient \
-	ex_env ex_lock ex_mpool ex_repquote ex_sequence ex_thread \
-	ex_tpcb example_database_load example_database_read excxx_access \
+	TxnGuide TxnGuideInMemory bench_001 berkeley_db_cxxsvc \
+	berkeley_db_svc db_dump185 db_perf db_reptest dbs ex_access \
+	ex_apprec ex_btrec ex_dbclient ex_env ex_lock ex_mpool \
+	ex_rep_base ex_rep_mgr ex_sequence ex_thread ex_tpcb \
+	example_database_load example_database_read excxx_access \
 	excxx_btrec excxx_env excxx_example_database_load \
 	excxx_example_database_read excxx_lock excxx_mpool \
-	excxx_sequence excxx_tpcb
+	excxx_repquote excxx_sequence excxx_tpcb txn_guide \
+	txn_guide_inmemory
 
 mostly-clean clean:
-	$(rm) -rf $(C_OBJS)
-	$(rm) -rf $(CXX_OBJS) $(JAVA_OBJS) $(TCL_OBJS)
-	$(rm) -rf $(RPC_CLIENT_OBJS) $(RPC_SRV_OBJS) $(RPC_CXXSRV_OBJS)
-	$(rm) -rf $(UTIL_PROGS) *.exe $(CLEAN_LIST)
-	$(rm) -rf $(JAVA_CLASSTOP) $(JAVA_EXCLASSTOP)
-	$(rm) -rf $(JAVA_RPCCLASSES) $(rpc_jarfile)
-	$(rm) -rf tags *@o@ *.o *.o.lock *.lo core *.core
-	$(rm) -rf ALL.OUT.* PARALLEL_TESTDIR.*
-	$(rm) -rf RUN_LOG RUNQUEUE TESTDIR TESTDIR.A
-	$(rm) -rf TEST.LIST logtrack_seen.db tm .libs $(LIB_INSTALL_FILE_LIST)
+	$(RM) -rf $(C_OBJS)
+	$(RM) -rf $(CXX_OBJS) $(JAVA_OBJS) $(TCL_OBJS)
+	$(RM) -rf $(RPC_CLIENT_OBJS) $(RPC_SRV_OBJS) $(RPC_CXXSRV_OBJS)
+	$(RM) -rf $(UTIL_PROGS) *.exe $(CLEAN_LIST)
+	$(RM) -rf $(JAVA_CLASSTOP) $(JAVA_EXCLASSTOP)
+	$(RM) -rf tags *@o@ *.o *.o.lock *.lo core *.core
+	$(RM) -rf ALL.OUT.* PARALLEL_TESTDIR.*
+	$(RM) -rf RUN_LOG RUNQUEUE TESTDIR TESTDIR.A TEST.LIST
+	$(RM) -rf logtrack_seen.db tm .libs $(LIB_INSTALL_FILE_LIST)
 
 REALCLEAN_LIST=\
-	Makefile confdefs.h config.cache config.log config.status \
+	Makefile clib_port.h confdefs.h config.cache config.log config.status \
 	configure.lineno db.h db185_int.h db_185.h db_config.h \
 	db_cxx.h db_int.h db_int_def.h include.tcl \
 	db_server.h db_server_clnt.c db_server_svc.c db_server_xdr.c \
 	gen_db_server.c win_db.h
 
 distclean maintainer-clean realclean: clean
-	$(rm) -rf $(REALCLEAN_LIST)
-	$(rm) -rf libtool
+	$(RM) -rf $(REALCLEAN_LIST)
+	$(RM) -rf libtool
 
 check depend dvi info obj TAGS:
-	@echo "$@: make target not supported" && true
+	@echo "make: $@ target not available"
 
 dist rpm rpmbuild:
-	@echo "$@: make target not supported" && false
+	@echo "make: $@ target not available" && exit 1
 
 ##################################################
 # Multi-threaded testers, benchmarks.
@@ -1038,6 +915,67 @@ db_perf: $(DBPERF_OBJS) $(DEF_LIB)
 	    $(LDFLAGS) $(DBPERF_OBJS) $(DEF_LIB) $(TEST_LIBS) $(LIBS)
 	$(POSTLINK) $@
 
+db_reptest@o@: $(srcdir)/test_rep/db_reptest.c
+	$(CC) $(CFLAGS) $?
+reptest_accept@o@: $(srcdir)/test_rep/reptest_accept.c
+	$(CC) $(CFLAGS) $?
+reptest_client@o@: $(srcdir)/test_rep/reptest_client.c
+	$(CC) $(CFLAGS) $?
+reptest_config@o@: $(srcdir)/test_rep/reptest_config.c
+	$(CC) $(CFLAGS) $?
+reptest_dbs@o@: $(srcdir)/test_rep/reptest_dbs.c
+	$(CC) $(CFLAGS) $?
+reptest_debug@o@: $(srcdir)/test_rep/reptest_debug.c
+	$(CC) $(CFLAGS) $?
+reptest_elect@o@: $(srcdir)/test_rep/reptest_elect.c
+	$(CC) $(CFLAGS) $?
+reptest_env@o@: $(srcdir)/test_rep/reptest_env.c
+	$(CC) $(CFLAGS) $?
+reptest_exec@o@: $(srcdir)/test_rep/reptest_exec.c
+	$(CC) $(CFLAGS) $?
+reptest_file@o@: $(srcdir)/test_rep/reptest_file.c
+	$(CC) $(CFLAGS) $?
+reptest_key@o@: $(srcdir)/test_rep/reptest_key.c
+	$(CC) $(CFLAGS) $?
+reptest_master@o@: $(srcdir)/test_rep/reptest_master.c
+	$(CC) $(CFLAGS) $?
+reptest_misc@o@: $(srcdir)/test_rep/reptest_misc.c
+	$(CC) $(CFLAGS) $?
+reptest_msg_thread@o@: $(srcdir)/test_rep/reptest_msg_thread.c
+	$(CC) $(CFLAGS) $?
+reptest_op@o@: $(srcdir)/test_rep/reptest_op.c
+	$(CC) $(CFLAGS) $?
+reptest_parse@o@: $(srcdir)/test_rep/reptest_parse.c
+	$(CC) $(CFLAGS) $?
+reptest_send@o@: $(srcdir)/test_rep/reptest_send.c
+	$(CC) $(CFLAGS) $?
+reptest_site@o@: $(srcdir)/test_rep/reptest_site.c
+	$(CC) $(CFLAGS) $?
+reptest_socket@o@: $(srcdir)/test_rep/reptest_socket.c
+	$(CC) $(CFLAGS) $?
+reptest_spawn@o@: $(srcdir)/test_rep/reptest_spawn.c
+	$(CC) $(CFLAGS) $?
+reptest_thread@o@: $(srcdir)/test_rep/reptest_thread.c
+	$(CC) $(CFLAGS) $?
+reptest_txn@o@: $(srcdir)/test_rep/reptest_txn.c
+	$(CC) $(CFLAGS) $?
+reptest_util@o@: $(srcdir)/test_rep/reptest_util.c
+	$(CC) $(CFLAGS) $?
+DBREPTEST_OBJS=\
+	db_reptest@o@ perf_rand@o@ reptest_accept@o@ reptest_client@o@ \
+	reptest_config@o@ reptest_dbs@o@ reptest_debug@o@ \
+	reptest_elect@o@ reptest_env@o@ reptest_exec@o@ reptest_file@o@ \
+	reptest_key@o@ reptest_master@o@ reptest_misc@o@ \
+	reptest_msg_thread@o@ reptest_op@o@ reptest_parse@o@ \
+	reptest_send@o@ reptest_site@o@ reptest_socket@o@ \
+	reptest_spawn@o@ reptest_thread@o@ reptest_txn@o@ \
+	reptest_util@o@
+
+db_reptest: $(DBREPTEST_OBJS) $(DEF_LIB)
+	$(CCLINK) -o $@ \
+	    $(LDFLAGS) $(DBREPTEST_OBJS) $(DEF_LIB) $(TEST_LIBS) $(LIBS)
+	$(POSTLINK) $@
+
 tm@o@: $(srcdir)/mutex/tm.c
 	$(CC) $(CFLAGS) $?
 tm: tm@o@ $(DEF_LIB)
@@ -1063,9 +1001,12 @@ ex_apprec@o@: $(srcdir)/examples_c/ex_apprec/ex_apprec.c
 	$(CC) $(CFLAGS) $?
 ex_apprec_auto@o@: $(srcdir)/examples_c/ex_apprec/ex_apprec_auto.c
 	$(CC) $(CFLAGS) $?
+ex_apprec_autop@o@: $(srcdir)/examples_c/ex_apprec/ex_apprec_autop.c
+	$(CC) $(CFLAGS) $?
 ex_apprec_rec@o@: $(srcdir)/examples_c/ex_apprec/ex_apprec_rec.c
 	$(CC) $(CFLAGS) $?
-EX_APPREC_OBJS=ex_apprec@o@ ex_apprec_auto@o@ ex_apprec_rec@o@
+EX_APPREC_OBJS=\
+	ex_apprec@o@ ex_apprec_auto@o@ ex_apprec_autop@o@ ex_apprec_rec@o@
 ex_apprec: $(EX_APPREC_OBJS) $(DEF_LIB)
 	$(CCLINK) -o $@ \
 	    $(LDFLAGS) $(EX_APPREC_OBJS) $(DEF_LIB) $(TEST_LIBS) $(LIBS)
@@ -1100,21 +1041,28 @@ ex_mpool: ex_mpool@o@ $(DEF_LIB)
 	$(CCLINK) -o $@ $(LDFLAGS) ex_mpool@o@ $(DEF_LIB) $(LIBS)
 	$(POSTLINK) $@
 
-ex_rq_client@o@: $(srcdir)/examples_c/ex_repquote/ex_rq_client.c
+rep_base@o@: $(srcdir)/examples_c/ex_rep/base/rep_base.c
 	$(CC) $(CFLAGS) $?
-ex_rq_main@o@:	$(srcdir)/examples_c/ex_repquote/ex_rq_main.c
+rep_common@o@: $(srcdir)/examples_c/ex_rep/common/rep_common.c
 	$(CC) $(CFLAGS) $?
-ex_rq_master@o@: $(srcdir)/examples_c/ex_repquote/ex_rq_master.c
+rep_msg@o@: $(srcdir)/examples_c/ex_rep/base/rep_msg.c
 	$(CC) $(CFLAGS) $?
-ex_rq_net@o@: $(srcdir)/examples_c/ex_repquote/ex_rq_net.c
+rep_net@o@: $(srcdir)/examples_c/ex_rep/base/rep_net.c
 	$(CC) $(CFLAGS) $?
-ex_rq_util@o@: $(srcdir)/examples_c/ex_repquote/ex_rq_util.c
+EX_REP_BASE_OBJS=\
+	rep_base@o@ rep_common@o@ rep_msg@o@ rep_net@o@
+ex_rep_base: $(EX_REP_BASE_OBJS) $(DEF_LIB)
+	$(CCLINK) -o $@ \
+	    $(LDFLAGS) $(EX_REP_BASE_OBJS) $(DEF_LIB) $(TEST_LIBS) $(LIBS)
+	$(POSTLINK) $@
+
+rep_mgr@o@: $(srcdir)/examples_c/ex_rep/mgr/rep_mgr.c
 	$(CC) $(CFLAGS) $?
-EX_RQ_OBJS=\
-	ex_rq_client@o@ ex_rq_main@o@ ex_rq_master@o@ ex_rq_net@o@ ex_rq_util@o@
-ex_repquote: $(EX_RQ_OBJS) $(DEF_LIB)
+EX_REP_MGR_OBJS=\
+	rep_common@o@ rep_mgr@o@
+ex_rep_mgr: $(EX_REP_MGR_OBJS) $(DEF_LIB)
 	$(CCLINK) -o $@ \
-	    $(LDFLAGS) $(EX_RQ_OBJS) $(DEF_LIB) $(TEST_LIBS) $(LIBS)
+	    $(LDFLAGS) $(EX_REP_MGR_OBJS) $(DEF_LIB) $(TEST_LIBS) $(LIBS)
 	$(POSTLINK) $@
 
 ex_sequence@o@: $(srcdir)/examples_c/ex_sequence.c
@@ -1156,6 +1104,18 @@ example_database_read: example_database_read@o@ gettingstarted_common@o@ \
 	    example_database_read@o@ gettingstarted_common@o@ $(DEF_LIB) $(LIBS)
 	$(POSTLINK) $@
 
+txn_guide_inmemory@o@: $(srcdir)/examples_c/txn_guide/txn_guide_inmemory.c
+	$(CC) $(CFLAGS) $?
+txn_guide_inmemory: txn_guide_inmemory@o@ $(DEF_LIB)
+	$(CCLINK) -o $@ $(LDFLAGS) txn_guide_inmemory@o@ $(DEF_LIB) $(LIBS)
+	$(POSTLINK) $@
+
+txn_guide@o@: $(srcdir)/examples_c/txn_guide/txn_guide.c
+	$(CC) $(CFLAGS) $?
+txn_guide: txn_guide@o@ $(DEF_LIB)
+	$(CCLINK) -o $@ $(LDFLAGS) txn_guide@o@ $(DEF_LIB) $(LIBS)
+	$(POSTLINK) $@
+
 ##################################################
 # Example programs for C++.
 ##################################################
@@ -1189,6 +1149,15 @@ excxx_mpool: MpoolExample@o@ $(DEF_LIB_CXX)
 	$(CXXLINK) -o $@ $(LDFLAGS) MpoolExample@o@ $(DEF_LIB_CXX) $(LIBS)
 	$(POSTLINK) $@
 
+RepQuoteExample@o@: $(srcdir)/examples_cxx/excxx_repquote/RepQuoteExample.cpp
+	$(CXX) -I$(srcdir)/examples_cxx/excxx_repquote $(CXXFLAGS) $?
+RepConfigInfo@o@: $(srcdir)/examples_cxx/excxx_repquote/RepConfigInfo.cpp
+	$(CXX) -I$(srcdir)/examples_cxx/excxx_repquote $(CXXFLAGS) $?
+excxx_repquote: RepQuoteExample@o@ RepConfigInfo@o@ $(DEF_LIB_CXX)
+	$(CXXLINK) -o $@ $(LDFLAGS) \
+	    RepQuoteExample@o@ RepConfigInfo@o@ $(DEF_LIB_CXX) $(LIBS)
+	$(POSTLINK) $@
+
 SequenceExample@o@: $(srcdir)/examples_cxx/SequenceExample.cpp
 	$(CXX) $(CXXFLAGS) $?
 excxx_sequence: SequenceExample@o@ $(DEF_LIB_CXX)
@@ -1220,6 +1189,18 @@ excxx_example_database_read: \
 	    excxx_example_database_read@o@ MyDb@o@ $(DEF_LIB_CXX) $(LIBS)
 	$(POSTLINK) $@
 
+TxnGuideInMemory@o@: $(srcdir)/examples_cxx/txn_guide/TxnGuideInMemory.cpp
+	$(CXX) $(CXXFLAGS) $?
+TxnGuideInMemory: TxnGuideInMemory@o@ $(DEF_LIB_CXX)
+	$(CXXLINK) -o $@ $(LDFLAGS) TxnGuideInMemory@o@ $(DEF_LIB_CXX) $(LIBS)
+	$(POSTLINK) $@
+
+TxnGuide@o@: $(srcdir)/examples_cxx/txn_guide/TxnGuide.cpp
+	$(CXX) $(CXXFLAGS) $?
+TxnGuide: TxnGuide@o@ $(DEF_LIB_CXX)
+	$(CXXLINK) -o $@ $(LDFLAGS) TxnGuide@o@ $(DEF_LIB_CXX) $(LIBS)
+	$(POSTLINK) $@
+
 ##################################################
 # C API build rules.
 ##################################################
@@ -1255,6 +1236,8 @@ bt_split@o@: $(srcdir)/btree/bt_split.c
 	 $(CC) $(CFLAGS) $?
 bt_stat@o@: $(srcdir)/btree/bt_stat.c
 	 $(CC) $(CFLAGS) $?
+bt_compact@o@: $(srcdir)/btree/bt_compact.c
+	 $(CC) $(CFLAGS) $?
 bt_upgrade@o@: $(srcdir)/btree/bt_upgrade.c
 	 $(CC) $(CFLAGS) $?
 bt_verify@o@: $(srcdir)/btree/bt_verify.c
@@ -1287,6 +1270,10 @@ db_byteorder@o@: $(srcdir)/common/db_byteorder.c
 	 $(CC) $(CFLAGS) $?
 db_cam@o@: $(srcdir)/db/db_cam.c
 	 $(CC) $(CFLAGS) $?
+db_cds@o@: $(srcdir)/db/db_cds.c
+	 $(CC) $(CFLAGS) $?
+db_clock@o@: $(srcdir)/common/db_clock.c
+	 $(CC) $(CFLAGS) $?
 db_conv@o@: $(srcdir)/db/db_conv.c
 	 $(CC) $(CFLAGS) $?
 db_dispatch@o@: $(srcdir)/db/db_dispatch.c
@@ -1363,6 +1350,10 @@ dbreg_stat@o@: $(srcdir)/dbreg/dbreg_stat.c
 	 $(CC) $(CFLAGS) $?
 dbreg_util@o@: $(srcdir)/dbreg/dbreg_util.c
 	 $(CC) $(CFLAGS) $?
+env_config@o@: $(srcdir)/env/env_config.c
+	 $(CC) $(CFLAGS) $?
+env_failchk@o@: $(srcdir)/env/env_failchk.c
+	 $(CC) $(CFLAGS) $?
 env_file@o@: $(srcdir)/env/env_file.c
 	 $(CC) $(CFLAGS) $?
 env_method@o@: $(srcdir)/env/env_method.c
@@ -1373,6 +1364,8 @@ env_recover@o@: $(srcdir)/env/env_recover.c
 	 $(CC) $(CFLAGS) $?
 env_region@o@: $(srcdir)/env/env_region.c
 	 $(CC) $(CFLAGS) $?
+env_register@o@: $(srcdir)/env/env_register.c
+	 $(CC) $(CFLAGS) $?
 env_stat@o@: $(srcdir)/env/env_stat.c
 	 $(CC) $(CFLAGS) $?
 fileops_auto@o@: $(srcdir)/fileops/fileops_auto.c
@@ -1425,6 +1418,8 @@ lock@o@: $(srcdir)/lock/lock.c
 	 $(CC) $(CFLAGS) $?
 lock_deadlock@o@:$(srcdir)/lock/lock_deadlock.c
 	 $(CC) $(CFLAGS) $?
+lock_failchk@o@:$(srcdir)/lock/lock_failchk.c
+	 $(CC) $(CFLAGS) $?
 lock_id@o@:$(srcdir)/lock/lock_id.c
 	 $(CC) $(CFLAGS) $?
 lock_list@o@:$(srcdir)/lock/lock_list.c
@@ -1445,6 +1440,8 @@ log_archive@o@: $(srcdir)/log/log_archive.c
 	 $(CC) $(CFLAGS) $?
 log_compare@o@: $(srcdir)/log/log_compare.c
 	 $(CC) $(CFLAGS) $?
+log_debug@o@: $(srcdir)/log/log_debug.c
+	 $(CC) $(CFLAGS) $?
 log_get@o@: $(srcdir)/log/log_get.c
 	 $(CC) $(CFLAGS) $?
 log_method@o@: $(srcdir)/log/log_method.c
@@ -1453,6 +1450,8 @@ log_put@o@: $(srcdir)/log/log_put.c
 	 $(CC) $(CFLAGS) $?
 log_stat@o@: $(srcdir)/log/log_stat.c
 	 $(CC) $(CFLAGS) $?
+mkpath@o@: $(srcdir)/common/mkpath.c
+	 $(CC) $(CFLAGS) $?
 mp_alloc@o@: $(srcdir)/mp/mp_alloc.c
 	 $(CC) $(CFLAGS) $?
 mp_bh@o@: $(srcdir)/mp/mp_bh.c
@@ -1469,6 +1468,8 @@ mp_fset@o@: $(srcdir)/mp/mp_fset.c
 	 $(CC) $(CFLAGS) $?
 mp_method@o@: $(srcdir)/mp/mp_method.c
 	 $(CC) $(CFLAGS) $?
+mp_mvcc@o@: $(srcdir)/mp/mp_mvcc.c
+	 $(CC) $(CFLAGS) $?
 mp_region@o@: $(srcdir)/mp/mp_region.c
 	 $(CC) $(CFLAGS) $?
 mp_register@o@: $(srcdir)/mp/mp_register.c
@@ -1481,16 +1482,24 @@ mp_trickle@o@: $(srcdir)/mp/mp_trickle.c
 	 $(CC) $(CFLAGS) $?
 mt19937db@o@: $(srcdir)/crypto/mersenne/mt19937db.c
 	 $(CC) $(CFLAGS) $?
+mut_alloc@o@: $(srcdir)/mutex/mut_alloc.c
+	 $(CC) $(CFLAGS) $?
+mut_failchk@o@: $(srcdir)/mutex/mut_failchk.c
+	 $(CC) $(CFLAGS) $?
 mut_fcntl@o@: $(srcdir)/mutex/mut_fcntl.c
 	 $(CC) $(CFLAGS) $?
+mut_method@o@: $(srcdir)/mutex/mut_method.c
+	 $(CC) $(CFLAGS) $?
 mut_pthread@o@: $(srcdir)/mutex/mut_pthread.c
 	 $(CC) $(CFLAGS) $?
+mut_region@o@: $(srcdir)/mutex/mut_region.c
+	 $(CC) $(CFLAGS) $?
+mut_stat@o@: $(srcdir)/mutex/mut_stat.c
+	 $(CC) $(CFLAGS) $?
 mut_tas@o@: $(srcdir)/mutex/mut_tas.c
 	 $(CC) $(CFLAGS) $?
 mut_win32@o@: $(srcdir)/mutex/mut_win32.c
 	 $(CC) $(CFLAGS) $?
-mutex@o@: $(srcdir)/mutex/mutex.c
-	 $(CC) $(CFLAGS) $?
 os_abs@o@: $(srcdir)/@OSDIR@/os_abs.c
 	 $(CC) $(CFLAGS) $?
 os_alloc@o@: $(srcdir)/os/os_alloc.c
@@ -1505,9 +1514,13 @@ os_errno@o@: $(srcdir)/@OSDIR@/os_errno.c
 	 $(CC) $(CFLAGS) $?
 os_fid@o@: $(srcdir)/@OSDIR@/os_fid.c
 	 $(CC) $(CFLAGS) $?
+os_flock@o@: $(srcdir)/@OSDIR@/os_flock.c
+	 $(CC) $(CFLAGS) $?
 os_fsync@o@: $(srcdir)/@OSDIR@/os_fsync.c
 	 $(CC) $(CFLAGS) $?
-os_id@o@: $(srcdir)/os/os_id.c
+os_fzero@o@: $(srcdir)/os/os_fzero.c
+	 $(CC) $(CFLAGS) $?
+os_getenv@o@: $(srcdir)/@OSDIR@/os_getenv.c
 	 $(CC) $(CFLAGS) $?
 os_handle@o@: $(srcdir)/@OSDIR@/os_handle.c
 	 $(CC) $(CFLAGS) $?
@@ -1515,10 +1528,14 @@ os_map@o@: $(srcdir)/@OSDIR@/os_map.c
 	 $(CC) $(CFLAGS) $?
 os_method@o@: $(srcdir)/os/os_method.c
 	 $(CC) $(CFLAGS) $?
+os_mkdir@o@: $(srcdir)/os/os_mkdir.c
+	 $(CC) $(CFLAGS) $?
 os_oflags@o@: $(srcdir)/os/os_oflags.c
 	 $(CC) $(CFLAGS) $?
 os_open@o@: $(srcdir)/@OSDIR@/os_open.c
 	 $(CC) $(CFLAGS) $?
+os_pid@o@: $(srcdir)/os/os_pid.c
+	 $(CC) $(CFLAGS) $?
 os_region@o@: $(srcdir)/os/os_region.c
 	 $(CC) $(CFLAGS) $?
 os_rename@o@: $(srcdir)/@OSDIR@/os_rename.c
@@ -1541,8 +1558,12 @@ os_tmpdir@o@: $(srcdir)/os/os_tmpdir.c
 	 $(CC) $(CFLAGS) $?
 os_truncate@o@: $(srcdir)/@OSDIR@/os_truncate.c
 	 $(CC) $(CFLAGS) $?
+os_uid@o@: $(srcdir)/os/os_uid.c
+	 $(CC) $(CFLAGS) $?
 os_unlink@o@: $(srcdir)/os/os_unlink.c
 	 $(CC) $(CFLAGS) $?
+os_yield@o@: $(srcdir)/os/os_yield.c
+	 $(CC) $(CFLAGS) $?
 qam@o@: $(srcdir)/qam/qam.c
 	 $(CC) $(CFLAGS) $?
 qam_auto@o@: $(srcdir)/qam/qam_auto.c
@@ -1573,6 +1594,10 @@ rep_autop@o@: $(srcdir)/rep/rep_autop.c
 	 $(CC) $(CFLAGS) $?
 rep_backup@o@: $(srcdir)/rep/rep_backup.c
 	 $(CC) $(CFLAGS) $?
+rep_elect@o@: $(srcdir)/rep/rep_elect.c
+	 $(CC) $(CFLAGS) $?
+rep_log@o@: $(srcdir)/rep/rep_log.c
+	 $(CC) $(CFLAGS) $?
 rep_method@o@: $(srcdir)/rep/rep_method.c
 	 $(CC) $(CFLAGS) $?
 rep_record@o@: $(srcdir)/rep/rep_record.c
@@ -1585,6 +1610,26 @@ rep_stat@o@: $(srcdir)/rep/rep_stat.c
 	 $(CC) $(CFLAGS) $?
 rep_util@o@: $(srcdir)/rep/rep_util.c
 	 $(CC) $(CFLAGS) $?
+rep_verify@o@: $(srcdir)/rep/rep_verify.c
+	 $(CC) $(CFLAGS) $?
+repmgr_elect@o@: $(srcdir)/repmgr/repmgr_elect.c
+	$(CC) $(CFLAGS) $?
+repmgr_method@o@: $(srcdir)/repmgr/repmgr_method.c
+	$(CC) $(CFLAGS) $?
+repmgr_msg@o@: $(srcdir)/repmgr/repmgr_msg.c
+	$(CC) $(CFLAGS) $?
+repmgr_net@o@: $(srcdir)/repmgr/repmgr_net.c
+	$(CC) $(CFLAGS) $?
+repmgr_posix@o@: $(srcdir)/repmgr/repmgr_posix.c
+	$(CC) $(CFLAGS) $?
+repmgr_queue@o@: $(srcdir)/repmgr/repmgr_queue.c
+	$(CC) $(CFLAGS) $?
+repmgr_sel@o@: $(srcdir)/repmgr/repmgr_sel.c
+	$(CC) $(CFLAGS) $?
+repmgr_stat@o@: $(srcdir)/repmgr/repmgr_stat.c
+	$(CC) $(CFLAGS) $?
+repmgr_util@o@: $(srcdir)/repmgr/repmgr_util.c
+	$(CC) $(CFLAGS) $?
 rijndael-alg-fst@o@: $(srcdir)/crypto/rijndael/rijndael-alg-fst.c
 	$(CC) $(CFLAGS) $?
 rijndael-api-fst@o@: $(srcdir)/crypto/rijndael/rijndael-api-fst.c
@@ -1603,6 +1648,10 @@ txn_auto@o@: $(srcdir)/txn/txn_auto.c
 	 $(CC) $(CFLAGS) $?
 txn_autop@o@: $(srcdir)/txn/txn_autop.c
 	 $(CC) $(CFLAGS) $?
+txn_chkpt@o@: $(srcdir)/txn/txn_chkpt.c
+	 $(CC) $(CFLAGS) $?
+txn_failchk@o@: $(srcdir)/txn/txn_failchk.c
+	 $(CC) $(CFLAGS) $?
 txn_method@o@: $(srcdir)/txn/txn_method.c
 	 $(CC) $(CFLAGS) $?
 txn_rec@o@: $(srcdir)/txn/txn_rec.c
@@ -1660,37 +1709,37 @@ cxx_txn@o@: $(srcdir)/cxx/cxx_txn.cpp
 # Java API build rules.
 ##################################################
 db_java_wrap@o@: $(srcdir)/libdb_java/db_java_wrap.c
-	$(CC) $(CFLAGS) $?
+	$(CC) $(CFLAGS) $(SWIGCFLAGS) $?
 
 ##################################################
 # Tcl API build rules.
 ##################################################
 tcl_compat@o@: $(srcdir)/tcl/tcl_compat.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_db@o@: $(srcdir)/tcl/tcl_db.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_db_pkg@o@: $(srcdir)/tcl/tcl_db_pkg.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_dbcursor@o@: $(srcdir)/tcl/tcl_dbcursor.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_env@o@: $(srcdir)/tcl/tcl_env.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_internal@o@: $(srcdir)/tcl/tcl_internal.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_lock@o@: $(srcdir)/tcl/tcl_lock.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_log@o@: $(srcdir)/tcl/tcl_log.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_mp@o@: $(srcdir)/tcl/tcl_mp.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_rep@o@: $(srcdir)/tcl/tcl_rep.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_seq@o@: $(srcdir)/tcl/tcl_seq.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_txn@o@: $(srcdir)/tcl/tcl_txn.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 tcl_util@o@: $(srcdir)/tcl/tcl_util.c
-	$(CC) $(CFLAGS) $(TCFLAGS) $?
+	$(CC) $(CFLAGS) $(TCL_INCLUDE_SPEC) $?
 
 ##################################################
 # RPC build rules.
@@ -1734,6 +1783,8 @@ db_dump@o@: $(srcdir)/db_dump/db_dump.c
 	$(CC) $(CFLAGS) $?
 db_dump185@o@: $(srcdir)/db_dump185/db_dump185.c
 	$(CC) $(DB185INC) $?
+db_hotbackup@o@: $(srcdir)/db_hotbackup/db_hotbackup.c
+	$(CC) $(CFLAGS) $?
 db_load@o@: $(srcdir)/db_load/db_load.c
 	$(CC) $(CFLAGS) $?
 db_printlog@o@: $(srcdir)/db_printlog/db_printlog.c
@@ -1750,26 +1801,58 @@ db_verify@o@: $(srcdir)/db_verify/db_verify.c
 ##################################################
 # C library replacement files.
 ##################################################
+atoi@o@: $(srcdir)/clib/atoi.c
+	$(CC) $(CFLAGS) $?
+atol@o@: $(srcdir)/clib/atol.c
+	$(CC) $(CFLAGS) $?
+ctime@o@: $(srcdir)/clib/ctime.c
+	 $(CC) $(CFLAGS) $?
+getaddrinfo@o@: $(srcdir)/clib/getaddrinfo.c
+	$(CC) $(CFLAGS) $?
 getcwd@o@: $(srcdir)/clib/getcwd.c
 	$(CC) $(CFLAGS) $?
 getopt@o@: $(srcdir)/clib/getopt.c
 	$(CC) $(CFLAGS) $?
+isalpha@o@: $(srcdir)/clib/isalpha.c
+	$(CC) $(CFLAGS) $?
+isdigit@o@: $(srcdir)/clib/isdigit.c
+	$(CC) $(CFLAGS) $?
+isprint@o@: $(srcdir)/clib/isprint.c
+	$(CC) $(CFLAGS) $?
+isspace@o@: $(srcdir)/clib/isspace.c
+	$(CC) $(CFLAGS) $?
 memcmp@o@: $(srcdir)/clib/memcmp.c
 	$(CC) $(CFLAGS) $?
 memcpy@o@: $(srcdir)/clib/memmove.c
 	$(CC) -DMEMCOPY $(CFLAGS) $? -o $@
 memmove@o@: $(srcdir)/clib/memmove.c
 	$(CC) -DMEMMOVE $(CFLAGS) $?
+printf@o@: $(srcdir)/clib/printf.c
+	$(CC) $(CFLAGS) $?
 raise@o@: $(srcdir)/clib/raise.c
 	$(CC) $(CFLAGS) $?
+rand@o@: $(srcdir)/clib/rand.c
+	$(CC) $(CFLAGS) $?
 strcasecmp@o@: $(srcdir)/clib/strcasecmp.c
 	$(CC) $(CFLAGS) $?
 strdup@o@: $(srcdir)/clib/strdup.c
 	$(CC) $(CFLAGS) $?
 snprintf@o@: $(srcdir)/clib/snprintf.c
 	$(CC) $(CFLAGS) $?
+strcat@o@: $(srcdir)/clib/strcat.c
+	$(CC) $(CFLAGS) $?
+strchr@o@: $(srcdir)/clib/strchr.c
+	$(CC) $(CFLAGS) $?
 strerror@o@: $(srcdir)/clib/strerror.c
 	$(CC) $(CFLAGS) $?
+strncat@o@: $(srcdir)/clib/strncat.c
+	$(CC) $(CFLAGS) $?
+strncmp@o@: $(srcdir)/clib/strncmp.c
+	$(CC) $(CFLAGS) $?
+strrchr@o@: $(srcdir)/clib/strrchr.c
+	$(CC) $(CFLAGS) $?
+strsep@o@: $(srcdir)/clib/strsep.c
+	$(CC) $(CFLAGS) $?
 strtol@o@: $(srcdir)/clib/strtol.c
 	$(CC) $(CFLAGS) $?
 strtoul@o@: $(srcdir)/clib/strtoul.c
diff --git a/db/dist/RELEASE b/db/dist/RELEASE
index 6de537058..0874a36d3 100644
--- a/db/dist/RELEASE
+++ b/db/dist/RELEASE
@@ -1,11 +1,11 @@
-# $Id: RELEASE,v 11.195 2004/11/09 01:30:41 bostic Exp $
+# $Id: RELEASE,v 12.38 2006/09/20 20:08:48 bostic Exp $
 
 DB_VERSION_MAJOR=4
-DB_VERSION_MINOR=3
-DB_VERSION_PATCH=27
+DB_VERSION_MINOR=5
+DB_VERSION_PATCH=20
 DB_VERSION="$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH"
 
 DB_VERSION_UNIQUE_NAME=`printf "_%d%03d" $DB_VERSION_MAJOR $DB_VERSION_MINOR`
 
 DB_RELEASE_DATE=`date "+%B %e, %Y"`
-DB_VERSION_STRING="Sleepycat Software: Berkeley DB $DB_VERSION: ($DB_RELEASE_DATE)"
+DB_VERSION_STRING="Berkeley DB $DB_VERSION: ($DB_RELEASE_DATE)"
diff --git a/db/dist/aclocal/config.ac b/db/dist/aclocal/config.ac
index 717a0becc..3ae2ff2eb 100644
--- a/db/dist/aclocal/config.ac
+++ b/db/dist/aclocal/config.ac
@@ -15,47 +15,7 @@ AH_TEMPLATE(HAVE_FILESYSTEM_NOTZERO,
 AH_TEMPLATE(HAVE_UNLINK_WITH_OPEN_FAILURE,
     [Define to 1 if unlink of file with open file descriptors will fail.])
 
-AH_BOTTOM([/*
- * Exit success/failure macros.
- */
-#ifndef	HAVE_EXIT_SUCCESS
-#define	EXIT_FAILURE	1
-#define	EXIT_SUCCESS	0
-#endif
-
-/*
- * Don't step on the namespace.  Other libraries may have their own
- * implementations of these functions, we don't want to use their
- * implementations or force them to use ours based on the load order.
- */
-#ifndef	HAVE_GETCWD
-#define	getcwd		__db_Cgetcwd
-#endif
-#ifndef	HAVE_MEMCMP
-#define	memcmp		__db_Cmemcmp
-#endif
-#ifndef	HAVE_MEMCPY
-#define	memcpy		__db_Cmemcpy
-#endif
-#ifndef	HAVE_MEMMOVE
-#define	memmove		__db_Cmemmove
-#endif
-#ifndef	HAVE_RAISE
-#define	raise		__db_Craise
-#endif
-#ifndef	HAVE_SNPRINTF
-#define	snprintf	__db_Csnprintf
-#endif
-#ifndef	HAVE_STRCASECMP
-#define	strcasecmp	__db_Cstrcasecmp
-#define	strncasecmp	__db_Cstrncasecmp
-#endif
-#ifndef	HAVE_STRERROR
-#define	strerror	__db_Cstrerror
-#endif
-#ifndef	HAVE_VSNPRINTF
-#define	vsnprintf	__db_Cvsnprintf
-#endif
+AH_BOTTOM([#include "clib_port.h"
 
 #ifdef DB_WIN32
 #include "win_db.h"
diff --git a/db/dist/aclocal/libtool.ac b/db/dist/aclocal/libtool.ac
index 71dae456a..0f53cb592 100644
--- a/db/dist/aclocal/libtool.ac
+++ b/db/dist/aclocal/libtool.ac
@@ -1,28 +1,13 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
 ## Free Software Foundation, Inc.
 ## Originally by Gordon Matzigkeit , 1996
 ##
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-##
-## As a special exception to the GNU General Public License, if you
-## distribute this file as part of a program that contains a
-## configuration script generated by Autoconf, you may include it under
-## the same distribution terms that you use for the rest of that program.
+## This file is free software; the Free Software Foundation gives
+## unlimited permission to copy and/or distribute it, with or without
+## modifications, as long as this notice is preserved.
 
-# serial 47 AC_PROG_LIBTOOL
+# serial 48 AC_PROG_LIBTOOL
 
 
 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -132,7 +117,7 @@ esac
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
+Xsed='sed -e 1s/^X//'
 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
 
 # Same as above, but do not quote variable references.
@@ -152,7 +137,7 @@ rm="rm -f"
 default_ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except M$VC,
+# All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 ltmain="$ac_aux_dir/ltmain.sh"
@@ -172,6 +157,7 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
 test -z "$AS" && AS=as
 test -z "$CC" && CC=cc
 test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$DLLTOOL" && DLLTOOL=dlltool
 test -z "$LD" && LD=ld
 test -z "$LN_S" && LN_S="ln -s"
@@ -191,16 +177,16 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
     ;;
   *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
     ;;
   esac
   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
 
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+_LT_CC_BASENAME([$compiler])
 
 # Only perform the check for file, if the check method requires it
 case $deplibs_check_method in
@@ -242,11 +228,56 @@ AC_DEFUN([_LT_AC_SYS_COMPILER],
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 ])# _LT_AC_SYS_COMPILER
 
 
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+AC_DEFUN([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
+
+
 # _LT_AC_SYS_LIBPATH_AIX
 # ----------------------
 # Links a minimal program and checks the executable
@@ -326,8 +357,8 @@ if test "X${echo_test_string+set}" != Xset; then
 # find a string as large as possible, as long as the shell can cope with it
   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
     then
       break
@@ -496,7 +527,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    case "`/usr/bin/file conftest.o`" in
+    case `/usr/bin/file conftest.o` in
     *32-bit*)
       case $host in
         x86_64-*linux*)
@@ -547,6 +578,22 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)    LD="${LD-ld} -64" ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
@@ -578,7 +625,7 @@ AC_CACHE_CHECK([$1], [$2],
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
@@ -588,8 +635,10 @@ AC_CACHE_CHECK([$1], [$2],
    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        $2=yes
      fi
    fi
@@ -615,11 +664,16 @@ AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
    LDFLAGS="$LDFLAGS $3"
    printf "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The compiler can only warn and ignore the option if not recognized
+     # The linker can only warn and ignore the option if not recognized
      # So say no if there are warnings
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
      else
        $2=yes
      fi
@@ -678,20 +732,50 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* )
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
     elif test -x /usr/sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
     else
-      lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
     fi
     # And add a safety zone
     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     ;;
 
- *)
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
@@ -722,7 +806,7 @@ fi
 
 
 # _LT_AC_CHECK_DLFCN
-# --------------------
+# ------------------
 AC_DEFUN([_LT_AC_CHECK_DLFCN],
 [AC_CHECK_HEADERS(dlfcn.h)dnl
 ])# _LT_AC_CHECK_DLFCN
@@ -730,7 +814,7 @@ AC_DEFUN([_LT_AC_CHECK_DLFCN],
 
 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
+# ---------------------------------------------------------------------
 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
 if test "$cross_compiling" = yes; then :
@@ -796,17 +880,19 @@ int main ()
       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
       /* dlclose (self); */
     }
+  else
+    puts (dlerror ());
 
     exit (status);
 }]
 EOF
   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) $1 ;;
       x$lt_dlneed_uscore) $2 ;;
-      x$lt_unknown|x*) $3 ;;
+      x$lt_dlunknown|x*) $3 ;;
     esac
   else :
     # compilation failed
@@ -818,7 +904,7 @@ rm -fr conftest*
 
 
 # AC_LIBTOOL_DLOPEN_SELF
-# -------------------
+# ----------------------
 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
 if test "x$enable_dlopen" != xyes; then
@@ -889,7 +975,7 @@ else
     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
     save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
     save_LIBS="$LIBS"
     LIBS="$lt_cv_dlopen_libs $LIBS"
@@ -902,7 +988,7 @@ else
     ])
 
     if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
     	  lt_cv_dlopen_self_static, [dnl
 	  _LT_AC_TRY_DLOPEN_SELF(
@@ -950,7 +1036,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
@@ -962,11 +1048,13 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -1226,7 +1314,8 @@ cygwin* | mingw* | pw32*)
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -1256,7 +1345,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -1279,7 +1368,7 @@ darwin* | rhapsody*)
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -1314,8 +1403,17 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -1333,14 +1431,19 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -1360,7 +1463,7 @@ hpux9* | hpux10* | hpux11*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -1400,6 +1503,18 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -1459,7 +1574,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -1521,8 +1636,13 @@ nto-qnx*)
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  need_version=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -1560,13 +1680,6 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -1592,7 +1705,7 @@ sunos4*)
   need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -1625,6 +1738,29 @@ sysv4*MP*)
   fi
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -1638,6 +1774,11 @@ uts4*)
 esac
 AC_MSG_RESULT([$dynamic_linker])
 test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
 
@@ -1662,6 +1803,9 @@ if test -f "$ltmain" && test -n "$tagnames"; then
       AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
     fi
   fi
+  if test -z "$LTCFLAGS"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+  fi
 
   # Extract list of available tagged configurations in $ofile.
   # Note that this assumes the entire list is on one line.
@@ -1688,7 +1832,9 @@ if test -f "$ltmain" && test -n "$tagnames"; then
 
       case $tagname in
       CXX)
-	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+	    (test "X$CXX" != "Xg++"))) ; then
 	  AC_LIBTOOL_LANG_CXX_CONFIG
 	else
 	  tagname=""
@@ -1750,7 +1896,7 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN],
 
 # AC_LIBTOOL_WIN32_DLL
 # --------------------
-# declare package support for building win32 dll's
+# declare package support for building win32 DLLs
 AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
 [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
 ])# AC_LIBTOOL_WIN32_DLL
@@ -1788,7 +1934,7 @@ AC_ARG_ENABLE([shared],
 
 # AC_DISABLE_SHARED
 # -----------------
-#- set the default shared flag to --disable-shared
+# set the default shared flag to --disable-shared
 AC_DEFUN([AC_DISABLE_SHARED],
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 AC_ENABLE_SHARED(no)
@@ -1924,7 +2070,7 @@ dnl not every word.  This closes a longstanding sh security hole.
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
-	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
 	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
@@ -2034,7 +2180,7 @@ AC_CACHE_VAL(lt_cv_path_LD,
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
+      # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 &1  /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
       # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
       lt_cv_file_magic_cmd=/usr/bin/file
       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
       ;;
@@ -2180,7 +2326,7 @@ gnu*)
 
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
@@ -2196,6 +2342,11 @@ hpux10.20* | hpux11*)
   esac
   ;;
 
+interix3*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $LD in
   *-32|*"-32 ") libmagic=32-bit;;
@@ -2208,15 +2359,6 @@ irix5* | irix6* | nonstopux*)
 
 # This must be Linux ELF.
 linux*)
-  case $host_cpu in
-  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -2250,15 +2392,11 @@ osf3* | osf4* | osf5*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 solaris*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   case $host_vendor in
   motorola)
     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
@@ -2279,10 +2417,13 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
   siemens)
     lt_cv_deplibs_check_method=pass_all
     ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
   esac
   ;;
 
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 esac
@@ -2302,36 +2443,43 @@ AC_DEFUN([AC_PROG_NM],
   # Let the user override the test.
   lt_cv_path_NM="$NM"
 else
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
-    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      # Tru64's nm complains that /dev/null is an invalid object file
-      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-      */dev/null* | *'Invalid file or object type'*)
-	lt_cv_path_NM="$tmp_nm -B"
-	break
-        ;;
-      *)
-	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	*/dev/null*)
-	  lt_cv_path_NM="$tmp_nm -p"
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
 	  break
 	  ;;
 	*)
-	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	  continue # so that we can try to find one that supports BSD flags
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
 	  ;;
 	esac
-      esac
-    fi
+      fi
+    done
+    IFS="$lt_save_ifs"
   done
-  IFS="$lt_save_ifs"
   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
 fi])
 NM="$lt_cv_path_NM"
@@ -2363,13 +2511,13 @@ esac
 # -----------------------------------
 # sets LIBLTDL to the link flags for the libltdl convenience library and
 # LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
-# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
-# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
-# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
+# --enable-ltdl-convenience to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
+# (note the single quotes!).  If your package is not flat and you're not
+# using automake, define top_builddir and top_srcdir appropriately in
+# the Makefiles.
 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   case $enable_ltdl_convenience in
@@ -2388,13 +2536,13 @@ AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
 # -----------------------------------
 # sets LIBLTDL to the link flags for the libltdl installable library and
 # LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
-# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
-# DIRECTORY is not provided and an installed libltdl is not found, it is
-# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
-# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
-# quotes!).  If your package is not flat and you're not using automake,
-# define top_builddir and top_srcdir appropriately in the Makefiles.
+# --enable-ltdl-install to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
@@ -2432,10 +2580,21 @@ AC_DEFUN([AC_LIBTOOL_CXX],
 # ---------------
 AC_DEFUN([_LT_AC_LANG_CXX],
 [AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
 ])# _LT_AC_LANG_CXX
 
+# _LT_AC_PROG_CXXCPP
+# ------------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+fi
+])# _LT_AC_PROG_CXXCPP
 
 # AC_LIBTOOL_F77
 # --------------
@@ -2475,7 +2634,7 @@ _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
 
 
 # AC_LIBTOOL_RC
-# --------------
+# -------------
 # enable support for Windows resource files
 AC_DEFUN([AC_LIBTOOL_RC],
 [AC_REQUIRE([LT_AC_PROG_RC])
@@ -2508,36 +2667,9 @@ lt_simple_link_test_code='int main(){return(0);}\n'
 
 _LT_AC_SYS_COMPILER
 
-#
-# Check for any special shared library compilation flags.
-#
-_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
-if test "$GCC" = no; then
-  case $host_os in
-  sco3.2v5*)
-    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
-    ;;
-  esac
-fi
-if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
-  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
-  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ 	]]" >/dev/null; then :
-  else
-    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
-    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
-  fi
-fi
-
-
-#
-# Check to make sure the static flag actually works.
-#
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
-  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
-  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
-  [],
-  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
 
 ## CAVEAT EMPTOR:
 ## There is no encapsulation within the following macros, do not change
@@ -2551,9 +2683,9 @@ AC_LIBTOOL_PROG_LD_SHLIBS($1)
 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
+AC_LIBTOOL_DLOPEN_SELF
 
-# Report which librarie types wil actually be built
+# Report which library types will actually be built
 AC_MSG_CHECKING([if libtool supports shared libraries])
 AC_MSG_RESULT([$can_build_shared])
 
@@ -2562,7 +2694,7 @@ test "$can_build_shared" = "no" && enable_shared=no
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -2600,7 +2732,7 @@ AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
 AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
 [AC_LANG_PUSH(C++)
 AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
 
 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
@@ -2612,6 +2744,7 @@ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
 _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 _LT_AC_TAGVAR(hardcode_automatic, $1)=no
 _LT_AC_TAGVAR(module_cmds, $1)=
 _LT_AC_TAGVAR(module_expsym_cmds, $1)=
@@ -2629,7 +2762,7 @@ _LT_AC_TAGVAR(postdeps, $1)=
 _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
 
 # Source file extension for C++ test sources.
-ac_ext=cc
+ac_ext=cpp
 
 # Object file extension for compiled C++ test sources.
 objext=o
@@ -2639,11 +2772,15 @@ _LT_AC_TAGVAR(objext, $1)=$objext
 lt_simple_compile_test_code="int some_variable = 0;\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC=$CC
 lt_save_LD=$LD
@@ -2654,18 +2791,18 @@ lt_save_path_LD=$lt_cv_path_LD
 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
   lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
 else
-  unset lt_cv_prog_gnu_ld
+  $as_unset lt_cv_prog_gnu_ld
 fi
 if test -n "${lt_cv_path_LDCXX+set}"; then
   lt_cv_path_LD=$lt_cv_path_LDCXX
 else
-  unset lt_cv_path_LD
+  $as_unset lt_cv_path_LD
 fi
 test -z "${LDCXX+set}" || LD=$LDCXX
 CC=${CXX-"c++"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+_LT_CC_BASENAME([$compiler])
 
 # We don't want -fno-exception wen compiling C++ code, so set the
 # no_builtin_flag separately
@@ -2754,6 +2891,7 @@ case $host_os in
 	    ;;
 	  esac
 	done
+	;;
       esac
 
       exp_sym_flag='-bexport'
@@ -2772,7 +2910,7 @@ case $host_os in
     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
     if test "$GXX" = yes; then
-      case $host_os in aix4.[012]|aix4.[012].*)
+      case $host_os in aix4.[[012]]|aix4.[[012]].*)
       # We only want to do this on AIX 4.2 and lower, the check
       # below for broken collect2 doesn't work under 4.3+
 	collect2name=`${CC} -print-prog-name=collect2`
@@ -2791,8 +2929,12 @@ case $host_os in
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 	fi
+	;;
       esac
       shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+	shared_flag="$shared_flag "'${wl}-G'
+      fi
     else
       # not using gcc
       if test "$host_cpu" = ia64; then
@@ -2819,12 +2961,12 @@ case $host_os in
       _LT_AC_SYS_LIBPATH_AIX
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
      else
       if test "$host_cpu" = ia64; then
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
       else
 	# Determine the default libpath from the value encoded in an empty executable.
 	_LT_AC_SYS_LIBPATH_AIX
@@ -2833,16 +2975,26 @@ case $host_os in
 	# -berok will link without error, but may produce a broken library.
 	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	# -bexpall does not export symbols beginning with underscore (_)
-	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
 	# Exported symbols can be pulled into shared objects from archives
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	# This is similar to how AIX traditionally builds it's shared libraries.
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	# This is similar to how AIX traditionally builds its shared libraries.
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
       fi
     fi
     ;;
+
+  beos*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Joseph Beckenbach  says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+    ;;
+
   chorus*)
     case $cc_basename in
       *)
@@ -2852,7 +3004,6 @@ case $host_os in
     esac
     ;;
 
-
   cygwin* | mingw* | pw32*)
     # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
     # as there is no search path for DLLs.
@@ -2862,7 +3013,7 @@ case $host_os in
     _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
     if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is; otherwise, prepend...
       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -2871,13 +3022,13 @@ case $host_os in
 	echo EXPORTS > $output_objdir/$soname.def;
 	cat $export_symbols >> $output_objdir/$soname.def;
       fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
     else
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
     fi
   ;;
       darwin* | rhapsody*)
-        case "$host_os" in
+        case $host_os in
         rhapsody* | darwin1.[[012]])
          _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
          ;;
@@ -2915,7 +3066,7 @@ case $host_os in
           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
         fi
         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
           if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           else
@@ -2923,12 +3074,12 @@ case $host_os in
           fi
             _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
       else
-      case "$cc_basename" in
+      case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
           _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -2941,11 +3092,11 @@ case $host_os in
 
   dgux*)
     case $cc_basename in
-      ec++)
+      ec++*)
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      ghcx)
+      ghcx*)
 	# Green Hills C++ Compiler
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -2956,14 +3107,14 @@ case $host_os in
 	;;
     esac
     ;;
-  freebsd[12]*)
+  freebsd[[12]]*)
     # C++ shared libraries reported to be fairly broken before switch to ELF
     _LT_AC_TAGVAR(ld_shlibs, $1)=no
     ;;
   freebsd-elf*)
     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
     ;;
-  freebsd* | kfreebsd*-gnu)
+  freebsd* | kfreebsd*-gnu | dragonfly*)
     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
     # conventions
     _LT_AC_TAGVAR(ld_shlibs, $1)=yes
@@ -2980,11 +3131,11 @@ case $host_os in
 				# location of the library.
 
     case $cc_basename in
-    CC)
+    CC*)
       # FIXME: insert proper C++ library support
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
       ;;
-    aCC)
+    aCC*)
       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
@@ -2994,7 +3145,7 @@ case $host_os in
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -3008,33 +3159,22 @@ case $host_os in
     ;;
   hpux10*|hpux11*)
     if test $with_gnu_ld = no; then
-      case "$host_cpu" in
-      hppa*64*)
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+      case $host_cpu in
+      hppa*64*|ia64*)
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-        ;;
-      ia64*)
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         ;;
       *)
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         ;;
       esac
     fi
-    case "$host_cpu" in
-    hppa*64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-    ia64*)
+    case $host_cpu in
+    hppa*64*|ia64*)
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
       ;;
     *)
       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
@@ -3045,14 +3185,17 @@ case $host_os in
     esac
 
     case $cc_basename in
-      CC)
+      CC*)
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      aCC)
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+      aCC*)
+	case $host_cpu in
+	hppa*64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	  ;;
 	*)
 	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
@@ -3071,9 +3214,12 @@ case $host_os in
       *)
 	if test "$GXX" = yes; then
 	  if test $with_gnu_ld = no; then
-	    case "$host_cpu" in
-	    ia64*|hppa*64*)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	    case $host_cpu in
+	    hppa*64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      ;;
+	    ia64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	      ;;
 	    *)
 	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
@@ -3087,11 +3233,25 @@ case $host_os in
 	;;
     esac
     ;;
+  interix3*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+    # Instead, shared libraries are loaded at an image base (0x10000000 by
+    # default) and relocated if they conflict, which is a slow very memory
+    # consuming and fragmenting process.  To avoid this, we pick a random,
+    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    ;;
   irix5* | irix6*)
     case $cc_basename in
-      CC)
+      CC*)
 	# SGI C++
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
 	# Archives containing C++ object files must be created using
 	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -3102,7 +3262,7 @@ case $host_os in
       *)
 	if test "$GXX" = yes; then
 	  if test "$with_gnu_ld" = no; then
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	  else
 	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
 	  fi
@@ -3115,7 +3275,7 @@ case $host_os in
     ;;
   linux*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -3140,7 +3300,7 @@ case $host_os in
 	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
 	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 	;;
-      icpc)
+      icpc*)
 	# Intel C++
 	with_gnu_ld=yes
 	# version 8.0 and above of icpc choke on multiply defined symbols
@@ -3152,8 +3312,12 @@ case $host_os in
   	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  ;;
 	*)  # Version 8.0 or newer
-  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  tmp_idyn=
+	  case $host_cpu in
+	    ia64*) tmp_idyn=' -i_dynamic';;
+	  esac
+  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  ;;
 	esac
 	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
@@ -3161,7 +3325,16 @@ case $host_os in
 	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	;;
-      cxx)
+      pgCC*)
+        # Portland Group C++ compiler
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
 	# Compaq C++
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
@@ -3192,7 +3365,7 @@ case $host_os in
     ;;
   mvs*)
     case $cc_basename in
-      cxx)
+      cxx*)
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
@@ -3218,6 +3391,8 @@ case $host_os in
     _LT_AC_TAGVAR(ld_shlibs, $1)=no
     ;;
   openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
@@ -3229,7 +3404,7 @@ case $host_os in
     ;;
   osf3*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -3245,14 +3420,14 @@ case $host_os in
 	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 
 	;;
-      RCC)
+      RCC*)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      cxx)
+      cxx*)
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -3270,7 +3445,7 @@ case $host_os in
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -3289,7 +3464,7 @@ case $host_os in
     ;;
   osf4* | osf5*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -3304,17 +3479,17 @@ case $host_os in
 	# the KAI C++ compiler.
 	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
 	;;
-      RCC)
+      RCC*)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      cxx)
+      cxx*)
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
 	  $rm $lib.exp'
 
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -3333,7 +3508,7 @@ case $host_os in
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -3354,27 +3529,14 @@ case $host_os in
     # FIXME: insert proper C++ library support
     _LT_AC_TAGVAR(ld_shlibs, $1)=no
     ;;
-  sco*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    case $cc_basename in
-      CC)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
   sunos4*)
     case $cc_basename in
-      CC)
+      CC*)
 	# Sun C++ 4.x
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      lcc)
+      lcc*)
 	# Lucid
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -3387,36 +3549,33 @@ case $host_os in
     ;;
   solaris*)
     case $cc_basename in
-      CC)
+      CC*)
 	# Sun C++ 4.2, 5.x and Centerline C++
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
 	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 	case $host_os in
-	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 	  *)
 	    # The C++ compiler is used as linker so we must use $wl
 	    # flag to pass the commands to the underlying system
-	    # linker.
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
 	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
 	    ;;
 	esac
 	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	output_verbose_link_cmd='echo'
 
 	# Archives containing C++ object files must be created using
 	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -3424,7 +3583,7 @@ case $host_os in
 	# in the archive.
 	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
 	;;
-      gcx)
+      gcx*)
 	# Green Hills C++ Compiler
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
@@ -3462,12 +3621,63 @@ case $host_os in
 	;;
     esac
     ;;
-  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
+    ;;
+  sysv5* | sco3.2v5* | sco5v6*)
+    # Note: We can NOT use -z defs as we might desire, because we do not
+    # link with -lc, and that would cause any symbols used from libc to
+    # always be unresolved, which means just about no library would
+    # ever link correctly.  If we're not using GNU ld we use -z text
+    # though, which does catch some bad symbols but isn't as heavy-handed
+    # as -z defs.
+    # For security reasons, it is highly recommended that you always
+    # use absolute paths for naming shared libraries, and exclude the
+    # DT_RUNPATH tag from executables and libraries.  But doing so
+    # requires that you compile everything twice, which is a pain.
+    # So that behaviour is only enabled if SCOABSPATH is set to a
+    # non-empty value in the environment.  Most likely only useful for
+    # creating official distributions of packages.
+    # This is a hack until libtool officially supports absolute path
+    # names for shared libraries.
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
     ;;
   tandem*)
     case $cc_basename in
-      NCC)
+      NCC*)
 	# NonStop-UX NCC 3.20
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -3504,8 +3714,6 @@ AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 AC_LIBTOOL_PROG_LD_SHLIBS($1)
 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
 
 AC_LIBTOOL_CONFIG($1)
 
@@ -3523,7 +3731,7 @@ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
 ])# AC_LIBTOOL_LANG_CXX_CONFIG
 
 # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------
+# ------------------------------------
 # Figure out "hidden" library dependencies from verbose
 # compiler output when linking a shared library.
 # Parse the compiler output and extract the necessary
@@ -3577,7 +3785,7 @@ if AC_TRY_EVAL(ac_compile); then
   # The `*' in the case matches for architectures that use `case' in
   # $output_verbose_cmd can trigger glob expansion during the loop
   # eval without this substitution.
-  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
 
   for p in `eval $output_verbose_link_cmd`; do
     case $p in
@@ -3653,13 +3861,37 @@ fi
 
 $rm -f confest.$objext
 
+# PORTME: override above test on systems where it is broken
+ifelse([$1],[CXX],
+[case $host_os in
+interix3*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_AC_TAGVAR(predep_objects,$1)=
+  _LT_AC_TAGVAR(postdep_objects,$1)=
+  _LT_AC_TAGVAR(postdeps,$1)=
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+esac
+])
+
 case " $_LT_AC_TAGVAR(postdeps, $1) " in
 *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
 esac
 ])# AC_LIBTOOL_POSTDEP_PREDEP
 
 # AC_LIBTOOL_LANG_F77_CONFIG
-# ------------------------
+# --------------------------
 # Ensure that the configuration vars for the C compiler are
 # suitably defined.  Those variables are subsequently used by
 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
@@ -3703,12 +3935,16 @@ lt_simple_link_test_code="      program t\n      end\n"
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${F77-"f77"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+_LT_CC_BASENAME([$compiler])
 
 AC_MSG_CHECKING([if libtool supports shared libraries])
 AC_MSG_RESULT([$can_build_shared])
@@ -3718,7 +3954,7 @@ test "$can_build_shared" = "no" && enable_shared=no
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -3727,7 +3963,9 @@ aix3*)
   fi
   ;;
 aix4* | aix5*)
-  test "$enable_shared" = yes && enable_static=no
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
   ;;
 esac
 AC_MSG_RESULT([$enable_shared])
@@ -3737,8 +3975,6 @@ AC_MSG_CHECKING([whether to build static libraries])
 test "$enable_shared" = yes || enable_static=yes
 AC_MSG_RESULT([$enable_static])
 
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
 _LT_AC_TAGVAR(GCC, $1)="$G77"
 _LT_AC_TAGVAR(LD, $1)="$LD"
 
@@ -3748,8 +3984,6 @@ AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 AC_LIBTOOL_PROG_LD_SHLIBS($1)
 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-
 
 AC_LIBTOOL_CONFIG($1)
 
@@ -3778,20 +4012,27 @@ _LT_AC_TAGVAR(objext, $1)=$objext
 lt_simple_compile_test_code="class foo {}\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${GCJ-"gcj"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
 ## CAVEAT EMPTOR:
 ## There is no encapsulation within the following macros, do not change
 ## the running order or otherwise move them around unless you know exactly
@@ -3803,8 +4044,6 @@ AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 AC_LIBTOOL_PROG_LD_SHLIBS($1)
 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
 
 AC_LIBTOOL_CONFIG($1)
 
@@ -3814,7 +4053,7 @@ CC="$lt_save_CC"
 
 
 # AC_LIBTOOL_LANG_RC_CONFIG
-# --------------------------
+# -------------------------
 # Ensure that the configuration vars for the Windows resource compiler are
 # suitably defined.  Those variables are subsequently used by
 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
@@ -3838,11 +4077,16 @@ lt_simple_link_test_code="$lt_simple_compile_test_code"
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${RC-"windres"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
 AC_LIBTOOL_CONFIG($1)
@@ -3872,7 +4116,7 @@ if test -f "$ltmain"; then
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -3978,7 +4222,7 @@ ifelse([$1], [],
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -3989,7 +4233,7 @@ ifelse([$1], [],
 SED=$lt_SED
 
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e s/^X//"
+Xsed="$SED -e 1s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
@@ -4024,6 +4268,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -4035,6 +4285,9 @@ AR_FLAGS=$lt_AR_FLAGS
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
 
@@ -4100,7 +4353,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -4374,9 +4627,6 @@ symcode='[[BCDEGRST]]'
 # Regexp to match symbols that can be accessed directly from C.
 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
 
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
 # Transform an extracted symbol line into a proper C declaration
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
@@ -4398,15 +4648,31 @@ hpux*) # Its linker distinguishes data from code symbols
   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
   lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
   ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDGIRSTW]]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
 irix* | nonstopux*)
   symcode='[[BCDEGRST]]'
   ;;
 osf*)
   symcode='[[BCDEGQRST]]'
   ;;
-solaris* | sysv5*)
+solaris*)
   symcode='[[BDRT]]'
   ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
 sysv4)
   symcode='[[DFNSTU]]'
   ;;
@@ -4429,8 +4695,11 @@ esac
 # Try without a prefix undercore, then with it.
 for ac_symprfx in "" "_"; do
 
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
   # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -4586,6 +4855,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       # DJGPP does not support shared libraries at all
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
       ;;
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
     sysv4*MP*)
       if test -d /usr/nec; then
 	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
@@ -4594,7 +4867,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	;;
       *)
@@ -4619,7 +4892,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	;;
       chorus*)
 	case $cc_basename in
-	cxch68)
+	cxch68*)
 	  # Green Hills C++ Compiler
 	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
 	  ;;
@@ -4628,7 +4901,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        darwin*)
          # PIC is the default on this platform
          # Common symbols not allowed in MH_DYLIB files
-         case "$cc_basename" in
+         case $cc_basename in
            xlc*)
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -4637,10 +4910,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       dgux*)
 	case $cc_basename in
-	  ec++)
+	  ec++*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    ;;
-	  ghcx)
+	  ghcx*)
 	    # Green Hills C++ Compiler
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    ;;
@@ -4648,22 +4921,22 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	    ;;
 	esac
 	;;
-      freebsd* | kfreebsd*-gnu)
+      freebsd* | kfreebsd*-gnu | dragonfly*)
 	# FreeBSD uses GNU C++
 	;;
       hpux9* | hpux10* | hpux11*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
 	    if test "$host_cpu" != ia64; then
 	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	    fi
 	    ;;
-	  aCC)
+	  aCC*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-	    case "$host_cpu" in
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
 	      ;;
@@ -4676,9 +4949,13 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	    ;;
 	esac
 	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
       irix5* | irix6* | nonstopux*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 	    # CC pic flag -KPIC is the default.
@@ -4689,18 +4966,24 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	;;
       linux*)
 	case $cc_basename in
-	  KCC)
+	  KCC*)
 	    # KAI C++ Compiler
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	    ;;
-	  icpc)
+	  icpc* | ecpc*)
 	    # Intel C++
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 	    ;;
-	  cxx)
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
 	    # Compaq C++
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
 	    # Linux and Compaq Tru64 Unix objects are PIC.
@@ -4717,7 +5000,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	;;
       mvs*)
 	case $cc_basename in
-	  cxx)
+	  cxx*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
 	    ;;
 	  *)
@@ -4728,14 +5011,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
-	  KCC)
+	  KCC*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
 	    ;;
-	  RCC)
+	  RCC*)
 	    # Rational C++ 2.4.1
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    ;;
-	  cxx)
+	  cxx*)
 	    # Digital/Compaq C++
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
@@ -4749,24 +5032,15 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	;;
       psos*)
 	;;
-      sco*)
-	case $cc_basename in
-	  CC)
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
       solaris*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
 	    ;;
-	  gcx)
+	  gcx*)
 	    # Green Hills C++ Compiler
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 	    ;;
@@ -4776,12 +5050,12 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	;;
       sunos4*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    # Sun C++ 4.x
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	    ;;
-	  lcc)
+	  lcc*)
 	    # Lucid
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    ;;
@@ -4791,7 +5065,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	;;
       tandem*)
 	case $cc_basename in
-	  NCC)
+	  NCC*)
 	    # NonStop-UX NCC 3.20
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    ;;
@@ -4799,7 +5073,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	    ;;
 	esac
 	;;
-      unixware*)
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
 	;;
       vxworks*)
 	;;
@@ -4846,6 +5127,11 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
       ;;
 
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
     msdosdjgpp*)
       # Just because we use GCC doesn't mean we suddenly get shared libraries
       # on systems that don't support them.
@@ -4862,7 +5148,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -4891,7 +5177,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       darwin*)
         # PIC is the default on this platform
         # Common symbols not allowed in MH_DYLIB files
-       case "$cc_basename" in
+       case $cc_basename in
          xlc*)
          _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
          _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -4909,7 +5195,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -4933,12 +5219,19 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       ;;
 
     linux*)
-      case $CC in
+      case $cc_basename in
       icc* | ecc*)
 	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
         ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
       ccc*)
         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         # All Alpha code is PIC.
@@ -4953,15 +5246,15 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    sco3.2v5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
-      ;;
-
     solaris*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -4970,7 +5263,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sysv4 | sysv4.2uw2* | sysv4.3*)
       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -4983,6 +5276,17 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       fi
       ;;
 
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
     uts4*)
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -5010,7 +5314,7 @@ if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
@@ -5019,6 +5323,16 @@ case "$host_os" in
     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
     ;;
 esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
 ])
 
 
@@ -5043,7 +5357,7 @@ ifelse([$1],[CXX],[
     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   *)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
@@ -5086,7 +5400,8 @@ ifelse([$1],[CXX],[
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
-
+  # Just being paranoid about ensuring that cc_basename is set.
+  _LT_CC_BASENAME([$compiler])
   case $host_os in
   cygwin* | mingw* | pw32*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
@@ -5096,6 +5411,10 @@ ifelse([$1],[CXX],[
       with_gnu_ld=no
     fi
     ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
   openbsd*)
     with_gnu_ld=no
     ;;
@@ -5106,6 +5425,27 @@ ifelse([$1],[CXX],[
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
     # See if GNU ld supports shared libraries.
     case $host_os in
     aix3* | aix4* | aix5*)
@@ -5156,10 +5496,10 @@ EOF
       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_AC_TAGVAR(always_export_symbols, $1)=no
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -5168,9 +5508,55 @@ EOF
 	  echo EXPORTS > $output_objdir/$soname.def;
 	  cat $export_symbols >> $output_objdir/$soname.def;
 	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
-	ld_shlibs=no
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    interix3*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
@@ -5184,7 +5570,7 @@ EOF
       fi
       ;;
 
-    solaris* | sysv5*)
+    solaris*)
       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	cat <&2
@@ -5205,6 +5591,33 @@ EOF
       fi
       ;;
 
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
     sunos4*)
       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       wlarc=
@@ -5212,31 +5625,6 @@ EOF
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
-      fi
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -5247,16 +5635,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       ;;
     esac
 
-    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
-      runpath_var=LD_RUN_PATH
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-      fi
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -5268,7 +5651,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -5302,6 +5685,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
   	    break
   	  fi
 	  done
+	  ;;
 	esac
 
 	exp_sym_flag='-bexport'
@@ -5320,7 +5704,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -5339,8 +5723,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
   	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
   	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 	  fi
+	  ;;
 	esac
 	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -5348,11 +5736,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
   	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-  	if test "$aix_use_runtimelinking" = yes; then
+	  if test "$aix_use_runtimelinking" = yes; then
 	    shared_flag='${wl}-G'
 	  else
 	    shared_flag='${wl}-bM:SRE'
-  	fi
+	  fi
 	fi
       fi
 
@@ -5366,12 +5754,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
        # Determine the default libpath from the value encoded in an empty executable.
        _LT_AC_SYS_LIBPATH_AIX
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
        else
 	if test "$host_cpu" = ia64; then
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an empty executable.
 	 _LT_AC_SYS_LIBPATH_AIX
@@ -5380,13 +5768,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
 	  # -berok will link without error, but may produce a broken library.
 	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  # -bexpall does not export symbols beginning with underscore (_)
-	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
 	  # Exported symbols can be pulled into shared objects from archives
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -5420,12 +5806,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
       # FIXME: Should let the user specify the lib program.
       _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
       ;;
 
     darwin* | rhapsody*)
-      case "$host_os" in
+      case $host_os in
         rhapsody* | darwin1.[[012]])
          _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
          ;;
@@ -5454,16 +5840,16 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
     	output_verbose_link_cmd='echo'
         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
       _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
-      case "$cc_basename" in
+      case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -5504,7 +5890,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
@@ -5527,47 +5913,62 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
       ;;
 
-    hpux10* | hpux11*)
+    hpux10*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*|ia64*)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
 	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
 	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	case $host_cpu in
+	hppa*64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*)
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
 	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 	  ;;
-	ia64*)
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-	  ;;
 	*)
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
@@ -5661,7 +6062,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -5669,21 +6070,15 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
       ;;
 
-    sco3.2v5*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
     solaris*)
       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
       if test "$GCC" = yes; then
+	wlarc='${wl}'
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+	wlarc=''
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -5692,8 +6087,18 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       case $host_os in
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
       esac
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
       ;;
@@ -5750,36 +6155,45 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       fi
       ;;
 
-    sysv4.2uw2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+      runpath_var='LD_RUN_PATH'
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
       if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-    sysv5*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
       ;;
 
     uts4*)
@@ -5797,11 +6211,6 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
 #
 # Do we need to explicitly link libc?
 #
@@ -5829,6 +6238,7 @@ x|xyes)
         libobjs=conftest.$ac_objext
         deplibs=
         wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
         compiler_flags=-v
         linker_flags=-v
         verstring=
@@ -5956,7 +6366,7 @@ lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && break
+  test ! -f $lt_ac_sed && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
diff --git a/db/dist/aclocal/mutex.ac b/db/dist/aclocal/mutex.ac
index 959ed4ebe..31b3d2942 100644
--- a/db/dist/aclocal/mutex.ac
+++ b/db/dist/aclocal/mutex.ac
@@ -1,4 +1,4 @@
-# $Id: mutex.ac,v 11.46 2004/07/09 16:23:19 bostic Exp $
+# $Id: mutex.ac,v 12.18 2006/06/20 20:31:01 bostic Exp $
 
 # POSIX pthreads tests: inter-process safe and intra-process only.
 AC_DEFUN(AM_PTHREADS_SHARED, [
@@ -105,18 +105,14 @@ orig_libs=$LIBS
 # *BSD systems).
 #
 # Test for LWP threads before testing for UI/POSIX threads, we prefer them
-# on Solaris.  There's a bug in SunOS 5.7 where applications get pwrite, not
-# pwrite64, if they load the C library before the appropriate threads library,
-# e.g., tclsh using dlopen to load the DB library.  By using LWP threads we
-# avoid answering lots of user questions, not to mention the bugs.
+# on Solaris, for two reasons: a bug in SunOS 5.7 causes applications to
+# get pwrite, not pwrite64, if they load the C library before the appropriate
+# threads library, e.g., tclsh using dlopen to load the DB library.  Second,
+# LWP mutexes are faster than POSIX pthread mutexes by some amount.
 #
 # Otherwise, test for POSIX threads before UI threads.  There are Linux systems
 # that support a UI compatibility mode, and applications are more likely to be
 # written for POSIX threads than UI threads.
-#
-# Try and link with a threads library if possible.  The problem is the Solaris
-# C library has UI/POSIX interface stubs, but they're broken, configuring them
-# for inter-process mutexes doesn't return an error, but it doesn't work either.
 if test "$db_cv_posixmutexes" = yes; then
 	db_cv_mutex="posix_only";
 fi
@@ -353,6 +349,28 @@ AC_TRY_COMPILE(,[
 ], [db_cv_mutex="ARM/gcc-assembly"])
 fi
 
+# MIPS/gcc: Linux
+if test "$db_cv_mutex" = no; then
+AC_TRY_COMPILE(,[
+#if (defined(__mips) || defined(__mips__)) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
+], [db_cv_mutex="MIPS/gcc-assembly"])
+fi
+
+# MIPS/gcc: Linux
+if test "$db_cv_mutex" = no; then
+AC_TRY_COMPILE(,[
+#if (defined(__mips) || defined(__mips__)) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
+], [db_cv_mutex="MIPS/gcc-assembly"])
+fi
+
 # PaRisc/gcc: HP/UX
 if test "$db_cv_mutex" = no; then
 AC_TRY_COMPILE(,[
@@ -400,7 +418,7 @@ fi
 # x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux
 if test "$db_cv_mutex" = no; then
 AC_TRY_COMPILE(,[
-#if (defined(i386) || defined(__i386__) || defined(__x86_64__)) && defined(__GNUC__)
+#if (defined(i386) || defined(__i386__)) && defined(__GNUC__)
 	exit(0);
 #else
 	FAIL TO COMPILE/LINK
@@ -408,6 +426,17 @@ AC_TRY_COMPILE(,[
 ], [db_cv_mutex="x86/gcc-assembly"])
 fi
 
+# x86_64/gcc: FreeBSD, NetBSD, BSD/OS, Linux
+if test "$db_cv_mutex" = no; then
+AC_TRY_COMPILE(,[
+#if (defined(x86_64) || defined(__x86_64__)) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
+], [db_cv_mutex="x86_64/gcc-assembly"])
+fi
+
 # S390/cc: IBM OS/390 Unix
 if test "$db_cv_mutex" = no; then
 AC_TRY_COMPILE(,[
@@ -430,7 +459,7 @@ AC_TRY_COMPILE(,[
 ], [db_cv_mutex="S390/gcc-assembly"])
 fi
 
-# ia86/gcc: Linux
+# ia64/gcc: Linux
 if test "$db_cv_mutex" = no; then
 AC_TRY_COMPILE(,[
 #if defined(__ia64) && defined(__GNUC__)
@@ -458,6 +487,10 @@ if test "$db_cv_mutex" = no; then
 fi
 ])
 
+AC_SUBST(thread_h_decl)
+AC_SUBST(db_threadid_t_decl)
+db_threadid_t_decl=notset
+
 case "$db_cv_mutex" in
 68K/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_68K_GCC_ASSEMBLY)
@@ -502,17 +535,11 @@ POSIX/pthreads/private)	ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_THREAD_ONLY)
 			AH_TEMPLATE(HAVE_MUTEX_THREAD_ONLY,
 			    [Define to 1 to configure mutexes intra-process only.]);;
-POSIX/pthreads/library)	LIBS="$LIBS -lpthread"
-			LIBJSO_LIBS="$LIBJSO_LIBS -lpthread"
-			LIBTSO_LIBS="$LIBTSO_LIBS -lpthread"
-			ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
+POSIX/pthreads/library)	ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_PTHREADS)
 			AH_TEMPLATE(HAVE_MUTEX_PTHREADS,
 			    [Define to 1 to use POSIX 1003.1 pthread_XXX mutexes.]);;
 POSIX/pthreads/library/private)
-			LIBS="$LIBS -lpthread"
-			LIBJSO_LIBS="$LIBJSO_LIBS -lpthread"
-			LIBTSO_LIBS="$LIBTSO_LIBS -lpthread"
 			ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_PTHREADS)
 			AH_TEMPLATE(HAVE_MUTEX_PTHREADS,
@@ -525,7 +552,7 @@ PPC/gcc-assembly)
 			AC_DEFINE(HAVE_MUTEX_PPC_GCC_ASSEMBLY)
 			AH_TEMPLATE(HAVE_MUTEX_PPC_GCC_ASSEMBLY,
 			    [Define to 1 to use the GCC compiler and PowerPC assembly language mutexes.]);;
-ReliantUNIX/initspin)	LIBS="$LIBS -lmproc"
+ReliantUNIX/initspin)	LIBSO_LIBS="$LIBSO_LIBS -lmproc"
 			ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_RELIANTUNIX_INITSPIN)
 			AH_TEMPLATE(HAVE_MUTEX_RELIANTUNIX_INITSPIN,
@@ -562,13 +589,11 @@ Tru64/cc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_TRU64_CC_ASSEMBLY)
 			AH_TEMPLATE(HAVE_MUTEX_TRU64_CC_ASSEMBLY,
 			    [Define to 1 to use the CC compiler and Tru64 assembly language mutexes.]);;
-
 UI/threads)		ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_UI_THREADS)
 			AH_TEMPLATE(HAVE_MUTEX_UI_THREADS,
 			    [Define to 1 to use the UNIX International mutexes.]);;
-UI/threads/library)	LIBS="$LIBS -lthread"
-			ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
+UI/threads/library)	ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_UI_THREADS)
 			AH_TEMPLATE(HAVE_MUTEX_UI_THREADS,
 			    [Define to 1 to use the UNIX International mutexes.]);;
@@ -590,10 +615,18 @@ win32)			ADDITIONAL_OBJS="mut_win32${o} $ADDITIONAL_OBJS"
 win32/gcc)		ADDITIONAL_OBJS="mut_win32${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_WIN32_GCC)
 			AH_TEMPLATE(HAVE_MUTEX_WIN32_GCC, [Define to 1 to use the GCC compiler and Windows mutexes.]);;
+MIPS/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			AC_DEFINE(HAVE_MUTEX_MIPS_GCC_ASSEMBLY)
+			AH_TEMPLATE(HAVE_MUTEX_MIPS_GCC_ASSEMBLY,
+			    [Define to 1 to use the GCC compiler and MIPS assembly language mutexes.]);;
 x86/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY)
 			AH_TEMPLATE(HAVE_MUTEX_X86_GCC_ASSEMBLY,
 			    [Define to 1 to use the GCC compiler and x86 assembly language mutexes.]);;
+x86_64/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			AC_DEFINE(HAVE_MUTEX_X86_64_GCC_ASSEMBLY)
+			AH_TEMPLATE(HAVE_MUTEX_X86_64_GCC_ASSEMBLY,
+			[Define to 1 to use the GCC compiler and amd64 assembly language mutexes.]);;
 UNIX/fcntl)		AC_MSG_WARN(
 			    [NO FAST MUTEXES FOUND FOR THIS COMPILER/ARCHITECTURE.])
 			ADDITIONAL_OBJS="mut_fcntl${o} $ADDITIONAL_OBJS"
@@ -603,10 +636,88 @@ UNIX/fcntl)		AC_MSG_WARN(
 *)			AC_MSG_ERROR([Unknown mutex interface: $db_cv_mutex]);;
 esac
 
-if test "$db_cv_mutex" != "UNIX/fcntl"; then
-	AC_DEFINE(HAVE_MUTEX_THREADS)
-	AH_TEMPLATE(HAVE_MUTEX_THREADS,
-	    [Define to 1 if fast mutexes are available.])
+# The mutex selection may require specific declarations -- we fill in most of
+# them above, but here are the common ones.
+#
+# The mutex selection may tell us what kind of thread package we're using,
+# which we use to figure out the thread type.
+#
+# If we're configured for the POSIX pthread API, then force the thread ID type
+# and include function, regardless of the mutex selection.  Ditto for the
+# (default) Solaris lwp mutexes, because they don't have a way to return the
+# thread ID.
+#
+# Try and link with a threads library if possible.  The problem is the Solaris
+# C library has UI/POSIX interface stubs, but they're broken, configuring them
+# for inter-process mutexes doesn't return an error, but it doesn't work either.
+# For that reason always add -lpthread if we're using pthread calls or mutexes
+# and there's a pthread library.
+#
+# We can't depend on any specific call existing (pthread_create, for example),
+# as it may be #defined in an include file -- OSF/1 (Tru64) has this problem.
+case "$db_cv_mutex" in
+POSIX/pthread*|Solaris/lwp)
+	thread_h_decl="#include "
+	db_threadid_t_decl="typedef pthread_t db_threadid_t;"
+	AC_HAVE_LIBRARY(pthread, LIBSO_LIBS="$LIBSO_LIBS -lpthread");;
+UI/threads*)
+	thread_h_decl="#include "
+	db_threadid_t_decl="typedef thread_t db_threadid_t;"
+	AC_HAVE_LIBRARY(thread, LIBSO_LIBS="$LIBSO_LIBS -lthread");;
+*)
+	if test "$db_cv_pthread_api" = "yes"; then
+		thread_h_decl="#include "
+		db_threadid_t_decl="typedef pthread_t db_threadid_t;"
+		AC_HAVE_LIBRARY(pthread, LIBSO_LIBS="$LIBSO_LIBS -lpthread")
+	fi;;
+esac
+
+# We need to know if the thread ID type will fit into an integral type and we
+# can compare it for equality and generally treat it like an int, or if it's a
+# non-integral type and we have to treat it like a structure or other untyped
+# block of bytes.  For example, MVS typedef's pthread_t to a structure.
+AH_TEMPLATE(HAVE_SIMPLE_THREAD_TYPE,
+    [Define to 1 if thread identifier type db_threadid_t is integral.])
+if test "$db_threadid_t_decl" = "notset"; then
+	db_threadid_t_decl="typedef uintmax_t db_threadid_t;"
+	AC_DEFINE(HAVE_SIMPLE_THREAD_TYPE)
+else
+	AC_TRY_COMPILE(
+	#include 
+	$thread_h_decl, [
+	$db_threadid_t_decl
+	db_threadid_t a;
+	a = 0;
+	], AC_DEFINE(HAVE_SIMPLE_THREAD_TYPE))
+fi
+
+# If we're building replication and configured with POSIX pthreads or were
+# told to build using the POSIX API, build the replication manager framework.
+db_cv_build_replication_mgr="no"
+if test "$db_cv_build_replication" = "yes"; then
+	AH_TEMPLATE(HAVE_REPLICATION_THREADS,
+	    [Define to 1 if building the Berkeley DB replication framework.])
+	case "$db_cv_mutex" in
+	POSIX/pthread*|Solaris/lwp)
+		db_cv_build_replication_mgr="yes";;
+	esac
+	if test "$db_cv_pthread_api" = "yes"; then
+		db_cv_build_replication_mgr="yes"
+	fi
+
+	if test "$db_cv_build_replication_mgr" = "yes"; then
+		AC_DEFINE(HAVE_REPLICATION_THREADS)
+
+		# Solaris requires the socket and nsl libraries to build the
+		# replication manager.  Don't add nsl regardless of the OS,
+		# it causes RPC to fail on AIX 4.3.3.
+		case "$host_os" in
+		solaris*)
+			AC_HAVE_LIBRARY(nsl, LIBSO_LIBS="$LIBSO_LIBS -lnsl")
+			AC_HAVE_LIBRARY(socket,
+			    LIBSO_LIBS="$LIBSO_LIBS -lsocket");;
+		esac
+	fi
 fi
 
 # There are 3 classes of mutexes:
diff --git a/db/dist/aclocal/options.ac b/db/dist/aclocal/options.ac
index b770fc444..81e1361b8 100644
--- a/db/dist/aclocal/options.ac
+++ b/db/dist/aclocal/options.ac
@@ -1,4 +1,4 @@
-# $Id: options.ac,v 11.37 2004/06/10 16:38:18 bostic Exp $
+# $Id: options.ac,v 12.4 2006/04/07 15:08:58 bostic Exp $
 
 # Process user-specified options.
 AC_DEFUN(AM_OPTIONS_SET, [
@@ -161,6 +161,28 @@ AC_ARG_ENABLE(posixmutexes,
 	[db_cv_posixmutexes="$enable_posixmutexes"], [db_cv_posixmutexes="no"])
 AC_MSG_RESULT($db_cv_posixmutexes)
 
+AC_ARG_ENABLE(pthread_self,
+	[AC_HELP_STRING([--enable-pthread_self],
+			[Obsolete; use --enable-pthread_api instead.])],
+	[AC_MSG_ERROR(
+    [--enable-pthread_self no longer supported, use --enable-pthread_api])])
+
+AC_MSG_CHECKING(if --enable-pthread_api option specified)
+AC_ARG_ENABLE(pthread_api,
+	[AC_HELP_STRING([--enable-pthread_api],
+			[Configure Berkeley DB for POSIX pthread API.])],
+	[db_cv_pthread_api="$enable_pthread_api"], [db_cv_pthread_api="no"])
+# POSIX mutexes implies other POSIX APIs.
+if test "$db_cv_posixmutexes" != "no"; then
+	db_cv_pthread_api="yes"
+fi
+AC_MSG_RESULT($db_cv_pthread_api)
+AH_TEMPLATE(HAVE_PTHREAD_API,
+    [Define to 1 to configure Berkeley DB for POSIX pthread API.])
+if test "$db_cv_pthread_api" = "yes"; then
+	AC_DEFINE(HAVE_PTHREAD_API)
+fi
+
 AC_MSG_CHECKING(if --enable-rpc option specified)
 AC_ARG_ENABLE(rpc,
 	[AC_HELP_STRING([--enable-rpc],
@@ -224,20 +246,13 @@ if test "$with_mutex" != "no"; then
 fi
 AC_MSG_RESULT($with_mutex)
 
-AH_TEMPLATE(MUTEX_ALIGN,
-    [Define to a value if using non-standard mutex alignment.])
-AC_MSG_CHECKING(if --with-mutexalign=ALIGNMENT option specified)
+# --with-mutexalign=ALIGNMENT was the configuration option that Berkeley DB
+# used before the DbEnv::mutex_set_align method was added.
 AC_ARG_WITH(mutexalign,
 	[AC_HELP_STRING([--with-mutexalign=ALIGNMENT],
-			[Selection of non-standard mutex alignment.])],
-	[with_mutexalign="$withval"], [with_mutexalign="no"])
-if test "$with_mutexalign" = "yes"; then
-	AC_MSG_ERROR([--with-mutexalign requires a mutex alignment argument])
-fi
-if test "$with_mutexalign" != "no"; then
-	AC_DEFINE_UNQUOTED(MUTEX_ALIGN, $with_mutexalign)
-fi
-AC_MSG_RESULT($with_mutexalign)
+			[Obsolete; use DbEnv::mutex_set_align instead.])],
+	[AC_MSG_ERROR(
+    [--with-mutexalign no longer supported, use DbEnv::mutex_set_align])])
 
 AC_MSG_CHECKING([if --with-tcl=DIR option specified])
 AC_ARG_WITH(tcl,
@@ -273,20 +288,4 @@ if test "$db_cv_test" = "yes"; then
 	if test "$db_cv_tcl" = "no"; then
 		AC_MSG_ERROR([--enable-test requires --enable-tcl])
 	fi
-fi
-
-# Uniquename excludes C++, Java, RPC.
-if test "$db_cv_uniquename" = "yes"; then
-	if test "$db_cv_rpc" = "yes"; then
-		AC_MSG_ERROR(
-		    [--with-uniquename is not compatible with --enable-rpc])
-	fi
-	if test "$db_cv_cxx" = "yes"; then
-		AC_MSG_ERROR(
-		    [--with-uniquename is not compatible with --enable-cxx])
-	fi
-	if test "$db_cv_java" = "yes"; then
-		AC_MSG_ERROR(
-		    [--with-uniquename is not compatible with --enable-java])
-	fi
 fi])
diff --git a/db/dist/aclocal/programs.ac b/db/dist/aclocal/programs.ac
index db6b4f03e..3fb61f045 100644
--- a/db/dist/aclocal/programs.ac
+++ b/db/dist/aclocal/programs.ac
@@ -1,71 +1,52 @@
-# $Id: programs.ac,v 11.22 2004/06/10 16:38:18 bostic Exp $
+# $Id: programs.ac,v 12.2 2006/07/06 14:00:28 bostic Exp $
 
 # Check for programs used in building/installation.
 AC_DEFUN(AM_PROGRAMS_SET, [
 
-AC_CHECK_TOOL(db_cv_path_ar, ar, missing_ar)
-if test "$db_cv_path_ar" = missing_ar; then
-	AC_MSG_ERROR([No ar utility found.])
-fi
+AC_CHECK_TOOL(AR, ar, none)
+test "$AR" = "none" && AC_MSG_ERROR([No ar utility found.])
 
-AC_CHECK_TOOL(db_cv_path_chmod, chmod, missing_chmod)
-if test "$db_cv_path_chmod" = missing_chmod; then
-	AC_MSG_ERROR([No chmod utility found.])
-fi
+AC_CHECK_TOOL(CHMOD, chmod, none)
+test "$CHMOD" = "none" && AC_MSG_ERROR([No chmod utility found.])
 
-AC_CHECK_TOOL(db_cv_path_cp, cp, missing_cp)
-if test "$db_cv_path_cp" = missing_cp; then
-	AC_MSG_ERROR([No cp utility found.])
-fi
+AC_CHECK_TOOL(CP, cp, none)
+test "$CP" = "none" && AC_MSG_ERROR([No cp utility found.])
 
-AC_CHECK_TOOL(db_cv_path_ln, ln, missing_ln)
-if test "$db_cv_path_ln" = missing_ln; then
-	AC_MSG_ERROR([No ln utility found.])
+# The Tcl test suite requires a kill utility.
+if test "$db_cv_test" = "yes"; then
+	AC_CHECK_TOOL(KILL, kill, none)
+	test "$KILL" = "none" && AC_MSG_ERROR([No kill utility found.])
 fi
 
-AC_CHECK_TOOL(db_cv_path_mkdir, mkdir, missing_mkdir)
-if test "$db_cv_path_mkdir" = missing_mkdir; then
-	AC_MSG_ERROR([No mkdir utility found.])
-fi
+AC_CHECK_TOOL(LN, ln, none)
+test "$LN" = "none" && AC_MSG_ERROR([No ln utility found.])
 
-# We need a complete path for ranlib, because it doesn't exist on some
-# architectures because the ar utility packages the library itself.
-AC_CHECK_TOOL(path_ranlib, ranlib, missing_ranlib)
-AC_PATH_PROG(db_cv_path_ranlib, $path_ranlib, missing_ranlib)
+AC_CHECK_TOOL(MKDIR, mkdir, none)
+test "$MKDIR" = "none" && AC_MSG_ERROR([No mkdir utility found.])
 
-AC_CHECK_TOOL(db_cv_path_rm, rm, missing_rm)
-if test "$db_cv_path_rm" = missing_rm; then
-	AC_MSG_ERROR([No rm utility found.])
-fi
+# Ranlib doesn't exist on some architectures because the ar utility
+# packages the library itself.
+AC_CHECK_TOOL(RANLIB, ranlib, none)
+
+AC_CHECK_TOOL(RM, rm, none)
+test "$RM" = "none" && AC_MSG_ERROR([No rm utility found.])
 
 if test "$db_cv_rpc" = "yes"; then
-	AC_CHECK_TOOL(db_cv_path_rpcgen, rpcgen, missing_rpcgen)
-	if test "$db_cv_path_rpcgen" = missing_rpcgen; then
-		AC_MSG_ERROR([No rpcgen utility found.])
-	fi
+	AC_CHECK_TOOL(RPCGEN, rpcgen, none)
+	test "$RPCGEN" = "none" && AC_MSG_ERROR([No rpcgen utility found.])
 fi
 
-# We need a complete path for sh, because some implementations of make
-# get upset if SHELL is set to just the command name.
-AC_CHECK_TOOL(path_sh, sh, missing_sh)
-AC_PATH_PROG(db_cv_path_sh, $path_sh, missing_sh)
-if test "$db_cv_path_sh" = missing_sh; then
-	AC_MSG_ERROR([No sh utility found.])
-fi
+# We need a complete path for sh, because some make utility implementations get
+# upset if SHELL is set to just the command name.  Don't use the SHELL variable
+# here because the user likely has the SHELL variable set to something other
+# than the Bourne shell, which is what Make wants.
+AC_PATH_TOOL(db_cv_path_sh, sh, none)
+test "$db_cv_path_sh" = "none" && AC_MSG_ERROR([No sh utility found.])
 
 # Don't strip the binaries if --enable-debug was specified.
 if test "$db_cv_debug" = yes; then
-	db_cv_path_strip=debug_build_no_strip
+	STRIP="none"
 else
-	AC_CHECK_TOOL(path_strip, strip, missing_strip)
-	AC_PATH_PROG(db_cv_path_strip, $path_strip, missing_strip)
-fi
-
-if test "$db_cv_test" = "yes"; then
-	AC_CHECK_TOOL(db_cv_path_kill, kill, missing_kill)
-	if test "$db_cv_path_kill" = missing_kill; then
-		AC_MSG_ERROR([No kill utility found.])
-	fi
-fi
-
-])
+	AC_CHECK_TOOL(STRIP, strip, none)
+	test "$STRIP" = "none" && AC_MSG_WARN([No strip utility found.])
+fi])
diff --git a/db/dist/aclocal/rpc.ac b/db/dist/aclocal/rpc.ac
index 7d7f4dabe..11fb0e925 100644
--- a/db/dist/aclocal/rpc.ac
+++ b/db/dist/aclocal/rpc.ac
@@ -1,4 +1,4 @@
-# $Id: rpc.ac,v 11.9 2004/09/27 21:33:48 mjc Exp $
+# $Id: rpc.ac,v 12.1 2006/05/08 20:52:36 bostic Exp $
 
 # Try and configure RPC support.
 AC_DEFUN(AM_RPC_CONFIGURE, [
@@ -71,13 +71,7 @@ AC_DEFUN(AM_RPC_CONFIGURE, [
 	RPC_CLIENT_OBJS="\$(RPC_CLIENT_OBJS)"
 	ADDITIONAL_PROGS="berkeley_db_svc $ADDITIONAL_PROGS"
 
-	case "$host_os" in
-	hpux*)
-		AC_CHECK_FUNC(svc_run,,
-		    AC_CHECK_LIB(nsl, svc_run,
-		    LIBS="-lnsl $LIBS"; LIBTSO_LIBS="-lnsl $LIBTSO_LIBS";
-		    LIBJSO_LIBS="-lnsl $LIBJSO_LIBS"));;
-	solaris*)
-		AC_CHECK_FUNC(svc_run,, AC_CHECK_LIB(nsl, svc_run));;
-	esac
+	# Solaris and HPUX need the nsl library to build RPC.
+	AC_CHECK_FUNC(svc_run,,
+	    AC_HAVE_LIBRARY(nsl, LIBSO_LIBS="$LIBSO_LIBS -lnsl"))
 ])
diff --git a/db/dist/aclocal/sequence.ac b/db/dist/aclocal/sequence.ac
index ca320b232..75cf19bfd 100644
--- a/db/dist/aclocal/sequence.ac
+++ b/db/dist/aclocal/sequence.ac
@@ -1,8 +1,9 @@
-# $Id: sequence.ac,v 1.3 2004/10/28 18:14:30 bostic Exp $
+# $Id: sequence.ac,v 12.3 2005/11/24 00:49:24 bostic Exp $
 
 # Try and configure sequence support.
 AC_DEFUN(AM_SEQUENCE_CONFIGURE, [
 	AC_MSG_CHECKING([for 64-bit integral type support for sequences])
+
 	db_cv_build_sequence="yes"
 
 	# Have to have found 64-bit types to support sequences.  If we don't
@@ -14,13 +15,27 @@ AC_DEFUN(AM_SEQUENCE_CONFIGURE, [
 		db_cv_build_sequence="no"
 	fi
 
-	# Have to be able to cast variables to the "unsigned long long" and
-	# "long long" types, that's our cast for the printf "%ll[du]" format.
-	if test "$ac_cv_type_long_long" = "no"; then
+	# Figure out what type is the right size, and set the format.
+	AC_SUBST(INT64_FMT)
+	AC_SUBST(UINT64_FMT)
+	db_cv_seq_type="no"
+	if test "$db_cv_build_sequence" = "yes" -a\
+	    "$ac_cv_sizeof_long" -eq "8"; then
+		db_cv_seq_type="long"
+		db_cv_seq_fmt='"%ld"'
+		db_cv_seq_ufmt='"%lu"'
+		INT64_FMT='#define	INT64_FMT	"%ld"'
+		UINT64_FMT='#define	UINT64_FMT	"%lu"'
+	else if test "$db_cv_build_sequence" = "yes" -a\
+	    "$ac_cv_sizeof_long_long" -eq "8"; then
+		db_cv_seq_type="long long"
+		db_cv_seq_fmt='"%lld"'
+		db_cv_seq_ufmt='"%llu"'
+		INT64_FMT='#define	INT64_FMT	"%lld"'
+		UINT64_FMT='#define	UINT64_FMT	"%llu"'
+	else
 		db_cv_build_sequence="no"
 	fi
-	if test "$ac_cv_type_unsigned_long_long" = "no"; then
-		db_cv_build_sequence="no"
 	fi
 
 	# Test to see if we can declare variables of the appropriate size
@@ -29,45 +44,45 @@ AC_DEFUN(AM_SEQUENCE_CONFIGURE, [
 	if test "$db_cv_build_sequence" = "yes"; then
 		AC_TRY_RUN([
 		main() {
-			long long l;
-			unsigned long long u;
-			char buf[100];
+			$db_cv_seq_type l;
+			unsigned $db_cv_seq_type u;
+			char buf@<:@100@:>@;
 
-			buf[0] = 'a';
+			buf@<:@0@:>@ = 'a';
 			l = 9223372036854775807LL;
-			(void)snprintf(buf, sizeof(buf), "%lld", l);
+			(void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
 			if (strcmp(buf, "9223372036854775807"))
 				return (1);
 			u = 18446744073709551615ULL;
-			(void)snprintf(buf, sizeof(buf), "%llu", u);
+			(void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
 			if (strcmp(buf, "18446744073709551615"))
 				return (1);
 			return (0);
 		}],, [db_cv_build_sequence="no"],
 		AC_TRY_LINK(,[
-			long long l;
-			unsigned long long u;
-			char buf[100];
+			$db_cv_seq_type l;
+			unsigned $db_cv_seq_type u;
+			char buf@<:@100@:>@;
 
-			buf[0] = 'a';
+			buf@<:@0@:>@ = 'a';
 			l = 9223372036854775807LL;
-			(void)snprintf(buf, sizeof(buf), "%lld", l);
+			(void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
 			if (strcmp(buf, "9223372036854775807"))
 				return (1);
 			u = 18446744073709551615ULL;
-			(void)snprintf(buf, sizeof(buf), "%llu", u);
+			(void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
 			if (strcmp(buf, "18446744073709551615"))
 				return (1);
 			return (0);
 		],, [db_cv_build_sequence="no"]))
 	fi
 	if test "$db_cv_build_sequence" = "yes"; then
-		AC_DEFINE(HAVE_SEQUENCE)
-		AH_TEMPLATE(HAVE_SEQUENCE,
-		    [Define to 1 if building sequence support.])
-
 		AC_SUBST(db_seq_decl)
 		db_seq_decl="typedef int64_t db_seq_t;";
+
+		AC_DEFINE(HAVE_64BIT_TYPES)
+		AH_TEMPLATE(HAVE_64BIT_TYPES,
+		    [Define to 1 if 64-bit types are available.])
 	else
 		# It still has to compile, but it won't run.
 		db_seq_decl="typedef int db_seq_t;";
diff --git a/db/dist/aclocal/sosuffix.ac b/db/dist/aclocal/sosuffix.ac
index 8864280f1..bd391e248 100644
--- a/db/dist/aclocal/sosuffix.ac
+++ b/db/dist/aclocal/sosuffix.ac
@@ -1,4 +1,4 @@
-# $Id: sosuffix.ac,v 1.4 2004/08/14 20:00:45 dda Exp $
+# $Id: sosuffix.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 # Determine shared object suffixes.
 #
 # Our method is to use the libtool variable $library_names_spec,
diff --git a/db/dist/aclocal/tcl.ac b/db/dist/aclocal/tcl.ac
index d28d36083..360cf62b1 100644
--- a/db/dist/aclocal/tcl.ac
+++ b/db/dist/aclocal/tcl.ac
@@ -1,4 +1,4 @@
-# $Id: tcl.ac,v 11.18 2004/03/11 20:11:17 bostic Exp $
+# $Id: tcl.ac,v 12.2 2005/06/28 20:45:25 gmf Exp $
 
 # The SC_* macros in this file are from the unix/tcl.m4 files in the Tcl
 # 8.3.0 distribution, with some minor changes.  For this reason, license
@@ -93,12 +93,11 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [
 		AC_MSG_ERROR([Berkeley DB requires Tcl version 8.4 or better.])
 	fi
 
-	#
-	# The eval is required to do the TCL_DBGX substitution in the
-	# TCL_LIB_FILE variable
-	#
-	eval TCL_LIB_FILE="${TCL_LIB_FILE}"
-	eval TCL_LIB_FLAG="${TCL_LIB_FLAG}"
+	# The eval is required to do substitution (for example, the TCL_DBGX
+	# substitution in the TCL_LIB_FILE variable.
+	eval "TCL_INCLUDE_SPEC=\"${TCL_INCLUDE_SPEC}\""
+	eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+	eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
 	eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
 
 	#
@@ -115,8 +114,9 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [
 		LIBTSO_LIBS="$LIBTSO_LIBS $TCL_LIB_SPEC $TCL_LIB_FLAG";;
 	esac
 	AC_SUBST(TCL_BIN_DIR)
-	AC_SUBST(TCL_SRC_DIR)
+	AC_SUBST(TCL_INCLUDE_SPEC)
 	AC_SUBST(TCL_LIB_FILE)
+	AC_SUBST(TCL_SRC_DIR)
 
 	AC_SUBST(TCL_TCLSH)
 	TCL_TCLSH="${TCL_PREFIX}/bin/tclsh${TCL_VERSION}"
@@ -128,14 +128,8 @@ AC_DEFUN(AM_TCL_LOAD, [
 		AC_MSG_ERROR([Tcl requires shared libraries])
 	fi
 
-	AC_SUBST(TCFLAGS)
-
 	SC_PATH_TCLCONFIG
 	SC_LOAD_TCLCONFIG
 
-	if test x"$TCL_PREFIX" != x && test -f "$TCL_PREFIX/include/tcl.h"; then
-		TCFLAGS="-I$TCL_PREFIX/include"
-	fi
-
 	INSTALL_LIBS="${INSTALL_LIBS} \$(libtso_target)"
 ])
diff --git a/db/dist/aclocal/types.ac b/db/dist/aclocal/types.ac
index b5843385c..f9291386d 100644
--- a/db/dist/aclocal/types.ac
+++ b/db/dist/aclocal/types.ac
@@ -1,4 +1,4 @@
-# $Id: types.ac,v 11.18 2004/10/25 18:14:14 bostic Exp $
+# $Id: types.ac,v 12.3 2005/11/03 17:46:14 bostic Exp $
 
 # Check the sizes we know about, and see if any of them match what's needed.
 #
@@ -68,6 +68,11 @@ AC_CHECK_HEADER(stddef.h, [
 	db_includes="$db_includes
 #include "
 	stddef_h_decl="#include "])
+AC_SUBST(unistd_h_decl)
+AC_CHECK_HEADER(unistd.h, [
+	db_includes="$db_includes
+#include "
+	unistd_h_decl="#include "])
 db_includes="$db_includes
 #include "
 
@@ -76,10 +81,6 @@ db_includes="$db_includes
 AC_CHECK_TYPE(off_t,, AC_MSG_ERROR([No off_t type.]), $db_includes)
 AC_CHECK_TYPE(size_t,, AC_MSG_ERROR([No size_t type.]), $db_includes)
 
-# Check for long long and unsigned long long, we only support sequences
-# if those types are available.
-AC_CHECK_TYPES([long long, unsigned long long],,, $db_includes)
-
 # We need to know the sizes of various objects on this system.
 AC_CHECK_SIZEOF(char,, $db_includes)
 AC_CHECK_SIZEOF(unsigned char,, $db_includes)
@@ -148,6 +149,9 @@ AC_CHECK_TYPE(ssize_t,,
     [AM_SEARCH_SSIZES(ssize_t_decl, ssize_t, $ac_cv_sizeof_size_t)],
     $db_includes)
 
+# So far, no autoconf'd systems lack pid_t.
+AC_SUBST(pid_t_decl)
+
 # Check for uintmax_t -- if none exists, first the largest unsigned integral
 # type available.
 AC_SUBST(uintmax_t_decl)
diff --git a/db/dist/aclocal_java/ac_check_class.ac b/db/dist/aclocal_java/ac_check_class.ac
index 915198af5..b12e7f02f 100644
--- a/db/dist/aclocal_java/ac_check_class.ac
+++ b/db/dist/aclocal_java/ac_check_class.ac
@@ -15,7 +15,7 @@ dnl The general documentation, as well as the sample configure.in, is
 dnl included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Stephane Bortzmeyer 
-dnl @version $Id: ac_check_class.ac,v 1.1 2001/08/23 16:58:42 dda Exp $
+dnl @version $Id: ac_check_class.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_CHECK_CLASS],[
 AC_REQUIRE([AC_PROG_JAVA])
diff --git a/db/dist/aclocal_java/ac_check_classpath.ac b/db/dist/aclocal_java/ac_check_classpath.ac
index 4a78d0f87..b18d479b3 100644
--- a/db/dist/aclocal_java/ac_check_classpath.ac
+++ b/db/dist/aclocal_java/ac_check_classpath.ac
@@ -12,7 +12,7 @@ dnl The general documentation, as well as the sample configure.in, is
 dnl included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Stephane Bortzmeyer 
-dnl @version $Id: ac_check_classpath.ac,v 1.1 2001/08/23 16:58:42 dda Exp $
+dnl @version $Id: ac_check_classpath.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_CHECK_CLASSPATH],[
 if test "x$CLASSPATH" = x; then
diff --git a/db/dist/aclocal_java/ac_check_junit.ac b/db/dist/aclocal_java/ac_check_junit.ac
index 3b81d1dc3..cc02e3276 100644
--- a/db/dist/aclocal_java/ac_check_junit.ac
+++ b/db/dist/aclocal_java/ac_check_junit.ac
@@ -30,7 +30,7 @@ dnl     echo "exec @JUNIT@ my.package.name.AllJunitTests" >> $@
 dnl     chmod +x $@
 dnl
 dnl @author Luc Maisonobe
-dnl @version $Id: ac_check_junit.ac,v 1.1 2001/08/23 16:58:43 dda Exp $
+dnl @version $Id: ac_check_junit.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_CHECK_JUNIT],[
 AC_CACHE_VAL(ac_cv_prog_JUNIT,[
diff --git a/db/dist/aclocal_java/ac_check_rqrd_class.ac b/db/dist/aclocal_java/ac_check_rqrd_class.ac
index ab62e33c8..c7c26b877 100644
--- a/db/dist/aclocal_java/ac_check_rqrd_class.ac
+++ b/db/dist/aclocal_java/ac_check_rqrd_class.ac
@@ -14,7 +14,7 @@ dnl The general documentation, as well as the sample configure.in, is
 dnl included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Stephane Bortzmeyer 
-dnl @version $Id: ac_check_rqrd_class.ac,v 1.1 2001/08/23 16:58:43 dda Exp $
+dnl @version $Id: ac_check_rqrd_class.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 
 AC_DEFUN([AC_CHECK_RQRD_CLASS],[
diff --git a/db/dist/aclocal_java/ac_java_options.ac b/db/dist/aclocal_java/ac_java_options.ac
index 567afca7f..e71adfe68 100644
--- a/db/dist/aclocal_java/ac_java_options.ac
+++ b/db/dist/aclocal_java/ac_java_options.ac
@@ -12,7 +12,7 @@ dnl The general documentation, as well as the sample configure.in, is
 dnl included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Devin Weaver 
-dnl @version $Id: ac_java_options.ac,v 1.1 2001/08/23 16:58:43 dda Exp $
+dnl @version $Id: ac_java_options.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_JAVA_OPTIONS],[
 AC_ARG_WITH(java-prefix,
diff --git a/db/dist/aclocal_java/ac_jni_include_dirs.ac b/db/dist/aclocal_java/ac_jni_include_dirs.ac
index b70d108d6..177f62f85 100644
--- a/db/dist/aclocal_java/ac_jni_include_dirs.ac
+++ b/db/dist/aclocal_java/ac_jni_include_dirs.ac
@@ -27,8 +27,8 @@ dnl
 dnl Note: This macro can work with the autoconf M4 macros for Java programs.
 dnl This particular macro is not part of the original set of macros.
 dnl
-dnl @author Don Anderson 
-dnl @version $Id: ac_jni_include_dirs.ac,v 1.12 2003/10/05 18:10:06 dda Exp $
+dnl @author Don Anderson
+dnl @version $Id: ac_jni_include_dirs.ac,v 12.1 2006/08/24 14:45:36 bostic Exp $
 dnl
 AC_DEFUN(AC_JNI_INCLUDE_DIR,[
 
diff --git a/db/dist/aclocal_java/ac_prog_jar.ac b/db/dist/aclocal_java/ac_prog_jar.ac
index 9dfa1be6d..c60a79a85 100644
--- a/db/dist/aclocal_java/ac_prog_jar.ac
+++ b/db/dist/aclocal_java/ac_prog_jar.ac
@@ -22,7 +22,7 @@ dnl The general documentation of those macros, as well as the sample
 dnl configure.in, is included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Egon Willighagen 
-dnl @version $Id: ac_prog_jar.ac,v 1.1 2001/08/23 16:58:43 dda Exp $
+dnl @version $Id: ac_prog_jar.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_PROG_JAR],[
 AC_REQUIRE([AC_EXEEXT])dnl
diff --git a/db/dist/aclocal_java/ac_prog_java.ac b/db/dist/aclocal_java/ac_prog_java.ac
index 67a879ffc..05c65e7c4 100644
--- a/db/dist/aclocal_java/ac_prog_java.ac
+++ b/db/dist/aclocal_java/ac_prog_java.ac
@@ -62,9 +62,9 @@ dnl
 dnl    AC_OUTPUT(Makefile)
 dnl
 dnl @author Stephane Bortzmeyer 
-dnl @version $Id: ac_prog_java.ac,v 1.2 2003/05/10 17:46:09 dda Exp $
+dnl @version $Id: ac_prog_java.ac,v 12.1 2006/08/24 14:45:36 bostic Exp $
 dnl
-dnl Note: Modified by dda@sleepycat.com to prefer java over kaffe. [#8059]
+dnl Note: Modified to prefer java over kaffe. [#8059]
 dnl
 AC_DEFUN([AC_PROG_JAVA],[
 AC_REQUIRE([AC_EXEEXT])dnl
diff --git a/db/dist/aclocal_java/ac_prog_java_works.ac b/db/dist/aclocal_java/ac_prog_java_works.ac
index 36acd2676..f0ff8c57f 100644
--- a/db/dist/aclocal_java/ac_prog_java_works.ac
+++ b/db/dist/aclocal_java/ac_prog_java_works.ac
@@ -11,7 +11,7 @@ dnl The general documentation, as well as the sample configure.in, is
 dnl included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Stephane Bortzmeyer 
-dnl @version $Id: ac_prog_java_works.ac,v 1.1 2001/08/23 16:58:44 dda Exp $
+dnl @version $Id: ac_prog_java_works.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_PROG_JAVA_WORKS], [
 AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes)
diff --git a/db/dist/aclocal_java/ac_prog_javac.ac b/db/dist/aclocal_java/ac_prog_javac.ac
index 5ded7d1b7..b3607dcf8 100644
--- a/db/dist/aclocal_java/ac_prog_javac.ac
+++ b/db/dist/aclocal_java/ac_prog_javac.ac
@@ -28,7 +28,7 @@ dnl The general documentation, as well as the sample configure.in, is
 dnl included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Stephane Bortzmeyer 
-dnl @version $Id: ac_prog_javac.ac,v 1.3 2001/08/23 17:08:22 dda Exp $
+dnl @version $Id: ac_prog_javac.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_PROG_JAVAC],[
 AC_REQUIRE([AC_EXEEXT])dnl
diff --git a/db/dist/aclocal_java/ac_prog_javac_works.ac b/db/dist/aclocal_java/ac_prog_javac_works.ac
index 139a99f98..0cfd1f213 100644
--- a/db/dist/aclocal_java/ac_prog_javac_works.ac
+++ b/db/dist/aclocal_java/ac_prog_javac_works.ac
@@ -11,7 +11,7 @@ dnl The general documentation, as well as the sample configure.in, is
 dnl included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Stephane Bortzmeyer 
-dnl @version $Id: ac_prog_javac_works.ac,v 1.1 2001/08/23 16:58:44 dda Exp $
+dnl @version $Id: ac_prog_javac_works.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_PROG_JAVAC_WORKS],[
 AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [
diff --git a/db/dist/aclocal_java/ac_prog_javadoc.ac b/db/dist/aclocal_java/ac_prog_javadoc.ac
index 5154d3f1f..36b95bd00 100644
--- a/db/dist/aclocal_java/ac_prog_javadoc.ac
+++ b/db/dist/aclocal_java/ac_prog_javadoc.ac
@@ -22,7 +22,7 @@ dnl The general documentation of those macros, as well as the sample
 dnl configure.in, is included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Egon Willighagen 
-dnl @version $Id: ac_prog_javadoc.ac,v 1.1 2001/08/23 16:58:44 dda Exp $
+dnl @version $Id: ac_prog_javadoc.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_PROG_JAVADOC],[
 AC_REQUIRE([AC_EXEEXT])dnl
diff --git a/db/dist/aclocal_java/ac_prog_javah.ac b/db/dist/aclocal_java/ac_prog_javah.ac
index 1b16d9e24..7563036c0 100644
--- a/db/dist/aclocal_java/ac_prog_javah.ac
+++ b/db/dist/aclocal_java/ac_prog_javah.ac
@@ -5,7 +5,7 @@ dnl and looks for the jni.h header file. If available, JAVAH is set to
 dnl the full path of javah and CPPFLAGS is updated accordingly.
 dnl
 dnl @author Luc Maisonobe
-dnl @version $Id: ac_prog_javah.ac,v 1.1 2001/08/23 16:58:44 dda Exp $
+dnl @version $Id: ac_prog_javah.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_PROG_JAVAH],[
 AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
diff --git a/db/dist/aclocal_java/ac_try_compile_java.ac b/db/dist/aclocal_java/ac_try_compile_java.ac
index 775569ba0..d22aeab42 100644
--- a/db/dist/aclocal_java/ac_try_compile_java.ac
+++ b/db/dist/aclocal_java/ac_try_compile_java.ac
@@ -14,7 +14,7 @@ dnl The general documentation, as well as the sample configure.in, is
 dnl included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Devin Weaver 
-dnl @version $Id: ac_try_compile_java.ac,v 1.1 2001/08/23 16:58:44 dda Exp $
+dnl @version $Id: ac_try_compile_java.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_TRY_COMPILE_JAVA],[
 AC_REQUIRE([AC_PROG_JAVAC])dnl
diff --git a/db/dist/aclocal_java/ac_try_run_javac.ac b/db/dist/aclocal_java/ac_try_run_javac.ac
index cf91306af..012493588 100644
--- a/db/dist/aclocal_java/ac_try_run_javac.ac
+++ b/db/dist/aclocal_java/ac_try_run_javac.ac
@@ -14,7 +14,7 @@ dnl The general documentation, as well as the sample configure.in, is
 dnl included in the AC_PROG_JAVA macro.
 dnl
 dnl @author Devin Weaver 
-dnl @version $Id: ac_try_run_javac.ac,v 1.1 2001/08/23 16:58:45 dda Exp $
+dnl @version $Id: ac_try_run_javac.ac,v 12.0 2004/11/17 03:43:38 bostic Exp $
 dnl
 AC_DEFUN([AC_TRY_RUN_JAVA],[
 AC_REQUIRE([AC_PROG_JAVAC])dnl
diff --git a/db/dist/buildrel b/db/dist/buildrel
index 2537376a8..1d2263cb5 100644
--- a/db/dist/buildrel
+++ b/db/dist/buildrel
@@ -1,11 +1,12 @@
-# $Id: buildrel,v 1.65 2004/11/09 01:26:29 bostic Exp $
+# $Id: buildrel,v 12.14 2006/09/20 01:12:33 bostic Exp $
 #
 # Build the distribution package.
 #
 # A set of commands intended to be cut and pasted into a csh window.
 
-# Development tree, release home.
-setenv D `pwd`
+setenv D		~bostic/berkeleydb/db.rel
+setenv DBCONF		"~bostic/bin/dbconf thread"
+setenv TARGETDIR	~bostic/berkeleydb/
 
 # Update the release number.
 cd $D/dist
@@ -24,7 +25,7 @@ cd $D/dist && sh s_all
 cd $D && cvs -q commit
 
 # Copy a development tree into a release tree.
-setenv R /var/tmp/db-$VERSION
+setenv R $TARGETDIR/db-$VERSION
 rm -rf $R && mkdir -p $R
 cd $D && cvs -q status | \
     grep "Repository revision" | \
@@ -38,19 +39,25 @@ cd db_docs && sh build $D clean && sh build $D |& sed '/.html$/d'
 cd je/docs_src && sh build db ../../db
 rm -rf $R/docs && cp -r $D/docs $R/docs
 
-# Remove source directories we don't distribute.
-cd $R && rm -rf docs_src docs/api_java
-cd $R && rm -rf test/TODO test/upgrade test_perf test_purify
-cd $R && rm -rf test_server test_thread test_vxworks test_xa
-cd $R && rm -rf java/src/com/sleepycat/xa
+########################################
+# PATCH RELEASE: starting point.
+########################################
 
 # Fix symbolic links and permissions.
 cd $R/dist && sh s_perm
 cd $R/dist && sh s_symlink
 
+# Remove source directories we don't distribute.
+cd $R && rm -rf build_brew os_brew
+cd $R && rm -rf docs_src docs/api_java docs/api_c/pindex.src
+cd $R && rm -rf java/src/com/sleepycat/xa
+cd $R && rm -rf rpc_server/java
+cd $R && rm -rf test/TODO test/upgrade test_perf test_purify
+cd $R && rm -rf test_rep test_server test_thread test_vxworks test_xa
+
 # Build a version and smoke test.
 cd $R && rm -rf build_run && mkdir build_run
-cd $R/build_run && ~bostic/bin/dbconf && make >& mklog
+cd $R/build_run && $DBCONF && make >& mklog
 cd $R/build_run && make ex_access && ./ex_access
 
 # Check the install
@@ -67,7 +74,7 @@ cd $R && rm -rf build_run
 # ACQUIRE ROOT PRIVILEGES
 cd $R && find . -type d | xargs chmod 775
 cd $R && find . -type f | xargs chmod 444
-cd $R && chmod 664 build_win32/*.dsp
+cd $R && chmod 664 build_windows/*.dsp
 cd $R/dist && sh s_perm
 chown -R 100 $R
 chgrp -R 100 $R
@@ -88,14 +95,14 @@ awk '{ if (length() > 99) print "Path length: " length() " bytes: " $0;}'
 # Create the non-crypto tree.
 setenv RNC "$R/../db-$VERSION.NC"
 rm -rf $RNC $R/../__TMP && mkdir $R/../__TMP
-cd $R/../__TMP && gzcat $T | tar xpf - && mv -i db-$VERSION $RNC
+cd $R/../__TMP && gzcat $T | pax -r && mv -i db-$VERSION $RNC
 cd $R && rm -rf $R/../__TMP
 cd $RNC/dist && sh s_crypto
 
 # ACQUIRE ROOT PRIVILEGES
 cd $RNC && find . -type d | xargs chmod 775
 cd $RNC && find . -type f | xargs chmod 444
-cd $RNC && chmod 664 build_win32/*.dsp
+cd $RNC && chmod 664 build_windows/*.dsp
 cd $RNC/dist && sh s_perm
 chown -R 100 $RNC
 chgrp -R 100 $RNC
@@ -112,17 +119,25 @@ awk '{ if (length() > 99) print "Path length: " length() " bytes: " $0;}'
 
 # Remove tags files.  They're large and we don't want to store symbolic links
 # in the zip archive for portability reasons.
+#
+# Modify the text files to have Windows end-of-line characters.
 # ACQUIRE ROOT PRIVILEGES
 cd $R && rm -f `find . -name 'tags'`
 cd $RNC && rm -f `find . -name 'tags'`
+
+set t=__tmp
+cd $R && awk '{print $0 "\r"}' < LICENSE > $t && cp $t LICENSE && rm -f $t
+cd $R && awk '{print $0 "\r"}' < README > $t && cp $t README && rm -f $t
+cd $RNC && awk '{print $0 "\r"}' < LICENSE > $t && cp $t LICENSE && rm -f $t
+cd $RNC && awk '{print $0 "\r"}' < README > $t && cp $t README && rm -f $t
 # DISCARD ROOT PRIVILEGES
 
 # Create the crypto zip archive release.
 setenv T "$R/../db-$VERSION.zip"
-cd $R/.. && zip -r - db-$VERSION > $T
+cd $R/.. && zip -q -r - db-$VERSION > $T
 chmod 444 $T
 
 # Create the non-crypto zip archive release.
 setenv T "$R/../db-$VERSION.NC.zip"
-cd $RNC/.. && zip -r - db-$VERSION.NC > $T
+cd $RNC/.. && zip -q -r - db-$VERSION.NC > $T
 chmod 444 $T
diff --git a/db/dist/clib_port.h b/db/dist/clib_port.h
new file mode 100644
index 000000000..cfefbb37d
--- /dev/null
+++ b/db/dist/clib_port.h
@@ -0,0 +1,97 @@
+/*
+ * Exit success/failure macros.
+ */
+#ifndef	HAVE_EXIT_SUCCESS
+#define	EXIT_FAILURE	1
+#define	EXIT_SUCCESS	0
+#endif
+
+/*
+ * Don't step on the namespace.  Other libraries may have their own
+ * implementations of these functions, we don't want to use their
+ * implementations or force them to use ours based on the load order.
+ */
+#ifndef	HAVE_ATOI
+#define	atoi		__db_Catoi
+#endif
+#ifndef	HAVE_ATOL
+#define	atol		__db_Catol
+#endif
+#ifndef	HAVE_GETADDRINFO
+#define	freeaddrinfo(a)		__db_Cfreeaddrinfo(a)
+#define	getaddrinfo(a, b, c, d)	__db_Cgetaddrinfo(a, b, c, d)
+#endif
+#ifndef	HAVE_GETCWD
+#define	getcwd		__db_Cgetcwd
+#endif
+#ifndef	HAVE_GETOPT
+#define	getopt		__db_Cgetopt
+#define	optarg		__db_Coptarg
+#define	opterr		__db_Copterr
+#define	optind		__db_Coptind
+#define	optopt		__db_Coptopt
+#define	optreset	__db_Coptreset
+#endif
+#ifndef	HAVE_ISSPACE
+#define	isspace		__db_Cisspace
+#endif
+#ifndef	HAVE_MEMCMP
+#define	memcmp		__db_Cmemcmp
+#endif
+#ifndef	HAVE_MEMCPY
+#define	memcpy		__db_Cmemcpy
+#endif
+#ifndef	HAVE_MEMMOVE
+#define	memmove		__db_Cmemmove
+#endif
+#ifndef	HAVE_PRINTF
+#define	printf		__db_Cprintf
+#define	fprintf		__db_Cfprintf
+#endif
+#ifndef	HAVE_RAISE
+#define	raise		__db_Craise
+#endif
+#ifndef	HAVE_RAND
+#define	rand		__db_Crand
+#define	srand		__db_Csrand
+#endif
+#ifndef	HAVE_SNPRINTF
+#define	snprintf	__db_Csnprintf
+#endif
+#ifndef	HAVE_STRCASECMP
+#define	strcasecmp	__db_Cstrcasecmp
+#define	strncasecmp	__db_Cstrncasecmp
+#endif
+#ifndef	HAVE_STRCAT
+#define	strcat		__db_Cstrcat
+#endif
+#ifndef	HAVE_STRCHR
+#define	strchr		__db_Cstrchr
+#endif
+#ifndef	HAVE_STRDUP
+#define	strdup		__db_Cstrdup
+#endif
+#ifndef	HAVE_STRERROR
+#define	strerror	__db_Cstrerror
+#endif
+#ifndef	HAVE_STRNCAT
+#define	strncat		__db_Cstrncat
+#endif
+#ifndef	HAVE_STRNCMP
+#define	strncmp		__db_Cstrncmp
+#endif
+#ifndef	HAVE_STRRCHR
+#define	strrchr		__db_Cstrrchr
+#endif
+#ifndef	HAVE_STRSEP
+#define	strsep		__db_Cstrsep
+#endif
+#ifndef	HAVE_STRTOL
+#define	strtol		__db_Cstrtol
+#endif
+#ifndef	HAVE_STRTOUL
+#define	strtoul		__db_Cstrtoul
+#endif
+#ifndef	HAVE_VSNPRINTF
+#define	vsnprintf	__db_Cvsnprintf
+#endif
diff --git a/db/dist/config.guess b/db/dist/config.guess
index 7d0185e01..396482d6c 100755
--- a/db/dist/config.guess
+++ b/db/dist/config.guess
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
 
-timestamp='2004-09-07'
+timestamp='2006-07-02'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,13 +18,15 @@ timestamp='2004-09-07'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+
 # Originally written by Per Bothner .
 # Please send patches to .  Submit a context
 # diff and a properly formatted ChangeLog entry.
@@ -53,7 +56,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -66,11 +69,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )	# Use stdin as input.
@@ -104,7 +107,7 @@ set_cc_for_build='
 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -123,7 +126,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
 	;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
@@ -196,55 +199,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
-	exit 0 ;;
-    amd64:OpenBSD:*:*)
-	echo x86_64-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    amiga:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    cats:OpenBSD:*:*)
-	echo arm-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    hp300:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    luna88k:OpenBSD:*:*)
-    	echo m88k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mac68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    macppc:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-	echo m88k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvmeppc:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sgi:OpenBSD:*:*)
-	echo mips64-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sun3:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:OpenBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
     *:ekkoBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
     macppc:MirBSD:*:*)
-	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
-	exit 0 ;;
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
     *:MirBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
 	*4.0)
@@ -297,37 +268,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit 0 ;;
+	exit ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
 	# of the specific Alpha model?
 	echo alpha-pc-interix
-	exit 0 ;;
+	exit ;;
     21064:Windows_NT:50:3)
 	echo alpha-dec-winnt3.5
-	exit 0 ;;
+	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
-	exit 0;;
+	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-amigaos
-	exit 0 ;;
+	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-morphos
-	exit 0 ;;
+	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
-	exit 0 ;;
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
     *:OS400:*:*)
         echo powerpc-ibm-os400
-	exit 0 ;;
+	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit 0;;
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
-	exit 0;;
+	exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
 	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
 	if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -335,32 +312,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	else
 		echo pyramid-pyramid-bsd
 	fi
-	exit 0 ;;
+	exit ;;
     NILE*:*:*:dcosx)
 	echo pyramid-pyramid-svr4
-	exit 0 ;;
+	exit ;;
     DRS?6000:unix:4.0:6*)
 	echo sparc-icl-nx6
-	exit 0 ;;
-    DRS?6000:UNIX_SV:4.2*:7*)
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
 	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7 && exit 0 ;;
+	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
     sun4H:SunOS:5.*:*)
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     i86pc:SunOS:5.*:*)
 	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
 	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
 	    Series*|S4*)
@@ -369,10 +346,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
 	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit 0 ;;
+	exit ;;
     sun3*:SunOS:*:*)
 	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -384,10 +361,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		echo sparc-sun-sunos${UNAME_RELEASE}
 		;;
 	esac
-	exit 0 ;;
+	exit ;;
     aushp:SunOS:*:*)
 	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -398,40 +375,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     m68k:machten:*:*)
 	echo m68k-apple-machten${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     powerpc:machten:*:*)
 	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
-	exit 0 ;;
+	exit ;;
     RISC*:ULTRIX:*:*)
 	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     VAX*:ULTRIX*:*:*)
 	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
 	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -455,32 +432,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	  exit (-1);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c \
-	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-	  && exit 0
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
 	echo mips-mips-riscos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
-	exit 0 ;;
+	exit ;;
     Motorola:*:4.3:PL8-*)
 	echo powerpc-harris-powermax
-	exit 0 ;;
+	exit ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 	echo powerpc-harris-powermax
-	exit 0 ;;
+	exit ;;
     Night_Hawk:Power_UNIX:*:*)
 	echo powerpc-harris-powerunix
-	exit 0 ;;
+	exit ;;
     m88k:CX/UX:7*:*)
 	echo m88k-harris-cxux7
-	exit 0 ;;
+	exit ;;
     m88k:*:4*:R4*)
 	echo m88k-motorola-sysv4
-	exit 0 ;;
+	exit ;;
     m88k:*:3*:R3*)
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -496,29 +474,29 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit 0 ;;
+ 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
-	exit 0 ;;
+	exit ;;
     M88*:*:R3*:*)
 	# Delta 88k system running SVR3
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
 	echo m88k-tektronix-sysv3
-	exit 0 ;;
+	exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
 	echo m68k-tektronix-bsd
-	exit 0 ;;
+	exit ;;
     *:IRIX*:*:*)
 	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit 0 ;;
+	exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
 	echo i386-ibm-aix
-	exit 0 ;;
+	exit ;;
     ia64:AIX:*:*)
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
@@ -526,7 +504,7 @@ EOF
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-	exit 0 ;;
+	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 		eval $set_cc_for_build
@@ -541,14 +519,18 @@ EOF
 			exit(0);
 			}
 EOF
-		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
-		echo rs6000-ibm-aix3.2.5
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
 		echo rs6000-ibm-aix3.2.4
 	else
 		echo rs6000-ibm-aix3.2
 	fi
-	exit 0 ;;
+	exit ;;
     *:AIX:*:[45])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
@@ -562,28 +544,28 @@ EOF
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit 0 ;;
+	exit ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
-	exit 0 ;;
+	exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 	echo romp-ibm-bsd4.4
-	exit 0 ;;
+	exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
 	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit 0 ;;                           # report: romp-ibm BSD 4.3
+	exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
-	exit 0 ;;
+	exit ;;
     DPX/2?00:B.O.S.:*:*)
 	echo m68k-bull-sysv3
-	exit 0 ;;
+	exit ;;
     9000/[34]??:4.3bsd:1.*:*)
 	echo m68k-hp-bsd
-	exit 0 ;;
+	exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
 	echo m68k-hp-bsd4.4
-	exit 0 ;;
+	exit ;;
     9000/[34678]??:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	case "${UNAME_MACHINE}" in
@@ -645,9 +627,19 @@ EOF
 	esac
 	if [ ${HP_ARCH} = "hppa2.0w" ]
 	then
-	    # avoid double evaluation of $set_cc_for_build
-	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
 	    then
 		HP_ARCH="hppa2.0w"
 	    else
@@ -655,11 +647,11 @@ EOF
 	    fi
 	fi
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit 0 ;;
+	exit ;;
     ia64:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	echo ia64-hp-hpux${HPUX_REV}
-	exit 0 ;;
+	exit ;;
     3050*:HI-UX:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -687,158 +679,179 @@ EOF
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
 	echo unknown-hitachi-hiuxwe2
-	exit 0 ;;
+	exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
 	echo hppa1.1-hp-bsd
-	exit 0 ;;
+	exit ;;
     9000/8??:4.3bsd:*:*)
 	echo hppa1.0-hp-bsd
-	exit 0 ;;
+	exit ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 	echo hppa1.0-hp-mpeix
-	exit 0 ;;
+	exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
 	echo hppa1.1-hp-osf
-	exit 0 ;;
+	exit ;;
     hp8??:OSF1:*:*)
 	echo hppa1.0-hp-osf
-	exit 0 ;;
+	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
 	    echo ${UNAME_MACHINE}-unknown-osf1mk
 	else
 	    echo ${UNAME_MACHINE}-unknown-osf1
 	fi
-	exit 0 ;;
+	exit ;;
     parisc*:Lites*:*:*)
 	echo hppa1.1-hp-lites
-	exit 0 ;;
+	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit 0 ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit 0 ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit 0 ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit 0 ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit 0 ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*[A-Z]90:*:*:*)
 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*TS:*:*:*)
 	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*T3E:*:*:*)
 	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*SV1:*:*:*)
 	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     *:UNICOS/mp:*:*)
 	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit 0 ;;
+        exit ;;
     5000:UNIX_System_V:4.*:*)
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit 0 ;;
+	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sparc*:BSD/OS:*:*)
 	echo sparc-unknown-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:BSD/OS:*:*)
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:FreeBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit 0 ;;
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
-	exit 0 ;;
+	exit ;;
     i*:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
-	exit 0 ;;
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
-	exit 0 ;;
-    x86:Interix*:[34]*)
-	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-	exit 0 ;;
+	exit ;;
+    x86:Interix*:[3456]*)
+	echo i586-pc-interix${UNAME_RELEASE}
+	exit ;;
+    EM64T:Interix*:[3456]*)
+	echo x86_64-unknown-interix${UNAME_RELEASE}
+	exit ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
-	exit 0 ;;
+	exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
 	# UNAME_MACHINE based on the output of uname instead of i386?
 	echo i586-pc-interix
-	exit 0 ;;
+	exit ;;
     i*:UWIN*:*)
 	echo ${UNAME_MACHINE}-pc-uwin
-	exit 0 ;;
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
     p*:CYGWIN*:*)
 	echo powerpcle-unknown-cygwin
-	exit 0 ;;
+	exit ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     *:GNU:*:*)
 	# the GNU system
 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit 0 ;;
+	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
 	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-	exit 0 ;;
+	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
-	exit 0 ;;
+	exit ;;
     arm*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
     cris:Linux:*:*)
 	echo cris-axis-linux-gnu
-	exit 0 ;;
+	exit ;;
     crisv32:Linux:*:*)
 	echo crisv32-axis-linux-gnu
-	exit 0 ;;
+	exit ;;
     frv:Linux:*:*)
     	echo frv-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     ia64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     m32r*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     m68*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     mips:Linux:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -855,8 +868,12 @@ EOF
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
     mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -874,15 +891,22 @@ EOF
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
     ppc:Linux:*:*)
 	echo powerpc-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     ppc64:Linux:*:*)
 	echo powerpc64-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -896,7 +920,7 @@ EOF
 	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
 	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-	exit 0 ;;
+	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -904,25 +928,28 @@ EOF
 	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
 	  *)    echo hppa-unknown-linux-gnu ;;
 	esac
-	exit 0 ;;
+	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
 	echo hppa64-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux
-	exit 0 ;;
+	exit ;;
     sh64*:Linux:*:*)
     	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     sh*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
     x86_64:Linux:*:*)
 	echo x86_64-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
 	# first see if it will tell us. cd to the root directory to prevent
@@ -940,15 +967,15 @@ EOF
 		;;
 	  a.out-i386-linux)
 		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-		exit 0 ;;
+		exit ;;
 	  coff-i386)
 		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-		exit 0 ;;
+		exit ;;
 	  "")
 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
 		# one that does not give us useful --help.
 		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-		exit 0 ;;
+		exit ;;
 	esac
 	# Determine whether the default compiler is a.out or elf
 	eval $set_cc_for_build
@@ -965,7 +992,7 @@ EOF
 	LIBC=gnulibc1
 	# endif
 	#else
-	#ifdef __INTEL_COMPILER
+	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
 	LIBC=gnu
 	#else
 	LIBC=gnuaout
@@ -975,16 +1002,23 @@ EOF
 	LIBC=dietlibc
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
-	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^LIBC/{
+		s: ::g
+		p
+	    }'`"
+	test x"${LIBC}" != x && {
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		exit
+	}
+	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
 	;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 	# earlier versions are messed up and put the nodename in both
 	# sysname and nodename.
 	echo i386-sequent-sysv4
-	exit 0 ;;
+	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
@@ -992,27 +1026,27 @@ EOF
 	# I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit 0 ;;
+	exit ;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
 	echo ${UNAME_MACHINE}-pc-os2-emx
-	exit 0 ;;
+	exit ;;
     i*86:XTS-300:*:STOP)
 	echo ${UNAME_MACHINE}-unknown-stop
-	exit 0 ;;
+	exit ;;
     i*86:atheos:*:*)
 	echo ${UNAME_MACHINE}-unknown-atheos
-	exit 0 ;;
-	i*86:syllable:*:*)
+	exit ;;
+    i*86:syllable:*:*)
 	echo ${UNAME_MACHINE}-pc-syllable
-	exit 0 ;;
+	exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     i*86:*DOS:*:*)
 	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit 0 ;;
+	exit ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
 	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1020,15 +1054,16 @@ EOF
 	else
 		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
-	exit 0 ;;
-    i*86:*:5:[78]*)
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
 	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	exit 0 ;;
+	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then
 	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
 	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 	fi
-	exit 0 ;;
+	exit ;;
     mini*:CTIX:SYS*5:*)
 	# "miniframe"
 	echo m68010-convergent-sysv
-	exit 0 ;;
+	exit ;;
     mc68k:UNIX:SYSTEM5:3.51m)
 	echo m68k-convergent-sysv
-	exit 0 ;;
+	exit ;;
     M680?0:D-NIX:5.3:*)
 	echo m68k-diab-dnix
-	exit 0 ;;
+	exit ;;
     M68*:*:R3V[5678]*:*)
-	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
+          && { echo i486-ncr-sysv4; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
-	exit 0 ;;
+	exit ;;
     TSUNAMI:LynxOS:2.*:*)
 	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 	echo powerpc-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
-	exit 0 ;;
+	exit ;;
     RM*:SINIX-*:*:*)
 	echo mips-sni-sysv4
-	exit 0 ;;
+	exit ;;
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1120,69 +1155,72 @@ EOF
 	else
 		echo ns32k-sni-sysv
 	fi
-	exit 0 ;;
+	exit ;;
     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                       # says 
         echo i586-unisys-sysv4
-        exit 0 ;;
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes .
 	# How about differentiating between stratus architectures? -djm
 	echo hppa1.1-stratus-sysv4
-	exit 0 ;;
+	exit ;;
     *:*:*:FTX*)
 	# From seanf@swdc.stratus.com.
 	echo i860-stratus-sysv4
-	exit 0 ;;
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
     *:VOS:*:*)
 	# From Paul.Green@stratus.com.
 	echo hppa1.1-stratus-vos
-	exit 0 ;;
+	exit ;;
     mc68*:A/UX:*:*)
 	echo m68k-apple-aux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
-	exit 0 ;;
+	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
 	        echo mips-nec-sysv${UNAME_RELEASE}
 	else
 	        echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-        exit 0 ;;
+        exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
-	exit 0 ;;
+	exit ;;
     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
 	echo powerpc-apple-beos
-	exit 0 ;;
+	exit ;;
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 	echo i586-pc-beos
-	exit 0 ;;
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SX-5:SUPER-UX:*:*)
 	echo sx5-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SX-6:SUPER-UX:*:*)
 	echo sx6-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     Power*:Rhapsody:*:*)
 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Rhapsody:*:*)
 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
 	case $UNAME_PROCESSOR in
-	    *86) UNAME_PROCESSOR=i686 ;;
 	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
 	if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1190,22 +1228,25 @@ EOF
 		UNAME_MACHINE=pc
 	fi
 	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
-	exit 0 ;;
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
 	echo nsr-tandem-nsk${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
-	exit 0 ;;
+	exit ;;
     BS2000:POSIX*:*:*)
 	echo bs2000-siemens-sysv
-	exit 0 ;;
+	exit ;;
     DS/*:UNIX_System_V:*:*)
 	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
 	# is converted to i386 for consistency with other x86
@@ -1216,38 +1257,47 @@ EOF
 	    UNAME_MACHINE="$cputype"
 	fi
 	echo ${UNAME_MACHINE}-unknown-plan9
-	exit 0 ;;
+	exit ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
-	exit 0 ;;
+	exit ;;
     *:TENEX:*:*)
 	echo pdp10-unknown-tenex
-	exit 0 ;;
+	exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 	echo pdp10-dec-tops20
-	exit 0 ;;
+	exit ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 	echo pdp10-xkl-tops20
-	exit 0 ;;
+	exit ;;
     *:TOPS-20:*:*)
 	echo pdp10-unknown-tops20
-	exit 0 ;;
+	exit ;;
     *:ITS:*:*)
 	echo pdp10-unknown-its
-	exit 0 ;;
+	exit ;;
     SEI:*:*:SEIUX)
         echo mips-sei-seiux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:DragonFly:*:*)
 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit 0 ;;
+	exit ;;
     *:*VMS:*:*)
     	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 	case "${UNAME_MACHINE}" in
-	    A*) echo alpha-dec-vms && exit 0 ;;
-	    I*) echo ia64-dec-vms && exit 0 ;;
-	    V*) echo vax-dec-vms && exit 0 ;;
-	esac
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1279,7 +1329,7 @@ main ()
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
+  printf ("arm-acorn-riscix\n"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -1368,11 +1418,12 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -1381,22 +1432,22 @@ then
     case `getsysinfo -f cpu_type` in
     c1*)
 	echo c1-convex-bsd
-	exit 0 ;;
+	exit ;;
     c2*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-	exit 0 ;;
+	exit ;;
     c34*)
 	echo c34-convex-bsd
-	exit 0 ;;
+	exit ;;
     c38*)
 	echo c38-convex-bsd
-	exit 0 ;;
+	exit ;;
     c4*)
 	echo c4-convex-bsd
-	exit 0 ;;
+	exit ;;
     esac
 fi
 
@@ -1407,7 +1458,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-    ftp://ftp.gnu.org/pub/gnu/config/
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
diff --git a/db/dist/config.hin b/db/dist/config.hin
index 28d618102..d4a3f3138 100644
--- a/db/dist/config.hin
+++ b/db/dist/config.hin
@@ -21,12 +21,30 @@
 /* Define to 1 if you want a version with run-time diagnostic checking. */
 #undef DIAGNOSTIC
 
+/* Define to 1 if 64-bit types are available. */
+#undef HAVE_64BIT_TYPES
+
+/* Define to 1 if you have the `abort' function. */
+#undef HAVE_ABORT
+
+/* Define to 1 if you have the `atoi' function. */
+#undef HAVE_ATOI
+
+/* Define to 1 if you have the `atol' function. */
+#undef HAVE_ATOL
+
 /* Define to 1 if you have the `clock_gettime' function. */
 #undef HAVE_CLOCK_GETTIME
 
 /* Define to 1 if Berkeley DB release includes strong cryptography. */
 #undef HAVE_CRYPTO
 
+/* Define to 1 if you have the `ctime_r' function. */
+#undef HAVE_CTIME_R
+
+/* Define to 1 if ctime_r takes a buffer length as a third argument. */
+#undef HAVE_CTIME_R_3ARG
+
 /* Define to 1 if you have the `directio' function. */
 #undef HAVE_DIRECTIO
 
@@ -40,6 +58,12 @@
 /* Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines. */
 #undef HAVE_EXIT_SUCCESS
 
+/* Define to 1 if you have the `fchmod' function. */
+#undef HAVE_FCHMOD
+
+/* Define to 1 if you have the `fcntl' function. */
+#undef HAVE_FCNTL
+
 /* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */
 #undef HAVE_FCNTL_F_SETFD
 
@@ -52,9 +76,15 @@
 /* Define to 1 if you have the `ftruncate' function. */
 #undef HAVE_FTRUNCATE
 
+/* Define to 1 if you have the `getaddrinfo' function. */
+#undef HAVE_GETADDRINFO
+
 /* Define to 1 if you have the `getcwd' function. */
 #undef HAVE_GETCWD
 
+/* Define to 1 if you have the `getenv' function. */
+#undef HAVE_GETENV
+
 /* Define to 1 if you have the `getopt' function. */
 #undef HAVE_GETOPT
 
@@ -73,11 +103,17 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_INTTYPES_H
 
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-#undef HAVE_LIBNSL
+/* Define to 1 if you have the `isalpha' function. */
+#undef HAVE_ISALPHA
+
+/* Define to 1 if you have the `isdigit' function. */
+#undef HAVE_ISDIGIT
 
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
+/* Define to 1 if you have the `isprint' function. */
+#undef HAVE_ISPRINT
+
+/* Define to 1 if you have the `isspace' function. */
+#undef HAVE_ISSPACE
 
 /* Define to 1 if you have the `memcmp' function. */
 #undef HAVE_MEMCMP
@@ -97,6 +133,9 @@
 /* Define to 1 if you have the `mmap' function. */
 #undef HAVE_MMAP
 
+/* Define to 1 if you have the `mprotect' function. */
+#undef HAVE_MPROTECT
+
 /* Define to 1 if you have the `munlock' function. */
 #undef HAVE_MUNLOCK
 
@@ -131,6 +170,9 @@
 /* Define to 1 to use the GCC compiler and IA64 assembly language mutexes. */
 #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY
 
+/* Define to 1 to use the GCC compiler and MIPS assembly language mutexes. */
+#undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY
+
 /* Define to 1 to use the msem_XXX mutexes on systems other than HP-UX. */
 #undef HAVE_MUTEX_MSEM_INIT
 
@@ -172,9 +214,6 @@
 /* Define to 1 if mutexes hold system resources. */
 #undef HAVE_MUTEX_SYSTEM_RESOURCES
 
-/* Define to 1 if fast mutexes are available. */
-#undef HAVE_MUTEX_THREADS
-
 /* Define to 1 to configure mutexes intra-process only. */
 #undef HAVE_MUTEX_THREAD_ONLY
 
@@ -199,6 +238,9 @@
 /* Define to 1 to use the GCC compiler and Windows mutexes. */
 #undef HAVE_MUTEX_WIN32_GCC
 
+/* Define to 1 to use the GCC compiler and amd64 assembly language mutexes. */
+#undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
+
 /* Define to 1 to use the GCC compiler and x86 assembly language mutexes. */
 #undef HAVE_MUTEX_X86_GCC_ASSEMBLY
 
@@ -211,9 +253,18 @@
 /* Define to 1 if you have the `pread' function. */
 #undef HAVE_PREAD
 
+/* Define to 1 if you have the `printf' function. */
+#undef HAVE_PRINTF
+
 /* Define to 1 if you have the `pstat_getdynamic' function. */
 #undef HAVE_PSTAT_GETDYNAMIC
 
+/* Define to 1 to configure Berkeley DB for POSIX pthread API. */
+#undef HAVE_PTHREAD_API
+
+/* Define to 1 if you have the `pthread_yield' function. */
+#undef HAVE_PTHREAD_YIELD
+
 /* Define to 1 if you have the `pwrite' function. */
 #undef HAVE_PWRITE
 
@@ -232,6 +283,9 @@
 /* Define to 1 if building replication support. */
 #undef HAVE_REPLICATION
 
+/* Define to 1 if building the Berkeley DB replication framework. */
+#undef HAVE_REPLICATION_THREADS
+
 /* Define to 1 if building RPC client/server. */
 #undef HAVE_RPC
 
@@ -241,17 +295,20 @@
 /* Define to 1 if you have the `select' function. */
 #undef HAVE_SELECT
 
-/* Define to 1 if building sequence support. */
-#undef HAVE_SEQUENCE
-
 /* Define to 1 if you have the `shmget' function. */
 #undef HAVE_SHMGET
 
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if thread identifier type db_threadid_t is integral. */
+#undef HAVE_SIMPLE_THREAD_TYPE
+
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
-/* Define to 1 if you have the `srand' function. */
-#undef HAVE_SRAND
+/* Define to 1 if you have the `stat' function. */
+#undef HAVE_STAT
 
 /* Define to 1 if building statistics support. */
 #undef HAVE_STATISTICS
@@ -265,18 +322,39 @@
 /* Define to 1 if you have the `strcasecmp' function. */
 #undef HAVE_STRCASECMP
 
+/* Define to 1 if you have the `strcat' function. */
+#undef HAVE_STRCAT
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
 /* Define to 1 if you have the `strdup' function. */
 #undef HAVE_STRDUP
 
 /* Define to 1 if you have the `strerror' function. */
 #undef HAVE_STRERROR
 
+/* Define to 1 if you have the `strftime' function. */
+#undef HAVE_STRFTIME
+
 /* Define to 1 if you have the  header file. */
 #undef HAVE_STRINGS_H
 
 /* Define to 1 if you have the  header file. */
 #undef HAVE_STRING_H
 
+/* Define to 1 if you have the `strncat' function. */
+#undef HAVE_STRNCAT
+
+/* Define to 1 if you have the `strncmp' function. */
+#undef HAVE_STRNCMP
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the `strsep' function. */
+#undef HAVE_STRSEP
+
 /* Define to 1 if you have the `strtol' function. */
 #undef HAVE_STRTOL
 
@@ -318,9 +396,6 @@
 /* Define to 1 if unlink of file with open file descriptors will fail. */
 #undef HAVE_UNLINK_WITH_OPEN_FAILURE
 
-/* Define to 1 if the system has the type `unsigned long long'. */
-#undef HAVE_UNSIGNED_LONG_LONG
-
 /* Define to 1 if building access method verification support. */
 #undef HAVE_VERIFY
 
@@ -336,9 +411,6 @@
 /* Define to 1 if you have the `_fstati64' function. */
 #undef HAVE__FSTATI64
 
-/* Define to a value if using non-standard mutex alignment. */
-#undef MUTEX_ALIGN
-
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
@@ -354,40 +426,40 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* The size of a `char', as computed by sizeof. */
+/* The size of `char', as computed by sizeof. */
 #undef SIZEOF_CHAR
 
-/* The size of a `char *', as computed by sizeof. */
+/* The size of `char *', as computed by sizeof. */
 #undef SIZEOF_CHAR_P
 
-/* The size of a `int', as computed by sizeof. */
+/* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
 
-/* The size of a `long', as computed by sizeof. */
+/* The size of `long', as computed by sizeof. */
 #undef SIZEOF_LONG
 
-/* The size of a `long long', as computed by sizeof. */
+/* The size of `long long', as computed by sizeof. */
 #undef SIZEOF_LONG_LONG
 
-/* The size of a `short', as computed by sizeof. */
+/* The size of `short', as computed by sizeof. */
 #undef SIZEOF_SHORT
 
-/* The size of a `size_t', as computed by sizeof. */
+/* The size of `size_t', as computed by sizeof. */
 #undef SIZEOF_SIZE_T
 
-/* The size of a `unsigned char', as computed by sizeof. */
+/* The size of `unsigned char', as computed by sizeof. */
 #undef SIZEOF_UNSIGNED_CHAR
 
-/* The size of a `unsigned int', as computed by sizeof. */
+/* The size of `unsigned int', as computed by sizeof. */
 #undef SIZEOF_UNSIGNED_INT
 
-/* The size of a `unsigned long', as computed by sizeof. */
+/* The size of `unsigned long', as computed by sizeof. */
 #undef SIZEOF_UNSIGNED_LONG
 
-/* The size of a `unsigned long long', as computed by sizeof. */
+/* The size of `unsigned long long', as computed by sizeof. */
 #undef SIZEOF_UNSIGNED_LONG_LONG
 
-/* The size of a `unsigned short', as computed by sizeof. */
+/* The size of `unsigned short', as computed by sizeof. */
 #undef SIZEOF_UNSIGNED_SHORT
 
 /* Define to 1 if the `S_IS*' macros in  do not work properly. */
@@ -411,47 +483,7 @@
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 
-/*
- * Exit success/failure macros.
- */
-#ifndef	HAVE_EXIT_SUCCESS
-#define	EXIT_FAILURE	1
-#define	EXIT_SUCCESS	0
-#endif
-
-/*
- * Don't step on the namespace.  Other libraries may have their own
- * implementations of these functions, we don't want to use their
- * implementations or force them to use ours based on the load order.
- */
-#ifndef	HAVE_GETCWD
-#define	getcwd		__db_Cgetcwd
-#endif
-#ifndef	HAVE_MEMCMP
-#define	memcmp		__db_Cmemcmp
-#endif
-#ifndef	HAVE_MEMCPY
-#define	memcpy		__db_Cmemcpy
-#endif
-#ifndef	HAVE_MEMMOVE
-#define	memmove		__db_Cmemmove
-#endif
-#ifndef	HAVE_RAISE
-#define	raise		__db_Craise
-#endif
-#ifndef	HAVE_SNPRINTF
-#define	snprintf	__db_Csnprintf
-#endif
-#ifndef	HAVE_STRCASECMP
-#define	strcasecmp	__db_Cstrcasecmp
-#define	strncasecmp	__db_Cstrncasecmp
-#endif
-#ifndef	HAVE_STRERROR
-#define	strerror	__db_Cstrerror
-#endif
-#ifndef	HAVE_VSNPRINTF
-#define	vsnprintf	__db_Cvsnprintf
-#endif
+#include "clib_port.h"
 
 #ifdef DB_WIN32
 #include "win_db.h"
diff --git a/db/dist/config.sub b/db/dist/config.sub
index edb6b663c..53954dbe9 100755
--- a/db/dist/config.sub
+++ b/db/dist/config.sub
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
 
-timestamp='2004-08-29'
+timestamp='2006-08-14'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +22,15 @@ timestamp='2004-08-29'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+
 # Please send patches to .  Submit a context
 # diff and a properly formatted ChangeLog entry.
 #
@@ -70,7 +72,7 @@ Report bugs and patches to ."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -83,11 +85,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )	# Use stdin as input.
@@ -99,7 +101,7 @@ while test $# -gt 0 ; do
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit 0;;
+       exit ;;
 
     * )
        break ;;
@@ -118,8 +120,9 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
-  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -170,6 +173,10 @@ case $os in
 	-hiux*)
 		os=-hiuxwe2
 		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco5)
 		os=-sco3.2v5
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -186,6 +193,10 @@ case $os in
 		# Don't forget version if it is 3.2v4 or newer.
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco*)
 		os=-sco3.2v2
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -230,14 +241,16 @@ case $basic_machine in
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
 	| fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
-	| m32r | m32rle | m68000 | m68k | m88k | mcore \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -246,6 +259,7 @@ case $basic_machine in
 	| mips64vr4100 | mips64vr4100el \
 	| mips64vr4300 | mips64vr4300el \
 	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
 	| mipsisa64 | mipsisa64el \
@@ -254,20 +268,23 @@ case $basic_machine in
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
+	| mt \
 	| msp430 \
+	| nios | nios2 \
 	| ns16k | ns32k \
-	| openrisc | or32 \
+	| or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 	| pyramid \
-	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
-	| strongarm \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu | strongarm \
 	| tahoe | thumb | tic4x | tic80 | tron \
 	| v850 | v850e \
 	| we32k \
-	| x86 | xscale | xstormy16 | xtensa \
+	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
 	| z8k)
 		basic_machine=$basic_machine-unknown
 		;;
@@ -278,6 +295,9 @@ case $basic_machine in
 		;;
 	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
 
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
@@ -297,8 +317,8 @@ case $basic_machine in
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* \
-	| bs2000-* \
+	| avr-* | avr32-* \
+	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
@@ -308,9 +328,9 @@ case $basic_machine in
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
-	| m32r-* | m32rle-* \
+	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | mcore-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -319,6 +339,7 @@ case $basic_machine in
 	| mips64vr4100-* | mips64vr4100el-* \
 	| mips64vr4300-* | mips64vr4300el-* \
 	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
 	| mipsisa64-* | mipsisa64el-* \
@@ -327,24 +348,27 @@ case $basic_machine in
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
+	| mt-* \
 	| msp430-* \
+	| nios-* | nios2-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 	| pyramid-* \
 	| romp-* | rs6000-* \
-	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
 	| tahoe-* | thumb-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
 	| tron-* \
 	| v850-* | v850e-* | vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
-	| xtensa-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa-* \
 	| ymp-* \
 	| z8k-*)
 		;;
@@ -489,6 +513,10 @@ case $basic_machine in
 		basic_machine=m88k-motorola
 		os=-sysv3
 		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
 	dpx20 | dpx20-*)
 		basic_machine=rs6000-bull
 		os=-bosx
@@ -679,6 +707,9 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-msdos
 		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
@@ -754,9 +785,8 @@ case $basic_machine in
 		basic_machine=hppa1.1-oki
 		os=-proelf
 		;;
-	or32 | or32-*)
+	openrisc | openrisc-*)
 		basic_machine=or32-unknown
-		os=-coff
 		;;
 	os400)
 		basic_machine=powerpc-ibm
@@ -787,6 +817,12 @@ case $basic_machine in
 	pc532 | pc532-*)
 		basic_machine=ns32k-pc532
 		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	pentium | p5 | k5 | k6 | nexgen | viac3)
 		basic_machine=i586-pc
 		;;
@@ -843,6 +879,10 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
 	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
@@ -869,6 +909,10 @@ case $basic_machine in
 	sb1el)
 		basic_machine=mipsisa64sb1el-unknown
 		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
 	sei)
 		basic_machine=mips-sei
 		os=-seiux
@@ -1029,6 +1073,10 @@ case $basic_machine in
 		basic_machine=hppa1.1-winbond
 		os=-proelf
 		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
@@ -1078,13 +1126,10 @@ case $basic_machine in
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
-	sh64)
-		basic_machine=sh64-unknown
-		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b)
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
 		basic_machine=sparc-sun
 		;;
 	cydra)
@@ -1157,20 +1202,23 @@ case $os in
 	      | -aos* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1188,7 +1236,7 @@ case $os in
 		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 		;;
 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
 	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 		;;
 	-mac*)
@@ -1297,6 +1345,9 @@ case $os in
 	-kaos*)
 		os=-kaos
 		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
 	-none)
 		;;
 	*)
@@ -1319,6 +1370,9 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
+        spu-*)
+		os=-elf
+		;;
 	*-acorn)
 		os=-riscix1.2
 		;;
@@ -1328,9 +1382,9 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-    c4x-* | tic4x-*)
-        os=-coff
-        ;;
+        c4x-* | tic4x-*)
+        	os=-coff
+		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
 		os=-tops20
@@ -1374,6 +1428,9 @@ case $basic_machine in
 	*-be)
 		os=-beos
 		;;
+	*-haiku)
+		os=-haiku
+		;;
 	*-ibm)
 		os=-aix
 		;;
@@ -1545,7 +1602,7 @@ case $basic_machine in
 esac
 
 echo $basic_machine$os
-exit 0
+exit
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/db/dist/configure b/db/dist/configure
index 6cda7d877..b7af6f85c 100755
--- a/db/dist/configure
+++ b/db/dist/configure
@@ -1,10 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for Berkeley DB 4.3.27.
+# Generated by GNU Autoconf 2.60 for Berkeley DB 4.5.20.
 #
-# Report bugs to .
+# Report bugs to .
 #
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -18,11 +19,35 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
@@ -31,8 +56,43 @@ else
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -46,18 +106,19 @@ do
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -65,157 +126,386 @@ fi
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
+# CDPATH.
+$as_unset CDPATH
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
 fi
 
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
+  case $as_dir in
 	 /*)
-	   if ("$as_dir/$as_base" -c '
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
+  chmod +x "$as_me.lineno" ||
     { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -224,7 +514,19 @@ else
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+# Find out whether ``test -x'' works.  Don't use a zero-byte file, as
+# systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  as_executable_p="test -x"
+else
+  as_executable_p=:
+fi
+rm -f conf$$.file
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -233,15 +535,6 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 
 
 # Check that we are running under the correct shell.
@@ -287,8 +580,8 @@ if test "X${echo_test_string+set}" != Xset; then
 # find a string as large as possible, as long as the shell can cope with it
   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
     then
       break
@@ -397,38 +690,35 @@ tagnames=${tagnames+${tagnames},}CXX
 
 tagnames=${tagnames+${tagnames},}F77
 
+exec 7<&0 &1
+
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec 6>&1
-
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_clean_files=
 ac_config_libobj_dir=.
+LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
 # Identity of this package.
 PACKAGE_NAME='Berkeley DB'
-PACKAGE_TARNAME='db-4.3.27'
-PACKAGE_VERSION='4.3.27'
-PACKAGE_STRING='Berkeley DB 4.3.27'
-PACKAGE_BUGREPORT='support@sleepycat.com'
+PACKAGE_TARNAME='db-4.5.20'
+PACKAGE_VERSION='4.5.20'
+PACKAGE_STRING='Berkeley DB 4.5.20'
+PACKAGE_BUGREPORT='Oracle Technology Network Berkeley DB forum'
 
 ac_unique_file="../db/db.c"
-ac_default_prefix=/usr/local/BerkeleyDB.4.3
+ac_default_prefix=/usr/local/BerkeleyDB.4.5
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include 
@@ -457,17 +747,197 @@ ac_includes_default="\
 #endif
 #if HAVE_INTTYPES_H
 # include 
-#else
-# if HAVE_STDINT_H
-#  include 
-# endif
+#endif
+#if HAVE_STDINT_H
+# include 
 #endif
 #if HAVE_UNISTD_H
 # include 
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os ADDITIONAL_INCS ADDITIONAL_LANG ADDITIONAL_OBJS ADDITIONAL_PROGS BUILD_TARGET CFLAGS CONFIGURATION_ARGS CONFIGURATION_PATH CPPFLAGS CRYPTO_OBJS CXX CXXFLAGS DB_PROTO1 DB_PROTO2 DEFAULT_LIB DEFAULT_LIB_CXX INSTALLER INSTALL_LIBS INSTALL_TARGET JAR JAVACFLAGS LDFLAGS LIBJSO_LIBS LIBSO_LIBS LIBTOOL LIBTSO_LIBS LIBTSO_MODSUFFIX LIBTSO_MODULE LIBXSO_LIBS MAKEFILE_CC MAKEFILE_CCLINK MAKEFILE_CXX MAKEFILE_CXXLINK MAKEFILE_SOLINK MAKEFILE_XSOLINK OSDIR POSTLINK REPLACEMENT_OBJS RPC_CLIENT_OBJS RPC_SERVER_H SOFLAGS TEST_LIBS db_int_def o DB_VERSION_MAJOR DB_VERSION_MINOR DB_VERSION_PATCH DB_VERSION_STRING DB_VERSION_UNIQUE_NAME db_cv_path_ar ac_ct_db_cv_path_ar db_cv_path_chmod ac_ct_db_cv_path_chmod db_cv_path_cp ac_ct_db_cv_path_cp db_cv_path_ln ac_ct_db_cv_path_ln db_cv_path_mkdir ac_ct_db_cv_path_mkdir path_ranlib ac_ct_path_ranlib db_cv_path_ranlib db_cv_path_rm ac_ct_db_cv_path_rm db_cv_path_rpcgen ac_ct_db_cv_path_rpcgen path_sh ac_ct_path_sh db_cv_path_sh path_strip ac_ct_path_strip db_cv_path_strip db_cv_path_kill ac_ct_db_cv_path_kill INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA db_cv_build_type CC ac_ct_CC EXEEXT OBJEXT DB_CONST CCC ac_ct_CCC ac_ct_CXX CXXCPP cxx_have_stdheaders EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP F77 FFLAGS ac_ct_F77 SOSUFFIX MODSUFFIX JMODSUFFIX JAVAC JAVA uudecode _ACJNI_JAVAC inttypes_h_decl stdint_h_decl stddef_h_decl u_char_decl u_short_decl u_int_decl u_long_decl u_int8_decl u_int16_decl int16_decl u_int32_decl int32_decl u_int64_decl int64_decl ssize_t_decl uintmax_t_decl uintptr_t_decl LIBOBJS TCFLAGS TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_TCLSH db_seq_decl LTLIBOBJS'
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+ADDITIONAL_INCS
+ADDITIONAL_LANG
+ADDITIONAL_OBJS
+ADDITIONAL_PROGS
+BUILD_TARGET
+CFLAGS
+CONFIGURATION_ARGS
+CONFIGURATION_PATH
+CPPFLAGS
+CRYPTO_OBJS
+CXX
+CXXFLAGS
+DB_PROTO1
+DB_PROTO2
+DEFAULT_LIB
+DEFAULT_LIB_CXX
+INSTALLER
+INSTALL_LIBS
+INSTALL_TARGET
+JAR
+JAVACFLAGS
+LDFLAGS
+LIBCSO_LIBS
+LIBJSO_LIBS
+LIBSO_LIBS
+LIBTOOL
+LIBTSO_LIBS
+LIBTSO_MODSUFFIX
+LIBTSO_MODULE
+LIBXSO_LIBS
+MAKEFILE_CC
+MAKEFILE_CCLINK
+MAKEFILE_CXX
+MAKEFILE_CXXLINK
+MAKEFILE_SOLINK
+MAKEFILE_XSOLINK
+OSDIR
+POSTLINK
+REPLACEMENT_OBJS
+RPC_CLIENT_OBJS
+RPC_SERVER_H
+SOFLAGS
+SWIGCFLAGS
+TEST_LIBS
+db_int_def
+o
+platform_header
+platform_footer
+DB_VERSION_MAJOR
+DB_VERSION_MINOR
+DB_VERSION_PATCH
+DB_VERSION_STRING
+DB_VERSION_UNIQUE_NAME
+AR
+CHMOD
+CP
+KILL
+LN
+MKDIR
+RANLIB
+RM
+RPCGEN
+db_cv_path_sh
+STRIP
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CC
+ac_ct_CC
+EXEEXT
+OBJEXT
+DB_CONST
+CCC
+ac_ct_CXX
+CXXCPP
+cxx_have_stdheaders
+GREP
+EGREP
+LN_S
+ECHO
+CPP
+F77
+FFLAGS
+ac_ct_F77
+SOSUFFIX
+MODSUFFIX
+JMODSUFFIX
+JAVAC
+JAVA
+uudecode
+_ACJNI_JAVAC
+inttypes_h_decl
+stdint_h_decl
+stddef_h_decl
+unistd_h_decl
+u_char_decl
+u_short_decl
+u_int_decl
+u_long_decl
+u_int8_decl
+u_int16_decl
+int16_decl
+u_int32_decl
+int32_decl
+u_int64_decl
+int64_decl
+ssize_t_decl
+pid_t_decl
+uintmax_t_decl
+uintptr_t_decl
+thread_h_decl
+db_threadid_t_decl
+LIBOBJS
+TCL_BIN_DIR
+TCL_INCLUDE_SPEC
+TCL_LIB_FILE
+TCL_SRC_DIR
+TCL_TCLSH
+INT64_FMT
+UINT64_FMT
+db_seq_decl
+LTLIBOBJS'
 ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+CXXCPP
+CPP
+F77
+FFLAGS'
+
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -494,34 +964,48 @@ x_libraries=NONE
 # and all the variables that are supposed to be based on exec_prefix
 # by default will actually change.
 # Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -543,12 +1027,18 @@ do
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
     datadir=$ac_optarg ;;
 
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
   -disable-* | --disable-*)
     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
@@ -556,7 +1046,17 @@ do
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
+    eval enable_$ac_feature=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
@@ -565,11 +1065,7 @@ do
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
+    eval enable_$ac_feature=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -596,6 +1092,12 @@ do
   -host=* | --host=* | --hos=* | --ho=*)
     host_alias=$ac_optarg ;;
 
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
@@ -620,13 +1122,16 @@ do
   | --libexe=* | --libex=* | --libe=*)
     libexecdir=$ac_optarg ;;
 
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -691,6 +1196,16 @@ do
   | --progr-tra=* | --program-tr=* | --program-t=*)
     program_transform_name=$ac_optarg ;;
 
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
@@ -747,11 +1262,7 @@ do
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
     ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
+    eval with_$ac_package=\$ac_optarg ;;
 
   -without-* | --without-*)
     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
@@ -760,7 +1271,7 @@ do
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
     ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
+    eval with_$ac_package=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -791,8 +1302,7 @@ Try \`$0 --help' for more information." >&2
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
+    eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
@@ -812,27 +1322,19 @@ if test -n "$ac_prev"; then
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-	      localstatedir libdir includedir oldincludedir infodir mandir
+# Be sure to have absolute directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
 do
-  eval ac_val=$`echo $ac_var`
+  eval ac_val=\$$ac_var
   case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -859,94 +1361,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
 test "$silent" = yes && exec 6>/dev/null
 
 
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$0" : 'X\(//\)[^/]' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
-  fi
 fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CXX_set=${CXX+set}
-ac_env_CXX_value=$CXX
-ac_cv_env_CXX_set=${CXX+set}
-ac_cv_env_CXX_value=$CXX
-ac_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_env_CXXFLAGS_value=$CXXFLAGS
-ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_cv_env_CXXFLAGS_value=$CXXFLAGS
-ac_env_CXXCPP_set=${CXXCPP+set}
-ac_env_CXXCPP_value=$CXXCPP
-ac_cv_env_CXXCPP_set=${CXXCPP+set}
-ac_cv_env_CXXCPP_value=$CXXCPP
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-ac_env_F77_set=${F77+set}
-ac_env_F77_value=$F77
-ac_cv_env_F77_set=${F77+set}
-ac_cv_env_F77_value=$F77
-ac_env_FFLAGS_set=${FFLAGS+set}
-ac_env_FFLAGS_value=$FFLAGS
-ac_cv_env_FFLAGS_set=${FFLAGS+set}
-ac_cv_env_FFLAGS_value=$FFLAGS
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
 
 #
 # Report the --help message.
@@ -955,7 +1439,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Berkeley DB 4.3.27 to adapt to many kinds of systems.
+\`configure' configures Berkeley DB 4.5.20 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -975,9 +1459,6 @@ Configuration:
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
-
-  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
 			  [$ac_default_prefix]
@@ -995,15 +1476,22 @@ Fine tuning of the installation directories:
   --bindir=DIR           user executables [EPREFIX/bin]
   --sbindir=DIR          system admin executables [EPREFIX/sbin]
   --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
   --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
   --libdir=DIR           object code libraries [EPREFIX/lib]
   --includedir=DIR       C header files [PREFIX/include]
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/db-4.5.20]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -1021,7 +1509,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Berkeley DB 4.3.27:";;
+     short | recursive ) echo "Configuration of Berkeley DB 4.5.20:";;
    esac
   cat <<\_ACEOF
 
@@ -1046,16 +1534,16 @@ Optional Features:
   --enable-mingw          Build Berkeley DB for MinGW.
   --enable-o_direct       Enable the O_DIRECT flag for direct I/O.
   --enable-posixmutexes   Force use of POSIX standard mutexes.
+  --enable-pthread_self   Obsolete; use --enable-pthread_api instead.
+  --enable-pthread_api    Configure Berkeley DB for POSIX pthread API.
   --enable-rpc            Build RPC client/server.
   --enable-smallbuild     Build small footprint version of the library.
   --enable-tcl            Build Tcl API.
   --enable-test           Configure to run the test suite.
   --enable-uimutexes      Force use of Unix International mutexes.
   --enable-umrw           Mask harmless uninitialized memory read/writes.
-  --enable-shared[=PKGS]
-                          build shared libraries [default=yes]
-  --enable-static[=PKGS]
-                          build static libraries [default=yes]
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
@@ -1066,22 +1554,21 @@ Optional Packages:
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-mutex=MUTEX      Selection of non-standard mutexes.
   --with-mutexalign=ALIGNMENT
-                          Selection of non-standard mutex alignment.
+                          Obsolete; use DbEnv::mutex_set_align instead.
   --with-tcl=DIR          Directory location of tclConfig.sh.
   --with-uniquename=NAME  Build a uniquely named library.
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-pic              try to use only PIC/non-PIC objects [default=use
                           both]
-  --with-tags[=TAGS]
-                          include additional configurations [automatic]
+  --with-tags[=TAGS]      include additional configurations [automatic]
 
 Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L if you have libraries in a
               nonstandard directory 
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I if you have
-              headers in a nonstandard directory 
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I if
+              you have headers in a nonstandard directory 
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CXXCPP      C++ preprocessor
@@ -1092,122 +1579,88 @@ Some influential environment variables:
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
-Report bugs to .
+Report bugs to .
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
+    test -d "$ac_dir" || continue
     ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-	   test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd $ac_popdir
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Berkeley DB configure 4.3.27
-generated by GNU Autoconf 2.59
+Berkeley DB configure 4.5.20
+generated by GNU Autoconf 2.60
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
-  exit 0
+  exit
 fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Berkeley DB $as_me 4.3.27, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+It was created by Berkeley DB $as_me 4.5.20, which was
+generated by GNU Autoconf 2.60.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
+exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -1226,7 +1679,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
@@ -1240,6 +1693,7 @@ do
   test -z "$as_dir" && as_dir=.
   echo "PATH: $as_dir"
 done
+IFS=$as_save_IFS
 
 } >&5
 
@@ -1261,7 +1715,6 @@ _ACEOF
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
-ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1272,7 +1725,7 @@ do
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    *\'*)
       ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
@@ -1294,9 +1747,7 @@ do
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
+      ac_configure_args="$ac_configure_args '$ac_arg'"
       ;;
     esac
   done
@@ -1307,8 +1758,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
@@ -1321,20 +1772,34 @@ trap 'exit_status=$?
 _ASBOX
     echo
     # The following way of writing the cache mishandles newlines in values,
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
   (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       sed -n \
-	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
     *)
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-}
+    esac |
+    sort
+)
     echo
 
     cat <<\_ASBOX
@@ -1345,22 +1810,28 @@ _ASBOX
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
       cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
 _ASBOX
       echo
       for ac_var in $ac_subst_files
       do
-	eval ac_val=$`echo $ac_var`
-	echo "$ac_var='"'"'$ac_val'"'"'"
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1372,26 +1843,24 @@ _ASBOX
 ## ----------- ##
 _ASBOX
       echo
-      sed "/^$/d" confdefs.h | sort
+      cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
       echo "$as_me: caught signal $ac_signal"
     echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-     ' 0
+' 0
 for ac_signal in 1 2 13 15; do
   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1422,14 +1891,17 @@ _ACEOF
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
 fi
-for ac_site_file in $CONFIG_SITE; do
+shift
+for ac_site_file
+do
   if test -r "$ac_site_file"; then
     { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
@@ -1445,8 +1917,8 @@ if test -r "$cache_file"; then
     { echo "$as_me:$LINENO: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
     esac
   fi
 else
@@ -1458,12 +1930,11 @@ fi
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
       { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
@@ -1488,8 +1959,7 @@ echo "$as_me:   current value: $ac_new_val" >&2;}
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1506,12 +1976,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov
    { (exit 1); exit 1; }; }
 fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
 
 
 
@@ -1536,118 +2000,165 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-          ac_config_headers="$ac_config_headers db_config.h:config.hin"
+ac_config_headers="$ac_config_headers db_config.h:config.hin"
 
 
 # Configure setup.
 ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
     break
-  elif test -f $ac_dir/install.sh; then
+  elif test -f "$ac_dir/install.sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
-  elif test -f $ac_dir/shtool; then
+  elif test -f "$ac_dir/shtool"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/shtool install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
 
 # Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
   { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
-  ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 test "$program_prefix" != NONE &&
-  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
 test "$program_suffix" != NONE &&
-  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
 # Double any \ or $.  echo might interpret backslashes.
 # By default was `s,x,x', remove it if useless.
 cat <<\_ACEOF >conftest.sed
 s/[\\$]/&&/g;s/;s,x,x,$//
 _ACEOF
 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
+rm -f conftest.sed
 
 
 # Don't build in the top-level or dist directories.
-echo "$as_me:$LINENO: checking if building in the top-level or dist directories" >&5
-echo $ECHO_N "checking if building in the top-level or dist directories... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if building in the top-level or dist directories" >&5
+echo $ECHO_N "checking if building in the top-level or dist directories... $ECHO_C" >&6; }
 if  test -d db_archive -o -f configure.ac  ; then
-	echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-	{ { echo "$as_me:$LINENO: error: Berkeley DB should not be built in the top-level or dist directories." >&5
-echo "$as_me: error: Berkeley DB should not be built in the top-level or dist directories." >&2;}
+	{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	{ { echo "$as_me:$LINENO: error: \
+Berkeley DB should not be built in the top-level or \"dist\" directories. \
+Change directory to the build_unix directory and run ../dist/configure \
+from there." >&5
+echo "$as_me: error: \
+Berkeley DB should not be built in the top-level or \"dist\" directories. \
+Change directory to the build_unix directory and run ../dist/configure \
+from there." >&2;}
    { (exit 1); exit 1; }; }
+
 fi
-echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 # Substitution variables.
 
@@ -1694,6 +2205,12 @@ echo "${ECHO_T}no" >&6
 
 
 
+
+
+
+
+
+# The Windows public header has two extra symbols we need to remove.
 
 
 
@@ -1704,11 +2221,11 @@ echo "${ECHO_T}no" >&6
 
 DB_VERSION_MAJOR="4"
 
-DB_VERSION_MINOR="3"
+DB_VERSION_MINOR="5"
 
-DB_VERSION_PATCH="27"
+DB_VERSION_PATCH="20"
 
-DB_VERSION_STRING='"Sleepycat Software: Berkeley DB 4.3.27: (December 22, 2004)"'
+DB_VERSION_STRING='"Berkeley DB 4.5.20: (September 20, 2006)"'
 
 
 # Process all options before using them.
@@ -1716,285 +2233,317 @@ DB_VERSION_STRING='"Sleepycat Software: Berkeley DB 4.3.27: (December 22, 2004)"
 
 # --enable-bigfile was the configuration option that Berkeley DB used before
 # autoconf 2.50 was released (which had --enable-largefile integrated in).
-# Check whether --enable-bigfile or --disable-bigfile was given.
+# Check whether --enable-bigfile was given.
 if test "${enable_bigfile+set}" = set; then
-  enableval="$enable_bigfile"
-  { { echo "$as_me:$LINENO: error: --enable-bigfile no longer supported, use --enable-largefile" >&5
+  enableval=$enable_bigfile; { { echo "$as_me:$LINENO: error: --enable-bigfile no longer supported, use --enable-largefile" >&5
 echo "$as_me: error: --enable-bigfile no longer supported, use --enable-largefile" >&2;}
    { (exit 1); exit 1; }; }
-fi;
+fi
 
-echo "$as_me:$LINENO: checking if --disable-cryptography option specified" >&5
-echo $ECHO_N "checking if --disable-cryptography option specified... $ECHO_C" >&6
-# Check whether --enable-cryptography or --disable-cryptography was given.
-if test "${enable_cryptography+set}" = set; then
-  enableval="$enable_cryptography"
 
+{ echo "$as_me:$LINENO: checking if --disable-cryptography option specified" >&5
+echo $ECHO_N "checking if --disable-cryptography option specified... $ECHO_C" >&6; }
+# Check whether --enable-cryptography was given.
+if test "${enable_cryptography+set}" = set; then
+  enableval=$enable_cryptography;
 else
   enableval="yes"
-fi;
+fi
+
 db_cv_build_cryptography="$enableval"
 case "$enableval" in
- no) echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6;;
-yes) echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6;;
+ no) { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; };;
+yes) { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; };;
 esac
 
-echo "$as_me:$LINENO: checking if --disable-hash option specified" >&5
-echo $ECHO_N "checking if --disable-hash option specified... $ECHO_C" >&6
-# Check whether --enable-hash or --disable-hash was given.
+{ echo "$as_me:$LINENO: checking if --disable-hash option specified" >&5
+echo $ECHO_N "checking if --disable-hash option specified... $ECHO_C" >&6; }
+# Check whether --enable-hash was given.
 if test "${enable_hash+set}" = set; then
-  enableval="$enable_hash"
-
+  enableval=$enable_hash;
 else
   enableval="yes"
-fi;
+fi
+
 db_cv_build_hash="$enableval"
 case "$enableval" in
- no) echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6;;
-yes) echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6;;
+ no) { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; };;
+yes) { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; };;
 esac
 
-echo "$as_me:$LINENO: checking if --disable-queue option specified" >&5
-echo $ECHO_N "checking if --disable-queue option specified... $ECHO_C" >&6
-# Check whether --enable-queue or --disable-queue was given.
+{ echo "$as_me:$LINENO: checking if --disable-queue option specified" >&5
+echo $ECHO_N "checking if --disable-queue option specified... $ECHO_C" >&6; }
+# Check whether --enable-queue was given.
 if test "${enable_queue+set}" = set; then
-  enableval="$enable_queue"
-
+  enableval=$enable_queue;
 else
   enableval="yes"
-fi;
+fi
+
 db_cv_build_queue="$enableval"
 case "$enableval" in
- no) echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6;;
-yes) echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6;;
+ no) { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; };;
+yes) { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; };;
 esac
 
-echo "$as_me:$LINENO: checking if --disable-replication option specified" >&5
-echo $ECHO_N "checking if --disable-replication option specified... $ECHO_C" >&6
-# Check whether --enable-replication or --disable-replication was given.
+{ echo "$as_me:$LINENO: checking if --disable-replication option specified" >&5
+echo $ECHO_N "checking if --disable-replication option specified... $ECHO_C" >&6; }
+# Check whether --enable-replication was given.
 if test "${enable_replication+set}" = set; then
-  enableval="$enable_replication"
-
+  enableval=$enable_replication;
 else
   enableval="yes"
-fi;
+fi
+
 db_cv_build_replication="$enableval"
 case "$enableval" in
- no) echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6;;
-yes) echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6;;
+ no) { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; };;
+yes) { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; };;
 esac
 
-echo "$as_me:$LINENO: checking if --disable-statistics option specified" >&5
-echo $ECHO_N "checking if --disable-statistics option specified... $ECHO_C" >&6
-# Check whether --enable-statistics or --disable-statistics was given.
+{ echo "$as_me:$LINENO: checking if --disable-statistics option specified" >&5
+echo $ECHO_N "checking if --disable-statistics option specified... $ECHO_C" >&6; }
+# Check whether --enable-statistics was given.
 if test "${enable_statistics+set}" = set; then
-  enableval="$enable_statistics"
-
+  enableval=$enable_statistics;
 else
   enableval="yes"
-fi;
+fi
+
 db_cv_build_statistics="$enableval"
 case "$enableval" in
- no) echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6;;
-yes) echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6;;
+ no) { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; };;
+yes) { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; };;
 esac
 
-echo "$as_me:$LINENO: checking if --disable-verify option specified" >&5
-echo $ECHO_N "checking if --disable-verify option specified... $ECHO_C" >&6
-# Check whether --enable-verify or --disable-verify was given.
+{ echo "$as_me:$LINENO: checking if --disable-verify option specified" >&5
+echo $ECHO_N "checking if --disable-verify option specified... $ECHO_C" >&6; }
+# Check whether --enable-verify was given.
 if test "${enable_verify+set}" = set; then
-  enableval="$enable_verify"
-
+  enableval=$enable_verify;
 else
   enableval="yes"
-fi;
+fi
+
 db_cv_build_verify="$enableval"
 case "$enableval" in
- no) echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6;;
-yes) echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6;;
+ no) { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; };;
+yes) { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; };;
 esac
 
-echo "$as_me:$LINENO: checking if --enable-compat185 option specified" >&5
-echo $ECHO_N "checking if --enable-compat185 option specified... $ECHO_C" >&6
-# Check whether --enable-compat185 or --disable-compat185 was given.
+{ echo "$as_me:$LINENO: checking if --enable-compat185 option specified" >&5
+echo $ECHO_N "checking if --enable-compat185 option specified... $ECHO_C" >&6; }
+# Check whether --enable-compat185 was given.
 if test "${enable_compat185+set}" = set; then
-  enableval="$enable_compat185"
-  db_cv_compat185="$enable_compat185"
+  enableval=$enable_compat185; db_cv_compat185="$enable_compat185"
 else
   db_cv_compat185="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_compat185" >&5
-echo "${ECHO_T}$db_cv_compat185" >&6
+fi
 
-echo "$as_me:$LINENO: checking if --enable-cxx option specified" >&5
-echo $ECHO_N "checking if --enable-cxx option specified... $ECHO_C" >&6
-# Check whether --enable-cxx or --disable-cxx was given.
+{ echo "$as_me:$LINENO: result: $db_cv_compat185" >&5
+echo "${ECHO_T}$db_cv_compat185" >&6; }
+
+{ echo "$as_me:$LINENO: checking if --enable-cxx option specified" >&5
+echo $ECHO_N "checking if --enable-cxx option specified... $ECHO_C" >&6; }
+# Check whether --enable-cxx was given.
 if test "${enable_cxx+set}" = set; then
-  enableval="$enable_cxx"
-  db_cv_cxx="$enable_cxx"
+  enableval=$enable_cxx; db_cv_cxx="$enable_cxx"
 else
   db_cv_cxx="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_cxx" >&5
-echo "${ECHO_T}$db_cv_cxx" >&6
+fi
 
-echo "$as_me:$LINENO: checking if --enable-debug option specified" >&5
-echo $ECHO_N "checking if --enable-debug option specified... $ECHO_C" >&6
-# Check whether --enable-debug or --disable-debug was given.
+{ echo "$as_me:$LINENO: result: $db_cv_cxx" >&5
+echo "${ECHO_T}$db_cv_cxx" >&6; }
+
+{ echo "$as_me:$LINENO: checking if --enable-debug option specified" >&5
+echo $ECHO_N "checking if --enable-debug option specified... $ECHO_C" >&6; }
+# Check whether --enable-debug was given.
 if test "${enable_debug+set}" = set; then
-  enableval="$enable_debug"
-  db_cv_debug="$enable_debug"
+  enableval=$enable_debug; db_cv_debug="$enable_debug"
 else
   db_cv_debug="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_debug" >&5
-echo "${ECHO_T}$db_cv_debug" >&6
+fi
 
-echo "$as_me:$LINENO: checking if --enable-debug_rop option specified" >&5
-echo $ECHO_N "checking if --enable-debug_rop option specified... $ECHO_C" >&6
-# Check whether --enable-debug_rop or --disable-debug_rop was given.
+{ echo "$as_me:$LINENO: result: $db_cv_debug" >&5
+echo "${ECHO_T}$db_cv_debug" >&6; }
+
+{ echo "$as_me:$LINENO: checking if --enable-debug_rop option specified" >&5
+echo $ECHO_N "checking if --enable-debug_rop option specified... $ECHO_C" >&6; }
+# Check whether --enable-debug_rop was given.
 if test "${enable_debug_rop+set}" = set; then
-  enableval="$enable_debug_rop"
-  db_cv_debug_rop="$enable_debug_rop"
+  enableval=$enable_debug_rop; db_cv_debug_rop="$enable_debug_rop"
 else
   db_cv_debug_rop="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_debug_rop" >&5
-echo "${ECHO_T}$db_cv_debug_rop" >&6
+fi
 
-echo "$as_me:$LINENO: checking if --enable-debug_wop option specified" >&5
-echo $ECHO_N "checking if --enable-debug_wop option specified... $ECHO_C" >&6
-# Check whether --enable-debug_wop or --disable-debug_wop was given.
+{ echo "$as_me:$LINENO: result: $db_cv_debug_rop" >&5
+echo "${ECHO_T}$db_cv_debug_rop" >&6; }
+
+{ echo "$as_me:$LINENO: checking if --enable-debug_wop option specified" >&5
+echo $ECHO_N "checking if --enable-debug_wop option specified... $ECHO_C" >&6; }
+# Check whether --enable-debug_wop was given.
 if test "${enable_debug_wop+set}" = set; then
-  enableval="$enable_debug_wop"
-  db_cv_debug_wop="$enable_debug_wop"
+  enableval=$enable_debug_wop; db_cv_debug_wop="$enable_debug_wop"
 else
   db_cv_debug_wop="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_debug_wop" >&5
-echo "${ECHO_T}$db_cv_debug_wop" >&6
+fi
 
-echo "$as_me:$LINENO: checking if --enable-diagnostic option specified" >&5
-echo $ECHO_N "checking if --enable-diagnostic option specified... $ECHO_C" >&6
-# Check whether --enable-diagnostic or --disable-diagnostic was given.
+{ echo "$as_me:$LINENO: result: $db_cv_debug_wop" >&5
+echo "${ECHO_T}$db_cv_debug_wop" >&6; }
+
+{ echo "$as_me:$LINENO: checking if --enable-diagnostic option specified" >&5
+echo $ECHO_N "checking if --enable-diagnostic option specified... $ECHO_C" >&6; }
+# Check whether --enable-diagnostic was given.
 if test "${enable_diagnostic+set}" = set; then
-  enableval="$enable_diagnostic"
-  db_cv_diagnostic="$enable_diagnostic"
+  enableval=$enable_diagnostic; db_cv_diagnostic="$enable_diagnostic"
 else
   db_cv_diagnostic="no"
-fi;
+fi
+
 if test "$db_cv_diagnostic" = "yes"; then
-	echo "$as_me:$LINENO: result: $db_cv_diagnostic" >&5
-echo "${ECHO_T}$db_cv_diagnostic" >&6
+	{ echo "$as_me:$LINENO: result: $db_cv_diagnostic" >&5
+echo "${ECHO_T}$db_cv_diagnostic" >&6; }
 fi
 if test "$db_cv_diagnostic" = "no" -a "$db_cv_debug_rop" = "yes"; then
 	db_cv_diagnostic="yes"
-	echo "$as_me:$LINENO: result: by --enable-debug_rop" >&5
-echo "${ECHO_T}by --enable-debug_rop" >&6
+	{ echo "$as_me:$LINENO: result: by --enable-debug_rop" >&5
+echo "${ECHO_T}by --enable-debug_rop" >&6; }
 fi
 if test "$db_cv_diagnostic" = "no" -a "$db_cv_debug_wop" = "yes"; then
 	db_cv_diagnostic="yes"
-	echo "$as_me:$LINENO: result: by --enable-debug_wop" >&5
-echo "${ECHO_T}by --enable-debug_wop" >&6
+	{ echo "$as_me:$LINENO: result: by --enable-debug_wop" >&5
+echo "${ECHO_T}by --enable-debug_wop" >&6; }
 fi
 if test "$db_cv_diagnostic" = "no"; then
-	echo "$as_me:$LINENO: result: $db_cv_diagnostic" >&5
-echo "${ECHO_T}$db_cv_diagnostic" >&6
+	{ echo "$as_me:$LINENO: result: $db_cv_diagnostic" >&5
+echo "${ECHO_T}$db_cv_diagnostic" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking if --enable-dump185 option specified" >&5
-echo $ECHO_N "checking if --enable-dump185 option specified... $ECHO_C" >&6
-# Check whether --enable-dump185 or --disable-dump185 was given.
+{ echo "$as_me:$LINENO: checking if --enable-dump185 option specified" >&5
+echo $ECHO_N "checking if --enable-dump185 option specified... $ECHO_C" >&6; }
+# Check whether --enable-dump185 was given.
 if test "${enable_dump185+set}" = set; then
-  enableval="$enable_dump185"
-  db_cv_dump185="$enable_dump185"
+  enableval=$enable_dump185; db_cv_dump185="$enable_dump185"
 else
   db_cv_dump185="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_dump185" >&5
-echo "${ECHO_T}$db_cv_dump185" >&6
+fi
 
-echo "$as_me:$LINENO: checking if --enable-java option specified" >&5
-echo $ECHO_N "checking if --enable-java option specified... $ECHO_C" >&6
-# Check whether --enable-java or --disable-java was given.
+{ echo "$as_me:$LINENO: result: $db_cv_dump185" >&5
+echo "${ECHO_T}$db_cv_dump185" >&6; }
+
+{ echo "$as_me:$LINENO: checking if --enable-java option specified" >&5
+echo $ECHO_N "checking if --enable-java option specified... $ECHO_C" >&6; }
+# Check whether --enable-java was given.
 if test "${enable_java+set}" = set; then
-  enableval="$enable_java"
-  db_cv_java="$enable_java"
+  enableval=$enable_java; db_cv_java="$enable_java"
 else
   db_cv_java="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_java" >&5
-echo "${ECHO_T}$db_cv_java" >&6
+fi
 
-echo "$as_me:$LINENO: checking if --enable-mingw option specified" >&5
-echo $ECHO_N "checking if --enable-mingw option specified... $ECHO_C" >&6
-# Check whether --enable-mingw or --disable-mingw was given.
+{ echo "$as_me:$LINENO: result: $db_cv_java" >&5
+echo "${ECHO_T}$db_cv_java" >&6; }
+
+{ echo "$as_me:$LINENO: checking if --enable-mingw option specified" >&5
+echo $ECHO_N "checking if --enable-mingw option specified... $ECHO_C" >&6; }
+# Check whether --enable-mingw was given.
 if test "${enable_mingw+set}" = set; then
-  enableval="$enable_mingw"
-  db_cv_mingw="$enable_mingw"
+  enableval=$enable_mingw; db_cv_mingw="$enable_mingw"
 else
   db_cv_mingw="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_mingw" >&5
-echo "${ECHO_T}$db_cv_mingw" >&6
+fi
 
-echo "$as_me:$LINENO: checking if --enable-o_direct option specified" >&5
-echo $ECHO_N "checking if --enable-o_direct option specified... $ECHO_C" >&6
-# Check whether --enable-o_direct or --disable-o_direct was given.
+{ echo "$as_me:$LINENO: result: $db_cv_mingw" >&5
+echo "${ECHO_T}$db_cv_mingw" >&6; }
+
+{ echo "$as_me:$LINENO: checking if --enable-o_direct option specified" >&5
+echo $ECHO_N "checking if --enable-o_direct option specified... $ECHO_C" >&6; }
+# Check whether --enable-o_direct was given.
 if test "${enable_o_direct+set}" = set; then
-  enableval="$enable_o_direct"
-  db_cv_o_direct="$enable_o_direct"
+  enableval=$enable_o_direct; db_cv_o_direct="$enable_o_direct"
 else
   db_cv_o_direct="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_o_direct" >&5
-echo "${ECHO_T}$db_cv_o_direct" >&6
+fi
 
-echo "$as_me:$LINENO: checking if --enable-posixmutexes option specified" >&5
-echo $ECHO_N "checking if --enable-posixmutexes option specified... $ECHO_C" >&6
-# Check whether --enable-posixmutexes or --disable-posixmutexes was given.
+{ echo "$as_me:$LINENO: result: $db_cv_o_direct" >&5
+echo "${ECHO_T}$db_cv_o_direct" >&6; }
+
+{ echo "$as_me:$LINENO: checking if --enable-posixmutexes option specified" >&5
+echo $ECHO_N "checking if --enable-posixmutexes option specified... $ECHO_C" >&6; }
+# Check whether --enable-posixmutexes was given.
 if test "${enable_posixmutexes+set}" = set; then
-  enableval="$enable_posixmutexes"
-  db_cv_posixmutexes="$enable_posixmutexes"
+  enableval=$enable_posixmutexes; db_cv_posixmutexes="$enable_posixmutexes"
 else
   db_cv_posixmutexes="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_posixmutexes" >&5
-echo "${ECHO_T}$db_cv_posixmutexes" >&6
+fi
+
+{ echo "$as_me:$LINENO: result: $db_cv_posixmutexes" >&5
+echo "${ECHO_T}$db_cv_posixmutexes" >&6; }
+
+# Check whether --enable-pthread_self was given.
+if test "${enable_pthread_self+set}" = set; then
+  enableval=$enable_pthread_self; { { echo "$as_me:$LINENO: error: --enable-pthread_self no longer supported, use --enable-pthread_api" >&5
+echo "$as_me: error: --enable-pthread_self no longer supported, use --enable-pthread_api" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+{ echo "$as_me:$LINENO: checking if --enable-pthread_api option specified" >&5
+echo $ECHO_N "checking if --enable-pthread_api option specified... $ECHO_C" >&6; }
+# Check whether --enable-pthread_api was given.
+if test "${enable_pthread_api+set}" = set; then
+  enableval=$enable_pthread_api; db_cv_pthread_api="$enable_pthread_api"
+else
+  db_cv_pthread_api="no"
+fi
+
+# POSIX mutexes implies other POSIX APIs.
+if test "$db_cv_posixmutexes" != "no"; then
+	db_cv_pthread_api="yes"
+fi
+{ echo "$as_me:$LINENO: result: $db_cv_pthread_api" >&5
+echo "${ECHO_T}$db_cv_pthread_api" >&6; }
+
+
+if test "$db_cv_pthread_api" = "yes"; then
+	cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD_API 1
+_ACEOF
 
-echo "$as_me:$LINENO: checking if --enable-rpc option specified" >&5
-echo $ECHO_N "checking if --enable-rpc option specified... $ECHO_C" >&6
-# Check whether --enable-rpc or --disable-rpc was given.
+fi
+
+{ echo "$as_me:$LINENO: checking if --enable-rpc option specified" >&5
+echo $ECHO_N "checking if --enable-rpc option specified... $ECHO_C" >&6; }
+# Check whether --enable-rpc was given.
 if test "${enable_rpc+set}" = set; then
-  enableval="$enable_rpc"
-  db_cv_rpc="$enable_rpc"
+  enableval=$enable_rpc; db_cv_rpc="$enable_rpc"
 else
   db_cv_rpc="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_rpc" >&5
-echo "${ECHO_T}$db_cv_rpc" >&6
+fi
+
+{ echo "$as_me:$LINENO: result: $db_cv_rpc" >&5
+echo "${ECHO_T}$db_cv_rpc" >&6; }
 
-echo "$as_me:$LINENO: checking if --enable-smallbuild option specified" >&5
-echo $ECHO_N "checking if --enable-smallbuild option specified... $ECHO_C" >&6
-# Check whether --enable-smallbuild or --disable-smallbuild was given.
+{ echo "$as_me:$LINENO: checking if --enable-smallbuild option specified" >&5
+echo $ECHO_N "checking if --enable-smallbuild option specified... $ECHO_C" >&6; }
+# Check whether --enable-smallbuild was given.
 if test "${enable_smallbuild+set}" = set; then
-  enableval="$enable_smallbuild"
-  db_cv_smallbuild="$enable_smallbuild"
+  enableval=$enable_smallbuild; db_cv_smallbuild="$enable_smallbuild"
 else
   db_cv_smallbuild="no"
-fi;
+fi
+
 if test "$db_cv_smallbuild" = "yes"; then
 	db_cv_build_cryptography="no"
 	db_cv_build_hash="no"
@@ -2003,67 +2552,67 @@ if test "$db_cv_smallbuild" = "yes"; then
 	db_cv_build_statistics="no"
 	db_cv_build_verify="no"
 fi
-echo "$as_me:$LINENO: result: $db_cv_smallbuild" >&5
-echo "${ECHO_T}$db_cv_smallbuild" >&6
+{ echo "$as_me:$LINENO: result: $db_cv_smallbuild" >&5
+echo "${ECHO_T}$db_cv_smallbuild" >&6; }
 
-echo "$as_me:$LINENO: checking if --enable-tcl option specified" >&5
-echo $ECHO_N "checking if --enable-tcl option specified... $ECHO_C" >&6
-# Check whether --enable-tcl or --disable-tcl was given.
+{ echo "$as_me:$LINENO: checking if --enable-tcl option specified" >&5
+echo $ECHO_N "checking if --enable-tcl option specified... $ECHO_C" >&6; }
+# Check whether --enable-tcl was given.
 if test "${enable_tcl+set}" = set; then
-  enableval="$enable_tcl"
-  db_cv_tcl="$enable_tcl"
+  enableval=$enable_tcl; db_cv_tcl="$enable_tcl"
 else
   db_cv_tcl="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_tcl" >&5
-echo "${ECHO_T}$db_cv_tcl" >&6
+fi
+
+{ echo "$as_me:$LINENO: result: $db_cv_tcl" >&5
+echo "${ECHO_T}$db_cv_tcl" >&6; }
 
-echo "$as_me:$LINENO: checking if --enable-test option specified" >&5
-echo $ECHO_N "checking if --enable-test option specified... $ECHO_C" >&6
-# Check whether --enable-test or --disable-test was given.
+{ echo "$as_me:$LINENO: checking if --enable-test option specified" >&5
+echo $ECHO_N "checking if --enable-test option specified... $ECHO_C" >&6; }
+# Check whether --enable-test was given.
 if test "${enable_test+set}" = set; then
-  enableval="$enable_test"
-  db_cv_test="$enable_test"
+  enableval=$enable_test; db_cv_test="$enable_test"
 else
   db_cv_test="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_test" >&5
-echo "${ECHO_T}$db_cv_test" >&6
+fi
+
+{ echo "$as_me:$LINENO: result: $db_cv_test" >&5
+echo "${ECHO_T}$db_cv_test" >&6; }
 
-echo "$as_me:$LINENO: checking if --enable-uimutexes option specified" >&5
-echo $ECHO_N "checking if --enable-uimutexes option specified... $ECHO_C" >&6
-# Check whether --enable-uimutexes or --disable-uimutexes was given.
+{ echo "$as_me:$LINENO: checking if --enable-uimutexes option specified" >&5
+echo $ECHO_N "checking if --enable-uimutexes option specified... $ECHO_C" >&6; }
+# Check whether --enable-uimutexes was given.
 if test "${enable_uimutexes+set}" = set; then
-  enableval="$enable_uimutexes"
-  db_cv_uimutexes="$enable_uimutexes"
+  enableval=$enable_uimutexes; db_cv_uimutexes="$enable_uimutexes"
 else
   db_cv_uimutexes="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_uimutexes" >&5
-echo "${ECHO_T}$db_cv_uimutexes" >&6
+fi
+
+{ echo "$as_me:$LINENO: result: $db_cv_uimutexes" >&5
+echo "${ECHO_T}$db_cv_uimutexes" >&6; }
 
-echo "$as_me:$LINENO: checking if --enable-umrw option specified" >&5
-echo $ECHO_N "checking if --enable-umrw option specified... $ECHO_C" >&6
-# Check whether --enable-umrw or --disable-umrw was given.
+{ echo "$as_me:$LINENO: checking if --enable-umrw option specified" >&5
+echo $ECHO_N "checking if --enable-umrw option specified... $ECHO_C" >&6; }
+# Check whether --enable-umrw was given.
 if test "${enable_umrw+set}" = set; then
-  enableval="$enable_umrw"
-  db_cv_umrw="$enable_umrw"
+  enableval=$enable_umrw; db_cv_umrw="$enable_umrw"
 else
   db_cv_umrw="no"
-fi;
-echo "$as_me:$LINENO: result: $db_cv_umrw" >&5
-echo "${ECHO_T}$db_cv_umrw" >&6
+fi
+
+{ echo "$as_me:$LINENO: result: $db_cv_umrw" >&5
+echo "${ECHO_T}$db_cv_umrw" >&6; }
 
-echo "$as_me:$LINENO: checking if --with-mutex=MUTEX option specified" >&5
-echo $ECHO_N "checking if --with-mutex=MUTEX option specified... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if --with-mutex=MUTEX option specified" >&5
+echo $ECHO_N "checking if --with-mutex=MUTEX option specified... $ECHO_C" >&6; }
 
-# Check whether --with-mutex or --without-mutex was given.
+# Check whether --with-mutex was given.
 if test "${with_mutex+set}" = set; then
-  withval="$with_mutex"
-  with_mutex="$withval"
+  withval=$with_mutex; with_mutex="$withval"
 else
   with_mutex="no"
-fi;
+fi
+
 if test "$with_mutex" = "yes"; then
 	{ { echo "$as_me:$LINENO: error: --with-mutex requires a mutex name argument" >&5
 echo "$as_me: error: --with-mutex requires a mutex name argument" >&2;}
@@ -2072,75 +2621,60 @@ fi
 if test "$with_mutex" != "no"; then
 	db_cv_mutex="$with_mutex"
 fi
-echo "$as_me:$LINENO: result: $with_mutex" >&5
-echo "${ECHO_T}$with_mutex" >&6
+{ echo "$as_me:$LINENO: result: $with_mutex" >&5
+echo "${ECHO_T}$with_mutex" >&6; }
 
+# --with-mutexalign=ALIGNMENT was the configuration option that Berkeley DB
+# used before the DbEnv::mutex_set_align method was added.
 
-
-echo "$as_me:$LINENO: checking if --with-mutexalign=ALIGNMENT option specified" >&5
-echo $ECHO_N "checking if --with-mutexalign=ALIGNMENT option specified... $ECHO_C" >&6
-
-# Check whether --with-mutexalign or --without-mutexalign was given.
+# Check whether --with-mutexalign was given.
 if test "${with_mutexalign+set}" = set; then
-  withval="$with_mutexalign"
-  with_mutexalign="$withval"
-else
-  with_mutexalign="no"
-fi;
-if test "$with_mutexalign" = "yes"; then
-	{ { echo "$as_me:$LINENO: error: --with-mutexalign requires a mutex alignment argument" >&5
-echo "$as_me: error: --with-mutexalign requires a mutex alignment argument" >&2;}
+  withval=$with_mutexalign; { { echo "$as_me:$LINENO: error: --with-mutexalign no longer supported, use DbEnv::mutex_set_align" >&5
+echo "$as_me: error: --with-mutexalign no longer supported, use DbEnv::mutex_set_align" >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test "$with_mutexalign" != "no"; then
-	cat >>confdefs.h <<_ACEOF
-#define MUTEX_ALIGN $with_mutexalign
-_ACEOF
 
-fi
-echo "$as_me:$LINENO: result: $with_mutexalign" >&5
-echo "${ECHO_T}$with_mutexalign" >&6
 
-echo "$as_me:$LINENO: checking if --with-tcl=DIR option specified" >&5
-echo $ECHO_N "checking if --with-tcl=DIR option specified... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if --with-tcl=DIR option specified" >&5
+echo $ECHO_N "checking if --with-tcl=DIR option specified... $ECHO_C" >&6; }
 
-# Check whether --with-tcl or --without-tcl was given.
+# Check whether --with-tcl was given.
 if test "${with_tcl+set}" = set; then
-  withval="$with_tcl"
-  with_tclconfig="$withval"
+  withval=$with_tcl; with_tclconfig="$withval"
 else
   with_tclconfig="no"
-fi;
-echo "$as_me:$LINENO: result: $with_tclconfig" >&5
-echo "${ECHO_T}$with_tclconfig" >&6
+fi
+
+{ echo "$as_me:$LINENO: result: $with_tclconfig" >&5
+echo "${ECHO_T}$with_tclconfig" >&6; }
 if test "$with_tclconfig" != "no"; then
 	db_cv_tcl="yes"
 fi
 
-echo "$as_me:$LINENO: checking if --with-uniquename=NAME option specified" >&5
-echo $ECHO_N "checking if --with-uniquename=NAME option specified... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if --with-uniquename=NAME option specified" >&5
+echo $ECHO_N "checking if --with-uniquename=NAME option specified... $ECHO_C" >&6; }
 
-# Check whether --with-uniquename or --without-uniquename was given.
+# Check whether --with-uniquename was given.
 if test "${with_uniquename+set}" = set; then
-  withval="$with_uniquename"
-  with_uniquename="$withval"
+  withval=$with_uniquename; with_uniquename="$withval"
 else
   with_uniquename="no"
-fi;
+fi
+
 if test "$with_uniquename" = "no"; then
 	db_cv_uniquename="no"
 	DB_VERSION_UNIQUE_NAME=""
-	echo "$as_me:$LINENO: result: $with_uniquename" >&5
-echo "${ECHO_T}$with_uniquename" >&6
+	{ echo "$as_me:$LINENO: result: $with_uniquename" >&5
+echo "${ECHO_T}$with_uniquename" >&6; }
 else
 	db_cv_uniquename="yes"
 	if test "$with_uniquename" = "yes"; then
-		DB_VERSION_UNIQUE_NAME="_4003"
+		DB_VERSION_UNIQUE_NAME="_4005"
 	else
 		DB_VERSION_UNIQUE_NAME="$with_uniquename"
 	fi
-	echo "$as_me:$LINENO: result: $DB_VERSION_UNIQUE_NAME" >&5
-echo "${ECHO_T}$DB_VERSION_UNIQUE_NAME" >&6
+	{ echo "$as_me:$LINENO: result: $DB_VERSION_UNIQUE_NAME" >&5
+echo "${ECHO_T}$DB_VERSION_UNIQUE_NAME" >&6; }
 fi
 
 # Test requires Tcl
@@ -2152,25 +2686,6 @@ echo "$as_me: error: --enable-test requires --enable-tcl" >&2;}
 	fi
 fi
 
-# Uniquename excludes C++, Java, RPC.
-if test "$db_cv_uniquename" = "yes"; then
-#	if test "$db_cv_rpc" = "yes"; then
-#		{ { echo "$as_me:$LINENO: error: --with-uniquename is not compatible with --enable-rpc" >&5
-#echo "$as_me: error: --with-uniquename is not compatible with --enable-rpc" >&2;}
-#   { (exit 1); exit 1; }; }
-#	fi
-	if test "$db_cv_cxx" = "yes"; then
-		{ { echo "$as_me:$LINENO: error: --with-uniquename is not compatible with --enable-cxx" >&5
-echo "$as_me: error: --with-uniquename is not compatible with --enable-cxx" >&2;}
-   { (exit 1); exit 1; }; }
-	fi
-	if test "$db_cv_java" = "yes"; then
-		{ { echo "$as_me:$LINENO: error: --with-uniquename is not compatible with --enable-java" >&5
-echo "$as_me: error: --with-uniquename is not compatible with --enable-java" >&2;}
-   { (exit 1); exit 1; }; }
-	fi
-fi
-
 # Set some #defines based on configuration options.
 if test "$db_cv_diagnostic" = "yes"; then
 	cat >>confdefs.h <<\_ACEOF
@@ -2220,13 +2735,13 @@ fi
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_db_cv_path_ar+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$db_cv_path_ar"; then
-  ac_cv_prog_db_cv_path_ar="$db_cv_path_ar" # Let the user override the test.
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2234,37 +2749,39 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_db_cv_path_ar="${ac_tool_prefix}ar"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
-db_cv_path_ar=$ac_cv_prog_db_cv_path_ar
-if test -n "$db_cv_path_ar"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_ar" >&5
-echo "${ECHO_T}$db_cv_path_ar" >&6
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_db_cv_path_ar"; then
-  ac_ct_db_cv_path_ar=$db_cv_path_ar
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
   # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_db_cv_path_ar+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_db_cv_path_ar"; then
-  ac_cv_prog_ac_ct_db_cv_path_ar="$ac_ct_db_cv_path_ar" # Let the user override the test.
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2272,47 +2789,59 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_db_cv_path_ar="ar"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_db_cv_path_ar" && ac_cv_prog_ac_ct_db_cv_path_ar="missing_ar"
 fi
 fi
-ac_ct_db_cv_path_ar=$ac_cv_prog_ac_ct_db_cv_path_ar
-if test -n "$ac_ct_db_cv_path_ar"; then
-  echo "$as_me:$LINENO: result: $ac_ct_db_cv_path_ar" >&5
-echo "${ECHO_T}$ac_ct_db_cv_path_ar" >&6
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  db_cv_path_ar=$ac_ct_db_cv_path_ar
+  if test "x$ac_ct_AR" = x; then
+    AR="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
 else
-  db_cv_path_ar="$ac_cv_prog_db_cv_path_ar"
+  AR="$ac_cv_prog_AR"
 fi
 
-if test "$db_cv_path_ar" = missing_ar; then
-	{ { echo "$as_me:$LINENO: error: No ar utility found." >&5
+test "$AR" = "none" && { { echo "$as_me:$LINENO: error: No ar utility found." >&5
 echo "$as_me: error: No ar utility found." >&2;}
    { (exit 1); exit 1; }; }
-fi
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}chmod", so it can be a program name with args.
 set dummy ${ac_tool_prefix}chmod; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_db_cv_path_chmod+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CHMOD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$db_cv_path_chmod"; then
-  ac_cv_prog_db_cv_path_chmod="$db_cv_path_chmod" # Let the user override the test.
+  if test -n "$CHMOD"; then
+  ac_cv_prog_CHMOD="$CHMOD" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2320,37 +2849,39 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_db_cv_path_chmod="${ac_tool_prefix}chmod"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CHMOD="${ac_tool_prefix}chmod"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
-db_cv_path_chmod=$ac_cv_prog_db_cv_path_chmod
-if test -n "$db_cv_path_chmod"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_chmod" >&5
-echo "${ECHO_T}$db_cv_path_chmod" >&6
+CHMOD=$ac_cv_prog_CHMOD
+if test -n "$CHMOD"; then
+  { echo "$as_me:$LINENO: result: $CHMOD" >&5
+echo "${ECHO_T}$CHMOD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_db_cv_path_chmod"; then
-  ac_ct_db_cv_path_chmod=$db_cv_path_chmod
+if test -z "$ac_cv_prog_CHMOD"; then
+  ac_ct_CHMOD=$CHMOD
   # Extract the first word of "chmod", so it can be a program name with args.
 set dummy chmod; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_db_cv_path_chmod+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CHMOD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_db_cv_path_chmod"; then
-  ac_cv_prog_ac_ct_db_cv_path_chmod="$ac_ct_db_cv_path_chmod" # Let the user override the test.
+  if test -n "$ac_ct_CHMOD"; then
+  ac_cv_prog_ac_ct_CHMOD="$ac_ct_CHMOD" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2358,47 +2889,59 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_db_cv_path_chmod="chmod"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CHMOD="chmod"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_db_cv_path_chmod" && ac_cv_prog_ac_ct_db_cv_path_chmod="missing_chmod"
 fi
 fi
-ac_ct_db_cv_path_chmod=$ac_cv_prog_ac_ct_db_cv_path_chmod
-if test -n "$ac_ct_db_cv_path_chmod"; then
-  echo "$as_me:$LINENO: result: $ac_ct_db_cv_path_chmod" >&5
-echo "${ECHO_T}$ac_ct_db_cv_path_chmod" >&6
+ac_ct_CHMOD=$ac_cv_prog_ac_ct_CHMOD
+if test -n "$ac_ct_CHMOD"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CHMOD" >&5
+echo "${ECHO_T}$ac_ct_CHMOD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  db_cv_path_chmod=$ac_ct_db_cv_path_chmod
+  if test "x$ac_ct_CHMOD" = x; then
+    CHMOD="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CHMOD=$ac_ct_CHMOD
+  fi
 else
-  db_cv_path_chmod="$ac_cv_prog_db_cv_path_chmod"
+  CHMOD="$ac_cv_prog_CHMOD"
 fi
 
-if test "$db_cv_path_chmod" = missing_chmod; then
-	{ { echo "$as_me:$LINENO: error: No chmod utility found." >&5
+test "$CHMOD" = "none" && { { echo "$as_me:$LINENO: error: No chmod utility found." >&5
 echo "$as_me: error: No chmod utility found." >&2;}
    { (exit 1); exit 1; }; }
-fi
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}cp", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cp; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_db_cv_path_cp+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$db_cv_path_cp"; then
-  ac_cv_prog_db_cv_path_cp="$db_cv_path_cp" # Let the user override the test.
+  if test -n "$CP"; then
+  ac_cv_prog_CP="$CP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2406,37 +2949,39 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_db_cv_path_cp="${ac_tool_prefix}cp"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CP="${ac_tool_prefix}cp"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
-db_cv_path_cp=$ac_cv_prog_db_cv_path_cp
-if test -n "$db_cv_path_cp"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_cp" >&5
-echo "${ECHO_T}$db_cv_path_cp" >&6
+CP=$ac_cv_prog_CP
+if test -n "$CP"; then
+  { echo "$as_me:$LINENO: result: $CP" >&5
+echo "${ECHO_T}$CP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_db_cv_path_cp"; then
-  ac_ct_db_cv_path_cp=$db_cv_path_cp
+if test -z "$ac_cv_prog_CP"; then
+  ac_ct_CP=$CP
   # Extract the first word of "cp", so it can be a program name with args.
 set dummy cp; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_db_cv_path_cp+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_db_cv_path_cp"; then
-  ac_cv_prog_ac_ct_db_cv_path_cp="$ac_ct_db_cv_path_cp" # Let the user override the test.
+  if test -n "$ac_ct_CP"; then
+  ac_cv_prog_ac_ct_CP="$ac_ct_CP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2444,47 +2989,61 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_db_cv_path_cp="cp"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CP="cp"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_db_cv_path_cp" && ac_cv_prog_ac_ct_db_cv_path_cp="missing_cp"
 fi
 fi
-ac_ct_db_cv_path_cp=$ac_cv_prog_ac_ct_db_cv_path_cp
-if test -n "$ac_ct_db_cv_path_cp"; then
-  echo "$as_me:$LINENO: result: $ac_ct_db_cv_path_cp" >&5
-echo "${ECHO_T}$ac_ct_db_cv_path_cp" >&6
+ac_ct_CP=$ac_cv_prog_ac_ct_CP
+if test -n "$ac_ct_CP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CP" >&5
+echo "${ECHO_T}$ac_ct_CP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  db_cv_path_cp=$ac_ct_db_cv_path_cp
+  if test "x$ac_ct_CP" = x; then
+    CP="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CP=$ac_ct_CP
+  fi
 else
-  db_cv_path_cp="$ac_cv_prog_db_cv_path_cp"
+  CP="$ac_cv_prog_CP"
 fi
 
-if test "$db_cv_path_cp" = missing_cp; then
-	{ { echo "$as_me:$LINENO: error: No cp utility found." >&5
+test "$CP" = "none" && { { echo "$as_me:$LINENO: error: No cp utility found." >&5
 echo "$as_me: error: No cp utility found." >&2;}
    { (exit 1); exit 1; }; }
-fi
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ln", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ln; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_db_cv_path_ln+set}" = set; then
+# The Tcl test suite requires a kill utility.
+if test "$db_cv_test" = "yes"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}kill", so it can be a program name with args.
+set dummy ${ac_tool_prefix}kill; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_KILL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$db_cv_path_ln"; then
-  ac_cv_prog_db_cv_path_ln="$db_cv_path_ln" # Let the user override the test.
+  if test -n "$KILL"; then
+  ac_cv_prog_KILL="$KILL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2492,37 +3051,39 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_db_cv_path_ln="${ac_tool_prefix}ln"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_KILL="${ac_tool_prefix}kill"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
-db_cv_path_ln=$ac_cv_prog_db_cv_path_ln
-if test -n "$db_cv_path_ln"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_ln" >&5
-echo "${ECHO_T}$db_cv_path_ln" >&6
+KILL=$ac_cv_prog_KILL
+if test -n "$KILL"; then
+  { echo "$as_me:$LINENO: result: $KILL" >&5
+echo "${ECHO_T}$KILL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_db_cv_path_ln"; then
-  ac_ct_db_cv_path_ln=$db_cv_path_ln
-  # Extract the first word of "ln", so it can be a program name with args.
-set dummy ln; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_db_cv_path_ln+set}" = set; then
+if test -z "$ac_cv_prog_KILL"; then
+  ac_ct_KILL=$KILL
+  # Extract the first word of "kill", so it can be a program name with args.
+set dummy kill; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_KILL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_db_cv_path_ln"; then
-  ac_cv_prog_ac_ct_db_cv_path_ln="$ac_ct_db_cv_path_ln" # Let the user override the test.
+  if test -n "$ac_ct_KILL"; then
+  ac_cv_prog_ac_ct_KILL="$ac_ct_KILL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2530,47 +3091,60 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_db_cv_path_ln="ln"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_KILL="kill"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_db_cv_path_ln" && ac_cv_prog_ac_ct_db_cv_path_ln="missing_ln"
 fi
 fi
-ac_ct_db_cv_path_ln=$ac_cv_prog_ac_ct_db_cv_path_ln
-if test -n "$ac_ct_db_cv_path_ln"; then
-  echo "$as_me:$LINENO: result: $ac_ct_db_cv_path_ln" >&5
-echo "${ECHO_T}$ac_ct_db_cv_path_ln" >&6
+ac_ct_KILL=$ac_cv_prog_ac_ct_KILL
+if test -n "$ac_ct_KILL"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_KILL" >&5
+echo "${ECHO_T}$ac_ct_KILL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  db_cv_path_ln=$ac_ct_db_cv_path_ln
+  if test "x$ac_ct_KILL" = x; then
+    KILL="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    KILL=$ac_ct_KILL
+  fi
 else
-  db_cv_path_ln="$ac_cv_prog_db_cv_path_ln"
+  KILL="$ac_cv_prog_KILL"
 fi
 
-if test "$db_cv_path_ln" = missing_ln; then
-	{ { echo "$as_me:$LINENO: error: No ln utility found." >&5
-echo "$as_me: error: No ln utility found." >&2;}
+	test "$KILL" = "none" && { { echo "$as_me:$LINENO: error: No kill utility found." >&5
+echo "$as_me: error: No kill utility found." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}mkdir", so it can be a program name with args.
-set dummy ${ac_tool_prefix}mkdir; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_db_cv_path_mkdir+set}" = set; then
+  # Extract the first word of "${ac_tool_prefix}ln", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ln; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_LN+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$db_cv_path_mkdir"; then
-  ac_cv_prog_db_cv_path_mkdir="$db_cv_path_mkdir" # Let the user override the test.
+  if test -n "$LN"; then
+  ac_cv_prog_LN="$LN" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2578,37 +3152,39 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_db_cv_path_mkdir="${ac_tool_prefix}mkdir"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LN="${ac_tool_prefix}ln"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
-db_cv_path_mkdir=$ac_cv_prog_db_cv_path_mkdir
-if test -n "$db_cv_path_mkdir"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_mkdir" >&5
-echo "${ECHO_T}$db_cv_path_mkdir" >&6
+LN=$ac_cv_prog_LN
+if test -n "$LN"; then
+  { echo "$as_me:$LINENO: result: $LN" >&5
+echo "${ECHO_T}$LN" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_db_cv_path_mkdir"; then
-  ac_ct_db_cv_path_mkdir=$db_cv_path_mkdir
-  # Extract the first word of "mkdir", so it can be a program name with args.
-set dummy mkdir; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_db_cv_path_mkdir+set}" = set; then
+if test -z "$ac_cv_prog_LN"; then
+  ac_ct_LN=$LN
+  # Extract the first word of "ln", so it can be a program name with args.
+set dummy ln; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_LN+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_db_cv_path_mkdir"; then
-  ac_cv_prog_ac_ct_db_cv_path_mkdir="$ac_ct_db_cv_path_mkdir" # Let the user override the test.
+  if test -n "$ac_ct_LN"; then
+  ac_cv_prog_ac_ct_LN="$ac_ct_LN" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2616,49 +3192,59 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_db_cv_path_mkdir="mkdir"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LN="ln"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_db_cv_path_mkdir" && ac_cv_prog_ac_ct_db_cv_path_mkdir="missing_mkdir"
 fi
 fi
-ac_ct_db_cv_path_mkdir=$ac_cv_prog_ac_ct_db_cv_path_mkdir
-if test -n "$ac_ct_db_cv_path_mkdir"; then
-  echo "$as_me:$LINENO: result: $ac_ct_db_cv_path_mkdir" >&5
-echo "${ECHO_T}$ac_ct_db_cv_path_mkdir" >&6
+ac_ct_LN=$ac_cv_prog_ac_ct_LN
+if test -n "$ac_ct_LN"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_LN" >&5
+echo "${ECHO_T}$ac_ct_LN" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  db_cv_path_mkdir=$ac_ct_db_cv_path_mkdir
+  if test "x$ac_ct_LN" = x; then
+    LN="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    LN=$ac_ct_LN
+  fi
 else
-  db_cv_path_mkdir="$ac_cv_prog_db_cv_path_mkdir"
+  LN="$ac_cv_prog_LN"
 fi
 
-if test "$db_cv_path_mkdir" = missing_mkdir; then
-	{ { echo "$as_me:$LINENO: error: No mkdir utility found." >&5
-echo "$as_me: error: No mkdir utility found." >&2;}
+test "$LN" = "none" && { { echo "$as_me:$LINENO: error: No ln utility found." >&5
+echo "$as_me: error: No ln utility found." >&2;}
    { (exit 1); exit 1; }; }
-fi
 
-# We need a complete path for ranlib, because it doesn't exist on some
-# architectures because the ar utility packages the library itself.
 if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_path_ranlib+set}" = set; then
+  # Extract the first word of "${ac_tool_prefix}mkdir", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mkdir; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_MKDIR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$path_ranlib"; then
-  ac_cv_prog_path_ranlib="$path_ranlib" # Let the user override the test.
+  if test -n "$MKDIR"; then
+  ac_cv_prog_MKDIR="$MKDIR" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2666,37 +3252,39 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_path_ranlib="${ac_tool_prefix}ranlib"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_MKDIR="${ac_tool_prefix}mkdir"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
-path_ranlib=$ac_cv_prog_path_ranlib
-if test -n "$path_ranlib"; then
-  echo "$as_me:$LINENO: result: $path_ranlib" >&5
-echo "${ECHO_T}$path_ranlib" >&6
+MKDIR=$ac_cv_prog_MKDIR
+if test -n "$MKDIR"; then
+  { echo "$as_me:$LINENO: result: $MKDIR" >&5
+echo "${ECHO_T}$MKDIR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_path_ranlib"; then
-  ac_ct_path_ranlib=$path_ranlib
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_path_ranlib+set}" = set; then
+if test -z "$ac_cv_prog_MKDIR"; then
+  ac_ct_MKDIR=$MKDIR
+  # Extract the first word of "mkdir", so it can be a program name with args.
+set dummy mkdir; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_MKDIR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_path_ranlib"; then
-  ac_cv_prog_ac_ct_path_ranlib="$ac_ct_path_ranlib" # Let the user override the test.
+  if test -n "$ac_ct_MKDIR"; then
+  ac_cv_prog_ac_ct_MKDIR="$ac_ct_MKDIR" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2704,120 +3292,101 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_path_ranlib="ranlib"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_MKDIR="mkdir"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_path_ranlib" && ac_cv_prog_ac_ct_path_ranlib="missing_ranlib"
 fi
 fi
-ac_ct_path_ranlib=$ac_cv_prog_ac_ct_path_ranlib
-if test -n "$ac_ct_path_ranlib"; then
-  echo "$as_me:$LINENO: result: $ac_ct_path_ranlib" >&5
-echo "${ECHO_T}$ac_ct_path_ranlib" >&6
+ac_ct_MKDIR=$ac_cv_prog_ac_ct_MKDIR
+if test -n "$ac_ct_MKDIR"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_MKDIR" >&5
+echo "${ECHO_T}$ac_ct_MKDIR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  path_ranlib=$ac_ct_path_ranlib
+  if test "x$ac_ct_MKDIR" = x; then
+    MKDIR="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    MKDIR=$ac_ct_MKDIR
+  fi
 else
-  path_ranlib="$ac_cv_prog_path_ranlib"
+  MKDIR="$ac_cv_prog_MKDIR"
 fi
 
-# Extract the first word of "$path_ranlib", so it can be a program name with args.
-set dummy $path_ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_db_cv_path_ranlib+set}" = set; then
+test "$MKDIR" = "none" && { { echo "$as_me:$LINENO: error: No mkdir utility found." >&5
+echo "$as_me: error: No mkdir utility found." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Ranlib doesn't exist on some architectures because the ar utility
+# packages the library itself.
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $db_cv_path_ranlib in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_db_cv_path_ranlib="$db_cv_path_ranlib" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_db_cv_path_ranlib="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_db_cv_path_ranlib" && ac_cv_path_db_cv_path_ranlib="missing_ranlib"
-  ;;
-esac
 fi
-db_cv_path_ranlib=$ac_cv_path_db_cv_path_ranlib
-
-if test -n "$db_cv_path_ranlib"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_ranlib" >&5
-echo "${ECHO_T}$db_cv_path_ranlib" >&6
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}rm", so it can be a program name with args.
-set dummy ${ac_tool_prefix}rm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_db_cv_path_rm+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$db_cv_path_rm"; then
-  ac_cv_prog_db_cv_path_rm="$db_cv_path_rm" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_db_cv_path_rm="${ac_tool_prefix}rm"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-db_cv_path_rm=$ac_cv_prog_db_cv_path_rm
-if test -n "$db_cv_path_rm"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_rm" >&5
-echo "${ECHO_T}$db_cv_path_rm" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
 fi
-
-fi
-if test -z "$ac_cv_prog_db_cv_path_rm"; then
-  ac_ct_db_cv_path_rm=$db_cv_path_rm
-  # Extract the first word of "rm", so it can be a program name with args.
-set dummy rm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_db_cv_path_rm+set}" = set; then
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_db_cv_path_rm"; then
-  ac_cv_prog_ac_ct_db_cv_path_rm="$ac_ct_db_cv_path_rm" # Let the user override the test.
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2825,48 +3394,56 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_db_cv_path_rm="rm"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_db_cv_path_rm" && ac_cv_prog_ac_ct_db_cv_path_rm="missing_rm"
 fi
 fi
-ac_ct_db_cv_path_rm=$ac_cv_prog_ac_ct_db_cv_path_rm
-if test -n "$ac_ct_db_cv_path_rm"; then
-  echo "$as_me:$LINENO: result: $ac_ct_db_cv_path_rm" >&5
-echo "${ECHO_T}$ac_ct_db_cv_path_rm" >&6
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  db_cv_path_rm=$ac_ct_db_cv_path_rm
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
 else
-  db_cv_path_rm="$ac_cv_prog_db_cv_path_rm"
+  RANLIB="$ac_cv_prog_RANLIB"
 fi
 
-if test "$db_cv_path_rm" = missing_rm; then
-	{ { echo "$as_me:$LINENO: error: No rm utility found." >&5
-echo "$as_me: error: No rm utility found." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
-if test "$db_cv_rpc" = "yes"; then
-	if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}rpcgen", so it can be a program name with args.
-set dummy ${ac_tool_prefix}rpcgen; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_db_cv_path_rpcgen+set}" = set; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}rm", so it can be a program name with args.
+set dummy ${ac_tool_prefix}rm; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RM+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$db_cv_path_rpcgen"; then
-  ac_cv_prog_db_cv_path_rpcgen="$db_cv_path_rpcgen" # Let the user override the test.
+  if test -n "$RM"; then
+  ac_cv_prog_RM="$RM" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2874,37 +3451,39 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_db_cv_path_rpcgen="${ac_tool_prefix}rpcgen"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RM="${ac_tool_prefix}rm"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
-db_cv_path_rpcgen=$ac_cv_prog_db_cv_path_rpcgen
-if test -n "$db_cv_path_rpcgen"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_rpcgen" >&5
-echo "${ECHO_T}$db_cv_path_rpcgen" >&6
+RM=$ac_cv_prog_RM
+if test -n "$RM"; then
+  { echo "$as_me:$LINENO: result: $RM" >&5
+echo "${ECHO_T}$RM" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_db_cv_path_rpcgen"; then
-  ac_ct_db_cv_path_rpcgen=$db_cv_path_rpcgen
-  # Extract the first word of "rpcgen", so it can be a program name with args.
-set dummy rpcgen; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_db_cv_path_rpcgen+set}" = set; then
+if test -z "$ac_cv_prog_RM"; then
+  ac_ct_RM=$RM
+  # Extract the first word of "rm", so it can be a program name with args.
+set dummy rm; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RM+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_db_cv_path_rpcgen"; then
-  ac_cv_prog_ac_ct_db_cv_path_rpcgen="$ac_ct_db_cv_path_rpcgen" # Let the user override the test.
+  if test -n "$ac_ct_RM"; then
+  ac_cv_prog_ac_ct_RM="$ac_ct_RM" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2912,50 +3491,60 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_db_cv_path_rpcgen="rpcgen"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RM="rm"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_db_cv_path_rpcgen" && ac_cv_prog_ac_ct_db_cv_path_rpcgen="missing_rpcgen"
 fi
 fi
-ac_ct_db_cv_path_rpcgen=$ac_cv_prog_ac_ct_db_cv_path_rpcgen
-if test -n "$ac_ct_db_cv_path_rpcgen"; then
-  echo "$as_me:$LINENO: result: $ac_ct_db_cv_path_rpcgen" >&5
-echo "${ECHO_T}$ac_ct_db_cv_path_rpcgen" >&6
+ac_ct_RM=$ac_cv_prog_ac_ct_RM
+if test -n "$ac_ct_RM"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RM" >&5
+echo "${ECHO_T}$ac_ct_RM" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  db_cv_path_rpcgen=$ac_ct_db_cv_path_rpcgen
+  if test "x$ac_ct_RM" = x; then
+    RM="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RM=$ac_ct_RM
+  fi
 else
-  db_cv_path_rpcgen="$ac_cv_prog_db_cv_path_rpcgen"
+  RM="$ac_cv_prog_RM"
 fi
 
-	if test "$db_cv_path_rpcgen" = missing_rpcgen; then
-		{ { echo "$as_me:$LINENO: error: No rpcgen utility found." >&5
-echo "$as_me: error: No rpcgen utility found." >&2;}
+test "$RM" = "none" && { { echo "$as_me:$LINENO: error: No rm utility found." >&5
+echo "$as_me: error: No rm utility found." >&2;}
    { (exit 1); exit 1; }; }
-	fi
-fi
 
-# We need a complete path for sh, because some implementations of make
-# get upset if SHELL is set to just the command name.
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}sh", so it can be a program name with args.
-set dummy ${ac_tool_prefix}sh; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_path_sh+set}" = set; then
+if test "$db_cv_rpc" = "yes"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}rpcgen", so it can be a program name with args.
+set dummy ${ac_tool_prefix}rpcgen; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RPCGEN+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$path_sh"; then
-  ac_cv_prog_path_sh="$path_sh" # Let the user override the test.
+  if test -n "$RPCGEN"; then
+  ac_cv_prog_RPCGEN="$RPCGEN" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2963,37 +3552,39 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_path_sh="${ac_tool_prefix}sh"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RPCGEN="${ac_tool_prefix}rpcgen"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
-path_sh=$ac_cv_prog_path_sh
-if test -n "$path_sh"; then
-  echo "$as_me:$LINENO: result: $path_sh" >&5
-echo "${ECHO_T}$path_sh" >&6
+RPCGEN=$ac_cv_prog_RPCGEN
+if test -n "$RPCGEN"; then
+  { echo "$as_me:$LINENO: result: $RPCGEN" >&5
+echo "${ECHO_T}$RPCGEN" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_path_sh"; then
-  ac_ct_path_sh=$path_sh
-  # Extract the first word of "sh", so it can be a program name with args.
-set dummy sh; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_path_sh+set}" = set; then
+if test -z "$ac_cv_prog_RPCGEN"; then
+  ac_ct_RPCGEN=$RPCGEN
+  # Extract the first word of "rpcgen", so it can be a program name with args.
+set dummy rpcgen; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RPCGEN+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_path_sh"; then
-  ac_cv_prog_ac_ct_path_sh="$ac_ct_path_sh" # Let the user override the test.
+  if test -n "$ac_ct_RPCGEN"; then
+  ac_cv_prog_ac_ct_RPCGEN="$ac_ct_RPCGEN" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -3001,35 +3592,59 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_path_sh="sh"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RPCGEN="rpcgen"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_path_sh" && ac_cv_prog_ac_ct_path_sh="missing_sh"
 fi
 fi
-ac_ct_path_sh=$ac_cv_prog_ac_ct_path_sh
-if test -n "$ac_ct_path_sh"; then
-  echo "$as_me:$LINENO: result: $ac_ct_path_sh" >&5
-echo "${ECHO_T}$ac_ct_path_sh" >&6
+ac_ct_RPCGEN=$ac_cv_prog_ac_ct_RPCGEN
+if test -n "$ac_ct_RPCGEN"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RPCGEN" >&5
+echo "${ECHO_T}$ac_ct_RPCGEN" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  path_sh=$ac_ct_path_sh
+  if test "x$ac_ct_RPCGEN" = x; then
+    RPCGEN="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RPCGEN=$ac_ct_RPCGEN
+  fi
 else
-  path_sh="$ac_cv_prog_path_sh"
+  RPCGEN="$ac_cv_prog_RPCGEN"
+fi
+
+	test "$RPCGEN" = "none" && { { echo "$as_me:$LINENO: error: No rpcgen utility found." >&5
+echo "$as_me: error: No rpcgen utility found." >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
-# Extract the first word of "$path_sh", so it can be a program name with args.
-set dummy $path_sh; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+# We need a complete path for sh, because some make utility implementations get
+# upset if SHELL is set to just the command name.  Don't use the SHELL variable
+# here because the user likely has the SHELL variable set to something other
+# than the Bourne shell, which is what Make wants.
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}sh", so it can be a program name with args.
+set dummy ${ac_tool_prefix}sh; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_db_cv_path_sh+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3044,128 +3659,41 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_db_cv_path_sh="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_db_cv_path_sh" && ac_cv_path_db_cv_path_sh="missing_sh"
   ;;
 esac
 fi
 db_cv_path_sh=$ac_cv_path_db_cv_path_sh
-
 if test -n "$db_cv_path_sh"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_sh" >&5
-echo "${ECHO_T}$db_cv_path_sh" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-if test "$db_cv_path_sh" = missing_sh; then
-	{ { echo "$as_me:$LINENO: error: No sh utility found." >&5
-echo "$as_me: error: No sh utility found." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-# Don't strip the binaries if --enable-debug was specified.
-if test "$db_cv_debug" = yes; then
-	db_cv_path_strip=debug_build_no_strip
-else
-	if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_path_strip+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$path_strip"; then
-  ac_cv_prog_path_strip="$path_strip" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_path_strip="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-path_strip=$ac_cv_prog_path_strip
-if test -n "$path_strip"; then
-  echo "$as_me:$LINENO: result: $path_strip" >&5
-echo "${ECHO_T}$path_strip" >&6
+  { echo "$as_me:$LINENO: result: $db_cv_path_sh" >&5
+echo "${ECHO_T}$db_cv_path_sh" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-if test -z "$ac_cv_prog_path_strip"; then
-  ac_ct_path_strip=$path_strip
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_path_strip+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_path_strip"; then
-  ac_cv_prog_ac_ct_path_strip="$ac_ct_path_strip" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_path_strip="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  test -z "$ac_cv_prog_ac_ct_path_strip" && ac_cv_prog_ac_ct_path_strip="missing_strip"
-fi
-fi
-ac_ct_path_strip=$ac_cv_prog_ac_ct_path_strip
-if test -n "$ac_ct_path_strip"; then
-  echo "$as_me:$LINENO: result: $ac_ct_path_strip" >&5
-echo "${ECHO_T}$ac_ct_path_strip" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-  path_strip=$ac_ct_path_strip
-else
-  path_strip="$ac_cv_prog_path_strip"
 fi
-
-	# Extract the first word of "$path_strip", so it can be a program name with args.
-set dummy $path_strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_db_cv_path_strip+set}" = set; then
+if test -z "$ac_cv_path_db_cv_path_sh"; then
+  ac_pt_db_cv_path_sh=$db_cv_path_sh
+  # Extract the first word of "sh", so it can be a program name with args.
+set dummy sh; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_db_cv_path_sh+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $db_cv_path_strip in
+  case $ac_pt_db_cv_path_sh in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_db_cv_path_strip="$db_cv_path_strip" # Let the user override the test with a path.
+  ac_cv_path_ac_pt_db_cv_path_sh="$ac_pt_db_cv_path_sh" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3174,41 +3702,64 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_db_cv_path_strip="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_db_cv_path_sh="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_db_cv_path_strip" && ac_cv_path_db_cv_path_strip="missing_strip"
   ;;
 esac
 fi
-db_cv_path_strip=$ac_cv_path_db_cv_path_strip
-
-if test -n "$db_cv_path_strip"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_strip" >&5
-echo "${ECHO_T}$db_cv_path_strip" >&6
+ac_pt_db_cv_path_sh=$ac_cv_path_ac_pt_db_cv_path_sh
+if test -n "$ac_pt_db_cv_path_sh"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_db_cv_path_sh" >&5
+echo "${ECHO_T}$ac_pt_db_cv_path_sh" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+  if test "x$ac_pt_db_cv_path_sh" = x; then
+    db_cv_path_sh="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    db_cv_path_sh=$ac_pt_db_cv_path_sh
+  fi
+else
+  db_cv_path_sh="$ac_cv_path_db_cv_path_sh"
 fi
 
-if test "$db_cv_test" = "yes"; then
+test "$db_cv_path_sh" = "none" && { { echo "$as_me:$LINENO: error: No sh utility found." >&5
+echo "$as_me: error: No sh utility found." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Don't strip the binaries if --enable-debug was specified.
+if test "$db_cv_debug" = yes; then
+	STRIP="none"
+else
 	if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}kill", so it can be a program name with args.
-set dummy ${ac_tool_prefix}kill; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_db_cv_path_kill+set}" = set; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$db_cv_path_kill"; then
-  ac_cv_prog_db_cv_path_kill="$db_cv_path_kill" # Let the user override the test.
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -3216,37 +3767,39 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_db_cv_path_kill="${ac_tool_prefix}kill"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
-db_cv_path_kill=$ac_cv_prog_db_cv_path_kill
-if test -n "$db_cv_path_kill"; then
-  echo "$as_me:$LINENO: result: $db_cv_path_kill" >&5
-echo "${ECHO_T}$db_cv_path_kill" >&6
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_db_cv_path_kill"; then
-  ac_ct_db_cv_path_kill=$db_cv_path_kill
-  # Extract the first word of "kill", so it can be a program name with args.
-set dummy kill; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_db_cv_path_kill+set}" = set; then
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_db_cv_path_kill"; then
-  ac_cv_prog_ac_ct_db_cv_path_kill="$ac_ct_db_cv_path_kill" # Let the user override the test.
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -3254,39 +3807,48 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_db_cv_path_kill="kill"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_db_cv_path_kill" && ac_cv_prog_ac_ct_db_cv_path_kill="missing_kill"
 fi
 fi
-ac_ct_db_cv_path_kill=$ac_cv_prog_ac_ct_db_cv_path_kill
-if test -n "$ac_ct_db_cv_path_kill"; then
-  echo "$as_me:$LINENO: result: $ac_ct_db_cv_path_kill" >&5
-echo "${ECHO_T}$ac_ct_db_cv_path_kill" >&6
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  db_cv_path_kill=$ac_ct_db_cv_path_kill
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP="none"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
 else
-  db_cv_path_kill="$ac_cv_prog_db_cv_path_kill"
+  STRIP="$ac_cv_prog_STRIP"
 fi
 
-	if test "$db_cv_path_kill" = missing_kill; then
-		{ { echo "$as_me:$LINENO: error: No kill utility found." >&5
-echo "$as_me: error: No kill utility found." >&2;}
-   { (exit 1); exit 1; }; }
-	fi
+	test "$STRIP" = "none" && { echo "$as_me:$LINENO: WARNING: No strip utility found." >&5
+echo "$as_me: WARNING: No strip utility found." >&2;}
 fi
-
-
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
@@ -3300,8 +3862,8 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3323,7 +3885,7 @@ case $as_dir/ in
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -3342,21 +3904,22 @@ case $as_dir/ in
     ;;
 esac
 done
+IFS=$as_save_IFS
 
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
     INSTALL=$ac_cv_path_install
   else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -3384,15 +3947,15 @@ INSTALL_TARGET="library_install"
 # because the makefile CC may be set to use $(LIBTOOL).
 #
 # Don't override anything if it's already set from the environment.
-optimize_def="-O"
+optimize_debug="-O"
 case "$host_os" in
 aix4.3.*|aix5*)
-	optimize_def="-O2"
+	optimize_debug="-O2"
 	CC=${CC-"xlc_r"}
 	CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
 	LDFLAGS="$LDFLAGS -Wl,-brtl";;
 bsdi3*)	CC=${CC-"shlicc2"}
-	LIBS="$LIBS -lipc";;
+	LIBSO_LIBS="$LIBSO_LIBS -lipc";;
 cygwin*)
 	CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
 freebsd*)
@@ -3401,10 +3964,10 @@ freebsd*)
 gnu*|k*bsd*-gnu|linux*)
 	CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
 hpux*)	CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
-irix*)	optimize_def="-O2"
+irix*)	optimize_debug="-O2"
 	CPPFLAGS="$CPPFLAGS -D_SGI_MP_SOURCE";;
 mpeix*)	CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_SOCKET_SOURCE"
-	LIBS="$LIBS -lsocket -lsvipc";;
+	LIBSO_LIBS="$LIBSO_LIBS -lsocket -lsvipc";;
 osf*)	CPPFLAGS="$CPPFLAGS -pthread";;
 *qnx*)	cat >>confdefs.h <<\_ACEOF
 #define HAVE_QNX 1
@@ -3413,20 +3976,14 @@ _ACEOF
 
 ;;
 solaris*)
-	CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
+	CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS ";;
 esac
 
-# Set CFLAGS/CXXFLAGS.  We MUST set the flags before we call autoconf
-# compiler configuration macros, because if we don't, they set CFLAGS
-# to no optimization and -g, which isn't what we want.
-CFLAGS=${CFLAGS-$optimize_def}
-CXXFLAGS=${CXXFLAGS-"$CFLAGS"}
-
-# If the user wants a debugging environment, add -g to the CFLAGS value.
-#
-# XXX
-# Some compilers can't mix optimizing and debug flags.  The only way to
-# handle this is to specify CFLAGS in the environment before configuring.
+# If the user wants a debugging environment, change any compiler optimization
+# flags to -g.  We used to add -g to the -O compiler flags, but compilers are
+# good enough at code re-organization that debugging with -O no longer works.
+# If you want to compile with a different set of flags, specify CFLAGS in the
+# environment before configuring.
 if test "$db_cv_debug" = "yes"; then
 	cat >>confdefs.h <<\_ACEOF
 #define DEBUG 1
@@ -3435,13 +3992,14 @@ _ACEOF
 
 
 
-	CFLAGS="$CFLAGS -g"
-	CXXFLAGS="$CXXFLAGS -g"
-	db_cv_build_type=debug
-else
-	db_cv_build_type=release
+	optimize_debug="-g"
 fi
 
+# Set CFLAGS/CXXFLAGS.  We MUST set the flags before we call autoconf
+# compiler configuration macros, because if we don't, they set CFLAGS
+# to no optimization and -g, which isn't what we want.
+CFLAGS=${CFLAGS-$optimize_debug}
+CXXFLAGS=${CXXFLAGS-"$CFLAGS"}
 
 # The default compiler is cc (NOT gcc), the default CFLAGS is as specified
 # above, NOT what is set by AC_PROG_CC, as it won't set optimization flags
@@ -3456,8 +4014,8 @@ if test -n "$ac_tool_prefix"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3470,25 +4028,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
@@ -3498,8 +4058,8 @@ if test -z "$CC"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3512,29 +4072,45 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 
@@ -3545,21 +4121,35 @@ See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
+echo "$as_me:$LINENO: checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5
-  (eval $ac_compiler --version &5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5
-  (eval $ac_compiler -v &5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5
-  (eval $ac_compiler -V &5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
@@ -3584,46 +4174,70 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
-	;;
-    conftest.$ac_ext )
-	# This is the source file.
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
 	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
 	# certainly right.
 	break;;
     *.* )
-	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	# FIXME: I believe we export ac_cv_exeext for Libtool,
-	# but it would be cool to find out if it's true.  Does anybody
-	# maintain Libtool? --akim.
-	export ac_cv_exeext
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
 	break;;
     * )
 	break;;
   esac
 done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -3636,19 +4250,23 @@ See \`config.log' for more details." >&2;}
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
 
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -3667,22 +4285,27 @@ See \`config.log' for more details." >&2;}
     fi
   fi
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 rm -f a.out a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
@@ -3693,9 +4316,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  export ac_cv_exeext
 	  break;;
     * ) break;;
   esac
@@ -3709,14 +4331,14 @@ See \`config.log' for more details." >&2;}
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3736,14 +4358,20 @@ main ()
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
@@ -3761,12 +4389,12 @@ fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3789,24 +4417,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -3815,24 +4455,28 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+	ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3848,24 +4492,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -3874,285 +4530,278 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include 
-#include 
-#include 
-#include 
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
 int
 main ()
 {
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+
   ;
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
+  :
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
-  *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
-#include 
+
 int
 main ()
 {
-exit (42);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  :
+  ac_cv_prog_cc_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-continue
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
+#include 
+#include 
+#include 
+#include 
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
 int
 main ()
 {
-exit (42);
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  break
+  ac_cv_prog_cc_c89=$ac_arg
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
 fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
 
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4160,11 +4809,19 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-# Set specific per-compiler flags.
+# We know what compiler we're going to use, now.  Set per-compiler flags.
 if test "$GCC" = "yes"; then
-	# We want -O2 if we're using gcc.
+	# Use -O3 if we're using gcc, unless we're doing a small build, in
+	# which case we use -Os alone.  The code size for -O3 is quite a
+	# bit larger than -O2: a compromise is "-Os -finline-functions",
+	# it's smaller and explicitly inlining the functions helps Berkeley
+	# DB.
 	CFLAGS="$CFLAGS "
-	CFLAGS=`echo "$CFLAGS" | sed 's/-O /-O2 /g'`
+	if test "$db_cv_smallbuild" = "yes"; then
+		CFLAGS=`echo "$CFLAGS" | sed 's/-O /-Os /g'`
+	else
+		CFLAGS=`echo "$CFLAGS" | sed 's/-O /-O3 /g'`
+	fi
 else
 	case "$host_os" in
 	hpux11.0*)	;;
@@ -4184,8 +4841,8 @@ else
 fi
 
 
-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
 if test "${ac_cv_c_const+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4225,6 +4882,7 @@ main ()
     char const *s = 0 ? (char *) 0 : (char const *) 0;
 
     *t++ = 0;
+    if (s) return 0;
   }
   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
     int x[] = {25, 17};
@@ -4243,7 +4901,9 @@ main ()
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
     const int foo = 10;
+    if (!foo) return 0;
   }
+  return !x[0] && !zero.x;
 #endif
 
   ;
@@ -4251,24 +4911,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4277,12 +4949,13 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_c_const=no
+	ac_cv_c_const=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6; }
 if test $ac_cv_c_const = no; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -4317,8 +4990,8 @@ if test "$db_cv_cxx" = "yes"; then
 		aix*)		if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}xlC_r", so it can be a program name with args.
 set dummy ${ac_tool_prefix}xlC_r; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4331,32 +5004,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CCC="${ac_tool_prefix}xlC_r"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CCC=$ac_cv_prog_CCC
 if test -n "$CCC"; then
-  echo "$as_me:$LINENO: result: $CCC" >&5
-echo "${ECHO_T}$CCC" >&6
+  { echo "$as_me:$LINENO: result: $CCC" >&5
+echo "${ECHO_T}$CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CCC"; then
   ac_ct_CCC=$CCC
   # Extract the first word of "xlC_r", so it can be a program name with args.
 set dummy xlC_r; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4369,37 +5044,52 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CCC="xlC_r"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CCC=$ac_cv_prog_ac_ct_CCC
 if test -n "$ac_ct_CCC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
-echo "${ECHO_T}$ac_ct_CCC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
+echo "${ECHO_T}$ac_ct_CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CCC=$ac_ct_CCC
+  if test "x$ac_ct_CCC" = x; then
+    CCC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CCC=$ac_ct_CCC
+  fi
 else
   CCC="$ac_cv_prog_CCC"
 fi
 
 				LIBXSO_LIBS="-lC_r $LIBXSO_LIBS"
-				LIBS="-lC_r $LIBS";;
+				LIBSO_LIBS="-lC_r $LIBSO_LIBS";;
 		hpux*)		if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}aCC", so it can be a program name with args.
 set dummy ${ac_tool_prefix}aCC; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4412,32 +5102,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CCC="${ac_tool_prefix}aCC"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CCC=$ac_cv_prog_CCC
 if test -n "$CCC"; then
-  echo "$as_me:$LINENO: result: $CCC" >&5
-echo "${ECHO_T}$CCC" >&6
+  { echo "$as_me:$LINENO: result: $CCC" >&5
+echo "${ECHO_T}$CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CCC"; then
   ac_ct_CCC=$CCC
   # Extract the first word of "aCC", so it can be a program name with args.
 set dummy aCC; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4450,26 +5142,41 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CCC="aCC"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CCC=$ac_cv_prog_ac_ct_CCC
 if test -n "$ac_ct_CCC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
-echo "${ECHO_T}$ac_ct_CCC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
+echo "${ECHO_T}$ac_ct_CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CCC=$ac_ct_CCC
+  if test "x$ac_ct_CCC" = x; then
+    CCC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CCC=$ac_ct_CCC
+  fi
 else
   CCC="$ac_cv_prog_CCC"
 fi
@@ -4477,8 +5184,8 @@ fi
 		irix*)		if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}CC", so it can be a program name with args.
 set dummy ${ac_tool_prefix}CC; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4491,32 +5198,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CCC="${ac_tool_prefix}CC"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CCC=$ac_cv_prog_CCC
 if test -n "$CCC"; then
-  echo "$as_me:$LINENO: result: $CCC" >&5
-echo "${ECHO_T}$CCC" >&6
+  { echo "$as_me:$LINENO: result: $CCC" >&5
+echo "${ECHO_T}$CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CCC"; then
   ac_ct_CCC=$CCC
   # Extract the first word of "CC", so it can be a program name with args.
 set dummy CC; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4529,26 +5238,41 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CCC="CC"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CCC=$ac_cv_prog_ac_ct_CCC
 if test -n "$ac_ct_CCC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
-echo "${ECHO_T}$ac_ct_CCC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
+echo "${ECHO_T}$ac_ct_CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CCC=$ac_ct_CCC
+  if test "x$ac_ct_CCC" = x; then
+    CCC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CCC=$ac_ct_CCC
+  fi
 else
   CCC="$ac_cv_prog_CCC"
 fi
@@ -4556,8 +5280,8 @@ fi
 		osf*)		if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}cxx", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cxx; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4570,32 +5294,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CCC="${ac_tool_prefix}cxx"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CCC=$ac_cv_prog_CCC
 if test -n "$CCC"; then
-  echo "$as_me:$LINENO: result: $CCC" >&5
-echo "${ECHO_T}$CCC" >&6
+  { echo "$as_me:$LINENO: result: $CCC" >&5
+echo "${ECHO_T}$CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CCC"; then
   ac_ct_CCC=$CCC
   # Extract the first word of "cxx", so it can be a program name with args.
 set dummy cxx; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4608,26 +5334,41 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CCC="cxx"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CCC=$ac_cv_prog_ac_ct_CCC
 if test -n "$ac_ct_CCC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
-echo "${ECHO_T}$ac_ct_CCC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
+echo "${ECHO_T}$ac_ct_CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CCC=$ac_ct_CCC
+  if test "x$ac_ct_CCC" = x; then
+    CCC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CCC=$ac_ct_CCC
+  fi
 else
   CCC="$ac_cv_prog_CCC"
 fi
@@ -4635,8 +5376,8 @@ fi
 		solaris*)	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}CC", so it can be a program name with args.
 set dummy ${ac_tool_prefix}CC; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4649,32 +5390,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CCC="${ac_tool_prefix}CC"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CCC=$ac_cv_prog_CCC
 if test -n "$CCC"; then
-  echo "$as_me:$LINENO: result: $CCC" >&5
-echo "${ECHO_T}$CCC" >&6
+  { echo "$as_me:$LINENO: result: $CCC" >&5
+echo "${ECHO_T}$CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CCC"; then
   ac_ct_CCC=$CCC
   # Extract the first word of "CC", so it can be a program name with args.
 set dummy CC; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CCC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4687,44 +5430,63 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CCC="CC"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CCC=$ac_cv_prog_ac_ct_CCC
 if test -n "$ac_ct_CCC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
-echo "${ECHO_T}$ac_ct_CCC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CCC" >&5
+echo "${ECHO_T}$ac_ct_CCC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CCC=$ac_ct_CCC
+  if test "x$ac_ct_CCC" = x; then
+    CCC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CCC=$ac_ct_CCC
+  fi
 else
   CCC="$ac_cv_prog_CCC"
 fi
 ;;
 		esac
 	fi
-	ac_ext=cc
+	ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4737,36 +5499,38 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CXX=$ac_cv_prog_CXX
 if test -n "$CXX"; then
-  echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6
+  { echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$CXX" && break
   done
 fi
 if test -z "$CXX"; then
   ac_ct_CXX=$CXX
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4779,55 +5543,85 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
 if test -n "$ac_ct_CXX"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_CXX" && break
 done
-test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
 
-  CXX=$ac_ct_CXX
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
 fi
 
-
+  fi
+fi
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C++ compiler version" >&5
+echo "$as_me:$LINENO: checking for C++ compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5
-  (eval $ac_compiler --version &5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5
-  (eval $ac_compiler -v &5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5
-  (eval $ac_compiler -V &5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
-echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4850,24 +5644,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4876,24 +5682,28 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+	ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
 GXX=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_cxx_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4909,24 +5719,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4935,70 +5757,53 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cxx_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
-#include 
+
 int
 main ()
 {
-exit (42);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -5007,61 +5812,91 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
+
 int
 main ()
 {
-exit (42);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  break
+  ac_cv_prog_cxx_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -5069,13 +5904,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 	###### WORKAROUND: SEE SR #7938
-	ac_ext=cc
+	ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
 if test -z "$CXXCPP"; then
   if test "${ac_cv_prog_CXXCPP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5105,8 +5940,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5131,9 +5971,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5143,8 +5984,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include 
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5171,6 +6017,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -5188,8 +6035,8 @@ fi
 else
   ac_cv_prog_CXXCPP=$CXXCPP
 fi
-echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6
+{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6; }
 ac_preproc_ok=false
 for ac_cxx_preproc_warn_flag in '' yes
 do
@@ -5212,8 +6059,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5238,9 +6090,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5250,8 +6103,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include 
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5278,6 +6136,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -5303,14 +6162,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-echo "$as_me:$LINENO: checking whether C++ supports the ISO C++ standard includes" >&5
-echo $ECHO_N "checking whether C++ supports the ISO C++ standard includes... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether C++ supports the ISO C++ standard includes" >&5
+echo $ECHO_N "checking whether C++ supports the ISO C++ standard includes... $ECHO_C" >&6; }
 if test "${db_cv_cxx_have_stdheaders+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-
- ac_ext=cc
+ ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -5333,24 +6191,36 @@ std::ostream *o; return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -5359,9 +6229,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-db_cv_cxx_have_stdheaders=no
+	db_cv_cxx_have_stdheaders=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -5370,8 +6241,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: $db_cv_cxx_have_stdheaders" >&5
-echo "${ECHO_T}$db_cv_cxx_have_stdheaders" >&6
+{ echo "$as_me:$LINENO: result: $db_cv_cxx_have_stdheaders" >&5
+echo "${ECHO_T}$db_cv_cxx_have_stdheaders" >&6; }
 if test "$db_cv_cxx_have_stdheaders" = yes; then
 	cxx_have_stdheaders="#define	HAVE_CXX_STDHEADERS 1"
 fi
@@ -5381,8 +6252,8 @@ fi
 
 # Do some gcc specific configuration.
 
-echo "$as_me:$LINENO: checking whether we are using gcc version 2.96" >&5
-echo $ECHO_N "checking whether we are using gcc version 2.96... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using gcc version 2.96" >&5
+echo $ECHO_N "checking whether we are using gcc version 2.96... $ECHO_C" >&6; }
 if test "${db_cv_gcc_2_96+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5396,8 +6267,8 @@ if test "$GCC" = "yes"; then
 	esac
 fi
 fi
-echo "$as_me:$LINENO: result: $db_cv_gcc_2_96" >&5
-echo "${ECHO_T}$db_cv_gcc_2_96" >&6
+{ echo "$as_me:$LINENO: result: $db_cv_gcc_2_96" >&5
+echo "${ECHO_T}$db_cv_gcc_2_96" >&6; }
 if test "$db_cv_gcc_2_96" = "yes"; then
 	CFLAGS=`echo "$CFLAGS" | sed 's/-O2/-O/'`
 	CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-O2/-O/'`
@@ -5407,8 +6278,8 @@ echo "$as_me: WARNING: INSTALLED GCC COMPILER HAS SERIOUS BUGS; PLEASE UPGRADE."
 echo "$as_me: WARNING: GCC OPTIMIZATION LEVEL SET TO -O." >&2;}
 fi
 
-echo "$as_me:$LINENO: checking whether g++ requires -fhandle-exceptions" >&5
-echo $ECHO_N "checking whether g++ requires -fhandle-exceptions... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether g++ requires -fhandle-exceptions" >&5
+echo $ECHO_N "checking whether g++ requires -fhandle-exceptions... $ECHO_C" >&6; }
 if test "${db_cv_gxx_except+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5422,8 +6293,8 @@ if test "$GXX" = "yes"; then
 	esac
 fi
 fi
-echo "$as_me:$LINENO: result: $db_cv_gxx_except" >&5
-echo "${ECHO_T}$db_cv_gxx_except" >&6
+{ echo "$as_me:$LINENO: result: $db_cv_gxx_except" >&5
+echo "${ECHO_T}$db_cv_gxx_except" >&6; }
 if test "$db_cv_gxx_except" = "yes"; then
 	CXXFLAGS="$CXXFLAGS -fhandle-exceptions"
 fi
@@ -5447,10 +6318,9 @@ export CC CCC
 CCC=CXX
 
 # Libtool configuration.
-# Check whether --enable-shared or --disable-shared was given.
+# Check whether --enable-shared was given.
 if test "${enable_shared+set}" = set; then
-  enableval="$enable_shared"
-  p=${PACKAGE-default}
+  enableval=$enable_shared; p=${PACKAGE-default}
     case $enableval in
     yes) enable_shared=yes ;;
     no) enable_shared=no ;;
@@ -5469,12 +6339,12 @@ if test "${enable_shared+set}" = set; then
     esac
 else
   enable_shared=yes
-fi;
+fi
+
 
-# Check whether --enable-static or --disable-static was given.
+# Check whether --enable-static was given.
 if test "${enable_static+set}" = set; then
-  enableval="$enable_static"
-  p=${PACKAGE-default}
+  enableval=$enable_static; p=${PACKAGE-default}
     case $enableval in
     yes) enable_static=yes ;;
     no) enable_static=no ;;
@@ -5493,12 +6363,12 @@ if test "${enable_static+set}" = set; then
     esac
 else
   enable_static=yes
-fi;
+fi
+
 
-# Check whether --enable-fast-install or --disable-fast-install was given.
+# Check whether --enable-fast-install was given.
 if test "${enable_fast_install+set}" = set; then
-  enableval="$enable_fast_install"
-  p=${PACKAGE-default}
+  enableval=$enable_fast_install; p=${PACKAGE-default}
     case $enableval in
     yes) enable_fast_install=yes ;;
     no) enable_fast_install=no ;;
@@ -5517,10 +6387,11 @@ if test "${enable_fast_install+set}" = set; then
     esac
 else
   enable_fast_install=yes
-fi;
+fi
+
 
-echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
 if test "${lt_cv_path_SED+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5544,7 +6415,7 @@ lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && break
+  test ! -f $lt_ac_sed && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -5573,37 +6444,184 @@ done
 fi
 
 SED=$lt_cv_path_SED
-echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6
+{ echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6; }
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
     fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
 
 
 
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
+# Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
-  withval="$with_gnu_ld"
-  test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
   with_gnu_ld=no
-fi;
+fi
+
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -5632,11 +6650,11 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
 else
-  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
 fi
 if test "${lt_cv_path_LD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5649,7 +6667,7 @@ else
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
+      # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 &5
-echo "${ECHO_T}$LD" >&6
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 &1 &5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
-echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
 if test "${lt_cv_ld_reload_flag+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   lt_cv_ld_reload_flag='-r'
 fi
-echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
 reload_flag=$lt_cv_ld_reload_flag
 case $reload_flag in
 "" | " "*) ;;
@@ -5716,15 +6734,15 @@ reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   darwin*)
     if test "$GCC" = yes; then
-      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
     ;;
 esac
 
-echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
 if test "${lt_cv_path_NM+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5732,56 +6750,63 @@ else
   # Let the user override the test.
   lt_cv_path_NM="$NM"
 else
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
-    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      # Tru64's nm complains that /dev/null is an invalid object file
-      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-      */dev/null* | *'Invalid file or object type'*)
-	lt_cv_path_NM="$tmp_nm -B"
-	break
-        ;;
-      *)
-	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	*/dev/null*)
-	  lt_cv_path_NM="$tmp_nm -p"
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
 	  break
 	  ;;
 	*)
-	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	  continue # so that we can try to find one that supports BSD flags
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
 	  ;;
 	esac
-      esac
-    fi
+      fi
+    done
+    IFS="$lt_save_ifs"
   done
-  IFS="$lt_save_ifs"
   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
 fi
 fi
-echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6; }
 NM="$lt_cv_path_NM"
 
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 else
-  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
 if test "${lt_cv_deplibs_check_method+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5831,13 +6856,13 @@ darwin* | rhapsody*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-freebsd* | kfreebsd*-gnu)
+freebsd* | kfreebsd*-gnu | dragonfly*)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
       # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
       lt_cv_file_magic_cmd=/usr/bin/file
       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
       ;;
@@ -5853,7 +6878,7 @@ gnu*)
 
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
@@ -5869,6 +6894,11 @@ hpux10.20* | hpux11*)
   esac
   ;;
 
+interix3*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $LD in
   *-32|*"-32 ") libmagic=32-bit;;
@@ -5881,15 +6911,6 @@ irix5* | irix6* | nonstopux*)
 
 # This must be Linux ELF.
 linux*)
-  case $host_cpu in
-  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -5923,15 +6944,11 @@ osf3* | osf4* | osf5*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 solaris*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   case $host_vendor in
   motorola)
     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
@@ -5952,17 +6969,20 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
   siemens)
     lt_cv_deplibs_check_method=pass_all
     ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
   esac
   ;;
 
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 esac
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -5973,14 +6993,17 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+# Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
+  enableval=$enable_libtool_lock;
+fi
 
-fi;
 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
@@ -6007,7 +7030,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6010 "configure"' > conftest.$ac_ext
+  echo '#line 7033 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -6050,7 +7073,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-    case "`/usr/bin/file conftest.o`" in
+    case `/usr/bin/file conftest.o` in
     *32-bit*)
       case $host in
         x86_64-*linux*)
@@ -6092,8 +7115,8 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
-  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
 if test "${lt_cv_cc_needs_belf+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6119,24 +7142,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6145,9 +7180,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-lt_cv_cc_needs_belf=no
+	lt_cv_cc_needs_belf=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
      ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -6156,13 +7192,33 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)    LD="${LD-ld} -64" ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
 
 esac
 
@@ -6174,8 +7230,8 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -6209,8 +7265,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -6235,9 +7296,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -6247,8 +7309,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include 
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -6275,6 +7342,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -6292,8 +7360,8 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -6316,8 +7384,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -6342,9 +7415,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -6354,8 +7428,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include 
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -6382,6 +7461,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -6404,8 +7484,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6429,24 +7509,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6455,9 +7547,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+	ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
@@ -6513,6 +7606,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include 
+#include 
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -6532,18 +7626,27 @@ main ()
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
 	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6556,12 +7659,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6584,9 +7689,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
 		  inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -6600,24 +7705,36 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6626,12 +7743,14 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+	eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -6646,18 +7765,19 @@ done
 for ac_header in dlfcn.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6668,24 +7788,36 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6694,15 +7826,16 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6711,8 +7844,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -6736,9 +7874,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -6762,25 +7901,24 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to support@sleepycat.com ##
-## ------------------------------------ ##
+    ( cat <<\_ASBOX
+## ---------------------------------------------------------- ##
+## Report this to Oracle Technology Network Berkeley DB forum ##
+## ---------------------------------------------------------- ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -6792,17 +7930,278 @@ fi
 
 done
 
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer  to  if __STDC__ is defined, since
+  #  exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include 
+#else
+# include 
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include 
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer  to  if __STDC__ is defined, since
+  #  exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include 
+#else
+# include 
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include 
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+
 ac_ext=f
 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
 if test -n "$ac_tool_prefix"; then
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_F77+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6815,36 +8214,38 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 F77=$ac_cv_prog_F77
 if test -n "$F77"; then
-  echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6
+  { echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$F77" && break
   done
 fi
 if test -z "$F77"; then
   ac_ct_F77=$F77
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6857,48 +8258,78 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_F77="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_F77=$ac_cv_prog_ac_ct_F77
 if test -n "$ac_ct_F77"; then
-  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_F77" && break
 done
 
-  F77=$ac_ct_F77
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
 fi
 
 
 # Provide some information about the compiler.
-echo "$as_me:6887:" \
-     "checking for Fortran 77 compiler version" >&5
+echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5
-  (eval $ac_compiler --version &5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5
-  (eval $ac_compiler -v &5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5
-  (eval $ac_compiler -V &5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
@@ -6908,8 +8339,8 @@ rm -f a.out
 # input file.  (Note that this only needs to work for GNU compilers.)
 ac_save_ext=$ac_ext
 ac_ext=F
-echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
 if test "${ac_cv_f77_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6922,24 +8353,36 @@ else
       end
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6948,20 +8391,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+	ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_f77_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
 ac_ext=$ac_save_ext
 ac_test_FFLAGS=${FFLAGS+set}
 ac_save_FFLAGS=$FFLAGS
 FFLAGS=
-echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_f77_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6972,24 +8416,36 @@ cat >conftest.$ac_ext <<_ACEOF
       end
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6998,13 +8454,14 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_f77_g=no
+	ac_cv_prog_f77_g=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
 if test "$ac_test_FFLAGS" = set; then
   FFLAGS=$ac_save_FFLAGS
 elif test $ac_cv_prog_f77_g = yes; then
@@ -7033,8 +8490,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 
 # find the maximum length of command line arguments
-echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
 if test "${lt_cv_sys_max_cmd_len+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7074,20 +8531,50 @@ else
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* )
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
     elif test -x /usr/sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
     else
-      lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
     fi
     # And add a safety zone
     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
     ;;
 
- *)
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ 	]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
@@ -7112,19 +8599,19 @@ else
 fi
 
 if test -n $lt_cv_sys_max_cmd_len ; then
-  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+  { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
 else
-  echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6
+  { echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6; }
 fi
 
 
 
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
-echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7138,9 +8625,6 @@ symcode='[BCDEGRST]'
 # Regexp to match symbols that can be accessed directly from C.
 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
 
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
 # Transform an extracted symbol line into a proper C declaration
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
@@ -7162,15 +8646,31 @@ hpux*) # Its linker distinguishes data from code symbols
   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
   lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
   ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
 irix* | nonstopux*)
   symcode='[BCDEGRST]'
   ;;
 osf*)
   symcode='[BCDEGQRST]'
   ;;
-solaris* | sysv5*)
+solaris*)
   symcode='[BDRT]'
   ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
 sysv4)
   symcode='[DFNSTU]'
   ;;
@@ -7193,8 +8693,11 @@ esac
 # Try without a prefix undercore, then with it.
 for ac_symprfx in "" "_"; do
 
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
   # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -7312,15 +8815,15 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then
   lt_cv_sys_global_symbol_to_cdecl=
 fi
 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6
+  { echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6; }
 else
-  echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6
+  { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
 if test "${lt_cv_objdir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7334,8 +8837,8 @@ else
 fi
 rmdir .libs 2>/dev/null
 fi
-echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6; }
 objdir=$lt_cv_objdir
 
 
@@ -7356,7 +8859,7 @@ esac
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
+Xsed='sed -e 1s/^X//'
 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
 
 # Same as above, but do not quote variable references.
@@ -7376,7 +8879,7 @@ rm="rm -f"
 default_ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except M$VC,
+# All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 ltmain="$ac_aux_dir/ltmain.sh"
@@ -7386,8 +8889,8 @@ with_gnu_ld="$lt_cv_prog_gnu_ld"
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7400,32 +8903,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AR="${ac_tool_prefix}ar"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 AR=$ac_cv_prog_AR
 if test -n "$AR"; then
-  echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_AR"; then
   ac_ct_AR=$AR
   # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7438,27 +8943,41 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_AR="ar"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
 fi
 fi
 ac_ct_AR=$ac_cv_prog_ac_ct_AR
 if test -n "$ac_ct_AR"; then
-  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  AR=$ac_ct_AR
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
 else
   AR="$ac_cv_prog_AR"
 fi
@@ -7466,8 +8985,8 @@ fi
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7480,32 +8999,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+  { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_RANLIB"; then
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7518,27 +9039,41 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  RANLIB=$ac_ct_RANLIB
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
 else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
@@ -7546,8 +9081,8 @@ fi
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7560,32 +9095,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 STRIP=$ac_cv_prog_STRIP
 if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_STRIP"; then
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7598,27 +9135,41 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_STRIP="strip"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
 fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  STRIP=$ac_ct_STRIP
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
 else
   STRIP="$ac_cv_prog_STRIP"
 fi
@@ -7633,6 +9184,7 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
 test -z "$AS" && AS=as
 test -z "$CC" && CC=cc
 test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$DLLTOOL" && DLLTOOL=dlltool
 test -z "$LD" && LD=ld
 test -z "$LN_S" && LN_S="ln -s"
@@ -7652,23 +9204,32 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
     ;;
   *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
     ;;
   esac
   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
 
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
 
 # Only perform the check for file, if the check method requires it
 case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7688,7 +9249,7 @@ else
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
-	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
 	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
@@ -7720,17 +9281,17 @@ fi
 
 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
-    echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6; }
 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7750,7 +9311,7 @@ else
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
-	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
 	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
@@ -7782,11 +9343,11 @@ fi
 
 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
   else
@@ -7801,21 +9362,21 @@ esac
 enable_dlopen=no
 enable_win32_dll=no
 
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+# Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
+  enableval=$enable_libtool_lock;
+fi
 
-fi;
 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
 
-# Check whether --with-pic or --without-pic was given.
+# Check whether --with-pic was given.
 if test "${with_pic+set}" = set; then
-  withval="$with_pic"
-  pic_mode="$withval"
+  withval=$with_pic; pic_mode="$withval"
 else
   pic_mode=default
-fi;
+fi
+
 test -z "$pic_mode" && pic_mode=default
 
 # Use C for the default configuration in the libtool script
@@ -7845,68 +9406,25 @@ lt_simple_link_test_code='int main(){return(0);}\n'
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
 
-#
-# Check for any special shared library compilation flags.
-#
-lt_prog_cc_shlib=
-if test "$GCC" = no; then
-  case $host_os in
-  sco3.2v5*)
-    lt_prog_cc_shlib='-belf'
-    ;;
-  esac
-fi
-if test -n "$lt_prog_cc_shlib"; then
-  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
-echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
-  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
-  else
-    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
-echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
-    lt_cv_prog_cc_can_build_shared=no
-  fi
-fi
-
-
-#
-# Check to make sure the static flag actually works.
-#
-echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-     else
-       lt_prog_compiler_static_works=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
-
-if test x"$lt_prog_compiler_static_works" = xyes; then
-    :
-else
-    lt_prog_compiler_static=
-fi
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
 
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
 
 
 ## CAVEAT EMPTOR:
@@ -7920,8 +9438,8 @@ if test "$GCC" = yes; then
   lt_prog_compiler_no_builtin_flag=' -fno-builtin'
 
 
-echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7935,26 +9453,28 @@ else
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7941: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9459: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7945: \$? = $ac_status" >&5
+   echo "$as_me:9463: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
@@ -7968,8 +9488,8 @@ lt_prog_compiler_wl=
 lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
   if test "$GCC" = yes; then
     lt_prog_compiler_wl='-Wl,'
@@ -8007,6 +9527,11 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       lt_prog_compiler_pic='-fno-common'
       ;;
 
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
     msdosdjgpp*)
       # Just because we use GCC doesn't mean we suddenly get shared libraries
       # on systems that don't support them.
@@ -8023,7 +9548,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -8052,7 +9577,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       darwin*)
         # PIC is the default on this platform
         # Common symbols not allowed in MH_DYLIB files
-       case "$cc_basename" in
+       case $cc_basename in
          xlc*)
          lt_prog_compiler_pic='-qnocommon'
          lt_prog_compiler_wl='-Wl,'
@@ -8070,7 +9595,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       lt_prog_compiler_wl='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -8094,12 +9619,19 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       ;;
 
     linux*)
-      case $CC in
+      case $cc_basename in
       icc* | ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
 	lt_prog_compiler_static='-static'
         ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
       ccc*)
         lt_prog_compiler_wl='-Wl,'
         # All Alpha code is PIC.
@@ -8114,15 +9646,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    sco3.2v5*)
-      lt_prog_compiler_pic='-Kpic'
-      lt_prog_compiler_static='-dn'
-      ;;
-
     solaris*)
-      lt_prog_compiler_wl='-Wl,'
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -8131,7 +9663,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       lt_prog_compiler_static='-Bstatic'
       ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sysv4 | sysv4.2uw2* | sysv4.3*)
       lt_prog_compiler_wl='-Wl,'
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
@@ -8144,6 +9676,17 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       fi
       ;;
 
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
     uts4*)
       lt_prog_compiler_pic='-pic'
       lt_prog_compiler_static='-Bstatic'
@@ -8155,16 +9698,16 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
     esac
   fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic"; then
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
 if test "${lt_prog_compiler_pic_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8178,26 +9721,28 @@ else
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8184: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9727: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8188: \$? = $ac_status" >&5
+   echo "$as_me:9731: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
 
 if test x"$lt_prog_compiler_pic_works" = xyes; then
     case $lt_prog_compiler_pic in
@@ -8210,7 +9755,7 @@ else
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic=
@@ -8220,8 +9765,50 @@ case "$host_os" in
     ;;
 esac
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works=yes
+       fi
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_c_o+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8238,23 +9825,25 @@ else
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8244: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9831: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8248: \$? = $ac_status" >&5
+   echo "$as_me:9835: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -8265,23 +9854,23 @@ else
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
   if test "$hard_links" = no; then
     { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
@@ -8291,8 +9880,8 @@ else
   need_locks=no
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
   runpath_var=
   allow_undefined_flag=
@@ -8330,6 +9919,16 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -8340,6 +9939,10 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
       with_gnu_ld=no
     fi
     ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
   openbsd*)
     with_gnu_ld=no
     ;;
@@ -8350,6 +9953,27 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
     # See if GNU ld supports shared libraries.
     case $host_os in
     aix3* | aix4* | aix5*)
@@ -8400,10 +10024,10 @@ EOF
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
 	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -8412,7 +10036,53 @@ EOF
 	  echo EXPORTS > $output_objdir/$soname.def;
 	  cat $export_symbols >> $output_objdir/$soname.def;
 	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    interix3*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
       else
 	ld_shlibs=no
       fi
@@ -8428,7 +10098,7 @@ EOF
       fi
       ;;
 
-    solaris* | sysv5*)
+    solaris*)
       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
 	ld_shlibs=no
 	cat <&2
@@ -8449,6 +10119,33 @@ EOF
       fi
       ;;
 
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    ld_shlibs=no
+	  fi
+	;;
+      esac
+      ;;
+
     sunos4*)
       archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       wlarc=
@@ -8456,31 +10153,6 @@ EOF
       hardcode_shlibpath_var=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_cmds="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        archive_expsym_cmds="$tmp_archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -8491,16 +10163,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       ;;
     esac
 
-    if test "$ld_shlibs" = yes; then
-      runpath_var=LD_RUN_PATH
-      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
-      export_dynamic_flag_spec='${wl}--export-dynamic'
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- 	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec=
-      fi
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -8512,7 +10179,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct=unsupported
@@ -8546,6 +10213,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
   	    break
   	  fi
 	  done
+	  ;;
 	esac
 
 	exp_sym_flag='-bexport'
@@ -8564,7 +10232,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       link_all_deplibs=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.012|aix4.012.*)
+	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -8583,8 +10251,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
   	  hardcode_libdir_flag_spec='-L$libdir'
   	  hardcode_libdir_separator=
 	  fi
+	  ;;
 	esac
 	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -8592,11 +10264,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
   	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-  	if test "$aix_use_runtimelinking" = yes; then
+	  if test "$aix_use_runtimelinking" = yes; then
 	    shared_flag='${wl}-G'
 	  else
 	    shared_flag='${wl}-bM:SRE'
-  	fi
+	  fi
 	fi
       fi
 
@@ -8624,24 +10296,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -8655,18 +10339,20 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
        else
 	if test "$host_cpu" = ia64; then
 	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an empty executable.
 	 cat >conftest.$ac_ext <<_ACEOF
@@ -8685,24 +10371,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -8716,8 +10414,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
@@ -8726,13 +10426,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	  # -berok will link without error, but may produce a broken library.
 	  no_undefined_flag=' ${wl}-bernotok'
 	  allow_undefined_flag=' ${wl}-berok'
-	  # -bexpall does not export symbols beginning with underscore (_)
-	  always_export_symbols=yes
 	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec=' '
+	  whole_archive_flag_spec='$convenience'
 	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -8771,7 +10469,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     darwin* | rhapsody*)
-      case "$host_os" in
+      case $host_os in
         rhapsody* | darwin1.[012])
          allow_undefined_flag='${wl}-undefined ${wl}suppress'
          ;;
@@ -8800,16 +10498,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     	output_verbose_link_cmd='echo'
         archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
       archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
       module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
-      case "$cc_basename" in
+      case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
          archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
          module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -8850,7 +10548,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
@@ -8873,47 +10571,62 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       export_dynamic_flag_spec='${wl}-E'
       ;;
 
-    hpux10* | hpux11*)
+    hpux10*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*|ia64*)
+	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+
+	hardcode_direct=yes
+	export_dynamic_flag_spec='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
 	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*)
-	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
 	  hardcode_libdir_flag_spec_ld='+b $libdir'
-	  hardcode_libdir_separator=:
-	  hardcode_direct=no
-	  hardcode_shlibpath_var=no
-	  ;;
-	ia64*)
-	  hardcode_libdir_flag_spec='-L$libdir'
 	  hardcode_direct=no
 	  hardcode_shlibpath_var=no
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L=yes
 	  ;;
 	*)
-	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	  hardcode_libdir_separator=:
 	  hardcode_direct=yes
 	  export_dynamic_flag_spec='${wl}-E'
 
@@ -9007,7 +10720,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	allow_undefined_flag=' -expect_unresolved \*'
 	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -9015,21 +10728,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_libdir_separator=:
       ;;
 
-    sco3.2v5*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
     solaris*)
       no_undefined_flag=' -z text'
       if test "$GCC" = yes; then
+	wlarc='${wl}'
 	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+	wlarc=''
 	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -9038,8 +10745,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-	whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
       esac
       link_all_deplibs=yes
       ;;
@@ -9096,36 +10813,45 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       fi
       ;;
 
-    sysv4.2uw2*)
-      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_minus_L=no
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+      runpath_var='LD_RUN_PATH'
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      no_undefined_flag='${wl}-z ${wl}text'
       if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var=no
       ;;
 
-    sysv5*)
-      no_undefined_flag=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      hardcode_libdir_flag_spec=
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
       ;;
 
     uts4*)
@@ -9140,15 +10866,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     esac
   fi
 
-echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6
+{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6; }
 test "$ld_shlibs" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
 #
 # Do we need to explicitly link libc?
 #
@@ -9166,8 +10887,8 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
@@ -9181,6 +10902,7 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
         libobjs=conftest.$ac_objext
         deplibs=
         wl=$lt_prog_compiler_wl
+	pic_flag=$lt_prog_compiler_pic
         compiler_flags=-v
         linker_flags=-v
         verstring=
@@ -9203,16 +10925,16 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
         cat conftest.err 1>&5
       fi
       $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -9341,7 +11063,8 @@ cygwin* | mingw* | pw32*)
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -9371,7 +11094,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -9394,7 +11117,7 @@ darwin* | rhapsody*)
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -9429,8 +11152,17 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -9448,14 +11180,19 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -9475,7 +11212,7 @@ hpux9* | hpux10* | hpux11*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -9515,6 +11252,18 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -9574,7 +11323,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -9636,8 +11385,13 @@ nto-qnx*)
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  need_version=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -9675,13 +11429,6 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -9707,7 +11454,7 @@ sunos4*)
   need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -9740,6 +11487,29 @@ sysv4*MP*)
   fi
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -9751,12 +11521,17 @@ uts4*)
   dynamic_linker=no
   ;;
 esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" || \
    test -n "$runpath_var" || \
@@ -9780,8 +11555,8 @@ else
   # directories.
   hardcode_action=unsupported
 fi
-echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6
+{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6; }
 
 if test "$hardcode_action" = relink; then
   # Fast installation is not supported
@@ -9794,29 +11569,29 @@ fi
 
 striplib=
 old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
    darwin*)
        if test -n "$STRIP" ; then
          striplib="$STRIP -x"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
        else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
        ;;
    *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
     ;;
   esac
 fi
@@ -9848,8 +11623,8 @@ else
 
   darwin*)
   # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9862,40 +11637,52 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dlopen ();
 int
 main ()
 {
-dlopen ();
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -9904,14 +11691,15 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dl_dlopen=no
+	ac_cv_lib_dl_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
 if test $ac_cv_lib_dl_dlopen = yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
@@ -9925,8 +11713,8 @@ fi
    ;;
 
   *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
 if test "${ac_cv_func_shl_load+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9953,53 +11741,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef shl_load
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char shl_load ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shl_load) || defined (__stub___shl_load)
+#if defined __stub_shl_load || defined __stub___shl_load
 choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != shl_load;
+return shl_load ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -10008,18 +11802,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_shl_load=no
+	ac_cv_func_shl_load=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
 if test $ac_cv_func_shl_load = yes; then
   lt_cv_dlopen="shl_load"
 else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dld_shl_load+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10032,40 +11827,52 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char shl_load ();
 int
 main ()
 {
-shl_load ();
+return shl_load ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -10074,19 +11881,20 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dld_shl_load=no
+	ac_cv_lib_dld_shl_load=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
 if test $ac_cv_lib_dld_shl_load = yes; then
   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
 else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
 if test "${ac_cv_func_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10113,53 +11921,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef dlopen
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dlopen ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
+#if defined __stub_dlopen || defined __stub___dlopen
 choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != dlopen;
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -10168,18 +11982,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_dlopen=no
+	ac_cv_func_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
 if test $ac_cv_func_dlopen = yes; then
   lt_cv_dlopen="dlopen"
 else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10192,40 +12007,52 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dlopen ();
 int
 main ()
 {
-dlopen ();
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -10234,19 +12061,20 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dl_dlopen=no
+	ac_cv_lib_dl_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
 if test $ac_cv_lib_dl_dlopen = yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
 if test "${ac_cv_lib_svld_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10259,40 +12087,52 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dlopen ();
 int
 main ()
 {
-dlopen ();
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -10301,19 +12141,20 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_svld_dlopen=no
+	ac_cv_lib_svld_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
 if test $ac_cv_lib_svld_dlopen = yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
 else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dld_dld_link+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10326,40 +12167,52 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dld_link ();
 int
 main ()
 {
-dld_link ();
+return dld_link ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -10368,14 +12221,15 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dld_dld_link=no
+	ac_cv_lib_dld_dld_link=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
 if test $ac_cv_lib_dld_dld_link = yes; then
   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
 fi
@@ -10410,13 +12264,13 @@ fi
     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
     save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
     save_LIBS="$LIBS"
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
 if test "${lt_cv_dlopen_self+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10426,7 +12280,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
     esac
   else :
     # compilation failed
@@ -10508,13 +12364,13 @@ rm -fr conftest*
 
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
 
     if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
 if test "${lt_cv_dlopen_self_static+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10524,7 +12380,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
     esac
   else :
     # compilation failed
@@ -10606,8 +12464,8 @@ rm -fr conftest*
 
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
     fi
 
     CPPFLAGS="$save_CPPFLAGS"
@@ -10628,19 +12486,19 @@ echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
 fi
 
 
-# Report which librarie types wil actually be built
-echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6
+# Report which library types will actually be built
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
 
-echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
 test "$can_build_shared" = "no" && enable_shared=no
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -10655,15 +12513,15 @@ aix4* | aix5*)
   fi
     ;;
 esac
-echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
 
-echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
 # Make sure either enable_shared or enable_static is yes.
 test "$enable_shared" = yes || enable_static=yes
-echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
 
 # The else clause should only fire when bootstrapping the
 # libtool distribution, otherwise you forgot to ship ltmain.sh
@@ -10678,7 +12536,7 @@ if test -f "$ltmain"; then
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -10782,7 +12640,7 @@ echo "$as_me: creating $ofile" >&6;}
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -10793,7 +12651,7 @@ echo "$as_me: creating $ofile" >&6;}
 SED=$lt_SED
 
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e s/^X//"
+Xsed="$SED -e 1s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
@@ -10827,6 +12685,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -10838,6 +12702,9 @@ AR_FLAGS=$lt_AR_FLAGS
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_compiler
 
@@ -10903,7 +12770,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -11146,11 +13013,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 CC="$lt_save_CC"
 
 
-# Check whether --with-tags or --without-tags was given.
+# Check whether --with-tags was given.
 if test "${with_tags+set}" = set; then
-  withval="$with_tags"
-  tagnames="$withval"
-fi;
+  withval=$with_tags; tagnames="$withval"
+fi
+
 
 if test -f "$ltmain" && test -n "$tagnames"; then
   if test ! -f "${ofile}"; then
@@ -11168,6 +13035,9 @@ echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script
 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
     fi
   fi
+  if test -z "$LTCFLAGS"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+  fi
 
   # Extract list of available tagged configurations in $ofile.
   # Note that this assumes the entire list is on one line.
@@ -11198,8 +13068,10 @@ echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
 
       case $tagname in
       CXX)
-	if test -n "$CXX" && test "X$CXX" != "Xno"; then
-	  ac_ext=cc
+	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+	    (test "X$CXX" != "Xg++"))) ; then
+	  ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -11218,6 +13090,7 @@ hardcode_libdir_flag_spec_CXX=
 hardcode_libdir_flag_spec_ld_CXX=
 hardcode_libdir_separator_CXX=
 hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
 hardcode_automatic_CXX=no
 module_cmds_CXX=
 module_expsym_cmds_CXX=
@@ -11235,7 +13108,7 @@ postdeps_CXX=
 compiler_lib_search_path_CXX=
 
 # Source file extension for C++ test sources.
-ac_ext=cc
+ac_ext=cpp
 
 # Object file extension for compiled C++ test sources.
 objext=o
@@ -11245,17 +13118,34 @@ objext_CXX=$objext
 lt_simple_compile_test_code="int some_variable = 0;\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC=$CC
 lt_save_LD=$LD
@@ -11266,18 +13156,27 @@ lt_save_path_LD=$lt_cv_path_LD
 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
   lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
 else
-  unset lt_cv_prog_gnu_ld
+  $as_unset lt_cv_prog_gnu_ld
 fi
 if test -n "${lt_cv_path_LDCXX+set}"; then
   lt_cv_path_LD=$lt_cv_path_LDCXX
 else
-  unset lt_cv_path_LD
+  $as_unset lt_cv_path_LD
 fi
 test -z "${LDCXX+set}" || LD=$LDCXX
 CC=${CXX-"c++"}
 compiler=$CC
 compiler_CXX=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
 
 # We don't want -fno-exception wen compiling C++ code, so set the
 # no_builtin_flag separately
@@ -11291,18 +13190,18 @@ if test "$GXX" = yes; then
   # Set up default GNU C++ configuration
 
 
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
+# Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
-  withval="$with_gnu_ld"
-  test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
   with_gnu_ld=no
-fi;
+fi
+
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -11331,11 +13230,11 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
 else
-  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
 fi
 if test "${lt_cv_path_LD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11348,7 +13247,7 @@ else
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
+      # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 &5
-echo "${ECHO_T}$LD" >&6
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 &1 &5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
@@ -11443,8 +13342,8 @@ else
 fi
 
 # PORTME: fill in a description of your system's C++ link characteristics
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 ld_shlibs_CXX=yes
 case $host_os in
   aix3*)
@@ -11473,6 +13372,7 @@ case $host_os in
 	    ;;
 	  esac
 	done
+	;;
       esac
 
       exp_sym_flag='-bexport'
@@ -11491,7 +13391,7 @@ case $host_os in
     link_all_deplibs_CXX=yes
 
     if test "$GXX" = yes; then
-      case $host_os in aix4.012|aix4.012.*)
+      case $host_os in aix4.[012]|aix4.[012].*)
       # We only want to do this on AIX 4.2 and lower, the check
       # below for broken collect2 doesn't work under 4.3+
 	collect2name=`${CC} -print-prog-name=collect2`
@@ -11510,8 +13410,12 @@ case $host_os in
 	  hardcode_libdir_flag_spec_CXX='-L$libdir'
 	  hardcode_libdir_separator_CXX=
 	fi
+	;;
       esac
       shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+	shared_flag="$shared_flag "'${wl}-G'
+      fi
     else
       # not using gcc
       if test "$host_cpu" = ia64; then
@@ -11551,24 +13455,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -11582,19 +13498,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
       hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
      else
       if test "$host_cpu" = ia64; then
 	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
 	allow_undefined_flag_CXX="-z nodefs"
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
       else
 	# Determine the default libpath from the value encoded in an empty executable.
 	cat >conftest.$ac_ext <<_ACEOF
@@ -11613,24 +13531,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -11644,8 +13574,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
@@ -11654,16 +13586,26 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	# -berok will link without error, but may produce a broken library.
 	no_undefined_flag_CXX=' ${wl}-bernotok'
 	allow_undefined_flag_CXX=' ${wl}-berok'
-	# -bexpall does not export symbols beginning with underscore (_)
-	always_export_symbols_CXX=yes
 	# Exported symbols can be pulled into shared objects from archives
-	whole_archive_flag_spec_CXX=' '
+	whole_archive_flag_spec_CXX='$convenience'
 	archive_cmds_need_lc_CXX=yes
-	# This is similar to how AIX traditionally builds it's shared libraries.
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	# This is similar to how AIX traditionally builds its shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
       fi
     fi
     ;;
+
+  beos*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      allow_undefined_flag_CXX=unsupported
+      # Joseph Beckenbach  says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+    ;;
+
   chorus*)
     case $cc_basename in
       *)
@@ -11673,7 +13615,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     esac
     ;;
 
-
   cygwin* | mingw* | pw32*)
     # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
     # as there is no search path for DLLs.
@@ -11683,7 +13624,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     enable_shared_with_static_runtimes_CXX=yes
 
     if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is; otherwise, prepend...
       archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -11692,13 +13633,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	echo EXPORTS > $output_objdir/$soname.def;
 	cat $export_symbols >> $output_objdir/$soname.def;
       fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
     else
       ld_shlibs_CXX=no
     fi
   ;;
       darwin* | rhapsody*)
-        case "$host_os" in
+        case $host_os in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
          ;;
@@ -11736,7 +13677,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
         fi
         module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
           if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
             archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           else
@@ -11744,12 +13685,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           fi
             module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
       else
-      case "$cc_basename" in
+      case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
           archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
           module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
           archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -11762,11 +13703,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
   dgux*)
     case $cc_basename in
-      ec++)
+      ec++*)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      ghcx)
+      ghcx*)
 	# Green Hills C++ Compiler
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
@@ -11777,14 +13718,14 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	;;
     esac
     ;;
-  freebsd12*)
+  freebsd[12]*)
     # C++ shared libraries reported to be fairly broken before switch to ELF
     ld_shlibs_CXX=no
     ;;
   freebsd-elf*)
     archive_cmds_need_lc_CXX=no
     ;;
-  freebsd* | kfreebsd*-gnu)
+  freebsd* | kfreebsd*-gnu | dragonfly*)
     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
     # conventions
     ld_shlibs_CXX=yes
@@ -11801,11 +13742,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 				# location of the library.
 
     case $cc_basename in
-    CC)
+    CC*)
       # FIXME: insert proper C++ library support
       ld_shlibs_CXX=no
       ;;
-    aCC)
+    aCC*)
       archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
@@ -11815,7 +13756,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -11829,33 +13770,22 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   hpux10*|hpux11*)
     if test $with_gnu_ld = no; then
-      case "$host_cpu" in
-      hppa*64*)
-	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+      hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_CXX=:
+
+      case $host_cpu in
+      hppa*64*|ia64*)
 	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
-	hardcode_libdir_separator_CXX=:
-        ;;
-      ia64*)
-	hardcode_libdir_flag_spec_CXX='-L$libdir'
         ;;
       *)
-	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_CXX=:
 	export_dynamic_flag_spec_CXX='${wl}-E'
         ;;
       esac
     fi
-    case "$host_cpu" in
-    hppa*64*)
-      hardcode_direct_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      ;;
-    ia64*)
+    case $host_cpu in
+    hppa*64*|ia64*)
       hardcode_direct_CXX=no
       hardcode_shlibpath_var_CXX=no
-      hardcode_minus_L_CXX=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
       ;;
     *)
       hardcode_direct_CXX=yes
@@ -11866,14 +13796,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     esac
 
     case $cc_basename in
-      CC)
+      CC*)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      aCC)
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+      aCC*)
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	  ;;
 	*)
 	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
@@ -11892,9 +13825,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       *)
 	if test "$GXX" = yes; then
 	  if test $with_gnu_ld = no; then
-	    case "$host_cpu" in
-	    ia64*|hppa*64*)
-	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	    case $host_cpu in
+	    hppa*64*)
+	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      ;;
+	    ia64*)
+	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	      ;;
 	    *)
 	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
@@ -11908,11 +13844,25 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	;;
     esac
     ;;
+  interix3*)
+    hardcode_direct_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+    # Instead, shared libraries are loaded at an image base (0x10000000 by
+    # default) and relocated if they conflict, which is a slow very memory
+    # consuming and fragmenting process.  To avoid this, we pick a random,
+    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+    archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    ;;
   irix5* | irix6*)
     case $cc_basename in
-      CC)
+      CC*)
 	# SGI C++
-	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
 	# Archives containing C++ object files must be created using
 	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -11923,7 +13873,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       *)
 	if test "$GXX" = yes; then
 	  if test "$with_gnu_ld" = no; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	  else
 	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
 	  fi
@@ -11936,7 +13886,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   linux*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -11961,7 +13911,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
 	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
 	;;
-      icpc)
+      icpc*)
 	# Intel C++
 	with_gnu_ld=yes
 	# version 8.0 and above of icpc choke on multiply defined symbols
@@ -11973,8 +13923,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
   	  archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  ;;
 	*)  # Version 8.0 or newer
-  	  archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-  	archive_expsym_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  tmp_idyn=
+	  case $host_cpu in
+	    ia64*) tmp_idyn=' -i_dynamic';;
+	  esac
+  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  ;;
 	esac
 	archive_cmds_need_lc_CXX=no
@@ -11982,7 +13936,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
 	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	;;
-      cxx)
+      pgCC*)
+        # Portland Group C++ compiler
+	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
 	# Compaq C++
 	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
@@ -12013,7 +13976,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   mvs*)
     case $cc_basename in
-      cxx)
+      cxx*)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
@@ -12039,6 +14002,8 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ld_shlibs_CXX=no
     ;;
   openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
     archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
     hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
@@ -12050,7 +14015,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   osf3*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -12066,14 +14031,14 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
 
 	;;
-      RCC)
+      RCC*)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      cxx)
+      cxx*)
 	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
 	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	hardcode_libdir_separator_CXX=:
@@ -12091,7 +14056,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
 	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	  hardcode_libdir_separator_CXX=:
@@ -12110,7 +14075,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   osf4* | osf5*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -12125,17 +14090,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	# the KAI C++ compiler.
 	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
 	;;
-      RCC)
+      RCC*)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      cxx)
+      cxx*)
 	allow_undefined_flag_CXX=' -expect_unresolved \*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 	archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
 	  $rm $lib.exp'
 
 	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
@@ -12154,7 +14119,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
 	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	  hardcode_libdir_separator_CXX=:
@@ -12175,27 +14140,14 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     # FIXME: insert proper C++ library support
     ld_shlibs_CXX=no
     ;;
-  sco*)
-    archive_cmds_need_lc_CXX=no
-    case $cc_basename in
-      CC)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
   sunos4*)
     case $cc_basename in
-      CC)
+      CC*)
 	# Sun C++ 4.x
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      lcc)
+      lcc*)
 	# Lucid
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
@@ -12208,36 +14160,33 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   solaris*)
     case $cc_basename in
-      CC)
+      CC*)
 	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
 	no_undefined_flag_CXX=' -zdefs'
-	archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
 	hardcode_libdir_flag_spec_CXX='-R$libdir'
 	hardcode_shlibpath_var_CXX=no
 	case $host_os in
-	  solaris2.0-5 | solaris2.0-5.*) ;;
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
 	  *)
 	    # The C++ compiler is used as linker so we must use $wl
 	    # flag to pass the commands to the underlying system
-	    # linker.
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
 	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
 	    ;;
 	esac
 	link_all_deplibs_CXX=yes
 
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	output_verbose_link_cmd='echo'
 
 	# Archives containing C++ object files must be created using
 	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -12245,7 +14194,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	# in the archive.
 	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
 	;;
-      gcx)
+      gcx*)
 	# Green Hills C++ Compiler
 	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
@@ -12283,33 +14232,84 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	;;
     esac
     ;;
-  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+    no_undefined_flag_CXX='${wl}-z,text'
     archive_cmds_need_lc_CXX=no
-    ;;
-  tandem*)
+    hardcode_shlibpath_var_CXX=no
+    runpath_var='LD_RUN_PATH'
+
     case $cc_basename in
-      NCC)
-	# NonStop-UX NCC 3.20
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
+      CC*)
+	archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	;;
       *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
+	archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	;;
     esac
     ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
+  sysv5* | sco3.2v5* | sco5v6*)
+    # Note: We can NOT use -z defs as we might desire, because we do not
+    # link with -lc, and that would cause any symbols used from libc to
+    # always be unresolved, which means just about no library would
+    # ever link correctly.  If we're not using GNU ld we use -z text
+    # though, which does catch some bad symbols but isn't as heavy-handed
+    # as -z defs.
+    # For security reasons, it is highly recommended that you always
+    # use absolute paths for naming shared libraries, and exclude the
+    # DT_RUNPATH tag from executables and libraries.  But doing so
+    # requires that you compile everything twice, which is a pain.
+    # So that behaviour is only enabled if SCOABSPATH is set to a
+    # non-empty value in the environment.  Most likely only useful for
+    # creating official distributions of packages.
+    # This is a hack until libtool officially supports absolute path
+    # names for shared libraries.
+    no_undefined_flag_CXX='${wl}-z,text'
+    allow_undefined_flag_CXX='${wl}-z,nodefs'
+    archive_cmds_need_lc_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+    export_dynamic_flag_spec_CXX='${wl}-Bexport'
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
     ;;
   *)
     # FIXME: insert proper C++ library support
     ld_shlibs_CXX=no
     ;;
 esac
-echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
 test "$ld_shlibs_CXX" = no && can_build_shared=no
 
 GCC_CXX="$GXX"
@@ -12345,7 +14345,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   # The `*' in the case matches for architectures that use `case' in
   # $output_verbose_cmd can trigger glob expansion during the loop
   # eval without this substitution.
-  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
 
   for p in `eval $output_verbose_link_cmd`; do
     case $p in
@@ -12421,6 +14421,29 @@ fi
 
 $rm -f confest.$objext
 
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix3*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+esac
+
+
 case " $postdeps_CXX " in
 *" -lc "*) archive_cmds_need_lc_CXX=no ;;
 esac
@@ -12429,8 +14452,8 @@ lt_prog_compiler_wl_CXX=
 lt_prog_compiler_pic_CXX=
 lt_prog_compiler_static_CXX=
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
   # C++ specific cases for pic, static, wl, etc.
   if test "$GXX" = yes; then
@@ -12468,6 +14491,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       # DJGPP does not support shared libraries at all
       lt_prog_compiler_pic_CXX=
       ;;
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
     sysv4*MP*)
       if test -d /usr/nec; then
 	lt_prog_compiler_pic_CXX=-Kconform_pic
@@ -12476,7 +14503,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	;;
       *)
@@ -12501,7 +14528,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	;;
       chorus*)
 	case $cc_basename in
-	cxch68)
+	cxch68*)
 	  # Green Hills C++ Compiler
 	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
 	  ;;
@@ -12510,7 +14537,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        darwin*)
          # PIC is the default on this platform
          # Common symbols not allowed in MH_DYLIB files
-         case "$cc_basename" in
+         case $cc_basename in
            xlc*)
            lt_prog_compiler_pic_CXX='-qnocommon'
            lt_prog_compiler_wl_CXX='-Wl,'
@@ -12519,10 +14546,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       dgux*)
 	case $cc_basename in
-	  ec++)
+	  ec++*)
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    ;;
-	  ghcx)
+	  ghcx*)
 	    # Green Hills C++ Compiler
 	    lt_prog_compiler_pic_CXX='-pic'
 	    ;;
@@ -12530,22 +14557,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	    ;;
 	esac
 	;;
-      freebsd* | kfreebsd*-gnu)
+      freebsd* | kfreebsd*-gnu | dragonfly*)
 	# FreeBSD uses GNU C++
 	;;
       hpux9* | hpux10* | hpux11*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
 	    if test "$host_cpu" != ia64; then
 	      lt_prog_compiler_pic_CXX='+Z'
 	    fi
 	    ;;
-	  aCC)
+	  aCC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-	    case "$host_cpu" in
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
 	      ;;
@@ -12558,9 +14585,13 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	    ;;
 	esac
 	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
       irix5* | irix6* | nonstopux*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_static_CXX='-non_shared'
 	    # CC pic flag -KPIC is the default.
@@ -12571,18 +14602,24 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	;;
       linux*)
 	case $cc_basename in
-	  KCC)
+	  KCC*)
 	    # KAI C++ Compiler
 	    lt_prog_compiler_wl_CXX='--backend -Wl,'
 	    lt_prog_compiler_pic_CXX='-fPIC'
 	    ;;
-	  icpc)
+	  icpc* | ecpc*)
 	    # Intel C++
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-static'
 	    ;;
-	  cxx)
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  cxx*)
 	    # Compaq C++
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
 	    # Linux and Compaq Tru64 Unix objects are PIC.
@@ -12599,7 +14636,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	;;
       mvs*)
 	case $cc_basename in
-	  cxx)
+	  cxx*)
 	    lt_prog_compiler_pic_CXX='-W c,exportall'
 	    ;;
 	  *)
@@ -12610,14 +14647,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
-	  KCC)
+	  KCC*)
 	    lt_prog_compiler_wl_CXX='--backend -Wl,'
 	    ;;
-	  RCC)
+	  RCC*)
 	    # Rational C++ 2.4.1
 	    lt_prog_compiler_pic_CXX='-pic'
 	    ;;
-	  cxx)
+	  cxx*)
 	    # Digital/Compaq C++
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
@@ -12631,24 +14668,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	;;
       psos*)
 	;;
-      sco*)
-	case $cc_basename in
-	  CC)
-	    lt_prog_compiler_pic_CXX='-fPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
       solaris*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-Bstatic'
 	    lt_prog_compiler_wl_CXX='-Qoption ld '
 	    ;;
-	  gcx)
+	  gcx*)
 	    # Green Hills C++ Compiler
 	    lt_prog_compiler_pic_CXX='-PIC'
 	    ;;
@@ -12658,12 +14686,12 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	;;
       sunos4*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    # Sun C++ 4.x
 	    lt_prog_compiler_pic_CXX='-pic'
 	    lt_prog_compiler_static_CXX='-Bstatic'
 	    ;;
-	  lcc)
+	  lcc*)
 	    # Lucid
 	    lt_prog_compiler_pic_CXX='-pic'
 	    ;;
@@ -12673,7 +14701,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	;;
       tandem*)
 	case $cc_basename in
-	  NCC)
+	  NCC*)
 	    # NonStop-UX NCC 3.20
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    ;;
@@ -12681,7 +14709,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 	    ;;
 	esac
 	;;
-      unixware*)
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	esac
 	;;
       vxworks*)
 	;;
@@ -12691,16 +14726,16 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
     esac
   fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic_CXX"; then
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -12714,26 +14749,28 @@ else
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12720: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14755: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:12724: \$? = $ac_status" >&5
+   echo "$as_me:14759: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works_CXX=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
 
 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
     case $lt_prog_compiler_pic_CXX in
@@ -12746,7 +14783,7 @@ else
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_CXX=
@@ -12756,8 +14793,50 @@ case "$host_os" in
     ;;
 esac
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_CXX=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
+
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -12774,23 +14853,25 @@ else
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12780: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14859: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12784: \$? = $ac_status" >&5
+   echo "$as_me:14863: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_CXX=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -12801,23 +14882,23 @@ else
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
   if test "$hard_links" = no; then
     { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
@@ -12827,8 +14908,8 @@ else
   need_locks=no
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
   export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   case $host_os in
@@ -12845,22 +14926,17 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
     export_symbols_cmds_CXX="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   esac
 
-echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
 test "$ld_shlibs_CXX" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
 #
 # Do we need to explicitly link libc?
 #
@@ -12878,8 +14954,8 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
@@ -12893,6 +14969,7 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
         libobjs=conftest.$ac_objext
         deplibs=
         wl=$lt_prog_compiler_wl_CXX
+	pic_flag=$lt_prog_compiler_pic_CXX
         compiler_flags=-v
         linker_flags=-v
         verstring=
@@ -12915,16 +14992,16 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
         cat conftest.err 1>&5
       fi
       $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -13053,7 +15130,8 @@ cygwin* | mingw* | pw32*)
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -13083,7 +15161,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -13106,7 +15184,7 @@ darwin* | rhapsody*)
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -13141,8 +15219,17 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -13160,14 +15247,19 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -13187,7 +15279,7 @@ hpux9* | hpux10* | hpux11*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -13227,6 +15319,18 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -13286,7 +15390,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -13348,8 +15452,13 @@ nto-qnx*)
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  need_version=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -13387,13 +15496,6 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -13419,7 +15521,7 @@ sunos4*)
   need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -13452,6 +15554,29 @@ sysv4*MP*)
   fi
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -13463,12 +15588,17 @@ uts4*)
   dynamic_linker=no
   ;;
 esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
 hardcode_action_CXX=
 if test -n "$hardcode_libdir_flag_spec_CXX" || \
    test -n "$runpath_var_CXX" || \
@@ -13492,8 +15622,8 @@ else
   # directories.
   hardcode_action_CXX=unsupported
 fi
-echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
 
 if test "$hardcode_action_CXX" = relink; then
   # Fast installation is not supported
@@ -13504,1759 +15634,1486 @@ elif test "$shlibpath_overrides_runpath" = yes ||
   enable_fast_install=needless
 fi
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
     ;;
   esac
-fi
 
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
+cfgfile="$ofile"
 
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
 
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
 
-  darwin*)
-  # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
 
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
 
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
 
-fi
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
 
-   ;;
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
 
-  *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define shl_load to an innocuous variant, in case  declares shl_load.
-   For example, HP-UX 11i  declares gettimeofday.  */
-#define shl_load innocuous_shl_load
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load (); below.
-    Prefer  to  if __STDC__ is defined, since
-     exists even on freestanding compilers.  */
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
 
-#ifdef __STDC__
-# include 
-#else
-# include 
-#endif
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
 
-#undef shl_load
+# A C compiler.
+LTCC=$lt_LTCC
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
 
-int
-main ()
-{
-return f != shl_load;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# A language-specific compiler.
+CC=$lt_compiler_CXX
 
-ac_cv_func_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
-  lt_cv_dlopen="shl_load"
-else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-int
-main ()
-{
-shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# An ERE matcher.
+EGREP=$lt_EGREP
 
-ac_cv_lib_dld_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define dlopen to an innocuous variant, in case  declares dlopen.
-   For example, HP-UX 11i  declares gettimeofday.  */
-#define dlopen innocuous_dlopen
+# The linker used to build libraries.
+LD=$lt_LD_CXX
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen (); below.
-    Prefer  to  if __STDC__ is defined, since
-     exists even on freestanding compilers.  */
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
 
-#ifdef __STDC__
-# include 
-#else
-# include 
-#endif
+# A BSD-compatible nm program.
+NM=$lt_NM
 
-#undef dlopen
+# A symbol stripping program
+STRIP=$lt_STRIP
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != dlopen;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
 
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
-  lt_cv_dlopen="dlopen"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
 
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Used on cygwin: assembler.
+AS="$AS"
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_svld_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
 
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_dld_link=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
 
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
+# Object file suffix (normally "o").
+objext="$ac_objext"
 
+# Old archive suffix (normally "a").
+libext="$libext"
 
-fi
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
 
+# Executable file suffix (normally "").
+exeext="$exeext"
 
-fi
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
 
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
-fi
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
 
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
 
-fi
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
 
+# Do we need a version for libraries?
+need_version=$need_version
 
-fi
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
 
-    ;;
-  esac
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
 
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
 
-    save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
 
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
 
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <
-#endif
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
 
-#include 
+# Library versioning type.
+version_type=$version_type
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
 
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
 
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <
-#endif
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
 
-#include 
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
 
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
 
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
-    fi
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
 
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_CXX \
-    CC_CXX \
-    LD_CXX \
-    lt_prog_compiler_wl_CXX \
-    lt_prog_compiler_pic_CXX \
-    lt_prog_compiler_static_CXX \
-    lt_prog_compiler_no_builtin_flag_CXX \
-    export_dynamic_flag_spec_CXX \
-    thread_safe_flag_spec_CXX \
-    whole_archive_flag_spec_CXX \
-    enable_shared_with_static_runtimes_CXX \
-    old_archive_cmds_CXX \
-    old_archive_from_new_cmds_CXX \
-    predep_objects_CXX \
-    postdep_objects_CXX \
-    predeps_CXX \
-    postdeps_CXX \
-    compiler_lib_search_path_CXX \
-    archive_cmds_CXX \
-    archive_expsym_cmds_CXX \
-    postinstall_cmds_CXX \
-    postuninstall_cmds_CXX \
-    old_archive_from_expsyms_cmds_CXX \
-    allow_undefined_flag_CXX \
-    no_undefined_flag_CXX \
-    export_symbols_cmds_CXX \
-    hardcode_libdir_flag_spec_CXX \
-    hardcode_libdir_flag_spec_ld_CXX \
-    hardcode_libdir_separator_CXX \
-    hardcode_automatic_CXX \
-    module_cmds_CXX \
-    module_expsym_cmds_CXX \
-    lt_cv_prog_compiler_c_o_CXX \
-    exclude_expsyms_CXX \
-    include_expsyms_CXX; do
-
-    case $var in
-    old_archive_cmds_CXX | \
-    old_archive_from_new_cmds_CXX | \
-    archive_cmds_CXX | \
-    archive_expsym_cmds_CXX | \
-    module_cmds_CXX | \
-    module_expsym_cmds_CXX | \
-    old_archive_from_expsyms_cmds_CXX | \
-    export_symbols_cmds_CXX | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
 
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
 
-cfgfile="$ofile"
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
 
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
 
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
 
-# The host system.
-host_alias=$host_alias
-host=$host
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
 
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
 
-# A C compiler.
-LTCC=$lt_LTCC
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-# A language-specific compiler.
-CC=$lt_compiler_CXX
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
 
-# An ERE matcher.
-EGREP=$lt_EGREP
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
 
-# The linker used to build libraries.
-LD=$lt_LD_CXX
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
-# A BSD-compatible nm program.
-NM=$lt_NM
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
 
-# A symbol stripping program
-STRIP=$lt_STRIP
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+# ### END LIBTOOL TAG CONFIG: $tagname
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+__EOF__
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
 
-# Used on cygwin: assembler.
-AS="$AS"
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
+	else
+	  tagname=""
+	fi
+	;;
 
-# Old archive suffix (normally "a").
-libext="$libext"
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
 
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
 
-# Executable file suffix (normally "").
-exeext="$exeext"
 
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
 
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
+# Source file extension for f77 test sources.
+ac_ext=f
 
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
 
-# Must we lock files when doing compilation ?
-need_locks=$lt_need_locks
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
 
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
 
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+# Allow CC to be a program name with arguments.
+compiler=$CC
 
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
 
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
 
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
 
-# Library versioning type.
-version_type=$version_type
 
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
 
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
 
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+test "$can_build_shared" = "no" && enable_shared=no
 
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
 
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
 
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
+GCC_F77="$G77"
+LD_F77="$LD"
 
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
 
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
 
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
 
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
 
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
 
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
 
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
 
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
 
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
 
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
 
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
 
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
 
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
 
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fpic'
+	lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
 
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
 
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
+    solaris*)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_F77='-Wl,';;
+      esac
+      ;;
 
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
 
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
 
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
 
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
 
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
 
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
 
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:16429: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:16433: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_F77=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_F77=yes
+       fi
+     else
+       lt_prog_compiler_static_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; }
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
+if test x"$lt_prog_compiler_static_works_F77" = xyes; then
+    :
+else
+    lt_prog_compiler_static_F77=
+fi
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-# ### END LIBTOOL TAG CONFIG: $tagname
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:16533: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:16537: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
 
-__EOF__
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
 
 
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
   fi
+else
+  need_locks=no
 fi
 
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-
-	else
-	  tagname=""
-	fi
-	;;
-
-      F77)
-	if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+  ld_shlibs_F77=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
 
-# Code to be used in simple link tests
-lt_simple_link_test_code="      program t\n      end\n"
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <&2
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
+EOF
+      fi
+      ;;
 
+    amigaos*)
+      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
 
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+      # Samuel A. Falvo II  reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
 
-echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach  says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
 
-echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
-test "$can_build_shared" = "no" && enable_shared=no
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case "$host_os" in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-aix4* | aix5*)
-  test "$enable_shared" = yes && enable_static=no
-  ;;
-esac
-echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
 
-echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6
+    interix3*)
+      hardcode_direct_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_F77='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
 
-test "$ld_shlibs_F77" = no && can_build_shared=no
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
-GCC_F77="$G77"
-LD_F77="$LD"
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
 
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <&2
 
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl_F77='-Wl,'
-    lt_prog_compiler_static_F77='-static'
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
 
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_F77='-Bstatic'
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
       fi
       ;;
 
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
-      ;;
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_F77=no
+	cat <<_LT_EOF 1>&2
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    ld_shlibs_F77=no
+	  fi
+	;;
+      esac
       ;;
 
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
       ;;
 
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_F77='-fno-common'
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
       ;;
+    esac
 
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared_F77=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_F77=-Kconform_pic
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
       fi
       ;;
 
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case "$host_cpu" in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_F77='-fPIC'
-	;;
-      esac
-      ;;
-
-    *)
-      lt_prog_compiler_pic_F77='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl_F77='-Wl,'
+    aix4* | aix5*)
       if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_F77='-Bstatic'
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
       else
-	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case "$cc_basename" in
-         xlc*)
-         lt_prog_compiler_pic_F77='-qnocommon'
-         lt_prog_compiler_wl_F77='-Wl,'
-         ;;
-       esac
-       ;;
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
 
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
-      ;;
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+	  for ld_flag in $LDFLAGS; do
+  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+  	    aix_use_runtimelinking=yes
+  	    break
+  	  fi
+	  done
+	  ;;
+	esac
 
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case "$host_cpu" in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_F77='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
-      ;;
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
 
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
-    newsos6)
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
 
-    linux*)
-      case $CC in
-      icc* | ecc*)
-	lt_prog_compiler_wl_F77='-Wl,'
-	lt_prog_compiler_pic_F77='-KPIC'
-	lt_prog_compiler_static_F77='-static'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl_F77='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static_F77='-non_shared'
-        ;;
-      esac
-      ;;
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  hardcode_direct_F77=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_F77=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  hardcode_minus_L_F77=yes
+  	  hardcode_libdir_flag_spec_F77='-L$libdir'
+  	  hardcode_libdir_separator_F77=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
 
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
 
-    sco3.2v5*)
-      lt_prog_compiler_pic_F77='-Kpic'
-      lt_prog_compiler_static_F77='-dn'
-      ;;
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
 
-    solaris*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    sunos4*)
-      lt_prog_compiler_wl_F77='-Qoption ld '
-      lt_prog_compiler_pic_F77='-PIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
+fi
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic_F77='-Kconform_pic'
-	lt_prog_compiler_static_F77='-Bstatic'
-      fi
-      ;;
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-    uts4*)
-      lt_prog_compiler_pic_F77='-pic'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+      program main
 
-    *)
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
-    esac
-  fi
-
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
-
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_pic_works_F77=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_F77"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15076: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:15080: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
-       lt_prog_compiler_pic_works_F77=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
-
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
-    case $lt_prog_compiler_pic_F77 in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
-     esac
-else
-    lt_prog_compiler_pic_F77=
-     lt_prog_compiler_can_build_shared_F77=no
-fi
-
-fi
-case "$host_os" in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_F77=
-    ;;
-  *)
-    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
-    ;;
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
 else
-  lt_cv_prog_compiler_c_o_F77=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15136: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:15140: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s out/conftest.err; then
-       lt_cv_prog_compiler_c_o_F77=yes
-     fi
-   fi
-   chmod u+w .
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
-
-  runpath_var=
-  allow_undefined_flag_F77=
-  enable_shared_with_static_runtimes_F77=no
-  archive_cmds_F77=
-  archive_expsym_cmds_F77=
-  old_archive_From_new_cmds_F77=
-  old_archive_from_expsyms_cmds_F77=
-  export_dynamic_flag_spec_F77=
-  whole_archive_flag_spec_F77=
-  thread_safe_flag_spec_F77=
-  hardcode_libdir_flag_spec_F77=
-  hardcode_libdir_flag_spec_ld_F77=
-  hardcode_libdir_separator_F77=
-  hardcode_direct_F77=no
-  hardcode_minus_L_F77=no
-  hardcode_shlibpath_var_F77=unsupported
-  link_all_deplibs_F77=unknown
-  hardcode_automatic_F77=no
-  module_cmds_F77=
-  module_expsym_cmds_F77=
-  always_export_symbols_F77=no
-  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms_F77=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs_F77=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs_F77=no
-	cat <&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-EOF
+	 hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_F77='$convenience'
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
       fi
       ;;
 
@@ -15264,827 +17121,502 @@ EOF
       archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
       hardcode_libdir_flag_spec_F77='-L$libdir'
       hardcode_minus_L_F77=yes
-
-      # Samuel A. Falvo II  reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
+      # see comment about different semantics on the GNU ld section
       ld_shlibs_F77=no
       ;;
 
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag_F77=unsupported
-	# Joseph Beckenbach  says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
       ;;
 
     cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec_F77='-L$libdir'
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_F77=' '
       allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=no
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_F77=yes
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      ;;
 
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
-      else
-	ld_shlibs=no
-      fi
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_F77=no
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77=''
+      link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
+    fi
       ;;
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
       ;;
 
-    solaris* | sysv5*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	ld_shlibs_F77=no
-	cat <&2
+    freebsd1*)
+      ld_shlibs_F77=no
+      ;;
 
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
       ;;
 
-    sunos4*)
-      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
       hardcode_direct_F77=yes
       hardcode_shlibpath_var_F77=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_cmds_F77="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
-        archive_expsym_cmds_F77="$tmp_archive_cmds"
+	archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
-    else
-      ld_shlibs_F77=no
-    fi
-    ;;
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
 
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
       ;;
-    esac
 
-    if test "$ld_shlibs_F77" = yes; then
-      runpath_var=LD_RUN_PATH
-      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
-      export_dynamic_flag_spec_F77='${wl}--export-dynamic'
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- 	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
-  	whole_archive_flag_spec_F77=
+	archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=yes
-      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L_F77=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct_F77=unsupported
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_F77=:
+
+	hardcode_direct_F77=yes
+	export_dynamic_flag_spec_F77='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_F77=yes
       fi
       ;;
 
-    aix4* | aix5*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
       else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_F77=:
 
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	*)
+	  hardcode_direct_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
 	esac
+      fi
+      ;;
 
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
       fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
 
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
 
-      archive_cmds_F77=''
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct_F77=yes
-      hardcode_libdir_separator_F77=':'
-      link_all_deplibs_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
 
-      if test "$GCC" = yes; then
-	case $host_os in aix4.012|aix4.012.*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  hardcode_direct_F77=yes
-	  else
-  	  # We have old collect2
-  	  hardcode_direct_F77=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L_F77=yes
-  	  hardcode_libdir_flag_spec_F77='-L$libdir'
-  	  hardcode_libdir_separator_F77=
-	  fi
-	esac
-	shared_flag='-shared'
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_F77='${wl}-E'
       else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-  	if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-  	fi
-	fi
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_F77='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	   ;;
+       esac
       fi
+      ;;
 
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols_F77=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag_F77='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
-      program main
-
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag_F77="-z nodefs"
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 cat >conftest.$ac_ext <<_ACEOF
-      program main
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
 
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
 
-	 hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag_F77=' ${wl}-bernotok'
-	  allow_undefined_flag_F77=' ${wl}-berok'
-	  # -bexpall does not export symbols beginning with underscore (_)
-	  always_export_symbols_F77=yes
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_F77=' '
-	  archive_cmds_need_lc_F77=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
       fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs_F77=yes
       ;;
 
-    amigaos*)
-      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
       hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
       hardcode_minus_L_F77=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs_F77=no
+      hardcode_shlibpath_var_F77=no
       ;;
 
-    bsdi[45]*)
-      export_dynamic_flag_spec_F77=-rdynamic
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
       ;;
 
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec_F77=' '
-      allow_undefined_flag_F77=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds_F77='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes_F77=yes
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
       ;;
 
-    darwin* | rhapsody*)
-      case "$host_os" in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc_F77=no
-      hardcode_direct_F77=no
-      hardcode_automatic_F77=yes
-      hardcode_shlibpath_var_F77=unsupported
-      whole_archive_flag_spec_F77=''
-      link_all_deplibs_F77=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case "$cc_basename" in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_F77=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    freebsd1*)
-      ld_shlibs_F77=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
       ;;
 
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
-      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z,text'
+      archive_cmds_need_lc_F77=no
       hardcode_shlibpath_var_F77=no
-      ;;
+      runpath_var='LD_RUN_PATH'
 
-    hpux9*)
       if test "$GCC" = yes; then
-	archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      hardcode_direct_F77=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L_F77=yes
-      export_dynamic_flag_spec_F77='${wl}-E'
-      ;;
-
-    hpux10* | hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
+	archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  ;;
-	*)
-	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*)
-	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
-	  hardcode_libdir_separator_F77=:
-	  hardcode_direct_F77=no
-	  hardcode_shlibpath_var_F77=no
-	  ;;
-	ia64*)
-	  hardcode_libdir_flag_spec_F77='-L$libdir'
-	  hardcode_direct_F77=no
-	  hardcode_shlibpath_var_F77=no
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_F77=yes
-	  ;;
-	*)
-	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-	  hardcode_libdir_separator_F77=:
-	  hardcode_direct_F77=yes
-	  export_dynamic_flag_spec_F77='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_F77=yes
-	  ;;
-	esac
+	archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_F77='${wl}-z,text'
+      allow_undefined_flag_F77='${wl}-z,nodefs'
+      archive_cmds_need_lc_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator_F77=':'
       link_all_deplibs_F77=yes
-      ;;
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+	archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
       ;;
 
-    newsos6)
+    uts4*)
       archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
+      hardcode_libdir_flag_spec_F77='-L$libdir'
       hardcode_shlibpath_var_F77=no
       ;;
 
-    openbsd*)
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_F77='${wl}-E'
-      else
-       case $host_os in
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   hardcode_libdir_flag_spec_F77='-R$libdir'
-	   ;;
-	 *)
-	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	   ;;
-       esac
-      fi
+    *)
+      ld_shlibs_F77=no
       ;;
+    esac
+  fi
 
-    os2*)
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-      allow_undefined_flag_F77=unsupported
-      archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6; }
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
       ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+	pic_flag=$lt_prog_compiler_pic_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_F77=no
+        else
+	  archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
       else
-	allow_undefined_flag_F77=' -expect_unresolved \*'
-	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+        cat conftest.err 1>&5
       fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
       ;;
+    esac
+  fi
+  ;;
+esac
 
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag_F77=' -expect_unresolved \*'
-	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_separator_F77=:
-      ;;
-
-    sco3.2v5*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_F77=no
-      export_dynamic_flag_spec_F77='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
-    solaris*)
-      no_undefined_flag_F77=' -z text'
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_shlibpath_var_F77=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-	whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
-      esac
-      link_all_deplibs_F77=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_F77=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds_F77='$CC -r -o $output$reload_objs'
-	  hardcode_direct_F77=no
-        ;;
-	motorola)
-	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_F77=no
-      export_dynamic_flag_spec_F77='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var_F77=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs_F77=yes
-      fi
-      ;;
-
-    sysv4.2uw2*)
-      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=no
-      hardcode_shlibpath_var_F77=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
-
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      no_undefined_flag_F77='${wl}-z ${wl}text'
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    sysv5*)
-      no_undefined_flag_F77=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      hardcode_libdir_flag_spec_F77=
-      hardcode_shlibpath_var_F77=no
-      runpath_var='LD_RUN_PATH'
-      ;;
-
-    uts4*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    *)
-      ld_shlibs_F77=no
-      ;;
-    esac
-  fi
-
-echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_F77=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_F77 in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_F77
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
-        allow_undefined_flag_F77=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_F77=no
-        else
-	  archive_cmds_need_lc_F77=yes
-        fi
-        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -16213,7 +17745,8 @@ cygwin* | mingw* | pw32*)
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -16243,7 +17776,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -16266,7 +17799,7 @@ darwin* | rhapsody*)
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -16301,8 +17834,17 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -16320,14 +17862,19 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -16347,7 +17894,7 @@ hpux9* | hpux10* | hpux11*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -16387,6 +17934,18 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -16446,7 +18005,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -16508,8 +18067,13 @@ nto-qnx*)
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  need_version=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -16547,13 +18111,6 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -16579,7 +18136,7 @@ sunos4*)
   need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -16612,6 +18169,29 @@ sysv4*MP*)
   fi
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -16623,12 +18203,17 @@ uts4*)
   dynamic_linker=no
   ;;
 esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
 hardcode_action_F77=
 if test -n "$hardcode_libdir_flag_spec_F77" || \
    test -n "$runpath_var_F77" || \
@@ -16652,8 +18237,8 @@ else
   # directories.
   hardcode_action_F77=unsupported
 fi
-echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6
+{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6; }
 
 if test "$hardcode_action_F77" = relink; then
   # Fast installation is not supported
@@ -16664,36 +18249,6 @@ elif test "$shlibpath_overrides_runpath" = yes ||
   enable_fast_install=needless
 fi
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
-fi
-
-
 
 # The else clause should only fire when bootstrapping the
 # libtool distribution, otherwise you forgot to ship ltmain.sh
@@ -16708,7 +18263,7 @@ if test -f "$ltmain"; then
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -16809,6 +18364,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -16820,6 +18381,9 @@ AR_FLAGS=$lt_AR_FLAGS
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_compiler_F77
 
@@ -16885,7 +18449,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -17111,7 +18675,6 @@ CC="$lt_save_CC"
 	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
 
 
-
 # Source file extension for Java test sources.
 ac_ext=java
 
@@ -17123,26 +18686,55 @@ objext_GCJ=$objext
 lt_simple_compile_test_code="class foo {}\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
 
-# Allow CC to be a program name with arguments.
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${GCJ-"gcj"}
 compiler=$CC
 compiler_GCJ=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
 archive_cmds_need_lc_GCJ=no
 
+old_archive_cmds_GCJ=$old_archive_cmds
+
 ## CAVEAT EMPTOR:
 ## There is no encapsulation within the following macros, do not change
 ## the running order or otherwise move them around unless you know exactly
@@ -17154,8 +18746,8 @@ if test "$GCC" = yes; then
   lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
 
 
-echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -17169,26 +18761,28 @@ else
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17175: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18767: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17179: \$? = $ac_status" >&5
+   echo "$as_me:18771: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
     lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
@@ -17202,8 +18796,8 @@ lt_prog_compiler_wl_GCJ=
 lt_prog_compiler_pic_GCJ=
 lt_prog_compiler_static_GCJ=
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
   if test "$GCC" = yes; then
     lt_prog_compiler_wl_GCJ='-Wl,'
@@ -17241,6 +18835,11 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       lt_prog_compiler_pic_GCJ='-fno-common'
       ;;
 
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
     msdosdjgpp*)
       # Just because we use GCC doesn't mean we suddenly get shared libraries
       # on systems that don't support them.
@@ -17257,7 +18856,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -17286,7 +18885,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       darwin*)
         # PIC is the default on this platform
         # Common symbols not allowed in MH_DYLIB files
-       case "$cc_basename" in
+       case $cc_basename in
          xlc*)
          lt_prog_compiler_pic_GCJ='-qnocommon'
          lt_prog_compiler_wl_GCJ='-Wl,'
@@ -17304,7 +18903,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       lt_prog_compiler_wl_GCJ='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -17328,12 +18927,19 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       ;;
 
     linux*)
-      case $CC in
+      case $cc_basename in
       icc* | ecc*)
 	lt_prog_compiler_wl_GCJ='-Wl,'
 	lt_prog_compiler_pic_GCJ='-KPIC'
 	lt_prog_compiler_static_GCJ='-static'
         ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-fpic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+        ;;
       ccc*)
         lt_prog_compiler_wl_GCJ='-Wl,'
         # All Alpha code is PIC.
@@ -17348,15 +18954,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       lt_prog_compiler_static_GCJ='-non_shared'
       ;;
 
-    sco3.2v5*)
-      lt_prog_compiler_pic_GCJ='-Kpic'
-      lt_prog_compiler_static_GCJ='-dn'
-      ;;
-
     solaris*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
       lt_prog_compiler_pic_GCJ='-KPIC'
       lt_prog_compiler_static_GCJ='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_GCJ='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -17365,7 +18971,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       lt_prog_compiler_static_GCJ='-Bstatic'
       ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sysv4 | sysv4.2uw2* | sysv4.3*)
       lt_prog_compiler_wl_GCJ='-Wl,'
       lt_prog_compiler_pic_GCJ='-KPIC'
       lt_prog_compiler_static_GCJ='-Bstatic'
@@ -17378,6 +18984,17 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       fi
       ;;
 
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+
     uts4*)
       lt_prog_compiler_pic_GCJ='-pic'
       lt_prog_compiler_static_GCJ='-Bstatic'
@@ -17389,16 +19006,16 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
     esac
   fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic_GCJ"; then
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -17412,26 +19029,28 @@ else
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17418: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19035: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17422: \$? = $ac_status" >&5
+   echo "$as_me:19039: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works_GCJ=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
 
 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
     case $lt_prog_compiler_pic_GCJ in
@@ -17444,7 +19063,7 @@ else
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_GCJ=
@@ -17454,8 +19073,50 @@ case "$host_os" in
     ;;
 esac
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_GCJ=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_GCJ=yes
+       fi
+     else
+       lt_prog_compiler_static_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; }
+
+if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
+    :
+else
+    lt_prog_compiler_static_GCJ=
+fi
+
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -17472,23 +19133,25 @@ else
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17478: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19139: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:17482: \$? = $ac_status" >&5
+   echo "$as_me:19143: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_GCJ=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -17499,23 +19162,23 @@ else
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
   if test "$hard_links" = no; then
     { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
@@ -17525,8 +19188,8 @@ else
   need_locks=no
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
   runpath_var=
   allow_undefined_flag_GCJ=
@@ -17564,6 +19227,16 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -17574,6 +19247,10 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
       with_gnu_ld=no
     fi
     ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
   openbsd*)
     with_gnu_ld=no
     ;;
@@ -17584,6 +19261,27 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
     # See if GNU ld supports shared libraries.
     case $host_os in
     aix3* | aix4* | aix5*)
@@ -17634,10 +19332,10 @@ EOF
       allow_undefined_flag_GCJ=unsupported
       always_export_symbols_GCJ=no
       enable_shared_with_static_runtimes_GCJ=yes
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
 	archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -17646,9 +19344,55 @@ EOF
 	  echo EXPORTS > $output_objdir/$soname.def;
 	  cat $export_symbols >> $output_objdir/$soname.def;
 	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
-	ld_shlibs=no
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    interix3*)
+      hardcode_direct_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_GCJ=no
       fi
       ;;
 
@@ -17662,7 +19406,7 @@ EOF
       fi
       ;;
 
-    solaris* | sysv5*)
+    solaris*)
       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
 	ld_shlibs_GCJ=no
 	cat <&2
@@ -17683,6 +19427,33 @@ EOF
       fi
       ;;
 
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_GCJ=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    ld_shlibs_GCJ=no
+	  fi
+	;;
+      esac
+      ;;
+
     sunos4*)
       archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       wlarc=
@@ -17690,31 +19461,6 @@ EOF
       hardcode_shlibpath_var_GCJ=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_cmds_GCJ="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        archive_expsym_cmds_GCJ="$tmp_archive_cmds"
-      fi
-    else
-      ld_shlibs_GCJ=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -17725,16 +19471,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       ;;
     esac
 
-    if test "$ld_shlibs_GCJ" = yes; then
-      runpath_var=LD_RUN_PATH
-      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
-      export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- 	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_GCJ=
-      fi
+    if test "$ld_shlibs_GCJ" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_GCJ=
+      export_dynamic_flag_spec_GCJ=
+      whole_archive_flag_spec_GCJ=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -17746,7 +19487,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L_GCJ=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct_GCJ=unsupported
@@ -17780,6 +19521,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
   	    break
   	  fi
 	  done
+	  ;;
 	esac
 
 	exp_sym_flag='-bexport'
@@ -17798,7 +19540,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       link_all_deplibs_GCJ=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.012|aix4.012.*)
+	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -17817,8 +19559,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
   	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
   	  hardcode_libdir_separator_GCJ=
 	  fi
+	  ;;
 	esac
 	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -17826,11 +19572,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
   	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-  	if test "$aix_use_runtimelinking" = yes; then
+	  if test "$aix_use_runtimelinking" = yes; then
 	    shared_flag='${wl}-G'
 	  else
 	    shared_flag='${wl}-bM:SRE'
-  	fi
+	  fi
 	fi
       fi
 
@@ -17858,24 +19604,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -17889,18 +19647,20 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
        hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
        else
 	if test "$host_cpu" = ia64; then
 	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag_GCJ="-z nodefs"
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an empty executable.
 	 cat >conftest.$ac_ext <<_ACEOF
@@ -17919,24 +19679,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -17950,8 +19722,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
@@ -17960,13 +19734,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	  # -berok will link without error, but may produce a broken library.
 	  no_undefined_flag_GCJ=' ${wl}-bernotok'
 	  allow_undefined_flag_GCJ=' ${wl}-berok'
-	  # -bexpall does not export symbols beginning with underscore (_)
-	  always_export_symbols_GCJ=yes
 	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_GCJ=' '
+	  whole_archive_flag_spec_GCJ='$convenience'
 	  archive_cmds_need_lc_GCJ=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -18000,12 +19772,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       old_archive_From_new_cmds_GCJ='true'
       # FIXME: Should let the user specify the lib program.
       old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_GCJ=yes
       ;;
 
     darwin* | rhapsody*)
-      case "$host_os" in
+      case $host_os in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
          ;;
@@ -18034,16 +19806,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     	output_verbose_link_cmd='echo'
         archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
       archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
       module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
-      case "$cc_basename" in
+      case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
          archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
          module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -18084,7 +19856,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec_GCJ='-R$libdir'
       hardcode_direct_GCJ=yes
@@ -18107,47 +19879,62 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       export_dynamic_flag_spec_GCJ='${wl}-E'
       ;;
 
-    hpux10* | hpux11*)
+    hpux10*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*|ia64*)
+	archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_GCJ=:
+
+	hardcode_direct_GCJ=yes
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_GCJ=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
 	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
 	  archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*)
-	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_GCJ=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
 	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
-	  hardcode_libdir_separator_GCJ=:
 	  hardcode_direct_GCJ=no
 	  hardcode_shlibpath_var_GCJ=no
 	  ;;
-	ia64*)
-	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
-	  hardcode_direct_GCJ=no
-	  hardcode_shlibpath_var_GCJ=no
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_GCJ=yes
-	  ;;
 	*)
-	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-	  hardcode_libdir_separator_GCJ=:
 	  hardcode_direct_GCJ=yes
 	  export_dynamic_flag_spec_GCJ='${wl}-E'
 
@@ -18241,7 +20028,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	allow_undefined_flag_GCJ=' -expect_unresolved \*'
 	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
@@ -18249,21 +20036,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_libdir_separator_GCJ=:
       ;;
 
-    sco3.2v5*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_GCJ=no
-      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
     solaris*)
       no_undefined_flag_GCJ=' -z text'
       if test "$GCC" = yes; then
+	wlarc='${wl}'
 	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+	wlarc=''
 	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -18272,8 +20053,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var_GCJ=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-	whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
       esac
       link_all_deplibs_GCJ=yes
       ;;
@@ -18330,36 +20121,45 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       fi
       ;;
 
-    sysv4.2uw2*)
-      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=no
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z,text'
+      archive_cmds_need_lc_GCJ=no
       hardcode_shlibpath_var_GCJ=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+      runpath_var='LD_RUN_PATH'
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      no_undefined_flag_GCJ='${wl}-z ${wl}text'
       if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_GCJ=no
       ;;
 
-    sysv5*)
-      no_undefined_flag_GCJ=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      hardcode_libdir_flag_spec_GCJ=
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_GCJ='${wl}-z,text'
+      allow_undefined_flag_GCJ='${wl}-z,nodefs'
+      archive_cmds_need_lc_GCJ=no
       hardcode_shlibpath_var_GCJ=no
+      hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
       ;;
 
     uts4*)
@@ -18374,15 +20174,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     esac
   fi
 
-echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
 test "$ld_shlibs_GCJ" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
 #
 # Do we need to explicitly link libc?
 #
@@ -18400,8 +20195,8 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
@@ -18415,6 +20210,7 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
         libobjs=conftest.$ac_objext
         deplibs=
         wl=$lt_prog_compiler_wl_GCJ
+	pic_flag=$lt_prog_compiler_pic_GCJ
         compiler_flags=-v
         linker_flags=-v
         verstring=
@@ -18437,16 +20233,16 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
         cat conftest.err 1>&5
       fi
       $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -18575,7 +20371,8 @@ cygwin* | mingw* | pw32*)
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -18605,7 +20402,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -18628,7 +20425,7 @@ darwin* | rhapsody*)
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -18663,8 +20460,17 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -18682,14 +20488,19 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -18709,7 +20520,7 @@ hpux9* | hpux10* | hpux11*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -18749,6 +20560,18 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -18808,7 +20631,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -18844,1021 +20667,212 @@ netbsd*)
   else
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
     soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
-test "$dynamic_linker" = no && can_build_shared=no
-
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
-   test -n "$runpath_var_GCJ" || \
-   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_GCJ" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
-     test "$hardcode_minus_L_GCJ" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_GCJ=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_GCJ=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_GCJ=unsupported
-fi
-echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6
-
-if test "$hardcode_action_GCJ" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
-fi
-
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-
-fi
-
-   ;;
-
-  *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define shl_load to an innocuous variant, in case  declares shl_load.
-   For example, HP-UX 11i  declares gettimeofday.  */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load (); below.
-    Prefer  to  if __STDC__ is defined, since
-     exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include 
-#else
-# include 
-#endif
-
-#undef shl_load
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != shl_load;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
-  lt_cv_dlopen="shl_load"
-else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-int
-main ()
-{
-shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define dlopen to an innocuous variant, in case  declares dlopen.
-   For example, HP-UX 11i  declares gettimeofday.  */
-#define dlopen innocuous_dlopen
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen (); below.
-    Prefer  to  if __STDC__ is defined, since
-     exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include 
-#else
-# include 
-#endif
-
-#undef dlopen
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != dlopen;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
-  lt_cv_dlopen="dlopen"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_svld_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_dld_link=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <
-#endif
-
-#include 
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
+    dynamic_linker='NetBSD ld.elf_so'
   fi
-fi
-rm -fr conftest*
-
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <
-#endif
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
 
-#include 
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
 
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
     esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
   fi
-fi
-rm -fr conftest*
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
 
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
-    fi
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
 
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
 
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
+
+if test "$hardcode_action_GCJ" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
 fi
 
 
@@ -19875,7 +20889,7 @@ if test -f "$ltmain"; then
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -19976,6 +20990,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -19987,6 +21007,9 @@ AR_FLAGS=$lt_AR_FLAGS
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_compiler_GCJ
 
@@ -20052,7 +21075,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -20277,7 +21300,6 @@ CC="$lt_save_CC"
       RC)
 
 
-
 # Source file extension for RC test sources.
 ac_ext=rc
 
@@ -20296,15 +21318,42 @@ lt_simple_link_test_code="$lt_simple_compile_test_code"
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${RC-"windres"}
 compiler=$CC
 compiler_RC=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
 lt_cv_prog_compiler_c_o_RC=yes
 
 # The else clause should only fire when bootstrapping the
@@ -20320,7 +21369,7 @@ if test -f "$ltmain"; then
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -20421,6 +21470,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -20432,6 +21487,9 @@ AR_FLAGS=$lt_AR_FLAGS
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_compiler_RC
 
@@ -20497,7 +21555,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -20778,8 +21836,8 @@ LIBTOOL_PROG="${SHELL} ./libtool"
 
 # Set SOSUFFIX and friends
 
-	echo "$as_me:$LINENO: checking SOSUFFIX from libtool" >&5
-echo $ECHO_N "checking SOSUFFIX from libtool... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking SOSUFFIX from libtool" >&5
+echo $ECHO_N "checking SOSUFFIX from libtool... $ECHO_C" >&6; }
 	module=no
 
 	versuffix=""
@@ -20800,13 +21858,13 @@ echo "$as_me: WARNING: assuming $_SUFFIX suffix for dynamic libraries." >&2;}
         fi
 
         SOSUFFIX=$_SOSUFFIX
-	echo "$as_me:$LINENO: result: $SOSUFFIX" >&5
-echo "${ECHO_T}$SOSUFFIX" >&6
+	{ echo "$as_me:$LINENO: result: $SOSUFFIX" >&5
+echo "${ECHO_T}$SOSUFFIX" >&6; }
 
 
 
-	echo "$as_me:$LINENO: checking MODSUFFIX from libtool" >&5
-echo $ECHO_N "checking MODSUFFIX from libtool... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking MODSUFFIX from libtool" >&5
+echo $ECHO_N "checking MODSUFFIX from libtool... $ECHO_C" >&6; }
 	module=yes
 
 	versuffix=""
@@ -20827,13 +21885,13 @@ echo "$as_me: WARNING: assuming $_SUFFIX suffix for dynamic libraries." >&2;}
         fi
 
         MODSUFFIX=$_SOSUFFIX
-	echo "$as_me:$LINENO: result: $MODSUFFIX" >&5
-echo "${ECHO_T}$MODSUFFIX" >&6
+	{ echo "$as_me:$LINENO: result: $MODSUFFIX" >&5
+echo "${ECHO_T}$MODSUFFIX" >&6; }
 
 
 
-	echo "$as_me:$LINENO: checking JMODSUFFIX from libtool" >&5
-echo $ECHO_N "checking JMODSUFFIX from libtool... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking JMODSUFFIX from libtool" >&5
+echo $ECHO_N "checking JMODSUFFIX from libtool... $ECHO_C" >&6; }
 	module=yes
 
 	versuffix=""
@@ -20858,8 +21916,8 @@ echo "$as_me: WARNING: assuming $_SUFFIX suffix for dynamic libraries." >&2;}
 	else
             JMODSUFFIX=$_SOSUFFIX
 	fi
-	echo "$as_me:$LINENO: result: $JMODSUFFIX" >&5
-echo "${ECHO_T}$JMODSUFFIX" >&6
+	{ echo "$as_me:$LINENO: result: $JMODSUFFIX" >&5
+echo "${ECHO_T}$JMODSUFFIX" >&6; }
 
 
 
@@ -20905,7 +21963,7 @@ case "$host_os" in
     ;;
     *)
         LIBTSO_MODULE="-module"
-        LIBTSO_MODSUFFIX=@MODSUFFIX@
+        LIBTSO_MODSUFFIX=$MODSUFFIX
     ;;
 esac
 
@@ -20956,8 +22014,8 @@ if test "x$JAVAPREFIX" = x; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_JAVAC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20970,25 +22028,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_JAVAC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 JAVAC=$ac_cv_prog_JAVAC
 if test -n "$JAVAC"; then
-  echo "$as_me:$LINENO: result: $JAVAC" >&5
-echo "${ECHO_T}$JAVAC" >&6
+  { echo "$as_me:$LINENO: result: $JAVAC" >&5
+echo "${ECHO_T}$JAVAC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$JAVAC" && break
 done
 
@@ -20997,8 +22057,8 @@ else
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_JAVAC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21011,25 +22071,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_JAVAC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 JAVAC=$ac_cv_prog_JAVAC
 if test -n "$JAVAC"; then
-  echo "$as_me:$LINENO: result: $JAVAC" >&5
-echo "${ECHO_T}$JAVAC" >&6
+  { echo "$as_me:$LINENO: result: $JAVAC" >&5
+echo "${ECHO_T}$JAVAC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$JAVAC" && break
 done
 test -n "$JAVAC" || JAVAC="$JAVAPREFIX"
@@ -21039,8 +22101,8 @@ test "x$JAVAC" = x && { { echo "$as_me:$LINENO: error: no acceptable Java compil
 echo "$as_me: error: no acceptable Java compiler found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:$LINENO: checking if $JAVAC works" >&5
-echo $ECHO_N "checking if $JAVAC works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $JAVAC works" >&5
+echo $ECHO_N "checking if $JAVAC works... $ECHO_C" >&6; }
 if test "${ac_cv_prog_javac_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21048,7 +22110,7 @@ else
 JAVA_TEST=Test.java
 CLASS_TEST=Test.class
 cat << \EOF > $JAVA_TEST
-/* #line 21051 "configure" */
+/* #line 22113 "configure" */
 public class Test {
 }
 EOF
@@ -21069,8 +22131,8 @@ fi
 rm -f $JAVA_TEST $CLASS_TEST
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_javac_works" >&5
-echo "${ECHO_T}$ac_cv_prog_javac_works" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_javac_works" >&5
+echo "${ECHO_T}$ac_cv_prog_javac_works" >&6; }
 
 
 
@@ -21079,8 +22141,8 @@ if test "x$JAVAPREFIX" = x; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_JAR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21093,25 +22155,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_JAR="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 JAR=$ac_cv_prog_JAR
 if test -n "$JAR"; then
-  echo "$as_me:$LINENO: result: $JAR" >&5
-echo "${ECHO_T}$JAR" >&6
+  { echo "$as_me:$LINENO: result: $JAR" >&5
+echo "${ECHO_T}$JAR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$JAR" && break
 done
 
@@ -21120,8 +22184,8 @@ else
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_JAR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21134,25 +22198,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_JAR="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 JAR=$ac_cv_prog_JAR
 if test -n "$JAR"; then
-  echo "$as_me:$LINENO: result: $JAR" >&5
-echo "${ECHO_T}$JAR" >&6
+  { echo "$as_me:$LINENO: result: $JAR" >&5
+echo "${ECHO_T}$JAR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$JAR" && break
 done
 test -n "$JAR" || JAR="$JAVAPREFIX"
@@ -21168,8 +22234,8 @@ if test x$JAVAPREFIX = x; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_JAVA+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21182,25 +22248,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_JAVA="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 JAVA=$ac_cv_prog_JAVA
 if test -n "$JAVA"; then
-  echo "$as_me:$LINENO: result: $JAVA" >&5
-echo "${ECHO_T}$JAVA" >&6
+  { echo "$as_me:$LINENO: result: $JAVA" >&5
+echo "${ECHO_T}$JAVA" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$JAVA" && break
 done
 
@@ -21209,8 +22277,8 @@ else
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_JAVA+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21223,25 +22291,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_JAVA="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 JAVA=$ac_cv_prog_JAVA
 if test -n "$JAVA"; then
-  echo "$as_me:$LINENO: result: $JAVA" >&5
-echo "${ECHO_T}$JAVA" >&6
+  { echo "$as_me:$LINENO: result: $JAVA" >&5
+echo "${ECHO_T}$JAVA" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$JAVA" && break
 done
 test -n "$JAVA" || JAVA="$JAVAPREFIX"
@@ -21253,8 +22323,8 @@ echo "$as_me: error: no acceptable Java virtual machine found in \$PATH" >&2;}
 
 # Extract the first word of "uudecode$EXEEXT", so it can be a program name with args.
 set dummy uudecode$EXEEXT; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_uudecode+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21267,28 +22337,30 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_uudecode="yes"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 uudecode=$ac_cv_prog_uudecode
 if test -n "$uudecode"; then
-  echo "$as_me:$LINENO: result: $uudecode" >&5
-echo "${ECHO_T}$uudecode" >&6
+  { echo "$as_me:$LINENO: result: $uudecode" >&5
+echo "${ECHO_T}$uudecode" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 if test x$uudecode = xyes; then
-echo "$as_me:$LINENO: checking if uudecode can decode base 64 file" >&5
-echo $ECHO_N "checking if uudecode can decode base 64 file... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if uudecode can decode base 64 file" >&5
+echo $ECHO_N "checking if uudecode can decode base 64 file... $ECHO_C" >&6; }
 if test "${ac_cv_prog_uudecode_base64+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21307,15 +22379,15 @@ EOF
 if uudecode$EXEEXT Test.uue; then
         ac_cv_prog_uudecode_base64=yes
 else
-        echo "configure: 21310: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
+        echo "configure: 22382: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
         echo "configure: failed file was:" >&5
         cat Test.uue >&5
         ac_cv_prog_uudecode_base64=no
 fi
 rm -f Test.uue
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_uudecode_base64" >&5
-echo "${ECHO_T}$ac_cv_prog_uudecode_base64" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_uudecode_base64" >&5
+echo "${ECHO_T}$ac_cv_prog_uudecode_base64" >&6; }
 fi
 if test x$ac_cv_prog_uudecode_base64 != xyes; then
         rm -f Test.class
@@ -21333,8 +22405,8 @@ if test "x$JAVAPREFIX" = x; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_JAVAC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21347,25 +22419,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_JAVAC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 JAVAC=$ac_cv_prog_JAVAC
 if test -n "$JAVAC"; then
-  echo "$as_me:$LINENO: result: $JAVAC" >&5
-echo "${ECHO_T}$JAVAC" >&6
+  { echo "$as_me:$LINENO: result: $JAVAC" >&5
+echo "${ECHO_T}$JAVAC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$JAVAC" && break
 done
 
@@ -21374,8 +22448,8 @@ else
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_JAVAC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21388,25 +22462,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_JAVAC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 JAVAC=$ac_cv_prog_JAVAC
 if test -n "$JAVAC"; then
-  echo "$as_me:$LINENO: result: $JAVAC" >&5
-echo "${ECHO_T}$JAVAC" >&6
+  { echo "$as_me:$LINENO: result: $JAVAC" >&5
+echo "${ECHO_T}$JAVAC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$JAVAC" && break
 done
 test -n "$JAVAC" || JAVAC="$JAVAPREFIX"
@@ -21416,8 +22492,8 @@ test "x$JAVAC" = x && { { echo "$as_me:$LINENO: error: no acceptable Java compil
 echo "$as_me: error: no acceptable Java compiler found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:$LINENO: checking if $JAVAC works" >&5
-echo $ECHO_N "checking if $JAVAC works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $JAVAC works" >&5
+echo $ECHO_N "checking if $JAVAC works... $ECHO_C" >&6; }
 if test "${ac_cv_prog_javac_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21425,7 +22501,7 @@ else
 JAVA_TEST=Test.java
 CLASS_TEST=Test.class
 cat << \EOF > $JAVA_TEST
-/* #line 21428 "configure" */
+/* #line 22504 "configure" */
 public class Test {
 }
 EOF
@@ -21446,14 +22522,14 @@ fi
 rm -f $JAVA_TEST $CLASS_TEST
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_javac_works" >&5
-echo "${ECHO_T}$ac_cv_prog_javac_works" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_javac_works" >&5
+echo "${ECHO_T}$ac_cv_prog_javac_works" >&6; }
 
 
         fi
 fi
-echo "$as_me:$LINENO: checking if $JAVA works" >&5
-echo $ECHO_N "checking if $JAVA works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $JAVA works" >&5
+echo $ECHO_N "checking if $JAVA works... $ECHO_C" >&6; }
 if test "${ac_cv_prog_java_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21462,7 +22538,7 @@ JAVA_TEST=Test.java
 CLASS_TEST=Test.class
 TEST=Test
 cat << \EOF > $JAVA_TEST
-/* [#]line 21465 "configure" */
+/* [#]line 22541 "configure" */
 public class Test {
 public static void main (String args[]) {
         System.exit (0);
@@ -21501,8 +22577,8 @@ fi
 rm -fr $JAVA_TEST $CLASS_TEST Test.uue
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_java_works" >&5
-echo "${ECHO_T}$ac_cv_prog_java_works" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_java_works" >&5
+echo "${ECHO_T}$ac_cv_prog_java_works" >&6; }
 
 
 
@@ -21515,8 +22591,8 @@ echo "$as_me: error: '$JAVAC' undefined" >&2;}
    { (exit 1); exit 1; }; }
 # Extract the first word of "$JAVAC", so it can be a program name with args.
 set dummy $JAVAC; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path__ACJNI_JAVAC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21531,36 +22607,37 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path__ACJNI_JAVAC="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   test -z "$ac_cv_path__ACJNI_JAVAC" && ac_cv_path__ACJNI_JAVAC="$JAVAC"
   ;;
 esac
 fi
 _ACJNI_JAVAC=$ac_cv_path__ACJNI_JAVAC
-
 if test -n "$_ACJNI_JAVAC"; then
-  echo "$as_me:$LINENO: result: $_ACJNI_JAVAC" >&5
-echo "${ECHO_T}$_ACJNI_JAVAC" >&6
+  { echo "$as_me:$LINENO: result: $_ACJNI_JAVAC" >&5
+echo "${ECHO_T}$_ACJNI_JAVAC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 test ! -x "$_ACJNI_JAVAC" && { { echo "$as_me:$LINENO: error: $JAVAC could not be found in path" >&5
 echo "$as_me: error: $JAVAC could not be found in path" >&2;}
    { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking absolute path of $JAVAC" >&5
-echo $ECHO_N "checking absolute path of $JAVAC... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking absolute path of $JAVAC" >&5
+echo $ECHO_N "checking absolute path of $JAVAC... $ECHO_C" >&6; }
 case "$_ACJNI_JAVAC" in
-/*)	echo "$as_me:$LINENO: result: $_ACJNI_JAVAC" >&5
-echo "${ECHO_T}$_ACJNI_JAVAC" >&6;;
+/*)	{ echo "$as_me:$LINENO: result: $_ACJNI_JAVAC" >&5
+echo "${ECHO_T}$_ACJNI_JAVAC" >&6; };;
 *)	{ { echo "$as_me:$LINENO: error: $_ACJNI_JAVAC is not an absolute path name" >&5
 echo "$as_me: error: $_ACJNI_JAVAC is not an absolute path name" >&2;}
    { (exit 1); exit 1; }; };;
@@ -21570,16 +22647,16 @@ esac
 # find the include directory relative to the javac executable
 _cur=""$_ACJNI_JAVAC""
 while ls -ld "$_cur" 2>/dev/null | grep " -> " >/dev/null; do
-	echo "$as_me:$LINENO: checking symlink for $_cur" >&5
-echo $ECHO_N "checking symlink for $_cur... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking symlink for $_cur" >&5
+echo $ECHO_N "checking symlink for $_cur... $ECHO_C" >&6; }
 	_slink=`ls -ld "$_cur" | sed 's/.* -> //'`
 	case "$_slink" in
 	/*) _cur="$_slink";;
 	# 'X' avoids triggering unwanted echo options.
 	*) _cur=`echo "X$_cur" | sed -e 's/^X//' -e 's:[^/]*$::'`"$_slink";;
 	esac
-	echo "$as_me:$LINENO: result: $_cur" >&5
-echo "${ECHO_T}$_cur" >&6
+	{ echo "$as_me:$LINENO: result: $_cur" >&5
+echo "${ECHO_T}$_cur" >&6; }
 done
 _ACJNI_FOLLOWED="$_cur"
 
@@ -21632,8 +22709,8 @@ do
 done
 
 
-	echo "$as_me:$LINENO: checking java version" >&5
-echo $ECHO_N "checking java version... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking java version" >&5
+echo $ECHO_N "checking java version... $ECHO_C" >&6; }
         case "$JAVA" in
 	*kaffe* )
 		JAVA_VERSION=`$JAVA -version 2>&1 |
@@ -21641,8 +22718,8 @@ echo $ECHO_N "checking java version... $ECHO_C" >&6
 	* )	JAVA_VERSION=`$JAVA -version 2>&1 |
         	       	sed -e '/ version /!d' -e 's/.*"\(.*\)".*/\1/'` ;;
 	esac
-	echo "$as_me:$LINENO: result: $JAVA_VERSION" >&5
-echo "${ECHO_T}$JAVA_VERSION" >&6
+	{ echo "$as_me:$LINENO: result: $JAVA_VERSION" >&5
+echo "${ECHO_T}$JAVA_VERSION" >&6; }
 	case "$JAVA_VERSION" in
 	1.[3456789]* | 1.[1-9][0-9]* | [23456789]* ) ;;
 	* )
@@ -21651,6 +22728,14 @@ echo "$as_me: error: Java version 1.3 or higher required, got $JAVA_VERSION" >&2
    { (exit 1); exit 1; }; } ;;
 	esac
 
+	# Because of the code that SWIG generates to cast between pointers and
+	# integers, we need to add the flag "-fno-strict-aliasing" to the gcc
+	# command line when compiling the JNI code.  This is documented in
+	# [#14953] and at http://www.swig.org/Doc1.3/Java.html
+	if test ${GCC} = "yes"; then
+		SWIGCFLAGS="-fno-strict-aliasing"
+	fi
+
 	for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
 	do
 		CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
@@ -21664,7 +22749,7 @@ fi
 
 # MinGW support.
 if test "$db_cv_mingw" = "yes"; then
-	OSDIR=os_win32
+	OSDIR=os_windows
 	PATH_SEPARATOR="\\\\/:"
 
 	cat >>confdefs.h <<\_ACEOF
@@ -21681,8 +22766,8 @@ else
 fi
 
 # Checks for include files, structures, C types.
-echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
-echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
+echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; }
 if test "${ac_cv_header_stat_broken+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21695,25 +22780,25 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include 
 #include 
 
-#if defined(S_ISBLK) && defined(S_IFDIR)
+#if defined S_ISBLK && defined S_IFDIR
 # if S_ISBLK (S_IFDIR)
 You lose.
 # endif
 #endif
 
-#if defined(S_ISBLK) && defined(S_IFCHR)
+#if defined S_ISBLK && defined S_IFCHR
 # if S_ISBLK (S_IFCHR)
 You lose.
 # endif
 #endif
 
-#if defined(S_ISLNK) && defined(S_IFREG)
+#if defined S_ISLNK && defined S_IFREG
 # if S_ISLNK (S_IFREG)
 You lose.
 # endif
 #endif
 
-#if defined(S_ISSOCK) && defined(S_IFREG)
+#if defined S_ISSOCK && defined S_IFREG
 # if S_ISSOCK (S_IFREG)
 You lose.
 # endif
@@ -21729,8 +22814,8 @@ fi
 rm -f conftest*
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
-echo "${ECHO_T}$ac_cv_header_stat_broken" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
+echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; }
 if test $ac_cv_header_stat_broken = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -21739,8 +22824,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
 if test "${ac_cv_header_time+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21764,24 +22849,36 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21790,12 +22887,13 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_time=no
+	ac_cv_header_time=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6; }
 if test $ac_cv_header_time = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -21812,9 +22910,9 @@ fi
 ac_header_dirent=no
 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
-echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -21836,24 +22934,36 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21862,12 +22972,14 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+	eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
@@ -21879,13 +22991,12 @@ fi
 done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
-  echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
 if test "${ac_cv_search_opendir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_func_search_save_LIBS=$LIBS
-ac_cv_search_opendir=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21893,265 +23004,527 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char opendir ();
 int
 main ()
 {
-opendir ();
+return opendir ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+for ac_lib in '' dir; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_opendir="none required"
+  ac_cv_search_opendir=$ac_res
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_opendir" = no; then
-  for ac_lib in dir; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext
+  if test "${ac_cv_search_opendir+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+  :
+else
+  ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+  { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char opendir ();
 int
 main ()
 {
-opendir ();
+return opendir ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+for ac_lib in '' x; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_opendir="-l$ac_lib"
-break
+  ac_cv_search_opendir=$ac_res
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext
+  if test "${ac_cv_search_opendir+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+  :
+else
+  ac_cv_search_opendir=no
 fi
+rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6
-if test "$ac_cv_search_opendir" != no; then
-  test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
 
-else
-  echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
-if test "${ac_cv_search_opendir+set}" = set; then
+fi
+
+
+
+
+for ac_header in sys/select.h sys/time.h sys/fcntl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_opendir=no
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char opendir ();
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------------------------- ##
+## Report this to Oracle Technology Network Berkeley DB forum ##
+## ---------------------------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
+echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; }
+if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
 int
 main ()
 {
-opendir ();
+static struct stat ac_aggr;
+if (ac_aggr.st_blksize)
+return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_opendir="none required"
+  ac_cv_member_struct_stat_st_blksize=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_opendir" = no; then
-  for ac_lib in x; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char opendir ();
+$ac_includes_default
 int
 main ()
 {
-opendir ();
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_blksize)
+return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_opendir="-l$ac_lib"
-break
+  ac_cv_member_struct_stat_st_blksize=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_cv_member_struct_stat_st_blksize=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6
-if test "$ac_cv_search_opendir" != no; then
-  test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
+echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; }
+if test $ac_cv_member_struct_stat_st_blksize = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
+
 
 fi
 
 
 
+# db.h includes  and , not the other default includes
+# autoconf usually includes.  For that reason, we specify a set of includes
+# for all type checking tests. [#5060]
+#
+# C99 says types should be in ; include  if it exists.
+#
+# Some systems have types in ; include  if it exists.
+#
+# IBM's OS/390 and z/OS releases have types in  not also found
+# in ; include  if it exists.
+db_includes="#include "
 
-for ac_header in sys/select.h sys/time.h sys/fcntl.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if test "${ac_cv_header_inttypes_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for inttypes.h" >&5
+echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_inttypes_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5
+echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking inttypes.h usability" >&5
+echo $ECHO_N "checking inttypes.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22159,27 +23532,39 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <$ac_header>
+#include 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -22188,25 +23573,31 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking inttypes.h presence" >&5
+echo $ECHO_N "checking inttypes.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include 
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -22230,198 +23621,236 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: inttypes.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to support@sleepycat.com ##
-## ------------------------------------ ##
+    { echo "$as_me:$LINENO: WARNING: inttypes.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: inttypes.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: inttypes.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: inttypes.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: inttypes.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: inttypes.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: inttypes.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: inttypes.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: inttypes.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: inttypes.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: inttypes.h: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------------------------- ##
+## Report this to Oracle Technology Network Berkeley DB forum ##
+## ---------------------------------------------------------- ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for inttypes.h" >&5
+echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_inttypes_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_cv_header_inttypes_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5
+echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+if test $ac_cv_header_inttypes_h = yes; then
 
+	db_includes="$db_includes
+#include "
+	inttypes_h_decl="#include "
 fi
 
-done
 
-echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
-echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6
-if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
+
+if test "${ac_cv_header_stdint_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for stdint.h" >&5
+echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdint_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdint_h" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking stdint.h usability" >&5
+echo $ECHO_N "checking stdint.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-static struct stat ac_aggr;
-if (ac_aggr.st_blksize)
-return 0;
-  ;
-  return 0;
-}
+#include 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_struct_stat_st_blksize=yes
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking stdint.h presence" >&5
+echo $ECHO_N "checking stdint.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static struct stat ac_aggr;
-if (sizeof ac_aggr.st_blksize)
-return 0;
-  ;
-  return 0;
-}
+#include 
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_member_struct_stat_st_blksize=yes
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_stat_st_blksize=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_header_preproc=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6
-if test $ac_cv_member_struct_stat_st_blksize = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-_ACEOF
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: stdint.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: stdint.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: stdint.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdint.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: stdint.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdint.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: stdint.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdint.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: stdint.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: stdint.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdint.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: stdint.h: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------------------------- ##
+## Report this to Oracle Technology Network Berkeley DB forum ##
+## ---------------------------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for stdint.h" >&5
+echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdint_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_stdint_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdint_h" >&6; }
 
 fi
+if test $ac_cv_header_stdint_h = yes; then
 
+	db_includes="$db_includes
+#include "
+	stdint_h_decl="#include "
+fi
 
 
-# db.h includes  and , not the other default includes
-# autoconf usually includes.  For that reason, we specify a set of includes
-# for all type checking tests. [#5060]
-#
-# C99 says types should be in ; include  if it exists.
-#
-# Some systems have types in ; include  if it exists.
-#
-# IBM's OS/390 and z/OS releases have types in  not also found
-# in ; include  if it exists.
-db_includes="#include "
 
-if test "${ac_cv_header_inttypes_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for inttypes.h" >&5
-echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6
-if test "${ac_cv_header_inttypes_h+set}" = set; then
+if test "${ac_cv_header_stddef_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for stddef.h" >&5
+echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_stddef_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5
-echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5
+echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking inttypes.h usability" >&5
-echo $ECHO_N "checking inttypes.h usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking stddef.h usability" >&5
+echo $ECHO_N "checking stddef.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22429,27 +23858,39 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include 
+#include 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -22458,25 +23899,31 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking inttypes.h presence" >&5
-echo $ECHO_N "checking inttypes.h presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking stddef.h presence" >&5
+echo $ECHO_N "checking stddef.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include 
+#include 
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -22500,74 +23947,73 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: inttypes.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: stddef.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: inttypes.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: inttypes.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: inttypes.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: inttypes.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: inttypes.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: inttypes.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: inttypes.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: inttypes.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: inttypes.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: inttypes.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: inttypes.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to support@sleepycat.com ##
-## ------------------------------------ ##
+    { echo "$as_me:$LINENO: WARNING: stddef.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: stddef.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stddef.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: stddef.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stddef.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: stddef.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stddef.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: stddef.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: stddef.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stddef.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: stddef.h: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------------------------- ##
+## Report this to Oracle Technology Network Berkeley DB forum ##
+## ---------------------------------------------------------- ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for inttypes.h" >&5
-echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6
-if test "${ac_cv_header_inttypes_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for stddef.h" >&5
+echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_stddef_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_inttypes_h=$ac_header_preproc
+  ac_cv_header_stddef_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5
-echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5
+echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; }
 
 fi
-if test $ac_cv_header_inttypes_h = yes; then
+if test $ac_cv_header_stddef_h = yes; then
 
 	db_includes="$db_includes
-#include "
-	inttypes_h_decl="#include "
+#include "
+	stddef_h_decl="#include "
 fi
 
 
 
-if test "${ac_cv_header_stdint_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for stdint.h" >&5
-echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6
-if test "${ac_cv_header_stdint_h+set}" = set; then
+if test "${ac_cv_header_unistd_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for unistd.h" >&5
+echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_unistd_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
-echo "${ECHO_T}$ac_cv_header_stdint_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5
+echo "${ECHO_T}$ac_cv_header_unistd_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking stdint.h usability" >&5
-echo $ECHO_N "checking stdint.h usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking unistd.h usability" >&5
+echo $ECHO_N "checking unistd.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22575,27 +24021,39 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include 
+#include 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -22604,25 +24062,31 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking stdint.h presence" >&5
-echo $ECHO_N "checking stdint.h presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking unistd.h presence" >&5
+echo $ECHO_N "checking unistd.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include 
+#include 
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -22646,218 +24110,310 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: stdint.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: unistd.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: stdint.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: stdint.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stdint.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: stdint.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stdint.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: stdint.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stdint.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: stdint.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: stdint.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stdint.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: stdint.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to support@sleepycat.com ##
-## ------------------------------------ ##
+    { echo "$as_me:$LINENO: WARNING: unistd.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: unistd.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: unistd.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: unistd.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: unistd.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: unistd.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: unistd.h: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------------------------- ##
+## Report this to Oracle Technology Network Berkeley DB forum ##
+## ---------------------------------------------------------- ##
 _ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for stdint.h" >&5
-echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6
-if test "${ac_cv_header_stdint_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for unistd.h" >&5
+echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_unistd_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_stdint_h=$ac_header_preproc
+  ac_cv_header_unistd_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
-echo "${ECHO_T}$ac_cv_header_stdint_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5
+echo "${ECHO_T}$ac_cv_header_unistd_h" >&6; }
 
 fi
-if test $ac_cv_header_stdint_h = yes; then
+if test $ac_cv_header_unistd_h = yes; then
 
 	db_includes="$db_includes
-#include "
-	stdint_h_decl="#include "
+#include "
+	unistd_h_decl="#include "
 fi
 
 
+db_includes="$db_includes
+#include "
 
-if test "${ac_cv_header_stddef_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for stddef.h" >&5
-echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6
-if test "${ac_cv_header_stddef_h+set}" = set; then
+# We require off_t and size_t, and we don't try to substitute our own
+# if we can't find them.
+{ echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_off_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5
-echo "${ECHO_T}$ac_cv_header_stddef_h" >&6
 else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking stddef.h usability" >&5
-echo $ECHO_N "checking stddef.h usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include 
+$db_includes
+
+typedef off_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_header_compiler=yes
+  ac_cv_type_off_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_cv_type_off_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
-# Is the header present?
-echo "$as_me:$LINENO: checking stddef.h presence" >&5
-echo $ECHO_N "checking stddef.h presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6; }
+if test $ac_cv_type_off_t = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: No off_t type." >&5
+echo "$as_me: error: No off_t type." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include 
+$db_includes
+
+typedef size_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+	ac_cv_type_size_t=no
 fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: stddef.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: stddef.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: stddef.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stddef.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: stddef.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stddef.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: stddef.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stddef.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: stddef.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: stddef.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: stddef.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: stddef.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to support@sleepycat.com ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for stddef.h" >&5
-echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6
-if test "${ac_cv_header_stddef_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
+if test $ac_cv_type_size_t = yes; then
+  :
 else
-  ac_cv_header_stddef_h=$ac_header_preproc
+  { { echo "$as_me:$LINENO: error: No size_t type." >&5
+echo "$as_me: error: No size_t type." >&2;}
+   { (exit 1); exit 1; }; }
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5
-echo "${ECHO_T}$ac_cv_header_stddef_h" >&6
 
-fi
-if test $ac_cv_header_stddef_h = yes; then
 
-	db_includes="$db_includes
-#include "
-	stddef_h_decl="#include "
+# We need to know the sizes of various objects on this system.
+{ echo "$as_me:$LINENO: checking for char" >&5
+echo $ECHO_N "checking for char... $ECHO_C" >&6; }
+if test "${ac_cv_type_char+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$db_includes
+
+typedef char ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_char=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_char=no
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
+echo "${ECHO_T}$ac_cv_type_char" >&6; }
 
-db_includes="$db_includes
-#include "
-
-# We require off_t and size_t, and we don't try to substitute our own
-# if we can't find them.
-echo "$as_me:$LINENO: checking for off_t" >&5
-echo $ECHO_N "checking for off_t... $ECHO_C" >&6
-if test "${ac_cv_type_off_t+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of char" >&5
+echo $ECHO_N "checking size of char... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  if test "$ac_cv_type_char" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -22865,64 +24421,54 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef char ac__type_sizeof_;
 int
 main ()
 {
-if ((off_t *) 0)
-  return 0;
-if (sizeof (off_t))
-  return 0;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_off_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_off_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
-echo "${ECHO_T}$ac_cv_type_off_t" >&6
-if test $ac_cv_type_off_t = yes; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: No off_t type." >&5
-echo "$as_me: error: No off_t type." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
-if test "${ac_cv_type_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -22930,67 +24476,71 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef char ac__type_sizeof_;
 int
 main ()
 {
-if ((size_t *) 0)
-  return 0;
-if (sizeof (size_t))
-  return 0;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_size_t=yes
+  ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_size_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
-if test $ac_cv_type_size_t = yes; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: No size_t type." >&5
-echo "$as_me: error: No size_t type." >&2;}
-   { (exit 1); exit 1; }; }
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
 
-
-# Check for long long and unsigned long long, we only support sequences
-# if those types are available.
-echo "$as_me:$LINENO: checking for long long" >&5
-echo $ECHO_N "checking for long long... $ECHO_C" >&6
-if test "${ac_cv_type_long_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -22998,63 +24548,135 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef char ac__type_sizeof_;
 int
 main ()
 {
-if ((long long *) 0)
-  return 0;
-if (sizeof (long long))
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$db_includes
+
+		   typedef char ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_long_long=yes
+  ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_long_long=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_long_long" >&6
-if test $ac_cv_type_long_long = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_LONG_LONG 1
-_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_lo= ac_hi=
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: checking for unsigned long long" >&5
-echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6
-if test "${ac_cv_type_unsigned_long_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23063,64 +24685,160 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef char ac__type_sizeof_;
 int
 main ()
 {
-if ((unsigned long long *) 0)
-  return 0;
-if (sizeof (unsigned long long))
-  return 0;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_unsigned_long_long=yes
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_unsigned_long_long=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6
-if test $ac_cv_type_unsigned_long_long = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_UNSIGNED_LONG_LONG 1
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_char=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (char)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; } ;;
+esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$db_includes
+
+		   typedef char ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include 
+#include 
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_char=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (char)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_char=0
 fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
+echo "${ECHO_T}$ac_cv_sizeof_char" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_CHAR $ac_cv_sizeof_char
+_ACEOF
 
 
-# We need to know the sizes of various objects on this system.
-echo "$as_me:$LINENO: checking for char" >&5
-echo $ECHO_N "checking for char... $ECHO_C" >&6
-if test "${ac_cv_type_char+set}" = set; then
+{ echo "$as_me:$LINENO: checking for unsigned char" >&5
+echo $ECHO_N "checking for unsigned char... $ECHO_C" >&6; }
+if test "${ac_cv_type_unsigned_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -23131,58 +24849,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef unsigned char ac__type_new_;
 int
 main ()
 {
-if ((char *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (char))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_char=yes
+  ac_cv_type_unsigned_char=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_char=no
+	ac_cv_type_unsigned_char=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
-echo "${ECHO_T}$ac_cv_type_char" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_char" >&5
+echo "${ECHO_T}$ac_cv_type_unsigned_char" >&6; }
 
-echo "$as_me:$LINENO: checking size of char" >&5
-echo $ECHO_N "checking size of char... $ECHO_C" >&6
-if test "${ac_cv_sizeof_char+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of unsigned char" >&5
+echo $ECHO_N "checking size of unsigned char... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_unsigned_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_char" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_unsigned_char" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -23196,10 +24928,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned char ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -23207,24 +24940,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23238,10 +24983,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned char ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -23249,24 +24995,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23275,20 +25033,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -23296,10 +25055,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned char ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -23307,24 +25067,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23338,10 +25110,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned char ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -23349,24 +25122,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23375,24 +25160,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -23404,10 +25192,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned char ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -23415,24 +25204,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23441,25 +25242,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_char=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
+?*) ac_cv_sizeof_unsigned_char=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char), 77
+echo "$as_me: error: cannot compute sizeof (unsigned char)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -23469,8 +25264,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (char)); }
-unsigned long ulongval () { return (long) (sizeof (char)); }
+		   typedef unsigned char ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -23479,69 +25275,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (char))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (char))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (char))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_char=`cat conftest.val`
+  ac_cv_sizeof_unsigned_char=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char), 77
+echo "$as_me: error: cannot compute sizeof (unsigned char)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_char=0
+  ac_cv_sizeof_unsigned_char=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
-echo "${ECHO_T}$ac_cv_sizeof_char" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_char" >&5
+echo "${ECHO_T}$ac_cv_sizeof_unsigned_char" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_CHAR $ac_cv_sizeof_char
+#define SIZEOF_UNSIGNED_CHAR $ac_cv_sizeof_unsigned_char
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for unsigned char" >&5
-echo $ECHO_N "checking for unsigned char... $ECHO_C" >&6
-if test "${ac_cv_type_unsigned_char+set}" = set; then
+{ echo "$as_me:$LINENO: checking for short" >&5
+echo $ECHO_N "checking for short... $ECHO_C" >&6; }
+if test "${ac_cv_type_short+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -23552,58 +25356,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef short ac__type_new_;
 int
 main ()
 {
-if ((unsigned char *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (unsigned char))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_unsigned_char=yes
+  ac_cv_type_short=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_unsigned_char=no
+	ac_cv_type_short=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_char" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_char" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
+echo "${ECHO_T}$ac_cv_type_short" >&6; }
 
-echo "$as_me:$LINENO: checking size of unsigned char" >&5
-echo $ECHO_N "checking size of unsigned char... $ECHO_C" >&6
-if test "${ac_cv_sizeof_unsigned_char+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of short" >&5
+echo $ECHO_N "checking size of short... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_short+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_unsigned_char" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_short" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -23617,10 +25435,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -23628,24 +25447,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23659,10 +25490,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -23670,24 +25502,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23696,20 +25540,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -23717,10 +25562,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -23728,24 +25574,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23759,10 +25617,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -23770,24 +25629,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23796,24 +25667,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -23825,10 +25699,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -23836,24 +25711,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -23862,25 +25749,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_unsigned_char=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char), 77
+?*) ac_cv_sizeof_short=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned char), 77
+echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -23890,8 +25771,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (unsigned char)); }
-unsigned long ulongval () { return (long) (sizeof (unsigned char)); }
+		   typedef short ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -23900,69 +25782,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (unsigned char))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (unsigned char))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (unsigned char))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_unsigned_char=`cat conftest.val`
+  ac_cv_sizeof_short=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned char), 77
+echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_unsigned_char=0
+  ac_cv_sizeof_short=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_char" >&5
-echo "${ECHO_T}$ac_cv_sizeof_unsigned_char" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
+echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_CHAR $ac_cv_sizeof_unsigned_char
+#define SIZEOF_SHORT $ac_cv_sizeof_short
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for short" >&5
-echo $ECHO_N "checking for short... $ECHO_C" >&6
-if test "${ac_cv_type_short+set}" = set; then
+{ echo "$as_me:$LINENO: checking for unsigned short" >&5
+echo $ECHO_N "checking for unsigned short... $ECHO_C" >&6; }
+if test "${ac_cv_type_unsigned_short+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -23973,58 +25863,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef unsigned short ac__type_new_;
 int
 main ()
 {
-if ((short *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (short))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_short=yes
+  ac_cv_type_unsigned_short=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_short=no
+	ac_cv_type_unsigned_short=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
-echo "${ECHO_T}$ac_cv_type_short" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_short" >&5
+echo "${ECHO_T}$ac_cv_type_unsigned_short" >&6; }
 
-echo "$as_me:$LINENO: checking size of short" >&5
-echo $ECHO_N "checking size of short... $ECHO_C" >&6
-if test "${ac_cv_sizeof_short+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of unsigned short" >&5
+echo $ECHO_N "checking size of unsigned short... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_unsigned_short+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_short" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_unsigned_short" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -24038,10 +25942,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -24049,24 +25954,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24080,10 +25997,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -24091,24 +26009,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24117,20 +26047,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -24138,10 +26069,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -24149,24 +26081,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24180,10 +26124,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -24191,24 +26136,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24217,24 +26174,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -24246,10 +26206,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -24257,24 +26218,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24283,25 +26256,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_short=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77
+?*) ac_cv_sizeof_unsigned_short=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short), 77
+echo "$as_me: error: cannot compute sizeof (unsigned short)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -24311,8 +26278,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (short)); }
-unsigned long ulongval () { return (long) (sizeof (short)); }
+		   typedef unsigned short ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -24321,69 +26289,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (short))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (short))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (short))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_short=`cat conftest.val`
+  ac_cv_sizeof_unsigned_short=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short), 77
+echo "$as_me: error: cannot compute sizeof (unsigned short)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_short=0
+  ac_cv_sizeof_unsigned_short=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
-echo "${ECHO_T}$ac_cv_sizeof_short" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_short" >&5
+echo "${ECHO_T}$ac_cv_sizeof_unsigned_short" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT $ac_cv_sizeof_short
+#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for unsigned short" >&5
-echo $ECHO_N "checking for unsigned short... $ECHO_C" >&6
-if test "${ac_cv_type_unsigned_short+set}" = set; then
+{ echo "$as_me:$LINENO: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6; }
+if test "${ac_cv_type_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -24394,58 +26370,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef int ac__type_new_;
 int
 main ()
 {
-if ((unsigned short *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (unsigned short))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_unsigned_short=yes
+  ac_cv_type_int=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_unsigned_short=no
+	ac_cv_type_int=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_short" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_short" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6; }
 
-echo "$as_me:$LINENO: checking size of unsigned short" >&5
-echo $ECHO_N "checking size of unsigned short... $ECHO_C" >&6
-if test "${ac_cv_sizeof_unsigned_short+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_unsigned_short" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_int" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -24459,10 +26449,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -24470,24 +26461,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24501,10 +26504,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -24512,24 +26516,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24538,20 +26554,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -24559,10 +26576,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -24570,24 +26588,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24601,10 +26631,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -24612,24 +26643,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24638,24 +26681,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -24667,10 +26713,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -24678,24 +26725,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24704,25 +26763,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_unsigned_short=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short), 77
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned short), 77
+echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -24732,8 +26785,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (unsigned short)); }
-unsigned long ulongval () { return (long) (sizeof (unsigned short)); }
+		   typedef int ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -24742,69 +26796,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (unsigned short))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (unsigned short))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (unsigned short))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_unsigned_short=`cat conftest.val`
+  ac_cv_sizeof_int=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned short), 77
+echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_unsigned_short=0
+  ac_cv_sizeof_int=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_short" >&5
-echo "${ECHO_T}$ac_cv_sizeof_unsigned_short" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short
+#define SIZEOF_INT $ac_cv_sizeof_int
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6
-if test "${ac_cv_type_int+set}" = set; then
+{ echo "$as_me:$LINENO: checking for unsigned int" >&5
+echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6; }
+if test "${ac_cv_type_unsigned_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -24815,58 +26877,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef unsigned int ac__type_new_;
 int
 main ()
 {
-if ((int *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (int))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_int=yes
+  ac_cv_type_unsigned_int=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_int=no
+	ac_cv_type_unsigned_int=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_int" >&5
+echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6; }
 
-echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6
-if test "${ac_cv_sizeof_int+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of unsigned int" >&5
+echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_unsigned_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_int" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_unsigned_int" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -24880,10 +26956,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -24891,24 +26968,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24922,10 +27011,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -24933,24 +27023,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -24959,20 +27061,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -24980,10 +27083,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -24991,24 +27095,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25022,10 +27138,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -25033,24 +27150,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25059,24 +27188,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -25088,10 +27220,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -25099,24 +27232,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25125,25 +27270,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
+?*) ac_cv_sizeof_unsigned_int=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int), 77
+echo "$as_me: error: cannot compute sizeof (unsigned int)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -25153,8 +27292,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (int)); }
-unsigned long ulongval () { return (long) (sizeof (int)); }
+		   typedef unsigned int ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -25163,69 +27303,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (int))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (int))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (int))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_int=`cat conftest.val`
+  ac_cv_sizeof_unsigned_int=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int), 77
+echo "$as_me: error: cannot compute sizeof (unsigned int)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_int=0
+  ac_cv_sizeof_unsigned_int=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
+#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for unsigned int" >&5
-echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6
-if test "${ac_cv_type_unsigned_int+set}" = set; then
+{ echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -25236,58 +27384,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef long ac__type_new_;
 int
 main ()
 {
-if ((unsigned int *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (unsigned int))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_unsigned_int=yes
+  ac_cv_type_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_unsigned_int=no
+	ac_cv_type_long=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_int" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6; }
 
-echo "$as_me:$LINENO: checking size of unsigned int" >&5
-echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6
-if test "${ac_cv_sizeof_unsigned_int+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_unsigned_int" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_long" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -25301,10 +27463,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -25312,24 +27475,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25343,10 +27518,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -25354,24 +27530,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25380,20 +27568,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -25401,10 +27590,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -25412,24 +27602,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25443,10 +27645,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -25454,24 +27657,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25480,24 +27695,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -25509,10 +27727,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -25520,24 +27739,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25546,25 +27777,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_unsigned_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned int), 77
+echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -25574,8 +27799,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (unsigned int)); }
-unsigned long ulongval () { return (long) (sizeof (unsigned int)); }
+		   typedef long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -25584,69 +27810,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (unsigned int))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (unsigned int))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (unsigned int))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_unsigned_int=`cat conftest.val`
+  ac_cv_sizeof_long=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned int), 77
+echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_unsigned_int=0
+  ac_cv_sizeof_long=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int
+#define SIZEOF_LONG $ac_cv_sizeof_long
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for long" >&5
-echo $ECHO_N "checking for long... $ECHO_C" >&6
-if test "${ac_cv_type_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking for unsigned long" >&5
+echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6; }
+if test "${ac_cv_type_unsigned_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -25657,58 +27891,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef unsigned long ac__type_new_;
 int
 main ()
 {
-if ((long *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (long))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_long=yes
+  ac_cv_type_unsigned_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_long=no
+	ac_cv_type_unsigned_long=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-echo "${ECHO_T}$ac_cv_type_long" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long" >&5
+echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6; }
 
-echo "$as_me:$LINENO: checking size of long" >&5
-echo $ECHO_N "checking size of long... $ECHO_C" >&6
-if test "${ac_cv_sizeof_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of unsigned long" >&5
+echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_unsigned_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_unsigned_long" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -25722,10 +27970,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -25733,24 +27982,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25764,10 +28025,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -25775,24 +28037,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25801,20 +28075,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -25822,10 +28097,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -25833,24 +28109,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25864,10 +28152,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -25875,24 +28164,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25901,24 +28202,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -25930,10 +28234,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -25941,24 +28246,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -25967,25 +28284,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+?*) ac_cv_sizeof_unsigned_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long), 77
+echo "$as_me: error: cannot compute sizeof (unsigned long)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -25995,8 +28306,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (long)); }
-unsigned long ulongval () { return (long) (sizeof (long)); }
+		   typedef unsigned long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -26005,69 +28317,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (long))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (long))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (long))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_long=`cat conftest.val`
+  ac_cv_sizeof_unsigned_long=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long), 77
+echo "$as_me: error: cannot compute sizeof (unsigned long)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_long=0
+  ac_cv_sizeof_unsigned_long=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
+#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for unsigned long" >&5
-echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6
-if test "${ac_cv_type_unsigned_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking for long long" >&5
+echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -26078,58 +28398,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef long long ac__type_new_;
 int
 main ()
 {
-if ((unsigned long *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (unsigned long))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_unsigned_long=yes
+  ac_cv_type_long_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_unsigned_long=no
+	ac_cv_type_long_long=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
 
-echo "$as_me:$LINENO: checking size of unsigned long" >&5
-echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6
-if test "${ac_cv_sizeof_unsigned_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of long long" >&5
+echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_unsigned_long" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_long_long" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -26143,10 +28477,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -26154,24 +28489,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26185,10 +28532,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -26196,24 +28544,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26222,20 +28582,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -26243,10 +28604,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -26254,24 +28616,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26285,10 +28659,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -26296,24 +28671,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26322,24 +28709,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -26351,10 +28741,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -26362,24 +28753,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26388,25 +28791,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_unsigned_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long), 77
+?*) ac_cv_sizeof_long_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long), 77
+echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26416,8 +28813,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (unsigned long)); }
-unsigned long ulongval () { return (long) (sizeof (unsigned long)); }
+		   typedef long long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -26426,69 +28824,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (unsigned long))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (unsigned long))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (unsigned long))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_unsigned_long=`cat conftest.val`
+  ac_cv_sizeof_long_long=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long), 77
+echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_unsigned_long=0
+  ac_cv_sizeof_long_long=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for long long" >&5
-echo $ECHO_N "checking for long long... $ECHO_C" >&6
-if test "${ac_cv_type_long_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking for unsigned long long" >&5
+echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; }
+if test "${ac_cv_type_unsigned_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -26499,58 +28905,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef unsigned long long ac__type_new_;
 int
 main ()
 {
-if ((long long *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (long long))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_long_long=yes
+  ac_cv_type_unsigned_long_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_long_long=no
+	ac_cv_type_unsigned_long_long=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_long_long" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; }
 
-echo "$as_me:$LINENO: checking size of long long" >&5
-echo $ECHO_N "checking size of long long... $ECHO_C" >&6
-if test "${ac_cv_sizeof_long_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of unsigned long long" >&5
+echo $ECHO_N "checking size of unsigned long long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_unsigned_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long_long" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_unsigned_long_long" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -26564,10 +28984,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -26575,24 +28996,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26606,10 +29039,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -26617,24 +29051,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26643,20 +29089,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -26664,10 +29111,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -26675,24 +29123,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26706,10 +29166,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -26717,24 +29178,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26743,24 +29216,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -26772,10 +29248,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef unsigned long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -26783,24 +29260,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -26809,25 +29298,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_long_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
+?*) ac_cv_sizeof_unsigned_long_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long), 77
+echo "$as_me: error: cannot compute sizeof (unsigned long long)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26837,8 +29320,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (long long)); }
-unsigned long ulongval () { return (long) (sizeof (long long)); }
+		   typedef unsigned long long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -26847,69 +29331,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (long long))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (long long))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (long long))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_long_long=`cat conftest.val`
+  ac_cv_sizeof_unsigned_long_long=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+echo "$as_me: error: cannot compute sizeof (unsigned long long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_long_long=0
+  ac_cv_sizeof_unsigned_long_long=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_long" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for unsigned long long" >&5
-echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6
-if test "${ac_cv_type_unsigned_long_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -26920,58 +29412,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef size_t ac__type_new_;
 int
 main ()
 {
-if ((unsigned long long *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (unsigned long long))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_unsigned_long_long=yes
+  ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_unsigned_long_long=no
+	ac_cv_type_size_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
 
-echo "$as_me:$LINENO: checking size of unsigned long long" >&5
-echo $ECHO_N "checking size of unsigned long long... $ECHO_C" >&6
-if test "${ac_cv_sizeof_unsigned_long_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of size_t" >&5
+echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_unsigned_long_long" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_size_t" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -26985,10 +29491,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -26996,24 +29503,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27027,10 +29546,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -27038,24 +29558,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27064,20 +29596,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -27085,10 +29618,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -27096,24 +29630,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27127,10 +29673,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -27138,24 +29685,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27164,24 +29723,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -27193,10 +29755,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -27204,24 +29767,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27230,25 +29805,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_unsigned_long_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long), 77
+?*) ac_cv_sizeof_size_t=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long long), 77
+echo "$as_me: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27258,8 +29827,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (unsigned long long)); }
-unsigned long ulongval () { return (long) (sizeof (unsigned long long)); }
+		   typedef size_t ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -27268,69 +29838,77 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (unsigned long long))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (unsigned long long))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (unsigned long long))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_unsigned_long_long=`cat conftest.val`
+  ac_cv_sizeof_size_t=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long long), 77
+echo "$as_me: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_unsigned_long_long=0
+  ac_cv_sizeof_size_t=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_long" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
-if test "${ac_cv_type_size_t+set}" = set; then
+{ echo "$as_me:$LINENO: checking for char *" >&5
+echo $ECHO_N "checking for char *... $ECHO_C" >&6; }
+if test "${ac_cv_type_char_p+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -27341,58 +29919,72 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef char * ac__type_new_;
 int
 main ()
 {
-if ((size_t *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (size_t))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_size_t=yes
+  ac_cv_type_char_p=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_size_t=no
+	ac_cv_type_char_p=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_char_p" >&5
+echo "${ECHO_T}$ac_cv_type_char_p" >&6; }
 
-echo "$as_me:$LINENO: checking size of size_t" >&5
-echo $ECHO_N "checking size of size_t... $ECHO_C" >&6
-if test "${ac_cv_sizeof_size_t+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of char *" >&5
+echo $ECHO_N "checking size of char *... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_char_p+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_size_t" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
+  if test "$ac_cv_type_char_p" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
   # This bug is HP SR number 8606223364.
@@ -27406,10 +29998,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef char * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -27417,24 +30010,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27448,10 +30053,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef char * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -27459,24 +30065,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27485,20 +30103,21 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -27506,10 +30125,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef char * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
 test_array [0] = 0
 
   ;
@@ -27517,24 +30137,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27548,10 +30180,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef char * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -27559,24 +30192,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27585,24 +30230,27 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+	ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -27614,10 +30262,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+		   typedef char * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -27625,24 +30274,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -27651,25 +30312,19 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_size_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77
+?*) ac_cv_sizeof_char_p=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char *)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (size_t), 77
+echo "$as_me: error: cannot compute sizeof (char *)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+   { (exit 77); exit 77; }; } ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27679,8 +30334,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
-long longval () { return (long) (sizeof (size_t)); }
-unsigned long ulongval () { return (long) (sizeof (size_t)); }
+		   typedef char * ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include 
 #include 
 int
@@ -27689,69 +30345,81 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
-  if (((long) (sizeof (size_t))) < 0)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      long i = longval ();
-      if (i != ((long) (sizeof (size_t))))
-	exit (1);
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (size_t))))
-	exit (1);
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_size_t=`cat conftest.val`
+  ac_cv_sizeof_char_p=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char *)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (size_t), 77
+echo "$as_me: error: cannot compute sizeof (char *)
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+   { (exit 77); exit 77; }; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_size_t=0
+  ac_cv_sizeof_char_p=0
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_char_p" >&5
+echo "${ECHO_T}$ac_cv_sizeof_char_p" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for char *" >&5
-echo $ECHO_N "checking for char *... $ECHO_C" >&6
-if test "${ac_cv_type_char_p+set}" = set; then
+
+# We look for u_char, u_short, u_int, u_long -- if we can't find them,
+# we create our own.
+
+{ echo "$as_me:$LINENO: checking for u_char" >&5
+echo $ECHO_N "checking for u_char... $ECHO_C" >&6; }
+if test "${ac_cv_type_u_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -27762,64 +30430,157 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef u_char ac__type_new_;
 int
 main ()
 {
-if ((char * *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (char *))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_char_p=yes
+  ac_cv_type_u_char=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_u_char=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_u_char" >&5
+echo "${ECHO_T}$ac_cv_type_u_char" >&6; }
+if test $ac_cv_type_u_char = yes; then
+  :
+else
+  u_char_decl="typedef unsigned char u_char;"
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking for u_short" >&5
+echo $ECHO_N "checking for u_short... $ECHO_C" >&6; }
+if test "${ac_cv_type_u_short+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$db_includes
+
+typedef u_short ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_u_short=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_char_p=no
+	ac_cv_type_u_short=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_cv_type_u_short" >&5
+echo "${ECHO_T}$ac_cv_type_u_short" >&6; }
+if test $ac_cv_type_u_short = yes; then
+  :
+else
+  u_short_decl="typedef unsigned short u_short;"
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_char_p" >&5
-echo "${ECHO_T}$ac_cv_type_char_p" >&6
 
-echo "$as_me:$LINENO: checking size of char *" >&5
-echo $ECHO_N "checking size of char *... $ECHO_C" >&6
-if test "${ac_cv_sizeof_char_p+set}" = set; then
+
+
+{ echo "$as_me:$LINENO: checking for u_int" >&5
+echo $ECHO_N "checking for u_int... $ECHO_C" >&6; }
+if test "${ac_cv_type_u_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_char_p" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -27827,41 +30588,78 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef u_int ac__type_new_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char *))) >= 0)];
-test_array [0] = 0
-
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_u_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_u_int=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int" >&5
+echo "${ECHO_T}$ac_cv_type_u_int" >&6; }
+if test $ac_cv_type_u_int = yes; then
+  :
+else
+  u_int_decl="typedef unsigned int u_int;"
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking for u_long" >&5
+echo $ECHO_N "checking for u_long... $ECHO_C" >&6; }
+if test "${ac_cv_type_u_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -27869,57 +30667,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef u_long ac__type_new_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char *))) <= $ac_mid)];
-test_array [0] = 0
-
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  ac_cv_type_u_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+	ac_cv_type_u_long=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_u_long" >&5
+echo "${ECHO_T}$ac_cv_type_u_long" >&6; }
+if test $ac_cv_type_u_long = yes; then
+  :
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  u_long_decl="typedef unsigned long u_long;"
+fi
 
-cat >conftest.$ac_ext <<_ACEOF
+
+# We look for fixed-size variants of u_char, u_short, u_int, u_long as well.
+
+{ echo "$as_me:$LINENO: checking for u_int8_t" >&5
+echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_u_int8_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -27927,41 +30747,96 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef u_int8_t ac__type_new_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char *))) < 0)];
-test_array [0] = 0
-
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_u_int8_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_u_int8_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5
+echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6; }
+if test $ac_cv_type_u_int8_t = yes; then
+  :
+else
+
+	case "1" in
+	"$ac_cv_sizeof_unsigned_int")
+		u_int8_decl="typedef unsigned int u_int8_t;";;
+	"$ac_cv_sizeof_unsigned_char")
+		u_int8_decl="typedef unsigned char u_int8_t;";;
+	"$ac_cv_sizeof_unsigned_short")
+		u_int8_decl="typedef unsigned short u_int8_t;";;
+	"$ac_cv_sizeof_unsigned_long")
+		u_int8_decl="typedef unsigned long u_int8_t;";;
+	"$ac_cv_sizeof_unsigned_long_long")
+		u_int8_decl="typedef unsigned long long u_int8_t;";;
+	*)
+		if test "" != "notfatal"; then
+			{ { echo "$as_me:$LINENO: error: No unsigned 1-byte integral type" >&5
+echo "$as_me: error: No unsigned 1-byte integral type" >&2;}
+   { (exit 1); exit 1; }; }
+		fi;;
+	esac
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking for u_int16_t" >&5
+echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_u_int16_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -27969,64 +30844,95 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef u_int16_t ac__type_new_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char *))) >= $ac_mid)];
-test_array [0] = 0
-
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+  ac_cv_type_u_int16_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
+	ac_cv_type_u_int16_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5
+echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6; }
+if test $ac_cv_type_u_int16_t = yes; then
+  :
+else
+
+	case "2" in
+	"$ac_cv_sizeof_unsigned_int")
+		u_int16_decl="typedef unsigned int u_int16_t;";;
+	"$ac_cv_sizeof_unsigned_char")
+		u_int16_decl="typedef unsigned char u_int16_t;";;
+	"$ac_cv_sizeof_unsigned_short")
+		u_int16_decl="typedef unsigned short u_int16_t;";;
+	"$ac_cv_sizeof_unsigned_long")
+		u_int16_decl="typedef unsigned long u_int16_t;";;
+	"$ac_cv_sizeof_unsigned_long_long")
+		u_int16_decl="typedef unsigned long long u_int16_t;";;
+	*)
+		if test "" != "notfatal"; then
+			{ { echo "$as_me:$LINENO: error: No unsigned 2-byte integral type" >&5
+echo "$as_me: error: No unsigned 2-byte integral type" >&2;}
+   { (exit 1); exit 1; }; }
+		fi;;
+	esac
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+
+
+
+{ echo "$as_me:$LINENO: checking for int16_t" >&5
+echo $ECHO_N "checking for int16_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_int16_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28035,148 +30941,190 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef int16_t ac__type_new_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (char *))) <= $ac_mid)];
-test_array [0] = 0
-
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  ac_cv_type_int16_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+	ac_cv_type_int16_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_char_p=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char *), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char *), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5
+echo "${ECHO_T}$ac_cv_type_int16_t" >&6; }
+if test $ac_cv_type_int16_t = yes; then
+  :
 else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+
+	case "2" in
+	"$ac_cv_sizeof_int")
+		int16_decl="typedef int int16_t;";;
+	"$ac_cv_sizeof_char")
+		int16_decl="typedef char int16_t;";;
+	"$ac_cv_sizeof_short")
+		int16_decl="typedef short int16_t;";;
+	"$ac_cv_sizeof_long")
+		int16_decl="typedef long int16_t;";;
+	"$ac_cv_sizeof_long_long")
+		int16_decl="typedef long long int16_t;";;
+	*)
+		if test "" != "notfatal"; then
+			{ { echo "$as_me:$LINENO: error: No signed 2-byte integral type" >&5
+echo "$as_me: error: No signed 2-byte integral type" >&2;}
    { (exit 1); exit 1; }; }
+		fi;;
+	esac
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking for u_int32_t" >&5
+echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_u_int32_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$db_includes
-
-long longval () { return (long) (sizeof (char *)); }
-unsigned long ulongval () { return (long) (sizeof (char *)); }
-#include 
-#include 
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (char *))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (char *))))
-	exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (char *))))
-	exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$db_includes
 
+typedef u_int32_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_char_p=`cat conftest.val`
+  ac_cv_type_u_int32_t=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char *), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char *), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+	ac_cv_type_u_int32_t=no
 fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.val
+{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5
+echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6; }
+if test $ac_cv_type_u_int32_t = yes; then
+  :
 else
-  ac_cv_sizeof_char_p=0
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_char_p" >&5
-echo "${ECHO_T}$ac_cv_sizeof_char_p" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p
-_ACEOF
 
+	case "4" in
+	"$ac_cv_sizeof_unsigned_int")
+		u_int32_decl="typedef unsigned int u_int32_t;";;
+	"$ac_cv_sizeof_unsigned_char")
+		u_int32_decl="typedef unsigned char u_int32_t;";;
+	"$ac_cv_sizeof_unsigned_short")
+		u_int32_decl="typedef unsigned short u_int32_t;";;
+	"$ac_cv_sizeof_unsigned_long")
+		u_int32_decl="typedef unsigned long u_int32_t;";;
+	"$ac_cv_sizeof_unsigned_long_long")
+		u_int32_decl="typedef unsigned long long u_int32_t;";;
+	*)
+		if test "" != "notfatal"; then
+			{ { echo "$as_me:$LINENO: error: No unsigned 4-byte integral type" >&5
+echo "$as_me: error: No unsigned 4-byte integral type" >&2;}
+   { (exit 1); exit 1; }; }
+		fi;;
+	esac
+fi
 
 
-# We look for u_char, u_short, u_int, u_long -- if we can't find them,
-# we create our own.
 
-echo "$as_me:$LINENO: checking for u_char" >&5
-echo $ECHO_N "checking for u_char... $ECHO_C" >&6
-if test "${ac_cv_type_u_char+set}" = set; then
+{ echo "$as_me:$LINENO: checking for int32_t" >&5
+echo $ECHO_N "checking for int32_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_int32_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -28187,61 +31135,93 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef int32_t ac__type_new_;
 int
 main ()
 {
-if ((u_char *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (u_char))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_u_char=yes
+  ac_cv_type_int32_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_u_char=no
+	ac_cv_type_int32_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_char" >&5
-echo "${ECHO_T}$ac_cv_type_u_char" >&6
-if test $ac_cv_type_u_char = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5
+echo "${ECHO_T}$ac_cv_type_int32_t" >&6; }
+if test $ac_cv_type_int32_t = yes; then
   :
 else
-  u_char_decl="typedef unsigned char u_char;"
+
+	case "4" in
+	"$ac_cv_sizeof_int")
+		int32_decl="typedef int int32_t;";;
+	"$ac_cv_sizeof_char")
+		int32_decl="typedef char int32_t;";;
+	"$ac_cv_sizeof_short")
+		int32_decl="typedef short int32_t;";;
+	"$ac_cv_sizeof_long")
+		int32_decl="typedef long int32_t;";;
+	"$ac_cv_sizeof_long_long")
+		int32_decl="typedef long long int32_t;";;
+	*)
+		if test "" != "notfatal"; then
+			{ { echo "$as_me:$LINENO: error: No signed 4-byte integral type" >&5
+echo "$as_me: error: No signed 4-byte integral type" >&2;}
+   { (exit 1); exit 1; }; }
+		fi;;
+	esac
 fi
 
 
 
-echo "$as_me:$LINENO: checking for u_short" >&5
-echo $ECHO_N "checking for u_short... $ECHO_C" >&6
-if test "${ac_cv_type_u_short+set}" = set; then
+{ echo "$as_me:$LINENO: checking for u_int64_t" >&5
+echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_u_int64_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -28252,61 +31232,93 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef u_int64_t ac__type_new_;
 int
 main ()
 {
-if ((u_short *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (u_short))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_u_short=yes
+  ac_cv_type_u_int64_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_u_short=no
+	ac_cv_type_u_int64_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_short" >&5
-echo "${ECHO_T}$ac_cv_type_u_short" >&6
-if test $ac_cv_type_u_short = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5
+echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; }
+if test $ac_cv_type_u_int64_t = yes; then
   :
 else
-  u_short_decl="typedef unsigned short u_short;"
+
+	case "8" in
+	"$ac_cv_sizeof_unsigned_int")
+		u_int64_decl="typedef unsigned int u_int64_t;";;
+	"$ac_cv_sizeof_unsigned_char")
+		u_int64_decl="typedef unsigned char u_int64_t;";;
+	"$ac_cv_sizeof_unsigned_short")
+		u_int64_decl="typedef unsigned short u_int64_t;";;
+	"$ac_cv_sizeof_unsigned_long")
+		u_int64_decl="typedef unsigned long u_int64_t;";;
+	"$ac_cv_sizeof_unsigned_long_long")
+		u_int64_decl="typedef unsigned long long u_int64_t;";;
+	*)
+		if test "notfatal" != "notfatal"; then
+			{ { echo "$as_me:$LINENO: error: No unsigned 8-byte integral type" >&5
+echo "$as_me: error: No unsigned 8-byte integral type" >&2;}
+   { (exit 1); exit 1; }; }
+		fi;;
+	esac
 fi
 
 
 
-echo "$as_me:$LINENO: checking for u_int" >&5
-echo $ECHO_N "checking for u_int... $ECHO_C" >&6
-if test "${ac_cv_type_u_int+set}" = set; then
+{ echo "$as_me:$LINENO: checking for int64_t" >&5
+echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_int64_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -28317,61 +31329,95 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef int64_t ac__type_new_;
 int
 main ()
 {
-if ((u_int *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (u_int))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_u_int=yes
+  ac_cv_type_int64_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_u_int=no
+	ac_cv_type_int64_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_int" >&5
-echo "${ECHO_T}$ac_cv_type_u_int" >&6
-if test $ac_cv_type_u_int = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5
+echo "${ECHO_T}$ac_cv_type_int64_t" >&6; }
+if test $ac_cv_type_int64_t = yes; then
   :
 else
-  u_int_decl="typedef unsigned int u_int;"
+
+	case "8" in
+	"$ac_cv_sizeof_int")
+		int64_decl="typedef int int64_t;";;
+	"$ac_cv_sizeof_char")
+		int64_decl="typedef char int64_t;";;
+	"$ac_cv_sizeof_short")
+		int64_decl="typedef short int64_t;";;
+	"$ac_cv_sizeof_long")
+		int64_decl="typedef long int64_t;";;
+	"$ac_cv_sizeof_long_long")
+		int64_decl="typedef long long int64_t;";;
+	*)
+		if test "notfatal" != "notfatal"; then
+			{ { echo "$as_me:$LINENO: error: No signed 8-byte integral type" >&5
+echo "$as_me: error: No signed 8-byte integral type" >&2;}
+   { (exit 1); exit 1; }; }
+		fi;;
+	esac
 fi
 
 
+# Check for ssize_t -- if none exists, find a signed integral type that's
+# the same size as a size_t.
 
-echo "$as_me:$LINENO: checking for u_long" >&5
-echo $ECHO_N "checking for u_long... $ECHO_C" >&6
-if test "${ac_cv_type_u_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking for ssize_t" >&5
+echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_ssize_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -28382,62 +31428,98 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef ssize_t ac__type_new_;
 int
 main ()
 {
-if ((u_long *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (u_long))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_u_long=yes
+  ac_cv_type_ssize_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_u_long=no
+	ac_cv_type_ssize_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_long" >&5
-echo "${ECHO_T}$ac_cv_type_u_long" >&6
-if test $ac_cv_type_u_long = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
+echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; }
+if test $ac_cv_type_ssize_t = yes; then
   :
 else
-  u_long_decl="typedef unsigned long u_long;"
+
+	case "$ac_cv_sizeof_size_t" in
+	"$ac_cv_sizeof_int")
+		ssize_t_decl="typedef int ssize_t;";;
+	"$ac_cv_sizeof_char")
+		ssize_t_decl="typedef char ssize_t;";;
+	"$ac_cv_sizeof_short")
+		ssize_t_decl="typedef short ssize_t;";;
+	"$ac_cv_sizeof_long")
+		ssize_t_decl="typedef long ssize_t;";;
+	"$ac_cv_sizeof_long_long")
+		ssize_t_decl="typedef long long ssize_t;";;
+	*)
+		if test "" != "notfatal"; then
+			{ { echo "$as_me:$LINENO: error: No signed $ac_cv_sizeof_size_t-byte integral type" >&5
+echo "$as_me: error: No signed $ac_cv_sizeof_size_t-byte integral type" >&2;}
+   { (exit 1); exit 1; }; }
+		fi;;
+	esac
 fi
 
 
-# We look for fixed-size variants of u_char, u_short, u_int, u_long as well.
+# So far, no autoconf'd systems lack pid_t.
 
-echo "$as_me:$LINENO: checking for u_int8_t" >&5
-echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6
-if test "${ac_cv_type_u_int8_t+set}" = set; then
+
+# Check for uintmax_t -- if none exists, first the largest unsigned integral
+# type available.
+
+{ echo "$as_me:$LINENO: checking for uintmax_t" >&5
+echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_uintmax_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -28446,81 +31528,71 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$db_includes
-
+$ac_includes_default
+typedef uintmax_t ac__type_new_;
 int
 main ()
 {
-if ((u_int8_t *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (u_int8_t))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_u_int8_t=yes
+  ac_cv_type_uintmax_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_u_int8_t=no
+	ac_cv_type_uintmax_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6
-if test $ac_cv_type_u_int8_t = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6; }
+if test $ac_cv_type_uintmax_t = yes; then
   :
 else
-
-	case "1" in
-	"$ac_cv_sizeof_unsigned_int")
-		u_int8_decl="typedef unsigned int u_int8_t;";;
-	"$ac_cv_sizeof_unsigned_char")
-		u_int8_decl="typedef unsigned char u_int8_t;";;
-	"$ac_cv_sizeof_unsigned_short")
-		u_int8_decl="typedef unsigned short u_int8_t;";;
-	"$ac_cv_sizeof_unsigned_long")
-		u_int8_decl="typedef unsigned long u_int8_t;";;
-	"$ac_cv_sizeof_unsigned_long_long")
-		u_int8_decl="typedef unsigned long long u_int8_t;";;
-	*)
-		if test "" != "notfatal"; then
-			{ { echo "$as_me:$LINENO: error: No unsigned 1-byte integral type" >&5
-echo "$as_me: error: No unsigned 1-byte integral type" >&2;}
-   { (exit 1); exit 1; }; }
-		fi;;
-	esac
-fi
-
-
-
-echo "$as_me:$LINENO: checking for u_int16_t" >&5
-echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6
-if test "${ac_cv_type_u_int16_t+set}" = set; then
+  { echo "$as_me:$LINENO: checking for unsigned long long" >&5
+echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; }
+if test "${ac_cv_type_unsigned_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -28531,79 +31603,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $db_includes
 
+typedef unsigned long long ac__type_new_;
 int
 main ()
 {
-if ((u_int16_t *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (u_int16_t))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_u_int16_t=yes
+  ac_cv_type_unsigned_long_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_u_int16_t=no
+	ac_cv_type_unsigned_long_long=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6
-if test $ac_cv_type_u_int16_t = yes; then
-  :
+{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; }
+if test $ac_cv_type_unsigned_long_long = yes; then
+  uintmax_t_decl="typedef unsigned long long uintmax_t;"
 else
+  uintmax_t_decl="typedef unsigned long uintmax_t;"
+fi
 
-	case "2" in
-	"$ac_cv_sizeof_unsigned_int")
-		u_int16_decl="typedef unsigned int u_int16_t;";;
-	"$ac_cv_sizeof_unsigned_char")
-		u_int16_decl="typedef unsigned char u_int16_t;";;
-	"$ac_cv_sizeof_unsigned_short")
-		u_int16_decl="typedef unsigned short u_int16_t;";;
-	"$ac_cv_sizeof_unsigned_long")
-		u_int16_decl="typedef unsigned long u_int16_t;";;
-	"$ac_cv_sizeof_unsigned_long_long")
-		u_int16_decl="typedef unsigned long long u_int16_t;";;
-	*)
-		if test "" != "notfatal"; then
-			{ { echo "$as_me:$LINENO: error: No unsigned 2-byte integral type" >&5
-echo "$as_me: error: No unsigned 2-byte integral type" >&2;}
-   { (exit 1); exit 1; }; }
-		fi;;
-	esac
 fi
 
 
+# Check for uintptr_t -- if none exists, find an integral type which is
+# the same size as a pointer.
 
-echo "$as_me:$LINENO: checking for int16_t" >&5
-echo $ECHO_N "checking for int16_t... $ECHO_C" >&6
-if test "${ac_cv_type_int16_t+set}" = set; then
+{ echo "$as_me:$LINENO: checking for uintptr_t" >&5
+echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_uintptr_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -28612,71 +31684,84 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$db_includes
-
+$ac_includes_default
+typedef uintptr_t ac__type_new_;
 int
 main ()
 {
-if ((int16_t *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (int16_t))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_int16_t=yes
+  ac_cv_type_uintptr_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_int16_t=no
+	ac_cv_type_uintptr_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5
-echo "${ECHO_T}$ac_cv_type_int16_t" >&6
-if test $ac_cv_type_int16_t = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; }
+if test $ac_cv_type_uintptr_t = yes; then
   :
 else
 
-	case "2" in
-	"$ac_cv_sizeof_int")
-		int16_decl="typedef int int16_t;";;
-	"$ac_cv_sizeof_char")
-		int16_decl="typedef char int16_t;";;
-	"$ac_cv_sizeof_short")
-		int16_decl="typedef short int16_t;";;
-	"$ac_cv_sizeof_long")
-		int16_decl="typedef long int16_t;";;
-	"$ac_cv_sizeof_long_long")
-		int16_decl="typedef long long int16_t;";;
+	case "$ac_cv_sizeof_char_p" in
+	"$ac_cv_sizeof_unsigned_int")
+		uintptr_t_decl="typedef unsigned int uintptr_t;";;
+	"$ac_cv_sizeof_unsigned_char")
+		uintptr_t_decl="typedef unsigned char uintptr_t;";;
+	"$ac_cv_sizeof_unsigned_short")
+		uintptr_t_decl="typedef unsigned short uintptr_t;";;
+	"$ac_cv_sizeof_unsigned_long")
+		uintptr_t_decl="typedef unsigned long uintptr_t;";;
+	"$ac_cv_sizeof_unsigned_long_long")
+		uintptr_t_decl="typedef unsigned long long uintptr_t;";;
 	*)
 		if test "" != "notfatal"; then
-			{ { echo "$as_me:$LINENO: error: No signed 2-byte integral type" >&5
-echo "$as_me: error: No signed 2-byte integral type" >&2;}
+			{ { echo "$as_me:$LINENO: error: No unsigned $ac_cv_sizeof_char_p-byte integral type" >&5
+echo "$as_me: error: No unsigned $ac_cv_sizeof_char_p-byte integral type" >&2;}
    { (exit 1); exit 1; }; }
 		fi;;
 	esac
@@ -28684,259 +31769,291 @@ fi
 
 
 
-echo "$as_me:$LINENO: checking for u_int32_t" >&5
-echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6
-if test "${ac_cv_type_u_int32_t+set}" = set; then
+{ echo "$as_me:$LINENO: checking for ANSI C exit success/failure values" >&5
+echo $ECHO_N "checking for ANSI C exit success/failure values... $ECHO_C" >&6; }
+if test "${db_cv_exit_defines+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$db_includes
-
+#include 
 int
 main ()
 {
-if ((u_int32_t *) 0)
-  return 0;
-if (sizeof (u_int32_t))
-  return 0;
+return (EXIT_SUCCESS);
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_u_int32_t=yes
+  db_cv_exit_defines=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_u_int32_t=no
+	db_cv_exit_defines=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6
-if test $ac_cv_type_u_int32_t = yes; then
-  :
-else
+{ echo "$as_me:$LINENO: result: $db_cv_exit_defines" >&5
+echo "${ECHO_T}$db_cv_exit_defines" >&6; }
+if test "$db_cv_exit_defines" = "yes"; then
+	cat >>confdefs.h <<\_ACEOF
+#define HAVE_EXIT_SUCCESS 1
+_ACEOF
+
+
 
-	case "4" in
-	"$ac_cv_sizeof_unsigned_int")
-		u_int32_decl="typedef unsigned int u_int32_t;";;
-	"$ac_cv_sizeof_unsigned_char")
-		u_int32_decl="typedef unsigned char u_int32_t;";;
-	"$ac_cv_sizeof_unsigned_short")
-		u_int32_decl="typedef unsigned short u_int32_t;";;
-	"$ac_cv_sizeof_unsigned_long")
-		u_int32_decl="typedef unsigned long u_int32_t;";;
-	"$ac_cv_sizeof_unsigned_long_long")
-		u_int32_decl="typedef unsigned long long u_int32_t;";;
-	*)
-		if test "" != "notfatal"; then
-			{ { echo "$as_me:$LINENO: error: No unsigned 4-byte integral type" >&5
-echo "$as_me: error: No unsigned 4-byte integral type" >&2;}
-   { (exit 1); exit 1; }; }
-		fi;;
-	esac
 fi
 
+# Check for mutexes.
+# We do this first because it changes $LIBSO_LIBS.
+
 
+# Mutexes we don't test for, but want the #defines to exist for
+# other ports.
 
-echo "$as_me:$LINENO: checking for int32_t" >&5
-echo $ECHO_N "checking for int32_t... $ECHO_C" >&6
-if test "${ac_cv_type_int32_t+set}" = set; then
+
+
+
+
+{ echo "$as_me:$LINENO: checking for mutexes" >&5
+echo $ECHO_N "checking for mutexes... $ECHO_C" >&6; }
+if test "${db_cv_mutex+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+db_cv_mutex=no
+
+orig_libs=$LIBS
+
+# User-specified POSIX or UI mutexes.
+#
+# There are two different reasons to specify mutexes: First, the application
+# is already using one type of mutex and doesn't want to mix-and-match (for
+# example, on Solaris, which has POSIX, UI and LWP mutexes).  Second, the
+# applications POSIX pthreads mutexes don't support inter-process locking,
+# but the application wants to use them anyway (for example, some Linux and
+# *BSD systems).
+#
+# Test for LWP threads before testing for UI/POSIX threads, we prefer them
+# on Solaris, for two reasons: a bug in SunOS 5.7 causes applications to
+# get pwrite, not pwrite64, if they load the C library before the appropriate
+# threads library, e.g., tclsh using dlopen to load the DB library.  Second,
+# LWP mutexes are faster than POSIX pthread mutexes by some amount.
+#
+# Otherwise, test for POSIX threads before UI threads.  There are Linux systems
+# that support a UI compatibility mode, and applications are more likely to be
+# written for POSIX threads than UI threads.
+if test "$db_cv_posixmutexes" = yes; then
+	db_cv_mutex="posix_only";
+fi
+if test "$db_cv_uimutexes" = yes; then
+	db_cv_mutex="ui_only";
+fi
+
+# User-specified Win32 mutexes (MinGW build)
+if test "$db_cv_mingw" = "yes"; then
+	db_cv_mutex=win32/gcc
+fi
+
+# LWP threads: _lwp_XXX
+if test "$db_cv_mutex" = no; then
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$db_includes
 
+#include 
 int
 main ()
 {
-if ((int32_t *) 0)
-  return 0;
-if (sizeof (int32_t))
-  return 0;
+
+	static lwp_mutex_t mi = SHAREDMUTEX;
+	static lwp_cond_t ci = SHAREDCV;
+	lwp_mutex_t mutex = mi;
+	lwp_cond_t cond = ci;
+	exit (
+	_lwp_mutex_lock(&mutex) ||
+	_lwp_mutex_unlock(&mutex));
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_int32_t=yes
+  db_cv_mutex="Solaris/lwp"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_int32_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5
-echo "${ECHO_T}$ac_cv_type_int32_t" >&6
-if test $ac_cv_type_int32_t = yes; then
-  :
-else
 
-	case "4" in
-	"$ac_cv_sizeof_int")
-		int32_decl="typedef int int32_t;";;
-	"$ac_cv_sizeof_char")
-		int32_decl="typedef char int32_t;";;
-	"$ac_cv_sizeof_short")
-		int32_decl="typedef short int32_t;";;
-	"$ac_cv_sizeof_long")
-		int32_decl="typedef long int32_t;";;
-	"$ac_cv_sizeof_long_long")
-		int32_decl="typedef long long int32_t;";;
-	*)
-		if test "" != "notfatal"; then
-			{ { echo "$as_me:$LINENO: error: No signed 4-byte integral type" >&5
-echo "$as_me: error: No signed 4-byte integral type" >&2;}
-   { (exit 1); exit 1; }; }
-		fi;;
-	esac
 fi
 
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
 
+# POSIX.1 pthreads: pthread_XXX
+#
+# If the user specified we use POSIX pthreads mutexes, and we fail to find the
+# full interface, try and configure for just intra-process support.
+if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then
+	LIBS="$LIBS -lpthread"
 
-echo "$as_me:$LINENO: checking for u_int64_t" >&5
-echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6
-if test "${ac_cv_type_u_int64_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+if test "$cross_compiling" = yes; then
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$db_includes
 
-int
-main ()
-{
-if ((u_int64_t *) 0)
-  return 0;
-if (sizeof (u_int64_t))
-  return 0;
+#include 
+int
+main ()
+{
+
+	pthread_cond_t cond;
+	pthread_mutex_t mutex;
+	pthread_condattr_t condattr;
+	pthread_mutexattr_t mutexattr;
+	exit (
+	pthread_condattr_init(&condattr) ||
+	pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
+	pthread_mutexattr_init(&mutexattr) ||
+	pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
+	pthread_cond_init(&cond, &condattr) ||
+	pthread_mutex_init(&mutex, &mutexattr) ||
+	pthread_mutex_lock(&mutex) ||
+	pthread_mutex_unlock(&mutex) ||
+	pthread_mutex_destroy(&mutex) ||
+	pthread_cond_destroy(&cond) ||
+	pthread_condattr_destroy(&condattr) ||
+	pthread_mutexattr_destroy(&mutexattr));
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_u_int64_t=yes
+  db_cv_mutex=""POSIX/pthreads/library""
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_u_int64_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6
-if test $ac_cv_type_u_int64_t = yes; then
-  :
-else
 
-	case "8" in
-	"$ac_cv_sizeof_unsigned_int")
-		u_int64_decl="typedef unsigned int u_int64_t;";;
-	"$ac_cv_sizeof_unsigned_char")
-		u_int64_decl="typedef unsigned char u_int64_t;";;
-	"$ac_cv_sizeof_unsigned_short")
-		u_int64_decl="typedef unsigned short u_int64_t;";;
-	"$ac_cv_sizeof_unsigned_long")
-		u_int64_decl="typedef unsigned long u_int64_t;";;
-	"$ac_cv_sizeof_unsigned_long_long")
-		u_int64_decl="typedef unsigned long long u_int64_t;";;
-	*)
-		if test "notfatal" != "notfatal"; then
-			{ { echo "$as_me:$LINENO: error: No unsigned 8-byte integral type" >&5
-echo "$as_me: error: No unsigned 8-byte integral type" >&2;}
-   { (exit 1); exit 1; }; }
-		fi;;
-	esac
 fi
 
-
-
-echo "$as_me:$LINENO: checking for int64_t" >&5
-echo $ECHO_N "checking for int64_t... $ECHO_C" >&6
-if test "${ac_cv_type_int64_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -28944,228 +32061,282 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$db_includes
 
-int
-main ()
-{
-if ((int64_t *) 0)
-  return 0;
-if (sizeof (int64_t))
-  return 0;
-  ;
-  return 0;
+#include 
+main() {
+	pthread_cond_t cond;
+	pthread_mutex_t mutex;
+	pthread_condattr_t condattr;
+	pthread_mutexattr_t mutexattr;
+	exit (
+	pthread_condattr_init(&condattr) ||
+	pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
+	pthread_mutexattr_init(&mutexattr) ||
+	pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
+	pthread_cond_init(&cond, &condattr) ||
+	pthread_mutex_init(&mutex, &mutexattr) ||
+	pthread_mutex_lock(&mutex) ||
+	pthread_mutex_unlock(&mutex) ||
+	pthread_mutex_destroy(&mutex) ||
+	pthread_cond_destroy(&cond) ||
+	pthread_condattr_destroy(&condattr) ||
+	pthread_mutexattr_destroy(&mutexattr));
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_int64_t=yes
+  db_cv_mutex=""POSIX/pthreads/library""
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_int64_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5
-echo "${ECHO_T}$ac_cv_type_int64_t" >&6
-if test $ac_cv_type_int64_t = yes; then
-  :
-else
-
-	case "8" in
-	"$ac_cv_sizeof_int")
-		int64_decl="typedef int int64_t;";;
-	"$ac_cv_sizeof_char")
-		int64_decl="typedef char int64_t;";;
-	"$ac_cv_sizeof_short")
-		int64_decl="typedef short int64_t;";;
-	"$ac_cv_sizeof_long")
-		int64_decl="typedef long int64_t;";;
-	"$ac_cv_sizeof_long_long")
-		int64_decl="typedef long long int64_t;";;
-	*)
-		if test "notfatal" != "notfatal"; then
-			{ { echo "$as_me:$LINENO: error: No signed 8-byte integral type" >&5
-echo "$as_me: error: No signed 8-byte integral type" >&2;}
-   { (exit 1); exit 1; }; }
-		fi;;
-	esac
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
-# Check for ssize_t -- if none exists, find a signed integral type that's
-# the same size as a size_t.
+	LIBS="$orig_libs"
+fi
+if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then
 
-echo "$as_me:$LINENO: checking for ssize_t" >&5
-echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6
-if test "${ac_cv_type_ssize_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+if test "$cross_compiling" = yes; then
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$db_includes
 
+#include 
 int
 main ()
 {
-if ((ssize_t *) 0)
-  return 0;
-if (sizeof (ssize_t))
-  return 0;
+
+	pthread_cond_t cond;
+	pthread_mutex_t mutex;
+	pthread_condattr_t condattr;
+	pthread_mutexattr_t mutexattr;
+	exit (
+	pthread_condattr_init(&condattr) ||
+	pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
+	pthread_mutexattr_init(&mutexattr) ||
+	pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
+	pthread_cond_init(&cond, &condattr) ||
+	pthread_mutex_init(&mutex, &mutexattr) ||
+	pthread_mutex_lock(&mutex) ||
+	pthread_mutex_unlock(&mutex) ||
+	pthread_mutex_destroy(&mutex) ||
+	pthread_cond_destroy(&cond) ||
+	pthread_condattr_destroy(&condattr) ||
+	pthread_mutexattr_destroy(&mutexattr));
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_ssize_t=yes
+  db_cv_mutex=""POSIX/pthreads""
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_ssize_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
-echo "${ECHO_T}$ac_cv_type_ssize_t" >&6
-if test $ac_cv_type_ssize_t = yes; then
-  :
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include 
+main() {
+	pthread_cond_t cond;
+	pthread_mutex_t mutex;
+	pthread_condattr_t condattr;
+	pthread_mutexattr_t mutexattr;
+	exit (
+	pthread_condattr_init(&condattr) ||
+	pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
+	pthread_mutexattr_init(&mutexattr) ||
+	pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
+	pthread_cond_init(&cond, &condattr) ||
+	pthread_mutex_init(&mutex, &mutexattr) ||
+	pthread_mutex_lock(&mutex) ||
+	pthread_mutex_unlock(&mutex) ||
+	pthread_mutex_destroy(&mutex) ||
+	pthread_cond_destroy(&cond) ||
+	pthread_condattr_destroy(&condattr) ||
+	pthread_mutexattr_destroy(&mutexattr));
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  db_cv_mutex=""POSIX/pthreads""
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-	case "$ac_cv_sizeof_size_t" in
-	"$ac_cv_sizeof_int")
-		ssize_t_decl="typedef int ssize_t;";;
-	"$ac_cv_sizeof_char")
-		ssize_t_decl="typedef char ssize_t;";;
-	"$ac_cv_sizeof_short")
-		ssize_t_decl="typedef short ssize_t;";;
-	"$ac_cv_sizeof_long")
-		ssize_t_decl="typedef long ssize_t;";;
-	"$ac_cv_sizeof_long_long")
-		ssize_t_decl="typedef long long ssize_t;";;
-	*)
-		if test "" != "notfatal"; then
-			{ { echo "$as_me:$LINENO: error: No signed $ac_cv_sizeof_size_t-byte integral type" >&5
-echo "$as_me: error: No signed $ac_cv_sizeof_size_t-byte integral type" >&2;}
-   { (exit 1); exit 1; }; }
-		fi;;
-	esac
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
-# Check for uintmax_t -- if none exists, first the largest unsigned integral
-# type available.
+fi
+if test "$db_cv_mutex" = "posix_only"; then
 
-echo "$as_me:$LINENO: checking for uintmax_t" >&5
-echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6
-if test "${ac_cv_type_uintmax_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+if test "$cross_compiling" = yes; then
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#include 
 int
 main ()
 {
-if ((uintmax_t *) 0)
-  return 0;
-if (sizeof (uintmax_t))
-  return 0;
+
+	pthread_cond_t cond;
+	pthread_mutex_t mutex;
+	pthread_condattr_t condattr;
+	pthread_mutexattr_t mutexattr;
+	exit (
+	pthread_condattr_init(&condattr) ||
+	pthread_mutexattr_init(&mutexattr) ||
+	pthread_cond_init(&cond, &condattr) ||
+	pthread_mutex_init(&mutex, &mutexattr) ||
+	pthread_mutex_lock(&mutex) ||
+	pthread_mutex_unlock(&mutex) ||
+	pthread_mutex_destroy(&mutex) ||
+	pthread_cond_destroy(&cond) ||
+	pthread_condattr_destroy(&condattr) ||
+	pthread_mutexattr_destroy(&mutexattr));
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_uintmax_t=yes
+  db_cv_mutex=""POSIX/pthreads/private""
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_uintmax_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5
-echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6
-if test $ac_cv_type_uintmax_t = yes; then
-  :
-else
-  echo "$as_me:$LINENO: checking for unsigned long long" >&5
-echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6
-if test "${ac_cv_type_unsigned_long_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -29173,223 +32344,280 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$db_includes
 
-int
-main ()
-{
-if ((unsigned long long *) 0)
-  return 0;
-if (sizeof (unsigned long long))
-  return 0;
-  ;
-  return 0;
+#include 
+main() {
+	pthread_cond_t cond;
+	pthread_mutex_t mutex;
+	pthread_condattr_t condattr;
+	pthread_mutexattr_t mutexattr;
+	exit (
+	pthread_condattr_init(&condattr) ||
+	pthread_mutexattr_init(&mutexattr) ||
+	pthread_cond_init(&cond, &condattr) ||
+	pthread_mutex_init(&mutex, &mutexattr) ||
+	pthread_mutex_lock(&mutex) ||
+	pthread_mutex_unlock(&mutex) ||
+	pthread_mutex_destroy(&mutex) ||
+	pthread_cond_destroy(&cond) ||
+	pthread_condattr_destroy(&condattr) ||
+	pthread_mutexattr_destroy(&mutexattr));
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_unsigned_long_long=yes
+  db_cv_mutex=""POSIX/pthreads/private""
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_unsigned_long_long=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6
-if test $ac_cv_type_unsigned_long_long = yes; then
-  uintmax_t_decl="typedef unsigned long long uintmax_t;"
-else
-  uintmax_t_decl="typedef unsigned long uintmax_t;"
 fi
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
-# Check for uintptr_t -- if none exists, find an integral type which is
-# the same size as a pointer.
+fi
+if test "$db_cv_mutex" = "posix_only"; then
+	LIBS="$LIBS -lpthread"
 
-echo "$as_me:$LINENO: checking for uintptr_t" >&5
-echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6
-if test "${ac_cv_type_uintptr_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+if test "$cross_compiling" = yes; then
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#include 
 int
 main ()
 {
-if ((uintptr_t *) 0)
-  return 0;
-if (sizeof (uintptr_t))
-  return 0;
+
+	pthread_cond_t cond;
+	pthread_mutex_t mutex;
+	pthread_condattr_t condattr;
+	pthread_mutexattr_t mutexattr;
+	exit (
+	pthread_condattr_init(&condattr) ||
+	pthread_mutexattr_init(&mutexattr) ||
+	pthread_cond_init(&cond, &condattr) ||
+	pthread_mutex_init(&mutex, &mutexattr) ||
+	pthread_mutex_lock(&mutex) ||
+	pthread_mutex_unlock(&mutex) ||
+	pthread_mutex_destroy(&mutex) ||
+	pthread_cond_destroy(&cond) ||
+	pthread_condattr_destroy(&condattr) ||
+	pthread_mutexattr_destroy(&mutexattr));
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_uintptr_t=yes
+  db_cv_mutex=""POSIX/pthreads/library/private""
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_uintptr_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
-echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6
-if test $ac_cv_type_uintptr_t = yes; then
-  :
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-	case "$ac_cv_sizeof_char_p" in
-	"$ac_cv_sizeof_unsigned_int")
-		uintptr_t_decl="typedef unsigned int uintptr_t;";;
-	"$ac_cv_sizeof_unsigned_char")
-		uintptr_t_decl="typedef unsigned char uintptr_t;";;
-	"$ac_cv_sizeof_unsigned_short")
-		uintptr_t_decl="typedef unsigned short uintptr_t;";;
-	"$ac_cv_sizeof_unsigned_long")
-		uintptr_t_decl="typedef unsigned long uintptr_t;";;
-	"$ac_cv_sizeof_unsigned_long_long")
-		uintptr_t_decl="typedef unsigned long long uintptr_t;";;
-	*)
-		if test "" != "notfatal"; then
-			{ { echo "$as_me:$LINENO: error: No unsigned $ac_cv_sizeof_char_p-byte integral type" >&5
-echo "$as_me: error: No unsigned $ac_cv_sizeof_char_p-byte integral type" >&2;}
-   { (exit 1); exit 1; }; }
-		fi;;
-	esac
-fi
+#include 
+main() {
+	pthread_cond_t cond;
+	pthread_mutex_t mutex;
+	pthread_condattr_t condattr;
+	pthread_mutexattr_t mutexattr;
+	exit (
+	pthread_condattr_init(&condattr) ||
+	pthread_mutexattr_init(&mutexattr) ||
+	pthread_cond_init(&cond, &condattr) ||
+	pthread_mutex_init(&mutex, &mutexattr) ||
+	pthread_mutex_lock(&mutex) ||
+	pthread_mutex_unlock(&mutex) ||
+	pthread_mutex_destroy(&mutex) ||
+	pthread_cond_destroy(&cond) ||
+	pthread_condattr_destroy(&condattr) ||
+	pthread_mutexattr_destroy(&mutexattr));
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  db_cv_mutex=""POSIX/pthreads/library/private""
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 
 
-echo "$as_me:$LINENO: checking for ANSI C exit success/failure values" >&5
-echo $ECHO_N "checking for ANSI C exit success/failure values... $ECHO_C" >&6
-if test "${db_cv_exit_defines+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+	LIBS="$orig_libs"
+fi
+if test "$db_cv_mutex" = "posix_only"; then
+	{ { echo "$as_me:$LINENO: error: unable to find POSIX 1003.1 mutex interfaces" >&5
+echo "$as_me: error: unable to find POSIX 1003.1 mutex interfaces" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
+# UI threads: thr_XXX
+if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "ui_only"; then
+LIBS="$LIBS -lthread"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include 
+
+#include 
+#include 
 int
 main ()
 {
-return (EXIT_SUCCESS);
+
+	mutex_t mutex;
+	cond_t cond;
+	int type = USYNC_PROCESS;
+	exit (
+	mutex_init(&mutex, type, NULL) ||
+	cond_init(&cond, type, NULL) ||
+	mutex_lock(&mutex) ||
+	mutex_unlock(&mutex));
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  db_cv_exit_defines=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-db_cv_exit_defines=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $db_cv_exit_defines" >&5
-echo "${ECHO_T}$db_cv_exit_defines" >&6
-if test "$db_cv_exit_defines" = "yes"; then
-	cat >>confdefs.h <<\_ACEOF
-#define HAVE_EXIT_SUCCESS 1
-_ACEOF
-
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  db_cv_mutex="UI/threads/library"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
-# Test for various functions/libraries -- do tests that change library values
-# first.
-#
-# The Berkeley DB library calls fdatasync, and it's only available in -lrt on
-# Solaris.  See if we can find it either without additional libraries or in
-# -lrt.  If fdatasync is found in -lrt, add -lrt to the Java and Tcl shared
-# library link lines.
-echo "$as_me:$LINENO: checking for library containing fdatasync" >&5
-echo $ECHO_N "checking for library containing fdatasync... $ECHO_C" >&6
-if test "${ac_cv_search_fdatasync+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_fdatasync=no
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS="$orig_libs"
+fi
+if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "ui_only"; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29397,132 +32625,154 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char fdatasync ();
+#include 
+#include 
 int
 main ()
 {
-fdatasync ();
+
+	mutex_t mutex;
+	cond_t cond;
+	int type = USYNC_PROCESS;
+	exit (
+	mutex_init(&mutex, type, NULL) ||
+	cond_init(&cond, type, NULL) ||
+	mutex_lock(&mutex) ||
+	mutex_unlock(&mutex));
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_fdatasync="none required"
+  db_cv_mutex="UI/threads"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_fdatasync" = no; then
-  for ac_lib in rt; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+fi
+if test "$db_cv_mutex" = "ui_only"; then
+	{ { echo "$as_me:$LINENO: error: unable to find UI mutex interfaces" >&5
+echo "$as_me: error: unable to find UI mutex interfaces" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# msemaphore: HPPA only
+# Try HPPA before general msem test, it needs special alignment.
+if test "$db_cv_mutex" = no; then
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char fdatasync ();
+#include 
 int
 main ()
 {
-fdatasync ();
+
+#if defined(__hppa)
+	typedef msemaphore tsl_t;
+	msemaphore x;
+	msem_init(&x, 0);
+	msem_lock(&x, 0);
+	msem_unlock(&x, 0);
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_fdatasync="-l$ac_lib"
-break
+  db_cv_mutex="HP/msem_init"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_search_fdatasync" >&5
-echo "${ECHO_T}$ac_cv_search_fdatasync" >&6
-if test "$ac_cv_search_fdatasync" != no; then
-  test "$ac_cv_search_fdatasync" = "none required" || LIBS="$ac_cv_search_fdatasync $LIBS"
-      if test "$ac_cv_search_fdatasync" != "none required" ; then
-        LIBJSO_LIBS="$LIBJSO_LIBS -lrt";
-        LIBSO_LIBS="$LIBSO_LIBS -lrt";
-        LIBTSO_LIBS="$LIBTSO_LIBS -lrt";
-    fi
 fi
 
-
-# The test and example programs use the sched_yield function, taken from -lrt
-# on Solaris.
-echo "$as_me:$LINENO: checking for library containing sched_yield" >&5
-echo $ECHO_N "checking for library containing sched_yield... $ECHO_C" >&6
-if test "${ac_cv_search_sched_yield+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_sched_yield=no
+# msemaphore: AIX, OSF/1
+if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29530,134 +32780,143 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char sched_yield ();
+#include 
+#include 
 int
 main ()
 {
-sched_yield ();
+
+	typedef msemaphore tsl_t;
+	msemaphore x;
+	msem_init(&x, 0);
+	msem_lock(&x, 0);
+	msem_unlock(&x, 0);
+	exit(0);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_sched_yield="none required"
+  db_cv_mutex="UNIX/msem_init"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_sched_yield" = no; then
-  for ac_lib in rt; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+fi
+
+# ReliantUNIX
+if test "$db_cv_mutex" = no; then
+LIBS="$LIBS -lmproc"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char sched_yield ();
+#include 
 int
 main ()
 {
-sched_yield ();
+
+	typedef spinlock_t tsl_t;
+	spinlock_t x;
+	initspin(&x, 1);
+	cspinlock(&x);
+	spinunlock(&x);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_sched_yield="-l$ac_lib"
-break
+  db_cv_mutex="ReliantUNIX/initspin"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_search_sched_yield" >&5
-echo "${ECHO_T}$ac_cv_search_sched_yield" >&6
-if test "$ac_cv_search_sched_yield" != no; then
-  test "$ac_cv_search_sched_yield" = "none required" || LIBS="$ac_cv_search_sched_yield $LIBS"
 
 fi
 
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS="$orig_libs"
+fi
 
-# !!!
-# We can't check for pthreads in the same way we did the test for sched_yield
-# because the Solaris C library includes pthread interfaces which are not
-# inter-process safe.  For that reason we always add -lpthread if we find a
-# pthread library.
-#
-# We can't depend on any specific call existing (pthread_create, for example),
-# as it may be #defined in an include file -- OSF/1 (Tru64) has this problem.
-echo "$as_me:$LINENO: checking for main in -lpthread" >&5
-echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
-if test "${ac_cv_lib_pthread_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+# SCO: UnixWare has threads in libthread, but OpenServer doesn't.
+if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29665,66 +32924,67 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
 int
 main ()
 {
-main ();
+
+#if defined(__USLC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_pthread_main=yes
+  db_cv_mutex="SCO/x86/cc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_pthread_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6
-if test $ac_cv_lib_pthread_main = yes; then
-  TEST_LIBS="$TEST_LIBS -lpthread"
+
 fi
-ac_cv_lib_pthread=ac_cv_lib_pthread_main
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-# !!!
-# We could be more exact about whether these libraries are needed, but don't
-# bother -- if they exist, we load them, it's only the test programs anyway.
-echo "$as_me:$LINENO: checking for main in -lm" >&5
-echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
-if test "${ac_cv_lib_m_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
+# abilock_t: SGI
+if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29732,62 +32992,72 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+#include 
 int
 main ()
 {
-main ();
+
+	typedef abilock_t tsl_t;
+	abilock_t x;
+	init_lock(&x);
+	acquire_lock(&x);
+	release_lock(&x);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_m_main=yes
+  db_cv_mutex="SGI/init_lock"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_m_main=no
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
-echo "${ECHO_T}$ac_cv_lib_m_main" >&6
-if test $ac_cv_lib_m_main = yes; then
-  TEST_LIBS="$TEST_LIBS -lm"
 fi
-ac_cv_lib_m=ac_cv_lib_m_main
 
-echo "$as_me:$LINENO: checking for main in -lsocket" >&5
-echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6
-if test "${ac_cv_lib_socket_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
+# sema_t: Solaris
+# The sema_XXX calls do not work on Solaris 5.5.  I see no reason to ever
+# turn this test on, unless we find some other platform that uses the old
+# POSIX.1 interfaces.  (I plan to move directly to pthreads on Solaris.)
+if test "$db_cv_mutex" = DOESNT_WORK; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29795,62 +33065,73 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+#include 
 int
 main ()
 {
-main ();
+
+	typedef sema_t tsl_t;
+	sema_t x;
+	sema_init(&x, 1, USYNC_PROCESS, NULL);
+	sema_wait(&x);
+	sema_post(&x);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_socket_main=yes
+  db_cv_mutex="UNIX/sema_init"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_socket_main=no
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_main" >&6
-if test $ac_cv_lib_socket_main = yes; then
-  TEST_LIBS="$TEST_LIBS -lsocket"
 fi
-ac_cv_lib_socket=ac_cv_lib_socket_main
 
-echo "$as_me:$LINENO: checking for main in -lnsl" >&5
-echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
+# _lock_try/_lock_clear: Solaris
+# On Solaris systems without Pthread or UI mutex interfaces, DB uses the
+# undocumented _lock_try _lock_clear function calls instead of either the
+# sema_trywait(3T) or sema_wait(3T) function calls.  This is because of
+# problems in those interfaces in some releases of the Solaris C library.
+if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29858,112 +33139,67 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+#include 
 int
 main ()
 {
-main ();
+
+	typedef lock_t tsl_t;
+	lock_t x;
+	_lock_try(&x);
+	_lock_clear(&x);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_nsl_main=yes
+  db_cv_mutex="Solaris/_lock_try"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_nsl_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6
-if test $ac_cv_lib_nsl_main = yes; then
-  TEST_LIBS="$TEST_LIBS -lnsl"
-fi
-ac_cv_lib_nsl=ac_cv_lib_nsl_main
-
-
-# Check for mutexes.
-# We do this here because it changes $LIBS.
-
-
-# Mutexes we don't test for, but want the #defines to exist for
-# other ports.
-
-
-
 
-
-echo "$as_me:$LINENO: checking for mutexes" >&5
-echo $ECHO_N "checking for mutexes... $ECHO_C" >&6
-if test "${db_cv_mutex+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-db_cv_mutex=no
-
-orig_libs=$LIBS
-
-# User-specified POSIX or UI mutexes.
-#
-# There are two different reasons to specify mutexes: First, the application
-# is already using one type of mutex and doesn't want to mix-and-match (for
-# example, on Solaris, which has POSIX, UI and LWP mutexes).  Second, the
-# applications POSIX pthreads mutexes don't support inter-process locking,
-# but the application wants to use them anyway (for example, some Linux and
-# *BSD systems).
-#
-# Test for LWP threads before testing for UI/POSIX threads, we prefer them
-# on Solaris.  There's a bug in SunOS 5.7 where applications get pwrite, not
-# pwrite64, if they load the C library before the appropriate threads library,
-# e.g., tclsh using dlopen to load the DB library.  By using LWP threads we
-# avoid answering lots of user questions, not to mention the bugs.
-#
-# Otherwise, test for POSIX threads before UI threads.  There are Linux systems
-# that support a UI compatibility mode, and applications are more likely to be
-# written for POSIX threads than UI threads.
-#
-# Try and link with a threads library if possible.  The problem is the Solaris
-# C library has UI/POSIX interface stubs, but they're broken, configuring them
-# for inter-process mutexes doesn't return an error, but it doesn't work either.
-if test "$db_cv_posixmutexes" = yes; then
-	db_cv_mutex="posix_only";
-fi
-if test "$db_cv_uimutexes" = yes; then
-	db_cv_mutex="ui_only";
 fi
 
-# User-specified Win32 mutexes (MinGW build)
-if test "$db_cv_mingw" = "yes"; then
-	db_cv_mutex=win32/gcc
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 
-# LWP threads: _lwp_XXX
+# _check_lock/_clear_lock: AIX
 if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -29972,532 +33208,542 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
+#include 
 int
 main ()
 {
 
-	static lwp_mutex_t mi = SHAREDMUTEX;
-	static lwp_cond_t ci = SHAREDCV;
-	lwp_mutex_t mutex = mi;
-	lwp_cond_t cond = ci;
-	exit (
-	_lwp_mutex_lock(&mutex) ||
-	_lwp_mutex_unlock(&mutex));
+	int x;
+	_check_lock(&x,0,1);
+	_clear_lock(&x,0);
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="Solaris/lwp"
+  db_cv_mutex="AIX/_check_lock"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
 
-# POSIX.1 pthreads: pthread_XXX
-#
-# If the user specified we use POSIX pthreads mutexes, and we fail to find the
-# full interface, try and configure for just intra-process support.
-if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then
-	LIBS="$LIBS -lpthread"
-
-if test "$cross_compiling" = yes; then
-  cat >conftest.$ac_ext <<_ACEOF
+# _spin_lock_try/_spin_unlock: Apple/Darwin
+if test "$db_cv_mutex" = no; then
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
 int
 main ()
 {
 
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	pthread_condattr_t condattr;
-	pthread_mutexattr_t mutexattr;
-	exit (
-	pthread_condattr_init(&condattr) ||
-	pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
-	pthread_mutexattr_init(&mutexattr) ||
-	pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
-	pthread_cond_init(&cond, &condattr) ||
-	pthread_mutex_init(&mutex, &mutexattr) ||
-	pthread_mutex_lock(&mutex) ||
-	pthread_mutex_unlock(&mutex) ||
-	pthread_mutex_destroy(&mutex) ||
-	pthread_cond_destroy(&cond) ||
-	pthread_condattr_destroy(&condattr) ||
-	pthread_mutexattr_destroy(&mutexattr));
+	int x;
+	_spin_lock_try(&x);
+	_spin_unlock(&x);
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex=""POSIX/pthreads/library""
+  db_cv_mutex="Darwin/_spin_lock_try"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#include 
-main() {
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	pthread_condattr_t condattr;
-	pthread_mutexattr_t mutexattr;
-	exit (
-	pthread_condattr_init(&condattr) ||
-	pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
-	pthread_mutexattr_init(&mutexattr) ||
-	pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
-	pthread_cond_init(&cond, &condattr) ||
-	pthread_mutex_init(&mutex, &mutexattr) ||
-	pthread_mutex_lock(&mutex) ||
-	pthread_mutex_unlock(&mutex) ||
-	pthread_mutex_destroy(&mutex) ||
-	pthread_cond_destroy(&cond) ||
-	pthread_condattr_destroy(&condattr) ||
-	pthread_mutexattr_destroy(&mutexattr));
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  db_cv_mutex=""POSIX/pthreads/library""
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-	LIBS="$orig_libs"
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then
 
-if test "$cross_compiling" = yes; then
-  cat >conftest.$ac_ext <<_ACEOF
+# Tru64/cc
+if test "$db_cv_mutex" = no; then
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
 int
 main ()
 {
 
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	pthread_condattr_t condattr;
-	pthread_mutexattr_t mutexattr;
-	exit (
-	pthread_condattr_init(&condattr) ||
-	pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
-	pthread_mutexattr_init(&mutexattr) ||
-	pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
-	pthread_cond_init(&cond, &condattr) ||
-	pthread_mutex_init(&mutex, &mutexattr) ||
-	pthread_mutex_lock(&mutex) ||
-	pthread_mutex_unlock(&mutex) ||
-	pthread_mutex_destroy(&mutex) ||
-	pthread_cond_destroy(&cond) ||
-	pthread_condattr_destroy(&condattr) ||
-	pthread_mutexattr_destroy(&mutexattr));
+#if defined(__alpha) && defined(__DECC)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex=""POSIX/pthreads""
+  db_cv_mutex="Tru64/cc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-else
-  cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+# Alpha/gcc
+if test "$db_cv_mutex" = no; then
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
-main() {
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	pthread_condattr_t condattr;
-	pthread_mutexattr_t mutexattr;
-	exit (
-	pthread_condattr_init(&condattr) ||
-	pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
-	pthread_mutexattr_init(&mutexattr) ||
-	pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
-	pthread_cond_init(&cond, &condattr) ||
-	pthread_mutex_init(&mutex, &mutexattr) ||
-	pthread_mutex_lock(&mutex) ||
-	pthread_mutex_unlock(&mutex) ||
-	pthread_mutex_destroy(&mutex) ||
-	pthread_cond_destroy(&cond) ||
-	pthread_condattr_destroy(&condattr) ||
-	pthread_mutexattr_destroy(&mutexattr));
+int
+main ()
+{
+
+#if defined(__alpha) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
+
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex=""POSIX/pthreads""
+  db_cv_mutex="ALPHA/gcc-assembly"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-if test "$db_cv_mutex" = "posix_only"; then
 
-if test "$cross_compiling" = yes; then
-  cat >conftest.$ac_ext <<_ACEOF
+# ARM/gcc: Linux
+if test "$db_cv_mutex" = no; then
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
 int
 main ()
 {
 
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	pthread_condattr_t condattr;
-	pthread_mutexattr_t mutexattr;
-	exit (
-	pthread_condattr_init(&condattr) ||
-	pthread_mutexattr_init(&mutexattr) ||
-	pthread_cond_init(&cond, &condattr) ||
-	pthread_mutex_init(&mutex, &mutexattr) ||
-	pthread_mutex_lock(&mutex) ||
-	pthread_mutex_unlock(&mutex) ||
-	pthread_mutex_destroy(&mutex) ||
-	pthread_cond_destroy(&cond) ||
-	pthread_condattr_destroy(&condattr) ||
-	pthread_mutexattr_destroy(&mutexattr));
+#if defined(__arm__) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex=""POSIX/pthreads/private""
+  db_cv_mutex="ARM/gcc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-else
-  cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+# MIPS/gcc: Linux
+if test "$db_cv_mutex" = no; then
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
-main() {
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	pthread_condattr_t condattr;
-	pthread_mutexattr_t mutexattr;
-	exit (
-	pthread_condattr_init(&condattr) ||
-	pthread_mutexattr_init(&mutexattr) ||
-	pthread_cond_init(&cond, &condattr) ||
-	pthread_mutex_init(&mutex, &mutexattr) ||
-	pthread_mutex_lock(&mutex) ||
-	pthread_mutex_unlock(&mutex) ||
-	pthread_mutex_destroy(&mutex) ||
-	pthread_cond_destroy(&cond) ||
-	pthread_condattr_destroy(&condattr) ||
-	pthread_mutexattr_destroy(&mutexattr));
+int
+main ()
+{
+
+#if (defined(__mips) || defined(__mips__)) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
+
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex=""POSIX/pthreads/private""
+  db_cv_mutex="MIPS/gcc-assembly"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-if test "$db_cv_mutex" = "posix_only"; then
-	LIBS="$LIBS -lpthread"
 
-if test "$cross_compiling" = yes; then
-  cat >conftest.$ac_ext <<_ACEOF
+# MIPS/gcc: Linux
+if test "$db_cv_mutex" = no; then
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
 int
 main ()
 {
 
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	pthread_condattr_t condattr;
-	pthread_mutexattr_t mutexattr;
-	exit (
-	pthread_condattr_init(&condattr) ||
-	pthread_mutexattr_init(&mutexattr) ||
-	pthread_cond_init(&cond, &condattr) ||
-	pthread_mutex_init(&mutex, &mutexattr) ||
-	pthread_mutex_lock(&mutex) ||
-	pthread_mutex_unlock(&mutex) ||
-	pthread_mutex_destroy(&mutex) ||
-	pthread_cond_destroy(&cond) ||
-	pthread_condattr_destroy(&condattr) ||
-	pthread_mutexattr_destroy(&mutexattr));
+#if (defined(__mips) || defined(__mips__)) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex=""POSIX/pthreads/library/private""
+  db_cv_mutex="MIPS/gcc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-else
-  cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+# PaRisc/gcc: HP/UX
+if test "$db_cv_mutex" = no; then
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
-main() {
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	pthread_condattr_t condattr;
-	pthread_mutexattr_t mutexattr;
-	exit (
-	pthread_condattr_init(&condattr) ||
-	pthread_mutexattr_init(&mutexattr) ||
-	pthread_cond_init(&cond, &condattr) ||
-	pthread_mutex_init(&mutex, &mutexattr) ||
-	pthread_mutex_lock(&mutex) ||
-	pthread_mutex_unlock(&mutex) ||
-	pthread_mutex_destroy(&mutex) ||
-	pthread_cond_destroy(&cond) ||
-	pthread_condattr_destroy(&condattr) ||
-	pthread_mutexattr_destroy(&mutexattr));
+int
+main ()
+{
+
+#if (defined(__hppa) || defined(__hppa__)) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
+
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex=""POSIX/pthreads/library/private""
+  db_cv_mutex="HPPA/gcc-assembly"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-	LIBS="$orig_libs"
-fi
-if test "$db_cv_mutex" = "posix_only"; then
-	{ { echo "$as_me:$LINENO: error: unable to find POSIX 1003.1 mutex interfaces" >&5
-echo "$as_me: error: unable to find POSIX 1003.1 mutex interfaces" >&2;}
-   { (exit 1); exit 1; }; }
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# UI threads: thr_XXX
-if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "ui_only"; then
-LIBS="$LIBS -lthread"
+# PPC/gcc:
+if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30505,58 +33751,67 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
-#include 
 int
 main ()
 {
 
-	mutex_t mutex;
-	cond_t cond;
-	int type = USYNC_PROCESS;
-	exit (
-	mutex_init(&mutex, type, NULL) ||
-	cond_init(&cond, type, NULL) ||
-	mutex_lock(&mutex) ||
-	mutex_unlock(&mutex));
+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="UI/threads/library"
+  db_cv_mutex="PPC/gcc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS="$orig_libs"
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "ui_only"; then
+
+# Sparc/gcc: SunOS, Solaris
+if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30564,64 +33819,66 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
-#include 
 int
 main ()
 {
 
-	mutex_t mutex;
-	cond_t cond;
-	int type = USYNC_PROCESS;
-	exit (
-	mutex_init(&mutex, type, NULL) ||
-	cond_init(&cond, type, NULL) ||
-	mutex_lock(&mutex) ||
-	mutex_unlock(&mutex));
+#if defined(__sparc__) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="UI/threads"
+  db_cv_mutex="Sparc/gcc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-if test "$db_cv_mutex" = "ui_only"; then
-	{ { echo "$as_me:$LINENO: error: unable to find UI mutex interfaces" >&5
-echo "$as_me: error: unable to find UI mutex interfaces" >&2;}
-   { (exit 1); exit 1; }; }
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# msemaphore: HPPA only
-# Try HPPA before general msem test, it needs special alignment.
+# 68K/gcc: SunOS
 if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30630,17 +33887,11 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
 int
 main ()
 {
 
-#if defined(__hppa)
-	typedef msemaphore tsl_t;
-	msemaphore x;
-	msem_init(&x, 0);
-	msem_lock(&x, 0);
-	msem_unlock(&x, 0);
+#if (defined(mc68020) || defined(sun3)) && defined(__GNUC__)
 	exit(0);
 #else
 	FAIL TO COMPILE/LINK
@@ -30650,39 +33901,52 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="HP/msem_init"
+  db_cv_mutex="68K/gcc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# msemaphore: AIX, OSF/1
+# x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux
 if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30691,58 +33955,67 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
-#include 
 int
 main ()
 {
 
-	typedef msemaphore tsl_t;
-	msemaphore x;
-	msem_init(&x, 0);
-	msem_lock(&x, 0);
-	msem_unlock(&x, 0);
+#if (defined(i386) || defined(__i386__)) && defined(__GNUC__)
 	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="UNIX/msem_init"
+  db_cv_mutex="x86/gcc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# ReliantUNIX
+# x86_64/gcc: FreeBSD, NetBSD, BSD/OS, Linux
 if test "$db_cv_mutex" = no; then
-LIBS="$LIBS -lmproc"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30750,55 +34023,66 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
 int
 main ()
 {
 
-	typedef spinlock_t tsl_t;
-	spinlock_t x;
-	initspin(&x, 1);
-	cspinlock(&x);
-	spinunlock(&x);
+#if (defined(x86_64) || defined(__x86_64__)) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="ReliantUNIX/initspin"
+  db_cv_mutex="x86_64/gcc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS="$orig_libs"
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# SCO: UnixWare has threads in libthread, but OpenServer doesn't.
+# S390/cc: IBM OS/390 Unix
 if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30811,7 +34095,7 @@ int
 main ()
 {
 
-#if defined(__USLC__)
+#if defined(__MVS__) && defined(__IBMC__)
 	exit(0);
 #else
 	FAIL TO COMPILE/LINK
@@ -30822,37 +34106,51 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="SCO/x86/cc-assembly"
+  db_cv_mutex="S390/cc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# abilock_t: SGI
+# S390/gcc: Linux
 if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30861,58 +34159,67 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
 int
 main ()
 {
 
-	typedef abilock_t tsl_t;
-	abilock_t x;
-	init_lock(&x);
-	acquire_lock(&x);
-	release_lock(&x);
+#if defined(__s390__) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="SGI/init_lock"
+  db_cv_mutex="S390/gcc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# sema_t: Solaris
-# The sema_XXX calls do not work on Solaris 5.5.  I see no reason to ever
-# turn this test on, unless we find some other platform that uses the old
-# POSIX.1 interfaces.  (I plan to move directly to pthreads on Solaris.)
-if test "$db_cv_mutex" = DOESNT_WORK; then
+# ia64/gcc: Linux
+if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30920,58 +34227,66 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
 int
 main ()
 {
 
-	typedef sema_t tsl_t;
-	sema_t x;
-	sema_init(&x, 1, USYNC_PROCESS, NULL);
-	sema_wait(&x);
-	sema_post(&x);
+#if defined(__ia64) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="UNIX/sema_init"
+  db_cv_mutex="ia64/gcc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# _lock_try/_lock_clear: Solaris
-# On Solaris systems without Pthread or UI mutex interfaces, DB uses the
-# undocumented _lock_try _lock_clear function calls instead of either the
-# sema_trywait(3T) or sema_wait(3T) function calls.  This is because of
-# problems in those interfaces in some releases of the Solaris C library.
+# uts/cc: UTS
 if test "$db_cv_mutex" = no; then
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30980,215 +34295,362 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include 
 int
 main ()
 {
 
-	typedef lock_t tsl_t;
-	lock_t x;
-	_lock_try(&x);
-	_lock_clear(&x);
+#if defined(_UTS)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="Solaris/_lock_try"
+  db_cv_mutex="UTS/cc-assembly"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# _check_lock/_clear_lock: AIX
+# default to UNIX fcntl system call mutexes.
 if test "$db_cv_mutex" = no; then
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+	db_cv_mutex="UNIX/fcntl"
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $db_cv_mutex" >&5
+echo "${ECHO_T}$db_cv_mutex" >&6; }
+
+
+
+db_threadid_t_decl=notset
+
+case "$db_cv_mutex" in
+68K/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_68K_GCC_ASSEMBLY 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-#include 
-int
-main ()
-{
 
-	int x;
-	_check_lock(&x,0,1);
-	_clear_lock(&x,0);
+;;
+AIX/_check_lock)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_AIX_CHECK_LOCK 1
+_ACEOF
 
-  ;
-  return 0;
-}
+
+;;
+Darwin/_spin_lock_try)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY 1
+_ACEOF
+
+
+;;
+ALPHA/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_ALPHA_GCC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+ARM/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_ARM_GCC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+HP/msem_init)		ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_HPPA_MSEM_INIT 1
+_ACEOF
+
+
+;;
+HPPA/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_HPPA_GCC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+ia64/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_IA64_GCC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+POSIX/pthreads)		ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_PTHREADS 1
+_ACEOF
+
+
+;;
+POSIX/pthreads/private)	ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_PTHREADS 1
+_ACEOF
+
+
+
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_THREAD_ONLY 1
+_ACEOF
+
+
+;;
+POSIX/pthreads/library)	ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_PTHREADS 1
+_ACEOF
+
+
+;;
+POSIX/pthreads/library/private)
+			ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_PTHREADS 1
+_ACEOF
+
+
+
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_THREAD_ONLY 1
+_ACEOF
+
+
+;;
+PPC/gcc-assembly)
+			ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_PPC_GCC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+ReliantUNIX/initspin)	LIBSO_LIBS="$LIBSO_LIBS -lmproc"
+			ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_RELIANTUNIX_INITSPIN 1
+_ACEOF
+
+
+;;
+S390/cc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_S390_CC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+S390/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_S390_GCC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+SCO/x86/cc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_SCO_X86_CC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+SGI/init_lock)		ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_SGI_INIT_LOCK 1
+_ACEOF
+
+
+;;
+Solaris/_lock_try)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_SOLARIS_LOCK_TRY 1
+_ACEOF
+
+
+;;
+Solaris/lwp)		ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_SOLARIS_LWP 1
+_ACEOF
+
+
+;;
+Sparc/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_SPARC_GCC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+Tru64/cc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_TRU64_CC_ASSEMBLY 1
+_ACEOF
+
+
+;;
+UI/threads)		ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_UI_THREADS 1
+_ACEOF
+
+
+;;
+UI/threads/library)	ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_UI_THREADS 1
+_ACEOF
+
+
+;;
+UNIX/msem_init)		ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_MSEM_INIT 1
+_ACEOF
+
+
+;;
+UNIX/sema_init)		ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_SEMA_INIT 1
+_ACEOF
+
+
+;;
+UTS/cc-assembly)	ADDITIONAL_OBJS="uts4.cc${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_UTS_CC_ASSEMBLY 1
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  db_cv_mutex="AIX/_check_lock"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
 
-# _spin_lock_try/_spin_unlock: Apple/Darwin
-if test "$db_cv_mutex" = no; then
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+;;
+win32)			ADDITIONAL_OBJS="mut_win32${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_WIN32 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-	int x;
-	_spin_lock_try(&x);
-	_spin_unlock(&x);
+;;
+win32/gcc)		ADDITIONAL_OBJS="mut_win32${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_WIN32_GCC 1
+_ACEOF
 
-  ;
-  return 0;
-}
+
+;;
+MIPS/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_MIPS_GCC_ASSEMBLY 1
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  db_cv_mutex="Darwin/_spin_lock_try"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
 
-# Tru64/cc
-if test "$db_cv_mutex" = no; then
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+;;
+x86/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_X86_GCC_ASSEMBLY 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-#if defined(__alpha) && defined(__DECC)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
+;;
+x86_64/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_X86_64_GCC_ASSEMBLY 1
+_ACEOF
 
-  ;
-  return 0;
-}
+
+;;
+UNIX/fcntl)		{ echo "$as_me:$LINENO: WARNING: NO FAST MUTEXES FOUND FOR THIS COMPILER/ARCHITECTURE." >&5
+echo "$as_me: WARNING: NO FAST MUTEXES FOUND FOR THIS COMPILER/ARCHITECTURE." >&2;}
+			ADDITIONAL_OBJS="mut_fcntl${o} $ADDITIONAL_OBJS"
+			cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_FCNTL 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  db_cv_mutex="Tru64/cc-assembly"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-# Alpha/gcc
-if test "$db_cv_mutex" = no; then
+;;
+*)			{ { echo "$as_me:$LINENO: error: Unknown mutex interface: $db_cv_mutex" >&5
+echo "$as_me: error: Unknown mutex interface: $db_cv_mutex" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
+# The mutex selection may require specific declarations -- we fill in most of
+# them above, but here are the common ones.
+#
+# The mutex selection may tell us what kind of thread package we're using,
+# which we use to figure out the thread type.
+#
+# If we're configured for the POSIX pthread API, then force the thread ID type
+# and include function, regardless of the mutex selection.  Ditto for the
+# (default) Solaris lwp mutexes, because they don't have a way to return the
+# thread ID.
+#
+# Try and link with a threads library if possible.  The problem is the Solaris
+# C library has UI/POSIX interface stubs, but they're broken, configuring them
+# for inter-process mutexes doesn't return an error, but it doesn't work either.
+# For that reason always add -lpthread if we're using pthread calls or mutexes
+# and there's a pthread library.
+#
+# We can't depend on any specific call existing (pthread_create, for example),
+# as it may be #defined in an include file -- OSF/1 (Tru64) has this problem.
+case "$db_cv_mutex" in
+POSIX/pthread*|Solaris/lwp)
+	thread_h_decl="#include "
+	db_threadid_t_decl="typedef pthread_t db_threadid_t;"
+	{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5
+echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pthread_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31196,53 +34658,78 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+
 int
 main ()
 {
-
-#if defined(__alpha) && defined(__GNUC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="ALPHA/gcc-assembly"
+  ac_cv_lib_pthread_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+	ac_cv_lib_pthread_main=no
 fi
 
-# ARM/gcc: Linux
-if test "$db_cv_mutex" = no; then
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; }
+if test $ac_cv_lib_pthread_main = yes; then
+  LIBSO_LIBS="$LIBSO_LIBS -lpthread"
+fi
+ac_cv_lib_pthread=ac_cv_lib_pthread_main
+;;
+UI/threads*)
+	thread_h_decl="#include "
+	db_threadid_t_decl="typedef thread_t db_threadid_t;"
+	{ echo "$as_me:$LINENO: checking for main in -lthread" >&5
+echo $ECHO_N "checking for main in -lthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_thread_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lthread  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31250,53 +34737,79 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+
 int
 main ()
 {
-
-#if defined(__arm__) && defined(__GNUC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="ARM/gcc-assembly"
+  ac_cv_lib_thread_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+	ac_cv_lib_thread_main=no
 fi
 
-# PaRisc/gcc: HP/UX
-if test "$db_cv_mutex" = no; then
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_thread_main" >&5
+echo "${ECHO_T}$ac_cv_lib_thread_main" >&6; }
+if test $ac_cv_lib_thread_main = yes; then
+  LIBSO_LIBS="$LIBSO_LIBS -lthread"
+fi
+ac_cv_lib_thread=ac_cv_lib_thread_main
+;;
+*)
+	if test "$db_cv_pthread_api" = "yes"; then
+		thread_h_decl="#include "
+		db_threadid_t_decl="typedef pthread_t db_threadid_t;"
+		{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5
+echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pthread_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31304,107 +34817,184 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+
 int
 main ()
 {
-
-#if (defined(__hppa) || defined(__hppa__)) && defined(__GNUC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="HPPA/gcc-assembly"
+  ac_cv_lib_pthread_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_cv_lib_pthread_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; }
+if test $ac_cv_lib_pthread_main = yes; then
+  LIBSO_LIBS="$LIBSO_LIBS -lpthread"
 fi
+ac_cv_lib_pthread=ac_cv_lib_pthread_main
 
-# PPC/gcc:
-if test "$db_cv_mutex" = no; then
-cat >conftest.$ac_ext <<_ACEOF
+	fi;;
+esac
+
+# We need to know if the thread ID type will fit into an integral type and we
+# can compare it for equality and generally treat it like an int, or if it's a
+# non-integral type and we have to treat it like a structure or other untyped
+# block of bytes.  For example, MVS typedef's pthread_t to a structure.
+
+
+if test "$db_threadid_t_decl" = "notset"; then
+	db_threadid_t_decl="typedef uintmax_t db_threadid_t;"
+	cat >>confdefs.h <<\_ACEOF
+#define HAVE_SIMPLE_THREAD_TYPE 1
+_ACEOF
+
+else
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#include 
+	$thread_h_decl
 int
 main ()
 {
 
-#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GNUC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
+	$db_threadid_t_decl
+	db_threadid_t a;
+	a = 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="PPC/gcc-assembly"
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_SIMPLE_THREAD_TYPE 1
+_ACEOF
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-# Sparc/gcc: SunOS, Solaris
-if test "$db_cv_mutex" = no; then
+# If we're building replication and configured with POSIX pthreads or were
+# told to build using the POSIX API, build the replication manager framework.
+db_cv_build_replication_mgr="no"
+if test "$db_cv_build_replication" = "yes"; then
+
+
+	case "$db_cv_mutex" in
+	POSIX/pthread*|Solaris/lwp)
+		db_cv_build_replication_mgr="yes";;
+	esac
+	if test "$db_cv_pthread_api" = "yes"; then
+		db_cv_build_replication_mgr="yes"
+	fi
+
+	if test "$db_cv_build_replication_mgr" = "yes"; then
+		cat >>confdefs.h <<\_ACEOF
+#define HAVE_REPLICATION_THREADS 1
+_ACEOF
+
+
+		# Solaris requires the socket and nsl libraries to build the
+		# replication manager.  Don't add nsl regardless of the OS,
+		# it causes RPC to fail on AIX 4.3.3.
+		case "$host_os" in
+		solaris*)
+			{ echo "$as_me:$LINENO: checking for main in -lnsl" >&5
+echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_nsl_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31412,53 +35002,75 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+
 int
 main ()
 {
-
-#if defined(__sparc__) && defined(__GNUC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="Sparc/gcc-assembly"
+  ac_cv_lib_nsl_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_cv_lib_nsl_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6; }
+if test $ac_cv_lib_nsl_main = yes; then
+  LIBSO_LIBS="$LIBSO_LIBS -lnsl"
 fi
+ac_cv_lib_nsl=ac_cv_lib_nsl_main
 
-# 68K/gcc: SunOS
-if test "$db_cv_mutex" = no; then
+			{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5
+echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; }
+if test "${ac_cv_lib_socket_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31466,53 +35078,116 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+
 int
 main ()
 {
-
-#if (defined(mc68020) || defined(sun3)) && defined(__GNUC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="68K/gcc-assembly"
+  ac_cv_lib_socket_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_cv_lib_socket_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; }
+if test $ac_cv_lib_socket_main = yes; then
+  LIBSO_LIBS="$LIBSO_LIBS -lsocket"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_lib_socket=ac_cv_lib_socket_main
+;;
+		esac
+	fi
 fi
 
-# x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux
-if test "$db_cv_mutex" = no; then
+# There are 3 classes of mutexes:
+#
+# 1: Mutexes requiring no cleanup, for example, test-and-set mutexes.
+# 2: Mutexes that must be destroyed, but which don't hold permanent system
+#    resources, for example, pthread mutexes on MVS aka OS/390 aka z/OS.
+# 3: Mutexes that must be destroyed, even after the process is gone, for
+#    example, pthread mutexes on QNX and binary semaphores on VxWorks.
+#
+# DB cannot currently distinguish between #2 and #3 because DB does not know
+# if the application is running environment recovery as part of startup and
+# does not need to do cleanup, or if the environment is being removed and/or
+# recovered in a loop in the application, and so does need to clean up.  If
+# we get it wrong, we're going to call the mutex destroy routine on a random
+# piece of memory, which usually works, but just might drop core.  For now,
+# we group #2 and #3 into the HAVE_MUTEX_SYSTEM_RESOURCES define, until we
+# have a better solution or reason to solve this in a general way -- so far,
+# the places we've needed to handle this are few.
+
+
+
+case "$host_os$db_cv_mutex" in
+*qnx*POSIX/pthread*|openedition*POSIX/pthread*)
+	cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_SYSTEM_RESOURCES 1
+_ACEOF
+;;
+esac
+
+# Test for various functions/libraries -- do tests that change library values
+# first.
+#
+# The yield function on Solaris is almost certainly pthread_yield (LWP threads
+# or POSIX pthreads), or thr_yield (UI threads).  There's an outside chance it
+# is sched_yield() though, only available in -lrt on Solaris.
+#
+# The Berkeley DB library calls fdatasync, only available in -lrt on Solaris.
+# See if we can find either without additional libraries or in -lrt.  If found
+# in -lrt and we haven't yet added -lrt,  add it to the shared library list.
+{ echo "$as_me:$LINENO: checking for library containing fdatasync" >&5
+echo $ECHO_N "checking for library containing fdatasync... $ECHO_C" >&6; }
+if test "${ac_cv_search_fdatasync+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31520,53 +35195,99 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fdatasync ();
 int
 main ()
 {
-
-#if (defined(i386) || defined(__i386__) || defined(__x86_64__)) && defined(__GNUC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return fdatasync ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+for ac_lib in '' rt; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="x86/gcc-assembly"
+  ac_cv_search_fdatasync=$ac_res
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
-# S390/cc: IBM OS/390 Unix
-if test "$db_cv_mutex" = no; then
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext
+  if test "${ac_cv_search_fdatasync+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_fdatasync+set}" = set; then
+  :
+else
+  ac_cv_search_fdatasync=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_fdatasync" >&5
+echo "${ECHO_T}$ac_cv_search_fdatasync" >&6; }
+ac_res=$ac_cv_search_fdatasync
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+      if test "$ac_cv_search_fdatasync" != "none required" ; then
+	LIBSO_LIBS="$LIBSO_LIBS -lrt";
+    fi
+else
+      { echo "$as_me:$LINENO: checking for library containing sched_yield" >&5
+echo $ECHO_N "checking for library containing sched_yield... $ECHO_C" >&6; }
+if test "${ac_cv_search_sched_yield+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31574,53 +35295,107 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
 int
 main ()
 {
-
-#if defined(__MVS__) && defined(__IBMC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return sched_yield ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+for ac_lib in '' rt; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="S390/cc-assembly"
+  ac_cv_search_sched_yield=$ac_res
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext
+  if test "${ac_cv_search_sched_yield+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_sched_yield+set}" = set; then
+  :
+else
+  ac_cv_search_sched_yield=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_cv_search_sched_yield" >&5
+echo "${ECHO_T}$ac_cv_search_sched_yield" >&6; }
+ac_res=$ac_cv_search_sched_yield
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+      if test "$ac_cv_search_sched_yield" != "none required" ; then
+	LIBSO_LIBS="$LIBSO_LIBS -lrt";
+    fi
 fi
 
-# S390/gcc: Linux
-if test "$db_cv_mutex" = no; then
+fi
+
+
+# !!!
+# We could be more exact about whether these libraries are needed, but don't
+# bother -- if they exist, we load them, it's only the test programs anyway.
+{ echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31628,53 +35403,75 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+
 int
 main ()
 {
-
-#if defined(__s390__) && defined(__GNUC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="S390/gcc-assembly"
+  ac_cv_lib_m_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_cv_lib_m_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6; }
+if test $ac_cv_lib_m_main = yes; then
+  TEST_LIBS="$TEST_LIBS -lm"
 fi
+ac_cv_lib_m=ac_cv_lib_m_main
 
-# ia86/gcc: Linux
-if test "$db_cv_mutex" = no; then
+{ echo "$as_me:$LINENO: checking for main in -lnsl" >&5
+echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_nsl_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31682,53 +35479,75 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+
 int
 main ()
 {
-
-#if defined(__ia64) && defined(__GNUC__)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="ia64/gcc-assembly"
+  ac_cv_lib_nsl_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_cv_lib_nsl_main=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6; }
+if test $ac_cv_lib_nsl_main = yes; then
+  TEST_LIBS="$TEST_LIBS -lnsl"
 fi
+ac_cv_lib_nsl=ac_cv_lib_nsl_main
 
-# uts/cc: UTS
-if test "$db_cv_mutex" = no; then
+{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5
+echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pthread_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31736,363 +35555,190 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+
 int
 main ()
 {
-
-#if defined(_UTS)
-	exit(0);
-#else
-	FAIL TO COMPILE/LINK
-#endif
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  db_cv_mutex="UTS/cc-assembly"
+  ac_cv_lib_pthread_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-# default to UNIX fcntl system call mutexes.
-if test "$db_cv_mutex" = no; then
-	db_cv_mutex="UNIX/fcntl"
-fi
-
-fi
-echo "$as_me:$LINENO: result: $db_cv_mutex" >&5
-echo "${ECHO_T}$db_cv_mutex" >&6
-
-case "$db_cv_mutex" in
-68K/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_68K_GCC_ASSEMBLY 1
-_ACEOF
-
-
-;;
-AIX/_check_lock)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_AIX_CHECK_LOCK 1
-_ACEOF
-
-
-;;
-Darwin/_spin_lock_try)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY 1
-_ACEOF
-
-
-;;
-ALPHA/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_ALPHA_GCC_ASSEMBLY 1
-_ACEOF
-
-
-;;
-ARM/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_ARM_GCC_ASSEMBLY 1
-_ACEOF
-
-
-;;
-HP/msem_init)		ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_HPPA_MSEM_INIT 1
-_ACEOF
-
-
-;;
-HPPA/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_HPPA_GCC_ASSEMBLY 1
-_ACEOF
-
-
-;;
-ia64/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_IA64_GCC_ASSEMBLY 1
-_ACEOF
-
-
-;;
-POSIX/pthreads)		ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_PTHREADS 1
-_ACEOF
-
-
-;;
-POSIX/pthreads/private)	ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_PTHREADS 1
-_ACEOF
-
-
-
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_THREAD_ONLY 1
-_ACEOF
-
-
-;;
-POSIX/pthreads/library)	LIBS="$LIBS -lpthread"
-			LIBJSO_LIBS="$LIBJSO_LIBS -lpthread"
-			LIBTSO_LIBS="$LIBTSO_LIBS -lpthread"
-			ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_PTHREADS 1
-_ACEOF
-
-
-;;
-POSIX/pthreads/library/private)
-			LIBS="$LIBS -lpthread"
-			LIBJSO_LIBS="$LIBJSO_LIBS -lpthread"
-			LIBTSO_LIBS="$LIBTSO_LIBS -lpthread"
-			ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_PTHREADS 1
-_ACEOF
-
-
-
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_THREAD_ONLY 1
-_ACEOF
-
-
-;;
-PPC/gcc-assembly)
-			ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_PPC_GCC_ASSEMBLY 1
-_ACEOF
-
-
-;;
-ReliantUNIX/initspin)	LIBS="$LIBS -lmproc"
-			ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_RELIANTUNIX_INITSPIN 1
-_ACEOF
-
-
-;;
-S390/cc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_S390_CC_ASSEMBLY 1
-_ACEOF
-
-
-;;
-S390/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_S390_GCC_ASSEMBLY 1
-_ACEOF
-
-
-;;
-SCO/x86/cc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_SCO_X86_CC_ASSEMBLY 1
-_ACEOF
-
-
-;;
-SGI/init_lock)		ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_SGI_INIT_LOCK 1
-_ACEOF
-
-
-;;
-Solaris/_lock_try)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_SOLARIS_LOCK_TRY 1
-_ACEOF
-
-
-;;
-Solaris/lwp)		ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_SOLARIS_LWP 1
-_ACEOF
-
-
-;;
-Sparc/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_SPARC_GCC_ASSEMBLY 1
-_ACEOF
+	ac_cv_lib_pthread_main=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; }
+if test $ac_cv_lib_pthread_main = yes; then
+  TEST_LIBS="$TEST_LIBS -lpthread"
+fi
+ac_cv_lib_pthread=ac_cv_lib_pthread_main
 
-;;
-Tru64/cc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_TRU64_CC_ASSEMBLY 1
+{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5
+echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; }
+if test "${ac_cv_lib_socket_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 
-;;
-
-UI/threads)		ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_UI_THREADS 1
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_socket_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_cv_lib_socket_main=no
+fi
 
-;;
-UI/threads/library)	LIBS="$LIBS -lthread"
-			ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_UI_THREADS 1
-_ACEOF
-
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; }
+if test $ac_cv_lib_socket_main = yes; then
+  TEST_LIBS="$TEST_LIBS -lsocket"
+fi
+ac_cv_lib_socket=ac_cv_lib_socket_main
 
-;;
-UNIX/msem_init)		ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_MSEM_INIT 1
-_ACEOF
 
+# Update LIBS so that the rest of our tests are run with the libraries we'll
+# load against.
+LIBS="$LIBSO_LIBS"
 
-;;
-UNIX/sema_init)		ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_SEMA_INIT 1
-_ACEOF
+# Checks for system functions for which we have replacements.
+#
+# The only portable getcwd call is getcwd(char *, size_t), where the
+# buffer is non-NULL -- Solaris can't handle a NULL buffer, and they
+# deleted getwd().
 
 
-;;
-UTS/cc-assembly)	ADDITIONAL_OBJS="uts4.cc${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_UTS_CC_ASSEMBLY 1
-_ACEOF
 
 
-;;
-win32)			ADDITIONAL_OBJS="mut_win32${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_WIN32 1
-_ACEOF
 
 
-;;
-win32/gcc)		ADDITIONAL_OBJS="mut_win32${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_WIN32_GCC 1
-_ACEOF
 
 
-;;
-x86/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_X86_GCC_ASSEMBLY 1
-_ACEOF
 
 
-;;
-UNIX/fcntl)		{ echo "$as_me:$LINENO: WARNING: NO FAST MUTEXES FOUND FOR THIS COMPILER/ARCHITECTURE." >&5
-echo "$as_me: WARNING: NO FAST MUTEXES FOUND FOR THIS COMPILER/ARCHITECTURE." >&2;}
-			ADDITIONAL_OBJS="mut_fcntl${o} $ADDITIONAL_OBJS"
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_FCNTL 1
-_ACEOF
 
 
-;;
-*)			{ { echo "$as_me:$LINENO: error: Unknown mutex interface: $db_cv_mutex" >&5
-echo "$as_me: error: Unknown mutex interface: $db_cv_mutex" >&2;}
-   { (exit 1); exit 1; }; };;
-esac
 
-if test "$db_cv_mutex" != "UNIX/fcntl"; then
-	cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_THREADS 1
-_ACEOF
 
 
 
-fi
 
-# There are 3 classes of mutexes:
-#
-# 1: Mutexes requiring no cleanup, for example, test-and-set mutexes.
-# 2: Mutexes that must be destroyed, but which don't hold permanent system
-#    resources, for example, pthread mutexes on MVS aka OS/390 aka z/OS.
-# 3: Mutexes that must be destroyed, even after the process is gone, for
-#    example, pthread mutexes on QNX and binary semaphores on VxWorks.
-#
-# DB cannot currently distinguish between #2 and #3 because DB does not know
-# if the application is running environment recovery as part of startup and
-# does not need to do cleanup, or if the environment is being removed and/or
-# recovered in a loop in the application, and so does need to clean up.  If
-# we get it wrong, we're going to call the mutex destroy routine on a random
-# piece of memory, which usually works, but just might drop core.  For now,
-# we group #2 and #3 into the HAVE_MUTEX_SYSTEM_RESOURCES define, until we
-# have a better solution or reason to solve this in a general way -- so far,
-# the places we've needed to handle this are few.
 
 
 
-case "$host_os$db_cv_mutex" in
-*qnx*POSIX/pthread*|openedition*POSIX/pthread*)
-	cat >>confdefs.h <<\_ACEOF
-#define HAVE_MUTEX_SYSTEM_RESOURCES 1
-_ACEOF
-;;
-esac
 
-# Checks for system functions for which we have replacements.
-#
-# XXX
-# The only portable getcwd call is getcwd(char *, size_t), where the
-# buffer is non-NULL -- Solaris can't handle a NULL buffer, and they
-# deleted getwd().
 
 
 
 
 
 
-for ac_func in getcwd getopt memcmp memcpy memmove raise
+for ac_func in \
+	abort atoi atol getcwd getenv getopt isalpha isdigit isprint isspace\
+	memcmp memcpy memmove printf raise rand strcasecmp strcat strchr\
+	strdup strerror strncat strncmp strrchr strsep strtol strtoul
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -32118,53 +35764,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -32173,25 +35825,25 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
+  case " $LIBOBJS " in
   *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
+  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
+ ;;
 esac
 
 fi
@@ -32199,16 +35851,39 @@ done
 
 
 
+# Check for system functions we optionally use.
+
+
+
+
+
+
+
+
 
 
 
 
-for ac_func in strcasecmp strdup strerror strtol strtoul
+
+
+
+
+
+
+
+
+
+
+for ac_func in \
+   _fstati64 clock_gettime directio fchmod fcntl fdatasync getaddrinfo\
+   getrusage gettimeofday getuid mprotect pstat_getdynamic pthread_yield\
+   sched_yield select sigaction snprintf stat strftime sysconf vsnprintf\
+   yield
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -32234,53 +35909,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -32289,45 +35970,32 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
-
 fi
 done
 
 
+# Replication can't run correctly if ftruncate isn't available.
 
-# Check for system functions we optionally use.
-
-
-
-
-
-
-for ac_func in _fstati64 clock_gettime directio fdatasync ftruncate getrusage
+for ac_func in ftruncate
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -32353,53 +36021,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -32408,13 +36082,15 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -32423,17 +36099,25 @@ _ACEOF
 fi
 done
 
+if test \
+    "$db_cv_build_replication" = "yes" -a "$ac_cv_func_ftruncate" = "no"; then
+	db_cv_build_replication=no
+	{ echo "$as_me:$LINENO: WARNING: replication requires ftruncate, replication disabled." >&5
+echo "$as_me: WARNING: replication requires ftruncate, replication disabled." >&2;}
+fi
 
+# ctime_r --
+#
+# There are two versions of ctime_r, one of which takes a buffer length as a
+# third argument, and one which only takes two arguments.  (There is also a
+# difference in return values, but we handle that in the code itself.)
 
-
-
-
-for ac_func in gettimeofday getuid pstat_getdynamic rand sched_yield
+for ac_func in ctime_r
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -32459,53 +36143,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -32514,13 +36204,15 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -32529,114 +36221,88 @@ _ACEOF
 fi
 done
 
-
-
-
-
-
-
-for ac_func in select snprintf srand sysconf vsnprintf yield
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+if test "$ac_cv_func_ctime_r" = "yes"; then
+{ echo "$as_me:$LINENO: checking for 2 or 3 argument version of ctime_r" >&5
+echo $ECHO_N "checking for 2 or 3 argument version of ctime_r... $ECHO_C" >&6; }
+if test "${db_cv_ctime_r_3arg+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case  declares $ac_func.
-   For example, HP-UX 11i  declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer  to  if __STDC__ is defined, since
-     exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include 
-#else
-# include 
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
+#include 
 int
 main ()
 {
-return f != $ac_func;
+
+	ctime_r(NULL, NULL, 100);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  db_cv_ctime_r_3arg="3-argument"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	db_cv_ctime_r_3arg="2-argument"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+{ echo "$as_me:$LINENO: result: $db_cv_ctime_r_3arg" >&5
+echo "${ECHO_T}$db_cv_ctime_r_3arg" >&6; }
+fi
+if test "$db_cv_ctime_r_3arg" = "3-argument"; then
+	cat >>confdefs.h <<\_ACEOF
+#define HAVE_CTIME_R_3ARG 1
 _ACEOF
 
-fi
-done
 
 
+fi
+
 # Pread/pwrite.
 # HP-UX has pread/pwrite, but it doesn't work with largefile support.
 # NCR's version of System V R 4.3 has pread/pwrite symbols, but no support.
@@ -32650,9 +36316,9 @@ echo "$as_me: WARNING: pread/pwrite interfaces ignored on $host_os-$host_vendor.
 for ac_func in pread pwrite
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -32678,53 +36344,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -32733,13 +36405,15 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -32751,8 +36425,8 @@ done
 esac
 
 # Check for fcntl(2) to deny child process access to file descriptors.
-echo "$as_me:$LINENO: checking for fcntl/F_SETFD" >&5
-echo $ECHO_N "checking for fcntl/F_SETFD... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for fcntl/F_SETFD" >&5
+echo $ECHO_N "checking for fcntl/F_SETFD... $ECHO_C" >&6; }
 if test "${db_cv_fcntl_f_setfd+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -32777,24 +36451,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -32803,13 +36489,14 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-db_cv_fcntl_f_setfd=no
+	db_cv_fcntl_f_setfd=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $db_cv_fcntl_f_setfd" >&5
-echo "${ECHO_T}$db_cv_fcntl_f_setfd" >&6
+{ echo "$as_me:$LINENO: result: $db_cv_fcntl_f_setfd" >&5
+echo "${ECHO_T}$db_cv_fcntl_f_setfd" >&6; }
 if test "$db_cv_fcntl_f_setfd" = "yes"; then
 	cat >>confdefs.h <<\_ACEOF
 #define HAVE_FCNTL_F_SETFD 1
@@ -32821,12 +36508,10 @@ fi
 
 # A/UX has a broken getopt(3).
 case "$host_os" in
-aux*)	case $LIBOBJS in
-    "getopt.$ac_objext"   | \
-  *" getopt.$ac_objext"   | \
-    "getopt.$ac_objext "* | \
+aux*)	case " $LIBOBJS " in
   *" getopt.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;;
+  *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
+ ;;
 esac
 ;;
 esac
@@ -32835,8 +36520,8 @@ esac
 # Linux and SGI require buffer alignment we may not match, otherwise writes
 # will fail.  Default to not using the O_DIRECT flag.
 if test "$db_cv_o_direct" = "yes"; then
-	echo "$as_me:$LINENO: checking for open/O_DIRECT" >&5
-echo $ECHO_N "checking for open/O_DIRECT... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for open/O_DIRECT" >&5
+echo $ECHO_N "checking for open/O_DIRECT... $ECHO_C" >&6; }
 if test "${db_cv_open_o_direct+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -32861,24 +36546,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -32887,13 +36584,14 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-db_cv_open_o_direct=no
+	db_cv_open_o_direct=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $db_cv_open_o_direct" >&5
-echo "${ECHO_T}$db_cv_open_o_direct" >&6
+{ echo "$as_me:$LINENO: result: $db_cv_open_o_direct" >&5
+echo "${ECHO_T}$db_cv_open_o_direct" >&6; }
 	if test \
 	    "$db_cv_o_direct" = "yes" -a "$db_cv_open_o_direct" = "yes"; then
 		cat >>confdefs.h <<\_ACEOF
@@ -32906,15 +36604,15 @@ _ACEOF
 fi
 
 # Check for largefile support.
-# Check whether --enable-largefile or --disable-largefile was given.
+# Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then
-  enableval="$enable_largefile"
+  enableval=$enable_largefile;
+fi
 
-fi;
 if test "$enable_largefile" != no; then
 
-  echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; }
 if test "${ac_cv_sys_largefile_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -32922,8 +36620,8 @@ else
      if test "$GCC" != yes; then
        ac_save_CC=$CC
        while :; do
-     	 # IRIX 6.2 and later do not support large files by default,
-     	 # so use the C compiler's -n32 option if that helps.
+	 # IRIX 6.2 and later do not support large files by default,
+	 # so use the C compiler's -n32 option if that helps.
 	 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32947,25 +36645,37 @@ main ()
   return 0;
 }
 _ACEOF
-     	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+	 rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -32974,28 +36684,42 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext
-     	 CC="$CC -n32"
-     	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+
+rm -f core conftest.err conftest.$ac_objext
+	 CC="$CC -n32"
+	 rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -33004,22 +36728,24 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
 	 break
        done
        CC=$ac_save_CC
        rm -f conftest.$ac_ext
     fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; }
   if test "$ac_cv_sys_largefile_CC" != no; then
     CC=$CC$ac_cv_sys_largefile_CC
   fi
 
-  echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; }
 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -33049,24 +36775,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -33075,8 +36813,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -33102,24 +36842,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -33128,13 +36880,15 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   break
 done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; }
 if test "$ac_cv_sys_file_offset_bits" != no; then
 
 cat >>confdefs.h <<_ACEOF
@@ -33143,8 +36897,8 @@ _ACEOF
 
 fi
 rm -f conftest*
-  echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; }
 if test "${ac_cv_sys_large_files+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -33174,24 +36928,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -33200,8 +36966,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -33227,24 +36995,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -33253,13 +37033,15 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   break
 done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
-echo "${ECHO_T}$ac_cv_sys_large_files" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6; }
 if test "$ac_cv_sys_large_files" != no; then
 
 cat >>confdefs.h <<_ACEOF
@@ -33272,140 +37054,30 @@ fi
 
 
 # Figure out how to create shared regions.
-#
-# First, we look for mmap.
-#
-# BSD/OS has mlock(2), but it doesn't work until the 4.1 release.
-#
-# Nextstep (version 3.3) apparently supports mmap(2) (the mmap symbol
-# is defined in the C library) but does not support munmap(2).  Don't
-# try to use mmap if we can't find munmap.
-#
-# Ultrix has mmap(2), but it doesn't work.
-mmap_ok=no
-case "$host_os" in
-bsdi3*|bsdi4.0)
-	{ echo "$as_me:$LINENO: WARNING: mlock(2) interface ignored on $host_os-$host_vendor." >&5
-echo "$as_me: WARNING: mlock(2) interface ignored on $host_os-$host_vendor." >&2;}
-	mmap_ok=yes
-
-
-for ac_func in mmap munmap
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case  declares $ac_func.
-   For example, HP-UX 11i  declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer  to  if __STDC__ is defined, since
-     exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include 
-#else
-# include 
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
-  mmap_ok=no
-fi
-done
-;;
-ultrix*)
-	{ echo "$as_me:$LINENO: WARNING: mmap(2) interface ignored on $host_os-$host_vendor." >&5
-echo "$as_me: WARNING: mmap(2) interface ignored on $host_os-$host_vendor." >&2;};;
-*)
+#
+# First, we look for mmap.
+#
+# BSD/OS has mlock(2), but it doesn't work until the 4.1 release.
+#
+# Nextstep (version 3.3) apparently supports mmap(2) (the mmap symbol
+# is defined in the C library) but does not support munmap(2).  Don't
+# try to use mmap if we can't find munmap.
+#
+# Ultrix has mmap(2), but it doesn't work.
+mmap_ok=no
+case "$host_os" in
+bsdi3*|bsdi4.0)
+	{ echo "$as_me:$LINENO: WARNING: mlock(2) interface ignored on $host_os-$host_vendor." >&5
+echo "$as_me: WARNING: mlock(2) interface ignored on $host_os-$host_vendor." >&2;}
 	mmap_ok=yes
 
 
-for ac_func in mlock munlock
+for ac_func in mmap munmap
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -33431,53 +37103,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -33486,29 +37164,38 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
+else
+  mmap_ok=no
 fi
 done
+;;
+ultrix*)
+	{ echo "$as_me:$LINENO: WARNING: mmap(2) interface ignored on $host_os-$host_vendor." >&5
+echo "$as_me: WARNING: mmap(2) interface ignored on $host_os-$host_vendor." >&2;};;
+*)
+	mmap_ok=yes
 
 
-
-for ac_func in mmap munmap
+for ac_func in mlock munlock
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -33534,53 +37221,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -33589,43 +37282,31 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-else
-  mmap_ok=no
 fi
 done
-;;
-esac
 
-# Second, we look for shmget.
-#
-# SunOS has the shmget(2) interfaces, but there appears to be a missing
-# #include  file, so we ignore them.
-shmget_ok=no
-case "$host_os" in
-sunos*)
-	{ echo "$as_me:$LINENO: WARNING: shmget(2) interface ignored on $host_os-$host_vendor." >&5
-echo "$as_me: WARNING: shmget(2) interface ignored on $host_os-$host_vendor." >&2;};;
-*)
-	shmget_ok=yes
 
-for ac_func in shmget
+
+for ac_func in mmap munmap
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -33651,53 +37332,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -33706,119 +37393,45 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 else
-  shmget_ok=no
+  mmap_ok=no
 fi
 done
 ;;
 esac
 
-# We require either mmap/munmap(2) or shmget(2).
-if test "$mmap_ok" = "no" -a "$shmget_ok" = "no"; then
-	{ echo "$as_me:$LINENO: WARNING: Neither mmap/munmap(2) or shmget(2) library functions." >&5
-echo "$as_me: WARNING: Neither mmap/munmap(2) or shmget(2) library functions." >&2;}
-fi
-
-# Optional RPC client/server.
-if test "$db_cv_rpc" = "yes"; then
-
-	cat >>confdefs.h <<\_ACEOF
-#define HAVE_RPC 1
-_ACEOF
-
-
-
-
-	# We use the target's rpcgen utility because it may be architecture
-	# specific, for example, 32- or 64-bit specific.
-	XDR_FILE=$srcdir/../rpc_server/db_server.x
-
-	# Prefer the -C option to rpcgen which generates ANSI C-conformant
-	# code.
-	RPCGEN="rpcgen -C"
-	echo "$as_me:$LINENO: checking \"$RPCGEN\" build of db_server.h" >&5
-echo $ECHO_N "checking \"$RPCGEN\" build of db_server.h... $ECHO_C" >&6
-	$RPCGEN -h $XDR_FILE > db_server.h 2>/dev/null
-	if test $? -ne 0; then
-		echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-		# Try rpcgen without the -C option.
-		RPCGEN="rpcgen"
-		echo "$as_me:$LINENO: checking \"$RPCGEN\" build of db_server.h" >&5
-echo $ECHO_N "checking \"$RPCGEN\" build of db_server.h... $ECHO_C" >&6
-		$RPCGEN -h $XDR_FILE > db_server.h 2>/dev/null
-		if test $? -ne 0; then
-			echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-			{ { echo "$as_me:$LINENO: error: Unable to build RPC support: $RPCGEN failed." >&5
-echo "$as_me: error: Unable to build RPC support: $RPCGEN failed." >&2;}
-   { (exit 1); exit 1; }; }
-		fi
-	fi
-
-	# Some rpcgen programs generate a set of client stubs called something
-	# like __db_env_create_4003 and functions on the server to handle the
-	# request called something like __db_env_create_4003_svc.  Others
-	# expect client and server stubs to both be called __db_env_create_4003.
-	#
-	# We have to generate code in whichever format rpcgen expects, and the
-	# only reliable way to do that is to check what is in the db_server.h
-	# file we just created.
-	if grep "env_create_[0-9]*_svc" db_server.h >/dev/null 2>&1 ; then
-		sed 's/__SVCSUFFIX__/_svc/' \
-		    < $srcdir/../rpc_server/c/gen_db_server.c > gen_db_server.c
-	else
-		sed 's/__SVCSUFFIX__//' \
-		    < $srcdir/../rpc_server/c/gen_db_server.c > gen_db_server.c
-	fi
-
-	echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-	$RPCGEN -l $XDR_FILE |
-	sed -e 's/^#include.*db_server.h.*/#include "db_server.h"/' \
-	    -e '1,/^#include/s/^#include/#include "db_config.h"\
-&/' > db_server_clnt.c
-
-	$RPCGEN -s tcp $XDR_FILE |
-	sed -e 's/^#include.*db_server.h.*/#include "db_server.h"/' \
-	    -e 's/^main *()/__dbsrv_main()/' \
-	    -e 's/^main *(.*argc.*argv.*)/__dbsrv_main(int argc, char *argv)/' \
-	    -e '/^db_rpc_serverprog/,/^}/{' \
-	    -e 's/return;//' \
-	    -e 's/^}/__dbsrv_timeout(0);}/' \
-	    -e '}' \
-	    -e '1,/^#include/s/^#include/#include "db_config.h"\
-#include "db_int_def.h"\
-&/' > db_server_svc.c
-
-	$RPCGEN -c $XDR_FILE |
-	sed -e 's/^#include.*db_server.h.*/#include "db_server.h"/' \
-	    -e '1,/^#include/s/^#include/#include "db_config.h"\
-&/' > db_server_xdr.c
-
-	RPC_SERVER_H=db_server.h
-	RPC_CLIENT_OBJS="\$(RPC_CLIENT_OBJS)"
-	ADDITIONAL_PROGS="berkeley_db_svc $ADDITIONAL_PROGS"
+# Second, we look for shmget.
+#
+# SunOS has the shmget(2) interfaces, but there appears to be a missing
+# #include  file, so we ignore them.
+shmget_ok=no
+case "$host_os" in
+sunos*)
+	{ echo "$as_me:$LINENO: WARNING: shmget(2) interface ignored on $host_os-$host_vendor." >&5
+echo "$as_me: WARNING: shmget(2) interface ignored on $host_os-$host_vendor." >&2;};;
+*)
+	shmget_ok=yes
 
-	case "$host_os" in
-	hpux*)
-		echo "$as_me:$LINENO: checking for svc_run" >&5
-echo $ECHO_N "checking for svc_run... $ECHO_C" >&6
-if test "${ac_cv_func_svc_run+set}" = set; then
+for ac_func in shmget
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -33827,12 +37440,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define svc_run to an innocuous variant, in case  declares svc_run.
+/* Define $ac_func to an innocuous variant, in case  declares $ac_func.
    For example, HP-UX 11i  declares gettimeofday.  */
-#define svc_run innocuous_svc_run
+#define $ac_func innocuous_$ac_func
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char svc_run (); below.
+    which can conflict with char $ac_func (); below.
     Prefer  to  if __STDC__ is defined, since
      exists even on freestanding compilers.  */
 
@@ -33842,147 +37455,181 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include 
 #endif
 
-#undef svc_run
+#undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char svc_run ();
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_svc_run) || defined (__stub___svc_run)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = svc_run;
 #endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != svc_run;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_svc_run=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_svc_run=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_svc_run" >&5
-echo "${ECHO_T}$ac_cv_func_svc_run" >&6
-if test $ac_cv_func_svc_run = yes; then
-  :
-else
-  echo "$as_me:$LINENO: checking for svc_run in -lnsl" >&5
-echo $ECHO_N "checking for svc_run in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_svc_run+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char svc_run ();
 int
 main ()
 {
-svc_run ();
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_nsl_svc_run=yes
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_nsl_svc_run=no
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_svc_run" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_svc_run" >&6
-if test $ac_cv_lib_nsl_svc_run = yes; then
-  LIBS="-lnsl $LIBS"; LIBTSO_LIBS="-lnsl $LIBTSO_LIBS";
-		    LIBJSO_LIBS="-lnsl $LIBJSO_LIBS"
 fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
+else
+  shmget_ok=no
 fi
+done
 ;;
-	solaris*)
-		echo "$as_me:$LINENO: checking for svc_run" >&5
-echo $ECHO_N "checking for svc_run... $ECHO_C" >&6
+esac
+
+# We require either mmap/munmap(2) or shmget(2).
+if test "$mmap_ok" = "no" -a "$shmget_ok" = "no"; then
+	{ echo "$as_me:$LINENO: WARNING: Neither mmap/munmap(2) or shmget(2) library functions." >&5
+echo "$as_me: WARNING: Neither mmap/munmap(2) or shmget(2) library functions." >&2;}
+fi
+
+# Optional RPC client/server.
+if test "$db_cv_rpc" = "yes"; then
+
+	cat >>confdefs.h <<\_ACEOF
+#define HAVE_RPC 1
+_ACEOF
+
+
+
+
+	# We use the target's rpcgen utility because it may be architecture
+	# specific, for example, 32- or 64-bit specific.
+	XDR_FILE=$srcdir/../rpc_server/db_server.x
+
+	# Prefer the -C option to rpcgen which generates ANSI C-conformant
+	# code.
+	RPCGEN="rpcgen -C"
+	{ echo "$as_me:$LINENO: checking \"$RPCGEN\" build of db_server.h" >&5
+echo $ECHO_N "checking \"$RPCGEN\" build of db_server.h... $ECHO_C" >&6; }
+	$RPCGEN -h $XDR_FILE > db_server.h 2>/dev/null
+	if test $? -ne 0; then
+		{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+		# Try rpcgen without the -C option.
+		RPCGEN="rpcgen"
+		{ echo "$as_me:$LINENO: checking \"$RPCGEN\" build of db_server.h" >&5
+echo $ECHO_N "checking \"$RPCGEN\" build of db_server.h... $ECHO_C" >&6; }
+		$RPCGEN -h $XDR_FILE > db_server.h 2>/dev/null
+		if test $? -ne 0; then
+			{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+			{ { echo "$as_me:$LINENO: error: Unable to build RPC support: $RPCGEN failed." >&5
+echo "$as_me: error: Unable to build RPC support: $RPCGEN failed." >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+	# Some rpcgen programs generate a set of client stubs called something
+	# like __db_env_create_4003 and functions on the server to handle the
+	# request called something like __db_env_create_4003_svc.  Others
+	# expect client and server stubs to both be called __db_env_create_4003.
+	#
+	# We have to generate code in whichever format rpcgen expects, and the
+	# only reliable way to do that is to check what is in the db_server.h
+	# file we just created.
+	if grep "env_create_[0-9]*_svc" db_server.h >/dev/null 2>&1 ; then
+		sed 's/__SVCSUFFIX__/_svc/' \
+		    < $srcdir/../rpc_server/c/gen_db_server.c > gen_db_server.c
+	else
+		sed 's/__SVCSUFFIX__//' \
+		    < $srcdir/../rpc_server/c/gen_db_server.c > gen_db_server.c
+	fi
+
+	{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+	$RPCGEN -l $XDR_FILE |
+	sed -e 's/^#include.*db_server.h.*/#include "db_server.h"/' \
+	    -e '1,/^#include/s/^#include/#include "db_config.h"\
+&/' > db_server_clnt.c
+
+	$RPCGEN -s tcp $XDR_FILE |
+	sed -e 's/^#include.*db_server.h.*/#include "db_server.h"/' \
+	    -e 's/^main *()/__dbsrv_main()/' \
+	    -e 's/^main *(.*argc.*argv.*)/__dbsrv_main(int argc, char *argv)/' \
+	    -e '/^db_rpc_serverprog/,/^}/{' \
+	    -e 's/return;//' \
+	    -e 's/^}/__dbsrv_timeout(0);}/' \
+	    -e '}' \
+	    -e '1,/^#include/s/^#include/#include "db_config.h"\
+&/' > db_server_svc.c
+
+	$RPCGEN -c $XDR_FILE |
+	sed -e 's/^#include.*db_server.h.*/#include "db_server.h"/' \
+	    -e '1,/^#include/s/^#include/#include "db_config.h"\
+&/' > db_server_xdr.c
+
+	RPC_SERVER_H=db_server.h
+	RPC_CLIENT_OBJS="\$(RPC_CLIENT_OBJS)"
+	ADDITIONAL_PROGS="berkeley_db_svc $ADDITIONAL_PROGS"
+
+	# Solaris and HPUX need the nsl library to build RPC.
+	{ echo "$as_me:$LINENO: checking for svc_run" >&5
+echo $ECHO_N "checking for svc_run... $ECHO_C" >&6; }
 if test "${ac_cv_func_svc_run+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -34009,53 +37656,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef svc_run
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char svc_run ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_svc_run) || defined (__stub___svc_run)
+#if defined __stub_svc_run || defined __stub___svc_run
 choke me
-#else
-char (*f) () = svc_run;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != svc_run;
+return svc_run ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -34064,20 +37717,20 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_svc_run=no
+	ac_cv_func_svc_run=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_svc_run" >&5
-echo "${ECHO_T}$ac_cv_func_svc_run" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_svc_run" >&5
+echo "${ECHO_T}$ac_cv_func_svc_run" >&6; }
 if test $ac_cv_func_svc_run = yes; then
   :
 else
-
-echo "$as_me:$LINENO: checking for svc_run in -lnsl" >&5
-echo $ECHO_N "checking for svc_run in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_svc_run+set}" = set; then
+  { echo "$as_me:$LINENO: checking for main in -lnsl" >&5
+echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_nsl_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -34089,68 +37742,70 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char svc_run ();
+
 int
 main ()
 {
-svc_run ();
+return main ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_nsl_svc_run=yes
+  ac_cv_lib_nsl_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_nsl_svc_run=no
+	ac_cv_lib_nsl_main=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_svc_run" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_svc_run" >&6
-if test $ac_cv_lib_nsl_svc_run = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
-  LIBS="-lnsl $LIBS"
-
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6; }
+if test $ac_cv_lib_nsl_main = yes; then
+  LIBSO_LIBS="$LIBSO_LIBS -lnsl"
 fi
+ac_cv_lib_nsl=ac_cv_lib_nsl_main
 
 fi
-;;
-	esac
+
 
 fi
 
@@ -34164,8 +37819,6 @@ echo "$as_me: error: Tcl requires shared libraries" >&2;}
 	fi
 
 
-
-
 	if test "${ac_cv_c_tclconfig+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -34206,16 +37859,16 @@ echo "$as_me: error: can't find Tcl configuration definitions" >&2;}
 	fi
 
 
-	echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
-echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
+echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6; }
 
 	if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
-		echo "$as_me:$LINENO: result: loading" >&5
-echo "${ECHO_T}loading" >&6
+		{ echo "$as_me:$LINENO: result: loading" >&5
+echo "${ECHO_T}loading" >&6; }
 		. $TCL_BIN_DIR/tclConfig.sh
 	else
-		echo "$as_me:$LINENO: result: file not found" >&5
-echo "${ECHO_T}file not found" >&6
+		{ echo "$as_me:$LINENO: result: file not found" >&5
+echo "${ECHO_T}file not found" >&6; }
 	fi
 
 	# DB requires at least version 8.4.
@@ -34226,12 +37879,11 @@ echo "$as_me: error: Berkeley DB requires Tcl version 8.4 or better." >&2;}
    { (exit 1); exit 1; }; }
 	fi
 
-	#
-	# The eval is required to do the TCL_DBGX substitution in the
-	# TCL_LIB_FILE variable
-	#
-	eval TCL_LIB_FILE="${TCL_LIB_FILE}"
-	eval TCL_LIB_FLAG="${TCL_LIB_FLAG}"
+	# The eval is required to do substitution (for example, the TCL_DBGX
+	# substitution in the TCL_LIB_FILE variable.
+	eval "TCL_INCLUDE_SPEC=\"${TCL_INCLUDE_SPEC}\""
+	eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+	eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
 	eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
 
 	#
@@ -34252,12 +37904,9 @@ echo "$as_me: error: Berkeley DB requires Tcl version 8.4 or better." >&2;}
 
 
 
-	TCL_TCLSH="${TCL_PREFIX}/bin/tclsh${TCL_VERSION}"
 
+	TCL_TCLSH="${TCL_PREFIX}/bin/tclsh${TCL_VERSION}"
 
-	if test x"$TCL_PREFIX" != x && test -f "$TCL_PREFIX/include/tcl.h"; then
-		TCFLAGS="-I$TCL_PREFIX/include"
-	fi
 
 	INSTALL_LIBS="${INSTALL_LIBS} \$(libtso_target)"
 
@@ -34265,8 +37914,9 @@ fi
 
 # Optional sequence code.
 
-	echo "$as_me:$LINENO: checking for 64-bit integral type support for sequences" >&5
-echo $ECHO_N "checking for 64-bit integral type support for sequences... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking for 64-bit integral type support for sequences" >&5
+echo $ECHO_N "checking for 64-bit integral type support for sequences... $ECHO_C" >&6; }
+
 	db_cv_build_sequence="yes"
 
 	# Have to have found 64-bit types to support sequences.  If we don't
@@ -34278,13 +37928,27 @@ echo $ECHO_N "checking for 64-bit integral type support for sequences... $ECHO_C
 		db_cv_build_sequence="no"
 	fi
 
-	# Have to be able to cast variables to the "unsigned long long" and
-	# "long long" types, that's our cast for the printf "%ll[du]" format.
-	if test "$ac_cv_type_long_long" = "no"; then
+	# Figure out what type is the right size, and set the format.
+
+
+	db_cv_seq_type="no"
+	if test "$db_cv_build_sequence" = "yes" -a\
+	    "$ac_cv_sizeof_long" -eq "8"; then
+		db_cv_seq_type="long"
+		db_cv_seq_fmt='"%ld"'
+		db_cv_seq_ufmt='"%lu"'
+		INT64_FMT='#define	INT64_FMT	"%ld"'
+		UINT64_FMT='#define	UINT64_FMT	"%lu"'
+	else if test "$db_cv_build_sequence" = "yes" -a\
+	    "$ac_cv_sizeof_long_long" -eq "8"; then
+		db_cv_seq_type="long long"
+		db_cv_seq_fmt='"%lld"'
+		db_cv_seq_ufmt='"%llu"'
+		INT64_FMT='#define	INT64_FMT	"%lld"'
+		UINT64_FMT='#define	UINT64_FMT	"%llu"'
+	else
 		db_cv_build_sequence="no"
 	fi
-	if test "$ac_cv_type_unsigned_long_long" = "no"; then
-		db_cv_build_sequence="no"
 	fi
 
 	# Test to see if we can declare variables of the appropriate size
@@ -34303,17 +37967,17 @@ int
 main ()
 {
 
-			long long l;
-			unsigned long long u;
-			char buf100;
+			$db_cv_seq_type l;
+			unsigned $db_cv_seq_type u;
+			char buf[100];
 
-			buf0 = 'a';
+			buf[0] = 'a';
 			l = 9223372036854775807LL;
-			(void)snprintf(buf, sizeof(buf), "%lld", l);
+			(void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
 			if (strcmp(buf, "9223372036854775807"))
 				return (1);
 			u = 18446744073709551615ULL;
-			(void)snprintf(buf, sizeof(buf), "%llu", u);
+			(void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
 			if (strcmp(buf, "18446744073709551615"))
 				return (1);
 			return (0);
@@ -34323,24 +37987,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -34349,9 +38025,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-db_cv_build_sequence="no"
+	db_cv_build_sequence="no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -34362,30 +38039,39 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 		main() {
-			long long l;
-			unsigned long long u;
+			$db_cv_seq_type l;
+			unsigned $db_cv_seq_type u;
 			char buf[100];
 
 			buf[0] = 'a';
 			l = 9223372036854775807LL;
-			(void)snprintf(buf, sizeof(buf), "%lld", l);
+			(void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
 			if (strcmp(buf, "9223372036854775807"))
 				return (1);
 			u = 18446744073709551615ULL;
-			(void)snprintf(buf, sizeof(buf), "%llu", u);
+			(void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
 			if (strcmp(buf, "18446744073709551615"))
 				return (1);
 			return (0);
 		}
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -34398,25 +38084,27 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 db_cv_build_sequence="no"
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 	fi
 	if test "$db_cv_build_sequence" = "yes"; then
-		cat >>confdefs.h <<\_ACEOF
-#define HAVE_SEQUENCE 1
-_ACEOF
 
+		db_seq_decl="typedef int64_t db_seq_t;";
 
+		cat >>confdefs.h <<\_ACEOF
+#define HAVE_64BIT_TYPES 1
+_ACEOF
 
 
 
-		db_seq_decl="typedef int64_t db_seq_t;";
 	else
 		# It still has to compile, but it won't run.
 		db_seq_decl="typedef int db_seq_t;";
 	fi
-	echo "$as_me:$LINENO: result: $db_cv_build_sequence" >&5
-echo "${ECHO_T}$db_cv_build_sequence" >&6
+	{ echo "$as_me:$LINENO: result: $db_cv_build_sequence" >&5
+echo "${ECHO_T}$db_cv_build_sequence" >&6; }
 
 
 # Optional DB 1.85 compatibility API.
@@ -34478,6 +38166,10 @@ _ACEOF
 
 
 	ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(REP_OBJS)"
+
+	if test "$db_cv_build_replication_mgr" = "yes"; then
+		ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(REPMGR_OBJS)"
+	fi
 else
 	ADDITIONAL_OBJS="$ADDITIONAL_OBJS rep_stub${o}"
 fi
@@ -34519,6 +38211,12 @@ else
 	CRYPTO_OBJS="crypto_stub${o}"
 fi
 
+# If DIAGNOSTIC is defined, include the log print routines in the library
+# itself, various diagnostic modes use them.
+if test "$db_cv_diagnostic" = "yes"; then
+	ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(PRINT_OBJS)"
+fi
+
 # We need to add the additional object files into the Makefile with the correct
 # suffix.  We can't use $LTLIBOBJS itself, because that variable has $U encoded
 # in it for automake, and that's not what we want.  See SR #7227 for additional
@@ -34540,6 +38238,7 @@ LTLIBOBJS=`echo "$LIBOBJS" |
 CREATE_LIST="Makefile
     db_cxx.h:$srcdir/../dbinc/db_cxx.in
     db_int.h:$srcdir/../dbinc/db_int.in
+    clib_port.h:$srcdir/../dist/clib_port.h
     include.tcl:$srcdir/../test/include.tcl"
 
 # MinGW needs win_db.h.
@@ -34583,7 +38282,7 @@ if test "$db_cv_compat185" = "yes"; then
 	fi
 fi
 
-          ac_config_files="$ac_config_files $CREATE_LIST"
+ac_config_files="$ac_config_files $CREATE_LIST"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -34603,39 +38302,58 @@ _ACEOF
 
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
   (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
+      ;; #(
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-} |
+    esac |
+    sort
+) |
   sed '
+     /^ac_cv_env_/b end
      t clear
-     : clear
+     :clear
      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
      t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    echo "not updating unwritable cache $cache_file"
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -34644,32 +38362,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[	 ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[	 ]*$//;
-}'
-fi
-
 DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -34707,11 +38411,35 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
@@ -34720,8 +38448,43 @@ else
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -34735,18 +38498,19 @@ do
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -34754,159 +38518,120 @@ fi
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
 
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -34915,7 +38640,19 @@ else
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+# Find out whether ``test -x'' works.  Don't use a zero-byte file, as
+# systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  as_executable_p="test -x"
+else
+  as_executable_p=:
+fi
+rm -f conf$$.file
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -34924,31 +38661,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 exec 6>&1
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# Save the log message, to keep $[0] and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by Berkeley DB $as_me 4.3.27, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+# values after options handling.
+ac_log="
+This file was extended by Berkeley DB $as_me 4.5.20, which was
+generated by GNU Autoconf 2.60.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -34956,30 +38676,19 @@ generated by GNU Autoconf 2.59.  Invocation command line was
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
 _ACEOF
 
+cat >>$CONFIG_STATUS <<_ACEOF
 # Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
 
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+_ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
-
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
@@ -35003,19 +38712,21 @@ Configuration headers:
 $config_headers
 
 Report bugs to ."
-_ACEOF
 
+_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-Berkeley DB config.status 4.3.27
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+Berkeley DB config.status 4.5.20
+configured by $0, generated by GNU Autoconf 2.60,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2006 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -35026,39 +38737,24 @@ while test $# != 0
 do
   case $1 in
   --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  -*)
+  *)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
   esac
 
   case $ac_option in
   # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
@@ -35068,18 +38764,24 @@ Try \`$0 --help' for more information." >&2;}
     $ac_shift
     CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
     ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; } ;;
 
-  *) ac_config_targets="$ac_config_targets $1" ;;
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
 
   esac
   shift
@@ -35095,29 +38797,43 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
 fi
 
 _ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
 
-
-
-
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+_ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "$CREATE_LIST" ) CONFIG_FILES="$CONFIG_FILES $CREATE_LIST" ;;
-  "db_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS db_config.h:config.hin" ;;
+  case $ac_config_target in
+    "db_config.h") CONFIG_HEADERS="$CONFIG_HEADERS db_config.h:config.hin" ;;
+    "$CREATE_LIST") CONFIG_FILES="$CONFIG_FILES $CREATE_LIST" ;;
+
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 done
 
+
 # If the user did not use the arguments to specify the items to instantiate,
 # then the envvar interface is used.  Set only those that are not.
 # We use the long form for the default assignment because of an extremely
@@ -35128,425 +38844,522 @@ if $ac_need_defaults; then
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
   trap '{ (exit 1); exit 1; }' 1 2 13 15
 }
-
 # Create a (secure) tmp directory for tmp files.
 
 {
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||
 {
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
 } ||
 {
    echo "$me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
 #
-# CONFIG_FILES section.
+# Set up the sed scripts for CONFIG_FILES section.
 #
 
 # No need to generate the scripts if there are no CONFIG_FILES.
 # This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@ADDITIONAL_INCS@,$ADDITIONAL_INCS,;t t
-s,@ADDITIONAL_LANG@,$ADDITIONAL_LANG,;t t
-s,@ADDITIONAL_OBJS@,$ADDITIONAL_OBJS,;t t
-s,@ADDITIONAL_PROGS@,$ADDITIONAL_PROGS,;t t
-s,@BUILD_TARGET@,$BUILD_TARGET,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@CONFIGURATION_ARGS@,$CONFIGURATION_ARGS,;t t
-s,@CONFIGURATION_PATH@,$CONFIGURATION_PATH,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@CRYPTO_OBJS@,$CRYPTO_OBJS,;t t
-s,@CXX@,$CXX,;t t
-s,@CXXFLAGS@,$CXXFLAGS,;t t
-s,@DB_PROTO1@,$DB_PROTO1,;t t
-s,@DB_PROTO2@,$DB_PROTO2,;t t
-s,@DEFAULT_LIB@,$DEFAULT_LIB,;t t
-s,@DEFAULT_LIB_CXX@,$DEFAULT_LIB_CXX,;t t
-s,@INSTALLER@,$INSTALLER,;t t
-s,@INSTALL_LIBS@,$INSTALL_LIBS,;t t
-s,@INSTALL_TARGET@,$INSTALL_TARGET,;t t
-s,@JAR@,$JAR,;t t
-s,@JAVACFLAGS@,$JAVACFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@LIBJSO_LIBS@,$LIBJSO_LIBS,;t t
-s,@LIBSO_LIBS@,$LIBSO_LIBS,;t t
-s,@LIBTOOL@,$LIBTOOL,;t t
-s,@LIBTSO_LIBS@,$LIBTSO_LIBS,;t t
-s,@LIBTSO_MODSUFFIX@,$LIBTSO_MODSUFFIX,;t t
-s,@LIBTSO_MODULE@,$LIBTSO_MODULE,;t t
-s,@LIBXSO_LIBS@,$LIBXSO_LIBS,;t t
-s,@MAKEFILE_CC@,$MAKEFILE_CC,;t t
-s,@MAKEFILE_CCLINK@,$MAKEFILE_CCLINK,;t t
-s,@MAKEFILE_CXX@,$MAKEFILE_CXX,;t t
-s,@MAKEFILE_CXXLINK@,$MAKEFILE_CXXLINK,;t t
-s,@MAKEFILE_SOLINK@,$MAKEFILE_SOLINK,;t t
-s,@MAKEFILE_XSOLINK@,$MAKEFILE_XSOLINK,;t t
-s,@OSDIR@,$OSDIR,;t t
-s,@POSTLINK@,$POSTLINK,;t t
-s,@REPLACEMENT_OBJS@,$REPLACEMENT_OBJS,;t t
-s,@RPC_CLIENT_OBJS@,$RPC_CLIENT_OBJS,;t t
-s,@RPC_SERVER_H@,$RPC_SERVER_H,;t t
-s,@SOFLAGS@,$SOFLAGS,;t t
-s,@TEST_LIBS@,$TEST_LIBS,;t t
-s,@db_int_def@,$db_int_def,;t t
-s,@o@,$o,;t t
-s,@DB_VERSION_MAJOR@,$DB_VERSION_MAJOR,;t t
-s,@DB_VERSION_MINOR@,$DB_VERSION_MINOR,;t t
-s,@DB_VERSION_PATCH@,$DB_VERSION_PATCH,;t t
-s,@DB_VERSION_STRING@,$DB_VERSION_STRING,;t t
-s,@DB_VERSION_UNIQUE_NAME@,$DB_VERSION_UNIQUE_NAME,;t t
-s,@db_cv_path_ar@,$db_cv_path_ar,;t t
-s,@ac_ct_db_cv_path_ar@,$ac_ct_db_cv_path_ar,;t t
-s,@db_cv_path_chmod@,$db_cv_path_chmod,;t t
-s,@ac_ct_db_cv_path_chmod@,$ac_ct_db_cv_path_chmod,;t t
-s,@db_cv_path_cp@,$db_cv_path_cp,;t t
-s,@ac_ct_db_cv_path_cp@,$ac_ct_db_cv_path_cp,;t t
-s,@db_cv_path_ln@,$db_cv_path_ln,;t t
-s,@ac_ct_db_cv_path_ln@,$ac_ct_db_cv_path_ln,;t t
-s,@db_cv_path_mkdir@,$db_cv_path_mkdir,;t t
-s,@ac_ct_db_cv_path_mkdir@,$ac_ct_db_cv_path_mkdir,;t t
-s,@path_ranlib@,$path_ranlib,;t t
-s,@ac_ct_path_ranlib@,$ac_ct_path_ranlib,;t t
-s,@db_cv_path_ranlib@,$db_cv_path_ranlib,;t t
-s,@db_cv_path_rm@,$db_cv_path_rm,;t t
-s,@ac_ct_db_cv_path_rm@,$ac_ct_db_cv_path_rm,;t t
-s,@db_cv_path_rpcgen@,$db_cv_path_rpcgen,;t t
-s,@ac_ct_db_cv_path_rpcgen@,$ac_ct_db_cv_path_rpcgen,;t t
-s,@path_sh@,$path_sh,;t t
-s,@ac_ct_path_sh@,$ac_ct_path_sh,;t t
-s,@db_cv_path_sh@,$db_cv_path_sh,;t t
-s,@path_strip@,$path_strip,;t t
-s,@ac_ct_path_strip@,$ac_ct_path_strip,;t t
-s,@db_cv_path_strip@,$db_cv_path_strip,;t t
-s,@db_cv_path_kill@,$db_cv_path_kill,;t t
-s,@ac_ct_db_cv_path_kill@,$ac_ct_db_cv_path_kill,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@db_cv_build_type@,$db_cv_build_type,;t t
-s,@CC@,$CC,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@DB_CONST@,$DB_CONST,;t t
-s,@CCC@,$CCC,;t t
-s,@ac_ct_CCC@,$ac_ct_CCC,;t t
-s,@ac_ct_CXX@,$ac_ct_CXX,;t t
-s,@CXXCPP@,$CXXCPP,;t t
-s,@cxx_have_stdheaders@,$cxx_have_stdheaders,;t t
-s,@EGREP@,$EGREP,;t t
-s,@LN_S@,$LN_S,;t t
-s,@ECHO@,$ECHO,;t t
-s,@AR@,$AR,;t t
-s,@ac_ct_AR@,$ac_ct_AR,;t t
-s,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@CPP@,$CPP,;t t
-s,@F77@,$F77,;t t
-s,@FFLAGS@,$FFLAGS,;t t
-s,@ac_ct_F77@,$ac_ct_F77,;t t
-s,@SOSUFFIX@,$SOSUFFIX,;t t
-s,@MODSUFFIX@,$MODSUFFIX,;t t
-s,@JMODSUFFIX@,$JMODSUFFIX,;t t
-s,@JAVAC@,$JAVAC,;t t
-s,@JAVA@,$JAVA,;t t
-s,@uudecode@,$uudecode,;t t
-s,@_ACJNI_JAVAC@,$_ACJNI_JAVAC,;t t
-s,@inttypes_h_decl@,$inttypes_h_decl,;t t
-s,@stdint_h_decl@,$stdint_h_decl,;t t
-s,@stddef_h_decl@,$stddef_h_decl,;t t
-s,@u_char_decl@,$u_char_decl,;t t
-s,@u_short_decl@,$u_short_decl,;t t
-s,@u_int_decl@,$u_int_decl,;t t
-s,@u_long_decl@,$u_long_decl,;t t
-s,@u_int8_decl@,$u_int8_decl,;t t
-s,@u_int16_decl@,$u_int16_decl,;t t
-s,@int16_decl@,$int16_decl,;t t
-s,@u_int32_decl@,$u_int32_decl,;t t
-s,@int32_decl@,$int32_decl,;t t
-s,@u_int64_decl@,$u_int64_decl,;t t
-s,@int64_decl@,$int64_decl,;t t
-s,@ssize_t_decl@,$ssize_t_decl,;t t
-s,@uintmax_t_decl@,$uintmax_t_decl,;t t
-s,@uintptr_t_decl@,$uintptr_t_decl,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@TCFLAGS@,$TCFLAGS,;t t
-s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t
-s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t
-s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t
-s,@TCL_TCLSH@,$TCL_TCLSH,;t t
-s,@db_seq_decl@,$db_seq_decl,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+ADDITIONAL_INCS!$ADDITIONAL_INCS$ac_delim
+ADDITIONAL_LANG!$ADDITIONAL_LANG$ac_delim
+ADDITIONAL_OBJS!$ADDITIONAL_OBJS$ac_delim
+ADDITIONAL_PROGS!$ADDITIONAL_PROGS$ac_delim
+BUILD_TARGET!$BUILD_TARGET$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+CONFIGURATION_ARGS!$CONFIGURATION_ARGS$ac_delim
+CONFIGURATION_PATH!$CONFIGURATION_PATH$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+CRYPTO_OBJS!$CRYPTO_OBJS$ac_delim
+CXX!$CXX$ac_delim
+CXXFLAGS!$CXXFLAGS$ac_delim
+DB_PROTO1!$DB_PROTO1$ac_delim
+DB_PROTO2!$DB_PROTO2$ac_delim
+DEFAULT_LIB!$DEFAULT_LIB$ac_delim
+DEFAULT_LIB_CXX!$DEFAULT_LIB_CXX$ac_delim
+INSTALLER!$INSTALLER$ac_delim
+INSTALL_LIBS!$INSTALL_LIBS$ac_delim
+INSTALL_TARGET!$INSTALL_TARGET$ac_delim
+JAR!$JAR$ac_delim
+JAVACFLAGS!$JAVACFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+LIBCSO_LIBS!$LIBCSO_LIBS$ac_delim
+LIBJSO_LIBS!$LIBJSO_LIBS$ac_delim
+LIBSO_LIBS!$LIBSO_LIBS$ac_delim
+LIBTOOL!$LIBTOOL$ac_delim
+LIBTSO_LIBS!$LIBTSO_LIBS$ac_delim
+LIBTSO_MODSUFFIX!$LIBTSO_MODSUFFIX$ac_delim
+LIBTSO_MODULE!$LIBTSO_MODULE$ac_delim
+LIBXSO_LIBS!$LIBXSO_LIBS$ac_delim
+MAKEFILE_CC!$MAKEFILE_CC$ac_delim
+MAKEFILE_CCLINK!$MAKEFILE_CCLINK$ac_delim
+MAKEFILE_CXX!$MAKEFILE_CXX$ac_delim
+MAKEFILE_CXXLINK!$MAKEFILE_CXXLINK$ac_delim
+MAKEFILE_SOLINK!$MAKEFILE_SOLINK$ac_delim
+MAKEFILE_XSOLINK!$MAKEFILE_XSOLINK$ac_delim
+OSDIR!$OSDIR$ac_delim
+POSTLINK!$POSTLINK$ac_delim
+REPLACEMENT_OBJS!$REPLACEMENT_OBJS$ac_delim
+RPC_CLIENT_OBJS!$RPC_CLIENT_OBJS$ac_delim
+RPC_SERVER_H!$RPC_SERVER_H$ac_delim
+SOFLAGS!$SOFLAGS$ac_delim
+SWIGCFLAGS!$SWIGCFLAGS$ac_delim
+TEST_LIBS!$TEST_LIBS$ac_delim
+db_int_def!$db_int_def$ac_delim
+o!$o$ac_delim
+platform_header!$platform_header$ac_delim
+platform_footer!$platform_footer$ac_delim
+DB_VERSION_MAJOR!$DB_VERSION_MAJOR$ac_delim
+DB_VERSION_MINOR!$DB_VERSION_MINOR$ac_delim
+DB_VERSION_PATCH!$DB_VERSION_PATCH$ac_delim
+DB_VERSION_STRING!$DB_VERSION_STRING$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
-fi # test -n "$CONFIG_FILES"
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+DB_VERSION_UNIQUE_NAME!$DB_VERSION_UNIQUE_NAME$ac_delim
+AR!$AR$ac_delim
+CHMOD!$CHMOD$ac_delim
+CP!$CP$ac_delim
+KILL!$KILL$ac_delim
+LN!$LN$ac_delim
+MKDIR!$MKDIR$ac_delim
+RANLIB!$RANLIB$ac_delim
+RM!$RM$ac_delim
+RPCGEN!$RPCGEN$ac_delim
+db_cv_path_sh!$db_cv_path_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CC!$CC$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DB_CONST!$DB_CONST$ac_delim
+CCC!$CCC$ac_delim
+ac_ct_CXX!$ac_ct_CXX$ac_delim
+CXXCPP!$CXXCPP$ac_delim
+cxx_have_stdheaders!$cxx_have_stdheaders$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+LN_S!$LN_S$ac_delim
+ECHO!$ECHO$ac_delim
+CPP!$CPP$ac_delim
+F77!$F77$ac_delim
+FFLAGS!$FFLAGS$ac_delim
+ac_ct_F77!$ac_ct_F77$ac_delim
+SOSUFFIX!$SOSUFFIX$ac_delim
+MODSUFFIX!$MODSUFFIX$ac_delim
+JMODSUFFIX!$JMODSUFFIX$ac_delim
+JAVAC!$JAVAC$ac_delim
+JAVA!$JAVA$ac_delim
+uudecode!$uudecode$ac_delim
+_ACJNI_JAVAC!$_ACJNI_JAVAC$ac_delim
+inttypes_h_decl!$inttypes_h_decl$ac_delim
+stdint_h_decl!$stdint_h_decl$ac_delim
+stddef_h_decl!$stddef_h_decl$ac_delim
+unistd_h_decl!$unistd_h_decl$ac_delim
+u_char_decl!$u_char_decl$ac_delim
+u_short_decl!$u_short_decl$ac_delim
+u_int_decl!$u_int_decl$ac_delim
+u_long_decl!$u_long_decl$ac_delim
+u_int8_decl!$u_int8_decl$ac_delim
+u_int16_decl!$u_int16_decl$ac_delim
+int16_decl!$int16_decl$ac_delim
+u_int32_decl!$u_int32_decl$ac_delim
+int32_decl!$int32_decl$ac_delim
+u_int64_decl!$u_int64_decl$ac_delim
+int64_decl!$int64_decl$ac_delim
+ssize_t_decl!$ssize_t_decl$ac_delim
+pid_t_decl!$pid_t_decl$ac_delim
+uintmax_t_decl!$uintmax_t_decl$ac_delim
+uintptr_t_decl!$uintptr_t_decl$ac_delim
+thread_h_decl!$thread_h_decl$ac_delim
+db_threadid_t_decl!$db_threadid_t_decl$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim
+TCL_INCLUDE_SPEC!$TCL_INCLUDE_SPEC$ac_delim
+TCL_LIB_FILE!$TCL_LIB_FILE$ac_delim
+TCL_SRC_DIR!$TCL_SRC_DIR$ac_delim
+TCL_TCLSH!$TCL_TCLSH$ac_delim
+INT64_FMT!$INT64_FMT$ac_delim
+UINT64_FMT!$UINT64_FMT$ac_delim
+db_seq_decl!$db_seq_decl$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 70; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
 
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
 _ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
 cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
   esac
 
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+  ac_dir=`$as_dirname -- "$ac_file" ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
     as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
     done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-
   ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
 
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
   case $INSTALL in
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
   esac
+_ACEOF
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-				     sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
 _ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
 $extrasub
@@ -35554,252 +39367,137 @@ _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
-ac_dB='[	 ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
   case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
   esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
 
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 # Do quote $f, to prevent DOS paths from being IFS'd.
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments.  This is necessary, for
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
+ac_dB='\\)[	 (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+	t rset
+	:rset
+	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
+	t ok
+	d
+	:ok
+	s/[\\&,]/\\&/g
+	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[	 #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
 do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
+/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
   echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
   rm -f conftest.defines
   mv conftest.tail conftest.defines
 done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
+rm -f conftest.defines conftest.tail
 
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
 cat >>$CONFIG_STATUS <<\_ACEOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
   if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
       { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
       rm -f $ac_file
-      mv $tmp/config.h $ac_file
+      mv "$tmp/config.h" $ac_file
     fi
   else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
+    echo "/* $configure_input  */"
+    cat "$ac_result"
   fi
-done
-_ACEOF
+  rm -f "$tmp/out12"
+ ;;
+
+
+  esac
+
+done # for ac_tag
 
-cat >>$CONFIG_STATUS <<\_ACEOF
 
 { (exit 0); exit 0; }
 _ACEOF
diff --git a/db/dist/configure.ac b/db/dist/configure.ac
index 8106d51d0..592fb5511 100644
--- a/db/dist/configure.ac
+++ b/db/dist/configure.ac
@@ -1,9 +1,10 @@
-# $Id: configure.ac,v 11.221 2004/11/16 01:07:57 mjc Exp $
+# $Id: configure.ac,v 12.46 2006/09/19 00:33:58 bostic Exp $
 # Process this file with autoconf to produce a configure script.
 
 PACKAGE=db
-AC_INIT(Berkeley DB,
-	__EDIT_DB_VERSION__, support@sleepycat.com, db-__EDIT_DB_VERSION__)
+AC_INIT(Berkeley DB, __EDIT_DB_VERSION__,
+	[Oracle Technology Network Berkeley DB forum],
+	db-__EDIT_DB_VERSION__)
 AC_CONFIG_SRCDIR([../db/db.c])
 AC_CONFIG_HEADERS([db_config.h:config.hin])
 
@@ -15,8 +16,11 @@ AC_ARG_PROGRAM()
 AC_MSG_CHECKING(if building in the top-level or dist directories)
 if [ test -d db_archive -o -f configure.ac ] ; then
 	AC_MSG_RESULT(yes)
-	AC_MSG_ERROR(
-    [Berkeley DB should not be built in the top-level or dist directories.])
+	AC_MSG_ERROR([\
+Berkeley DB should not be built in the top-level or "dist" directories. \
+Change directory to the build_unix directory and run ../dist/configure \
+from there.])
+
 fi
 AC_MSG_RESULT(no)
 
@@ -43,6 +47,7 @@ AC_SUBST(INSTALL_TARGET)
 AC_SUBST(JAR)
 AC_SUBST(JAVACFLAGS)
 AC_SUBST(LDFLAGS)
+AC_SUBST(LIBCSO_LIBS)
 AC_SUBST(LIBJSO_LIBS)
 AC_SUBST(LIBS)
 AC_SUBST(LIBSO_LIBS)
@@ -64,10 +69,15 @@ AC_SUBST(REPLACEMENT_OBJS)
 AC_SUBST(RPC_CLIENT_OBJS)
 AC_SUBST(RPC_SERVER_H)
 AC_SUBST(SOFLAGS)
+AC_SUBST(SWIGCFLAGS)
 AC_SUBST(TEST_LIBS)
 AC_SUBST(db_int_def)
 AC_SUBST(o)
 
+# The Windows public header has two extra symbols we need to remove.
+AC_SUBST(platform_header)
+AC_SUBST(platform_footer)
+
 # Set the default installation location.
 AC_PREFIX_DEFAULT(/usr/local/BerkeleyDB.__EDIT_DB_VERSION_MAJOR__.__EDIT_DB_VERSION_MINOR__)
 
@@ -134,15 +144,15 @@ INSTALL_TARGET="library_install"
 # because the makefile CC may be set to use $(LIBTOOL).
 #
 # Don't override anything if it's already set from the environment.
-optimize_def="-O"
+optimize_debug="-O"
 case "$host_os" in
 aix4.3.*|aix5*)
-	optimize_def="-O2"
+	optimize_debug="-O2"
 	CC=${CC-"xlc_r"}
 	CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
 	LDFLAGS="$LDFLAGS -Wl,-brtl";;
 bsdi3*)	CC=${CC-"shlicc2"}
-	LIBS="$LIBS -lipc";;
+	LIBSO_LIBS="$LIBSO_LIBS -lipc";;
 cygwin*)
 	CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
 freebsd*)
@@ -151,50 +161,53 @@ freebsd*)
 gnu*|k*bsd*-gnu|linux*)
 	CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
 hpux*)	CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
-irix*)	optimize_def="-O2"
+irix*)	optimize_debug="-O2"
 	CPPFLAGS="$CPPFLAGS -D_SGI_MP_SOURCE";;
 mpeix*)	CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_SOCKET_SOURCE"
-	LIBS="$LIBS -lsocket -lsvipc";;
+	LIBSO_LIBS="$LIBSO_LIBS -lsocket -lsvipc";;
 osf*)	CPPFLAGS="$CPPFLAGS -pthread";;
 *qnx*)	AC_DEFINE(HAVE_QNX)
 	AH_TEMPLATE(HAVE_QNX, [Define to 1 if building on QNX.]);;
 solaris*)
-	CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
+	CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS ";;
 esac
 
-# Set CFLAGS/CXXFLAGS.  We MUST set the flags before we call autoconf
-# compiler configuration macros, because if we don't, they set CFLAGS
-# to no optimization and -g, which isn't what we want.
-CFLAGS=${CFLAGS-$optimize_def}
-CXXFLAGS=${CXXFLAGS-"$CFLAGS"}
-
-# If the user wants a debugging environment, add -g to the CFLAGS value.
-#
-# XXX
-# Some compilers can't mix optimizing and debug flags.  The only way to
-# handle this is to specify CFLAGS in the environment before configuring.
+# If the user wants a debugging environment, change any compiler optimization
+# flags to -g.  We used to add -g to the -O compiler flags, but compilers are
+# good enough at code re-organization that debugging with -O no longer works.
+# If you want to compile with a different set of flags, specify CFLAGS in the
+# environment before configuring.
 if test "$db_cv_debug" = "yes"; then
 	AC_DEFINE(DEBUG)
 	AH_TEMPLATE(DEBUG, [Define to 1 if you want a debugging version.])
 
-	CFLAGS="$CFLAGS -g"
-	CXXFLAGS="$CXXFLAGS -g"
-	db_cv_build_type=debug
-else
-	db_cv_build_type=release
+	optimize_debug="-g"
 fi
-AC_SUBST(db_cv_build_type)
+
+# Set CFLAGS/CXXFLAGS.  We MUST set the flags before we call autoconf
+# compiler configuration macros, because if we don't, they set CFLAGS
+# to no optimization and -g, which isn't what we want.
+CFLAGS=${CFLAGS-$optimize_debug}
+CXXFLAGS=${CXXFLAGS-"$CFLAGS"}
 
 # The default compiler is cc (NOT gcc), the default CFLAGS is as specified
 # above, NOT what is set by AC_PROG_CC, as it won't set optimization flags
 # for any compiler other than gcc.
 AC_PROG_CC(cc gcc)
 
-# Set specific per-compiler flags.
+# We know what compiler we're going to use, now.  Set per-compiler flags.
 if test "$GCC" = "yes"; then
-	# We want -O2 if we're using gcc.
+	# Use -O3 if we're using gcc, unless we're doing a small build, in
+	# which case we use -Os alone.  The code size for -O3 is quite a
+	# bit larger than -O2: a compromise is "-Os -finline-functions",
+	# it's smaller and explicitly inlining the functions helps Berkeley
+	# DB.
 	CFLAGS="$CFLAGS "
-	CFLAGS=`echo "$CFLAGS" | sed 's/-O /-O2 /g'`
+	if test "$db_cv_smallbuild" = "yes"; then
+		CFLAGS=`echo "$CFLAGS" | sed 's/-O /-Os /g'`
+	else
+		CFLAGS=`echo "$CFLAGS" | sed 's/-O /-O3 /g'`
+	fi
 else
 	case "$host_os" in
 	hpux11.0*)	;;
@@ -239,7 +252,7 @@ if test "$db_cv_cxx" = "yes"; then
 		case "$host_os" in
 		aix*)		AC_CHECK_TOOL(CCC, xlC_r)
 				LIBXSO_LIBS="-lC_r $LIBXSO_LIBS"
-				LIBS="-lC_r $LIBS";;
+				LIBSO_LIBS="-lC_r $LIBSO_LIBS";;
 		hpux*)		AC_CHECK_TOOL(CCC, aCC);;
 		irix*)		AC_CHECK_TOOL(CCC, CC);;
 		osf*)		AC_CHECK_TOOL(CCC, cxx);;
@@ -330,7 +343,7 @@ case "$host_os" in
     ;;
     *)
         LIBTSO_MODULE="-module"
-        LIBTSO_MODSUFFIX=@MODSUFFIX@
+        LIBTSO_MODSUFFIX=$MODSUFFIX
     ;;
 esac
 
@@ -393,6 +406,14 @@ if test "$db_cv_java" = "yes"; then
 		AC_MSG_ERROR([Java version 1.3 or higher required, got $JAVA_VERSION]) ;;
 	esac
 
+	# Because of the code that SWIG generates to cast between pointers and
+	# integers, we need to add the flag "-fno-strict-aliasing" to the gcc
+	# command line when compiling the JNI code.  This is documented in
+	# [#14953] and at http://www.swig.org/Doc1.3/Java.html
+	if test ${GCC} = "yes"; then
+		SWIGCFLAGS="-fno-strict-aliasing"
+	fi
+
 	for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
 	do
 		CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
@@ -406,7 +427,7 @@ fi
 
 # MinGW support.
 if test "$db_cv_mingw" = "yes"; then
-	OSDIR=os_win32
+	OSDIR=os_windows
 	PATH_SEPARATOR="\\\\/:"
 
 	AC_DEFINE(DB_WIN32)
@@ -433,58 +454,84 @@ if test "$db_cv_exit_defines" = "yes"; then
     [Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines.])
 fi
 
+# Check for mutexes.
+# We do this first because it changes $LIBSO_LIBS.
+AM_DEFINE_MUTEXES
+
 # Test for various functions/libraries -- do tests that change library values
 # first.
 #
-# The Berkeley DB library calls fdatasync, and it's only available in -lrt on
-# Solaris.  See if we can find it either without additional libraries or in
-# -lrt.  If fdatasync is found in -lrt, add -lrt to the Java and Tcl shared
-# library link lines.
+# The yield function on Solaris is almost certainly pthread_yield (LWP threads
+# or POSIX pthreads), or thr_yield (UI threads).  There's an outside chance it
+# is sched_yield() though, only available in -lrt on Solaris.
+#
+# The Berkeley DB library calls fdatasync, only available in -lrt on Solaris.
+# See if we can find either without additional libraries or in -lrt.  If found
+# in -lrt and we haven't yet added -lrt,  add it to the shared library list.
 AC_SEARCH_LIBS(fdatasync, rt, [dnl
     if test "$ac_cv_search_fdatasync" != "none required" ; then
-        LIBJSO_LIBS="$LIBJSO_LIBS -lrt";
-        LIBSO_LIBS="$LIBSO_LIBS -lrt";
-        LIBTSO_LIBS="$LIBTSO_LIBS -lrt";
-    fi])
-
-# The test and example programs use the sched_yield function, taken from -lrt
-# on Solaris.
-AC_SEARCH_LIBS(sched_yield, rt)
-
-# !!!
-# We can't check for pthreads in the same way we did the test for sched_yield
-# because the Solaris C library includes pthread interfaces which are not
-# inter-process safe.  For that reason we always add -lpthread if we find a
-# pthread library.
-#
-# We can't depend on any specific call existing (pthread_create, for example),
-# as it may be #defined in an include file -- OSF/1 (Tru64) has this problem.
-AC_HAVE_LIBRARY(pthread, TEST_LIBS="$TEST_LIBS -lpthread")
+	LIBSO_LIBS="$LIBSO_LIBS -lrt";
+    fi], [dnl
+    AC_SEARCH_LIBS(sched_yield, rt, [dnl
+    if test "$ac_cv_search_sched_yield" != "none required" ; then
+	LIBSO_LIBS="$LIBSO_LIBS -lrt";
+    fi])])
 
 # !!!
 # We could be more exact about whether these libraries are needed, but don't
 # bother -- if they exist, we load them, it's only the test programs anyway.
 AC_HAVE_LIBRARY(m, TEST_LIBS="$TEST_LIBS -lm")
-AC_HAVE_LIBRARY(socket, TEST_LIBS="$TEST_LIBS -lsocket")
 AC_HAVE_LIBRARY(nsl, TEST_LIBS="$TEST_LIBS -lnsl")
+AC_HAVE_LIBRARY(pthread, TEST_LIBS="$TEST_LIBS -lpthread")
+AC_HAVE_LIBRARY(socket, TEST_LIBS="$TEST_LIBS -lsocket")
 
-# Check for mutexes.
-# We do this here because it changes $LIBS.
-AM_DEFINE_MUTEXES
+# Update LIBS so that the rest of our tests are run with the libraries we'll
+# load against.
+LIBS="$LIBSO_LIBS"
 
 # Checks for system functions for which we have replacements.
 #
-# XXX
 # The only portable getcwd call is getcwd(char *, size_t), where the
 # buffer is non-NULL -- Solaris can't handle a NULL buffer, and they
 # deleted getwd().
-AC_REPLACE_FUNCS(getcwd getopt memcmp memcpy memmove raise)
-AC_REPLACE_FUNCS(strcasecmp strdup strerror strtol strtoul)
+AC_REPLACE_FUNCS(\
+	abort atoi atol getcwd getenv getopt isalpha isdigit isprint isspace\
+	memcmp memcpy memmove printf raise rand strcasecmp strcat strchr\
+	strdup strerror strncat strncmp strrchr strsep strtol strtoul)
 
 # Check for system functions we optionally use.
-AC_CHECK_FUNCS(_fstati64 clock_gettime directio fdatasync ftruncate getrusage)
-AC_CHECK_FUNCS(gettimeofday getuid pstat_getdynamic rand sched_yield)
-AC_CHECK_FUNCS(select snprintf srand sysconf vsnprintf yield)
+AC_CHECK_FUNCS(\
+   _fstati64 clock_gettime directio fchmod fcntl fdatasync getaddrinfo\
+   getrusage gettimeofday getuid mprotect pstat_getdynamic pthread_yield\
+   sched_yield select sigaction snprintf stat strftime sysconf vsnprintf\
+   yield)
+
+# Replication can't run correctly if ftruncate isn't available.
+AC_CHECK_FUNCS(ftruncate)
+if test \
+    "$db_cv_build_replication" = "yes" -a "$ac_cv_func_ftruncate" = "no"; then
+	db_cv_build_replication=no
+	AC_MSG_WARN([replication requires ftruncate, replication disabled.])
+fi
+
+# ctime_r --
+#
+# There are two versions of ctime_r, one of which takes a buffer length as a
+# third argument, and one which only takes two arguments.  (There is also a
+# difference in return values, but we handle that in the code itself.)
+AC_CHECK_FUNCS(ctime_r)
+if test "$ac_cv_func_ctime_r" = "yes"; then
+AC_CACHE_CHECK([for 2 or 3 argument version of ctime_r], db_cv_ctime_r_3arg, [
+AC_TRY_LINK([
+#include ], [
+	ctime_r(NULL, NULL, 100);
+],  [db_cv_ctime_r_3arg="3-argument"], [db_cv_ctime_r_3arg="2-argument"])])
+fi
+if test "$db_cv_ctime_r_3arg" = "3-argument"; then
+	AC_DEFINE(HAVE_CTIME_R_3ARG)
+	AH_TEMPLATE(HAVE_CTIME_R_3ARG,
+	    [Define to 1 if ctime_r takes a buffer length as a third argument.])
+fi
 
 # Pread/pwrite.
 # HP-UX has pread/pwrite, but it doesn't work with largefile support.
@@ -640,6 +687,10 @@ if test "$db_cv_build_replication" = "yes"; then
 	AH_TEMPLATE(HAVE_REPLICATION,
 	    [Define to 1 if building replication support.])
 	ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(REP_OBJS)"
+
+	if test "$db_cv_build_replication_mgr" = "yes"; then
+		ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(REPMGR_OBJS)"
+	fi
 else
 	ADDITIONAL_OBJS="$ADDITIONAL_OBJS rep_stub${o}"
 fi
@@ -672,6 +723,12 @@ else
 	CRYPTO_OBJS="crypto_stub${o}"
 fi
 
+# If DIAGNOSTIC is defined, include the log print routines in the library
+# itself, various diagnostic modes use them.
+if test "$db_cv_diagnostic" = "yes"; then
+	ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(PRINT_OBJS)"
+fi
+
 # We need to add the additional object files into the Makefile with the correct
 # suffix.  We can't use $LTLIBOBJS itself, because that variable has $U encoded
 # in it for automake, and that's not what we want.  See SR #7227 for additional
@@ -693,6 +750,7 @@ AC_SUBST(LTLIBOBJS)
 CREATE_LIST="Makefile
     db_cxx.h:$srcdir/../dbinc/db_cxx.in
     db_int.h:$srcdir/../dbinc/db_int.in
+    clib_port.h:$srcdir/../dist/clib_port.h
     include.tcl:$srcdir/../test/include.tcl"
 
 # MinGW needs win_db.h.
diff --git a/db/dist/errno.h b/db/dist/errno.h
new file mode 100644
index 000000000..ae5bc88c8
--- /dev/null
+++ b/db/dist/errno.h
@@ -0,0 +1,186 @@
+/*-
+ * Copyright (c) 1982, 1986, 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)errno.h	8.5 (Berkeley) 1/21/94
+ * FreeBSD: /repoman/r/ncvs/src/sys/sys/errno.h,v 1.28 2005/04/02 12:33:28 das Exp $
+ *
+ * $Id: errno.h,v 1.2 2006/06/11 16:13:13 bostic Exp $
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#undef	errno
+#define	errno	__db_errno
+extern int	__db_errno;
+
+#define	EPERM		1		/* Operation not permitted */
+#define	ENOENT		2		/* No such file or directory */
+#define	ESRCH		3		/* No such process */
+#define	EINTR		4		/* Interrupted system call */
+#define	EIO		5		/* Input/output error */
+#define	ENXIO		6		/* Device not configured */
+#define	E2BIG		7		/* Argument list too long */
+#define	ENOEXEC		8		/* Exec format error */
+#define	EBADF		9		/* Bad file descriptor */
+#define	ECHILD		10		/* No child processes */
+#define	EDEADLK		11		/* Resource deadlock avoided */
+					/* 11 was EAGAIN */
+#define	ENOMEM		12		/* Cannot allocate memory */
+#define	EACCES		13		/* Permission denied */
+#define	EFAULT		14		/* Bad address */
+#ifndef _POSIX_SOURCE
+#define	ENOTBLK		15		/* Block device required */
+#endif
+#define	EBUSY		16		/* Device busy */
+#define	EEXIST		17		/* File exists */
+#define	EXDEV		18		/* Cross-device link */
+#define	ENODEV		19		/* Operation not supported by device */
+#define	ENOTDIR		20		/* Not a directory */
+#define	EISDIR		21		/* Is a directory */
+#define	EINVAL		22		/* Invalid argument */
+#define	ENFILE		23		/* Too many open files in system */
+#define	EMFILE		24		/* Too many open files */
+#define	ENOTTY		25		/* Inappropriate ioctl for device */
+#ifndef _POSIX_SOURCE
+#define	ETXTBSY		26		/* Text file busy */
+#endif
+#define	EFBIG		27		/* File too large */
+#define	ENOSPC		28		/* No space left on device */
+#define	ESPIPE		29		/* Illegal seek */
+#define	EROFS		30		/* Read-only filesystem */
+#define	EMLINK		31		/* Too many links */
+#define	EPIPE		32		/* Broken pipe */
+
+/* math software */
+#define	EDOM		33		/* Numerical argument out of domain */
+#define	ERANGE		34		/* Result too large */
+
+/* non-blocking and interrupt i/o */
+#define	EAGAIN		35		/* Resource temporarily unavailable */
+#ifndef _POSIX_SOURCE
+#define	EWOULDBLOCK	EAGAIN		/* Operation would block */
+#define	EINPROGRESS	36		/* Operation now in progress */
+#define	EALREADY	37		/* Operation already in progress */
+
+/* ipc/network software -- argument errors */
+#define	ENOTSOCK	38		/* Socket operation on non-socket */
+#define	EDESTADDRREQ	39		/* Destination address required */
+#define	EMSGSIZE	40		/* Message too long */
+#define	EPROTOTYPE	41		/* Protocol wrong type for socket */
+#define	ENOPROTOOPT	42		/* Protocol not available */
+#define	EPROTONOSUPPORT	43		/* Protocol not supported */
+#define	ESOCKTNOSUPPORT	44		/* Socket type not supported */
+#define	EOPNOTSUPP	45		/* Operation not supported */
+#define	ENOTSUP		EOPNOTSUPP	/* Operation not supported */
+#define	EPFNOSUPPORT	46		/* Protocol family not supported */
+#define	EAFNOSUPPORT	47		/* Address family not supported by protocol family */
+#define	EADDRINUSE	48		/* Address already in use */
+#define	EADDRNOTAVAIL	49		/* Can't assign requested address */
+
+/* ipc/network software -- operational errors */
+#define	ENETDOWN	50		/* Network is down */
+#define	ENETUNREACH	51		/* Network is unreachable */
+#define	ENETRESET	52		/* Network dropped connection on reset */
+#define	ECONNABORTED	53		/* Software caused connection abort */
+#define	ECONNRESET	54		/* Connection reset by peer */
+#define	ENOBUFS		55		/* No buffer space available */
+#define	EISCONN		56		/* Socket is already connected */
+#define	ENOTCONN	57		/* Socket is not connected */
+#define	ESHUTDOWN	58		/* Can't send after socket shutdown */
+#define	ETOOMANYREFS	59		/* Too many references: can't splice */
+#define	ETIMEDOUT	60		/* Operation timed out */
+#define	ECONNREFUSED	61		/* Connection refused */
+
+#define	ELOOP		62		/* Too many levels of symbolic links */
+#endif /* _POSIX_SOURCE */
+#define	ENAMETOOLONG	63		/* File name too long */
+
+/* should be rearranged */
+#ifndef _POSIX_SOURCE
+#define	EHOSTDOWN	64		/* Host is down */
+#define	EHOSTUNREACH	65		/* No route to host */
+#endif /* _POSIX_SOURCE */
+#define	ENOTEMPTY	66		/* Directory not empty */
+
+/* quotas & mush */
+#ifndef _POSIX_SOURCE
+#define	EPROCLIM	67		/* Too many processes */
+#define	EUSERS		68		/* Too many users */
+#define	EDQUOT		69		/* Disc quota exceeded */
+
+/* Network File System */
+#define	ESTALE		70		/* Stale NFS file handle */
+#define	EREMOTE		71		/* Too many levels of remote in path */
+#define	EBADRPC		72		/* RPC struct is bad */
+#define	ERPCMISMATCH	73		/* RPC version wrong */
+#define	EPROGUNAVAIL	74		/* RPC prog. not avail */
+#define	EPROGMISMATCH	75		/* Program version wrong */
+#define	EPROCUNAVAIL	76		/* Bad procedure for program */
+#endif /* _POSIX_SOURCE */
+
+#define	ENOLCK		77		/* No locks available */
+#define	ENOSYS		78		/* Function not implemented */
+
+#ifndef _POSIX_SOURCE
+#define	EFTYPE		79		/* Inappropriate file type or format */
+#define	EAUTH		80		/* Authentication error */
+#define	ENEEDAUTH	81		/* Need authenticator */
+#define	EIDRM		82		/* Identifier removed */
+#define	ENOMSG		83		/* No message of desired type */
+#define	EOVERFLOW	84		/* Value too large to be stored in data type */
+#define	ECANCELED	85		/* Operation canceled */
+#define	EILSEQ		86		/* Illegal byte sequence */
+#define	ENOATTR		87		/* Attribute not found */
+
+#define EDOOFUS		88		/* Programming error */
+#endif /* _POSIX_SOURCE */
+
+#define	EBADMSG		89		/* Bad message */
+#define	EMULTIHOP	90		/* Multihop attempted */
+#define	ENOLINK		91		/* Link has been severed */
+#define	EPROTO		92		/* Protocol error */
+
+#ifndef _POSIX_SOURCE
+#define	ELAST		92		/* Must be equal largest errno */
+#endif /* _POSIX_SOURCE */
+
+#ifdef _KERNEL
+/* pseudo-errors returned inside kernel to modify return to process */
+#define	ERESTART	(-1)		/* restart syscall */
+#define	EJUSTRETURN	(-2)		/* don't modify regs, just return */
+#define	ENOIOCTL	(-3)		/* ioctl not handled by this layer */
+#define	EDIRIOCTL	(-4)		/* do direct ioctl in GEOM */
+#endif
+
+#endif
diff --git a/db/dist/gen_inc.awk b/db/dist/gen_inc.awk
index d48d02bb1..3d631d17c 100644
--- a/db/dist/gen_inc.awk
+++ b/db/dist/gen_inc.awk
@@ -5,7 +5,7 @@
 # PUBLIC lines are put into two versions of per-directory include files:
 # one file that contains the prototypes, and one file that contains a
 # #define for the name to be processed during configuration when creating
-# unique names for every global symbol in the DB library.
+# unique names for every global C-language symbol in the DB library.
 #
 # The EXTERN lines are put into two files: one of which contains prototypes
 # which are always appended to the db.h file, and one of which contains a
@@ -37,20 +37,6 @@
 	}
 }
 
-# When we switched to methods in 4.0, we guessed txn_{abort,begin,commit}
-# were the interfaces applications would likely use and not be willing to
-# change, due to the sheer volume of the calls.  Provide wrappers -- we
-# could do txn_abort and txn_commit using macros, but not txn_begin, as
-# the name of the field is txn_begin, we didn't want to modify it.
-#
-# The issue with txn_begin hits us in another way.  If configured with the
-# --with-uniquename option, we use #defines to re-define DB's interfaces
-# to unique names.  We can't do that for these functions because txn_begin
-# is also a field name in the DB_ENV structure, and the #defines we use go
-# at the end of the db.h file -- we get control too late to #define a field
-# name.  So, modify the script that generates the unique names #defines to
-# not generate them for these three functions, and don't include the three
-# functions in libraries built with that configuration option.
 /EXTERN:/ {
 	sub("^.*EXTERN:[	 ][	 ]*", "")
 	if ($0 ~ "^#if|^#ifdef|^#ifndef|^#else|^#endif") {
@@ -62,7 +48,7 @@
 	if (eline ~ "\\)\\);") {
 		sub("^[	 ]*", "", eline)
 		print eline >> e_pfile
-		if (eline !~ db_version_unique_name && eline !~ "^int txn_") {
+		if (eline !~ db_version_unique_name) {
 			gsub("[	 ][	 ]*__P.*", "", eline)
 			sub("^.*[	 ][*]*", "", eline)
 			printf("#define	%s %s@DB_VERSION_UNIQUE_NAME@\n",
diff --git a/db/dist/gen_rec.awk b/db/dist/gen_rec.awk
index 001ec65f0..a8f1f01f3 100644
--- a/db/dist/gen_rec.awk
+++ b/db/dist/gen_rec.awk
@@ -2,10 +2,10 @@
 #
 # See the file LICENSE for redistribution information.
 #
-# Copyright (c) 1996-2004
-#	Sleepycat Software.  All rights reserved.
+# Copyright (c) 1996-2006
+#	Oracle Corporation.  All rights reserved.
 #
-# $Id: gen_rec.awk,v 11.110 2004/10/20 20:40:58 bostic Exp $
+# $Id: gen_rec.awk,v 12.22 2006/09/14 15:00:47 bostic Exp $
 #
 
 # This awk script generates all the log, print, and read routines for the DB
@@ -89,10 +89,6 @@ BEGIN {
 	# Write recovery template file headers
 	# This assumes we're doing DB recovery.
 	printf("#include \"db_config.h\"\n\n") > TFILE
-	printf("#ifndef NO_SYSTEM_INCLUDES\n") >> TFILE
-	printf("#include \n\n") >> TFILE
-	printf("#include \n") >> TFILE
-	printf("#endif\n\n") >> TFILE
 	printf("#include \"db_int.h\"\n") >> TFILE
 	printf("#include \"dbinc/db_page.h\"\n") >> TFILE
 	printf("#include \"dbinc/%s.h\"\n", prefix) >> TFILE
@@ -106,7 +102,7 @@ BEGIN {
 		printf("%s ", $i) >> PFILE
 	printf("%s\n", $i) >> PFILE
 }
-/^[ 	]*(BEGIN|IGNORED|BEGIN_BUF)/ {
+/^[ 	]*(BEGIN|BEGIN_COMPAT|BEGIN_BUF)/ {
 	if (in_begin) {
 		print "Invalid format: missing END statement"
 		exit
@@ -115,19 +111,31 @@ BEGIN {
 	is_dbt = 0;
 	has_dbp = 0;
 	is_uint = 0;
+	#
+	# BEGIN_COMPAT does not need logging function or rec table entry.
+	#
 	need_log_function = ($1 == "BEGIN") || ($1 == "BEGIN_BUF");
-	not_buf = ($1 == "BEGIN") || ($1 == "IGNORED");
+	is_compat = ($1 == "BEGIN_COMPAT");
+	not_buf = ($1 == "BEGIN") || ($1 == "BEGIN_COMPAT");
 	if (not_buf)
 		buf_only = 0;
 	nvars = 0;
 
 	thisfunc = $2;
-	funcname = sprintf("%s_%s", prefix, $2);
+	version = $3;
 
 	if (not_buf)
-		rectype = $3;
+		rectype = $4;
 
+	logfunc = sprintf("%s_%s", prefix, $2);
+	logname[num_funcs] = logfunc;
+	if (is_compat) {
+		funcname = sprintf("%s_%s_%s", prefix, $2, version);
+	} else {
+		funcname = logfunc;
+	}
 	funcs[num_funcs] = funcname;
+	functable[num_funcs] = is_compat;
 	++num_funcs;
 }
 /^[ 	]*(DB|ARG|DBT|LOCKS|PGDBT|POINTER|TIME)/ {
@@ -172,7 +180,7 @@ BEGIN {
 
 	# Here are the required fields for every structure
 	if (not_buf) {
-		printf("\tu_int32_t type;\n\tDB_TXN *txnid;\n") >> HFILE
+		printf("\tu_int32_t type;\n\tDB_TXN *txnp;\n") >> HFILE
 		printf("\tDB_LSN prev_lsn;\n") >>HFILE
 	}
 
@@ -181,7 +189,7 @@ BEGIN {
 		t = types[i];
 		if (modes[i] == "POINTER") {
 			ndx = index(t, "*");
-			t = substr(types[i], 0, ndx - 2);
+			t = substr(types[i], 1, ndx - 2);
 		}
 		printf("\t%s\t%s;\n", t, vars[i]) >> HFILE
 	}
@@ -243,6 +251,8 @@ END {
 
 	printf("\tint ret;\n\n") >> PFILE;
 	for (i = 0; i < num_funcs; i++) {
+		if (functable[i] == 1)
+			continue;
 		printf("\tif ((ret = __db_add_recovery(dbenv, ") >> PFILE;
 		printf("dtabp, dtabsizep,\n") >> PFILE;
 		printf("\t    %s_print, DB_%s)) != 0)\n", \
@@ -278,6 +288,8 @@ END {
 	printf(" db_recops, void *));\n") >> CFILE;
 	printf("\tsize_t *dtabsizep;\n{\n\tint ret;\n\n") >> CFILE;
 	for (i = 0; i < num_funcs; i++) {
+		if (functable[i] == 1)
+			continue;
 		printf("\tif ((ret = __db_add_recovery(dbenv, ") >> CFILE;
 		printf("dtabp, dtabsizep,\n") >> CFILE;
 		printf("\t    %s_recover, DB_%s)) != 0)\n", \
@@ -292,7 +304,7 @@ function log_function()
 	# Write the log function; function prototype
 	pi = 1;
 	if (not_buf) {
-		p[pi++] = sprintf("int %s_log", funcname);
+		p[pi++] = sprintf("int %s_log", logfunc);
 		p[pi++] = " ";
 		if (has_dbp == 1) {
 			p[pi++] = "__P((DB *";
@@ -301,7 +313,7 @@ function log_function()
 		}
 		p[pi++] = ", DB_TXN *, DB_LSN *, u_int32_t";
 	} else {
-		p[pi++] = sprintf("int %s_buf", funcname);
+		p[pi++] = sprintf("int %s_buf", logfunc);
 		p[pi++] = " ";
 		p[pi++] = "__P((u_int8_t *, size_t, size_t *";
 	}
@@ -322,13 +334,13 @@ function log_function()
 
 	# Function declaration
 	if (not_buf && has_dbp == 1) {
-		printf("int\n%s_log(dbp, txnid, ret_lsnp, flags", \
-		    funcname) >> CFILE;
+		printf("int\n%s_log(dbp, txnp, ret_lsnp, flags", \
+		    logfunc) >> CFILE;
 	} else if (not_buf) {
-		printf("int\n%s_log(dbenv, txnid, ret_lsnp, flags", \
-		    funcname) >> CFILE;
+		printf("int\n%s_log(dbenv, txnp, ret_lsnp, flags", \
+		    logfunc) >> CFILE;
 	} else {
-		printf("int\n%s_buf(buf, max, lenp", funcname) >> CFILE;
+		printf("int\n%s_buf(buf, max, lenp", logfunc) >> CFILE;
 	}
 	for (i = 0; i < nvars; i++) {
 		if (modes[i] == "DB") {
@@ -352,7 +364,7 @@ function log_function()
 		} else {
 			printf("\tDB_ENV *dbenv;\n") >> CFILE;
 		}
-		printf("\tDB_TXN *txnid;\n\tDB_LSN *ret_lsnp;\n") >> CFILE;
+		printf("\tDB_TXN *txnp;\n\tDB_LSN *ret_lsnp;\n") >> CFILE;
 		printf("\tu_int32_t flags;\n") >> CFILE;
 	} else {
 		printf("\tu_int8_t *buf;\n") >> CFILE;
@@ -403,7 +415,7 @@ function log_function()
 			printf("\tdbenv = dbp->dbenv;\n") >> CFILE;
 		if (dbprivate)
 			printf("\tCOMPQUIET(lr, NULL);\n\n") >> CFILE;
-		printf("\trectype = DB_%s;\n", funcname) >> CFILE;
+		printf("\trectype = DB_%s;\n", logfunc) >> CFILE;
 		printf("\tnpad = 0;\n") >> CFILE;
 		printf("\trlsnp = ret_lsnp;\n\n") >> CFILE;
 	}
@@ -419,23 +431,25 @@ function log_function()
 				    >> CFILE;
 			} else {
 				printf(") {\n") >> CFILE;
-				printf("\t\tif (txnid == NULL)\n") >> CFILE;
+				printf("\t\tif (txnp == NULL)\n") >> CFILE;
 				printf("\t\t\treturn (0);\n") >> CFILE;
 			}
+			printf("\t\tif (txnp == NULL)\n") >> CFILE;
+			printf("\t\t\treturn (0);\n") >> CFILE;
 			printf("\t\tis_durable = 0;\n") >> CFILE;
 			printf("\t} else\n") >> CFILE;
 			printf("\t\tis_durable = 1;\n\n") >> CFILE;
 		}
-		printf("\tif (txnid == NULL) {\n") >> CFILE;
+		printf("\tif (txnp == NULL) {\n") >> CFILE;
 		printf("\t\ttxn_num = 0;\n") >> CFILE;
 		printf("\t\tlsnp = &null_lsn;\n") >> CFILE;
 		printf("\t\tnull_lsn.file = null_lsn.offset = 0;\n") >> CFILE;
 		printf("\t} else {\n") >> CFILE;
-		if (dbprivate && funcname != "__db_debug") {
+		if (dbprivate && logfunc != "__db_debug") {
 			printf(\
-    "\t\tif (TAILQ_FIRST(&txnid->kids) != NULL &&\n") >> CFILE;
+    "\t\tif (TAILQ_FIRST(&txnp->kids) != NULL &&\n") >> CFILE;
 			printf("\t\t    (ret = __txn_activekids(") >> CFILE;
-			printf("dbenv, rectype, txnid)) != 0)\n") >> CFILE;
+			printf("dbenv, rectype, txnp)) != 0)\n") >> CFILE;
 			printf("\t\t\treturn (ret);\n") >> CFILE;
 		}
 		printf("\t\t/*\n\t\t * We need to assign begin_lsn while ") \
@@ -445,11 +459,10 @@ function log_function()
 		printf("DbEnv->log_put call,\n\t\t * ") >> CFILE;
 		printf("so pass in the appropriate memory location to be ") \
 		    >> CFILE;
-		printf("filled\n\t\t * in by the log_put code.\n\t\t*/\n") \
+		printf("filled\n\t\t * in by the log_put code.\n\t\t */\n") \
 		    >> CFILE;
-		printf("\t\tDB_SET_BEGIN_LSNP(txnid, &rlsnp);\n") >> CFILE;
-		printf("\t\ttxn_num = txnid->txnid;\n") >> CFILE;
-		printf("\t\tlsnp = &txnid->last_lsn;\n") >> CFILE;
+		printf("\t\tDB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);\n") >> CFILE;
+		printf("\t\ttxn_num = txnp->txnid;\n") >> CFILE;
 		printf("\t}\n\n") >> CFILE;
 
 		# If we're logging a DB handle, make sure we have a log
@@ -471,7 +484,7 @@ function log_function()
 			printf("->adj_size(logrec.size);\n") >> CFILE;
 			printf("\t\tlogrec.size += npad;\n\t}\n\n") >> CFILE
 
-			printf("\tif (is_durable || txnid == NULL) {\n") \
+			printf("\tif (is_durable || txnp == NULL) {\n") \
 			    >> CFILE;
 			printf("\t\tif ((ret =\n\t\t    __os_malloc(dbenv, ") \
 			    >> CFILE;
@@ -576,10 +589,27 @@ function log_function()
 				    sizes[i]) >> CFILE;
 				printf("\t\treturn (ENOMEM);\n") >> CFILE;
 			}
-			printf("\tif (%s != NULL)\n", vars[i]) >> CFILE;
-			printf("\t\tmemcpy(bp, %s, %s);\n", vars[i], \
+			printf("\tif (%s != NULL)", vars[i]) >> CFILE;
+			if (not_buf && has_dbp && types[i] == "DB_LSN *") {
+				printf(" {\n\t\tif (txnp != NULL) {\n") \
+				    >> CFILE;
+				printf( \
+	"\t\t\tLOG *lp = dbenv->lg_handle->reginfo.primary;\n") >> CFILE;
+				printf( \
+	"\t\t\tif (LOG_COMPARE(%s, &lp->lsn) >= 0 && (ret =\n", vars[i]) \
+				    >> CFILE;
+				printf( \
+	"\t\t\t    __log_check_page_lsn(dbenv, dbp, %s) != 0))\n", vars[i]) \
+				    >> CFILE;
+				printf("\t\t\t\treturn (ret);\n") >> CFILE;
+				printf("\t\t}") >> CFILE;
+			}
+			printf("\n\t\tmemcpy(bp, %s, %s);\n", vars[i], \
 			    sizes[i]) >> CFILE;
-			printf("\telse\n") >> CFILE;
+			if (not_buf && has_dbp && types[i] == "DB_LSN *")
+				printf("\t} else\n") >> CFILE;
+			else
+				printf("\telse\n") >> CFILE;
 			printf("\t\tmemset(bp, 0, %s);\n", sizes[i]) >> CFILE;
 			printf("\tbp += %s;\n\n", sizes[i]) >> CFILE;
 		}
@@ -590,9 +620,9 @@ function log_function()
 	# rather than requiring assert.h.
 	if (not_buf) {
 		if (dbprivate) {
-			printf("\tDB_ASSERT((u_int32_t)") >> CFILE;
-			printf("(bp - (u_int8_t *)logrec.data) ") >> CFILE;
-			printf("<= logrec.size);\n\n") >> CFILE;
+			printf("\tDB_ASSERT(dbenv,\n") >> CFILE;
+			printf("\t    (u_int32_t)(bp - (u_int8_t *)") >> CFILE;
+			printf("logrec.data) <= logrec.size);\n\n") >> CFILE;
 			# Save the log record off in the txn's linked list,
 			# or do log call.
 			# We didn't call the crypto alignment function when
@@ -600,15 +630,15 @@ function log_function()
 			# the right header files to find the function), so
 			# we have to copy the log record to make sure the
 			# alignment is correct.
-			printf("\tif (is_durable || txnid == NULL) {\n") \
+			printf("\tif (is_durable || txnp == NULL) {\n") \
 			    >> CFILE;
 			# Output the log record and update the return LSN.
 			printf("\t\tif ((ret = __log_put(dbenv, rlsnp,") \
 			    >> CFILE;
 			printf("(DBT *)&logrec,\n") >> CFILE;
 			printf("\t\t    flags | DB_LOG_NOCOPY)) == 0") >> CFILE;
-			printf(" && txnid != NULL) {\n") >> CFILE;
-			printf("\t\t\ttxnid->last_lsn = *rlsnp;\n") >> CFILE;
+			printf(" && txnp != NULL) {\n") >> CFILE;
+			printf("\t\t\t*lsnp = *rlsnp;\n") >> CFILE;
 
 			printf("\t\t\tif (rlsnp != ret_lsnp)\n") >> CFILE;
 			printf("\t\t\t\t *ret_lsnp = *rlsnp;\n") >> CFILE;
@@ -637,8 +667,10 @@ function log_function()
 			printf("\t\tret = 0;\n") >> CFILE;
 			printf("#endif\n") >> CFILE;
 			# Add a ND record to the txn list.
-			printf("\t\tSTAILQ_INSERT_HEAD(&txnid") >> CFILE;
+			printf("\t\tSTAILQ_INSERT_HEAD(&txnp") >> CFILE;
 			printf("->logs, lr, links);\n") >> CFILE;
+			printf("\t\tF_SET((TXN_DETAIL *)") >> CFILE;
+			printf("txnp->td, TXN_DTL_INMEMORY);\n") >> CFILE;
 			# Update the return LSN.
 			printf("\t\tLSN_NOT_LOGGED(*ret_lsnp);\n") >> CFILE;
 			printf("\t}\n\n") >> CFILE;
@@ -646,10 +678,10 @@ function log_function()
 			printf("\tif ((ret = dbenv->log_put(dbenv, rlsnp,") >> CFILE;
 			printf(" (DBT *)&logrec,\n") >> CFILE;
 			printf("\t    flags | DB_LOG_NOCOPY)) == 0") >> CFILE;
-			printf(" && txnid != NULL) {\n") >> CFILE;
+			printf(" && txnp != NULL) {\n") >> CFILE;
 
                 	# Update the transactions last_lsn.
-			printf("\t\ttxnid->last_lsn = *rlsnp;\n") >> CFILE;
+			printf("\t\t*lsnp = *rlsnp;\n") >> CFILE;
 			printf("\t\tif (rlsnp != ret_lsnp)\n") >> CFILE;
 			printf("\t\t\t *ret_lsnp = *rlsnp;\n") >> CFILE;
 			printf("\t}\n") >> CFILE;
@@ -660,15 +692,14 @@ function log_function()
 		printf("#ifdef LOG_DIAGNOSTIC\n") >> CFILE
 		printf("\tif (ret != 0)\n") >> CFILE;
 		printf("\t\t(void)%s_print(dbenv,\n", funcname) >> CFILE;
-		printf("\t\t    (DBT *)&logrec, ret_lsnp, NULL, NULL);\n") \
-		    >> CFILE
-		printf("#endif\n\n") >> CFILE
+		printf("\t\t    (DBT *)&logrec, ret_lsnp, ") >> CFILE
+		printf("DB_TXN_PRINT, NULL);\n#endif\n\n") >> CFILE
 		# Free and return
 		if (dbprivate) {
 			printf("#ifdef DIAGNOSTIC\n") >> CFILE
 			write_free("\t", "logrec.data", CFILE)
 			printf("#else\n") >> CFILE
-			printf("\tif (is_durable || txnid == NULL)\n") >> CFILE;
+			printf("\tif (is_durable || txnp == NULL)\n") >> CFILE;
 			write_free("\t\t", "logrec.data", CFILE)
 			printf("#endif\n") >> CFILE
 		} else {
@@ -691,7 +722,7 @@ function db_handle_id_function(modes, n)
 			# that ID we're able to acquire an open handle
 			# at recovery time.
 			printf(\
-		    "\tDB_ASSERT(dbp->log_filename != NULL);\n") \
+		    "\tDB_ASSERT(dbenv, dbp->log_filename != NULL);\n") \
 			    >> CFILE;
 			printf("\tif (dbp->log_filename->id == ") \
 			    >> CFILE;
@@ -727,6 +758,7 @@ function print_function()
 		if (modes[i] == "TIME") {
 			printf("\tstruct tm *lt;\n") >> PFILE
 			printf("\ttime_t timeval;\n") >> PFILE
+			printf("\tchar time_buf[CTIME_BUFLEN];\n") >> PFILE
 			break;
 		}
 	for (i = 0; i < nvars; i ++)
@@ -738,7 +770,7 @@ function print_function()
 	printf("\tint ret;\n\n") >> PFILE;
 
 	# Get rid of complaints about unused parameters.
-	printf("\tnotused2 = DB_TXN_ABORT;\n\tnotused3 = NULL;\n\n") >> PFILE;
+	printf("\tnotused2 = DB_TXN_PRINT;\n\tnotused3 = NULL;\n\n") >> PFILE;
 
 	# Call read routine to initialize structure
 	printf("\tif ((ret = %s_read(dbenv, dbtp->data, &argp)) != 0)\n", \
@@ -746,18 +778,15 @@ function print_function()
 	printf("\t\treturn (ret);\n") >> PFILE;
 
 	# Print values in every record
-	printf("\t(void)printf(\n\t    \"[%%lu][%%lu]%s%%s: ",\
-	     funcname) >> PFILE;
-	printf("rec: %%lu txnid %%lx ") >> PFILE;
-	printf("prevlsn [%%lu][%%lu]\\n\",\n") >> PFILE;
-	printf("\t    (u_long)lsnp->file,\n") >> PFILE;
-	printf("\t    (u_long)lsnp->offset,\n") >> PFILE;
+	printf("\t(void)printf(\n    \"[%%lu][%%lu]%s%%s: ", funcname) >> PFILE;
+	printf("rec: %%lu txnp %%lx prevlsn [%%lu][%%lu]\\n\",\n") >> PFILE;
+	printf("\t    (u_long)lsnp->file, (u_long)lsnp->offset,\n") >> PFILE;
 	printf("\t    (argp->type & DB_debug_FLAG) ? \"_debug\" : \"\",\n") \
 	     >> PFILE;
 	printf("\t    (u_long)argp->type,\n") >> PFILE;
-	printf("\t    (u_long)argp->txnid->txnid,\n") >> PFILE;
-	printf("\t    (u_long)argp->prev_lsn.file,\n") >> PFILE;
-	printf("\t    (u_long)argp->prev_lsn.offset);\n") >> PFILE;
+	printf("\t    (u_long)argp->txnp->txnid,\n") >> PFILE;
+	printf("\t    (u_long)argp->prev_lsn.file, ") >> PFILE;
+	printf("(u_long)argp->prev_lsn.offset);\n") >> PFILE;
 
 	# Now print fields of argp
 	for (i = 0; i < nvars; i ++) {
@@ -794,7 +823,8 @@ function print_function()
 	    "%%%s (%%.24s, 20%%02lu%%02lu%%02lu%%02lu%%02lu.%%02lu)\\n\",\n", \
 			    formats[i]) >> PFILE;
 			printf("\t    (long)argp->%s, ", vars[i]) >> PFILE;
-			printf("ctime(&timeval),", vars[i]) >> PFILE;
+			printf("__db_ctime(&timeval, time_buf),", \
+			    vars[i]) >> PFILE;
 			printf("\n\t    (u_long)lt->tm_year - 100, ") >> PFILE;
 			printf("(u_long)lt->tm_mon+1,") >> PFILE;
 			printf("\n\t    (u_long)lt->tm_mday, ") >> PFILE;
@@ -874,20 +904,21 @@ function read_function()
 	}
 	write_malloc("\t", "argp", malloc_size, CFILE)
 
-	# Set up the pointers to the txnid.
+	# Set up the pointers to the DB_TXN *.
 	printf("\tbp = recbuf;\n") >> CFILE;
 
 	if (not_buf) {
-		printf("\targp->txnid = (DB_TXN *)&argp[1];\n\n") >> CFILE;
-
-		# First get the record type, prev_lsn, and txnid fields.
+		printf("\targp->txnp = (DB_TXN *)&argp[1];\n") >> CFILE;
+		printf("\tmemset(argp->txnp, 0, sizeof(DB_TXN));\n\n") \
+		    >> CFILE;
+		# First get the record type, prev_lsn, and txnp fields.
 
 		printf("\tmemcpy(&argp->type, bp, sizeof(argp->type));\n") \
 		    >> CFILE;
 		printf("\tbp += sizeof(argp->type);\n\n") >> CFILE;
-		printf("\tmemcpy(&argp->txnid->txnid,  bp, ") >> CFILE;
-		printf("sizeof(argp->txnid->txnid));\n") >> CFILE;
-		printf("\tbp += sizeof(argp->txnid->txnid);\n\n") >> CFILE;
+		printf("\tmemcpy(&argp->txnp->txnid, bp, ") >> CFILE;
+		printf("sizeof(argp->txnp->txnid));\n") >> CFILE;
+		printf("\tbp += sizeof(argp->txnp->txnid);\n\n") >> CFILE;
 		printf("\tmemcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));\n") \
 		    >> CFILE;
 		printf("\tbp += sizeof(DB_LSN);\n\n") >> CFILE;
diff --git a/db/dist/gen_rpc.awk b/db/dist/gen_rpc.awk
index 7eee77b3d..e4bf85e76 100644
--- a/db/dist/gen_rpc.awk
+++ b/db/dist/gen_rpc.awk
@@ -1,5 +1,5 @@
 #
-# $Id: gen_rpc.awk,v 11.58 2004/08/19 20:28:37 mjc Exp $
+# $Id: gen_rpc.awk,v 12.7 2006/05/05 15:29:43 bostic Exp $
 # Awk script for generating client/server RPC code.
 #
 # This awk script generates most of the RPC routines for DB client/server
@@ -54,6 +54,12 @@ BEGIN {
 	printf("/* Do not edit: automatically built by gen_rpc.awk. */\n") \
 	    > XFILE
 	nendlist = 1;
+
+	# Output headers
+	general_headers()
+
+	# Put out the actual illegal and no-server functions.
+	illegal_functions(CFILE)
 }
 END {
 	if (error == 0) {
@@ -65,29 +71,60 @@ END {
 
 		printf("\t} = %d%03d;\n", major, minor) >> XFILE
 		printf("} = 351457;\n") >> XFILE
+
+		obj_init("DB", "dbp", obj_db, CFILE)
+		obj_init("DBC", "dbc", obj_dbc, CFILE)
+		obj_init("DB_ENV", "dbenv", obj_dbenv, CFILE)
+		obj_init("DB_TXN", "txn", obj_txn, CFILE)
 	}
 }
 
+/^[	 ]*LOCAL/ {
+	# LOCAL methods are ones where we don't override the handle
+	# method for RPC, nor is it illegal -- it's just satisfied
+	# locally.
+	next;
+}
+/^[	 ]*NOFUNC/ {
+	++obj_indx;
+
+	# NOFUNC methods are illegal on the RPC client.
+	if ($2 ~ "^db_")
+		obj_illegal(obj_db, "dbp", $2, $3)
+	else if ($2 ~ "^dbc_")
+		obj_illegal(obj_dbc, "dbc", $2, $3)
+	else if ($2 ~ "^env_")
+		obj_illegal(obj_dbenv, "dbenv", $2, $3)
+	else if ($2 ~ "^txn_")
+		obj_illegal(obj_txn, "txn", $2, $3)
+	else {
+		print "unexpected handle prefix: " $2
+		error = 1; exit
+	}
+	next;
+}
 /^[	 ]*BEGIN/ {
+	++obj_indx;
+
 	name = $2;
-	nofunc_code = 0;
-	funcvars = 0;
-	ret_code = 0;
-	if ($3 == "NOFUNC")
-		nofunc_code = 1;
-	if ($3 == "RETCODE")
-		ret_code = 1;
+	link_only = ret_code = 0
+	if ($3 == "LINKONLY")
+		link_only = 1
+	else if ($3 == "RETCODE")
+		ret_code = 1
 
+	funcvars = 0;
+	newvars = 0;
 	nvars = 0;
 	rvars = 0;
-	newvars = 0;
+	xdr_free = 0;
+
 	db_handle = 0;
-	env_handle = 0;
 	dbc_handle = 0;
-	txn_handle = 0;
-	mp_handle = 0;
 	dbt_handle = 0;
-	xdr_free = 0;
+	env_handle = 0;
+	mp_handle = 0;
+	txn_handle = 0;
 }
 /^[	 ]*ARG/ {
 	rpc_type[nvars] = $2;
@@ -102,36 +139,36 @@ END {
 
 	if (c_type[nvars] == "DBT *")
 		dbt_handle = 1;
-
-	if (c_type[nvars] == "DB_ENV *") {
+	else if (c_type[nvars] == "DB_ENV *") {
 		ctp_type[nvars] = "CT_ENV";
 		env_handle = 1;
 		env_idx = nvars;
-	}
 
-	if (c_type[nvars] == "DB *") {
+		if (nvars == 0)
+			obj_func("dbenv", obj_dbenv);
+	} else if (c_type[nvars] == "DB *") {
 		ctp_type[nvars] = "CT_DB";
 		if (db_handle != 1) {
 			db_handle = 1;
 			db_idx = nvars;
 		}
-	}
 
-	if (c_type[nvars] == "DBC *") {
+		if (nvars == 0)
+			obj_func("dbp", obj_db);
+	} else if (c_type[nvars] == "DBC *") {
 		ctp_type[nvars] = "CT_CURSOR";
 		dbc_handle = 1;
 		dbc_idx = nvars;
-	}
 
-	if (c_type[nvars] == "DB_TXN *") {
+		if (nvars == 0)
+			obj_func("dbc", obj_dbc);
+	} else if (c_type[nvars] == "DB_TXN *") {
 		ctp_type[nvars] = "CT_TXN";
 		txn_handle = 1;
 		txn_idx = nvars;
-	}
 
-	if (c_type[nvars] == "DB_MPOOLFILE *") {
-		mp_handle = 1;
-		mp_idx = nvars;
+		if (nvars == 0)
+			obj_func("txn", obj_txn);
 	}
 
 	++nvars;
@@ -189,198 +226,10 @@ END {
 /^[	 ]*END/ {
 	#
 	# =====================================================
-	# File headers, if necessary.
+	# LINKONLY -- just reference the function, that's all.
 	#
-	if (first == 0) {
-		printf("#include \"db_config.h\"\n") >> CFILE
-		printf("\n") >> CFILE
-		printf("#ifndef NO_SYSTEM_INCLUDES\n") >> CFILE
-		printf("#include \n") >> CFILE
-		printf("\n") >> CFILE
-		printf("#include \n") >> CFILE
-		printf("\n") >> CFILE
-		printf("#include \n") >> CFILE
-		printf("#endif\n") >> CFILE
-		printf("\n") >> CFILE
-		printf("#include \"db_server.h\"\n") >> CFILE
-		printf("\n") >> CFILE
-		printf("#include \"db_int.h\"\n") >> CFILE
-		printf("#include \"dbinc/txn.h\"\n") >> CFILE
-		printf("#include \"dbinc_auto/rpc_client_ext.h\"\n") >> CFILE
-		printf("\n") >> CFILE
-
-		printf("#include \"db_config.h\"\n") >> TFILE
-		printf("\n") >> TFILE
-		printf("#ifndef NO_SYSTEM_INCLUDES\n") >> TFILE
-		printf("#include \n") >> TFILE
-		printf("\n") >> TFILE
-		printf("#include \n") >> TFILE
-		printf("#endif\n") >> TFILE
-		printf("#include \"db_int.h\"\n") >> TFILE
-		printf("#include \"dbinc/txn.h\"\n") >> TFILE
-		printf("\n") >> TFILE
-
-		printf("#include \"db_config.h\"\n") >> SFILE
-		printf("\n") >> SFILE
-		printf("#ifndef NO_SYSTEM_INCLUDES\n") >> SFILE
-		printf("#include \n") >> SFILE
-		printf("\n") >> SFILE
-		printf("#include \n") >> SFILE
-		printf("\n") >> SFILE
-		printf("#include \n") >> SFILE
-		printf("#endif\n") >> SFILE
-		printf("\n") >> SFILE
-		printf("#include \"db_server.h\"\n") >> SFILE
-		printf("\n") >> SFILE
-		printf("#include \"db_int.h\"\n") >> SFILE
-		printf("#include \"dbinc/db_server_int.h\"\n") >> SFILE
-		printf("#include \"dbinc_auto/rpc_server_ext.h\"\n") >> SFILE
-		printf("\n") >> SFILE
-
-		printf("#include \"db_config.h\"\n") >> PFILE
-		printf("\n") >> PFILE
-		printf("#ifndef NO_SYSTEM_INCLUDES\n") >> PFILE
-		printf("#include \n") >> PFILE
-		printf("\n") >> PFILE
-		printf("#include \n") >> PFILE
-		printf("\n") >> PFILE
-		printf("#include \n") >> PFILE
-		printf("#endif\n") >> PFILE
-		printf("\n") >> PFILE
-		printf("#include \"db_server.h\"\n") >> PFILE
-		printf("\n") >> PFILE
-		printf("#include \"db_int.h\"\n") >> PFILE
-		printf("#include \"dbinc/db_server_int.h\"\n") >> PFILE
-		printf("\n") >> PFILE
-
-		first = 1;
-	}
-	#
-	# =====================================================
-	# Generate Client Nofunc code first if necessary
-	# NOTE:  This code must be first, because we don't want any
-	# other code other than this function, so before we write
-	# out to the XDR and server files, we just generate this
-	# and move on if this is all we are doing.
-	#
-	if (nofunc_code == 1) {
-		#
-		# First time through, put out the general no server and
-		# illegal functions.
-		#
-		if (first_nofunc == 0) {
-			printf("static int __dbcl_noserver ") >> CFILE
-			printf("__P((DB_ENV *));\n\n") >> CFILE
-			printf("static int\n") >> CFILE
-			printf("__dbcl_noserver(dbenv)\n") >> CFILE
-			printf("\tDB_ENV *dbenv;\n") >> CFILE
-			printf("{\n\t__db_err(dbenv,") >> CFILE
-			printf(" \"No server environment\");\n") >> CFILE
-			printf("\treturn (DB_NOSERVER);\n") >> CFILE
-			printf("}\n\n") >> CFILE
-
-			printf("static int __dbcl_rpc_illegal ") >> CFILE
-			printf("__P((DB_ENV *, char *));\n\n") >> CFILE
-			printf("static int\n") >> CFILE
-			printf("__dbcl_rpc_illegal(dbenv, name)\n") >> CFILE
-			printf("\tDB_ENV *dbenv;\n\tchar *name;\n") >> CFILE
-			printf("{\n\t__db_err(dbenv,") >> CFILE
-			printf(" \"%%s method unsupported in RPC") >> CFILE
-			printf(" environments\", name);\n") >> CFILE
-			printf("\treturn (DB_OPNOTSUP);\n") >> CFILE
-			printf("}\n\n") >> CFILE
-
-			first_nofunc = 1
-		}
-		#
-		# Spit out PUBLIC prototypes.
-		#
-		delete p;
-		pi = 1;
-		p[pi++] = sprintf("int __dbcl_%s __P((", name);
-		p[pi++] = "";
-		for (i = 0; i < nvars; ++i) {
-			p[pi++] = pr_type[i];
-			p[pi++] = ", ";
-		}
-		p[pi - 1] = "";
-		p[pi] = "));";
-		proto_format(p, CFILE);
-
-		#
-		# Spit out function name/args.
-		#
-		printf("int\n") >> CFILE
-		printf("__dbcl_%s(", name) >> CFILE
-		sep = "";
-		for (i = 0; i < nvars; ++i) {
-			printf("%s%s", sep, args[i]) >> CFILE
-			sep = ", ";
-		}
-		printf(")\n") >> CFILE
-
-		for (i = 0; i < nvars; ++i)
-			if (func_arg[i] == 0)
-				printf("\t%s %s;\n", c_type[i], args[i]) \
-				    >> CFILE
-			else
-				printf("\t%s;\n", c_type[i]) >> CFILE
-
-		#
-		# Call error function and return EINVAL
-		#
-		printf("{\n") >> CFILE
-
-		#
-		# If we don't have a local env, set one.
-		#
-		if (env_handle == 0) {
-			printf("\tDB_ENV *dbenv;\n\n") >> CFILE
-			if (db_handle)
-				printf("\tdbenv = %s->dbenv;\n", \
-				    args[db_idx]) >> CFILE
-			else if (dbc_handle)
-				printf("\tdbenv = %s->dbp->dbenv;\n", \
-				    args[dbc_idx]) >> CFILE
-			else if (txn_handle)
-				printf("\tdbenv = %s->mgrp->dbenv;\n", \
-				    args[txn_idx]) >> CFILE
-			else if (mp_handle)
-				printf("\tdbenv = %s->dbenv;\n", \
-				    args[mp_idx]) >> CFILE
-			else
-				printf("\tdbenv = NULL;\n") >> CFILE
-		}
-		#
-		# Quiet the compiler for all variables.
-		#
-		# NOTE:  Index 'i' starts at 1, not 0.  Our first arg is
-		# the handle we need to get to the env, and we do not want
-		# to COMPQUIET that one.
-		for (i = 1; i < nvars; ++i) {
-			if (rpc_type[i] == "CONST" || rpc_type[i] == "DBT" ||
-			    rpc_type[i] == "LIST" || rpc_type[i] == "STRING" ||
-			    rpc_type[i] == "GID") {
-				printf("\tCOMPQUIET(%s, NULL);\n", args[i]) \
-				    >> CFILE
-			}
-			if (rpc_type[i] == "INT" || rpc_type[i] == "IGNORE" ||
-			    rpc_type[i] == "ID") {
-				printf("\tCOMPQUIET(%s, 0);\n", args[i]) \
-				    >> CFILE
-			}
-		}
-
-		if (!env_handle) {
-			printf("\treturn (__dbcl_rpc_illegal(dbenv, ") >> CFILE
-			printf("\"%s\"));\n", name) >> CFILE
-		} else
-			printf("\treturn (__dbcl_rpc_illegal(%s, \"%s\"));\n", \
-			    args[env_idx], name) >> CFILE
-		printf("}\n\n") >> CFILE
-
+	if (link_only)
 		next;
-	}
 
 	#
 	# =====================================================
@@ -716,7 +565,7 @@ END {
 	#
 	for (i = 0; i < nvars; ++i) {
 		if (rpc_type[i] == "ID") {
-			printf("\tlong %scl_id;\n", args[i]) >> PFILE
+			printf("\tunsigned int %scl_id;\n", args[i]) >> PFILE
 		}
 		if (rpc_type[i] == "STRING") {
 			printf("\tchar *%s;\n", args[i]) >> PFILE
@@ -851,8 +700,7 @@ END {
 			    args[txn_idx]) >> CFILE
 		else
 			printf("\tdbenv = NULL;\n") >> CFILE
-		printf("\tif (dbenv == NULL || !RPC_ON(dbenv))\n") \
-		    >> CFILE
+		printf("\tif (dbenv == NULL || !RPC_ON(dbenv))\n") >> CFILE
 		printf("\t\treturn (__dbcl_noserver(NULL));\n") >> CFILE
 	} else {
 		printf("\tif (%s == NULL || !RPC_ON(%s))\n", \
@@ -862,13 +710,8 @@ END {
 	}
 	printf("\n") >> CFILE
 
-	if (!env_handle)
-		printf("\tcl = (CLIENT *)dbenv->cl_handle;\n") >> CFILE
-	else
-		printf("\tcl = (CLIENT *)%s->cl_handle;\n", \
-		    args[env_idx]) >> CFILE
-
-	printf("\n") >> CFILE
+	printf("\tcl = (CLIENT *)%s->cl_handle;\n\n", \
+	    env_handle ? args[env_idx] : "dbenv") >> CFILE
 
 	#
 	# If there is a function arg, check that it is NULL
@@ -878,9 +721,9 @@ END {
 			continue;
 		printf("\tif (%s != NULL) {\n", args[i]) >> CFILE
 		if (!env_handle) {
-			printf("\t\t__db_err(dbenv, ") >> CFILE
+			printf("\t\t__db_errx(dbenv, ") >> CFILE
 		} else {
-			printf("\t\t__db_err(%s, ", args[env_idx]) >> CFILE
+			printf("\t\t__db_errx(%s, ", args[env_idx]) >> CFILE
 		}
 		printf("\"User functions not supported in RPC\");\n") >> CFILE
 		printf("\t\treturn (EINVAL);\n\t}\n") >> CFILE
@@ -891,15 +734,22 @@ END {
 	#
 	for (i = 0; i < nvars; ++i) {
 		if (rpc_type[i] == "ID") {
-			printf("\tif (%s == NULL)\n", args[i]) >> CFILE
-			printf("\t\tmsg.%scl_id = 0;\n\telse\n", \
-			    args[i]) >> CFILE
+			# We don't need to check for a NULL DB_ENV *, because
+			# we already checked for it.  I frankly couldn't care
+			# less, but lint gets all upset at the wasted cycles.
+			if (c_type[i] != "DB_ENV *") {
+				printf("\tif (%s == NULL)\n", args[i]) >> CFILE
+				printf("\t\tmsg.%scl_id = 0;\n\telse\n", \
+				    args[i]) >> CFILE
+				indent = "\t\t";
+			} else
+				indent = "\t";
 			if (c_type[i] == "DB_TXN *") {
-				printf("\t\tmsg.%scl_id = %s->txnid;\n", \
-				    args[i], args[i]) >> CFILE
+				printf("%smsg.%scl_id = %s->txnid;\n", \
+				    indent, args[i], args[i]) >> CFILE
 			} else {
-				printf("\t\tmsg.%scl_id = %s->cl_id;\n", \
-				    args[i], args[i]) >> CFILE
+				printf("%smsg.%scl_id = %s->cl_id;\n", \
+				    indent, args[i], args[i]) >> CFILE
 			}
 		}
 		if (rpc_type[i] == "GID") {
@@ -990,10 +840,10 @@ END {
 	}
 	printf("\tif (replyp == NULL) {\n") >> CFILE
 	if (!env_handle) {
-		printf("\t\t__db_err(dbenv, ") >> CFILE
+		printf("\t\t__db_errx(dbenv, ") >> CFILE
 		printf("clnt_sperror(cl, \"Berkeley DB\"));\n") >> CFILE
 	} else {
-		printf("\t\t__db_err(%s, ", args[env_idx]) >> CFILE
+		printf("\t\t__db_errx(%s, ", args[env_idx]) >> CFILE
 		printf("clnt_sperror(cl, \"Berkeley DB\"));\n") >> CFILE
 	}
 	printf("\t\tret = DB_NOSERVER;\n") >> CFILE
@@ -1129,6 +979,154 @@ END {
 	}
 }
 
+function general_headers()
+{
+	printf("#include \"db_config.h\"\n") >> CFILE
+	printf("\n") >> CFILE
+	printf("#include \"db_int.h\"\n") >> CFILE
+	printf("#ifndef NO_SYSTEM_INCLUDES\n") >> CFILE
+	printf("#include \n") >> CFILE
+	printf("#endif\n") >> CFILE
+	printf("#include \"db_server.h\"\n") >> CFILE
+	printf("#include \"dbinc/txn.h\"\n") >> CFILE
+	printf("#include \"dbinc_auto/rpc_client_ext.h\"\n") >> CFILE
+	printf("\n") >> CFILE
+
+	printf("#include \"db_config.h\"\n") >> TFILE
+	printf("\n") >> TFILE
+	printf("#include \"db_int.h\"\n") >> TFILE
+	printf("#include \"dbinc/txn.h\"\n") >> TFILE
+	printf("\n") >> TFILE
+
+	printf("#include \"db_config.h\"\n") >> SFILE
+	printf("\n") >> SFILE
+	printf("#include \"db_int.h\"\n") >> SFILE
+	printf("#ifndef NO_SYSTEM_INCLUDES\n") >> SFILE
+	printf("#include \n") >> SFILE
+	printf("#endif\n") >> SFILE
+	printf("#include \"db_server.h\"\n") >> SFILE
+	printf("#include \"dbinc/db_server_int.h\"\n") >> SFILE
+	printf("#include \"dbinc_auto/rpc_server_ext.h\"\n") >> SFILE
+	printf("\n") >> SFILE
+
+	printf("#include \"db_config.h\"\n") >> PFILE
+	printf("\n") >> PFILE
+	printf("#include \"db_int.h\"\n") >> PFILE
+	printf("#ifndef NO_SYSTEM_INCLUDES\n") >> PFILE
+	printf("#include \n") >> PFILE
+	printf("#endif\n") >> PFILE
+	printf("#include \"db_server.h\"\n") >> PFILE
+	printf("#include \"dbinc/db_server_int.h\"\n") >> PFILE
+	printf("\n") >> PFILE
+}
+
+#
+# illegal_functions --
+#	Output general illegal-call functions
+function illegal_functions(OUTPUT)
+{
+	printf("static int __dbcl_dbp_illegal __P((DB *));\n") >> OUTPUT
+	printf("static int __dbcl_noserver __P((DB_ENV *));\n") >> OUTPUT
+	printf("static int __dbcl_txn_illegal __P((DB_TXN *));\n") >> OUTPUT
+	printf("\n") >> OUTPUT
+
+	printf("static int\n") >> OUTPUT
+	printf("__dbcl_noserver(dbenv)\n") >> OUTPUT
+	printf("\tDB_ENV *dbenv;\n") >> OUTPUT
+	printf("{\n\t__db_errx(dbenv,") >> OUTPUT
+	printf(" \"No Berkeley DB RPC server environment\");\n") >> OUTPUT
+	printf("\treturn (DB_NOSERVER);\n") >> OUTPUT
+	printf("}\n\n") >> OUTPUT
+
+	printf("/*\n") >> OUTPUT
+	printf(" * __dbcl_dbenv_illegal --\n") >> OUTPUT
+	printf(" *	DB_ENV method not supported under RPC.\n") >> OUTPUT
+	printf(" *\n") >> OUTPUT
+	printf(" * PUBLIC: int __dbcl_dbenv_illegal __P((DB_ENV *));\n")\
+	    >> OUTPUT
+	printf(" */\n") >> OUTPUT
+	printf("int\n") >> OUTPUT
+	printf("__dbcl_dbenv_illegal(dbenv)\n") >> OUTPUT
+	printf("\tDB_ENV *dbenv;\n") >> OUTPUT
+	printf("{\n\t__db_errx(dbenv,") >> OUTPUT
+	printf("\n\t    \"Interface not supported by ") >> OUTPUT
+	printf("Berkeley DB RPC client environments\");\n") >> OUTPUT
+	printf("\treturn (DB_OPNOTSUP);\n") >> OUTPUT
+	printf("}\n\n") >> OUTPUT
+	printf("/*\n") >> OUTPUT
+	printf(" * __dbcl_dbp_illegal --\n") >> OUTPUT
+	printf(" *	DB method not supported under RPC.\n") >> OUTPUT
+	printf(" */\n") >> OUTPUT
+	printf("static int\n") >> OUTPUT
+	printf("__dbcl_dbp_illegal(dbp)\n") >> OUTPUT
+	printf("\tDB *dbp;\n") >> OUTPUT
+	printf("{\n\treturn (__dbcl_dbenv_illegal(dbp->dbenv));\n") >> OUTPUT
+	printf("}\n\n") >> OUTPUT
+	printf("/*\n") >> OUTPUT
+	printf(" * __dbcl_txn_illegal --\n") >> OUTPUT
+	printf(" *	DB_TXN method not supported under RPC.\n") >> OUTPUT
+	printf(" */\n") >> OUTPUT
+	printf("static int\n__dbcl_txn_illegal(txn)\n") >> OUTPUT
+	printf("\tDB_TXN *txn;\n") >> OUTPUT
+	printf("{\n\treturn (__dbcl_dbenv_illegal(txn->mgrp->dbenv));\n")\
+	    >> OUTPUT
+	printf("}\n\n") >> OUTPUT
+}
+
+function obj_func(v, l)
+{
+	# Ignore db_create -- there's got to be something cleaner, but I
+	# don't want to rewrite rpc.src right now.
+	if (name == "db_create")
+		return;
+	if (name == "env_create")
+		return;
+
+	# Strip off the leading prefix for the method name -- there's got to
+	# be something cleaner, but I don't want to rewrite rpc.src right now.
+	len = length(name);
+	i = index(name, "_");
+	l[obj_indx] = sprintf("\t%s->%s = __dbcl_%s;",
+	    v, substr(name, i + 1, len - i), name);
+}
+
+function obj_illegal(l, handle, method, proto)
+{
+	# All of the functions return an int, with one exception.  Hack
+	# to make that work.
+	type = method == "db_get_mpf" ? "DB_MPOOLFILE *" : "int"
+
+	# Strip off the leading prefix for the method name -- there's got to
+	# be something cleaner, but I don't want to rewrite rpc.src right now.
+	len = length(method);
+	i = index(method, "_");
+
+	l[obj_indx] =\
+	    sprintf("\t%s->%s =\n\t    (%s (*)(",\
+	    handle, substr(method, i + 1, len - i), type)\
+	    proto\
+	    sprintf("))\n\t    __dbcl_%s_illegal;", handle);
+}
+
+function obj_init(obj, v, list, OUTPUT) {
+	printf("/*\n") >> OUTPUT
+	printf(" * __dbcl_%s_init --\n", v) >> OUTPUT
+	printf(" *\tInitialize %s handle methods.\n", obj) >> OUTPUT
+	printf(" *\n") >> OUTPUT
+	printf(\
+	    " * PUBLIC: void __dbcl_%s_init __P((%s *));\n", v, obj) >> OUTPUT
+	printf(" */\n") >> OUTPUT
+	printf("void\n") >> OUTPUT
+	printf("__dbcl_%s_init(%s)\n", v, v) >> OUTPUT
+	printf("\t%s *%s;\n", obj, v) >> OUTPUT
+	printf("{\n") >> OUTPUT
+	for (i = 1; i < obj_indx; ++i) {
+		if (i in list)
+			print list[i] >> OUTPUT
+	}
+	printf("\treturn;\n}\n\n") >> OUTPUT
+}
+
 #
 # split_lines --
 #	Add line separators to pretty-print the output.
diff --git a/db/dist/ltmain.sh b/db/dist/ltmain.sh
index c96a96ddd..06823e057 100644
--- a/db/dist/ltmain.sh
+++ b/db/dist/ltmain.sh
@@ -1,7 +1,7 @@
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun configure.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
 # Free Software Foundation, Inc.
 # Originally by Gordon Matzigkeit , 1996
 #
@@ -17,7 +17,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -43,8 +43,8 @@ EXIT_FAILURE=1
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION=1.5.8
-TIMESTAMP=" (1.1220.2.117 2004/08/04 14:12:05)"
+VERSION=1.5.22
+TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
 
 # See if we are running on zsh, and set the options which allow our
 # commands through without removal of \ escapes.
@@ -88,14 +88,15 @@ rm="rm -f"
 Xsed="${SED}"' -e 1s/^X//'
 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
 # test EBCDIC or ASCII
-case `echo A|tr A '\301'` in
- A) # EBCDIC based system
-  SP2NL="tr '\100' '\n'"
-  NL2SP="tr '\r\n' '\100\100'"
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  SP2NL='tr \040 \012'
+  NL2SP='tr \015\012 \040\040'
   ;;
- *) # Assume ASCII based system
-  SP2NL="tr '\040' '\012'"
-  NL2SP="tr '\015\012' '\040\040'"
+ *) # EBCDIC based system
+  SP2NL='tr \100 \n'
+  NL2SP='tr \r\n \100\100'
   ;;
 esac
 
@@ -112,8 +113,9 @@ if test "${LANG+set}" = set; then
 fi
 
 # Make sure IFS has a sensible default
-: ${IFS=" 	
-"}
+lt_nl='
+'
+IFS=" 	$lt_nl"
 
 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
   $echo "$modename: not configured to build any kind of library" 1>&2
@@ -130,6 +132,8 @@ run=
 show="$echo"
 show_help=
 execute_dlfiles=
+duplicate_deps=no
+preserve_args=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
 
@@ -137,13 +141,51 @@ o2lo="s/\\.${objext}\$/.lo/"
 # Shell function definitions:
 # This seems to be the best place for them
 
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+	# Failing that, at least try and use $RANDOM to avoid a race
+	my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+	save_mktempdir_umask=`umask`
+	umask 0077
+	$mkdir "$my_tmpdir"
+	umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || {
+        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
+	exit $EXIT_FAILURE
+      }
+    fi
+
+    $echo "X$my_tmpdir" | $Xsed
+}
+
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
 # Need a lot of goo to handle *both* DLLs and import libs
 # Has to be a shell function in order to 'eat' the argument
 # that is supplied when $file_magic_command is called.
-func_win32_libid () {
+func_win32_libid ()
+{
   win32_libid_type="unknown"
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
@@ -154,12 +196,11 @@ func_win32_libid () {
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
       $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
       win32_nmres=`eval $NM -f posix -A $1 | \
-	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
-      if test "X$win32_nmres" = "Ximport" ; then
-        win32_libid_type="x86 archive import"
-      else
-        win32_libid_type="x86 archive static"
-      fi
+	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
     fi
     ;;
   *DLL*)
@@ -183,7 +224,8 @@ func_win32_libid () {
 # Only attempt this if the compiler in the base compile
 # command doesn't match the default compiler.
 # arg is usually of the form 'gcc ...'
-func_infer_tag () {
+func_infer_tag ()
+{
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -242,8 +284,25 @@ func_infer_tag () {
 }
 
 
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+
+    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+      exit $EXIT_FAILURE
+    fi
+}
+
 # func_extract_archives gentop oldlib ...
-func_extract_archives () {
+func_extract_archives ()
+{
     my_gentop="$1"; shift
     my_oldlibs=${1+"$@"}
     my_oldobjs=""
@@ -274,9 +333,9 @@ func_extract_archives () {
       $run ${rm}r "$my_xdir"
       $show "$mkdir $my_xdir"
       $run $mkdir "$my_xdir"
-      status=$?
-      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
-	exit $status
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
+	exit $exit_status
       fi
       case $host in
       *-darwin*)
@@ -287,7 +346,7 @@ func_extract_archives () {
 	  cd $my_xdir || exit $?
 	  darwin_archive=$my_xabs
 	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename $darwin_archive`
+	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
 	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
 	  if test -n "$darwin_arches"; then 
 	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
@@ -296,64 +355,33 @@ func_extract_archives () {
 	    for darwin_arch in  $darwin_arches ; do
 	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
 	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      # Remove the table of contents from the thin files.
-	      $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
-	      $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
 	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $AR -xo "${darwin_base_archive}"
-	      rm "${darwin_base_archive}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
 	      cd "$darwin_curdir"
+	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
 	    done # $darwin_arches
       ## Okay now we have a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
 	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
 	      lipo -create -output "$darwin_file" $darwin_files
 	    done # $darwin_filelist
-	    rm -rf unfat-$$
+	    ${rm}r unfat-$$
 	    cd "$darwin_orig_dir"
 	  else
-	    cd $darwin_orig_dir
-	    (cd $my_xdir && $AR x $my_xabs) || exit $?
+	    cd "$darwin_orig_dir"
+ 	    func_extract_an_archive "$my_xdir" "$my_xabs"
 	  fi # $darwin_arches
 	fi # $run
-      ;;
-      *)
-	# We will extract separately just the conflicting names and we will
-	# no longer touch any unique names. It is faster to leave these
-	# extract automatically by $AR in one run.
-	$show "(cd $my_xdir && $AR x $my_xabs)"
-	$run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
-	if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
-	  :
-	else
-	  $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-	  $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-	  $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
-	  do
-	    i=1
-	    while test "$i" -le "$count"
-	    do
-	      # Put our $i before any first dot (extension)
-	      # Never overwrite any file
-	      name_to="$name"
-	      while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
-	      do
-		name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-	      done
-	      $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
-	      $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
-	      i=`expr $i + 1`
-	    done
-	  done
-	fi
 	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+        ;;
       esac
       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
     done
-
     func_extract_archives_result="$my_oldobjs"
 }
 # End of Shell function definitions
@@ -362,6 +390,8 @@ func_extract_archives () {
 # Darwin sucks
 eval std_shrext=\"$shrext_cmds\"
 
+disable_libs=no
+
 # Parse our command line options once, thoroughly.
 while test "$#" -gt 0
 do
@@ -426,10 +456,10 @@ do
   --version)
     $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
     $echo
-    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
+    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
     $echo "This is free software; see the source for copying conditions.  There is NO"
     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --config)
@@ -438,7 +468,7 @@ do
     for tagname in $taglist; do
       ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
     done
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --debug)
@@ -463,7 +493,7 @@ do
     else
       $echo "disable static libraries"
     fi
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --finish) mode="finish" ;;
@@ -478,7 +508,11 @@ do
     preserve_args="$preserve_args $arg"
     ;;
 
-  --tag) prevopt="--tag" prev=tag ;;
+  --tag)
+    prevopt="--tag"
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
   --tag=*)
     set tag "$optarg" ${1+"$@"}
     shift
@@ -510,6 +544,18 @@ if test -n "$prevopt"; then
   exit $EXIT_FAILURE
 fi
 
+case $disable_libs in
+no) 
+  ;;
+shared)
+  build_libtool_libs=no
+  build_old_libs=yes
+  ;;
+static)
+  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+  ;;
+esac
+
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
 # left over by shells.
@@ -520,7 +566,7 @@ if test -z "$show_help"; then
   # Infer the operation mode.
   if test -z "$mode"; then
     $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
-    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
     case $nonopt in
     *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
       mode=link
@@ -586,7 +632,7 @@ if test -z "$show_help"; then
 
     for arg
     do
-      case "$arg_mode" in
+      case $arg_mode in
       arg  )
 	# do not "continue".  Instead, add this to base_compile
 	lastarg="$arg"
@@ -668,7 +714,10 @@ if test -z "$show_help"; then
       case $lastarg in
       # Double-quote args containing other shell metacharacters.
       # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
+      # at all, so we specify them separately.
       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 	lastarg="\"$lastarg\""
 	;;
@@ -742,6 +791,14 @@ if test -z "$show_help"; then
       esac
     done
 
+    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+    case $qlibobj in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qlibobj="\"$qlibobj\"" ;;
+    esac
+    test "X$libobj" != "X$qlibobj" \
+	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
+	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
     if test "X$xdir" = "X$obj"; then
@@ -814,12 +871,17 @@ compiler."
 	$run $rm $removelist
 	exit $EXIT_FAILURE
       fi
-      $echo $srcfile > "$lockfile"
+      $echo "$srcfile" > "$lockfile"
     fi
 
     if test -n "$fix_srcfile_path"; then
       eval srcfile=\"$fix_srcfile_path\"
     fi
+    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+    case $qsrcfile in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+      qsrcfile="\"$qsrcfile\"" ;;
+    esac
 
     $run $rm "$libobj" "${libobj}T"
 
@@ -841,18 +903,18 @@ EOF
       fbsd_hideous_sh_bug=$base_compile
 
       if test "$pic_mode" != no; then
-	command="$base_compile $srcfile $pic_flag"
+	command="$base_compile $qsrcfile $pic_flag"
       else
 	# Don't build PIC code
-	command="$base_compile $srcfile"
+	command="$base_compile $qsrcfile"
       fi
 
       if test ! -d "${xdir}$objdir"; then
 	$show "$mkdir ${xdir}$objdir"
 	$run $mkdir ${xdir}$objdir
-	status=$?
-	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
-	  exit $status
+	exit_status=$?
+	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
+	  exit $exit_status
 	fi
       fi
 
@@ -924,9 +986,9 @@ EOF
     if test "$build_old_libs" = yes; then
       if test "$pic_mode" != yes; then
 	# Don't build PIC code
-	command="$base_compile $srcfile"
+	command="$base_compile $qsrcfile"
       else
-	command="$base_compile $srcfile $pic_flag"
+	command="$base_compile $qsrcfile $pic_flag"
       fi
       if test "$compiler_c_o" = yes; then
 	command="$command -o $obj"
@@ -1055,6 +1117,7 @@ EOF
     no_install=no
     objs=
     non_pic_objects=
+    notinst_path= # paths that contain not-installed libtool libraries
     precious_files_regex=
     prefer_static_libs=no
     preload=no
@@ -1083,14 +1146,15 @@ EOF
 	  if test -n "$link_static_flag"; then
 	    dlopen_self=$dlopen_self_static
 	  fi
+	  prefer_static_libs=yes
 	else
 	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
 	    dlopen_self=$dlopen_self_static
 	  fi
+	  prefer_static_libs=built
 	fi
 	build_libtool_libs=no
 	build_old_libs=yes
-	prefer_static_libs=yes
 	break
 	;;
       esac
@@ -1265,6 +1329,11 @@ EOF
 		  if test -z "$pic_object" || test "$pic_object" = none ; then
 		    arg="$non_pic_object"
 		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object="$pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
 		fi
 	      else
 		# Only an error if not doing a dry-run.
@@ -1348,6 +1417,13 @@ EOF
 	  prev=
 	  continue
 	  ;;
+	darwin_framework|darwin_framework_skip)
+	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  prev=
+	  continue
+	  ;;
 	*)
 	  eval "$prev=\"\$arg\""
 	  prev=
@@ -1406,6 +1482,18 @@ EOF
 	continue
 	;;
 
+      -framework|-arch|-isysroot)
+	case " $CC " in
+	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
+		prev=darwin_framework_skip ;;
+	  *) compiler_flags="$compiler_flags $arg"
+	     prev=darwin_framework ;;
+	esac
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+	continue
+	;;
+
       -inst-prefix-dir)
 	prev=inst_prefix
 	continue
@@ -1432,7 +1520,8 @@ EOF
 	  absdir=`cd "$dir" && pwd`
 	  if test -z "$absdir"; then
 	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-	    exit $EXIT_FAILURE
+	    absdir="$dir"
+	    notinst_path="$notinst_path $dir"
 	  fi
 	  dir="$absdir"
 	  ;;
@@ -1446,10 +1535,15 @@ EOF
 	esac
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$dir:"*) ;;
 	  *) dllsearchpath="$dllsearchpath:$dir";;
 	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
 	  ;;
 	esac
 	continue
@@ -1458,15 +1552,15 @@ EOF
       -l*)
 	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 	  case $host in
-	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
 	    # These systems don't actually have a C or math library (as such)
 	    continue
 	    ;;
-	  *-*-mingw* | *-*-os2*)
+	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
 	    test "X$arg" = "X-lc" && continue
 	    ;;
-	  *-*-openbsd* | *-*-freebsd*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	    # Do not include libc due to us having libc/libc_r.
 	    test "X$arg" = "X-lc" && continue
 	    ;;
@@ -1474,10 +1568,19 @@ EOF
 	    # Rhapsody C and math libraries are in the System framework
 	    deplibs="$deplibs -framework System"
 	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test "X$arg" = "X-lc" && continue
+	    ;;
 	  esac
 	elif test "X$arg" = "X-lc_r"; then
 	 case $host in
-	 *-*-openbsd* | *-*-freebsd*)
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	   # Do not include libc_r directly, use -pthread flag.
 	   continue
 	   ;;
@@ -1487,8 +1590,20 @@ EOF
 	continue
 	;;
 
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      -model)
+	compile_command="$compile_command $arg"
+	compiler_flags="$compiler_flags $arg"
+	finalize_command="$finalize_command $arg"
+	prev=xcompiler
+	continue
+	;;
+
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-	deplibs="$deplibs $arg"
+	compiler_flags="$compiler_flags $arg"
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
 	continue
 	;;
 
@@ -1497,13 +1612,19 @@ EOF
 	continue
 	;;
 
-      # gcc -m* arguments should be passed to the linker via $compiler_flags
-      # in order to pass architecture information to the linker
-      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
-      # but this is not reliable with gcc because gcc may use -mfoo to
-      # select a different linker, different libraries, etc, while
-      # -Wl,-mfoo simply passes -mfoo to the linker.
-      -m*)
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m* pass through architecture-specific compiler args for GCC
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -pg pass through profiling flag for GCC
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
+      -t[45]*|-txscale*|@*)
+
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
 	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
@@ -1514,34 +1635,10 @@ EOF
 	esac
         compile_command="$compile_command $arg"
         finalize_command="$finalize_command $arg"
-        if test "$with_gcc" = "yes" ; then
-          compiler_flags="$compiler_flags $arg"
-        fi
+        compiler_flags="$compiler_flags $arg"
         continue
         ;;
 
-      ################################################################
-      #### Local edit for Sleepycat SR #8705
-      #### This case was given to us by Albert Chin, and we expect
-      #### this to be included in future versions of libtool,
-      #### though we must verify that before upgrading.
-      ################################################################
-      # Flags for IRIX and Solaris compiler
-      -64|-mips[0-9]|-xarch=*)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
-	compiler_flags="$compiler_flags $arg"
-	continue
-	;;
-
       -shrext)
 	prev=shrext
 	continue
@@ -1776,6 +1873,11 @@ EOF
 	    if test -z "$pic_object" || test "$pic_object" = none ; then
 	      arg="$non_pic_object"
 	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object="$pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
 	  fi
 	else
 	  # Only an error if not doing a dry-run.
@@ -1881,9 +1983,9 @@ EOF
     if test ! -d "$output_objdir"; then
       $show "$mkdir $output_objdir"
       $run $mkdir $output_objdir
-      status=$?
-      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
-	exit $status
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
+	exit $exit_status
       fi
     fi
 
@@ -1946,7 +2048,6 @@ EOF
     newlib_search_path=
     need_relink=no # whether we're linking any uninstalled libtool libraries
     notinst_deplibs= # not-installed libtool libraries
-    notinst_path= # paths that contain not-installed libtool libraries
     case $linkmode in
     lib)
 	passes="conv link"
@@ -1998,7 +2099,7 @@ EOF
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
-	    deplibs="$deplib $deplibs"
+	    compiler_flags="$compiler_flags $deplib"
 	  fi
 	  continue
 	  ;;
@@ -2007,10 +2108,6 @@ EOF
 	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
 	    continue
 	  fi
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
 	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
 	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
 	    for search_ext in .la $std_shrext .so .a; do
@@ -2186,7 +2283,7 @@ EOF
 	esac # case $deplib
 	if test "$found" = yes || test -f "$lib"; then :
 	else
-	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
 	  exit $EXIT_FAILURE
 	fi
 
@@ -2210,6 +2307,8 @@ EOF
 	# it will not redefine variables installed, or shouldnotlink
 	installed=yes
 	shouldnotlink=no
+	avoidtemprpath=
+
 
 	# Read the .la file
 	case $lib in
@@ -2308,6 +2407,7 @@ EOF
 	    dir="$libdir"
 	    absdir="$libdir"
 	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
 	else
 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 	    dir="$ladir"
@@ -2392,12 +2492,12 @@ EOF
 	  if test -n "$library_names" &&
 	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
 	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var"; then
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
 	      # Make sure the rpath contains only unique directories.
 	      case "$temp_rpath " in
 	      *" $dir "*) ;;
 	      *" $absdir "*) ;;
-	      *) temp_rpath="$temp_rpath $dir" ;;
+	      *) temp_rpath="$temp_rpath $absdir" ;;
 	      esac
 	    fi
 
@@ -2434,8 +2534,12 @@ EOF
 	fi
 
 	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test "$use_static_libs" = built && test "$installed" = yes ; then
+	  use_static_libs=no
+	fi
 	if test -n "$library_names" &&
-	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
 	  if test "$installed" = no; then
 	    notinst_deplibs="$notinst_deplibs $lib"
 	    need_relink=yes
@@ -2548,11 +2652,15 @@ EOF
 	      if test "$hardcode_direct" = no; then
 		add="$dir/$linklib"
 		case $host in
-		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir="-L$dir" ;;
 		  *-*-darwin* )
 		    # if the lib is a module then we can not link against
 		    # it, someone is ignoring the new warnings I added
-		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
+		    if /usr/bin/file -L $add 2> /dev/null |
+                      $EGREP ": [^:]* bundle" >/dev/null ; then
 		      $echo "** Warning, lib $linklib is a module, not a shared library"
 		      if test -z "$old_library" ; then
 		        $echo
@@ -2583,7 +2691,7 @@ EOF
 		add_dir="-L$dir"
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
-		  case "$libdir" in
+		  case $libdir in
 		    [\\/]*)
 		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
 		      ;;
@@ -2656,7 +2764,7 @@ EOF
 	      add_dir="-L$libdir"
 	      # Try looking first in the location we're being installed to.
 	      if test -n "$inst_prefix_dir"; then
-		case "$libdir" in
+		case $libdir in
 		  [\\/]*)
 		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
 		    ;;
@@ -2717,8 +2825,6 @@ EOF
 	      fi
 	    fi
 	  else
-	    convenience="$convenience $dir/$old_library"
-	    old_convenience="$old_convenience $dir/$old_library"
 	    deplibs="$dir/$old_library $deplibs"
 	    link_static=yes
 	  fi
@@ -2836,12 +2942,12 @@ EOF
 	      *) continue ;;
 	      esac
 	      case " $deplibs " in
-	      *" $depdepl "*) ;;
-	      *) deplibs="$depdepl $deplibs" ;;
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
 	      esac
 	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$deplibs $path" ;;
+	      *" $depdepl "*) ;;
+	      *) deplibs="$depdepl $deplibs" ;;
 	      esac
 	    done
 	  fi # link_all_deplibs != no
@@ -3106,27 +3212,27 @@ EOF
 
 	# Check that each of the things are valid numbers.
 	case $current in
-	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 	  exit $EXIT_FAILURE
 	  ;;
 	esac
 
 	case $revision in
-	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 	  exit $EXIT_FAILURE
 	  ;;
 	esac
 
 	case $age in
-	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 	  exit $EXIT_FAILURE
 	  ;;
@@ -3305,9 +3411,9 @@ EOF
 
       # Eliminate all temporary directories.
       for path in $notinst_path; do
-	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
-	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
-	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
       done
 
       if test -n "$xrpath"; then
@@ -3358,9 +3464,14 @@ EOF
 	  *-*-netbsd*)
 	    # Don't link with libc until the a.out ld.so is fixed.
 	    ;;
-	  *-*-openbsd* | *-*-freebsd*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
 	    ;;
  	  *)
 	    # Add libc to deplibs on all other systems if necessary.
@@ -3404,11 +3515,11 @@ EOF
 	  int main() { return 0; }
 EOF
 	  $rm conftest
-	  $LTCC -o conftest conftest.c $deplibs
+	  $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
 	  if test "$?" -eq 0 ; then
 	    ldd_output=`ldd conftest`
 	    for i in $deplibs; do
-	      name="`expr $i : '-l\(.*\)'`"
+	      name=`expr $i : '-l\(.*\)'`
 	      # If $name is empty we are operating on a -L argument.
               if test "$name" != "" && test "$name" -ne "0"; then
 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
@@ -3445,11 +3556,11 @@ EOF
 	    # Error occurred in the first compile.  Let's try to salvage
 	    # the situation: Compile a separate program for each library.
 	    for i in $deplibs; do
-	      name="`expr $i : '-l\(.*\)'`"
+	      name=`expr $i : '-l\(.*\)'`
 	      # If $name is empty we are operating on a -L argument.
               if test "$name" != "" && test "$name" != "0"; then
 		$rm conftest
-		$LTCC -o conftest conftest.c $i
+		$LTCC $LTCFLAGS -o conftest conftest.c $i
 		# Did it work?
 		if test "$?" -eq 0 ; then
 		  ldd_output=`ldd conftest`
@@ -3497,7 +3608,7 @@ EOF
 	  set dummy $deplibs_check_method
 	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
 	  for a_deplib in $deplibs; do
-	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    name=`expr $a_deplib : '-l\(.*\)'`
 	    # If $name is empty we are operating on a -L argument.
             if test "$name" != "" && test  "$name" != "0"; then
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
@@ -3566,7 +3677,7 @@ EOF
 	  set dummy $deplibs_check_method
 	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
 	  for a_deplib in $deplibs; do
-	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    name=`expr $a_deplib : '-l\(.*\)'`
 	    # If $name is empty we are operating on a -L argument.
 	    if test -n "$name" && test "$name" != "0"; then
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
@@ -3696,6 +3807,35 @@ EOF
 	deplibs=$newdeplibs
       fi
 
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      deplibs="$new_libs"
+
+
       # All the library-specific variables (install_libdir is set above).
       library_names=
       old_library=
@@ -3779,6 +3919,7 @@ EOF
 	fi
 
 	lib="$output_objdir/$realname"
+	linknames=
 	for link
 	do
 	  linknames="$linknames $link"
@@ -3807,6 +3948,9 @@ EOF
 	        # The command line is too long to execute in one step.
 	        $show "using reloadable object file for export list..."
 	        skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
 	      fi
 	    done
 	    IFS="$save_ifs"
@@ -3876,7 +4020,8 @@ EOF
 	  fi
 	fi
 
-	if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
+	if test "X$skipped_export" != "X:" &&
+	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 	  :
 	else
@@ -3895,6 +4040,7 @@ EOF
 	    save_libobjs=$libobjs
 	  fi
 	  save_output=$output
+	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
 
 	  # Clear the reloadable object creation command queue and
 	  # initialize k to one.
@@ -3904,13 +4050,13 @@ EOF
 	  delfiles=
 	  last_robj=
 	  k=1
-	  output=$output_objdir/$save_output-${k}.$objext
+	  output=$output_objdir/$output_la-${k}.$objext
 	  # Loop over the list of objects to be linked.
 	  for obj in $save_libobjs
 	  do
 	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
 	    if test "X$objlist" = X ||
-	       { len=`expr "X$test_cmds" : ".*"` &&
+	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 		 test "$len" -le "$max_cmd_len"; }; then
 	      objlist="$objlist $obj"
 	    else
@@ -3924,9 +4070,9 @@ EOF
 		# the last one created.
 		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
 	      fi
-	      last_robj=$output_objdir/$save_output-${k}.$objext
+	      last_robj=$output_objdir/$output_la-${k}.$objext
 	      k=`expr $k + 1`
-	      output=$output_objdir/$save_output-${k}.$objext
+	      output=$output_objdir/$output_la-${k}.$objext
 	      objlist=$obj
 	      len=1
 	    fi
@@ -3946,13 +4092,13 @@ EOF
 	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
           fi
 
-	  # Set up a command to remove the reloadale object files
+	  # Set up a command to remove the reloadable object files
 	  # after they are used.
 	  i=0
 	  while test "$i" -lt "$k"
 	  do
 	    i=`expr $i + 1`
-	    delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
 	  done
 
 	  $echo "creating a temporary reloadable object file: $output"
@@ -4000,13 +4146,30 @@ EOF
 	  IFS="$save_ifs"
 	  eval cmd=\"$cmd\"
 	  $show "$cmd"
-	  $run eval "$cmd" || exit $?
+	  $run eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test "$mode" = relink; then
+	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	    fi
+
+	    exit $lt_exit
+	  }
 	done
 	IFS="$save_ifs"
 
 	# Restore the uninstalled library and exit
 	if test "$mode" = relink; then
 	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      $show "${rm}r $gentop"
+	      $run ${rm}r "$gentop"
+	    fi
+	  fi
+
 	  exit $EXIT_SUCCESS
 	fi
 
@@ -4188,6 +4351,35 @@ EOF
         ;;
       esac
 
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      compile_deplibs="$new_libs"
+
+
       compile_command="$compile_command $compile_deplibs"
       finalize_command="$finalize_command $finalize_deplibs"
 
@@ -4232,10 +4424,15 @@ EOF
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  *) dllsearchpath="$dllsearchpath:$libdir";;
 	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
 	  ;;
 	esac
       done
@@ -4349,13 +4546,25 @@ extern \"C\" {
 
 	    # Prepare the list of exported symbols
 	    if test -z "$export_symbols"; then
-	      export_symbols="$output_objdir/$output.exp"
+	      export_symbols="$output_objdir/$outputname.exp"
 	      $run $rm $export_symbols
-	      $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+              case $host in
+              *cygwin* | *mingw* )
+	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
 	    else
-	      $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
-	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      $run eval 'mv "$nlist"T "$nlist"'
+              case $host in
+              *cygwin* | *mingw* )
+	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
 	    fi
 	  fi
 
@@ -4406,7 +4615,26 @@ extern \"C\" {
 #endif
 
 /* The mapping between symbol names and symbols. */
+"
+
+	    case $host in
+	    *cygwin* | *mingw* )
+	  $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs */
+struct {
+"
+	      ;;
+	    * )
+	  $echo >> "$output_objdir/$dlsyms" "\
 const struct {
+"
+	      ;;
+	    esac
+
+
+	  $echo >> "$output_objdir/$dlsyms" "\
   const char *name;
   lt_ptr address;
 }
@@ -4453,16 +4681,29 @@ static const void *lt_preloaded_setup() {
 	  esac
 
 	  # Now compile the dynamic symbol file.
-	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
 	  # Clean up the generated files.
 	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
 	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
 
 	  # Transform the symbol file into the correct name.
-	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+          case $host in
+          *cygwin* | *mingw* )
+            if test -f "$output_objdir/${outputname}.def" ; then
+              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+            else
+              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+             fi
+            ;;
+          * )
+            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+            ;;
+          esac
 	  ;;
 	*)
 	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
@@ -4487,7 +4728,7 @@ static const void *lt_preloaded_setup() {
 	# We have no uninstalled library dependencies, so finalize right now.
 	$show "$link_command"
 	$run eval "$link_command"
-	status=$?
+	exit_status=$?
 
 	# Delete the generated files.
 	if test -n "$dlsyms"; then
@@ -4495,7 +4736,7 @@ static const void *lt_preloaded_setup() {
 	  $run $rm "$output_objdir/${outputname}S.${objext}"
 	fi
 
-	exit $status
+	exit $exit_status
       fi
 
       if test -n "$shlibpath_var"; then
@@ -4635,10 +4876,12 @@ static const void *lt_preloaded_setup() {
 	esac
 	case $host in
 	  *cygwin* | *mingw* )
-	    cwrappersource=`$echo ${objdir}/lt-${output}.c`
-	    cwrapper=`$echo ${output}.exe`
-	    $rm $cwrappersource $cwrapper
-	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+            output_name=`basename $output`
+            output_path=`dirname $output`
+            cwrappersource="$output_path/$objdir/lt-$output_name.c"
+            cwrapper="$output_path/$output_name.exe"
+            $rm $cwrappersource $cwrapper
+            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
 	    cat > $cwrappersource <
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #if defined(PATH_MAX)
 # define LT_PATHMAX PATH_MAX
@@ -4673,15 +4919,19 @@ EOF
 #endif
 
 #ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
 #endif
 
 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
   defined (__OS2__)
-#define HAVE_DOS_BASED_FILE_SYSTEM
-#ifndef DIR_SEPARATOR_2
-#define DIR_SEPARATOR_2 '\\'
-#endif
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
 #endif
 
 #ifndef DIR_SEPARATOR_2
@@ -4691,17 +4941,32 @@ EOF
         (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
 #endif /* DIR_SEPARATOR_2 */
 
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
   if (stale) { free ((void *) stale); stale = 0; } \
 } while (0)
 
+/* -DDEBUG is fairly common in CFLAGS.  */
+#undef DEBUG
+#if defined DEBUGWRAPPER
+# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
+#else
+# define DEBUG(format, ...)
+#endif
+
 const char *program_name = NULL;
 
 void * xmalloc (size_t num);
 char * xstrdup (const char *string);
-char * basename (const char *name);
-char * fnqualify(const char *path);
+const char * base_name (const char *name);
+char * find_executable(const char *wrapper);
+int    check_executable(const char *path);
 char * strendzap(char *str, const char *pat);
 void lt_fatal (const char *message, ...);
 
@@ -4711,29 +4976,51 @@ main (int argc, char *argv[])
   char **newargz;
   int i;
 
-  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  DEBUG("(main) argv[0]      : %s\n",argv[0]);
+  DEBUG("(main) program_name : %s\n",program_name);
   newargz = XMALLOC(char *, argc+2);
 EOF
 
-	    cat >> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF"
-  newargz[1] = fnqualify(argv[0]);
+            cat >> $cwrappersource <<"EOF"
+  newargz[1] = find_executable(argv[0]);
+  if (newargz[1] == NULL)
+    lt_fatal("Couldn't find %s", argv[0]);
+  DEBUG("(main) found exe at : %s\n",newargz[1]);
   /* we know the script has the same name, without the .exe */
   /* so make sure newargz[1] doesn't end in .exe */
   strendzap(newargz[1],".exe");
   for (i = 1; i < argc; i++)
     newargz[i+1] = xstrdup(argv[i]);
   newargz[argc+1] = NULL;
+
+  for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF"
+            cat >> $cwrappersource <<"EOF"
+  return 127;
 }
 
 void *
@@ -4753,48 +5040,148 @@ xstrdup (const char *string)
 ;
 }
 
-char *
-basename (const char *name)
+const char *
+base_name (const char *name)
 {
   const char *base;
 
 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
   /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha (name[0]) && name[1] == ':')
+  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
     name += 2;
 #endif
 
   for (base = name; *name; name++)
     if (IS_DIR_SEPARATOR (*name))
       base = name + 1;
-  return (char *) base;
+  return base;
+}
+
+int
+check_executable(const char * path)
+{
+  struct stat st;
+
+  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0) &&
+      (
+        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
+#if defined (S_IXOTH)
+       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
+#endif
+#if defined (S_IXGRP)
+       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
+#endif
+       ((st.st_mode & S_IXUSR) == S_IXUSR))
+      )
+    return 1;
+  else
+    return 0;
 }
 
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise */
 char *
-fnqualify(const char *path)
+find_executable (const char* wrapper)
 {
-  size_t size;
-  char *p;
+  int has_slash = 0;
+  const char* p;
+  const char* p_next;
+  /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char* concat_name;
+
+  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
 
-  assert(path != NULL);
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
 
-  /* Is it qualified already? */
+  /* Absolute path? */
 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha (path[0]) && path[1] == ':')
-    return xstrdup (path);
+  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
+  {
+    concat_name = xstrdup (wrapper);
+    if (check_executable(concat_name))
+      return concat_name;
+    XFREE(concat_name);
+  }
+  else
+  {
+#endif
+    if (IS_DIR_SEPARATOR (wrapper[0]))
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable(concat_name))
+        return concat_name;
+      XFREE(concat_name);
+    }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  }
 #endif
-  if (IS_DIR_SEPARATOR (path[0]))
-    return xstrdup (path);
 
-  /* prepend the current directory */
-  /* doesn't handle '~' */
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+    {
+      has_slash = 1;
+      break;
+    }
+  if (!has_slash)
+  {
+    /* no slashes; search PATH */
+    const char* path = getenv ("PATH");
+    if (path != NULL)
+    {
+      for (p = path; *p; p = p_next)
+      {
+        const char* q;
+        size_t p_len;
+        for (q = p; *q; q++)
+          if (IS_PATH_SEPARATOR(*q))
+            break;
+        p_len = q - p;
+        p_next = (*q == '\0' ? q : q + 1);
+        if (p_len == 0)
+        {
+          /* empty path: current directory */
+          if (getcwd (tmp, LT_PATHMAX) == NULL)
+            lt_fatal ("getcwd failed");
+          tmp_len = strlen(tmp);
+          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, tmp, tmp_len);
+          concat_name[tmp_len] = '/';
+          strcpy (concat_name + tmp_len + 1, wrapper);
+        }
+        else
+        {
+          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, p, p_len);
+          concat_name[p_len] = '/';
+          strcpy (concat_name + p_len + 1, wrapper);
+        }
+        if (check_executable(concat_name))
+          return concat_name;
+        XFREE(concat_name);
+      }
+    }
+    /* not found in PATH; assume curdir */
+  }
+  /* Relative path | not found in path: prepend cwd */
   if (getcwd (tmp, LT_PATHMAX) == NULL)
     lt_fatal ("getcwd failed");
-  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
-  p = XMALLOC(char, size);
-  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
-  return p;
+  tmp_len = strlen(tmp);
+  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable(concat_name))
+    return concat_name;
+  XFREE(concat_name);
+  return NULL;
 }
 
 char *
@@ -4838,16 +5225,16 @@ lt_fatal (const char *message, ...)
   va_end (ap);
 }
 EOF
-	  # we should really use a build-platform specific compiler
-	  # here, but OTOH, the wrappers (shell script and this C one)
-	  # are only useful if you want to execute the "real" binary.
-	  # Since the "real" binary is built for $host, then this
-	  # wrapper might as well be built for $host, too.
-	  $run $LTCC -s -o $cwrapper $cwrappersource
-	  ;;
-	esac
-	$rm $output
-	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+          # we should really use a build-platform specific compiler
+          # here, but OTOH, the wrappers (shell script and this C one)
+          # are only useful if you want to execute the "real" binary.
+          # Since the "real" binary is built for $host, then this
+          # wrapper might as well be built for $host, too.
+          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+          ;;
+        esac
+        $rm $output
+        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
 	$echo > $output "\
 #! $SHELL
@@ -4997,13 +5384,13 @@ else
 	# Backslashes separate directories on plain windows
 	*-*-mingw | *-*-os2*)
 	  $echo >> $output "\
-      exec \$progdir\\\\\$program \${1+\"\$@\"}
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
 "
 	  ;;
 
 	*)
 	  $echo >> $output "\
-      exec \$progdir/\$program \${1+\"\$@\"}
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
 "
 	  ;;
 	esac
@@ -5013,7 +5400,7 @@ else
     fi
   else
     # The program doesn't exist.
-    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
     \$echo \"This script is just a wrapper for \$program.\" 1>&2
     $echo \"See the $PACKAGE documentation for more information.\" 1>&2
     exit $EXIT_FAILURE
@@ -5055,6 +5442,63 @@ fi\
       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
        cmds=$old_archive_from_new_cmds
       else
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  $echo "copying selected object files to avoid basename conflicts..."
+
+	  if test -z "$gentop"; then
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    exit_status=$?
+	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
+	      exit $exit_status
+	    fi
+	  fi
+
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		counter=`expr $counter + 1`
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      $run ln "$obj" "$gentop/$newobj" ||
+	      $run cp "$obj" "$gentop/$newobj"
+	      oldobjs="$oldobjs $gentop/$newobj"
+	      ;;
+	    *) oldobjs="$oldobjs $obj" ;;
+	    esac
+	  done
+	fi
+
 	eval cmds=\"$old_archive_cmds\"
 
 	if len=`expr "X$cmds" : ".*"` &&
@@ -5068,20 +5512,7 @@ fi\
 	  objlist=
 	  concat_cmds=
 	  save_oldobjs=$oldobjs
-	  # GNU ar 2.10+ was changed to match POSIX; thus no paths are
-	  # encoded into archives.  This makes 'ar r' malfunction in
-	  # this piecewise linking case whenever conflicting object
-	  # names appear in distinct ar calls; check, warn and compensate.
-	    if (for obj in $save_oldobjs
-	    do
-	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	    :
-	  else
-	    $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
-	    $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
-	    AR_FLAGS=cq
-	  fi
+
 	  # Is there a better way of finding the last object in the list?
 	  for obj in $save_oldobjs
 	  do
@@ -5092,7 +5523,7 @@ fi\
 	    oldobjs="$objlist $obj"
 	    objlist="$objlist $obj"
 	    eval test_cmds=\"$old_archive_cmds\"
-	    if len=`expr "X$test_cmds" : ".*"` &&
+	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 	       test "$len" -le "$max_cmd_len"; then
 	      :
 	    else
@@ -5289,11 +5720,11 @@ relink_command=\"$relink_command\""
     # install_prog (especially on Windows NT).
     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
        # Allow the use of GNU shtool's install command.
-       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+       $echo "X$nonopt" | grep shtool > /dev/null; then
       # Aesthetically quote it.
       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 	arg="\"$arg\""
 	;;
       esac
@@ -5302,14 +5733,14 @@ relink_command=\"$relink_command\""
       shift
     else
       install_prog=
-      arg="$nonopt"
+      arg=$nonopt
     fi
 
     # The real first argument should be the name of the installation program.
     # Aesthetically quote it.
     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
     case $arg in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
       arg="\"$arg\""
       ;;
     esac
@@ -5327,28 +5758,31 @@ relink_command=\"$relink_command\""
     do
       if test -n "$dest"; then
 	files="$files $dest"
-	dest="$arg"
+	dest=$arg
 	continue
       fi
 
       case $arg in
       -d) isdir=yes ;;
-      -f) prev="-f" ;;
-      -g) prev="-g" ;;
-      -m) prev="-m" ;;
-      -o) prev="-o" ;;
+      -f) 
+      	case " $install_prog " in
+	*[\\\ /]cp\ *) ;;
+	*) prev=$arg ;;
+	esac
+	;;
+      -g | -m | -o) prev=$arg ;;
       -s)
 	stripme=" -s"
 	continue
 	;;
-      -*) ;;
-
+      -*)
+	;;
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
 	  prev=
 	else
-	  dest="$arg"
+	  dest=$arg
 	  continue
 	fi
 	;;
@@ -5357,7 +5791,7 @@ relink_command=\"$relink_command\""
       # Aesthetically quote the argument.
       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 	arg="\"$arg\""
 	;;
       esac
@@ -5526,11 +5960,14 @@ relink_command=\"$relink_command\""
 
 	  if test "$#" -gt 0; then
 	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
 	    for linkname
 	    do
 	      if test "$linkname" != "$realname"; then
-		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
-		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
 	      fi
 	    done
 	  fi
@@ -5543,7 +5980,16 @@ relink_command=\"$relink_command\""
 	    IFS="$save_ifs"
 	    eval cmd=\"$cmd\"
 	    $show "$cmd"
-	    $run eval "$cmd" || exit $?
+	    $run eval "$cmd" || {
+	      lt_exit=$?
+
+	      # Restore the uninstalled library and exit
+	      if test "$mode" = relink; then
+		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	      fi
+
+	      exit $lt_exit
+	    }
 	  done
 	  IFS="$save_ifs"
 	fi
@@ -5637,17 +6083,15 @@ relink_command=\"$relink_command\""
 	  notinst_deplibs=
 	  relink_command=
 
-	  # To insure that "foo" is sourced, and not "foo.exe",
-	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
-	  # which disallows the automatic-append-.exe behavior.
-	  case $build in
-	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
-	  *) wrapperdot=${wrapper} ;;
-	  esac
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
 	  # If there is no directory component, then add one.
-	  case $file in
-	  */* | *\\*) . ${wrapperdot} ;;
-	  *) . ./${wrapperdot} ;;
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
 	  esac
 
 	  # Check the variables that should have been set.
@@ -5675,34 +6119,21 @@ relink_command=\"$relink_command\""
 	  done
 
 	  relink_command=
-	  # To insure that "foo" is sourced, and not "foo.exe",
-	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
-	  # which disallows the automatic-append-.exe behavior.
-	  case $build in
-	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
-	  *) wrapperdot=${wrapper} ;;
-	  esac
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
 	  # If there is no directory component, then add one.
-	  case $file in
-	  */* | *\\*) . ${wrapperdot} ;;
-	  *) . ./${wrapperdot} ;;
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
 	  esac
 
 	  outputname=
 	  if test "$fast_install" = no && test -n "$relink_command"; then
 	    if test "$finalize" = yes && test -z "$run"; then
-	      tmpdir="/tmp"
-	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
-	      tmpdir="$tmpdir/libtool-$$"
-	      save_umask=`umask`
-	      umask 0077
-	      if $mkdir "$tmpdir"; then
-	        umask $save_umask
-	      else
-	        umask $save_umask
-		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
-		continue
-	      fi
+	      tmpdir=`func_mktempdir`
 	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
 	      outputname="$tmpdir/$file"
 	      # Replace the output file specification.
@@ -5726,7 +6157,7 @@ relink_command=\"$relink_command\""
 	fi
 
 	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyways
+	# one anyway 
 	case $install_prog,$host in
 	*/usr/bin/install*,*cygwin*)
 	  case $file:$destfile in
@@ -5826,7 +6257,7 @@ relink_command=\"$relink_command\""
     # Exit here if they wanted silent mode.
     test "$show" = : && exit $EXIT_SUCCESS
 
-    $echo "----------------------------------------------------------------------"
+    $echo "X----------------------------------------------------------------------" | $Xsed
     $echo "Libraries have been installed in:"
     for libdir in $libdirs; do
       $echo "   $libdir"
@@ -5859,7 +6290,7 @@ relink_command=\"$relink_command\""
     $echo
     $echo "See any operating system documentation about shared libraries for"
     $echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    $echo "----------------------------------------------------------------------"
+    $echo "X----------------------------------------------------------------------" | $Xsed
     exit $EXIT_SUCCESS
     ;;
 
@@ -6076,9 +6507,17 @@ relink_command=\"$relink_command\""
 	    rmfiles="$rmfiles $objdir/$n"
 	  done
 	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
-	  if test "$mode" = uninstall; then
+	  case "$mode" in
+	  clean)
+	    case "  $library_names " in
+	    # "  " in the beginning catches empty $dlname
+	    *" $dlname "*) ;;
+	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    esac
+	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    ;;
+	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
 	      cmds=$postuninstall_cmds
@@ -6111,7 +6550,8 @@ relink_command=\"$relink_command\""
 	      IFS="$save_ifs"
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
-	  fi
+	    ;;
+	  esac
 	fi
 	;;
 
@@ -6396,7 +6836,7 @@ esac
 $echo
 $echo "Try \`$modename --help' for more information about other modes."
 
-exit $EXIT_SUCCESS
+exit $?
 
 # The TAGs below are defined such that we never get into a situation
 # in which we disable both kinds of libraries.  Given conflicting
@@ -6410,12 +6850,11 @@ exit $EXIT_SUCCESS
 # configuration.  But we'll never go from static-only to shared-only.
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
+disable_libs=shared
 # ### END LIBTOOL TAG CONFIG: disable-shared
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+disable_libs=static
 # ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables:
diff --git a/db/dist/pubdef.in b/db/dist/pubdef.in
index 7f6ad2ebd..67b222499 100644
--- a/db/dist/pubdef.in
+++ b/db/dist/pubdef.in
@@ -1,386 +1,437 @@
+# $Id: pubdef.in,v 12.35 2006/09/13 14:53:38 mjc Exp $
+#
 # Name
 # D == documentation
 # I == include file
 # J == Java constant
 # N == wrapped by the Java native layer
-DB_AFTER		D I J
-DB_AGGRESSIVE		D I J
-DB_ALREADY_ABORTED	* I *
-DB_AM_CHKSUM		* I *
-DB_AM_CL_WRITER		* I *
-DB_AM_COMPENSATE	* I *
-DB_AM_CREATED		* I *
-DB_AM_CREATED_MSTR	* I *
-DB_AM_DBM_ERROR		* I *
-DB_AM_DELIMITER		* I *
-DB_AM_DIRTY		* I *
-DB_AM_DISCARD		* I *
-DB_AM_DUP		* I *
-DB_AM_DUPSORT		* I *
-DB_AM_ENCRYPT		* I *
-DB_AM_FIXEDLEN		* I *
-DB_AM_INMEM		* I *
-DB_AM_INORDER		* I *
-DB_AM_IN_RENAME		* I *
-DB_AM_NOT_DURABLE	* I *
-DB_AM_OPEN_CALLED	* I *
-DB_AM_PAD		* I *
-DB_AM_PGDEF		* I *
-DB_AM_RDONLY		* I *
-DB_AM_RECNUM		* I *
-DB_AM_RECOVER		* I *
-DB_AM_RENUMBER		* I *
-DB_AM_REPLICATION	* I *
-DB_AM_REVSPLITOFF	* I *
-DB_AM_SECONDARY		* I *
-DB_AM_SNAPSHOT		* I *
-DB_AM_SUBDB		* I *
-DB_AM_SWAP		* I *
-DB_AM_TXN		* I *
-DB_AM_VERIFYING		* I *
-DB_APPEND		D I J
-DB_ARCH_ABS		D I J
-DB_ARCH_DATA		D I J
-DB_ARCH_LOG		D I J
-DB_ARCH_REMOVE		D I J
-DB_AUTO_COMMIT		D I J
-DB_BEFORE		D I J
-DB_BTREE		D I J
-DB_BTREEMAGIC		* I *
-DB_BTREEOLDVER		* I *
-DB_BTREEVERSION		* I *
-DB_BUFFER_SMALL		D I N
-DB_CACHED_COUNTS	* I *
-DB_CDB_ALLDB		D I J
-DB_CHKSUM		D I J
-DB_CONFIG		D * *
-DB_CONSUME		D I J
-DB_CONSUME_WAIT		D I J
-DB_CREATE		D I J
-DB_CURRENT		D I J
-DB_CXX_NO_EXCEPTIONS	D I *
-DB_DBM_HSEARCH		* I *
-DB_DBT_APPMALLOC	D I N
-DB_DBT_DUPOK		* I *
-DB_DBT_ISSET		* I *
-DB_DBT_MALLOC		D I J
-DB_DBT_PARTIAL		D I J
-DB_DBT_REALLOC		D I N
-DB_DBT_USERMEM		D I J
-DB_DEGREE_2		D I J
-DB_DELETED		* I *
-DB_DIRECT		D I *
-DB_DIRECT_DB		D I J
-DB_DIRECT_LOG		D I J
-DB_DIRTY_READ		D I J
-DB_DONOTINDEX		D I J
-DB_DSYNC_LOG		D I J
-DB_DUP			D I J
-DB_DUPSORT		D I J
-DB_DURABLE_UNKNOWN	* I *
-DB_EID_BROADCAST	D I J
-DB_EID_INVALID		D I J
-DB_ENCRYPT		D I J
-DB_ENCRYPT_AES		D I J
-DB_ENV_AUTO_COMMIT	* I *
-DB_ENV_CDB		* I *
-DB_ENV_CDB_ALLDB	* I *
-DB_ENV_CREATE		* I *
-DB_ENV_DBLOCAL		* I *
-DB_ENV_DIRECT_DB	* I *
-DB_ENV_DIRECT_LOG	* I *
-DB_ENV_DSYNC_LOG	* I *
-DB_ENV_FATAL		* I *
-DB_ENV_LOCKDOWN		* I *
-DB_ENV_LOG_AUTOREMOVE	* I *
-DB_ENV_LOG_INMEMORY	* I *
-DB_ENV_NOLOCKING	* I *
-DB_ENV_NOMMAP		* I *
-DB_ENV_NOPANIC		* I *
-DB_ENV_OPEN_CALLED	* I *
-DB_ENV_OVERWRITE	* I *
-DB_ENV_PRIVATE		* I *
-DB_ENV_REGION_INIT	* I *
-DB_ENV_RPCCLIENT	* I *
-DB_ENV_RPCCLIENT_GIVEN	* I *
-DB_ENV_SYSTEM_MEM	* I *
-DB_ENV_THREAD		* I *
-DB_ENV_TIME_NOTGRANTED	* I *
-DB_ENV_TXN_NOSYNC	* I *
-DB_ENV_TXN_WRITE_NOSYNC	* I *
-DB_ENV_YIELDCPU		* I *
-DB_EXCL			D I J
-DB_EXTENT		* I *
-DB_FAST_STAT		D I J
-DB_FCNTL_LOCKING	* I *
-DB_FILE_ID_LEN		* I *
-DB_FIRST		D I J
-DB_FLUSH		D I J
-DB_FORCE		D I J
-DB_GET_BOTH		D I J
-DB_GET_BOTHC		* I *
-DB_GET_BOTH_RANGE	D I J
-DB_GET_RECNO		D I J
-DB_HANDLE_LOCK		* I *
-DB_HASH			D I J
-DB_HASHMAGIC		* I *
-DB_HASHOLDVER		* I *
-DB_HASHVERSION		* I *
-DB_HOME			D * *
-DB_INIT_CDB		D I J
-DB_INIT_LOCK		D I J
-DB_INIT_LOG		D I J
-DB_INIT_MPOOL		D I J
-DB_INIT_REP		D I J
-DB_INIT_TXN		D I J
-DB_INORDER		D I J
-DB_JOINENV		D I J
-DB_JOIN_ITEM		D I J
-DB_JOIN_NOSORT		D I J
-DB_KEYEMPTY		D I J
-DB_KEYEXIST		D I J
-DB_KEYFIRST		D I J
-DB_KEYLAST		D I J
-DB_LAST			D I J
-DB_LOCKDOWN		D I J
-DB_LOCKVERSION		* I *
-DB_LOCK_ABORT		* I *
-DB_LOCK_DEADLOCK	D I J
-DB_LOCK_DEFAULT		D I J
-DB_LOCK_DIRTY		* I *
-DB_LOCK_DUMP		* I *
-DB_LOCK_EXPIRE		D I J
-DB_LOCK_GET		D I J
-DB_LOCK_GET_TIMEOUT	D I J
-DB_LOCK_INHERIT		* I *
-DB_LOCK_IREAD		D I J
-DB_LOCK_IWR		D I J
-DB_LOCK_IWRITE		D I J
-DB_LOCK_MAXLOCKS	D I J
-DB_LOCK_MAXWRITE	D I J
-DB_LOCK_MINLOCKS	D I J
-DB_LOCK_MINWRITE	D I J
-DB_LOCK_NG		* I *
-DB_LOCK_NORUN		* I *
-DB_LOCK_NOTEXIST	* I *
-DB_LOCK_NOTGRANTED	D I J
-DB_LOCK_NOWAIT		D I J
-DB_LOCK_OLDEST		D I J
-DB_LOCK_PUT		D I J
-DB_LOCK_PUT_ALL		D I J
-DB_LOCK_PUT_OBJ		D I J
-DB_LOCK_PUT_READ	* I *
-DB_LOCK_RANDOM		D I J
-DB_LOCK_READ		D I J
-DB_LOCK_RECORD		* I *
-DB_LOCK_REMOVE		* I *
-DB_LOCK_SET_TIMEOUT	* I *
-DB_LOCK_SWITCH		* I *
-DB_LOCK_TIMEOUT		D I J
-DB_LOCK_TRADE		* I *
-DB_LOCK_UPGRADE		* I *
-DB_LOCK_UPGRADE_WRITE	* I *
-DB_LOCK_WAIT		* I *
-DB_LOCK_WRITE		D I J
-DB_LOCK_WWRITE		* I *
-DB_LOCK_YOUNGEST	D I J
-DB_LOGC_BUF_SIZE	* I *
-DB_LOGFILEID_INVALID	* I *
-DB_LOGMAGIC		* I *
-DB_LOGOLDVER		* I *
-DB_LOGVERSION		* I *
-DB_LOG_AUTOREMOVE	D I J
-DB_LOG_BUFFER_FULL	D I *
-DB_LOG_CHKPNT		* I *
-DB_LOG_COMMIT		* I *
-DB_LOG_DISK		* I *
-DB_LOG_INMEMORY		D I J
-DB_LOG_LOCKED		* I *
-DB_LOG_NOCOPY		* I *
-DB_LOG_NOT_DURABLE	* I *
-DB_LOG_PERM		* I *
-DB_LOG_RESEND		* I *
-DB_LOG_SILENT_ERR	* I *
-DB_LOG_WRNOSYNC		* I *
-DB_LSTAT_ABORTED	* I *
-DB_LSTAT_EXPIRED	* I *
-DB_LSTAT_FREE		* I *
-DB_LSTAT_HELD		* I *
-DB_LSTAT_NOTEXIST	* I *
-DB_LSTAT_PENDING	* I *
-DB_LSTAT_WAITING	* I *
-DB_MAX_PAGES		* I *
-DB_MAX_RECORDS		* I *
-DB_MPOOL_CLEAN		D I *
-DB_MPOOL_CREATE		D I *
-DB_MPOOL_DIRTY		D I *
-DB_MPOOL_DISCARD	D I *
-DB_MPOOL_FREE		* I *
-DB_MPOOL_LAST		D I *
-DB_MPOOL_NEW		D I *
-DB_MPOOL_NOFILE		D I J
-DB_MPOOL_UNLINK		D I J
-DB_MULTIPLE		D I J
-DB_MULTIPLE_INIT	D I *
-DB_MULTIPLE_KEY		D I J
-DB_MULTIPLE_KEY_NEXT	D I *
-DB_MULTIPLE_NEXT	D I *
-DB_MULTIPLE_RECNO_NEXT	D I *
-DB_NEEDSPLIT		* I *
-DB_NEXT			D I J
-DB_NEXT_DUP		D I J
-DB_NEXT_NODUP		D I J
-DB_NODUPDATA		D I J
-DB_NOLOCKING		D I J
-DB_NOMMAP		D I J
-DB_NOORDERCHK		D I J
-DB_NOOVERWRITE		D I J
-DB_NOPANIC		D I J
-DB_NOSERVER		D I *
-DB_NOSERVER_HOME	D I J
-DB_NOSERVER_ID		D I J
-DB_NOSYNC		D I J
-DB_NOTFOUND		D I J
-DB_NO_AUTO_COMMIT	* I *
-DB_ODDFILESIZE		D I *
-DB_OK_BTREE		* I *
-DB_OK_HASH		* I *
-DB_OK_QUEUE		* I *
-DB_OK_RECNO		* I *
-DB_OLD_VERSION		D I *
-DB_OPFLAGS_MASK		* I *
-DB_ORDERCHKONLY		D I J
-DB_OVERWRITE		D I J
-DB_PAGE_LOCK		* I *
-DB_PAGE_NOTFOUND	D I *
-DB_PANIC_ENVIRONMENT	D I J
-DB_POSITION		D I J
-DB_PREV			D I J
-DB_PREV_NODUP		D I J
-DB_PRINTABLE		D I J
-DB_PRIORITY_DEFAULT	D I J
-DB_PRIORITY_HIGH	D I J
-DB_PRIORITY_LOW		D I J
-DB_PRIORITY_VERY_HIGH 	D I J
-DB_PRIORITY_VERY_LOW	D I J
-DB_PRIVATE		D I J
-DB_PR_PAGE		* I *
-DB_PR_RECOVERYTEST	* I *
-DB_QAMMAGIC		* I *
-DB_QAMOLDVER		* I *
-DB_QAMVERSION		* I *
-DB_QUEUE		D I J
-DB_RDONLY		D I J
-DB_RDWRMASTER		* I *
-DB_RECNO		D I J
-DB_RECNUM		D I J
-DB_RECORDCOUNT		* I *
-DB_RECORD_LOCK		* I *
-DB_RECOVER		D I J
-DB_RECOVER_FATAL	D I J
-DB_REDO			* I *
-DB_REGION_INIT		D I J
-DB_REGION_MAGIC		* I *
-DB_RENAMEMAGIC		* I *
-DB_RENUMBER		D I J
-DB_REP_CLIENT		D I J
-DB_REP_CREATE		* I *
-DB_REP_DUPMASTER	D I J
-DB_REP_EGENCHG		* I *
-DB_REP_HANDLE_DEAD	D I N
-DB_REP_HOLDELECTION	D I J
-DB_REP_ISPERM		D I J
-DB_REP_LOGREADY		* I *
-DB_REP_MASTER		D I J
-DB_REP_NEWMASTER	D I J
-DB_REP_NEWSITE		D I J
-DB_REP_NOBUFFER		D I J
-DB_REP_NOTPERM		D I J
-DB_REP_PAGEDONE		* I *
-DB_REP_PERMANENT	D I J
-DB_REP_STARTUPDONE	D I J
-DB_REP_UNAVAIL		D I *
-DB_REVSPLITOFF		D I J
-DB_RMW			D I J
-DB_RPCCLIENT		D I J
-DB_RUNRECOVERY		D I N
-DB_SALVAGE		D I J
-DB_SECONDARY_BAD	D I *
-DB_SEQUENCE_VERSION	* I *
-DB_SEQ_DEC		D I J
-DB_SEQ_INC		D I J
-DB_SEQ_RANGE_SET	* I *
-DB_SEQ_WRAP		D I J
-DB_SET			D I J
-DB_SET_BEGIN_LSNP	* I *
-DB_SET_LOCK_TIMEOUT	D I J
-DB_SET_RANGE		D I J
-DB_SET_RECNO		D I J
-DB_SET_TXN_NOW		* I *
-DB_SET_TXN_TIMEOUT	D I J
-DB_SNAPSHOT		D I J
-DB_STAT_ALL		D I *
-DB_STAT_CLEAR		D I J
-DB_STAT_LOCK_CONF	D I *
-DB_STAT_LOCK_LOCKERS	D I *
-DB_STAT_LOCK_OBJECTS	D I *
-DB_STAT_LOCK_PARAMS	D I *
-DB_STAT_MEMP_HASH	D I *
-DB_STAT_SUBSYSTEM	D I *
-DB_SURPRISE_KID		* I *
-DB_SWAPBYTES		* I *
-DB_SYSTEM_MEM		D I J
-DB_TEST_ELECTINIT	* I *
-DB_TEST_ELECTVOTE1	* I *
-DB_TEST_POSTDESTROY	* I *
-DB_TEST_POSTLOG		* I *
-DB_TEST_POSTLOGMETA	* I *
-DB_TEST_POSTOPEN	* I *
-DB_TEST_POSTSYNC	* I *
-DB_TEST_PREDESTROY	* I *
-DB_TEST_PREOPEN		* I *
-DB_TEST_SUBDB_LOCKS	* I *
-DB_THREAD		D I J
-DB_TIMEOUT		* I *
-DB_TIME_NOTGRANTED	D I J
-DB_TRUNCATE		D I J
-DB_TXNVERSION		* I *
-DB_TXN_ABORT		D I J
-DB_TXN_APPLY		D I J
-DB_TXN_BACKWARD_ALLOC	* I *
-DB_TXN_BACKWARD_ROLL	D I J
-DB_TXN_CKP		* I *
-DB_TXN_FORWARD_ROLL	D I J
-DB_TXN_NOSYNC		D I J
-DB_TXN_NOT_DURABLE	D I J
-DB_TXN_NOWAIT		D I J
-DB_TXN_OPENFILES	* I *
-DB_TXN_POPENFILES	* I *
-DB_TXN_PRINT		D I J
-DB_TXN_SYNC		D I J
-DB_TXN_WRITE_NOSYNC	D I J
-DB_UNDO			* I *
-DB_UNKNOWN		D I J
-DB_UNREF		* I *
-DB_UPDATE_SECONDARY	* I *
-DB_UPGRADE		D I J
-DB_USE_ENVIRON		D I J
-DB_USE_ENVIRON_ROOT	D I J
-DB_VERB_DEADLOCK	D I J
-DB_VERB_RECOVERY	D I J
-DB_VERB_REPLICATION	D I J
-DB_VERB_WAITSFOR	D I J
-DB_VERIFY		D I J
-DB_VERIFY_BAD		D I N
-DB_VERIFY_FATAL		* I *
-DB_VERSION_MAJOR	* I J
-DB_VERSION_MINOR	* I J
-DB_VERSION_MISMATCH	D I *
-DB_VERSION_PATCH	* I J
-DB_VERSION_STRING	* I N
-DB_WRITECURSOR		D I J
-DB_WRITELOCK		* I *
-DB_WRITEOPEN		* I *
-DB_XA_CREATE		D I J
-DB_XIDDATASIZE		D I J
-DB_YIELDCPU		D I J
+DB_AFTER			D I J
+DB_AGGRESSIVE			D I J
+DB_ALREADY_ABORTED		* I *
+DB_AM_CHKSUM			* I *
+DB_AM_CL_WRITER			* I *
+DB_AM_COMPENSATE		* I *
+DB_AM_CREATED			* I *
+DB_AM_CREATED_MSTR		* I *
+DB_AM_DBM_ERROR			* I *
+DB_AM_DELIMITER			* I *
+DB_AM_DISCARD			* I *
+DB_AM_DUP			* I *
+DB_AM_DUPSORT			* I *
+DB_AM_ENCRYPT			* I *
+DB_AM_FIXEDLEN			* I *
+DB_AM_INMEM			* I *
+DB_AM_INORDER			* I *
+DB_AM_IN_RENAME			* I *
+DB_AM_NOT_DURABLE		* I *
+DB_AM_OPEN_CALLED		* I *
+DB_AM_PAD			* I *
+DB_AM_PGDEF			* I *
+DB_AM_RDONLY			* I *
+DB_AM_READ_UNCOMMITTED		* I *
+DB_AM_RECNUM			* I *
+DB_AM_RECOVER			* I *
+DB_AM_RENUMBER			* I *
+DB_AM_REVSPLITOFF		* I *
+DB_AM_SECONDARY			* I *
+DB_AM_SNAPSHOT			* I *
+DB_AM_SUBDB			* I *
+DB_AM_SWAP			* I *
+DB_AM_TXN			* I *
+DB_AM_VERIFYING			* I *
+DB_APPEND			D I J
+DB_ARCH_ABS			D I J
+DB_ARCH_DATA			D I J
+DB_ARCH_LOG			D I J
+DB_ARCH_REMOVE			D I J
+DB_ASSOC_IMMUTABLE_KEY		* I *
+DB_AUTO_COMMIT			D I J
+DB_BEFORE			D I J
+DB_BTREE			D I J
+DB_BTREEMAGIC			* I *
+DB_BTREEOLDVER			* I *
+DB_BTREEVERSION			* I *
+DB_BUFFER_SMALL			D I N
+DB_CDB_ALLDB			D I J
+DB_CHKSUM			D I J
+DB_COMPACT_FLAGS		* I *
+DB_CONFIG			D * *
+DB_CONSUME			D I J
+DB_CONSUME_WAIT			D I J
+DB_CREATE			D I J
+DB_CURRENT			D I J
+DB_CXX_NO_EXCEPTIONS		D I *
+DB_DBM_HSEARCH			* I *
+DB_DBT_APPMALLOC		D I N
+DB_DBT_DUPOK			* I *
+DB_DBT_ISSET			* I *
+DB_DBT_MALLOC			D I J
+DB_DBT_PARTIAL			D I J
+DB_DBT_REALLOC			D I N
+DB_DBT_USERCOPY			* I N
+DB_DBT_USERMEM			D I J
+DB_DEGREE_2			* I *
+DB_DELETED			* I *
+DB_DIRECT			D I *
+DB_DIRECT_DB			D I J
+DB_DIRECT_LOG			D I J
+DB_DIRTY_READ			* I *
+DB_DONOTINDEX			D I J
+DB_DSYNC_DB			D I J
+DB_DSYNC_LOG			D I J
+DB_DUP				D I J
+DB_DUPSORT			D I J
+DB_DURABLE_UNKNOWN		* I *
+DB_EID_BROADCAST		D I J
+DB_EID_INVALID			D I J
+DB_ENCRYPT			D I J
+DB_ENCRYPT_AES			D I J
+DB_ENV_AUTO_COMMIT		* I *
+DB_ENV_CDB			* I *
+DB_ENV_CDB_ALLDB		* I *
+DB_ENV_CREATE			* I *
+DB_ENV_DBLOCAL			* I *
+DB_ENV_DIRECT_DB		* I *
+DB_ENV_DIRECT_LOG		* I *
+DB_ENV_DSYNC_DB			* I *
+DB_ENV_DSYNC_LOG		* I *
+DB_ENV_FATAL			* I *
+DB_ENV_LOCKDOWN			* I *
+DB_ENV_LOG_AUTOREMOVE		* I *
+DB_ENV_LOG_INMEMORY		* I *
+DB_ENV_MULTIVERSION		* I *
+DB_ENV_NOLOCKING		* I *
+DB_ENV_NOMMAP			* I *
+DB_ENV_NOPANIC			* I *
+DB_ENV_OPEN_CALLED		* I *
+DB_ENV_OVERWRITE		* I *
+DB_ENV_PRIVATE			* I *
+DB_ENV_REGION_INIT		* I *
+DB_ENV_RPCCLIENT		* I *
+DB_ENV_RPCCLIENT_GIVEN		* I *
+DB_ENV_SYSTEM_MEM		* I *
+DB_ENV_THREAD			* I *
+DB_ENV_TIME_NOTGRANTED		* I *
+DB_ENV_TXN_NOSYNC		* I *
+DB_ENV_TXN_SNAPSHOT		* I *
+DB_ENV_TXN_WRITE_NOSYNC		* I *
+DB_ENV_YIELDCPU			* I *
+DB_EVENT_NO_SUCH_EVENT		* I *
+DB_EVENT_PANIC			D I J
+DB_EVENT_REP_CLIENT		D I J
+DB_EVENT_REP_MASTER		D I J
+DB_EVENT_REP_NEWMASTER		D I J
+DB_EVENT_REP_STARTUPDONE	D I J
+DB_EVENT_WRITE_FAILED		D I J
+DB_EXCL				D I J
+DB_EXTENT			* I *
+DB_FAST_STAT			D I J
+DB_FCNTL_LOCKING		* I *
+DB_FILE_ID_LEN			* I *
+DB_FIRST			D I J
+DB_FLUSH			D I J
+DB_FORCE			D I J
+DB_FREELIST_ONLY		D I J
+DB_FREE_SPACE			D I J
+DB_GET_BOTH			D I J
+DB_GET_BOTHC			* I *
+DB_GET_BOTH_RANGE		D I J
+DB_GET_RECNO			D I J
+DB_HANDLE_LOCK			* I *
+DB_HASH				D I J
+DB_HASHMAGIC			* I *
+DB_HASHOLDVER			* I *
+DB_HASHVERSION			* I *
+DB_HOME				D * *
+DB_IMMUTABLE_KEY		D I J
+DB_INIT_CDB			D I J
+DB_INIT_LOCK			D I J
+DB_INIT_LOG			D I J
+DB_INIT_MPOOL			D I J
+DB_INIT_REP			D I J
+DB_INIT_TXN			D I J
+DB_INORDER			D I J
+DB_JOINENV			* I J
+DB_JOIN_ITEM			D I J
+DB_JOIN_NOSORT			D I J
+DB_KEYEMPTY			D I J
+DB_KEYEXIST			D I J
+DB_KEYFIRST			D I J
+DB_KEYLAST			D I J
+DB_LAST				D I J
+DB_LOCKDOWN			D I J
+DB_LOCKVERSION			* I *
+DB_LOCK_ABORT			* I *
+DB_LOCK_DEADLOCK		D I J
+DB_LOCK_DEFAULT			D I J
+DB_LOCK_DUMP			* I *
+DB_LOCK_EXPIRE			D I J
+DB_LOCK_GET			D I J
+DB_LOCK_GET_TIMEOUT		D I J
+DB_LOCK_INHERIT			* I *
+DB_LOCK_IREAD			D I J
+DB_LOCK_IWR			D I J
+DB_LOCK_IWRITE			D I J
+DB_LOCK_MAXLOCKS		D I J
+DB_LOCK_MAXWRITE		D I J
+DB_LOCK_MINLOCKS		D I J
+DB_LOCK_MINWRITE		D I J
+DB_LOCK_NG			* I *
+DB_LOCK_NORUN			* I *
+DB_LOCK_NOTGRANTED		D I J
+DB_LOCK_NOWAIT			D I J
+DB_LOCK_OLDEST			D I J
+DB_LOCK_PUT			D I J
+DB_LOCK_PUT_ALL			D I J
+DB_LOCK_PUT_OBJ			D I J
+DB_LOCK_PUT_READ		* I *
+DB_LOCK_RANDOM			D I J
+DB_LOCK_READ			D I J
+DB_LOCK_READ_UNCOMMITTED	* I *
+DB_LOCK_RECORD			* I *
+DB_LOCK_SET_TIMEOUT		* I *
+DB_LOCK_SWITCH			* I *
+DB_LOCK_TIMEOUT			D I J
+DB_LOCK_TRADE			* I *
+DB_LOCK_UPGRADE			* I *
+DB_LOCK_UPGRADE_WRITE		* I *
+DB_LOCK_WAIT			* I *
+DB_LOCK_WRITE			D I J
+DB_LOCK_WWRITE			* I *
+DB_LOCK_YOUNGEST		D I J
+DB_LOGFILEID_INVALID		* I *
+DB_LOGMAGIC			* I *
+DB_LOGOLDVER			* I *
+DB_LOGVERSION			* I *
+DB_LOG_AUTOREMOVE		D I J
+DB_LOG_BUFFER_FULL		D I *
+DB_LOG_CHKPNT			* I *
+DB_LOG_COMMIT			* I *
+DB_LOG_DISK			* I *
+DB_LOG_INMEMORY			D I J
+DB_LOG_LOCKED			* I *
+DB_LOG_NOCOPY			* I *
+DB_LOG_NOT_DURABLE		* I *
+DB_LOG_SILENT_ERR		* I *
+DB_LOG_WRNOSYNC			* I *
+DB_LSTAT_ABORTED		* I *
+DB_LSTAT_EXPIRED		* I *
+DB_LSTAT_FREE			* I *
+DB_LSTAT_HELD			* I *
+DB_LSTAT_PENDING		* I *
+DB_LSTAT_WAITING		* I *
+DB_MAX_PAGES			* I *
+DB_MAX_RECORDS			* I *
+DB_MPOOL_CREATE			D I *
+DB_MPOOL_DIRTY			D I *
+DB_MPOOL_DISCARD		D I *
+DB_MPOOL_EDIT			D I *
+DB_MPOOL_FREE			* I *
+DB_MPOOL_LAST			D I *
+DB_MPOOL_NEW			D I *
+DB_MPOOL_NOFILE			D I J
+DB_MPOOL_UNLINK			D I J
+DB_MULTIPLE			D I J
+DB_MULTIPLE_INIT		D I *
+DB_MULTIPLE_KEY			D I J
+DB_MULTIPLE_KEY_NEXT		D I *
+DB_MULTIPLE_NEXT		D I *
+DB_MULTIPLE_RECNO_NEXT		D I *
+DB_MULTIVERSION			D I J
+DB_MUTEX_ALLOCATED		* I *
+DB_MUTEX_LOCKED			* I *
+DB_MUTEX_LOGICAL_LOCK		* I *
+DB_MUTEX_PROCESS_ONLY		D I *
+DB_MUTEX_SELF_BLOCK		D I *
+DB_NEEDSPLIT			* I *
+DB_NEXT				D I J
+DB_NEXT_DUP			D I J
+DB_NEXT_NODUP			D I J
+DB_NODUPDATA			D I J
+DB_NOLOCKING			D I J
+DB_NOMMAP			D I J
+DB_NOORDERCHK			D I J
+DB_NOOVERWRITE			D I J
+DB_NOPANIC			D I J
+DB_NOSERVER			D I *
+DB_NOSERVER_HOME		D I J
+DB_NOSERVER_ID			D I J
+DB_NOSYNC			D I J
+DB_NOTFOUND			D I J
+DB_NO_AUTO_COMMIT		* I *
+DB_ODDFILESIZE			D I *
+DB_OK_BTREE			* I *
+DB_OK_HASH			* I *
+DB_OK_QUEUE			* I *
+DB_OK_RECNO			* I *
+DB_OLD_VERSION			D I *
+DB_OPFLAGS_MASK			* I *
+DB_ORDERCHKONLY			D I J
+DB_OVERWRITE			D I J
+DB_PAGE_LOCK			* I *
+DB_PAGE_NOTFOUND		D I *
+DB_PANIC_ENVIRONMENT		D I J
+DB_POSITION			D I J
+DB_PREV				D I J
+DB_PREV_NODUP			D I J
+DB_PRINTABLE			D I J
+DB_PRIORITY_DEFAULT		D I J
+DB_PRIORITY_HIGH		D I J
+DB_PRIORITY_LOW			D I J
+DB_PRIORITY_VERY_HIGH		D I J
+DB_PRIORITY_VERY_LOW		D I J
+DB_PRIVATE			D I J
+DB_PR_PAGE			* I *
+DB_PR_RECOVERYTEST		* I *
+DB_QAMMAGIC			* I *
+DB_QAMOLDVER			* I *
+DB_QAMVERSION			* I *
+DB_QUEUE			D I J
+DB_RDONLY			D I J
+DB_RDWRMASTER			* I *
+DB_READ_COMMITTED		D I J
+DB_READ_UNCOMMITTED		D I J
+DB_RECNO			D I J
+DB_RECNUM			D I J
+DB_RECORD_LOCK			* I *
+DB_RECOVER			D I J
+DB_RECOVER_FATAL		D I J
+DB_REDO				* I *
+DB_REGION_INIT			D I J
+DB_REGION_MAGIC			* I *
+DB_REGISTER			D I J
+DB_RENAMEMAGIC			* I *
+DB_RENUMBER			D I J
+DB_REPMGR_ACKS_ALL		D I J
+DB_REPMGR_ACKS_ALL_PEERS	D I J
+DB_REPMGR_ACKS_NONE		D I J
+DB_REPMGR_ACKS_ONE		D I J
+DB_REPMGR_ACKS_ONE_PEER		D I J
+DB_REPMGR_ACKS_QUORUM		D I J
+DB_REPMGR_CONNECTED		D I J
+DB_REPMGR_DISCONNECTED		D I *
+DB_REPMGR_PEER			D I J
+DB_REP_ACK_TIMEOUT		D I J
+DB_REP_ANYWHERE			D I J
+DB_REP_BULKOVF			* I *
+DB_REP_CLIENT			D I J
+DB_REP_CONF_BULK		D I J
+DB_REP_CONF_DELAYCLIENT		D I J
+DB_REP_CONF_NOAUTOINIT		D I J
+DB_REP_CONF_NOWAIT		D I J
+DB_REP_CONNECTION_RETRY		D I J
+DB_REP_DUPMASTER		D I N
+DB_REP_EGENCHG			* I *
+DB_REP_ELECTION			D I J
+DB_REP_ELECTION_RETRY		D I J
+DB_REP_ELECTION_TIMEOUT		D I J
+DB_REP_FULL_ELECTION		D I J
+DB_REP_HANDLE_DEAD		D I N
+DB_REP_HOLDELECTION		D I N
+DB_REP_IGNORE			D I J
+DB_REP_ISPERM			D I J
+DB_REP_JOIN_FAILURE		D I N
+DB_REP_LOCKOUT			D I N
+DB_REP_LOGREADY			* I *
+DB_REP_MASTER			D I J
+DB_REP_NEWMASTER		D I J
+DB_REP_NEWSITE			D I J
+DB_REP_NOBUFFER			D I J
+DB_REP_NOTPERM			D I J
+DB_REP_PAGEDONE			* I *
+DB_REP_PERMANENT		D I J
+DB_REP_REREQUEST		D I J
+DB_REP_UNAVAIL			D I N
+DB_REVSPLITOFF			D I J
+DB_RMW				D I J
+DB_RPCCLIENT			D I J
+DB_RUNRECOVERY			D I N
+DB_SALVAGE			D I J
+DB_SECONDARY_BAD		D I *
+DB_SEQUENCE_OLDVER		* I *
+DB_SEQUENCE_VERSION		* I *
+DB_SEQ_DEC			D I J
+DB_SEQ_INC			D I J
+DB_SEQ_RANGE_SET		* I *
+DB_SEQ_WRAP			D I J
+DB_SEQ_WRAPPED			* I *
+DB_SET				D I J
+DB_SET_LOCK_TIMEOUT		D I J
+DB_SET_RANGE			D I J
+DB_SET_RECNO			D I J
+DB_SET_TXN_LSNP			* I *
+DB_SET_TXN_NOW			* I *
+DB_SET_TXN_TIMEOUT		D I J
+DB_SNAPSHOT			D I J
+DB_STAT_ALL			D I *
+DB_STAT_CLEAR			D I J
+DB_STAT_LOCK_CONF		D I *
+DB_STAT_LOCK_LOCKERS		D I *
+DB_STAT_LOCK_OBJECTS		D I *
+DB_STAT_LOCK_PARAMS		D I *
+DB_STAT_MEMP_HASH		D I *
+DB_STAT_NOERROR			* I *
+DB_STAT_SUBSYSTEM		D I *
+DB_SURPRISE_KID			* I *
+DB_SWAPBYTES			* I *
+DB_SYSTEM_MEM			D I J
+DB_TEST_ELECTINIT		* I *
+DB_TEST_ELECTVOTE1		* I *
+DB_TEST_POSTDESTROY		* I *
+DB_TEST_POSTLOG			* I *
+DB_TEST_POSTLOGMETA		* I *
+DB_TEST_POSTOPEN		* I *
+DB_TEST_POSTSYNC		* I *
+DB_TEST_PREDESTROY		* I *
+DB_TEST_PREOPEN			* I *
+DB_TEST_RECYCLE			* I *
+DB_TEST_SUBDB_LOCKS		* I *
+DB_THREAD			D I J
+DB_THREADID_STRLEN		D I *
+DB_TIMEOUT			* I *
+DB_TIME_NOTGRANTED		D I J
+DB_TRUNCATE			D I J
+DB_TXNVERSION			* I *
+DB_TXN_ABORT			D I J
+DB_TXN_APPLY			D I J
+DB_TXN_BACKWARD_ALLOC		* I *
+DB_TXN_BACKWARD_ROLL		D I J
+DB_TXN_CKP			* I *
+DB_TXN_FORWARD_ROLL		D I J
+DB_TXN_NOSYNC			D I J
+DB_TXN_NOT_DURABLE		D I J
+DB_TXN_NOWAIT			D I J
+DB_TXN_OPENFILES		* I *
+DB_TXN_POPENFILES		* I *
+DB_TXN_PRINT			D I J
+DB_TXN_SNAPSHOT			D I J
+DB_TXN_SYNC			D I J
+DB_TXN_WRITE_NOSYNC		D I J
+DB_UNDO				* I *
+DB_UNKNOWN			D I J
+DB_UNREF			* I *
+DB_UPDATE_SECONDARY		* I *
+DB_UPGRADE			D I J
+DB_USERCOPY_GETDATA		* I N
+DB_USERCOPY_SETDATA		* I N
+DB_USE_ENVIRON			D I J
+DB_USE_ENVIRON_ROOT		D I J
+DB_VERB_DEADLOCK		D I J
+DB_VERB_RECOVERY		D I J
+DB_VERB_REGISTER		D I J
+DB_VERB_REPLICATION		D I J
+DB_VERB_WAITSFOR		D I J
+DB_VERIFY			D I J
+DB_VERIFY_BAD			D I N
+DB_VERIFY_FATAL			* I *
+DB_VERSION_MAJOR		* I J
+DB_VERSION_MINOR		* I J
+DB_VERSION_MISMATCH		D I N
+DB_VERSION_PATCH		* I J
+DB_VERSION_STRING		* I N
+DB_WRITECURSOR			D I J
+DB_WRITELOCK			* I *
+DB_WRITEOPEN			* I *
+DB_XA_CREATE			D I J
+DB_XIDDATASIZE			D I J
+DB_YIELDCPU			D I J
diff --git a/db/dist/s_all b/db/dist/s_all
old mode 100644
new mode 100755
index 02686b742..0891a713b
--- a/db/dist/s_all
+++ b/db/dist/s_all
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_all,v 1.11 2002/10/30 15:26:36 bostic Exp $
+#	$Id: s_all,v 12.2 2005/12/01 03:24:24 bostic Exp $
 
 sh s_perm		# permissions.
 sh s_symlink		# symbolic links.
@@ -13,8 +13,8 @@ sh s_recover		# logging/recovery files.
 sh s_rpc		# RPC files.
 sh s_include		# standard include files.
 
-sh s_win32		# Win32 include files.
-sh s_win32_dsp		# Win32 build environment.
+sh s_windows		# Windows include files.
+sh s_windows_dsp	# Windows build environment.
 sh s_vxworks		# VxWorks include files.
 sh s_java		# Java support.
 sh s_test		# Test suite support.
diff --git a/db/dist/s_config b/db/dist/s_config
index 604a1d089..194df83a5 100755
--- a/db/dist/s_config
+++ b/db/dist/s_config
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_config,v 1.13 2003/07/02 15:27:44 bostic Exp $
+#	$Id: s_config,v 12.1 2005/08/16 05:19:18 mjc Exp $
 #
 # Build the autoconfiguration files.
 
@@ -20,14 +20,13 @@ rm -f configure
 autoconf
 
 # Edit version information we couldn't pre-compute.
-(echo "1,\$s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" &&
- echo "1,\$s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" &&
- echo "1,\$s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" &&
- echo "1,\$s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" &&
- echo "1,\$s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" &&
- echo "1,\$s/__EDIT_DB_VERSION__/$DB_VERSION/g" &&
- echo "w" &&
- echo "q") | ed configure
+sed -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+    -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+    -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+    -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+    -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+    -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure > configure.version
+mv configure.version configure
 
 rm -rf autom4te.cache
 chmod 555 configure
diff --git a/db/dist/s_crypto b/db/dist/s_crypto
old mode 100644
new mode 100755
index 05a93043a..8dc736207
--- a/db/dist/s_crypto
+++ b/db/dist/s_crypto
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_crypto,v 11.8 2003/11/24 22:41:26 bostic Exp $
+#	$Id: s_crypto,v 12.1 2005/12/01 03:24:24 bostic Exp $
 
 # Remove crypto from the DB source tree.
 
@@ -43,8 +43,8 @@ chmod 664 $f
  echo 'w' &&
  echo 'q') | ed $f
 
- sh ./s_win32
- sh ./s_win32_dsp
+ sh ./s_windows
+ sh ./s_windows_dsp
 
 # VxWorks
 f=vx_config.in
diff --git a/db/dist/s_include b/db/dist/s_include
index ab058d86d..57a048ed8 100755
--- a/db/dist/s_include
+++ b/db/dist/s_include
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_include,v 1.22 2004/04/19 18:27:17 mjc Exp $
+#	$Id: s_include,v 12.3 2006/04/27 13:40:36 mjc Exp $
 #
 # Build the automatically generated function prototype files.
 
@@ -72,11 +72,12 @@ head defonly _DB_INT_DEF_IN_ > $i_dfile
 # Process the standard directories, creating per-directory prototype
 # files and adding to the external prototype and #define files.
 for i in db btree clib common crypto dbreg env fileops hash hmac \
-    lock log mp mutex os qam rep rpc_client rpc_server sequence tcl txn xa; do
+    lock log mp mutex os qam rep repmgr rpc_client rpc_server \
+    sequence tcl txn xa; do
 	head "_${i}_ext_h_" > $i_pfile
 
 	if [ $i = os ] ; then
-		f=`ls ../$i/*.c ../os_win32/*.c`
+		f=`ls ../$i/*.c ../os_windows/*.c`
 	elif [ $i = rpc_server ] ; then
 		f=`ls ../$i/c/*.c`
 	elif [ $i = crypto ] ; then
@@ -112,9 +113,9 @@ done
 
 # There are a few globals in DB -- add them to the external/internal
 # #define files.
-(echo "#define __db_global_values __db_global_values@DB_VERSION_UNIQUE_NAME@";
-    echo "#define __db_jump __db_jump@DB_VERSION_UNIQUE_NAME@") >> $i_dfile
-(echo "#define db_xa_switch db_xa_switch@DB_VERSION_UNIQUE_NAME@") >> $e_dfile
+(echo "#define	__db_global_values __db_global_values@DB_VERSION_UNIQUE_NAME@";
+    echo "#define	__db_jump __db_jump@DB_VERSION_UNIQUE_NAME@") >> $i_dfile
+(echo "#define	db_xa_switch db_xa_switch@DB_VERSION_UNIQUE_NAME@") >> $e_dfile
 
 # Wrap up the external #defines/prototypes, and internal #defines.
 tail defonly _DB_EXT_DEF_IN_ >> $e_dfile
diff --git a/db/dist/s_java b/db/dist/s_java
index ae715ccd6..57b88e8e5 100755
--- a/db/dist/s_java
+++ b/db/dist/s_java
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_java,v 11.8 2004/04/06 20:43:35 mjc Exp $
+#	$Id: s_java,v 12.0 2004/11/17 03:43:35 bostic Exp $
 #
 # Build the Java files.
 
diff --git a/db/dist/s_java_const b/db/dist/s_java_const
index 644b32324..8374b1f61 100755
--- a/db/dist/s_java_const
+++ b/db/dist/s_java_const
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_java_const,v 1.27 2004/07/30 14:51:37 mjc Exp $
+#	$Id: s_java_const,v 12.0 2004/11/17 03:43:35 bostic Exp $
 #
 # Build the Java files.
 
diff --git a/db/dist/s_java_stat b/db/dist/s_java_stat
index 4eb2ab147..67fa917f8 100755
--- a/db/dist/s_java_stat
+++ b/db/dist/s_java_stat
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_java_stat,v 1.33 2004/09/28 19:30:36 mjc Exp $
+#	$Id: s_java_stat,v 12.14 2006/08/24 14:45:35 bostic Exp $
 #
 # Build the Java files.
 
@@ -8,11 +8,10 @@ msgjava="/*-
  *
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 2002-2004
- *	Sleepycat Software.  All rights reserved.
+ * Copyright (c) 2002-2006
+ *	Oracle Corporation.  All rights reserved.
  */"
 
-
 s=/tmp/__java.sed
 t=/tmp/__java
 c=/tmp/__javajnic
@@ -28,8 +27,9 @@ jclass()
 	/__db_$1/d
 	/;/!d
 	/^}/d
-	/char[	 ]*\*/{
-		s/^[	 ]*[^\*]*\*[	 ]*\([^;]*\).*/\\
+	/db_threadid_t/d
+	/char[	 ]*/{
+		s/^[	 ]*char[*	 ]*[	 ]*\([^[;]*\).*/\\
 $2    private String \1;\\
 $2    public String get_\1() {\\
 $2        return \1;\\
@@ -84,12 +84,15 @@ $2    }/p
 }
 EOF
 	sed -n -f $s < ../dbinc/db.in |
-	perl -w -p -e 's/get_(st|bt|hash|qs)_/get_/;' \
+	perl -w -p -e 's/get_(st|bt|hash|qs|compact)_/get_/;' \
 	           -e 'if (m/get.*\(/) {' \
-	           -e     's/_n([b-df-hj-np-tv-z])/_num_$1/;' \
+	           -e     's/_n([b-df-hj-np-tv-z]|upgrade)/_num_$1/;' \
 	           -e     's/_(min|max)([a-z])/_$1_$2/;' \
-	           -e     's/pg(.)/_pages_$1/;' \
-	           -e     's/(count|flag|free|id\(|page|size|timeout)/_$1/g;' \
+	           -e     's/_mvcc/_multiversion/;' \
+	           -e     's/_cnt/_count_/;' \
+	           -e     's/_pg/_pages_/;' \
+	           -e     's/(count|flag|free|page|percent|size|timeout)/_$1/g;' \
+	           -e     's/([^p])(id\()/$1_$2/g;' \
 	           -e     's/__*/_/g;' \
 	           -e     's/_(.)/\U$1/g' \
 	           -e '};' \
@@ -109,8 +112,9 @@ jclass_jni()
 	/__db_$1/d
 	/;/!d
 	/^}/d
-	/char[	 ]*\*/{
-		s/^[	 ]*[^\*]*\*[	 ]*\([^;]*\).*/	JAVADB_STAT_STRING(jnienv, jobj, $1_\1_fid, statp, \1);/p
+	/db_threadid_t/d
+	/char[	 ]*/{
+		s/^[	 ]*char[*	 ]*[	 ]*\([^[;]*\).*/	JAVADB_STAT_STRING(jnienv, jobj, $1_\1_fid, statp, \1);/p
 		d
 	}
 	/time_t/{
@@ -136,7 +140,7 @@ jclass_jni()
 	s/^[	 ]*[^	 ]*[	 ]*\([^;]*\).*/	JAVADB_STAT_INT(jnienv, jobj, $1_\1_fid, statp, \1);/p
 }
 EOF
-	echo "static int $fill(JNIEnv *jnienv, " >> $c
+	echo "static int $fill(JNIEnv *jnienv," >> $c
 	echo "    jobject jobj, struct __db_$1 *statp) {" >> $c
 	sed -n -f $s < ../dbinc/db.in >> $c
         echo '	return (0);' >> $c
@@ -150,8 +154,9 @@ jni_fieldid_decls()
 	/__db_$1/d
 	/;/!d
 	/^}/d
-	/char[	 ]*\*/{
-		s/^[	 ]*[^\*]*\*[	 ]*\([^;]*\).*/static jfieldID $1_\1_fid;/p
+	/db_threadid_t/d
+	/char[	 ]*/{
+		s/^[	 ]*char[*	 ]*[	 ]*\([^[;]*\).*/static jfieldID $1_\1_fid;/p
 		d
 	}
 	/time_t/{
@@ -187,8 +192,9 @@ jni_fieldids()
 	/__db_$1/d
 	/;/!d
 	/^}/d
-	/char[	 ]*\*/{
-		s/^[	 ]*[^\*]*\*[	 ]*\([^;]*\).*/	{ \&$1_\1_fid, \&$1_class, \"\1\", \"Ljava\/lang\/String;\" },/p
+	/db_threadid_t/d
+	/char[	 ]*/{
+		s/^[	 ]*char[*	 ]*[	 ]*\([^[;]*\).*/	{ \&$1_\1_fid, \&$1_class, \"\1\", \"Ljava\/lang\/String;\" },/p
 		d
 	}
 	/time_t/{
@@ -225,8 +231,9 @@ jclass_toString()
 	/__db_$1/d
 	/;/!d
 	/^}/d
-	/char[	 ]*\*/{
-		s/^[	 ]*[^\*]*\*[	 ]*\([^;]*\).*/$3            + "\\\\n$3  \1=" + \1/p
+	/db_threadid_t/d
+	/char[	 ]*/{
+		s/^[	 ]*char[*	 ]*[	 ]*\([^[;]*\).*/$3            + "\\\\n$3  \1=" + \1/p
 		d
 	}
 	/DB_TXN_ACTIVE[	 ]*\*/{
@@ -260,7 +267,7 @@ stat_class()
 	 echo
 	 echo "public class $j_class$extends {"
 	 echo "    // no public constructor"
-	 echo "    protected $j_class() {}"
+	 echo "    /* package */ $j_class() {}"
 	 jclass $1
 	 jclass_toString $1 $2
 	 echo '}') > $t
@@ -275,11 +282,42 @@ echo "$msgjava" > $c
 > $u2
 
 stat_class bt_stat BtreeStats " extends DatabaseStats"
+
+# Build CompactStats.java - not purely a statistics class, but close enough to
+# share this code.
+(echo "$msgjava"
+ echo
+ echo 'package com.sleepycat.db;'
+ echo
+ echo 'import com.sleepycat.db.internal.DbUtil;'
+ echo
+ echo "public class CompactStats"
+ echo '{'
+ echo "    // no public constructor"
+ echo "    /* package */ CompactStats() {}"
+ echo
+ echo "    /* package */"
+ echo "    CompactStats(int fillpercent, int timeout, int pages) {"
+ echo "        this.compact_fillpercent = fillpercent;"
+ echo "        this.compact_timeout = timeout;"
+ echo "        this.compact_pages = pages;"
+ echo "    }"
+ jclass compact
+ jclass_toString compact CompactStats
+ echo '}'
+ echo '// end of TransactionStats.java') |
+   psed 's,public int get\(FillPercent\|Pages(\|Timeout\|Truncate\),/* package */ int get\1,g'> $t
+jclass_jni compact __dbj_fill_compact
+f=../java/src/com/sleepycat/db/CompactStats.java
+cmp $t $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
+
 stat_class h_stat HashStats " extends DatabaseStats"
 stat_class lock_stat LockStats
 stat_class log_stat LogStats
 stat_class mpool_fstat CacheFileStats
 stat_class mpool_stat CacheStats
+stat_class mutex_stat MutexStats
 stat_class qam_stat QueueStats " extends DatabaseStats"
 stat_class rep_stat ReplicationStats
 stat_class seq_stat SequenceStats
@@ -294,11 +332,11 @@ stat_class seq_stat SequenceStats
  echo "public class TransactionStats"
  echo '{'
  echo "    // no public constructor"
- echo "    protected TransactionStats() {}"
+ echo "    /* package */ TransactionStats() {}"
  echo
  echo -n "    public static class Active {"
  echo    "        // no public constructor"
- echo    "        protected Active() {}"
+ echo    "        /* package */ Active() {}"
  jclass txn_active "    "
  jclass_toString txn_active Active "    "
  echo '    };'
diff --git a/db/dist/s_java_swig b/db/dist/s_java_swig
index c1e67e316..6a12b67d0 100755
--- a/db/dist/s_java_swig
+++ b/db/dist/s_java_swig
@@ -1,8 +1,12 @@
 #!/bin/sh -
-#       $Id: s_java_swig,v 11.11 2004/09/23 17:31:53 mjc Exp $
+#       $Id: s_java_swig,v 12.6 2006/09/08 20:28:44 bostic Exp $
 #
 # Run SWIG to generate the Java APIs
 
+t=/tmp/__db_a
+trap 'rm -f $t ; exit 0' 0
+trap 'rm -f $t ; exit 1' 1 2 3 13 15
+
 SWIG=swig
 SWIG_DIR=../libdb_java
 SWIG_FILE=$SWIG_DIR/db.i
@@ -21,7 +25,7 @@ for api in java ; do
 	swig_args=""
 	case $api in
 	java)
-		swig_args="-nodefault -package $PACKAGE $args"
+		swig_args="-nodefaultctor -nodefaultdtor -package $PACKAGE $args"
 		;;
 	esac
 
@@ -53,3 +57,17 @@ for f in *.java ; do
 	perl -p $SWIG_DIR/java-post.pl < $f > $JAVA_SRCDIR/$f || exit $?
 	rm -f $f
 done
+
+# db_config.h must be the first #include, move it to the top of the file.
+(
+      echo '#include "db_config.h"'
+      sed '/#include "db_config.h"/d' < db_java_wrap.c
+) > $t && cp $t db_java_wrap.c
+
+# The following might become redundant with newer swig versions.
+# builds usually already define _CRT_SECURE_NO_DEPRECATE
+(
+      sed -e '/# define _CRT_SECURE_NO_DEPRECATE/i\
+# undef _CRT_SECURE_NO_DEPRECATE' < db_java_wrap.c
+) > $t && cp $t db_java_wrap.c
+
diff --git a/db/dist/s_je2db b/db/dist/s_je2db
index aaaa42cf1..a5c64197e 100644
--- a/db/dist/s_je2db
+++ b/db/dist/s_je2db
@@ -52,7 +52,7 @@ E1='s/com\.sleepycat\.je/com.sleepycat.db/g'
 E2='/import com\.sleepycat\.db\.ForeignKeyNullifier/d'
 E3='/implements/s/, ForeignKeyNullifier//'
 E4='//,//d'
-EXCLUDETESTS="\(\(ForeignKeyTest\)\|\(TupleSerialFactoryTest\)\)"
+EXCLUDETESTS="\(\(ForeignKeyTest\)\|\(TupleSerialFactoryTest\)\\|\(XACollectionTest\)\)"
 
 cd "$JESRC"
 for f in `find . -name '*.java' | grep $DIRMATCH` ; do
diff --git a/db/dist/s_perm b/db/dist/s_perm
index 8c3a0f746..834645b98 100755
--- a/db/dist/s_perm
+++ b/db/dist/s_perm
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_perm,v 1.31 2004/10/05 18:56:58 bostic Exp $
+#	$Id: s_perm,v 12.2 2005/12/01 03:24:24 bostic Exp $
 
 d=..
 echo 'Updating Berkeley DB source tree permissions...'
@@ -15,7 +15,7 @@ run()
 	fi
 }
 
-run build_win32/include.tcl 664
+run build_windows/include.tcl 664
 run dist/config.guess 555
 run dist/config.sub 555
 run dist/configure 555
@@ -36,8 +36,8 @@ run dist/s_symlink 555
 run dist/s_tags 555
 run dist/s_test 555
 run dist/s_vxworks 555
-run dist/s_win32 555
-run dist/s_win32_dsp 555
+run dist/s_windows 555
+run dist/s_windows_dsp 555
 run dist/vx_buildcd 555
 run mod_db4/configure 555
 
diff --git a/db/dist/s_readme b/db/dist/s_readme
index f2ed07044..afa8c5b60 100755
--- a/db/dist/s_readme
+++ b/db/dist/s_readme
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_readme,v 1.7 2003/07/02 15:27:44 bostic Exp $
+#	$Id: s_readme,v 12.1 2006/08/24 14:45:35 bostic Exp $
 #
 # Build the README.
 
@@ -15,7 +15,7 @@ trap 'rm -f $t; exit 0' 0 1 2 3 13 15
 cat << END_OF_README>$t
 $DB_VERSION_STRING
 
-This is version $DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH of Berkeley DB from Sleepycat Software.  To view
+This is version $DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH of Berkeley DB from Oracle Corporation.  To view
 the release and installation documentation, load the distribution file
 docs/index.html into your web browser.
 END_OF_README
diff --git a/db/dist/s_recover b/db/dist/s_recover
index b30a08554..5bc67e7e8 100755
--- a/db/dist/s_recover
+++ b/db/dist/s_recover
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_recover,v 1.17 2004/06/17 17:35:19 bostic Exp $
+#	$Id: s_recover,v 12.1 2006/05/24 16:24:24 sue Exp $
 #
 # Build the automatically generated logging/recovery files.
 
@@ -23,11 +23,11 @@ for i in $DIR; do
 		# so it's okay to just take the first.
 		grep '^PREFIX' $f | sed q
 		egrep '^BEGIN[	 ]|^IGNORED[	 ]|^DEPRECATED[	 ]' $f |
-		    awk '{print $1 "\t" $2 "\t" $3}'
+		    awk '{print $1 "\t" $2 "\t" $3 "\t" $4}'
 	done
 done > $loglist
 grep -v '^PREFIX' $loglist |
-    awk '{print $2 "\t" $3}' | sort -n -k 2 | uniq -d -f 1 > $tmp
+    awk '{print $2 "\t" $3 "\t" $4}' | sort -n -k 3 | uniq -d -f 1 > $tmp
 [ -s $tmp ] && {
 	echo "DUPLICATE LOG VALUES:"
 	cat $tmp
diff --git a/db/dist/s_rpc b/db/dist/s_rpc
old mode 100644
new mode 100755
index 8dada0e3b..7da75819e
--- a/db/dist/s_rpc
+++ b/db/dist/s_rpc
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_rpc,v 11.20 2004/03/11 20:11:17 bostic Exp $
+#	$Id: s_rpc,v 12.0 2004/11/17 03:43:35 bostic Exp $
 #
 # Build the automatically generated RPC files
 
diff --git a/db/dist/s_symlink b/db/dist/s_symlink
index 533eb6b44..9625e0134 100755
--- a/db/dist/s_symlink
+++ b/db/dist/s_symlink
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_symlink,v 1.32 2004/04/01 15:10:53 bostic Exp $
+#	$Id: s_symlink,v 12.5 2006/09/13 17:51:34 bostic Exp $
 
 echo 'Creating Berkeley DB source tree symbolic links...'
 
@@ -22,6 +22,7 @@ build db_checkpoint/tags ../dist/tags
 build db_deadlock/tags ../dist/tags
 build db_dump/tags ../dist/tags
 build db_dump185/tags ../dist/tags
+build db_hotbackup/tags ../dist/tags
 build db_load/tags ../dist/tags
 build db_printlog/tags ../dist/tags
 build db_recover/tags ../dist/tags
@@ -45,10 +46,12 @@ build log/tags ../dist/tags
 build mp/tags ../dist/tags
 build mutex/tags ../dist/tags
 build os/tags ../dist/tags
+build os_brew/tags ../dist/tags
 build os_vxworks/tags ../dist/tags
-build os_win32/tags ../dist/tags
+build os_windows/tags ../dist/tags
 build qam/tags ../dist/tags
 build rep/tags ../dist/tags
+build repmgr/tags ../dist/tags
 build rpc_client/tags ../dist/tags
 build rpc_server/tags ../dist/tags
 build sequence/tags ../dist/tags
diff --git a/db/dist/s_tags b/db/dist/s_tags
index d1c21e5b2..ff59d826e 100755
--- a/db/dist/s_tags
+++ b/db/dist/s_tags
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_tags,v 1.18 2004/04/01 15:11:14 bostic Exp $
+#	$Id: s_tags,v 12.2 2006/04/23 15:58:33 bostic Exp $
 #
 # Build tags files.
 
@@ -27,6 +27,7 @@ files=`echo ../dbinc/*.h \
 	../os/*.[ch] \
 	../qam/*.[ch] \
 	../rep/*.[ch] \
+	../repmgr/*.[ch] \
 	../rpc_client/*.[ch] \
 	../rpc_server/c/*.[ch] \
 	../sequence/*.[ch] \
@@ -55,7 +56,9 @@ fi
 ctags $flags $files 2>/dev/null
 chmod 444 $f
 
-f=../test_perf/tags
-echo "Building $f"
-(cd ../test_perf && ctags $flags *.[ch] 2>/dev/null)
-chmod 444 $f
+for i in test_perf test_rep test_server; do
+	f=../$i/tags
+	echo "Building $f"
+	(cd ../$i && ctags $flags *.[ch] 2>/dev/null)
+	chmod 444 $f
+done
diff --git a/db/dist/s_test b/db/dist/s_test
index df0648d56..543d95b9f 100755
--- a/db/dist/s_test
+++ b/db/dist/s_test
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_test,v 1.29 2004/05/13 18:51:43 mjc Exp $
+#	$Id: s_test,v 12.5 2006/07/07 19:05:59 bostic Exp $
 #
 # Build the Tcl test files.
 
@@ -30,11 +30,19 @@ trap 'rm -f $t; exit 0' 0 1 2 3 13 15
  echo "global dict"				&& \
  echo "global util_path"			&& \
  echo ""					&& \
+ echo "global is_freebsd_test"			&& \
  echo "global is_hp_test"			&& \
+ echo "global is_linux_test"			&& \
  echo "global is_qnx_test"			&& \
+ echo "global is_sunos_test"			&& \
  echo "global is_windows_test"			&& \
+ echo "global is_windows9x_test"		&& \
  echo ""					&& \
- echo "set KILL \"@db_cv_path_kill@\"") > $t
+ echo "global valid_methods"			&& \
+ echo "global checking_valid_methods"		&& \
+ echo "global test_recopts"			&& \
+ echo ""					&& \
+ echo "set KILL \"@KILL@\"") > $t
 
 f=../test/include.tcl
 cmp $t $f > /dev/null 2>&1 ||
@@ -55,13 +63,21 @@ cmp $t $f > /dev/null 2>&1 ||
  echo "global dict"				&& \
  echo "global util_path"			&& \
  echo ""					&& \
+ echo "global is_freebsd_test"			&& \
  echo "global is_hp_test"			&& \
+ echo "global is_linux_test"			&& \
  echo "global is_qnx_test"			&& \
+ echo "global is_sunos_test"			&& \
  echo "global is_windows_test"			&& \
+ echo "global is_windows9x_test"		&& \
+ echo ""					&& \
+ echo "global valid_methods"			&& \
+ echo "global checking_valid_methods"		&& \
+ echo "global test_recopts"			&& \
  echo ""					&& \
  echo "set KILL ./dbkill.exe") > $t
 
-f=../build_win32/include.tcl
+f=../build_windows/include.tcl
 cmp $t $f > /dev/null 2>&1 ||
     (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
 
diff --git a/db/dist/s_vxworks b/db/dist/s_vxworks
old mode 100644
new mode 100755
index fbff44ab0..ff974e676
--- a/db/dist/s_vxworks
+++ b/db/dist/s_vxworks
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$Id: s_vxworks,v 1.52 2004/10/15 18:28:21 bostic Exp $
+#	$Id: s_vxworks,v 12.13 2006/09/13 16:57:49 bostic Exp $
 #
 # Build the VxWorks files.
 
@@ -29,15 +29,17 @@ i\\
 #endif
 }
 /@inttypes_h_decl@/d
-/@stdint_h_decl@/d
 /@stddef_h_decl@/d
+/@stdint_h_decl@/d
+/@unistd_h_decl@/d
+/@thread_h_decl@/d
 s/@u_int8_decl@/typedef unsigned char u_int8_t;/
 /@int16_decl@/d
 s/@u_int16_decl@/typedef unsigned short u_int16_t;/
 /@int32_decl@/d
 s/@u_int32_decl@/typedef unsigned int u_int32_t;/
 s/@int64_decl@//
-s/@u_int64_decl@//
+s/@u_int64_decl@/typedef unsigned long long u_int64_t;/
 /@u_char_decl@/d
 /@u_short_decl@/d
 /@u_int_decl@/d
@@ -46,6 +48,8 @@ s/@u_int64_decl@//
 s/@uintmax_t_decl@/typedef unsigned long uintmax_t;/
 s/@uintptr_t_decl@/typedef unsigned long uintptr_t;/
 s/@db_seq_decl@/typedef int db_seq_t;/
+/@pid_t_decl@/d
+s/@db_threadid_t_decl@/typedef uintmax_t db_threadid_t;/
 s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/
 s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/
 s/@DB_VERSION_PATCH@/$DB_VERSION_PATCH/
@@ -54,11 +58,14 @@ s/@DB_VERSION_UNIQUE_NAME@//
 s/@DB_CONST@//
 s/@DB_PROTO1@/#undef __P/
 s/@DB_PROTO2@/#define	__P(protos)	protos/
+/@platform_header@/d
+/@platform_footer@/d
 ENDOFSEDTEXT
 (echo "$msgc" &&
     sed -f $s ../dbinc/db.in &&
     cat ../dbinc_auto/ext_prot.in) > $t
-`egrep '@.*@' $t` && {
+test `egrep '@.*@' $t` && {
+	egrep '@.*@' $t
 	echo 'Unexpanded autoconf variables found in VxWorks db.h.'
 	exit 1
 }
@@ -67,11 +74,14 @@ cmp $t $f > /dev/null 2>&1 ||
     (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
 
 cat < $s
+s/@INT64_FMT@/#define	INT64_FMT	"%lld"/
+s/@UINT64_FMT@/#define	UINT64_FMT	"%llu"/
 s/@PATH_SEPARATOR@/\/\\\\\\\\/
 s/@db_int_def@//
 ENDOFSEDTEXT
 (echo "$msgc" && sed -f $s ../dbinc/db_int.in) > $t
-`egrep '@.*@' $t` && {
+test `egrep '@.*@' $t` && {
+	egrep '@.*@' $t
 	echo 'Unexpanded autoconf variables found in VxWorks db_int.h.'
 	exit 1
 }
@@ -79,6 +89,21 @@ f=../build_vxworks/db_int.h
 cmp $t $f > /dev/null 2>&1 ||
     (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
 
+# Build the VxWorks db_config.h file.
+# We don't fail, but we complain if the vx_config.in file isn't up-to-date.
+check_config()
+{
+	egrep '^#undef' config.hin |
+	    awk '{print $2}' | sed '/^SIZEOF_/d' | sort > $s
+	(egrep '#undef' $1 | awk '{print $3}'
+	 egrep '^#define' $1 | awk '{print $2}') | sort > $t
+	cmp $s $t || {
+		echo "config.hin and $1 differ"
+		echo "<<< config.hin >>> $1"
+		diff $s $t
+	}
+}
+check_config vx_config.in
 f=../build_vxworks/db_config.h
 (echo "$msgc" && sed "s/__EDIT_DB_VERSION__/$DB_VERSION/" vx_config.in) > $t
 cmp $t $f > /dev/null 2>&1 ||
@@ -97,6 +122,10 @@ f=../build_vxworks/db_config_small.h
 cmp $t $f > /dev/null 2>&1 ||
     (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
 
+f=../build_vxworks/clib_port.h
+cmp clib_port.h $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp clib_port.h $f && chmod 444 $f)
+
 # Build a sed script that will change a "standard" DB utility into
 # VxWorks-compatible code.
 transform()
@@ -163,8 +192,8 @@ ENDOFSEDTEXT
 	echo '#include '
 }
 
-PROGRAM_LIST="db_archive db_checkpoint db_deadlock db_dump db_load \
-    db_printlog db_recover db_stat db_upgrade db_verify ex_access"
+PROGRAM_LIST="db_archive db_checkpoint db_deadlock db_dump db_hotbackup \
+    db_load db_printlog db_recover db_stat db_upgrade db_verify ex_access"
 
 # Build VxWorks versions of the utilities.
 for i in $PROGRAM_LIST; do
@@ -184,21 +213,80 @@ for i in $PROGRAM_LIST; do
 	    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
 done
 
+# Output the build lines for a single utility.
+#	$1 == application name
+util_one()
+{
+	egrep "app=$1" srcfiles.in |
+	awk '{print $1}' |
+	sed 's/ex_access/dbdemo/' > $u
+
+	# Build a list of source files.
+	for i in `cat $u`; do
+		if test "$1" = "ex_access" -o "$1" = `basename $i .c`; then
+			i=`basename $i`
+		else
+			i="\$(PRJ_DIR)/../../$i"
+		fi
+		o=" FILE_$i"
+		
+		echo "${o}_dependDone"
+		echo "FALSE"
+		echo ""
+		echo
+		echo "${o}_dependencies"
+		echo ""
+		echo
+		echo "${o}_objects"
+		echo "`basename $i .c`.o"
+		echo ""
+		echo
+		echo "${o}_tool"
+		echo "C/C++ compiler"
+		echo ""
+		echo
+	done
+	echo " PROJECT_FILES"
+	for i in `cat $u`; do
+		if test "$1" = "ex_access" -o "$1" = `basename $i .c`; then
+			i="`basename $i`"
+		else
+			i="../../$i"
+		fi
+		echo "\$(PRJ_DIR)/$i"
+	done |
+	sed -e '${' \
+	    -e 'p' \
+	    -e 'd' \
+	    -e '}' \
+	    -e 's/$/ \\/'
+	echo ""
+	echo
+	echo " userComments"
+	if test "$1" = "ex_access"; then
+		echo "dbdemo"
+	else
+		echo "$1"
+	fi
+	echo ""
+}
+
 # Build VxWorks Tornado 2.0 project files for the utilities.
 for i in $PROGRAM_LIST; do
 	if [ $i = "ex_access" ]; then
 		target=dbdemo
-		dir=../examples_c
 	else
 		target=$i
-		dir=../$i
 	fi
 
-	sed "s/__DB_APPLICATION_NAME__/$target/g" < vx_2.0/wpj.in > $t
+	(sed -e "s/__DB_APPLICATION_NAME__/$target/g" < vx_2.0/wpj.in
+	    util_one $i) > $t
 	f=../build_vxworks/$target/${target}20.wpj
 	cmp $t $f > /dev/null 2>&1 ||
 	    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
-	sed "s/__DB_APPLICATION_NAME__/$target/g" < vx_2.2/wpj.in > $t
+
+	(sed -e "s/__DB_APPLICATION_NAME__/$target/g" < vx_2.2/wpj.in
+	    util_one $i) > $t
 	f=../build_vxworks/$target/${target}22.wpj
 	cmp $t $f > /dev/null 2>&1 ||
 	    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
@@ -291,4 +379,3 @@ for v in 0 2 ; do
 	cmp $u $f > /dev/null 2>&1 ||
 	    (echo "Building $f" && rm -f $f && cp $u $f && chmod 444 $f)
 done
-
diff --git a/db/dist/s_windows b/db/dist/s_windows
new file mode 100755
index 000000000..b5f46eabf
--- /dev/null
+++ b/db/dist/s_windows
@@ -0,0 +1,197 @@
+#!/bin/sh -
+#	$Id: s_windows,v 12.20 2006/07/13 06:19:45 mjc Exp $
+#
+# Build Windows include files.
+
+msgc="/* DO NOT EDIT: automatically built by dist/s_windows. */"
+msgw="; DO NOT EDIT: automatically built by dist/s_windows."
+
+. RELEASE
+
+s=/tmp/__db_a$$
+t=/tmp/__db_b$$
+rm -f $s $t
+
+trap 'rm -f $s $t ; exit 1' 1 2 3 13 15
+
+# Build the Win32 automatically generated files.
+cat < $s
+/@inttypes_h_decl@/d
+/@stdint_h_decl@/d
+s/@stddef_h_decl@/#include /
+/@unistd_h_decl@/d
+/@thread_h_decl@/d
+s/@u_int8_decl@/typedef unsigned char u_int8_t;/
+s/@int16_decl@/typedef short int16_t;/
+s/@u_int16_decl@/typedef unsigned short u_int16_t;/
+s/@int32_decl@/typedef int int32_t;/
+s/@u_int32_decl@/typedef unsigned int u_int32_t;/
+s/@int64_decl@/typedef __int64 int64_t;/
+s/@u_int64_decl@/typedef unsigned __int64 u_int64_t;/
+s/@db_seq_decl@/typedef int64_t db_seq_t;/
+s/@pid_t_decl@/typedef int pid_t;/
+s/@db_threadid_t_decl@/typedef u_int32_t db_threadid_t;/
+/@u_char_decl@/{
+	i\\
+#ifndef _WINSOCKAPI_
+	s/@u_char_decl@/typedef unsigned char u_char;/
+}
+s/@u_short_decl@/typedef unsigned short u_short;/
+s/@u_int_decl@/typedef unsigned int u_int;/
+/@u_long_decl@/{
+	s/@u_long_decl@/typedef unsigned long u_long;/
+	a\\
+#endif
+}
+/@ssize_t_decl@/{
+	i\\
+#ifdef _WIN64\\
+typedef int64_t ssize_t;\\
+#else\\
+typedef int32_t ssize_t;\\
+#endif
+	d
+}
+s/@uintmax_t_decl@/typedef u_int64_t uintmax_t;/
+/@uintptr_t_decl@/{
+	i\\
+#ifdef _WIN64\\
+typedef u_int64_t uintptr_t;\\
+#else\\
+typedef u_int32_t uintptr_t;\\
+#endif
+	d
+}
+/@platform_header@/{
+	i\\
+/*\\
+\ * Turn off inappropriate compiler warnings\\
+\ */\\
+#ifdef _MSC_VER\\
+/*\\
+\ * This warning is explicitly disabled in Visual C++ by default.\\
+\ * It is necessary to explicitly enable the /Wall flag to generate this\\
+\ * warning.\\
+\ * Since this is a shared include file it should compile without warnings\\
+\ * at the highest warning level, so third party applications can use\\
+\ * higher warning levels cleanly.\\
+\ *\\
+\ * 4820: 'bytes' bytes padding added after member 'member'\\
+\ *       The type and order of elements caused the compiler to\\
+\ *       add padding to the end of a struct.\\
+\ */\\
+#pragma warning(push)\\
+#pragma warning(disable: 4820)\\
+#endif /* _MSC_VER */
+	d
+}
+/@platform_footer@/{
+	i\\
+/* Restore default compiler warnings */\\
+#ifdef _MSC_VER\\
+#pragma warning(pop)\\
+#endif
+	d
+}
+s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/
+s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/
+s/@DB_VERSION_PATCH@/$DB_VERSION_PATCH/
+s/@DB_VERSION_STRING@/"$DB_VERSION_STRING"/
+s/@DB_VERSION_UNIQUE_NAME@//
+s/@DB_CONST@//
+s/@DB_PROTO1@/#undef __P/
+s/@DB_PROTO2@/#define	__P(protos)	protos/
+ENDOFSEDTEXT
+(echo "$msgc" &&
+    sed -f $s ../dbinc/db.in &&
+    cat ../dbinc_auto/ext_prot.in) > $t
+test `egrep '@.*@' $t` && {
+	egrep '@.*@' $t
+	echo 'Unexpanded autoconf variables found in Windows db.h.'
+	exit 1
+}
+f=../build_windows/db.h
+cmp $t $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
+
+cat < $s
+s/@cxx_have_stdheaders@/#define	HAVE_CXX_STDHEADERS 1/
+ENDOFSEDTEXT
+(echo "$msgc" && sed -f $s ../dbinc/db_cxx.in) > $t
+test `egrep '@.*@' $t` && {
+	egrep '@.*@' $t
+	echo 'Unexpanded autoconf variables found in Windows db_cxx.h.'
+	exit 1
+}
+f=../build_windows/db_cxx.h
+cmp $t $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
+
+cat < $s
+s/@INT64_FMT@/#define	INT64_FMT	"%I64d"/
+s/@UINT64_FMT@/#define	UINT64_FMT	"%I64u"/
+s/@PATH_SEPARATOR@/\\\\\\\\\/:/
+s/@db_int_def@//
+ENDOFSEDTEXT
+(echo "$msgc" && sed -f $s ../dbinc/db_int.in) > $t
+test `egrep '@.*@' $t` && {
+	egrep '@.*@' $t
+	echo 'Unexpanded autoconf variables found in Windows db_int.h.'
+	exit 1
+}
+f=../build_windows/db_int.h
+cmp $t $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
+
+# Build the Windows db_config.h file.
+# We don't fail, but we complain if the win_config.in file isn't up-to-date.
+check_config()
+{
+	egrep '^#undef' config.hin |
+	    awk '{print $2}' | sed '/^SIZEOF_/d' | sort > $s
+	(egrep '#undef' $1 | awk '{print $3}'
+	 egrep '^#define' $1 | awk '{print $2}') | sed '/__STDC__/d' | sort > $t
+	cmp $s $t || {
+		echo "config.hin and $1 differ"
+		echo "<<< config.hin >>> $1"
+		diff $s $t
+	}
+}
+check_config win_config.in
+f=../build_windows/db_config.h
+(echo "$msgc" && sed "s/__EDIT_DB_VERSION__/$DB_VERSION/" win_config.in) > $t
+cmp $t $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
+
+f=../build_windows/libdb.rc
+cat < $s
+s/%MAJOR%/$DB_VERSION_MAJOR/
+s/%MINOR%/$DB_VERSION_MINOR/
+s/%PATCH%/$DB_VERSION_PATCH/
+ENDOFSEDTEXT
+sed -f $s ../build_windows/libdbrc.src > $t
+cmp $t $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
+
+f=../build_windows/libdb.def
+(echo $msgw &&
+ echo &&
+ echo EXPORTS;
+a=1
+for i in `sed -e '/^$/d' -e '/^#/d' win_exports.in`; do
+	echo "	$i	@$a"
+	a=`expr $a + 1`
+done) > $t
+cmp $t $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
+
+f=../build_windows/win_db.h
+i=win_db.in
+cmp $i $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp $i $f && chmod 444 $f)
+
+f=../build_windows/clib_port.h
+cmp clib_port.h $f > /dev/null 2>&1 ||
+    (echo "Building $f" && rm -f $f && cp clib_port.h $f && chmod 444 $f)
+
+rm -f $s $t
diff --git a/db/dist/s_windows_dsp b/db/dist/s_windows_dsp
new file mode 100755
index 000000000..c7a94fe64
--- /dev/null
+++ b/db/dist/s_windows_dsp
@@ -0,0 +1,144 @@
+#!/bin/sh -
+#	$Id: s_windows_dsp,v 12.9 2006/07/13 06:19:45 mjc Exp $
+#
+# Build Windows/32 .dsp files.
+
+. RELEASE
+
+SRCFILES=srcfiles.in
+
+create_dsp()
+{
+    projname="$1"       # name of the .dsp file
+    match="$2"          # the string used to egrep the $sources file
+    sources="$3"        # a modified version of $SRCFILES to facilitate matches
+    dsptemplate="$4"    # overall template file for the .dsp
+    extra_cppflags="$5" # extra flags to send to compiler
+    release_libs="$6"   # libraries to link against in Release builds
+    debug_libs="$7"     # libraries to link against in Debug builds
+    lib_suffix="$8"     # the library name is libdb@lib_suffix@@VERSION@
+
+    srctemplate="$BUILDDIR/srcfile_dsp.src"    # template file for the src file fragments
+    dspoutput=$BUILDDIR/$projname.dsp
+
+
+    postbuild=$dspoutput.postbuild
+    if [ ! -f $postbuild ] ; then
+	    postbuild=/dev/null
+    fi
+
+    rm -f $dspoutput.insert
+    for srcpath in `egrep "$match" $sources | sed -e 's/[ 	].*//'`
+    do
+        # take the path name and break it up, converting / to \\.
+        # so many backslashes needed because of shell quoting and
+        # sed quoting -- we'll end up with two backslashes for every
+        # forward slash, but we need that when feeding that to the
+        # later sed command.
+        set - `echo $srcpath | sed -e 's;\(.*\)/;../\\1 ;' \
+            -e "s;$BUILDDIR;.;" \
+            -e 's;/;\\\\\\\\;g'`
+	srcdir="$1"
+	srcfile="$2"
+        sed -e "s/@srcdir@/$srcdir/g" \
+            -e "s/@srcfile@/$srcfile/g" \
+            < $srctemplate >> $dspoutput.insert
+    done
+    sed -e "/@SOURCE_FILES@/r$dspoutput.insert" \
+        -e "/@SOURCE_FILES@/d" \
+        -e "/@POST_BUILD@/r$postbuild" \
+        -e "/@POST_BUILD@/d" \
+        -e "s/@project_name@/$projname/g" \
+        -e "s/@bin_rel_dest@/Release/g" \
+        -e "s/@lib_rel_dest@/Release/g" \
+        -e "s/@bin_debug_dest@/Debug/g" \
+        -e "s/@lib_debug_dest@/Debug/g" \
+        -e "s,@extra_cppflags@,$extra_cppflags,g" \
+        -e "s,@release_libs@,$release_libs,g" \
+        -e "s,@debug_libs@,$debug_libs,g" \
+        -e "s,@lib_suffix@,$lib_suffix,g" \
+        -e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \
+        -e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" \
+      < $dsptemplate > $dspoutput.new
+
+    # Set the file mode to 644 because the VC++ IDE needs a writeable file
+    # in our development environment.
+    cmp $dspoutput.new $dspoutput > /dev/null 2>&1 ||
+	(echo "Building $dspoutput" && rm -f $dspoutput &&
+	    cp $dspoutput.new $dspoutput && chmod 664 $dspoutput)
+    rm -f $dspoutput.insert $dspoutput.new
+}
+
+TMPA=/tmp/swindsp$$a
+trap "rm -f $TMPA; exit 1" 1 2 3 15
+
+# create a copy of the srcfiles with comments and empty lines removed.
+# add a space at the end of each list of modules so that each module
+# can be unambiguously matched e.g. ' dynamic '
+sed -e "s/#.*$//" \
+    -e "/^[ 	]*$/d" \
+    -e "s/[ 	][ 	]*/ /" \
+    -e "s/[ 	]*$//" \
+    -e "/[	 ]/!d" \
+    -e "s/$/ /" < $SRCFILES > $TMPA
+
+# get a list of all modules mentioned
+#
+MODULES="`sed -e 's/^[^ ]* //' < $TMPA \
+    | tr ' ' '\012' | sort | uniq`"
+
+for BUILDDIR in ../build_windows
+do
+    for module in $MODULES
+    do
+        case "$module" in
+        dynamic )
+            create_dsp db_dll " $module " $TMPA $BUILDDIR/dynamic_dsp.src \
+                '' 'ws2_32.lib' 'ws2_32.lib'
+            ;;
+        small )
+            create_dsp db_small " $module " $TMPA $BUILDDIR/static_dsp.src \
+                '/D "HAVE_SMALLBUILD"' '' '' _small
+            ;;
+        static )
+            create_dsp db_static " $module " $TMPA $BUILDDIR/static_dsp.src
+            ;;
+        java )
+            create_dsp db_java " $module " $TMPA $BUILDDIR/dynamic_dsp.src '' \
+                'libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib' \
+                'libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib' _java
+            ;;
+        tcl )
+            create_dsp db_tcl " $module " $TMPA $BUILDDIR/dynamic_dsp.src \
+                '/D "DB_TCL_SUPPORT"' \
+                'libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib tcl84.lib' \
+                'libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib tcl84g.lib' _tcl
+            ;;
+        testutil )
+            create_dsp db_test " $module " $TMPA $BUILDDIR/app_dsp.src \
+	        '' '/out:"dbkill.exe"' '/out:"dbkill.exe"'
+            ;;
+        app=* )
+            appname=`echo $module | sed -e 's/^app=//'`
+            case "$appname" in
+            ex_rep_base )
+                libs='ws2_32.lib'
+                ;;
+            * )
+                libs=''
+                ;;
+            esac
+            create_dsp $appname " $module " $TMPA $BUILDDIR/app_dsp.src '' \
+                $libs $libs
+            ;;
+        vx|vxsmall )
+            ;;
+        * )
+            echo \
+    "s_windows_dsp: module name $module in $SRCFILES is unknown type"
+            ;;
+        esac
+    done
+done
+
+rm -f $TMPA
diff --git a/db/dist/s_winmsi b/db/dist/s_winmsi
new file mode 100644
index 000000000..77acd0e4b
--- /dev/null
+++ b/db/dist/s_winmsi
@@ -0,0 +1,134 @@
+#!/bin/bash -
+#	$Id: s_winmsi,v 1.8 2005/12/01 03:04:20 bostic Exp $
+#
+# Note: The s_winmsi script in Berkeley DB core closely parallels the
+# s_winmsi script in Berkeley DB/XML.  If you change one,
+# consider whether your changes apply to the other.
+# As of this writing, the two s_winmsi scripts 'diff' very closely, and
+# identical portions have been factored into functions in s_winmsi.fcn.
+#
+#   Usage: s_winmsi [ options ]
+#
+# See the Usage() function in s_winmsi.fcn for a full list of options.
+# By default, this script expects a db-X.Y.Z.NC.zip file
+# to be in this directory, and uses it to build all binaries
+# needed for an Windows install, and finally builds the an
+# output db-X.Y.Z.NC.msi file that can be installed on
+# Windows XP and 2000.
+#
+# The major other inputs to this script are these files:
+#
+#   features.in        list of choosable features (like Java,PHP,...)
+#   files.in           what files are in each feature and where they belong
+#   links.in           a list of URLs that end up as part of the Start Menu
+#   environment.in     a list of environment vars that must be set
+#
+# This script does a number of operations, using the directory
+# './winmsi/stage' as a staging area:
+#
+#   extracts the contents of the input ZIP file and uses those
+#   files (minus docs/...) to build a Sources directory for
+#   the Sources features.
+#
+#   builds Berkeley DB using Visual Studio tools using a .BAT
+#   script derived from winbuild.in .
+#
+#   builds Perl and other APIs .
+#
+#   uses {features,files,links,environment}.in to build some include
+#   files in WiX XML format.  These files are named
+#   *.wixinc (e.g. directory.wixinc)
+#
+#   run m4 on dbcorewix.in to create dbcore.wxs .  dbcorewix.in
+#   uses m4 macros to allow reasonable refactoring of repeated
+#   UI code.  Also, m4 is used to include the files created in
+#   the previous step.
+#
+#   Use the WiX compiler/linker on the .wxs files to create the .msi file.
+#
+################################################################
+
+# Define all needed shell functions
+. ./winmsi/s_winmsi.fcn
+
+ERRORLOG="$0".log
+SetupErrorLog
+
+# Do this before parsing options, we need the version number
+. ./RELEASE
+dbver=db-$DB_VERSION.NC
+
+# Set variables used by functions to customize this installer
+PRODUCT_NAME="Berkeley DB"
+PRODUCT_VERSION="$DB_VERSION"
+PRODUCT_STAGE=`pwd`/winmsi/stage
+PRODUCT_LICENSEDIR="${PRODUCT_STAGE}/$dbver"
+PRODUCT_SUB_BLDDIR="${PRODUCT_STAGE}/$dbver"
+PRODUCT_BLDDIR="${PRODUCT_STAGE}/$dbver"
+PRODUCT_SRCDIR="${PRODUCT_STAGE}/$dbver"
+PRODUCT_DBBUILDDIR="${PRODUCT_STAGE}/$dbver/build_unix"
+PRODUCT_SHARED_WINMSIDIR=`pwd`/winmsi
+PRODUCT_IMAGEDIR=$PRODUCT_SHARED_WINMSIDIR/images
+PRODUCT_ZIP_FILEFMT="db-X.Y.Z.NC.zip"
+PRODUCT_MSI_FILEFMT="db-X.Y.Z.NC.msi"
+
+PRODUCT_MAJOR=`echo "$PRODUCT_VERSION" | \
+    sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
+PRODUCT_MINOR=`echo "$PRODUCT_VERSION" | \
+    sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
+PRODUCT_PATCH=`echo "$PRODUCT_VERSION" | \
+    sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
+PRODUCT_MAJMIN="${PRODUCT_MAJOR}${PRODUCT_MINOR}"
+
+# Gather command line options, and use reasonable defaults
+SetupOptions \
+        -input "$dbver.zip" \
+        -output "$dbver.msi" \
+        "$@"
+
+if [ "$OPT_USEBUILD" != '' ]; then
+    PRODUCT_BLDDIR="${OPT_USEBUILD}"
+    PRODUCT_SUB_BLDDIR="${OPT_USEBUILD}"
+fi
+
+Progress "s_winmsi starting, errors to $ERRORLOG"
+
+# Fail fast for certain missing files
+
+RequireCygwin
+RequireJava
+RequireTcl
+RequireWix
+RequirePerl
+
+CreateStage
+cd ${PRODUCT_STAGE}
+
+
+CreateSources ${PRODUCT_STAGE}/Sources
+
+# The docs are put into a separate feature set
+mv ${PRODUCT_STAGE}/Sources/docs ${PRODUCT_STAGE}/
+
+# Build everything unless we were told to use a preexisting build
+if [ "$OPT_USEBUILD" = '' ]; then
+    CreateWindowsBuild
+    CreateWindowsSystem
+    CreateInclude \
+        ${PRODUCT_SUB_BLDDIR}/installed_include \
+        ${PRODUCT_SUB_BLDDIR}/dbinc/* \
+        ${PRODUCT_SUB_BLDDIR}/dbinc_auto/* \
+        ${PRODUCT_SUB_BLDDIR}/build_windows/*.h
+    CreateDbPerl
+fi
+
+if ! "$OPT_SKIPGEN" ; then
+  CreateLicenseRtf ../../../LICENSE license.rtf
+  CreateWixIncludeFiles
+fi
+
+CreateMsi ../dbcorewix.in dbcore.wxs "$OPT_OUTFILE"
+
+Progress "s_winmsi finished, $OPT_OUTFILE created."
+exit 0
+
diff --git a/db/dist/srcfiles.in b/db/dist/srcfiles.in
index b00be5a10..870ab3be4 100644
--- a/db/dist/srcfiles.in
+++ b/db/dist/srcfiles.in
@@ -1,8 +1,8 @@
-#	$Id: srcfiles.in,v 1.87 2004/10/30 21:07:01 bostic Exp $
+#	$Id: srcfiles.in,v 12.53 2006/09/09 14:08:39 bostic Exp $
 #
-# This is an input file for the s_win32_dsp and s_vxworks scripts.  It lists
+# This is an input file for the s_windows_dsp and s_vxworks scripts.  It lists
 # the source files in the Berkeley DB tree and notes which are used to build
-# the Win/32 and VxWorks libraries.
+# the Windows and VxWorks libraries.
 #
 # Please keep this list sorted alphabetically!
 #
@@ -21,6 +21,7 @@
 #   vx			File is in the VxWorks library.
 #   vxsmall		File is in the small VxWorks library.
 
+btree/bt_compact.c				dynamic small static vx vxsmall
 btree/bt_compare.c				dynamic small static vx vxsmall
 btree/bt_conv.c					dynamic small static vx vxsmall
 btree/bt_curadj.c				dynamic small static vx vxsmall
@@ -44,6 +45,7 @@ build_vxworks/db_archive/db_archive.c
 build_vxworks/db_checkpoint/db_checkpoint.c
 build_vxworks/db_deadlock/db_deadlock.c
 build_vxworks/db_dump/db_dump.c
+build_vxworks/db_hotbackup/db_hotbackup.c
 build_vxworks/db_load/db_load.c
 build_vxworks/db_printlog/db_printlog.c
 build_vxworks/db_recover/db_recover.c
@@ -51,27 +53,46 @@ build_vxworks/db_stat/db_stat.c
 build_vxworks/db_upgrade/db_upgrade.c
 build_vxworks/db_verify/db_verify.c
 build_vxworks/dbdemo/dbdemo.c
-build_win32/dbkill.cpp				testutil
-build_win32/libdb.def				dynamic
-build_win32/libdb.rc				dynamic
-build_win32/libdb_tcl.def			tcl
+build_windows/dbkill.cpp			testutil
+build_windows/libdb.def				dynamic
+build_windows/libdb.rc				dynamic
+build_windows/libdb_tcl.def			tcl
+clib/abort.c
+clib/atoi.c
+clib/atol.c
+clib/ctime.c					dynamic small static vx vxsmall
+clib/getaddrinfo.c				dynamic static
 clib/getcwd.c
 clib/getopt.c					vx vxsmall
+clib/isalpha.c
+clib/isdigit.c
+clib/isprint.c
+clib/isspace.c
 clib/memcmp.c
 clib/memmove.c
+clib/printf.c
 clib/raise.c
+clib/rand.c
 clib/snprintf.c					vx vxsmall
 clib/strcasecmp.c				dynamic small static vx vxsmall
+clib/strcat.c
+clib/strchr.c
 clib/strdup.c					vx vxsmall
 clib/strerror.c
+clib/strncat.c
+clib/strncmp.c
+clib/strrchr.c
+clib/strsep.c					dynamic small static vx vxsmall
 clib/strtol.c
 clib/strtoul.c
 common/crypto_stub.c				small vxsmall
 common/db_byteorder.c				dynamic small static vx vxsmall
+common/db_clock.c				dynamic static vx
 common/db_err.c					dynamic small static vx vxsmall
 common/db_getlong.c				dynamic small static vx vxsmall
 common/db_idspace.c				dynamic small static vx vxsmall
 common/db_log2.c				dynamic small static vx vxsmall
+common/mkpath.c					dynamic small static vx vxsmall
 common/util_arg.c				vx vxsmall
 common/util_cache.c				dynamic small static vx vxsmall
 common/util_log.c				dynamic small static vx vxsmall
@@ -100,6 +121,7 @@ db/db_am.c					dynamic small static vx vxsmall
 db/db_auto.c					dynamic small static vx vxsmall
 db/db_autop.c					app=db_printlog
 db/db_cam.c					dynamic small static vx vxsmall
+db/db_cds.c					dynamic small static vx vxsmall
 db/db_conv.c					dynamic small static vx vxsmall
 db/db_dispatch.c				dynamic small static vx vxsmall
 db/db_dup.c					dynamic small static vx vxsmall
@@ -131,6 +153,7 @@ db_checkpoint/db_checkpoint.c			app=db_checkpoint
 db_deadlock/db_deadlock.c			app=db_deadlock
 db_dump/db_dump.c				app=db_dump
 db_dump185/db_dump185.c
+db_hotbackup/db_hotbackup.c			app=db_hotbackup
 db_load/db_load.c				app=db_load
 db_printlog/db_printlog.c			app=db_printlog
 db_recover/db_recover.c				app=db_recover
@@ -149,13 +172,25 @@ dbreg/dbreg_stat.c				dynamic small static vx vxsmall
 dbreg/dbreg_util.c				dynamic small static vx vxsmall
 env/db_salloc.c					dynamic small static vx vxsmall
 env/db_shash.c					dynamic small static vx vxsmall
+env/env_config.c				dynamic small static vx vxsmall
+env/env_failchk.c				dynamic small static vx vxsmall
 env/env_file.c					dynamic small static vx vxsmall
 env/env_method.c				dynamic small static vx vxsmall
 env/env_open.c					dynamic small static vx vxsmall
 env/env_recover.c				dynamic small static vx vxsmall
 env/env_region.c				dynamic small static vx vxsmall
+env/env_register.c				dynamic small static vx vxsmall
 env/env_stat.c					dynamic small static vx vxsmall
 examples_c/bench_001.c
+examples_c/csv/DbRecord.c			app=ex_csvload app=ex_csvquery
+examples_c/csv/code.c				app=ex_csvcode
+examples_c/csv/csv_local.c			app=ex_csvload app=ex_csvquery
+examples_c/csv/db.c				app=ex_csvload app=ex_csvquery
+examples_c/csv/load.c				app=ex_csvload
+examples_c/csv/load_main.c			app=ex_csvload
+examples_c/csv/query.c				app=ex_csvquery
+examples_c/csv/query_main.c			app=ex_csvquery
+examples_c/csv/util.c				app=ex_csvload app=ex_csvquery
 examples_c/ex_access.c				app=ex_access
 examples_c/ex_apprec/ex_apprec.c
 examples_c/ex_apprec/ex_apprec_auto.c
@@ -166,27 +201,33 @@ examples_c/ex_dbclient.c
 examples_c/ex_env.c				app=ex_env
 examples_c/ex_lock.c				app=ex_lock
 examples_c/ex_mpool.c				app=ex_mpool
-examples_c/ex_repquote/ex_rq_client.c		app=ex_repquote
-examples_c/ex_repquote/ex_rq_main.c		app=ex_repquote
-examples_c/ex_repquote/ex_rq_master.c		app=ex_repquote
-examples_c/ex_repquote/ex_rq_net.c		app=ex_repquote
-examples_c/ex_repquote/ex_rq_util.c		app=ex_repquote
-examples_c/ex_sequence.c
+examples_c/ex_rep/base/rep_base.c		app=ex_rep_base
+examples_c/ex_rep/base/rep_msg.c		app=ex_rep_base
+examples_c/ex_rep/base/rep_net.c		app=ex_rep_base
+examples_c/ex_rep/common/rep_common.c		app=ex_rep_base app=ex_rep_mgr
+examples_c/ex_rep/mgr/rep_mgr.c			app=ex_rep_mgr
+examples_c/ex_sequence.c			app=ex_sequence
 examples_c/ex_thread.c
 examples_c/ex_tpcb.c				app=ex_tpcb
-examples_c/getting_started/example_database_load.c
-examples_c/getting_started/example_database_read.c
-examples_c/getting_started/gettingstarted_common.c
+examples_c/getting_started/example_database_load.c	app=example_database_load
+examples_c/getting_started/example_database_read.c	app=example_database_read
+examples_c/getting_started/gettingstarted_common.c	app=example_database_load app=example_database_read
+examples_c/txn_guide/txn_guide.c		app=ex_txnguide
+examples_c/txn_guide/txn_guide_inmemory.c	app=ex_txnguide_inmem
 examples_cxx/AccessExample.cpp			app=excxx_access
 examples_cxx/BtRecExample.cpp			app=excxx_btrec
 examples_cxx/EnvExample.cpp			app=excxx_env
 examples_cxx/LockExample.cpp			app=excxx_lock
 examples_cxx/MpoolExample.cpp			app=excxx_mpool
-examples_cxx/SequenceExample.cpp
+examples_cxx/SequenceExample.cpp		app=excxx_sequence
 examples_cxx/TpcbExample.cpp			app=excxx_tpcb
-examples_cxx/getting_started/MyDb.cpp
-examples_cxx/getting_started/excxx_example_database_load.cpp
-examples_cxx/getting_started/excxx_example_database_read.cpp
+examples_cxx/excxx_repquote/RepConfigInfo.cpp	app=excxx_repquote
+examples_cxx/excxx_repquote/RepQuoteExample.cpp	app=excxx_repquote
+examples_cxx/getting_started/MyDb.cpp		app=excxx_example_database_load app=excxx_example_database_read
+examples_cxx/getting_started/excxx_example_database_load.cpp	app=excxx_example_database_load
+examples_cxx/getting_started/excxx_example_database_read.cpp	app=excxx_example_database_read
+examples_cxx/txn_guide/TxnGuide.cpp		app=excxx_txnguide
+examples_cxx/txn_guide/TxnGuideInMemory.cpp	app=excxx_txnguide_inmem
 fileops/fileops_auto.c				dynamic small static vx vxsmall
 fileops/fileops_autop.c				app=db_printlog
 fileops/fop_basic.c				dynamic small static vx vxsmall
@@ -215,6 +256,7 @@ hsearch/hsearch.c				dynamic static vx
 libdb_java/db_java_wrap.c			java
 lock/lock.c					dynamic small static vx vxsmall
 lock/lock_deadlock.c				dynamic small static vx vxsmall
+lock/lock_failchk.c				dynamic small static vx vxsmall
 lock/lock_id.c					dynamic small static vx vxsmall
 lock/lock_list.c				dynamic small static vx vxsmall
 lock/lock_method.c				dynamic small static vx vxsmall
@@ -225,6 +267,7 @@ lock/lock_util.c				dynamic small static vx vxsmall
 log/log.c					dynamic small static vx vxsmall
 log/log_archive.c				dynamic small static vx vxsmall
 log/log_compare.c				dynamic small static vx vxsmall
+log/log_debug.c					dynamic small static vx vxsmall
 log/log_get.c					dynamic small static vx vxsmall
 log/log_method.c				dynamic small static vx vxsmall
 log/log_put.c					dynamic small static vx vxsmall
@@ -237,17 +280,22 @@ mp/mp_fopen.c					dynamic small static vx vxsmall
 mp/mp_fput.c					dynamic small static vx vxsmall
 mp/mp_fset.c					dynamic small static vx vxsmall
 mp/mp_method.c					dynamic small static vx vxsmall
+mp/mp_mvcc.c					dynamic small static vx vxsmall
 mp/mp_region.c					dynamic small static vx vxsmall
 mp/mp_register.c				dynamic small static vx vxsmall
 mp/mp_stat.c					dynamic small static vx vxsmall
 mp/mp_sync.c					dynamic small static vx vxsmall
 mp/mp_trickle.c					dynamic small static vx vxsmall
+mutex/mut_alloc.c				dynamic small static vx vxsmall
+mutex/mut_failchk.c				dynamic small static vx vxsmall
 mutex/mut_fcntl.c
+mutex/mut_method.c				dynamic small static vx vxsmall
 mutex/mut_pthread.c
+mutex/mut_region.c				dynamic small static vx vxsmall
+mutex/mut_stat.c				dynamic small static vx vxsmall
 mutex/mut_tas.c					vx vxsmall
 mutex/mut_win32.c				dynamic small static
-mutex/mutex.c					dynamic small static vx vxsmall
-mutex/tm.c
+mutex/tm.c					app=tm
 os/os_abs.c
 os/os_alloc.c					dynamic small static vx vxsmall
 os/os_clock.c					vx vxsmall
@@ -255,17 +303,21 @@ os/os_config.c
 os/os_dir.c					vx vxsmall
 os/os_errno.c					vx vxsmall
 os/os_fid.c					vx vxsmall
+os/os_flock.c					vx vxsmall
 os/os_fsync.c					vx vxsmall
+os/os_fzero.c					dynamic small static vx vxsmall
+os/os_getenv.c					vx vxsmall
 os/os_handle.c					vx vxsmall
-os/os_id.c					dynamic small static vx vxsmall
 os/os_map.c
-os/os_method.c					dynamic small static vx vxsmall
+os/os_method.c					vx vxsmall
+os/os_mkdir.c					dynamic small static vx vxsmall
 os/os_oflags.c					dynamic small static vx vxsmall
 os/os_open.c					vx vxsmall
+os/os_pid.c					dynamic small static vx vxsmall
 os/os_region.c					dynamic small static vx vxsmall
 os/os_rename.c					vx vxsmall
 os/os_root.c					dynamic small static vx vxsmall
-os/os_rpath.c					dynamic small static vx vxsmall
+os/os_rpath.c					dynamic small static
 os/os_rw.c					vx vxsmall
 os/os_seek.c					vx vxsmall
 os/os_sleep.c					vx vxsmall
@@ -273,28 +325,60 @@ os/os_spin.c					vx vxsmall
 os/os_stat.c					vx vxsmall
 os/os_tmpdir.c					dynamic small static vx vxsmall
 os/os_truncate.c				vx vxsmall
+os/os_uid.c					dynamic small static vx vxsmall
 os/os_unlink.c					vx vxsmall
+os/os_yield.c					vx vxsmall
+os_brew/abort.c
+os_brew/ctime.c
+os_brew/fclose.c
+os_brew/fgetc.c
+os_brew/fgets.c
+os_brew/fopen.c
+os_brew/fwrite.c
+os_brew/getcwd.c
+os_brew/localtime.c
+os_brew/os_abs.c
+os_brew/os_config.c
+os_brew/os_dir.c
+os_brew/os_errno.c
+os_brew/os_handle.c
+os_brew/os_mkdir.c
+os_brew/os_oflags.c
+os_brew/os_open.c
+os_brew/os_pid.c
+os_brew/os_rename.c
+os_brew/os_rw.c
+os_brew/os_seek.c
+os_brew/os_sleep.c
+os_brew/os_stat.c
+os_brew/os_truncate.c
+os_brew/os_unlink.c
+os_brew/time.c
 os_vxworks/os_vx_abs.c				vx vxsmall
 os_vxworks/os_vx_config.c			vx vxsmall
 os_vxworks/os_vx_map.c				vx vxsmall
-os_win32/os_abs.c				dynamic small static
-os_win32/os_clock.c				dynamic small static
-os_win32/os_config.c				dynamic small static
-os_win32/os_dir.c				dynamic small static
-os_win32/os_errno.c				dynamic small static
-os_win32/os_fid.c				dynamic small static
-os_win32/os_fsync.c				dynamic small static
-os_win32/os_handle.c				dynamic small static
-os_win32/os_map.c				dynamic small static
-os_win32/os_open.c				dynamic small static
-os_win32/os_rename.c				dynamic small static
-os_win32/os_rw.c				dynamic small static
-os_win32/os_seek.c				dynamic small static
-os_win32/os_sleep.c				dynamic small static
-os_win32/os_spin.c				dynamic small static
-os_win32/os_stat.c				dynamic small static
-os_win32/os_truncate.c				dynamic small static
-os_win32/os_unlink.c				dynamic small static
+os_vxworks/os_vx_rpath.c			vx vxsmall
+os_windows/os_abs.c				dynamic small static
+os_windows/os_clock.c				dynamic small static
+os_windows/os_config.c				dynamic small static
+os_windows/os_dir.c				dynamic small static
+os_windows/os_errno.c				dynamic small static
+os_windows/os_fid.c				dynamic small static
+os_windows/os_flock.c				dynamic small static
+os_windows/os_fsync.c				dynamic small static
+os_windows/os_getenv.c				dynamic small static
+os_windows/os_handle.c				dynamic small static
+os_windows/os_map.c				dynamic small static
+os_windows/os_open.c				dynamic small static
+os_windows/os_rename.c				dynamic small static
+os_windows/os_rw.c				dynamic small static
+os_windows/os_seek.c				dynamic small static
+os_windows/os_sleep.c				dynamic small static
+os_windows/os_spin.c				dynamic small static
+os_windows/os_stat.c				dynamic small static
+os_windows/os_truncate.c			dynamic small static
+os_windows/os_unlink.c				dynamic small static
+os_windows/os_yield.c				dynamic small static
 qam/qam.c					dynamic static vx
 qam/qam_auto.c					dynamic static vx
 qam/qam_autop.c					app=db_printlog
@@ -310,12 +394,25 @@ qam/qam_verify.c				dynamic static vx
 rep/rep_auto.c					dynamic static vx
 rep/rep_autop.c					app=db_printlog
 rep/rep_backup.c				dynamic static vx
+rep/rep_elect.c					dynamic static vx
+rep/rep_log.c					dynamic static vx
 rep/rep_method.c				dynamic static vx
 rep/rep_record.c				dynamic static vx
 rep/rep_region.c				dynamic static vx
 rep/rep_stat.c					dynamic static vx
 rep/rep_stub.c					small vxsmall
 rep/rep_util.c					dynamic static vx
+rep/rep_verify.c				dynamic static vx
+repmgr/repmgr_elect.c				dynamic static
+repmgr/repmgr_method.c				dynamic static
+repmgr/repmgr_msg.c				dynamic static
+repmgr/repmgr_net.c				dynamic static
+repmgr/repmgr_posix.c
+repmgr/repmgr_queue.c				dynamic static
+repmgr/repmgr_sel.c				dynamic static
+repmgr/repmgr_stat.c				dynamic static
+repmgr/repmgr_util.c				dynamic static
+repmgr/repmgr_windows.c				dynamic static
 rpc_client/client.c
 rpc_client/gen_client.c
 rpc_client/gen_client_ret.c
@@ -350,7 +447,7 @@ test_perf/perf_log.c				app=db_perf
 test_perf/perf_misc.c				app=db_perf
 test_perf/perf_op.c				app=db_perf
 test_perf/perf_parse.c				app=db_perf
-test_perf/perf_rand.c				app=db_perf
+test_perf/perf_rand.c				app=db_perf app=db_reptest
 test_perf/perf_spawn.c				app=db_perf
 test_perf/perf_stat.c				app=db_perf
 test_perf/perf_sync.c				app=db_perf
@@ -359,9 +456,34 @@ test_perf/perf_trickle.c			app=db_perf
 test_perf/perf_txn.c				app=db_perf
 test_perf/perf_util.c				app=db_perf
 test_perf/perf_vx.c
+test_rep/db_reptest.c				app=db_reptest
+test_rep/reptest_accept.c			app=db_reptest
+test_rep/reptest_client.c			app=db_reptest
+test_rep/reptest_config.c			app=db_reptest
+test_rep/reptest_dbs.c				app=db_reptest
+test_rep/reptest_debug.c			app=db_reptest
+test_rep/reptest_elect.c			app=db_reptest
+test_rep/reptest_env.c				app=db_reptest
+test_rep/reptest_exec.c				app=db_reptest
+test_rep/reptest_file.c				app=db_reptest
+test_rep/reptest_key.c				app=db_reptest
+test_rep/reptest_master.c			app=db_reptest
+test_rep/reptest_misc.c				app=db_reptest
+test_rep/reptest_msg_thread.c			app=db_reptest
+test_rep/reptest_op.c				app=db_reptest
+test_rep/reptest_parse.c			app=db_reptest
+test_rep/reptest_send.c				app=db_reptest
+test_rep/reptest_site.c				app=db_reptest
+test_rep/reptest_socket.c			app=db_reptest
+test_rep/reptest_spawn.c			app=db_reptest
+test_rep/reptest_thread.c			app=db_reptest
+test_rep/reptest_txn.c				app=db_reptest
+test_rep/reptest_util.c				app=db_reptest
 txn/txn.c					dynamic small static vx vxsmall
 txn/txn_auto.c					dynamic small static vx vxsmall
 txn/txn_autop.c					app=db_printlog
+txn/txn_chkpt.c					dynamic small static vx vxsmall
+txn/txn_failchk.c				dynamic small static vx vxsmall
 txn/txn_method.c				dynamic small static vx vxsmall
 txn/txn_rec.c					dynamic small static vx vxsmall
 txn/txn_recover.c				dynamic small static vx vxsmall
diff --git a/db/dist/tags b/db/dist/tags
index 479f7d5f9..46ff0c65d 100644
--- a/db/dist/tags
+++ b/db/dist/tags
@@ -1,559 +1,698 @@
+ACK_WAITER	../repmgr/repmgr_windows.c	/^} ACK_WAITER;$/
+ACK_WAITERS_TABLE	../dbinc/repmgr.h	/^struct __ack_waiters_table;$/
 ACQUIRE	../btree/bt_cursor.c	/^#define	ACQUIRE(dbc, mode, lpgno, lock, fpgno, pag/
-ACQUIRE_COUPLE	../btree/bt_cursor.c	/^#define	ACQUIRE_COUPLE(dbc, mode, lpgno, lock, fpg/
-ACQUIRE_CUR	../btree/bt_cursor.c	/^#define	ACQUIRE_CUR(dbc, mode, p, ret) do {				\\$/
-ACQUIRE_CUR_COUPLE	../btree/bt_cursor.c	/^#define	ACQUIRE_CUR_COUPLE(dbc, mode, p, ret) do {/
+ACQUIRE_CUR	../btree/bt_cursor.c	/^#define	ACQUIRE_CUR(dbc, mode, p, flags, ret) do {/
 ACQUIRE_WRITE_LOCK	../btree/bt_cursor.c	/^#define	ACQUIRE_WRITE_LOCK(dbc, ret) do {				\\$/
-ACTION	../dbinc/db.in	2149
-ACTIVATE_CTP	../dbinc/db_server_int.h	/^#define	ACTIVATE_CTP(ctp, id, type) {		\\$/
+ACTION	../dbinc/db.in	/^} ACTION;$/
+ACTIVATE_CTP	../dbinc/db_server_int.h	/^#define	ACTIVATE_CTP(ctp, id, type) {					\\$/
+ADDRINFO	../dbinc/repmgr.h	/^typedef struct addrinfo	ADDRINFO;$/
+ADDR_LIST_CURRENT	../dbinc/repmgr.h	/^#define	ADDR_LIST_CURRENT(na)	((na)->current)$/
+ADDR_LIST_FIRST	../dbinc/repmgr.h	/^#define	ADDR_LIST_FIRST(na)	((na)->current = (na)-/
+ADDR_LIST_NEXT	../dbinc/repmgr.h	/^#define	ADDR_LIST_NEXT(na)	((na)->current = (na)->/
+ADD_CONFIG_NAME	../tcl/tcl_db_pkg.c	/^#define	ADD_CONFIG_NAME(name)						\\$/
+AES_CIPHER	../dbinc/crypto.h	/^} AES_CIPHER;$/
+AI_CANONNAME	../dbinc/repmgr.h	/^#define	AI_CANONNAME	0x02$/
+AI_NUMERICHOST	../dbinc/repmgr.h	/^#define	AI_NUMERICHOST	0x04$/
+AI_PASSIVE	../dbinc/repmgr.h	/^#define	AI_PASSIVE	0x01$/
 ALIGNP_DEC	../dbinc/db_int.in	/^#define	ALIGNP_DEC(p, bound)						\\$/
 ALIGNP_INC	../dbinc/db_int.in	/^#define	ALIGNP_INC(p, bound)						\\$/
+ALIVE_ON	../dbinc/db_int.in	/^#define	ALIVE_ON(dbenv)		((dbenv)->is_alive != NUL/
+ALREADY_FLUSHED	../log/log_put.c	/^#define	ALREADY_FLUSHED(lp, lsnp)					\\$/
 ANYSITE	../rep/rep_record.c	/^#define	ANYSITE(rep)$/
-APPNAME	../dbinc/db_int.in	292
-BACKUP_PREFIX	../db/db.c	1007
-BADARG	../clib/getopt.c	59
-BADCH	../clib/getopt.c	57
-BAD_BLOCK_LENGTH	../crypto/rijndael/rijndael-api-fst.h	64
-BAD_CIPHER_INSTANCE	../crypto/rijndael/rijndael-api-fst.h	65
-BAD_CIPHER_MODE	../crypto/rijndael/rijndael-api-fst.h	62
-BAD_CIPHER_STATE	../crypto/rijndael/rijndael-api-fst.h	63
-BAD_DATA	../crypto/rijndael/rijndael-api-fst.h	66
-BAD_KEY_DIR	../crypto/rijndael/rijndael-api-fst.h	59
-BAD_KEY_INSTANCE	../crypto/rijndael/rijndael-api-fst.h	61
-BAD_KEY_MAT	../crypto/rijndael/rijndael-api-fst.h	60
-BAD_KILLID	../lock/lock_deadlock.c	40
-BAD_OTHER	../crypto/rijndael/rijndael-api-fst.h	67
-BFMSG	../db185/db185.c	176
-BH	../dbinc/mp.h	13
-BH_CALLPGIN	../dbinc/mp.h	331
-BH_DIRTY	../dbinc/mp.h	332
-BH_DIRTY_CREATE	../dbinc/mp.h	333
-BH_DISCARD	../dbinc/mp.h	334
-BH_FREE_FREEMEM	../dbinc/mp.h	318
-BH_FREE_UNLOCKED	../dbinc/mp.h	319
-BH_LOCKED	../dbinc/mp.h	335
-BH_TRASH	../dbinc/mp.h	336
+APPNAME	../dbinc/db_int.in	/^} APPNAME;$/
+BACKUP_PREFIX	../db/db.c	/^#define	BACKUP_PREFIX	"__db"$/
+BADARG	../clib/getopt.c	/^#define	BADARG	(int)':'$/
+BADCH	../clib/getopt.c	/^#define	BADCH	(int)'?'$/
+BAD_BLOCK_LENGTH	../crypto/rijndael/rijndael-api-fst.h	/^#define     BAD_BLOCK_LENGTH     -6$/
+BAD_CIPHER_INSTANCE	../crypto/rijndael/rijndael-api-fst.h	/^#define     BAD_CIPHER_INSTANCE  -7$/
+BAD_CIPHER_MODE	../crypto/rijndael/rijndael-api-fst.h	/^#define     BAD_CIPHER_MODE      -4 \/*  Params st/
+BAD_CIPHER_STATE	../crypto/rijndael/rijndael-api-fst.h	/^#define     BAD_CIPHER_STATE     -5 \/*  Cipher in/
+BAD_DATA	../crypto/rijndael/rijndael-api-fst.h	/^#define     BAD_DATA             -8 \/*  Data cont/
+BAD_KEY_DIR	../crypto/rijndael/rijndael-api-fst.h	/^#define     BAD_KEY_DIR          -1 \/*  Key direc/
+BAD_KEY_INSTANCE	../crypto/rijndael/rijndael-api-fst.h	/^#define     BAD_KEY_INSTANCE     -3 \/*  Key passe/
+BAD_KEY_MAT	../crypto/rijndael/rijndael-api-fst.h	/^#define     BAD_KEY_MAT          -2 \/*  Key mater/
+BAD_KILLID	../lock/lock_deadlock.c	/^#define	BAD_KILLID	0xffffffff$/
+BAD_OTHER	../crypto/rijndael/rijndael-api-fst.h	/^#define     BAD_OTHER            -9 \/*  Unknown e/
+BFMSG	../db185/db185.c	/^#define	BFMSG \\$/
+BH	../dbinc/mp.h	/^struct __bh;		typedef struct __bh BH;$/
+BH_CALLPGIN	../dbinc/mp.h	/^#define	BH_CALLPGIN	0x001		\/* Convert the page be/
+BH_DIRTY	../dbinc/mp.h	/^#define	BH_DIRTY	0x002		\/* Page is modified. *\/$/
+BH_DIRTY_CREATE	../dbinc/mp.h	/^#define	BH_DIRTY_CREATE	0x004		\/* Page is modifie/
+BH_DISCARD	../dbinc/mp.h	/^#define	BH_DISCARD	0x008		\/* Page is useless. *\//
+BH_FREED	../dbinc/mp.h	/^#define	BH_FREED	0x010		\/* Page was freed. *\/$/
+BH_FREE_FREEMEM	../dbinc/mp.h	/^#define	BH_FREE_FREEMEM		0x01$/
+BH_FREE_REUSE	../dbinc/mp.h	/^#define	BH_FREE_REUSE		0x02$/
+BH_FREE_UNLOCKED	../dbinc/mp.h	/^#define	BH_FREE_UNLOCKED	0x04$/
+BH_FROZEN	../dbinc/mp.h	/^#define	BH_FROZEN	0x020		\/* Frozen buffer: alloca/
+BH_FROZEN_ALLOC	../dbinc/mp.h	/^struct __bh_frozen_a;	typedef struct __bh_frozen_a/
+BH_FROZEN_PAGE	../dbinc/mp.h	/^struct __bh_frozen;	typedef struct __bh_frozen_p B/
+BH_LOCKED	../dbinc/mp.h	/^#define	BH_LOCKED	0x040		\/* Page is locked (I\/O /
+BH_OBSOLETE	../dbinc/mp.h	/^#define	BH_OBSOLETE(bhp, old_lsn)	((SH_CHAIN_HASNE/
+BH_OWNED_BY	../dbinc/mp.h	/^#define	BH_OWNED_BY(dbenv, bhp, txn)	((txn) != NUL/
+BH_OWNER	../dbinc/mp.h	/^#define	BH_OWNER(dbenv, bhp)						\\$/
+BH_PRIORITY	../dbinc/mp.h	/^#define	BH_PRIORITY(bhp)						\\$/
+BH_TRACK	../mp/mp_sync.c	/^} BH_TRACK;$/
+BH_TRASH	../dbinc/mp.h	/^#define	BH_TRASH	0x080		\/* Page is garbage. *\/$/
+BINTERNAL	../dbinc/db_page.h	/^} BINTERNAL;$/
 BINTERNAL_PSIZE	../dbinc/db_page.h	/^#define	BINTERNAL_PSIZE(len)						\\$/
 BINTERNAL_SIZE	../dbinc/db_page.h	/^#define	BINTERNAL_SIZE(len)						\\$/
-BITSPERBLOCK	../crypto/rijndael/rijndael-api-fst.h	56
-BI_DELETED	../dbinc/btree.h	72
+BITEM_PSIZE	../dbinc/db_page.h	/^#define	BITEM_PSIZE(bk)							\\$/
+BITEM_SIZE	../dbinc/db_page.h	/^#define	BITEM_SIZE(bk)							\\$/
+BITSPERBLOCK	../crypto/rijndael/rijndael-api-fst.h	/^#define     BITSPERBLOCK        128 \/* Default nu/
+BI_DELETED	../dbinc/btree.h	/^#define	BI_DELETED	0x01		\/* Key\/data pair only p/
+BKEYDATA	../dbinc/db_page.h	/^} BKEYDATA;$/
 BKEYDATA_PSIZE	../dbinc/db_page.h	/^#define	BKEYDATA_PSIZE(len)						\\$/
 BKEYDATA_SIZE	../dbinc/db_page.h	/^#define	BKEYDATA_SIZE(len)						\\$/
-BOVERFLOW_PSIZE	../dbinc/db_page.h	588
-BOVERFLOW_SIZE	../dbinc/db_page.h	586
+BOVERFLOW	../dbinc/db_page.h	/^} BOVERFLOW;$/
+BOVERFLOW_PSIZE	../dbinc/db_page.h	/^#define	BOVERFLOW_PSIZE							\\$/
+BOVERFLOW_SIZE	../dbinc/db_page.h	/^#define	BOVERFLOW_SIZE							\\$/
+BPI_NORECNUM	../dbinc/btree.h	/^#define	BPI_NORECNUM	0x02		\/* Not update the recn/
+BPI_SPACEONLY	../dbinc/btree.h	/^#define	BPI_SPACEONLY	0x01		\/* Only check for spa/
 BS_TO_PAGE	../dbinc/hash.h	/^#define	BS_TO_PAGE(bucket, spares)		\\$/
-BTM_DUP	../dbinc/db_page.h	93
-BTM_DUPSORT	../dbinc/db_page.h	99
-BTM_FIXEDLEN	../dbinc/db_page.h	96
-BTM_MASK	../dbinc/db_page.h	100
-BTM_RECNO	../dbinc/db_page.h	94
-BTM_RECNUM	../dbinc/db_page.h	95
-BTM_RENUMBER	../dbinc/db_page.h	97
-BTM_SUBDB	../dbinc/db_page.h	98
-BTREE	../dbinc/btree.h	48
-BTREEMAGIC	../dbinc/db_185.in	120
-BTREEVERSION	../dbinc/db_185.in	121
-BTREE_CURSOR	../dbinc/btree.h	49
+BTMETA	../dbinc/db_page.h	/^} BTMETA33, BTMETA;$/
+BTMETA2X	../dbinc/db_upgrade.h	/^} BTMETA2X;$/
+BTMETA30	../dbinc/db_upgrade.h	/^} BTMETA30;$/
+BTMETA31	../dbinc/db_upgrade.h	/^} BTMETA31;$/
+BTM_DUP	../dbinc/db_page.h	/^#define	BTM_DUP		0x001	\/*	  Duplicates. *\/$/
+BTM_DUPSORT	../dbinc/db_page.h	/^#define	BTM_DUPSORT	0x040	\/*	  Duplicates are sor/
+BTM_FIXEDLEN	../dbinc/db_page.h	/^#define	BTM_FIXEDLEN	0x008	\/*	  Recno: fixed leng/
+BTM_MASK	../dbinc/db_page.h	/^#define	BTM_MASK	0x07f$/
+BTM_RECNO	../dbinc/db_page.h	/^#define	BTM_RECNO	0x002	\/*	  Recno tree. *\/$/
+BTM_RECNUM	../dbinc/db_page.h	/^#define	BTM_RECNUM	0x004	\/*	  Btree: maintain rec/
+BTM_RENUMBER	../dbinc/db_page.h	/^#define	BTM_RENUMBER	0x010	\/*	  Recno: renumber o/
+BTM_SUBDB	../dbinc/db_page.h	/^#define	BTM_SUBDB	0x020	\/*	  Subdatabases. *\/$/
+BTREE	../dbinc/btree.h	/^struct __btree;		typedef struct __btree BTREE;$/
+BTREEINFO	../dbinc/db_185.in	/^} BTREEINFO;$/
+BTREEMAGIC	../dbinc/db_185.in	/^#define	BTREEMAGIC	0x053162$/
+BTREEVERSION	../dbinc/db_185.in	/^#define	BTREEVERSION	3$/
+BTREE_CURSOR	../dbinc/btree.h	/^struct __cursor;	typedef struct __cursor BTREE_CUR/
 BT_STK_CLR	../dbinc/btree.h	/^#define	BT_STK_CLR(c) do {						\\$/
 BT_STK_ENTER	../dbinc/btree.h	/^#define	BT_STK_ENTER(dbenv, c, pagep, page_indx, l/
 BT_STK_NUM	../dbinc/btree.h	/^#define	BT_STK_NUM(dbenv, c, pagep, page_indx, ret/
 BT_STK_NUMPUSH	../dbinc/btree.h	/^#define	BT_STK_NUMPUSH(dbenv, c, pagep, page_indx,/
 BT_STK_POP	../dbinc/btree.h	/^#define	BT_STK_POP(c)							\\$/
 BT_STK_PUSH	../dbinc/btree.h	/^#define	BT_STK_PUSH(dbenv, c, pagep, page_indx, lo/
-BUCKET_INVALID	../dbinc/hash.h	111
+BUCKET_INVALID	../dbinc/hash.h	/^#define	BUCKET_INVALID	0xFFFFFFFF$/
 BUCKET_TO_PAGE	../dbinc/hash.h	/^#define	BUCKET_TO_PAGE(I, B)	(BS_TO_PAGE((B), (I)-/
+BULK_FORCE	../dbinc/rep.h	/^#define	BULK_FORCE	0x001		\/* Force buffer after t/
+BULK_XMIT	../dbinc/rep.h	/^#define	BULK_XMIT	0x002		\/* Buffer in transit. */
 B_DCLR	../dbinc/db_page.h	/^#define	B_DCLR(t)	(t) &= ~B_DELETE$/
-B_DELETE	../dbinc/db_page.h	529
+B_DELETE	../dbinc/db_page.h	/^#define	B_DELETE	(0x80)$/
 B_DISSET	../dbinc/db_page.h	/^#define	B_DISSET(t)	((t) & B_DELETE)$/
 B_DSET	../dbinc/db_page.h	/^#define	B_DSET(t)	(t) |= B_DELETE$/
-B_DUPLICATE	../dbinc/db_page.h	520
-B_KEYDATA	../dbinc/db_page.h	519
+B_DUPLICATE	../dbinc/db_page.h	/^#define	B_DUPLICATE	2	\/* Duplicate key\/data item/
+B_KEYDATA	../dbinc/db_page.h	/^#define	B_KEYDATA	1	\/* Key\/data item. *\/$/
 B_MAX	../dbinc/btree.h	/^#define	B_MAX(a,b)	(((a) > (b)) ? (a) : (b))$/
 B_MAXSIZEONPAGE	../dbinc/btree.h	/^#define	B_MAXSIZEONPAGE(ovflsize)					\\$/
 B_MINKEY_TO_OVFLSIZE	../dbinc/btree.h	/^#define	B_MINKEY_TO_OVFLSIZE(dbp, minkey, pgsize)	/
-B_OVERFLOW	../dbinc/db_page.h	521
-B_TSET	../dbinc/db_page.h	/^#define	B_TSET(t, type, deleted) {					\\$/
-B_TYPE	../dbinc/db_page.h	/^#define	B_TYPE(t)	((t) & ~B_DELETE)$/
-CAD_UPDATEROOT	../dbinc/btree.h	66
+B_OVERFLOW	../dbinc/db_page.h	/^#define	B_OVERFLOW	3	\/* Overflow key\/data item. /
+B_TSET	../dbinc/db_page.h	/^#define	B_TSET(t, type)	((t) = B_TYPE(type))$/
+B_TSET_DELETED	../dbinc/db_page.h	/^#define	B_TSET_DELETED(t, type) ((t) = (type) | B_/
+B_TYPE	../dbinc/db_page.h	/^#define	B_TYPE(t)		((t) & ~B_DELETE)$/
+CAD_UPDATEROOT	../dbinc/btree.h	/^#define	CAD_UPDATEROOT	0x01		\/* Root page count w/
 CALC_QAM_RECNO_PER_PAGE	../dbinc/qam.h	/^#define	CALC_QAM_RECNO_PER_PAGE(dbp)					\\$/
 CDB_LOCKING	../dbinc/db_int.in	/^#define	CDB_LOCKING(dbenv)	F_ISSET(dbenv, DB_ENV_C/
-CDB_LOCKING_DONE	../db/db_cam.c	/^#define	CDB_LOCKING_DONE(dbp, dbc)					\\$/
-CDB_LOCKING_INIT	../db/db_cam.c	/^#define	CDB_LOCKING_INIT(dbp, dbc)					\\$/
+CDB_LOCKING_DONE	../db/db_cam.c	/^#define	CDB_LOCKING_DONE(dbenv, dbc)					\\$/
+CDB_LOCKING_INIT	../db/db_cam.c	/^#define	CDB_LOCKING_INIT(dbenv, dbc)					\\$/
 CD_CLR	../btree/bt_recno.c	/^#define	CD_CLR(cp) {							\\$/
 CD_ISSET	../btree/bt_recno.c	/^#define	CD_ISSET(cp)							\\$/
 CD_SET	../btree/bt_recno.c	/^#define	CD_SET(cp) {							\\$/
-CHARKEY	../dbinc/hash.h	92
-CHECK_LSN	../dbinc/log.h	/^#define	CHECK_LSN(redo, cmp, lsn, prev)					\\$/
-CIPHER_AES	../dbinc/crypto.h	45
-CIPHER_ANY	../dbinc/crypto.h	49
-CKPLSN_CMP	../dbinc/log.h	361
-CLEAR_BYTE	../dbinc/debug.h	28
+CHAR64LONG16	../hmac/sha1.c	/^} CHAR64LONG16;$/
+CHARKEY	../dbinc/hash.h	/^#define	CHARKEY			"%$sniglet^&"$/
+CHECK_LSN	../dbinc/log.h	/^#define	CHECK_LSN(e, redo, cmp, lsn, prev)				\\$/
+CHECK_MTX_THREAD	../dbinc/db_int.in	/^#define	CHECK_MTX_THREAD(dbenv, mtx) do {				\\$/
+CHECK_THREAD	../dbinc/db_int.in	/^#define	CHECK_THREAD(dbenv) do {					\\$/
+CIPHER	../dbinc/crypto.h	/^} CIPHER;$/
+CIPHER_AES	../dbinc/crypto.h	/^#define	CIPHER_AES	1		\/* AES algorithm *\/$/
+CIPHER_ANY	../dbinc/crypto.h	/^#define	CIPHER_ANY	0x00000001	\/* Only for DB_CIPH/
+CKPLSN_CMP	../dbinc/log.h	/^#define	CKPLSN_CMP	0$/
+CLEAR_BYTE	../dbinc/debug.h	/^#define	CLEAR_BYTE	0xdb$/
 CLEAR_MAP	../lock/lock_deadlock.c	/^#define	CLEAR_MAP(M, N) {						\\$/
 CLIENT_ONLY	../rep/rep_record.c	/^#define	CLIENT_ONLY(rep, rp) do {					\\$/
+CLIENT_REREQ	../rep/rep_record.c	/^#define	CLIENT_REREQ do {						\\$/
 CLOSE_HANDLE	../fileops/fop_util.c	/^#define	CLOSE_HANDLE(D, F) {						\\$/
-CLR_MAP	../lock/lock_deadlock.c	/^#define	CLR_MAP(M, B)	((M)[(B) \/ 32] &= ~(1 << ((B/
-COMPQUIET	../dbinc/debug.h	/^#define	COMPQUIET(n, v)							\\$/
+CLR_MAP	../lock/lock_deadlock.c	/^#define	CLR_MAP(M, B)	((M)[(B) \/ 32] &= ~((u_int)/
+COMPQUIET	../dbinc/debug.h	/^#define	COMPQUIET(n, v)	do {					        \\$/
+CONFIG_GET_INT	../env/env_config.c	/^#define	CONFIG_GET_INT(s, vp) do {					\\$/
+CONFIG_GET_LONG	../env/env_config.c	/^#define	CONFIG_GET_LONG(s, vp) do {					\\$/
+CONFIG_GET_UINT32	../env/env_config.c	/^#define	CONFIG_GET_UINT32(s, vp) do {					\\$/
+CONFIG_INT	../env/env_config.c	/^#define	CONFIG_INT(s, f) do {						\\$/
+CONFIG_SLOTS	../env/env_config.c	/^#define	CONFIG_SLOTS	10$/
+CONFIG_UINT32	../env/env_config.c	/^#define	CONFIG_UINT32(s, f) do {					\\$/
 CONFLICTS	../dbinc/lock.h	/^#define	CONFLICTS(T, R, HELD, WANTED) \\$/
+CONNECTION_LIST	../dbinc/repmgr.h	/^typedef TAILQ_HEAD(__repmgr_conn_list, __repmgr_co/
+CONN_CONNECTING	../dbinc/repmgr.h	/^#define	CONN_CONNECTING	0x01	\/* nonblocking conne/
+CONN_DEFUNCT	../dbinc/repmgr.h	/^#define	CONN_DEFUNCT	0x02	\/* socket close pending/
 COPY_OBJ	../lock/lock_list.c	/^#define	COPY_OBJ(dp, obj)	do {					\\$/
 COPY_RET_MEM	../dbinc/db_int.in	/^#define	COPY_RET_MEM(src, dest)				\\$/
 CRYPTO_ON	../dbinc/db_int.in	/^#define	CRYPTO_ON(dbenv)	((dbenv)->crypto_handle !/
-CT_CURSOR	../dbinc/db_server_int.h	32
-CT_DB	../dbinc/db_server_int.h	33
-CT_ENV	../dbinc/db_server_int.h	34
-CT_JOIN	../dbinc/db_server_int.h	37
-CT_JOINCUR	../dbinc/db_server_int.h	38
-CT_TXN	../dbinc/db_server_int.h	35
+CRYPTO_ONLY	../libdb_java/db_java_wrap.c	/^#define	CRYPTO_ONLY(x) (x);$/
+CS_DEL	../btree/bt_compact.c	/^#define	CS_DEL		4	\/* Get a stack to delete a page/
+CS_GETRECNO	../btree/bt_compact.c	/^#define	CS_GETRECNO     0x80	\/* Extract record nu/
+CS_NEXT	../btree/bt_compact.c	/^#define	CS_NEXT		2	\/* Get the next page. *\/$/
+CS_NEXT_WRITE	../btree/bt_compact.c	/^#define	CS_NEXT_WRITE	3	\/* Get the next page and /
+CS_PARENT	../btree/bt_compact.c	/^#define	CS_PARENT	1	\/* We want the parent too, wr/
+CS_READ	../btree/bt_compact.c	/^#define	CS_READ	0	\/* We are just reading. *\/$/
+CS_START	../btree/bt_compact.c	/^#define	CS_START	5	\/* Starting level for stack, w/
+CTIME_BUFLEN	../dbinc/os.h	/^#define	CTIME_BUFLEN	26$/
+CTRACE	../btree/bt_compact.c	/^#define	CTRACE(dbc, location, t, start, f) do {			/
+CT_CURSOR	../dbinc/db_server_int.h	/^#define	CT_CURSOR	0x001		\/* Cursor *\/$/
+CT_DB	../dbinc/db_server_int.h	/^#define	CT_DB		0x002		\/* Database *\/$/
+CT_ENV	../dbinc/db_server_int.h	/^#define	CT_ENV		0x004		\/* Env *\/$/
+CT_JOIN	../dbinc/db_server_int.h	/^#define	CT_JOIN		0x10000000	\/* Join cursor compon/
+CT_JOINCUR	../dbinc/db_server_int.h	/^#define	CT_JOINCUR	0x20000000	\/* Join cursor *\/$/
+CT_TXN	../dbinc/db_server_int.h	/^#define	CT_TXN		0x008		\/* Txn *\/$/
 CURADJ_LOG	../btree/bt_recno.c	/^#define	CURADJ_LOG(dbc)							\\$/
-C_DELETED	../dbinc/btree.h	215
+C_DELETED	../dbinc/btree.h	/^#define	C_DELETED	0x0001		\/* Record was deleted. /
 C_EQUAL	../btree/bt_recno.c	/^#define	C_EQUAL(cp1, cp2)						\\$/
 C_LESSTHAN	../btree/bt_recno.c	/^#define	C_LESSTHAN(cp1, cp2)						\\$/
-C_RECNUM	../dbinc/btree.h	221
-C_RENUMBER	../dbinc/btree.h	228
-DATA_INIT_CNT	../env/env_method.c	640
-DB	../dbinc/db.in	127
-DB2JDBENV	../libdb_java/db_java_wrap.c	812
-DBC	../dbinc/db.in	155
-DBC2JDBENV	../libdb_java/db_java_wrap.c	813
-DBC_ACTIVE	../dbinc/db.in	1646
-DBC_COMPENSATE	../dbinc/db.in	1647
-DBC_DEGREE_2	../dbinc/db.in	1648
-DBC_DIRTY_READ	../dbinc/db.in	1649
-DBC_INTERNAL	../dbinc/db.in	156
-DBC_LOGGING	../dbinc/db_int.in	/^#define	DBC_LOGGING(dbc)						\\$/
-DBC_METHOD	../cxx/cxx_dbc.cpp	/^#define	DBC_METHOD(_name, _argspec, _arglist, _ret/
-DBC_MULTIPLE	../dbinc/db.in	1656
-DBC_MULTIPLE_KEY	../dbinc/db.in	1657
-DBC_OPD	../dbinc/db.in	1650
-DBC_OWN_LID	../dbinc/db.in	1658
-DBC_RECOVER	../dbinc/db.in	1651
-DBC_RMW	../dbinc/db.in	1652
-DBC_TRANSIENT	../dbinc/db.in	1653
-DBC_WRITECURSOR	../dbinc/db.in	1654
-DBC_WRITER	../dbinc/db.in	1655
+C_RECNUM	../dbinc/btree.h	/^#define	C_RECNUM	0x0002		\/* Tree requires record /
+C_RENUMBER	../dbinc/btree.h	/^#define	C_RENUMBER	0x0004		\/* Tree records are mu/
+DATA_INIT_CNT	../env/env_method.c	/^#define	DATA_INIT_CNT	20			\/* Start with 20 data /
+DB	../dbinc/db.in	/^struct __db;		typedef struct __db DB;$/
+DB2JDBENV	../libdb_java/db_java_wrap.c	/^#define	DB2JDBENV ((jobject)DB_ENV_INTERNAL(arg1->/
+DBC	../dbinc/db.in	/^struct __dbc;		typedef struct __dbc DBC;$/
+DBC2JDBENV	../libdb_java/db_java_wrap.c	/^#define	DBC2JDBENV ((jobject)DB_ENV_INTERNAL(arg1-/
+DBC_ACTIVE	../dbinc/db.in	/^#define	DBC_ACTIVE		0x0001	\/* Cursor in use. *\/$/
+DBC_DONTLOCK	../dbinc/db.in	/^#define	DBC_DONTLOCK		0x0002	\/* Don't lock on thi/
+DBC_INTERNAL	../dbinc/db.in	/^struct __dbc_internal;	typedef struct __dbc_intern/
+DBC_LOGGING	../dbinc/db_int.in	/^#define	DBC_LOGGING(dbc)	__dbc_logging(dbc)$/
+DBC_METHOD	../cxx/cxx_dbc.cpp	/^\/\/ Helper macro for simple methods that pass thr/
+DBC_MULTIPLE	../dbinc/db.in	/^#define	DBC_MULTIPLE		0x0004	\/* Return Multiple d/
+DBC_MULTIPLE_KEY	../dbinc/db.in	/^#define	DBC_MULTIPLE_KEY	0x0008	\/* Return Multipl/
+DBC_OPD	../dbinc/db.in	/^#define	DBC_OPD			0x0010	\/* Cursor references off/
+DBC_OWN_LID	../dbinc/db.in	/^#define	DBC_OWN_LID		0x0020	\/* Free lock id on de/
+DBC_READ_COMMITTED	../dbinc/db.in	/^#define	DBC_READ_COMMITTED	0x0040	\/* Cursor has d/
+DBC_READ_UNCOMMITTED	../dbinc/db.in	/^#define	DBC_READ_UNCOMMITTED	0x0080	\/* Cursor has/
+DBC_RECOVER	../dbinc/db.in	/^#define	DBC_RECOVER		0x0100	\/* Recovery cursor; d/
+DBC_RMW	../dbinc/db.in	/^#define	DBC_RMW			0x0200	\/* Acquire write flag in/
+DBC_TRANSIENT	../dbinc/db.in	/^#define	DBC_TRANSIENT		0x0400	\/* Cursor is transi/
+DBC_WRITECURSOR	../dbinc/db.in	/^#define	DBC_WRITECURSOR		0x0800	\/* Cursor may be /
+DBC_WRITER	../dbinc/db.in	/^#define	DBC_WRITER		0x1000	\/* Cursor immediately /
 DBENV_LOGGING	../dbinc/db_int.in	/^#define	DBENV_LOGGING(dbenv)						\\$/
 DBENV_METHOD	../cxx/cxx_env.cpp	/^#define	DBENV_METHOD(_name, _argspec, _arglist)			/
-DBENV_METHOD_ERR	../cxx/cxx_env.cpp	/^#define	DBENV_METHOD_ERR(_name, _argspec, _arglist/
+DBENV_METHOD_ERR	../cxx/cxx_env.cpp	/^\/\/ Helper macros for simple methods that pass th/
 DBENV_METHOD_QUIET	../cxx/cxx_env.cpp	/^#define	DBENV_METHOD_QUIET(_name, _argspec, _argli/
 DBENV_METHOD_VOID	../cxx/cxx_env.cpp	/^#define	DBENV_METHOD_VOID(_name, _argspec, _arglis/
-DBLOG_FORCE_OPEN	../dbinc/log.h	106
-DBLOG_RECOVER	../dbinc/log.h	105
-DBM	../dbinc/db.in	2086
-DBMETASIZE	../dbinc/db_page.h	180
-DBMETA_CHKSUM	../dbinc/db_page.h	76
-DBM_INSERT	../dbinc/db.in	2088
-DBM_REPLACE	../dbinc/db.in	2089
-DBM_SUFFIX	../dbinc/db.in	2095
-DBREG_CHKPNT	../dbinc/log.h	49
-DBREG_CLOSE	../dbinc/log.h	50
-DBREG_OPEN	../dbinc/log.h	51
-DBREG_RCLOSE	../dbinc/log.h	52
-DBREP_OPENFILES	../dbinc/rep.h	255
-DBSEQ_METHOD	../cxx/cxx_seq.cpp	/^#define	DBSEQ_METHOD(_name, _argspec, _arglist, _d/
-DBT	../dbinc/db.in	130
-DBTBUFLEN	../db/db_pr.c	1122
-DBTCL_DBM	../dbinc/tcl_db.h	22
-DBTCL_NDBM	../dbinc/tcl_db.h	23
-DBTCL_PREP	../dbinc/tcl_db.h	20
-DBTXN_METHOD	../cxx/cxx_txn.cpp	/^#define	DBTXN_METHOD(_name, _delete, _argspec, _ar/
-DBTYPE	../dbinc/db.in	1101
+DBLOG_FORCE_OPEN	../dbinc/log.h	/^#define	DBLOG_FORCE_OPEN	0x02	\/* Force the DB ope/
+DBLOG_RECOVER	../dbinc/log.h	/^#define	DBLOG_RECOVER		0x01	\/* We are in recovery/
+DBM	../dbinc/db.in	/^typedef struct __db DBM;$/
+DBMETA	../dbinc/db_page.h	/^} DBMETA33, DBMETA;$/
+DBMETA30	../dbinc/db_upgrade.h	/^} DBMETA30;$/
+DBMETA31	../dbinc/db_upgrade.h	/^} DBMETA31;$/
+DBMETASIZE	../dbinc/db_page.h	/^#define	DBMETASIZE	512$/
+DBMETA_CHKSUM	../dbinc/db_page.h	/^#define	DBMETA_CHKSUM		0x01$/
+DBM_INSERT	../dbinc/db.in	/^#define	DBM_INSERT	0		\/* Flags to dbm_store(). */
+DBM_REPLACE	../dbinc/db.in	/^#define	DBM_REPLACE	1$/
+DBM_SUFFIX	../dbinc/db.in	/^#define	DBM_SUFFIX	".db"$/
+DBREG_CHKPNT	../dbinc/log.h	/^#define	DBREG_CHKPNT	1		\/* Checkpoint: file name/
+DBREG_CLOSE	../dbinc/log.h	/^#define	DBREG_CLOSE	2		\/* File close. *\/$/
+DBREG_OPEN	../dbinc/log.h	/^#define	DBREG_OPEN	3		\/* File open. *\/$/
+DBREG_PREOPEN	../dbinc/log.h	/^#define	DBREG_PREOPEN	4		\/* Open in mpool only. */
+DBREG_RCLOSE	../dbinc/log.h	/^#define	DBREG_RCLOSE	5		\/* File close after recov/
+DBREG_REOPEN	../dbinc/log.h	/^#define	DBREG_REOPEN	6		\/* Open for in-memory dat/
+DBREP_OPENFILES	../dbinc/rep.h	/^#define	DBREP_OPENFILES		0x0001	\/* This handle ha/
+DBSEQ_METHOD	../cxx/cxx_seq.cpp	/^\/\/ Helper macro for simple methods that pass thr/
+DBT	../dbinc/db.in	/^struct __db_dbt;	typedef struct __db_dbt DBT;$/
+DBTBUFLEN	../db/db_pr.c	/^#define	DBTBUFLEN	100$/
+DBTCL_DBM	../dbinc/tcl_db.h	/^#define	DBTCL_DBM	1$/
+DBTCL_GLOBAL	../dbinc/tcl_db.h	/^} DBTCL_GLOBAL;$/
+DBTCL_INFO	../dbinc/tcl_db.h	/^} DBTCL_INFO;$/
+DBTCL_NDBM	../dbinc/tcl_db.h	/^#define	DBTCL_NDBM	2$/
+DBTCL_PREP	../dbinc/tcl_db.h	/^#define	DBTCL_PREP	64	\/* Size of txn_recover prep/
+DBTXN_METHOD	../cxx/cxx_txn.cpp	/^\/\/ Helper macro for simple methods that pass thr/
+DBTYPE	../dbinc/db.in	/^} DBTYPE;$/
+DBT_LOCKED	../libdb_java/db_java_wrap.c	/^} DBT_LOCKED;$/
 DB_ADDSTR	../env/env_open.c	/^#define	DB_ADDSTR(add) {						\\$/
-DB_ADD_BIG	../dbinc/db_am.h	25
-DB_ADD_DUP	../dbinc/db_am.h	23
-DB_AES_CHUNK	../dbinc/crypto.h	68
-DB_AES_KEYLEN	../dbinc/crypto.h	67
-DB_AFTER	../dbinc/db.in	1123
-DB_AGGRESSIVE	../dbinc/db.in	344
+DB_ADD_BIG	../dbinc/db_am.h	/^#define	DB_ADD_BIG	3$/
+DB_ADD_DUP	../dbinc/db_am.h	/^#define	DB_ADD_DUP	1$/
+DB_ADD_PAGE_COMPAT	../dbinc/db_am.h	/^#define	DB_ADD_PAGE_COMPAT	5	\/* Compatibility for/
+DB_AES_CHUNK	../dbinc/crypto.h	/^#define	DB_AES_CHUNK	16	\/* AES byte unit size *\//
+DB_AES_KEYLEN	../dbinc/crypto.h	/^#define	DB_AES_KEYLEN	128	\/* AES key length *\/$/
+DB_AFTER	../dbinc/db.in	/^#define	DB_AFTER		 1	\/* c_put() *\/$/
+DB_AGGRESSIVE	../dbinc/db.in	/^#define	DB_AGGRESSIVE	      0x0000001	\/* Salvage /
 DB_ALIGN	../dbinc/db_int.in	/^#define	DB_ALIGN(v, bound)						\\$/
-DB_ALREADY_ABORTED	../dbinc/db.in	1215
-DB_AM_CHKSUM	../dbinc/db.in	1483
-DB_AM_CL_WRITER	../dbinc/db.in	1484
-DB_AM_COMPENSATE	../dbinc/db.in	1485
-DB_AM_CREATED	../dbinc/db.in	1486
-DB_AM_CREATED_MSTR	../dbinc/db.in	1487
-DB_AM_DBM_ERROR	../dbinc/db.in	1488
-DB_AM_DELIMITER	../dbinc/db.in	1489
-DB_AM_DIRTY	../dbinc/db.in	1490
-DB_AM_DISCARD	../dbinc/db.in	1491
-DB_AM_DUP	../dbinc/db.in	1492
-DB_AM_DUPSORT	../dbinc/db.in	1493
-DB_AM_ENCRYPT	../dbinc/db.in	1494
-DB_AM_FIXEDLEN	../dbinc/db.in	1495
-DB_AM_INMEM	../dbinc/db.in	1496
-DB_AM_INORDER	../dbinc/db.in	1497
-DB_AM_IN_RENAME	../dbinc/db.in	1498
-DB_AM_NOT_DURABLE	../dbinc/db.in	1499
-DB_AM_OPEN_CALLED	../dbinc/db.in	1500
-DB_AM_PAD	../dbinc/db.in	1501
-DB_AM_PGDEF	../dbinc/db.in	1502
-DB_AM_RDONLY	../dbinc/db.in	1503
-DB_AM_RECNUM	../dbinc/db.in	1504
-DB_AM_RECOVER	../dbinc/db.in	1505
-DB_AM_RENUMBER	../dbinc/db.in	1506
-DB_AM_REPLICATION	../dbinc/db.in	1507
-DB_AM_REVSPLITOFF	../dbinc/db.in	1508
-DB_AM_SECONDARY	../dbinc/db.in	1509
-DB_AM_SNAPSHOT	../dbinc/db.in	1510
-DB_AM_SUBDB	../dbinc/db.in	1511
-DB_AM_SWAP	../dbinc/db.in	1512
-DB_AM_TXN	../dbinc/db.in	1513
-DB_AM_VERIFYING	../dbinc/db.in	1514
-DB_APPEND	../dbinc/db.in	1124
-DB_ARCH_ABS	../dbinc/db.in	520
-DB_ARCH_DATA	../dbinc/db.in	521
-DB_ARCH_LOG	../dbinc/db.in	522
-DB_ARCH_REMOVE	../dbinc/db.in	523
-DB_ASSERT	../dbinc/debug.h	/^#define	DB_ASSERT(e)	((e) ? (void)0 : __db_assert(/
-DB_AUTO_COMMIT	../dbinc/db.in	225
-DB_BEFORE	../dbinc/db.in	1125
-DB_BEGIN_SINGLE_THREAD	../dbinc/mutex.h	17
-DB_BTREEMAGIC	../dbinc/db.in	1107
-DB_BTREEOLDVER	../dbinc/db.in	1106
-DB_BTREEVERSION	../dbinc/db.in	1105
-DB_BTREE_STAT	../dbinc/db.in	128
-DB_BUFFER_SMALL	../dbinc/db.in	1187
-DB_CACHED_COUNTS	../dbinc/db.in	1126
-DB_CACHESIZE_MIN	../dbinc/mp.h	19
-DB_CACHE_PRIORITY	../dbinc/db.in	651
-DB_CALLBACK_C_INTERCEPT	../cxx/cxx_db.cpp	/^#define	DB_CALLBACK_C_INTERCEPT(_name, _rettype, _/
-DB_CDB_ALLDB	../dbinc/db.in	278
-DB_CHKSUM	../dbinc/db.in	314
-DB_CIPHER	../dbinc/db.in	129
-DB_COMMIT_FLUSH	../dbinc/log.h	292
-DB_CONSUME	../dbinc/db.in	1127
-DB_CONSUME_WAIT	../dbinc/db.in	1128
-DB_CREATE	../dbinc/db.in	190
-DB_CURRENT	../dbinc/db.in	1129
-DB_CXX_NO_EXCEPTIONS	../dbinc/db.in	191
-DB_CXX_PRIVATE_ENV	../dbinc/cxx_int.h	75
-DB_DBM_HSEARCH	../dbinc/db.in	2080
-DB_DBT_APPMALLOC	../dbinc/db.in	175
-DB_DBT_DUPOK	../dbinc/db.in	181
-DB_DBT_ISSET	../dbinc/db.in	176
-DB_DBT_MALLOC	../dbinc/db.in	177
-DB_DBT_PARTIAL	../dbinc/db.in	178
-DB_DBT_REALLOC	../dbinc/db.in	179
-DB_DBT_USERMEM	../dbinc/db.in	180
-DB_DEF_IOSIZE	../dbinc/db_int.in	100
-DB_DEGREE_2	../dbinc/db.in	226
-DB_DELETED	../dbinc/db.in	1216
+DB_ALREADY_ABORTED	../dbinc/db.in	/^#define	DB_ALREADY_ABORTED	(-30899)$/
+DB_AM_CHKSUM	../dbinc/db.in	/^#define	DB_AM_CHKSUM		0x00000001 \/* Checksumming /
+DB_AM_CL_WRITER	../dbinc/db.in	/^#define	DB_AM_CL_WRITER		0x00000002 \/* Allow writ/
+DB_AM_COMPENSATE	../dbinc/db.in	/^#define	DB_AM_COMPENSATE	0x00000004 \/* Created by/
+DB_AM_CREATED	../dbinc/db.in	/^#define	DB_AM_CREATED		0x00000008 \/* Database was/
+DB_AM_CREATED_MSTR	../dbinc/db.in	/^#define	DB_AM_CREATED_MSTR	0x00000010 \/* Encompas/
+DB_AM_DBM_ERROR	../dbinc/db.in	/^#define	DB_AM_DBM_ERROR		0x00000020 \/* Error in D/
+DB_AM_DELIMITER	../dbinc/db.in	/^#define	DB_AM_DELIMITER		0x00000040 \/* Variable l/
+DB_AM_DISCARD	../dbinc/db.in	/^#define	DB_AM_DISCARD		0x00000080 \/* Discard any /
+DB_AM_DUP	../dbinc/db.in	/^#define	DB_AM_DUP		0x00000100 \/* DB_DUP *\/$/
+DB_AM_DUPSORT	../dbinc/db.in	/^#define	DB_AM_DUPSORT		0x00000200 \/* DB_DUPSORT */
+DB_AM_ENCRYPT	../dbinc/db.in	/^#define	DB_AM_ENCRYPT		0x00000400 \/* Encryption */
+DB_AM_FIXEDLEN	../dbinc/db.in	/^#define	DB_AM_FIXEDLEN		0x00000800 \/* Fixed-lengt/
+DB_AM_INMEM	../dbinc/db.in	/^#define	DB_AM_INMEM		0x00001000 \/* In-memory; no /
+DB_AM_INORDER	../dbinc/db.in	/^#define	DB_AM_INORDER		0x00002000 \/* DB_INORDER */
+DB_AM_IN_RENAME	../dbinc/db.in	/^#define	DB_AM_IN_RENAME		0x00004000 \/* File is be/
+DB_AM_NOT_DURABLE	../dbinc/db.in	/^#define	DB_AM_NOT_DURABLE	0x00008000 \/* Do not lo/
+DB_AM_OPEN_CALLED	../dbinc/db.in	/^#define	DB_AM_OPEN_CALLED	0x00010000 \/* DB->open /
+DB_AM_PAD	../dbinc/db.in	/^#define	DB_AM_PAD		0x00020000 \/* Fixed-length rec/
+DB_AM_PGDEF	../dbinc/db.in	/^#define	DB_AM_PGDEF		0x00040000 \/* Page size was /
+DB_AM_RDONLY	../dbinc/db.in	/^#define	DB_AM_RDONLY		0x00080000 \/* Database is r/
+DB_AM_READ_UNCOMMITTED	../dbinc/db.in	/^#define	DB_AM_READ_UNCOMMITTED	0x00100000 \/* Supp/
+DB_AM_RECNUM	../dbinc/db.in	/^#define	DB_AM_RECNUM		0x00200000 \/* DB_RECNUM *\//
+DB_AM_RECOVER	../dbinc/db.in	/^#define	DB_AM_RECOVER		0x00400000 \/* DB opened by/
+DB_AM_RENUMBER	../dbinc/db.in	/^#define	DB_AM_RENUMBER		0x00800000 \/* DB_RENUMBER/
+DB_AM_REVSPLITOFF	../dbinc/db.in	/^#define	DB_AM_REVSPLITOFF	0x01000000 \/* DB_REVSPL/
+DB_AM_SECONDARY	../dbinc/db.in	/^#define	DB_AM_SECONDARY		0x02000000 \/* Database i/
+DB_AM_SNAPSHOT	../dbinc/db.in	/^#define	DB_AM_SNAPSHOT		0x04000000 \/* DB_SNAPSHOT/
+DB_AM_SUBDB	../dbinc/db.in	/^#define	DB_AM_SUBDB		0x08000000 \/* Subdatabases s/
+DB_AM_SWAP	../dbinc/db.in	/^#define	DB_AM_SWAP		0x10000000 \/* Pages need to b/
+DB_AM_TXN	../dbinc/db.in	/^#define	DB_AM_TXN		0x20000000 \/* Opened in a tran/
+DB_AM_VERIFYING	../dbinc/db.in	/^#define	DB_AM_VERIFYING		0x40000000 \/* DB handle /
+DB_APPEND	../dbinc/db.in	/^#define	DB_APPEND		 2	\/* put() *\/$/
+DB_ARCH_ABS	../dbinc/db.in	/^#define	DB_ARCH_ABS	0x001		\/* Absolute pathnames./
+DB_ARCH_DATA	../dbinc/db.in	/^#define	DB_ARCH_DATA	0x002		\/* Data files. *\/$/
+DB_ARCH_LOG	../dbinc/db.in	/^#define	DB_ARCH_LOG	0x004		\/* Log files. *\/$/
+DB_ARCH_REMOVE	../dbinc/db.in	/^#define	DB_ARCH_REMOVE	0x008	\/* Remove log files./
+DB_ASSERT	../dbinc/debug.h	/^#define	DB_ASSERT(env, e)						\\$/
+DB_ASSOC_IMMUTABLE_KEY	../dbinc/db.in	/^#define	DB_ASSOC_IMMUTABLE_KEY    0x00000001 \/* S/
+DB_AUTO_COMMIT	../dbinc/db.in	/^#define	DB_AUTO_COMMIT	      0x02000000\/* Implied/
+DB_BEFORE	../dbinc/db.in	/^#define	DB_BEFORE		 3	\/* c_put() *\/$/
+DB_BEGIN_SINGLE_THREAD	../dbinc/mutex.h	/^#define	DB_BEGIN_SINGLE_THREAD do {					\\$/
+DB_BTREEMAGIC	../dbinc/db.in	/^#define	DB_BTREEMAGIC	0x053162$/
+DB_BTREEOLDVER	../dbinc/db.in	/^#define	DB_BTREEOLDVER	8		\/* Oldest btree version/
+DB_BTREEVERSION	../dbinc/db.in	/^#define	DB_BTREEVERSION	9		\/* Current btree versi/
+DB_BTREE_STAT	../dbinc/db.in	/^struct __db_bt_stat;	typedef struct __db_bt_stat D/
+DB_BUFFER_SMALL	../dbinc/db.in	/^#define	DB_BUFFER_SMALL		(-30999)\/* User memory t/
+DB_CACHESIZE_MIN	../dbinc/mp.h	/^#define	DB_CACHESIZE_MIN	(20 * 1024)$/
+DB_CACHE_PRIORITY	../dbinc/db.in	/^} DB_CACHE_PRIORITY;$/
+DB_CDB_ALLDB	../dbinc/db.in	/^#define	DB_CDB_ALLDB	      0x00004000\/* Set CDB l/
+DB_CHKSUM	../dbinc/db.in	/^#define	DB_CHKSUM	      0x00004000 \/* Do checksum/
+DB_CIPHER	../dbinc/db.in	/^struct __db_cipher;	typedef struct __db_cipher DB_/
+DB_CLEARLEN_NOTSET	../dbinc/db_int.in	/^#define	DB_CLEARLEN_NOTSET	UINT32_MAX	\/* Not yet /
+DB_COMMIT_FLUSH	../dbinc/log.h	/^#define	DB_COMMIT_FLUSH		0x0001	\/* Flush the log /
+DB_COMPACT	../dbinc/db.in	/^struct __db_compact;	typedef struct __db_compact D/
+DB_COMPACT_FLAGS	../dbinc/db.in	/^#define	DB_COMPACT_FLAGS      \\$/
+DB_CONSUME	../dbinc/db.in	/^#define	DB_CONSUME		 4	\/* get() *\/$/
+DB_CONSUME_WAIT	../dbinc/db.in	/^#define	DB_CONSUME_WAIT		 5	\/* get() *\/$/
+DB_CREATE	../dbinc/db.in	/^#define	DB_CREATE	      0x0000001	\/* Create file /
+DB_CURRENT	../dbinc/db.in	/^#define	DB_CURRENT		 6	\/* c_get(), c_put(), DB_LO/
+DB_CXX_NO_EXCEPTIONS	../dbinc/db.in	/^#define	DB_CXX_NO_EXCEPTIONS  0x0000001	\/* C++: r/
+DB_DBM_HSEARCH	../dbinc/db.in	/^#define	DB_DBM_HSEARCH	0		\/* No historic interfac/
+DB_DBT_APPMALLOC	../dbinc/db.in	/^#define	DB_DBT_APPMALLOC	0x001	\/* Callback alloca/
+DB_DBT_DUPOK	../dbinc/db.in	/^#define	DB_DBT_DUPOK		0x080	\/* Insert if duplicat/
+DB_DBT_ISSET	../dbinc/db.in	/^#define	DB_DBT_ISSET		0x002	\/* Lower level calls /
+DB_DBT_MALLOC	../dbinc/db.in	/^#define	DB_DBT_MALLOC		0x004	\/* Return in malloc'/
+DB_DBT_PARTIAL	../dbinc/db.in	/^#define	DB_DBT_PARTIAL		0x008	\/* Partial put\/get/
+DB_DBT_REALLOC	../dbinc/db.in	/^#define	DB_DBT_REALLOC		0x010	\/* Return in reallo/
+DB_DBT_USERCOPY	../dbinc/db.in	/^#define	DB_DBT_USERCOPY		0x020	\/* Use the user-su/
+DB_DBT_USERMEM	../dbinc/db.in	/^#define	DB_DBT_USERMEM		0x040	\/* Return in user's/
+DB_DEF_IOSIZE	../dbinc/db_int.in	/^#define	DB_DEF_IOSIZE	(8 * 1024)$/
+DB_DEGREE_2	../dbinc/db.in	/^#define	DB_DEGREE_2	      0x04000000\/*	Historic n/
+DB_DELETED	../dbinc/db.in	/^#define	DB_DELETED		(-30898)\/* Recovery file mark/
 DB_DESTRUCTOR	../cxx/cxx_db.cpp	/^#define	DB_DESTRUCTOR(_name, _argspec, _arglist, _/
-DB_DIRECT	../dbinc/db.in	306
-DB_DIRECT_DB	../dbinc/db.in	279
-DB_DIRECT_LOG	../dbinc/db.in	280
-DB_DIRTY_READ	../dbinc/db.in	227
-DB_DONOTINDEX	../dbinc/db.in	1188
-DB_DSYNC_LOG	../dbinc/db.in	281
-DB_DUP	../dbinc/db.in	315
-DB_DUPSORT	../dbinc/db.in	316
-DB_DURABLE_UNKNOWN	../dbinc/db.in	307
-DB_EID_BROADCAST	../dbinc/db.in	957
-DB_EID_INVALID	../dbinc/db.in	958
-DB_ENCRYPT	../dbinc/db.in	317
-DB_ENCRYPT_AES	../dbinc/db.in	273
-DB_ENC_MAGIC	../dbinc/hmac.h	29
-DB_END_SINGLE_THREAD	../dbinc/mutex.h	18
-DB_ENV	../dbinc/db.in	131
-DB_ENV_AUTO_COMMIT	../dbinc/db.in	2049
-DB_ENV_CDB	../dbinc/db.in	2050
-DB_ENV_CDB_ALLDB	../dbinc/db.in	2051
-DB_ENV_CREATE	../dbinc/db.in	2052
-DB_ENV_DBLOCAL	../dbinc/db.in	2053
-DB_ENV_DIRECT_DB	../dbinc/db.in	2054
-DB_ENV_DIRECT_LOG	../dbinc/db.in	2055
-DB_ENV_DSYNC_LOG	../dbinc/db.in	2056
-DB_ENV_FATAL	../dbinc/db.in	2057
+DB_DIRECT	../dbinc/db.in	/^#define	DB_DIRECT	      0x0004000	\/* Don't buffer/
+DB_DIRECT_DB	../dbinc/db.in	/^#define	DB_DIRECT_DB	      0x00008000\/* Don't buf/
+DB_DIRECT_LOG	../dbinc/db.in	/^#define	DB_DIRECT_LOG	      0x00010000\/* Don't bu/
+DB_DIRTY_READ	../dbinc/db.in	/^#define	DB_DIRTY_READ	      0x08000000\/*	Historic/
+DB_DONOTINDEX	../dbinc/db.in	/^#define	DB_DONOTINDEX		(-30998)\/* "Null" return f/
+DB_DSYNC_DB	../dbinc/db.in	/^#define	DB_DSYNC_DB	      0x00020000\/* Set O_DSYN/
+DB_DSYNC_LOG	../dbinc/db.in	/^#define	DB_DSYNC_LOG	      0x00040000\/* Set O_DSY/
+DB_DUP	../dbinc/db.in	/^#define	DB_DUP		      0x00008000 \/* Btree, Hash: /
+DB_DUPSORT	../dbinc/db.in	/^#define	DB_DUPSORT	      0x00010000 \/* Btree, Has/
+DB_DURABLE_UNKNOWN	../dbinc/db.in	/^#define	DB_DURABLE_UNKNOWN    0x0000002 \/* Durabi/
+DB_EID_BROADCAST	../dbinc/db.in	/^#define	DB_EID_BROADCAST	-1$/
+DB_EID_INVALID	../dbinc/db.in	/^#define	DB_EID_INVALID		-2$/
+DB_ENCRYPT	../dbinc/db.in	/^#define	DB_ENCRYPT	      0x00020000 \/* Btree, Has/
+DB_ENCRYPT_AES	../dbinc/db.in	/^#define	DB_ENCRYPT_AES	      0x0000001	\/* AES, as/
+DB_ENC_MAGIC	../dbinc/hmac.h	/^#define	DB_ENC_MAGIC	"encryption and decryption ke/
+DB_END_SINGLE_THREAD	../dbinc/mutex.h	/^#define	DB_END_SINGLE_THREAD	(void)semGive(DB_GLOB/
+DB_ENTRY	../dbinc/log.h	/^} DB_ENTRY;$/
+DB_ENV	../dbinc/db.in	/^struct __db_env;	typedef struct __db_env DB_ENV;$/
+DB_ENV_AUTO_COMMIT	../dbinc/db.in	/^#define	DB_ENV_AUTO_COMMIT	0x00000001 \/* DB_AUTO_/
+DB_ENV_CDB	../dbinc/db.in	/^#define	DB_ENV_CDB		0x00000002 \/* DB_INIT_CDB. */
+DB_ENV_CDB_ALLDB	../dbinc/db.in	/^#define	DB_ENV_CDB_ALLDB	0x00000004 \/* CDB enviro/
+DB_ENV_CREATE	../dbinc/db.in	/^#define	DB_ENV_CREATE		0x00000008 \/* DB_CREATE se/
+DB_ENV_DBLOCAL	../dbinc/db.in	/^#define	DB_ENV_DBLOCAL		0x00000010 \/* Environment/
+DB_ENV_DIRECT_DB	../dbinc/db.in	/^#define	DB_ENV_DIRECT_DB	0x00000020 \/* DB_DIRECT_/
+DB_ENV_DIRECT_LOG	../dbinc/db.in	/^#define	DB_ENV_DIRECT_LOG	0x00000040 \/* DB_DIRECT/
+DB_ENV_DSYNC_DB	../dbinc/db.in	/^#define	DB_ENV_DSYNC_DB		0x00000080 \/* DB_DSYNC_D/
+DB_ENV_DSYNC_LOG	../dbinc/db.in	/^#define	DB_ENV_DSYNC_LOG	0x00000100 \/* DB_DSYNC_L/
+DB_ENV_FATAL	../dbinc/db.in	/^#define	DB_ENV_FATAL		0x00000200 \/* Doing fatal r/
 DB_ENV_INTERNAL	../libdb_java/db_java_wrap.c	/^#define	DB_ENV_INTERNAL(dbenv) ((dbenv)->api2_inte/
-DB_ENV_LOCKDOWN	../dbinc/db.in	2058
-DB_ENV_LOG_AUTOREMOVE	../dbinc/db.in	2059
-DB_ENV_LOG_INMEMORY	../dbinc/db.in	2060
-DB_ENV_NOLOCKING	../dbinc/db.in	2061
-DB_ENV_NOMMAP	../dbinc/db.in	2062
-DB_ENV_NOPANIC	../dbinc/db.in	2063
-DB_ENV_OPEN_CALLED	../dbinc/db.in	2064
-DB_ENV_OVERWRITE	../dbinc/db.in	2065
-DB_ENV_PRIVATE	../dbinc/db.in	2066
-DB_ENV_REGION_INIT	../dbinc/db.in	2067
-DB_ENV_RPCCLIENT	../dbinc/db.in	2068
-DB_ENV_RPCCLIENT_GIVEN	../dbinc/db.in	2069
-DB_ENV_SYSTEM_MEM	../dbinc/db.in	2070
+DB_ENV_LOCKDOWN	../dbinc/db.in	/^#define	DB_ENV_LOCKDOWN		0x00000400 \/* DB_LOCKDOW/
+DB_ENV_LOG_AUTOREMOVE	../dbinc/db.in	/^#define	DB_ENV_LOG_AUTOREMOVE   0x00000800 \/* DB_/
+DB_ENV_LOG_INMEMORY	../dbinc/db.in	/^#define	DB_ENV_LOG_INMEMORY     0x00001000 \/* DB_/
+DB_ENV_MULTIVERSION	../dbinc/db.in	/^#define	DB_ENV_MULTIVERSION	0x00002000 \/* DB_MULT/
+DB_ENV_NOLOCKING	../dbinc/db.in	/^#define	DB_ENV_NOLOCKING	0x00004000 \/* DB_NOLOCKI/
+DB_ENV_NOMMAP	../dbinc/db.in	/^#define	DB_ENV_NOMMAP		0x00008000 \/* DB_NOMMAP se/
+DB_ENV_NOPANIC	../dbinc/db.in	/^#define	DB_ENV_NOPANIC		0x00010000 \/* Okay if pan/
+DB_ENV_OPEN_CALLED	../dbinc/db.in	/^#define	DB_ENV_OPEN_CALLED	0x00020000 \/* DB_ENV->/
+DB_ENV_OVERWRITE	../dbinc/db.in	/^#define	DB_ENV_OVERWRITE	0x00040000 \/* DB_OVERWRI/
+DB_ENV_PRIVATE	../dbinc/db.in	/^#define	DB_ENV_PRIVATE		0x00080000 \/* DB_PRIVATE /
+DB_ENV_REGION_INIT	../dbinc/db.in	/^#define	DB_ENV_REGION_INIT	0x00100000 \/* DB_REGIO/
+DB_ENV_RPCCLIENT	../dbinc/db.in	/^#define	DB_ENV_RPCCLIENT	0x00200000 \/* DB_RPCCLIE/
+DB_ENV_RPCCLIENT_GIVEN	../dbinc/db.in	/^#define	DB_ENV_RPCCLIENT_GIVEN	0x00400000 \/* User/
+DB_ENV_SYSTEM_MEM	../dbinc/db.in	/^#define	DB_ENV_SYSTEM_MEM	0x00800000 \/* DB_SYSTEM/
 DB_ENV_TEST_RECOVERY	../dbinc/debug.h	/^#define	DB_ENV_TEST_RECOVERY(env, val, ret, name) /
-DB_ENV_THREAD	../dbinc/db.in	2071
-DB_ENV_TIME_NOTGRANTED	../dbinc/db.in	2072
-DB_ENV_TXN_NOSYNC	../dbinc/db.in	2073
-DB_ENV_TXN_WRITE_NOSYNC	../dbinc/db.in	2074
-DB_ENV_YIELDCPU	../dbinc/db.in	2075
-DB_ERROR	../dbinc/cxx_int.h	/^#define	DB_ERROR(env, caller, ecode, policy) \\$/
-DB_ERROR_DBT	../dbinc/cxx_int.h	/^#define	DB_ERROR_DBT(env, caller, dbt, policy) \\$/
-DB_EXCL	../dbinc/db.in	259
-DB_EXTENT	../dbinc/db.in	308
-DB_FAST_STAT	../dbinc/db.in	1130
-DB_FCNTL_LOCKING	../dbinc/db.in	260
-DB_FCNTL_OFF_GEN	../dbinc/mutex.h	960
-DB_FCNTL_OFF_LOCK	../dbinc/mutex.h	961
-DB_FCNTL_OFF_MPOOL	../dbinc/mutex.h	962
-DB_FH	../dbinc/db.in	157
-DB_FH_NOSYNC	../dbinc/os.h	84
-DB_FH_OPENED	../dbinc/os.h	85
-DB_FH_UNLINK	../dbinc/os.h	86
-DB_FILE_ID_LEN	../dbinc/db.in	369
-DB_FIRST	../dbinc/db.in	1131
-DB_FLUSH	../dbinc/db.in	526
-DB_FORCE	../dbinc/db.in	192
-DB_FTYPE_NOTSET	../dbinc/db_int.in	441
-DB_FTYPE_SET	../dbinc/db_int.in	440
-DB_GET_BOTH	../dbinc/db.in	1132
-DB_GET_BOTHC	../dbinc/db.in	1133
-DB_GET_BOTH_RANGE	../dbinc/db.in	1134
-DB_GET_RECNO	../dbinc/db.in	1135
+DB_ENV_TEST_RECYCLE	../dbinc/debug.h	/^#define	DB_ENV_TEST_RECYCLE(env, ret) do {				\\$/
+DB_ENV_THREAD	../dbinc/db.in	/^#define	DB_ENV_THREAD		0x01000000 \/* DB_THREAD se/
+DB_ENV_TIME_NOTGRANTED	../dbinc/db.in	/^#define	DB_ENV_TIME_NOTGRANTED	0x02000000 \/* DB_T/
+DB_ENV_TXN_NOSYNC	../dbinc/db.in	/^#define	DB_ENV_TXN_NOSYNC	0x04000000 \/* DB_TXN_NO/
+DB_ENV_TXN_SNAPSHOT	../dbinc/db.in	/^#define	DB_ENV_TXN_SNAPSHOT	0x08000000 \/* DB_TXN_/
+DB_ENV_TXN_WRITE_NOSYNC	../dbinc/db.in	/^#define	DB_ENV_TXN_WRITE_NOSYNC	0x10000000 \/* DB_/
+DB_ENV_YIELDCPU	../dbinc/db.in	/^#define	DB_ENV_YIELDCPU		0x20000000 \/* DB_YIELDCP/
+DB_EVENT	../dbinc/db_int.in	/^#define	DB_EVENT(dbenv, e, einfo) do {					\\$/
+DB_EVENT_NO_SUCH_EVENT	../dbinc/db.in	/^#define	DB_EVENT_NO_SUCH_EVENT		0 \/* out-of-band /
+DB_EVENT_PANIC	../dbinc/db.in	/^#define	DB_EVENT_PANIC			1$/
+DB_EVENT_REP_CLIENT	../dbinc/db.in	/^#define	DB_EVENT_REP_CLIENT		2$/
+DB_EVENT_REP_MASTER	../dbinc/db.in	/^#define	DB_EVENT_REP_MASTER		3$/
+DB_EVENT_REP_NEWMASTER	../dbinc/db.in	/^#define	DB_EVENT_REP_NEWMASTER		4$/
+DB_EVENT_REP_STARTUPDONE	../dbinc/db.in	/^#define	DB_EVENT_REP_STARTUPDONE	5$/
+DB_EVENT_WRITE_FAILED	../dbinc/db.in	/^#define	DB_EVENT_WRITE_FAILED		6$/
+DB_EXCL	../dbinc/db.in	/^#define	DB_EXCL		      0x0004000	\/* Exclusive ope/
+DB_EXTENT	../dbinc/db.in	/^#define	DB_EXTENT	      0x0008000	\/* internal: de/
+DB_FAST_STAT	../dbinc/db.in	/^#define	DB_FAST_STAT	      0x0000001 \/* Don't tra/
+DB_FCNTL_LOCKING	../dbinc/db.in	/^#define	DB_FCNTL_LOCKING      0x0008000	\/* UNDOC:/
+DB_FH	../dbinc/db.in	/^struct __fh_t;		typedef struct __fh_t DB_FH;$/
+DB_FH_NOSYNC	../dbinc/os.h	/^#define	DB_FH_NOSYNC	0x01		\/* Handle doesn't need/
+DB_FH_OPENED	../dbinc/os.h	/^#define	DB_FH_OPENED	0x02		\/* Handle is valid. */
+DB_FH_UNLINK	../dbinc/os.h	/^#define	DB_FH_UNLINK	0x04		\/* Unlink on close *\//
+DB_FILE_ID_LEN	../dbinc/db.in	/^#define	DB_FILE_ID_LEN		20	\/* Unique file ID leng/
+DB_FIRST	../dbinc/db.in	/^#define	DB_FIRST		 7	\/* c_get(), DB_LOGC->get() */
+DB_FLUSH	../dbinc/db.in	/^#define	DB_FLUSH		0x001	\/* Flush data to disk (pu/
+DB_FNAME_DURABLE	../dbinc/log.h	/^#define	DB_FNAME_DURABLE	0x02	\/* File is durable./
+DB_FNAME_NOTLOGGED	../dbinc/log.h	/^#define	DB_FNAME_NOTLOGGED	0x01	\/* Log of close f/
+DB_FORCE	../dbinc/db.in	/^#define	DB_FORCE	      0x0000004	\/* Force (anythi/
+DB_FREELIST_ONLY	../dbinc/db.in	/^#define	DB_FREELIST_ONLY      0x00004000 \/* Just /
+DB_FREEZER_MAGIC	../mp/mp_mvcc.c	/^#define	DB_FREEZER_MAGIC 0x06102002$/
+DB_FREE_SPACE	../dbinc/db.in	/^#define	DB_FREE_SPACE         0x00008000 \/* Free /
+DB_FTYPE_NOTSET	../dbinc/db_int.in	/^#define	DB_FTYPE_NOTSET		 0		\/* Don't call... *\//
+DB_FTYPE_SET	../dbinc/db_int.in	/^#define	DB_FTYPE_SET		-1		\/* Call pgin\/pgout fun/
+DB_GET_BOTH	../dbinc/db.in	/^#define	DB_GET_BOTH		 8	\/* get(), c_get() *\/$/
+DB_GET_BOTHC	../dbinc/db.in	/^#define	DB_GET_BOTHC		 9	\/* c_get() (internal) */
+DB_GET_BOTH_RANGE	../dbinc/db.in	/^#define	DB_GET_BOTH_RANGE	10	\/* get(), c_get() */
+DB_GET_RECNO	../dbinc/db.in	/^#define	DB_GET_RECNO		11	\/* c_get() *\/$/
 DB_GLOBAL	../dbinc/globals.h	/^#define	DB_GLOBAL(v)	__db_global_values.v$/
-DB_GROW_SIZE	../dbinc/log.h	89
-DB_HANDLE_LOCK	../dbinc/db.in	484
-DB_HASHMAGIC	../dbinc/db.in	1111
-DB_HASHOLDVER	../dbinc/db.in	1110
-DB_HASHVERSION	../dbinc/db.in	1109
-DB_HASH_DUP	../dbinc/db_page.h	123
-DB_HASH_DUPSORT	../dbinc/db_page.h	125
-DB_HASH_STAT	../dbinc/db.in	132
-DB_HASH_SUBDB	../dbinc/db_page.h	124
+DB_GLOBALS	../dbinc/globals.h	/^} DB_GLOBALS;$/
+DB_GROW_SIZE	../dbinc/log.h	/^#define	DB_GROW_SIZE	64$/
+DB_HANDLE_LOCK	../dbinc/db.in	/^#define	DB_HANDLE_LOCK	1$/
+DB_HASHMAGIC	../dbinc/db.in	/^#define	DB_HASHMAGIC	0x061561$/
+DB_HASHOLDVER	../dbinc/db.in	/^#define	DB_HASHOLDVER	7		\/* Oldest hash version s/
+DB_HASHTAB	../dbinc/db_int.in	/^typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB;$/
+DB_HASHVERSION	../dbinc/db.in	/^#define	DB_HASHVERSION	8		\/* Current hash version/
+DB_HASH_DUP	../dbinc/db_page.h	/^#define	DB_HASH_DUP	0x01	\/*	  Duplicates. *\/$/
+DB_HASH_DUPSORT	../dbinc/db_page.h	/^#define	DB_HASH_DUPSORT	0x04	\/*	  Duplicates are /
+DB_HASH_STAT	../dbinc/db.in	/^struct __db_h_stat;	typedef struct __db_h_stat DB_/
+DB_HASH_SUBDB	../dbinc/db_page.h	/^#define	DB_HASH_SUBDB	0x02	\/*	  Subdatabases. *\//
 DB_HTONL	../dbinc/db_swap.h	/^#define	DB_HTONL(p) do {						\\$/
 DB_ILLEGAL_AFTER_OPEN	../dbinc/db_int.in	/^#define	DB_ILLEGAL_AFTER_OPEN(dbp, name)				\\$/
 DB_ILLEGAL_BEFORE_OPEN	../dbinc/db_int.in	/^#define	DB_ILLEGAL_BEFORE_OPEN(dbp, name)				\\$/
 DB_ILLEGAL_IN_ENV	../dbinc/db_int.in	/^#define	DB_ILLEGAL_IN_ENV(dbp, name)					\\$/
 DB_ILLEGAL_METHOD	../dbinc/db_int.in	/^#define	DB_ILLEGAL_METHOD(dbp, flags) {					\\$/
-DB_INITENV_CDB	../env/env_open.c	95
-DB_INITENV_CDB_ALLDB	../env/env_open.c	96
-DB_INITENV_LOCK	../env/env_open.c	97
-DB_INITENV_LOG	../env/env_open.c	98
-DB_INITENV_MPOOL	../env/env_open.c	99
-DB_INITENV_REP	../env/env_open.c	100
-DB_INITENV_TXN	../env/env_open.c	101
-DB_INITIALIZE_DB_GLOBALS	../env/env_method.c	31
-DB_INIT_CDB	../dbinc/db.in	244
-DB_INIT_LOCK	../dbinc/db.in	245
-DB_INIT_LOG	../dbinc/db.in	246
-DB_INIT_MPOOL	../dbinc/db.in	247
-DB_INIT_REP	../dbinc/db.in	248
-DB_INIT_TXN	../dbinc/db.in	249
-DB_INORDER	../dbinc/db.in	318
+DB_IMMUTABLE_KEY	../dbinc/db.in	/^#define	DB_IMMUTABLE_KEY      0x0004000	\/* Second/
+DB_INITENV_CDB	../env/env_open.c	/^#define	DB_INITENV_CDB		0x0001	\/* DB_INIT_CDB *\//
+DB_INITENV_CDB_ALLDB	../env/env_open.c	/^#define	DB_INITENV_CDB_ALLDB	0x0002	\/* DB_INIT_CD/
+DB_INITENV_LOCK	../env/env_open.c	/^#define	DB_INITENV_LOCK		0x0004	\/* DB_INIT_LOCK */
+DB_INITENV_LOG	../env/env_open.c	/^#define	DB_INITENV_LOG		0x0008	\/* DB_INIT_LOG *\//
+DB_INITENV_MPOOL	../env/env_open.c	/^#define	DB_INITENV_MPOOL	0x0010	\/* DB_INIT_MPOOL /
+DB_INITENV_REP	../env/env_open.c	/^#define	DB_INITENV_REP		0x0020	\/* DB_INIT_REP *\//
+DB_INITENV_TXN	../env/env_open.c	/^#define	DB_INITENV_TXN		0x0040	\/* DB_INIT_TXN *\//
+DB_INITIALIZE_DB_GLOBALS	../env/env_method.c	/^#define	DB_INITIALIZE_DB_GLOBALS	1$/
+DB_INIT_CDB	../dbinc/db.in	/^#define	DB_INIT_CDB	      0x0004000	\/* Concurrent/
+DB_INIT_DBT	../dbinc/db_int.in	/^#define	DB_INIT_DBT(dbt, d, s)  do {					\\$/
+DB_INIT_LOCK	../dbinc/db.in	/^#define	DB_INIT_LOCK	      0x0008000	\/* Initializ/
+DB_INIT_LOG	../dbinc/db.in	/^#define	DB_INIT_LOG	      0x0010000	\/* Initialize/
+DB_INIT_MPOOL	../dbinc/db.in	/^#define	DB_INIT_MPOOL	      0x0020000	\/* Initiali/
+DB_INIT_REP	../dbinc/db.in	/^#define	DB_INIT_REP	      0x0040000	\/* Initialize/
+DB_INIT_TXN	../dbinc/db.in	/^#define	DB_INIT_TXN	      0x0080000	\/* Initialize/
+DB_INORDER	../dbinc/db.in	/^#define	DB_INORDER	      0x00040000 \/* Queue: str/
 DB_INTERNAL	../libdb_java/db_java_wrap.c	/^#define	DB_INTERNAL(db) ((db)->api_internal)$/
-DB_IO_READ	../dbinc/os.h	55
-DB_IO_WRITE	../dbinc/os.h	56
+DB_IO_READ	../dbinc/os.h	/^#define	DB_IO_READ	1$/
+DB_IO_WRITE	../dbinc/os.h	/^#define	DB_IO_WRITE	2$/
+DB_IS_READONLY	../dbinc/db_am.h	/^#define	DB_IS_READONLY(dbp)						\\$/
 DB_IS_THREADED	../dbinc/db_int.in	/^#define	DB_IS_THREADED(dbp)						\\$/
-DB_IV_BYTES	../dbinc/db_int.in	493
-DB_JOINENV	../dbinc/db.in	250
-DB_JOIN_ITEM	../dbinc/db.in	1136
-DB_JOIN_NOSORT	../dbinc/db.in	339
-DB_KEYEMPTY	../dbinc/db.in	1189
-DB_KEYEXIST	../dbinc/db.in	1190
-DB_KEYFIRST	../dbinc/db.in	1137
-DB_KEYLAST	../dbinc/db.in	1138
-DB_KEY_RANGE	../dbinc/db.in	159
-DB_LAST	../dbinc/db.in	1139
-DB_LOCK	../dbinc/db.in	135
-DB_LOCKDOWN	../dbinc/db.in	251
-DB_LOCKER_DELETED	../dbinc/lock.h	143
-DB_LOCKER_DIRTY	../dbinc/lock.h	144
-DB_LOCKER_INABORT	../dbinc/lock.h	145
-DB_LOCKER_TIMEOUT	../dbinc/lock.h	146
-DB_LOCKREQ	../dbinc/db.in	136
-DB_LOCKVERSION	../dbinc/db.in	367
-DB_LOCK_ABORT	../dbinc/db.in	387
-DB_LOCK_CDB_N	../lock/lock_region.c	53
-DB_LOCK_DEADLOCK	../dbinc/db.in	1191
-DB_LOCK_DEFAULT	../dbinc/db.in	376
-DB_LOCK_DEFAULT_N	../dbinc/lock.h	13
-DB_LOCK_DOALL	../dbinc/lock.h	200
-DB_LOCK_DOWNGRADE	../dbinc/lock.h	201
-DB_LOCK_EXPIRE	../dbinc/db.in	377
-DB_LOCK_FREE	../dbinc/lock.h	202
-DB_LOCK_ILOCK	../dbinc/db.in	133
-DB_LOCK_INVALIDID	../dbinc/lock.h	20
-DB_LOCK_MAXID	../dbinc/lock.h	21
-DB_LOCK_MAXLOCKS	../dbinc/db.in	378
-DB_LOCK_MAXWRITE	../dbinc/db.in	379
-DB_LOCK_MINLOCKS	../dbinc/db.in	380
-DB_LOCK_MINWRITE	../dbinc/db.in	381
-DB_LOCK_NOPROMOTE	../dbinc/lock.h	203
-DB_LOCK_NOREGION	../dbinc/lock.h	205
-DB_LOCK_NORUN	../dbinc/db.in	375
-DB_LOCK_NOTEXIST	../dbinc/db.in	1217
-DB_LOCK_NOTGRANTED	../dbinc/db.in	1192
-DB_LOCK_NOWAIT	../dbinc/db.in	388
-DB_LOCK_NOWAITERS	../dbinc/lock.h	206
-DB_LOCK_OLDEST	../dbinc/db.in	382
-DB_LOCK_RANDOM	../dbinc/db.in	383
-DB_LOCK_RECORD	../dbinc/db.in	389
-DB_LOCK_REMOVE	../dbinc/db.in	390
-DB_LOCK_RIW_N	../lock/lock_region.c	34
-DB_LOCK_SET_TIMEOUT	../dbinc/db.in	391
-DB_LOCK_STAT	../dbinc/db.in	134
-DB_LOCK_SWITCH	../dbinc/db.in	392
-DB_LOCK_UNLINK	../dbinc/lock.h	204
-DB_LOCK_UPGRADE	../dbinc/db.in	393
-DB_LOCK_YOUNGEST	../dbinc/db.in	384
-DB_LOG	../dbinc/log.h	58
-DB_LOGC	../dbinc/db.in	137
-DB_LOGC_BUF_SIZE	../dbinc/db.in	575
-DB_LOGFILEID_INVALID	../dbinc/db.in	1261
-DB_LOGMAGIC	../dbinc/db.in	517
-DB_LOGOLDVER	../dbinc/db.in	516
-DB_LOGVERSION	../dbinc/db.in	515
-DB_LOG_AUTOREMOVE	../dbinc/db.in	282
-DB_LOG_BUFFER_FULL	../dbinc/db.in	1193
-DB_LOG_CHKPNT	../dbinc/db.in	527
-DB_LOG_COMMIT	../dbinc/db.in	528
-DB_LOG_DISK	../dbinc/db.in	587
-DB_LOG_INMEMORY	../dbinc/db.in	283
-DB_LOG_LOCKED	../dbinc/db.in	588
-DB_LOG_NOCOPY	../dbinc/db.in	529
-DB_LOG_NOT_DURABLE	../dbinc/db.in	530
-DB_LOG_PERM	../dbinc/db.in	531
-DB_LOG_RESEND	../dbinc/db.in	532
-DB_LOG_SILENT_ERR	../dbinc/db.in	589
-DB_LOG_STAT	../dbinc/db.in	138
-DB_LOG_WRNOSYNC	../dbinc/db.in	533
-DB_LSN	../dbinc/db.in	139
-DB_MAC_KEY	../dbinc/db_int.in	494
-DB_MAC_MAGIC	../dbinc/hmac.h	28
-DB_MAXMMAPSIZE	../mp/mp_fopen.c	493
-DB_MAX_HANDLES	../dbinc/mutex.h	979
-DB_MAX_PAGES	../dbinc/db.in	107
-DB_MAX_PGSIZE	../dbinc/db_int.in	89
-DB_MAX_RECORDS	../dbinc/db.in	110
-DB_METHOD	../cxx/cxx_db.cpp	/^#define	DB_METHOD(_name, _argspec, _arglist, _reto/
+DB_IV_BYTES	../dbinc/db_int.in	/^#define	DB_IV_BYTES     16		\/* Bytes per IV *\/$/
+DB_JOINENV	../dbinc/db.in	/^#define	DB_JOINENV	      0x0	\/* Compatibility. */
+DB_JOIN_ITEM	../dbinc/db.in	/^#define	DB_JOIN_ITEM		12	\/* c_get(); do not do pr/
+DB_JOIN_NOSORT	../dbinc/db.in	/^#define	DB_JOIN_NOSORT	      0x0000001	\/* Don't t/
+DB_KEYEMPTY	../dbinc/db.in	/^#define	DB_KEYEMPTY		(-30997)\/* Key\/data deleted/
+DB_KEYEXIST	../dbinc/db.in	/^#define	DB_KEYEXIST		(-30996)\/* The key\/data pai/
+DB_KEYFIRST	../dbinc/db.in	/^#define	DB_KEYFIRST		13	\/* c_put() *\/$/
+DB_KEYLAST	../dbinc/db.in	/^#define	DB_KEYLAST		14	\/* c_put() *\/$/
+DB_KEY_RANGE	../dbinc/db.in	/^struct __key_range;	typedef struct __key_range DB_/
+DB_LAST	../dbinc/db.in	/^#define	DB_LAST			15	\/* c_get(), DB_LOGC->get() */
+DB_LOCK	../dbinc/db.in	/^struct __db_lock_u;	typedef struct __db_lock_u DB_/
+DB_LOCKDOWN	../dbinc/db.in	/^#define	DB_LOCKDOWN	      0x0100000	\/* Lock memor/
+DB_LOCKER	../dbinc/lock.h	/^} DB_LOCKER;$/
+DB_LOCKER_DELETED	../dbinc/lock.h	/^#define	DB_LOCKER_DELETED	0x0001$/
+DB_LOCKER_DIRTY	../dbinc/lock.h	/^#define	DB_LOCKER_DIRTY		0x0002$/
+DB_LOCKER_INABORT	../dbinc/lock.h	/^#define	DB_LOCKER_INABORT	0x0004$/
+DB_LOCKER_TIMEOUT	../dbinc/lock.h	/^#define	DB_LOCKER_TIMEOUT	0x0008$/
+DB_LOCKOBJ	../dbinc/lock.h	/^} DB_LOCKOBJ;$/
+DB_LOCKREGION	../dbinc/lock.h	/^} DB_LOCKREGION;$/
+DB_LOCKREQ	../dbinc/db.in	/^struct __db_lockreq;	typedef struct __db_lockreq D/
+DB_LOCKTAB	../dbinc/db.in	/^struct __db_locktab;	typedef struct __db_locktab D/
+DB_LOCKVERSION	../dbinc/db.in	/^#define	DB_LOCKVERSION	1$/
+DB_LOCK_ABORT	../dbinc/db.in	/^#define	DB_LOCK_ABORT		0x001	\/* Internal: Lock du/
+DB_LOCK_CDB_N	../lock/lock_region.c	/^#define	DB_LOCK_CDB_N	5$/
+DB_LOCK_DEADLOCK	../dbinc/db.in	/^#define	DB_LOCK_DEADLOCK	(-30995)\/* Deadlock. *\//
+DB_LOCK_DEFAULT	../dbinc/db.in	/^#define	DB_LOCK_DEFAULT		1	\/* Default policy. *\//
+DB_LOCK_DEFAULT_N	../dbinc/lock.h	/^#define	DB_LOCK_DEFAULT_N	1000	\/* Default # of lo/
+DB_LOCK_DOALL	../dbinc/lock.h	/^#define	DB_LOCK_DOALL		0x010000$/
+DB_LOCK_EXPIRE	../dbinc/db.in	/^#define	DB_LOCK_EXPIRE		2	\/* Only expire locks, n/
+DB_LOCK_FREE	../dbinc/lock.h	/^#define	DB_LOCK_FREE		0x040000$/
+DB_LOCK_ILOCK	../dbinc/db.in	/^struct __db_ilock;	typedef struct __db_ilock DB_LO/
+DB_LOCK_INVALIDID	../dbinc/lock.h	/^#define	DB_LOCK_INVALIDID	0$/
+DB_LOCK_MAXID	../dbinc/lock.h	/^#define	DB_LOCK_MAXID		0x7fffffff$/
+DB_LOCK_MAXLOCKS	../dbinc/db.in	/^#define	DB_LOCK_MAXLOCKS	3	\/* Select locker with /
+DB_LOCK_MAXWRITE	../dbinc/db.in	/^#define	DB_LOCK_MAXWRITE	4	\/* Select locker with /
+DB_LOCK_MINLOCKS	../dbinc/db.in	/^#define	DB_LOCK_MINLOCKS	5	\/* Select locker with /
+DB_LOCK_MINWRITE	../dbinc/db.in	/^#define	DB_LOCK_MINWRITE	6	\/* Select locker with /
+DB_LOCK_NOPROMOTE	../dbinc/lock.h	/^#define	DB_LOCK_NOPROMOTE	0x080000$/
+DB_LOCK_NOREGION	../dbinc/lock.h	/^#define	DB_LOCK_NOREGION	0x200000$/
+DB_LOCK_NORUN	../dbinc/db.in	/^#define	DB_LOCK_NORUN		0$/
+DB_LOCK_NOTGRANTED	../dbinc/db.in	/^#define	DB_LOCK_NOTGRANTED	(-30994)\/* Lock unavai/
+DB_LOCK_NOWAIT	../dbinc/db.in	/^#define	DB_LOCK_NOWAIT		0x002	\/* Don't wait on un/
+DB_LOCK_NOWAITERS	../dbinc/lock.h	/^#define	DB_LOCK_NOWAITERS	0x400000$/
+DB_LOCK_OLDEST	../dbinc/db.in	/^#define	DB_LOCK_OLDEST		7	\/* Select oldest locker/
+DB_LOCK_RANDOM	../dbinc/db.in	/^#define	DB_LOCK_RANDOM		8	\/* Select random locker/
+DB_LOCK_RECORD	../dbinc/db.in	/^#define	DB_LOCK_RECORD		0x004	\/* Internal: record/
+DB_LOCK_RIW_N	../lock/lock_region.c	/^#define	DB_LOCK_RIW_N	9$/
+DB_LOCK_SET_TIMEOUT	../dbinc/db.in	/^#define	DB_LOCK_SET_TIMEOUT	0x008	\/* Internal: se/
+DB_LOCK_STAT	../dbinc/db.in	/^struct __db_lock_stat;	typedef struct __db_lock_st/
+DB_LOCK_SWITCH	../dbinc/db.in	/^#define	DB_LOCK_SWITCH		0x010	\/* Internal: switch/
+DB_LOCK_UNLINK	../dbinc/lock.h	/^#define	DB_LOCK_UNLINK		0x100000$/
+DB_LOCK_UPGRADE	../dbinc/db.in	/^#define	DB_LOCK_UPGRADE		0x020	\/* Internal: upgra/
+DB_LOCK_YOUNGEST	../dbinc/db.in	/^#define	DB_LOCK_YOUNGEST	9	\/* Select youngest loc/
+DB_LOG	../dbinc/db.in	/^struct __db_log;	typedef struct __db_log DB_LOG;$/
+DB_LOGC	../dbinc/db.in	/^struct __db_log_cursor;	typedef struct __db_log_cu/
+DB_LOGFILEID_INVALID	../dbinc/db.in	/^#define	DB_LOGFILEID_INVALID	-1$/
+DB_LOGMAGIC	../dbinc/db.in	/^#define	DB_LOGMAGIC	0x040988$/
+DB_LOGOLDVER	../dbinc/db.in	/^#define	DB_LOGOLDVER	8		\/* Oldest log version sup/
+DB_LOGVERSION	../dbinc/db.in	/^#define	DB_LOGVERSION	12		\/* Current log version./
+DB_LOGVERSION_42	../dbinc/rep.h	/^#define	DB_LOGVERSION_42	8$/
+DB_LOGVERSION_43	../dbinc/rep.h	/^#define	DB_LOGVERSION_43	10$/
+DB_LOGVERSION_44	../dbinc/rep.h	/^#define	DB_LOGVERSION_44	11$/
+DB_LOGVERSION_45	../dbinc/rep.h	/^#define	DB_LOGVERSION_45	12$/
+DB_LOG_AUTOREMOVE	../dbinc/db.in	/^#define	DB_LOG_AUTOREMOVE     0x00080000\/* Automa/
+DB_LOG_BUFFER_FULL	../dbinc/db.in	/^#define	DB_LOG_BUFFER_FULL	(-30993)\/* In-memory l/
+DB_LOG_CHKPNT	../dbinc/db.in	/^#define	DB_LOG_CHKPNT		0x002	\/* Flush supports a /
+DB_LOG_COMMIT	../dbinc/db.in	/^#define	DB_LOG_COMMIT		0x004	\/* Flush supports a /
+DB_LOG_DISK	../dbinc/db.in	/^#define	DB_LOG_DISK		0x01	\/* Log record came from/
+DB_LOG_INMEMORY	../dbinc/db.in	/^#define	DB_LOG_INMEMORY       0x00100000\/* Store /
+DB_LOG_LOCKED	../dbinc/db.in	/^#define	DB_LOG_LOCKED		0x02	\/* Log region already/
+DB_LOG_NOCOPY	../dbinc/db.in	/^#define	DB_LOG_NOCOPY		0x008	\/* Don't copy data */
+DB_LOG_NOT_DURABLE	../dbinc/db.in	/^#define	DB_LOG_NOT_DURABLE	0x010	\/* Do not log; k/
+DB_LOG_PERM_42_44	../dbinc/rep.h	/^#define	DB_LOG_PERM_42_44	0x20$/
+DB_LOG_RESEND_42_44	../dbinc/rep.h	/^#define	DB_LOG_RESEND_42_44	0x40$/
+DB_LOG_SILENT_ERR	../dbinc/db.in	/^#define	DB_LOG_SILENT_ERR	0x04	\/* Turn-off error /
+DB_LOG_STAT	../dbinc/db.in	/^struct __db_log_stat;	typedef struct __db_log_stat/
+DB_LOG_WRNOSYNC	../dbinc/db.in	/^#define	DB_LOG_WRNOSYNC		0x020	\/* Write, don't sy/
+DB_LSN	../dbinc/db.in	/^struct __db_lsn;	typedef struct __db_lsn DB_LSN;$/
+DB_LSN_OFF_NOTSET	../dbinc/db_int.in	/^#define	DB_LSN_OFF_NOTSET	-1		\/* Not yet set. *\//
+DB_LSN_STACK_SIZE	../dbinc/db_dispatch.h	/^#define	DB_LSN_STACK_SIZE 4$/
+DB_MAC_KEY	../dbinc/db_int.in	/^#define	DB_MAC_KEY	20		\/* Bytes per MAC checksum /
+DB_MAC_MAGIC	../dbinc/hmac.h	/^#define	DB_MAC_MAGIC	"mac derivation key magic val/
+DB_MAXMMAPSIZE	../mp/mp_fopen.c	/^#define	DB_MAXMMAPSIZE	(10 * 1024 * 1024)	\/* 10 M/
+DB_MAXPATHLEN	../dbinc/db_int.in	/^#define	DB_MAXPATHLEN	1024$/
+DB_MAX_PAGES	../dbinc/db.in	/^#define	DB_MAX_PAGES	0xffffffff	\/* >= # of pages /
+DB_MAX_PGSIZE	../dbinc/db_int.in	/^#define	DB_MAX_PGSIZE	0x010000	\/* Maximum page si/
+DB_MAX_RECORDS	../dbinc/db.in	/^#define	DB_MAX_RECORDS	0xffffffff	\/* >= # of reco/
+DB_METHOD	../cxx/cxx_db.cpp	/^\/\/ Helper macros for simple methods that pass th/
 DB_METHOD_QUIET	../cxx/cxx_db.cpp	/^#define	DB_METHOD_QUIET(_name, _argspec, _arglist)/
 DB_METHOD_VOID	../cxx/cxx_db.cpp	/^#define	DB_METHOD_VOID(_name, _argspec, _arglist)	/
-DB_MINPAGECACHE	../dbinc/db_int.in	94
-DB_MIN_PGSIZE	../dbinc/db_int.in	88
-DB_MPOOL	../dbinc/db.in	140
-DB_MPOOLFILE	../dbinc/db.in	143
-DB_MPOOLFILE_METHOD	../cxx/cxx_mpool.cpp	/^#define	DB_MPOOLFILE_METHOD(_name, _argspec, _argl/
+DB_MINPAGECACHE	../dbinc/db_int.in	/^#define	DB_MINPAGECACHE	16$/
+DB_MIN_PGSIZE	../dbinc/db_int.in	/^#define	DB_MIN_PGSIZE	0x000200	\/* Minimum page si/
+DB_MPOOL	../dbinc/db.in	/^struct __db_mpool;	typedef struct __db_mpool DB_MP/
+DB_MPOOLFILE	../dbinc/db.in	/^struct __db_mpoolfile;	typedef struct __db_mpoolfi/
+DB_MPOOLFILE_METHOD	../cxx/cxx_mpool.cpp	/^\/\/ Helper macros for simple methods that pass th/
 DB_MPOOLFILE_METHOD_VOID	../cxx/cxx_mpool.cpp	/^#define	DB_MPOOLFILE_METHOD_VOID(_name, _argspec, /
-DB_MPOOL_CLEAN	../dbinc/db.in	635
-DB_MPOOL_CREATE	../dbinc/db.in	630
-DB_MPOOL_DIRTY	../dbinc/db.in	636
-DB_MPOOL_DISCARD	../dbinc/db.in	637
-DB_MPOOL_FREE	../dbinc/db.in	638
-DB_MPOOL_FSTAT	../dbinc/db.in	141
-DB_MPOOL_HASH	../dbinc/mp.h	14
-DB_MPOOL_LAST	../dbinc/db.in	631
-DB_MPOOL_NEW	../dbinc/db.in	632
-DB_MPOOL_NOFILE	../dbinc/db.in	641
-DB_MPOOL_STAT	../dbinc/db.in	142
-DB_MPOOL_UNLINK	../dbinc/db.in	642
-DB_MPREG	../dbinc/mp.h	15
+DB_MPOOL_CREATE	../dbinc/db.in	/^#define	DB_MPOOL_CREATE		0x001	\/* Create a page. /
+DB_MPOOL_DIRTY	../dbinc/db.in	/^#define	DB_MPOOL_DIRTY		0x002	\/* Get page for an /
+DB_MPOOL_DISCARD	../dbinc/db.in	/^#define	DB_MPOOL_DISCARD	0x001	\/* Don't cache the/
+DB_MPOOL_EDIT	../dbinc/db.in	/^#define	DB_MPOOL_EDIT		0x004	\/* Modify without co/
+DB_MPOOL_FREE	../dbinc/db.in	/^#define	DB_MPOOL_FREE		0x008	\/* Free page if pres/
+DB_MPOOL_FSTAT	../dbinc/db.in	/^struct __db_mpool_fstat;typedef struct __db_mpool_/
+DB_MPOOL_HASH	../dbinc/mp.h	/^struct __db_mpool_hash; typedef struct __db_mpool_/
+DB_MPOOL_LAST	../dbinc/db.in	/^#define	DB_MPOOL_LAST		0x010	\/* Return the last p/
+DB_MPOOL_NEW	../dbinc/db.in	/^#define	DB_MPOOL_NEW		0x020	\/* Create a new page./
+DB_MPOOL_NOFILE	../dbinc/db.in	/^#define	DB_MPOOL_NOFILE		0x001	\/* Never open a ba/
+DB_MPOOL_STAT	../dbinc/db.in	/^struct __db_mpool_stat;	typedef struct __db_mpool_/
+DB_MPOOL_UNLINK	../dbinc/db.in	/^#define	DB_MPOOL_UNLINK		0x002	\/* Unlink the file/
+DB_MPREG	../dbinc/mp.h	/^struct __db_mpreg;	typedef struct __db_mpreg DB_MP/
+DB_MSGBUF	../dbinc/db_int.in	/^} DB_MSGBUF;$/
 DB_MSGBUF_FLUSH	../dbinc/db_int.in	/^#define	DB_MSGBUF_FLUSH(dbenv, a) do {					\\$/
 DB_MSGBUF_INIT	../dbinc/db_int.in	/^#define	DB_MSGBUF_INIT(a) do {						\\$/
-DB_MULTIPLE	../dbinc/db.in	1168
+DB_MULTIPLE	../dbinc/db.in	/^#define	DB_MULTIPLE	0x10000000	\/* Return multiple/
 DB_MULTIPLE_INIT	../dbinc/db.in	/^#define	DB_MULTIPLE_INIT(pointer, dbt)					\\$/
-DB_MULTIPLE_KEY	../dbinc/db.in	1169
+DB_MULTIPLE_KEY	../dbinc/db.in	/^#define	DB_MULTIPLE_KEY	0x20000000	\/* Return mult/
 DB_MULTIPLE_KEY_NEXT	../dbinc/db.in	/^#define	DB_MULTIPLE_KEY_NEXT(pointer, dbt, retkey,/
 DB_MULTIPLE_NEXT	../dbinc/db.in	/^#define	DB_MULTIPLE_NEXT(pointer, dbt, retdata, re/
 DB_MULTIPLE_RECNO_NEXT	../dbinc/db.in	/^#define	DB_MULTIPLE_RECNO_NEXT(pointer, dbt, recno/
-DB_MUTEX	../dbinc/db.in	161
-DB_NEEDSPLIT	../dbinc/db.in	1218
-DB_NEXT	../dbinc/db.in	1140
-DB_NEXT_DUP	../dbinc/db.in	1141
-DB_NEXT_NODUP	../dbinc/db.in	1142
-DB_NODUPDATA	../dbinc/db.in	1143
-DB_NOLOCKING	../dbinc/db.in	284
-DB_NOMMAP	../dbinc/db.in	193
+DB_MULTIVERSION	../dbinc/db.in	/^#define	DB_MULTIVERSION	      0x0000008 \/* Multiv/
+DB_MUTEX	../dbinc/db.in	/^struct __db_mutex_t;	typedef struct __db_mutex_t D/
+DB_MUTEXMGR	../dbinc/db.in	/^struct __db_mutexmgr;	typedef struct __db_mutexmgr/
+DB_MUTEXREGION	../dbinc/mutex_int.h	/^} DB_MUTEXREGION;$/
+DB_MUTEX_ALLOCATED	../dbinc/db.in	/^#define	DB_MUTEX_ALLOCATED	0x01	\/* Mutex currentl/
+DB_MUTEX_LOCKED	../dbinc/db.in	/^#define	DB_MUTEX_LOCKED		0x02	\/* Mutex currently /
+DB_MUTEX_LOGICAL_LOCK	../dbinc/db.in	/^#define	DB_MUTEX_LOGICAL_LOCK	0x04	\/* Mutex backs/
+DB_MUTEX_PROCESS_ONLY	../dbinc/db.in	/^#define	DB_MUTEX_PROCESS_ONLY	0x08	\/* Mutex priva/
+DB_MUTEX_SELF_BLOCK	../dbinc/db.in	/^#define	DB_MUTEX_SELF_BLOCK	0x10	\/* Must be able /
+DB_MUTEX_STAT	../dbinc/db.in	/^struct __db_mutex_stat;	typedef struct __db_mutex_/
+DB_NEEDSPLIT	../dbinc/db.in	/^#define	DB_NEEDSPLIT		(-30897)\/* Page needs to be/
+DB_NEXT	../dbinc/db.in	/^#define	DB_NEXT			16	\/* c_get(), DB_LOGC->get() */
+DB_NEXT_DUP	../dbinc/db.in	/^#define	DB_NEXT_DUP		17	\/* c_get() *\/$/
+DB_NEXT_NODUP	../dbinc/db.in	/^#define	DB_NEXT_NODUP		18	\/* c_get() *\/$/
+DB_NODUPDATA	../dbinc/db.in	/^#define	DB_NODUPDATA		19	\/* put(), c_put() *\/$/
+DB_NOLOCKING	../dbinc/db.in	/^#define	DB_NOLOCKING	      0x00200000\/* Set locki/
+DB_NOMMAP	../dbinc/db.in	/^#define	DB_NOMMAP	      0x0000010	\/* Don't mmap u/
 DB_NONBLOCK	../dbinc/db_int.in	/^#define	DB_NONBLOCK(C)	((C)->txn != NULL && F_ISSE/
-DB_NOORDERCHK	../dbinc/db.in	345
-DB_NOOVERWRITE	../dbinc/db.in	1144
-DB_NOPANIC	../dbinc/db.in	285
-DB_NOSERVER	../dbinc/db.in	1194
-DB_NOSERVER_HOME	../dbinc/db.in	1195
-DB_NOSERVER_ID	../dbinc/db.in	1196
-DB_NOSYNC	../dbinc/db.in	1145
-DB_NOTFOUND	../dbinc/db.in	1197
-DB_NO_AUTO_COMMIT	../dbinc/db.in	228
+DB_NOORDERCHK	../dbinc/db.in	/^#define	DB_NOORDERCHK	      0x0000002	\/* Skip sor/
+DB_NOOVERWRITE	../dbinc/db.in	/^#define	DB_NOOVERWRITE		20	\/* put() *\/$/
+DB_NOPANIC	../dbinc/db.in	/^#define	DB_NOPANIC	      0x00400000\/* Set panic s/
+DB_NOSERVER	../dbinc/db.in	/^#define	DB_NOSERVER		(-30992)\/* Server panic retu/
+DB_NOSERVER_HOME	../dbinc/db.in	/^#define	DB_NOSERVER_HOME	(-30991)\/* Bad home sent/
+DB_NOSERVER_ID	../dbinc/db.in	/^#define	DB_NOSERVER_ID		(-30990)\/* Bad ID sent to/
+DB_NOSYNC	../dbinc/db.in	/^#define	DB_NOSYNC		21	\/* close() *\/$/
+DB_NOTFOUND	../dbinc/db.in	/^#define	DB_NOTFOUND		(-30989)\/* Key\/data pair no/
+DB_NO_AUTO_COMMIT	../dbinc/db.in	/^#define	DB_NO_AUTO_COMMIT     0x0010000	\/* Overri/
 DB_NTOHL	../dbinc/db_swap.h	/^#define	DB_NTOHL(p) do {						\\$/
-DB_ODDFILESIZE	../dbinc/db.in	309
-DB_OK_BTREE	../dbinc/db.in	1477
-DB_OK_HASH	../dbinc/db.in	1478
-DB_OK_QUEUE	../dbinc/db.in	1479
-DB_OK_RECNO	../dbinc/db.in	1480
-DB_OLD_VERSION	../dbinc/db.in	1198
-DB_OPFLAGS_MASK	../dbinc/db.in	1161
-DB_OPNOTSUP	../dbinc/db_int.in	259
-DB_ORDERCHKONLY	../dbinc/db.in	346
-DB_OSO_CREATE	../dbinc/os.h	31
-DB_OSO_DIRECT	../dbinc/os.h	32
-DB_OSO_DSYNC	../dbinc/os.h	33
-DB_OSO_EXCL	../dbinc/os.h	34
-DB_OSO_LOG	../dbinc/os.h	35
-DB_OSO_RDONLY	../dbinc/os.h	36
-DB_OSO_REGION	../dbinc/os.h	37
-DB_OSO_SEQ	../dbinc/os.h	38
-DB_OSO_TEMP	../dbinc/os.h	39
-DB_OSO_TRUNC	../dbinc/os.h	40
-DB_OS_SEEK	../dbinc/os.h	49
-DB_OVERFLOWED_DBT	../dbinc/cxx_int.h	/^#define	DB_OVERFLOWED_DBT(dbt) \\$/
-DB_OVERWRITE	../dbinc/db.in	286
-DB_PAGE_DB_LEN	../dbinc/db_page.h	58
-DB_PAGE_LOCK	../dbinc/db.in	486
-DB_PAGE_NOTFOUND	../dbinc/db.in	1199
-DB_PAGE_QUEUE_LEN	../dbinc/db_page.h	59
-DB_PANIC_ENVIRONMENT	../dbinc/db.in	287
+DB_ODDFILESIZE	../dbinc/db.in	/^#define	DB_ODDFILESIZE	      0x0010000	\/* Truncat/
+DB_OK_BTREE	../dbinc/db.in	/^#define	DB_OK_BTREE	0x01$/
+DB_OK_HASH	../dbinc/db.in	/^#define	DB_OK_HASH	0x02$/
+DB_OK_QUEUE	../dbinc/db.in	/^#define	DB_OK_QUEUE	0x04$/
+DB_OK_RECNO	../dbinc/db.in	/^#define	DB_OK_RECNO	0x08$/
+DB_OLD_VERSION	../dbinc/db.in	/^#define	DB_OLD_VERSION		(-30988)\/* Out-of-date ve/
+DB_OPFLAGS_MASK	../dbinc/db.in	/^#define	DB_OPFLAGS_MASK	0x000000ff	\/* Mask for op/
+DB_OPNOTSUP	../dbinc/db_int.in	/^#define	DB_OPNOTSUP	EOPNOTSUPP$/
+DB_ORDERCHKONLY	../dbinc/db.in	/^#define	DB_ORDERCHKONLY	      0x0000004	\/* Only p/
+DB_OSO_ABSMODE	../dbinc/os.h	/^#define	DB_OSO_ABSMODE	0x0001		\/* Absolute mode s/
+DB_OSO_CREATE	../dbinc/os.h	/^#define	DB_OSO_CREATE	0x0002		\/* POSIX: O_CREAT */
+DB_OSO_DIRECT	../dbinc/os.h	/^#define	DB_OSO_DIRECT	0x0004		\/* Don't buffer the/
+DB_OSO_DSYNC	../dbinc/os.h	/^#define	DB_OSO_DSYNC	0x0008		\/* POSIX: O_DSYNC. */
+DB_OSO_EXCL	../dbinc/os.h	/^#define	DB_OSO_EXCL	0x0010		\/* POSIX: O_EXCL *\/$/
+DB_OSO_RDONLY	../dbinc/os.h	/^#define	DB_OSO_RDONLY	0x0020		\/* POSIX: O_RDONLY /
+DB_OSO_REGION	../dbinc/os.h	/^#define	DB_OSO_REGION	0x0040		\/* Opening a region/
+DB_OSO_SEQ	../dbinc/os.h	/^#define	DB_OSO_SEQ	0x0080		\/* Expected sequential/
+DB_OSO_TEMP	../dbinc/os.h	/^#define	DB_OSO_TEMP	0x0100		\/* Remove after last /
+DB_OSO_TRUNC	../dbinc/os.h	/^#define	DB_OSO_TRUNC	0x0200		\/* POSIX: O_TRUNC */
+DB_OVERWRITE	../dbinc/db.in	/^#define	DB_OVERWRITE	      0x00800000\/* Overwrite/
+DB_PAGE_DB_LEN	../dbinc/db_page.h	/^#define	DB_PAGE_DB_LEN		32$/
+DB_PAGE_LOCK	../dbinc/db.in	/^#define	DB_PAGE_LOCK	3$/
+DB_PAGE_NOTFOUND	../dbinc/db.in	/^#define	DB_PAGE_NOTFOUND	(-30987)\/* Requested pag/
+DB_PAGE_QUEUE_LEN	../dbinc/db_page.h	/^#define	DB_PAGE_QUEUE_LEN	0$/
+DB_PANIC_ENVIRONMENT	../dbinc/db.in	/^#define	DB_PANIC_ENVIRONMENT  0x01000000\/* Set pa/
 DB_PCT	../dbinc/db_int.in	/^#define	DB_PCT(v, total)						\\$/
 DB_PCT_PG	../dbinc/db_int.in	/^#define	DB_PCT_PG(v, total, pgsize)					\\$/
-DB_PKG	../libdb_java/db_java_wrap.c	80
-DB_POSITION	../dbinc/db.in	1146
-DB_PREPLIST	../dbinc/db.in	144
-DB_PREV	../dbinc/db.in	1147
-DB_PREV_NODUP	../dbinc/db.in	1148
-DB_PRINTABLE	../dbinc/db.in	349
-DB_PRIVATE	../dbinc/db.in	252
-DB_PR_PAGE	../dbinc/db.in	347
-DB_PR_RECOVERYTEST	../dbinc/db.in	348
-DB_QAMMAGIC	../dbinc/db.in	1115
-DB_QAMOLDVER	../dbinc/db.in	1114
-DB_QAMVERSION	../dbinc/db.in	1113
-DB_QUEUE_STAT	../dbinc/db.in	145
-DB_RDONLY	../dbinc/db.in	194
-DB_RDWRMASTER	../dbinc/db.in	261
+DB_PGINFO	../dbinc/db_int.in	/^} DB_PGINFO;$/
+DB_PKG	../libdb_java/db_java_wrap.c	/^#define	DB_PKG "com\/sleepycat\/db\/"$/
+DB_POSITION	../dbinc/db.in	/^#define	DB_POSITION		22	\/* c_dup() *\/$/
+DB_PREPLIST	../dbinc/db.in	/^struct __db_preplist;	typedef struct __db_preplist/
+DB_PREV	../dbinc/db.in	/^#define	DB_PREV			23	\/* c_get(), DB_LOGC->get() */
+DB_PREV_NODUP	../dbinc/db.in	/^#define	DB_PREV_NODUP		24	\/* c_get(), DB_LOGC->ge/
+DB_PRINTABLE	../dbinc/db.in	/^#define	DB_PRINTABLE	      0x0000020	\/* Use print/
+DB_PRIVATE	../dbinc/db.in	/^#define	DB_PRIVATE	      0x0200000	\/* DB_ENV is p/
+DB_PR_PAGE	../dbinc/db.in	/^#define	DB_PR_PAGE	      0x0000008	\/* Show page c/
+DB_PR_RECOVERYTEST	../dbinc/db.in	/^#define	DB_PR_RECOVERYTEST    0x0000010	\/* Recove/
+DB_QAMMAGIC	../dbinc/db.in	/^#define	DB_QAMMAGIC	0x042253$/
+DB_QAMOLDVER	../dbinc/db.in	/^#define	DB_QAMOLDVER	3		\/* Oldest queue version s/
+DB_QAMVERSION	../dbinc/db.in	/^#define	DB_QAMVERSION	4		\/* Current queue version/
+DB_QUEUE_STAT	../dbinc/db.in	/^struct __db_qam_stat;	typedef struct __db_qam_stat/
+DB_RDONLY	../dbinc/db.in	/^#define	DB_RDONLY	      0x0000020	\/* Read-only (O/
+DB_RDWRMASTER	../dbinc/db.in	/^#define	DB_RDWRMASTER	      0x0020000	\/* UNDOC: a/
+DB_READ_COMMITTED	../dbinc/db.in	/^#define	DB_READ_COMMITTED     0x04000000\/* Degree/
+DB_READ_UNCOMMITTED	../dbinc/db.in	/^#define	DB_READ_UNCOMMITTED   0x08000000\/* Degree/
 DB_REAL_ERR	../dbinc/debug.h	/^#define	DB_REAL_ERR(env, error, error_set, default/
 DB_REAL_MSG	../dbinc/debug.h	/^#define	DB_REAL_MSG(env, fmt) {						\\$/
-DB_RECNUM	../dbinc/db.in	319
-DB_RECORDCOUNT	../dbinc/db.in	1149
-DB_RECORD_LOCK	../dbinc/db.in	485
-DB_RECOVER	../dbinc/db.in	195
-DB_RECOVER_FATAL	../dbinc/db.in	253
+DB_RECNUM	../dbinc/db.in	/^#define	DB_RECNUM	      0x00080000 \/* Btree: reco/
+DB_RECORD_LOCK	../dbinc/db.in	/^#define	DB_RECORD_LOCK	2$/
+DB_RECOVER	../dbinc/db.in	/^#define	DB_RECOVER	      0x0000040	\/* Run normal /
+DB_RECOVER_FATAL	../dbinc/db.in	/^#define	DB_RECOVER_FATAL      0x0400000	\/* Run ca/
 DB_REDO	../dbinc/db.in	/^#define	DB_REDO(op)	((op) == DB_TXN_FORWARD_ROLL |/
-DB_REGENV_REPLOCKED	../dbinc/region.h	170
-DB_REGENV_TIMEOUT	../dbinc/region.h	172
-DB_REGION_ENV	../dbinc/region.h	104
-DB_REGION_FMT	../dbinc/region.h	103
-DB_REGION_INIT	../dbinc/db.in	288
-DB_REGION_MAGIC	../dbinc/db.in	1734
-DB_REGION_NAME_LENGTH	../dbinc/region.h	105
-DB_REGION_PREFIX	../dbinc/region.h	102
-DB_REM_BIG	../dbinc/db_am.h	26
-DB_REM_DUP	../dbinc/db_am.h	24
-DB_RENAMEMAGIC	../dbinc/db.in	1103
-DB_RENUMBER	../dbinc/db.in	320
-DB_REP	../dbinc/db.in	146
-DB_REPVERSION	../dbinc/rep.h	268
-DB_REP_CLIENT	../dbinc/db.in	961
-DB_REP_CREATE	../dbinc/db.in	238
-DB_REP_DUPMASTER	../dbinc/db.in	1200
-DB_REP_EGENCHG	../dbinc/db.in	1219
-DB_REP_HANDLE_DEAD	../dbinc/db.in	1201
-DB_REP_HOLDELECTION	../dbinc/db.in	1202
-DB_REP_ISPERM	../dbinc/db.in	1203
-DB_REP_LOGREADY	../dbinc/db.in	1220
-DB_REP_MASTER	../dbinc/db.in	962
-DB_REP_MAX_GAP	../dbinc/rep.h	125
-DB_REP_NEWMASTER	../dbinc/db.in	1204
-DB_REP_NEWSITE	../dbinc/db.in	1205
-DB_REP_NOBUFFER	../dbinc/db.in	361
-DB_REP_NOTPERM	../dbinc/db.in	1206
-DB_REP_PAGEDONE	../dbinc/db.in	1221
-DB_REP_PERMANENT	../dbinc/db.in	362
-DB_REP_REQUEST_GAP	../dbinc/rep.h	124
-DB_REP_STARTUPDONE	../dbinc/db.in	1207
-DB_REP_STAT	../dbinc/db.in	147
-DB_REP_UNAVAIL	../dbinc/db.in	1208
+DB_REGENV_REPLOCKED	../dbinc/region.h	/^#define	DB_REGENV_REPLOCKED	0x0001	\/* Env locked /
+DB_REGENV_TIMEOUT	../dbinc/region.h	/^#define	DB_REGENV_TIMEOUT	30	\/* Backup timeout. */
+DB_REGION_ENV	../dbinc/region.h	/^#define	DB_REGION_ENV		"__db.001"	\/* Primary envi/
+DB_REGION_FMT	../dbinc/region.h	/^#define	DB_REGION_FMT		"__db.%03d"	\/* Region file/
+DB_REGION_INIT	../dbinc/db.in	/^#define	DB_REGION_INIT	      0x20000000\/* Page-fa/
+DB_REGION_MAGIC	../dbinc/db.in	/^#define	DB_REGION_MAGIC	0x120897	\/* Environment m/
+DB_REGION_NAME_LENGTH	../dbinc/region.h	/^#define	DB_REGION_NAME_LENGTH	8		\/* Length of fil/
+DB_REGION_PREFIX	../dbinc/region.h	/^#define	DB_REGION_PREFIX	"__db"		\/* DB file name /
+DB_REGISTER	../dbinc/db.in	/^#define	DB_REGISTER	      0x0800000	\/* Multi-proc/
+DB_REM_BIG	../dbinc/db_am.h	/^#define	DB_REM_BIG	4$/
+DB_REM_DUP	../dbinc/db_am.h	/^#define	DB_REM_DUP	2$/
+DB_REM_PAGE_COMPAT	../dbinc/db_am.h	/^#define	DB_REM_PAGE_COMPAT	6	\/* Compatibility for/
+DB_RENAMEMAGIC	../dbinc/db.in	/^#define	DB_RENAMEMAGIC	0x030800	\/* File has been /
+DB_RENUMBER	../dbinc/db.in	/^#define	DB_RENUMBER	      0x00100000 \/* Recno: re/
+DB_REP	../dbinc/db.in	/^struct __db_rep;	typedef struct __db_rep DB_REP;$/
+DB_REPMGR_ACK	../dbinc/repmgr.h	/^} DB_REPMGR_ACK;$/
+DB_REPMGR_ACKS_ALL	../dbinc/db.in	/^#define	DB_REPMGR_ACKS_ALL		1$/
+DB_REPMGR_ACKS_ALL_PEERS	../dbinc/db.in	/^#define	DB_REPMGR_ACKS_ALL_PEERS	2$/
+DB_REPMGR_ACKS_NONE	../dbinc/db.in	/^#define	DB_REPMGR_ACKS_NONE		3$/
+DB_REPMGR_ACKS_ONE	../dbinc/db.in	/^#define	DB_REPMGR_ACKS_ONE		4$/
+DB_REPMGR_ACKS_ONE_PEER	../dbinc/db.in	/^#define	DB_REPMGR_ACKS_ONE_PEER		5$/
+DB_REPMGR_ACKS_QUORUM	../dbinc/db.in	/^#define	DB_REPMGR_ACKS_QUORUM		6$/
+DB_REPMGR_CONNECTED	../dbinc/db.in	/^#define	DB_REPMGR_CONNECTED	0x01$/
+DB_REPMGR_DISCONNECTED	../dbinc/db.in	/^#define	DB_REPMGR_DISCONNECTED	0x02$/
+DB_REPMGR_HANDSHAKE	../dbinc/repmgr.h	/^} DB_REPMGR_HANDSHAKE;$/
+DB_REPMGR_PEER	../dbinc/db.in	/^#define	DB_REPMGR_PEER          0x01$/
+DB_REPMGR_SITE	../dbinc/db.in	/^			typedef struct __db_repmgr_site DB_REPMGR_SITE;/
+DB_REPMGR_VERSION	../dbinc/repmgr.h	/^#define	DB_REPMGR_VERSION	1$/
+DB_REPVERSION	../dbinc/rep.h	/^#define	DB_REPVERSION	3$/
+DB_REPVERSION_42	../dbinc/rep.h	/^#define	DB_REPVERSION_42	1$/
+DB_REPVERSION_43	../dbinc/rep.h	/^#define	DB_REPVERSION_43	2$/
+DB_REPVERSION_44	../dbinc/rep.h	/^#define	DB_REPVERSION_44	3$/
+DB_REPVERSION_45	../dbinc/rep.h	/^#define	DB_REPVERSION_45	3$/
+DB_REPVERSION_INVALID	../dbinc/rep.h	/^#define	DB_REPVERSION_INVALID	0$/
+DB_REP_ACK_TIMEOUT	../dbinc/db.in	/^#define	DB_REP_ACK_TIMEOUT	1$/
+DB_REP_ANYWHERE	../dbinc/db.in	/^#define	DB_REP_ANYWHERE	      0x0000001	\/* Messag/
+DB_REP_BULKOVF	../dbinc/db.in	/^#define	DB_REP_BULKOVF		(-30896)\/* Rep bulk buffe/
+DB_REP_CLIENT	../dbinc/db.in	/^#define	DB_REP_CLIENT			1$/
+DB_REP_CONF_BULK	../dbinc/db.in	/^#define	DB_REP_CONF_BULK	0x0001	\/* Bulk transfer./
+DB_REP_CONF_DELAYCLIENT	../dbinc/db.in	/^#define	DB_REP_CONF_DELAYCLIENT	0x0002	\/* Delay c/
+DB_REP_CONF_NOAUTOINIT	../dbinc/db.in	/^#define	DB_REP_CONF_NOAUTOINIT	0x0004	\/* No autom/
+DB_REP_CONF_NOWAIT	../dbinc/db.in	/^#define	DB_REP_CONF_NOWAIT	0x0008	\/* Don't wait, /
+DB_REP_CONNECTION_RETRY	../dbinc/db.in	/^#define	DB_REP_CONNECTION_RETRY 4$/
+DB_REP_DUPMASTER	../dbinc/db.in	/^#define	DB_REP_DUPMASTER	(-30986)\/* There are two/
+DB_REP_EGENCHG	../dbinc/db.in	/^#define	DB_REP_EGENCHG		(-30895)\/* Egen changed w/
+DB_REP_ELECTION	../dbinc/db.in	/^#define	DB_REP_ELECTION			2$/
+DB_REP_ELECTION_RETRY	../dbinc/db.in	/^#define	DB_REP_ELECTION_RETRY	3$/
+DB_REP_ELECTION_TIMEOUT	../dbinc/db.in	/^#define	DB_REP_ELECTION_TIMEOUT 2$/
+DB_REP_FULL_ELECTION	../dbinc/db.in	/^#define	DB_REP_FULL_ELECTION		3$/
+DB_REP_HANDLE_DEAD	../dbinc/db.in	/^#define	DB_REP_HANDLE_DEAD	(-30985)\/* Rolled back/
+DB_REP_HOLDELECTION	../dbinc/db.in	/^#define	DB_REP_HOLDELECTION	(-30984)\/* Time to ho/
+DB_REP_IGNORE	../dbinc/db.in	/^#define	DB_REP_IGNORE		(-30983)\/* This msg should/
+DB_REP_ISPERM	../dbinc/db.in	/^#define	DB_REP_ISPERM		(-30982)\/* Cached not writ/
+DB_REP_JOIN_FAILURE	../dbinc/db.in	/^#define	DB_REP_JOIN_FAILURE	(-30981)\/* Unable to /
+DB_REP_LOCKOUT	../dbinc/db.in	/^#define	DB_REP_LOCKOUT		(-30980)\/* API\/Replicati/
+DB_REP_LOGREADY	../dbinc/db.in	/^#define	DB_REP_LOGREADY		(-30894)\/* Rep log ready/
+DB_REP_MASTER	../dbinc/db.in	/^#define	DB_REP_MASTER			4$/
+DB_REP_MAX_GAP	../dbinc/rep.h	/^#define	DB_REP_MAX_GAP		128$/
+DB_REP_NEWMASTER	../dbinc/db.in	/^#define	DB_REP_NEWMASTER	(-30979)\/* We have learn/
+DB_REP_NEWSITE	../dbinc/db.in	/^#define	DB_REP_NEWSITE		(-30978)\/* New site enter/
+DB_REP_NOBUFFER	../dbinc/db.in	/^#define	DB_REP_NOBUFFER	      0x0000002	\/* Do not/
+DB_REP_NOTPERM	../dbinc/db.in	/^#define	DB_REP_NOTPERM		(-30977)\/* Permanent log /
+DB_REP_PAGEDONE	../dbinc/db.in	/^#define	DB_REP_PAGEDONE		(-30893)\/* This page was/
+DB_REP_PERMANENT	../dbinc/db.in	/^#define	DB_REP_PERMANENT      0x0000004	\/* Import/
+DB_REP_REQUEST_GAP	../dbinc/rep.h	/^#define	DB_REP_REQUEST_GAP	4$/
+DB_REP_REREQUEST	../dbinc/db.in	/^#define	DB_REP_REREQUEST      0x0000008	\/* This m/
+DB_REP_STAT	../dbinc/db.in	/^struct __db_rep_stat;	typedef struct __db_rep_stat/
+DB_REP_UNAVAIL	../dbinc/db.in	/^#define	DB_REP_UNAVAIL		(-30976)\/* Site cannot cu/
 DB_RETOK_DBCDEL	../dbinc/db_int.in	/^#define	DB_RETOK_DBCDEL(ret)	((ret) == 0 || (ret) /
 DB_RETOK_DBCGET	../dbinc/db_int.in	/^#define	DB_RETOK_DBCGET(ret)	((ret) == 0 || (ret) /
 DB_RETOK_DBCPUT	../dbinc/db_int.in	/^#define	DB_RETOK_DBCPUT(ret)	((ret) == 0 || (ret) /
@@ -564,915 +703,759 @@ DB_RETOK_LGGET	../dbinc/db_int.in	/^#define	DB_RETOK_LGGET(ret)	((ret) == 0 || (
 DB_RETOK_MPGET	../dbinc/db_int.in	/^#define	DB_RETOK_MPGET(ret)	((ret) == 0 || (ret) =/
 DB_RETOK_REPPMSG	../dbinc/db_int.in	/^#define	DB_RETOK_REPPMSG(ret)	((ret) == 0 || \\$/
 DB_RETOK_STD	../dbinc/db_int.in	/^#define	DB_RETOK_STD(ret)	((ret) == 0)$/
-DB_RETRY	../dbinc/os.h	18
-DB_REVSPLITOFF	../dbinc/db.in	321
-DB_RMW	../dbinc/db.in	1170
-DB_RPC2ND_CONCATDATAKEY	../dbinc/db_int.in	515
-DB_RPC2ND_CONCATKEYDATA	../dbinc/db_int.in	514
-DB_RPC2ND_CONSTANT	../dbinc/db_int.in	518
-DB_RPC2ND_GETNAME	../dbinc/db_int.in	520
-DB_RPC2ND_GETZIP	../dbinc/db_int.in	519
-DB_RPC2ND_MASK	../dbinc/db_int.in	510
-DB_RPC2ND_NOOP	../dbinc/db_int.in	513
-DB_RPC2ND_REVERSECONCAT	../dbinc/db_int.in	516
-DB_RPC2ND_REVERSEDATA	../dbinc/db_int.in	512
-DB_RPC2ND_TRUNCDATA	../dbinc/db_int.in	517
-DB_RPCCLIENT	../dbinc/db.in	233
-DB_RUNRECOVERY	../dbinc/db.in	1209
-DB_SALVAGE	../dbinc/db.in	350
-DB_SECONDARY_BAD	../dbinc/db.in	1210
-DB_SEQUENCE	../dbinc/db.in	148
-DB_SEQUENCE_STAT	../dbinc/db.in	150
-DB_SEQUENCE_VERSION	../dbinc/db.in	1117
-DB_SEQ_DEC	../dbinc/db.in	1033
-DB_SEQ_INC	../dbinc/db.in	1034
-DB_SEQ_RANGE_SET	../dbinc/db.in	1035
-DB_SEQ_RECORD	../dbinc/db.in	149
-DB_SEQ_WRAP	../dbinc/db.in	1036
-DB_SERVER_DBFLAGS	../dbinc/db_server_int.h	61
-DB_SERVER_DBNOSHARE	../dbinc/db_server_int.h	62
-DB_SERVER_ENVFLAGS	../dbinc/db_server_int.h	57
-DB_SERVER_FLAGMASK	../dbinc/db_server_int.h	28
-DB_SERVER_IDLETIMEOUT	../dbinc/db_server_int.h	15
-DB_SERVER_MAXTIMEOUT	../dbinc/db_server_int.h	14
-DB_SERVER_TIMEOUT	../dbinc/db_server_int.h	13
-DB_SET	../dbinc/db.in	1150
-DB_SET_BEGIN_LSNP	../dbinc/log.h	/^#define	DB_SET_BEGIN_LSNP(txn, rlsnp) do {				\\$/
+DB_RETRY	../dbinc/os.h	/^#define	DB_RETRY	100$/
+DB_REVSPLITOFF	../dbinc/db.in	/^#define	DB_REVSPLITOFF	      0x00200000 \/* Btree:/
+DB_RMW	../dbinc/db.in	/^#define	DB_RMW		0x40000000	\/* Acquire write lock /
+DB_RPC2ND_CONCATDATAKEY	../dbinc/db_int.in	/^#define	DB_RPC2ND_CONCATDATAKEY 0x00400000 \/* cal/
+DB_RPC2ND_CONCATKEYDATA	../dbinc/db_int.in	/^#define	DB_RPC2ND_CONCATKEYDATA	0x00300000 \/* cal/
+DB_RPC2ND_CONSTANT	../dbinc/db_int.in	/^#define	DB_RPC2ND_CONSTANT	0x00700000 \/* callback/
+DB_RPC2ND_GETNAME	../dbinc/db_int.in	/^#define	DB_RPC2ND_GETNAME	0x00900000 \/* sj_getnam/
+DB_RPC2ND_GETZIP	../dbinc/db_int.in	/^#define	DB_RPC2ND_GETZIP	0x00800000 \/* sj_getzip /
+DB_RPC2ND_MASK	../dbinc/db_int.in	/^#define	DB_RPC2ND_MASK		0x00f00000 \/* Reserved bi/
+DB_RPC2ND_NOOP	../dbinc/db_int.in	/^#define	DB_RPC2ND_NOOP		0x00200000 \/* callback_n(/
+DB_RPC2ND_REVERSECONCAT	../dbinc/db_int.in	/^#define	DB_RPC2ND_REVERSECONCAT	0x00500000 \/* cal/
+DB_RPC2ND_REVERSEDATA	../dbinc/db_int.in	/^#define	DB_RPC2ND_REVERSEDATA	0x00100000 \/* callb/
+DB_RPC2ND_TRUNCDATA	../dbinc/db_int.in	/^#define	DB_RPC2ND_TRUNCDATA	0x00600000 \/* callbac/
+DB_RPCCLIENT	../dbinc/db.in	/^#define	DB_RPCCLIENT	      0x0000002	\/* An RPC cl/
+DB_RUNRECOVERY	../dbinc/db.in	/^#define	DB_RUNRECOVERY		(-30975)\/* Panic return. /
+DB_SALVAGE	../dbinc/db.in	/^#define	DB_SALVAGE	      0x0000040	\/* Salvage wha/
+DB_SECONDARY_BAD	../dbinc/db.in	/^#define	DB_SECONDARY_BAD	(-30974)\/* Secondary ind/
+DB_SEQUENCE	../dbinc/db.in	/^struct __db_sequence;	typedef struct __db_sequence/
+DB_SEQUENCE_OLDVER	../dbinc/db.in	/^#define	DB_SEQUENCE_OLDVER  1		\/* Oldest sequence/
+DB_SEQUENCE_STAT	../dbinc/db.in	/^struct __db_seq_stat;	typedef struct __db_seq_stat/
+DB_SEQUENCE_VERSION	../dbinc/db.in	/^#define	DB_SEQUENCE_VERSION 2		\/* Current sequenc/
+DB_SEQ_DEC	../dbinc/db.in	/^#define	DB_SEQ_DEC		0x00000001	\/* Decrement seque/
+DB_SEQ_INC	../dbinc/db.in	/^#define	DB_SEQ_INC		0x00000002	\/* Increment seque/
+DB_SEQ_RANGE_SET	../dbinc/db.in	/^#define	DB_SEQ_RANGE_SET	0x00000004	\/* Range set /
+DB_SEQ_RECORD	../dbinc/db.in	/^struct __db_seq_record; typedef struct __db_seq_re/
+DB_SEQ_WRAP	../dbinc/db.in	/^#define	DB_SEQ_WRAP		0x00000008	\/* Wrap sequence /
+DB_SEQ_WRAPPED	../dbinc/db.in	/^#define	DB_SEQ_WRAPPED		0x00000010	\/* Just wrappe/
+DB_SERVER_DBFLAGS	../dbinc/db_server_int.h	/^#define	DB_SERVER_DBFLAGS	 (DB_NOMMAP | DB_RDONLY /
+DB_SERVER_DBNOSHARE	../dbinc/db_server_int.h	/^#define	DB_SERVER_DBNOSHARE	 (DB_EXCL | DB_TRUNCAT/
+DB_SERVER_ENVFLAGS	../dbinc/db_server_int.h	/^#define	DB_SERVER_ENVFLAGS	 (					\\$/
+DB_SERVER_FLAGMASK	../dbinc/db_server_int.h	/^#define	DB_SERVER_FLAGMASK	(					\\$/
+DB_SERVER_IDLETIMEOUT	../dbinc/db_server_int.h	/^#define	DB_SERVER_IDLETIMEOUT	86400	\/* 1 day *\/$/
+DB_SERVER_MAXTIMEOUT	../dbinc/db_server_int.h	/^#define	DB_SERVER_MAXTIMEOUT	1200	\/* 20 minutes */
+DB_SERVER_TIMEOUT	../dbinc/db_server_int.h	/^#define	DB_SERVER_TIMEOUT	300	\/* 5 minutes *\/$/
+DB_SET	../dbinc/db.in	/^#define	DB_SET			25	\/* c_get(), DB_LOGC->get() */
 DB_SET_CALLBACK	../cxx/cxx_db.cpp	/^#define	DB_SET_CALLBACK(_cxxname, _name, _cxxargsp/
-DB_SET_LOCK_TIMEOUT	../dbinc/db.in	1151
-DB_SET_RANGE	../dbinc/db.in	1152
-DB_SET_RECNO	../dbinc/db.in	1153
-DB_SET_TXN_NOW	../dbinc/db.in	1154
-DB_SET_TXN_TIMEOUT	../dbinc/db.in	1155
-DB_SNAPSHOT	../dbinc/db.in	322
-DB_STAT_ALL	../dbinc/db.in	327
-DB_STAT_CLEAR	../dbinc/db.in	328
-DB_STAT_LOCK_CONF	../dbinc/db.in	329
-DB_STAT_LOCK_FLAGS	../lock/lock_stat.c	150
-DB_STAT_LOCK_LOCKERS	../dbinc/db.in	330
-DB_STAT_LOCK_OBJECTS	../dbinc/db.in	331
-DB_STAT_LOCK_PARAMS	../dbinc/db.in	332
-DB_STAT_MEMP_FLAGS	../mp/mp_stat.c	288
-DB_STAT_MEMP_HASH	../dbinc/db.in	333
-DB_STAT_SUBSYSTEM	../dbinc/db.in	334
-DB_SURPRISE_KID	../dbinc/db.in	1222
-DB_SWAPBYTES	../dbinc/db.in	1224
-DB_SYSTEM_MEM	../dbinc/db.in	254
-DB_TEST_CHECKPOINT	../dbinc/debug.h	/^#define	DB_TEST_CHECKPOINT(env, val)					\\$/
-DB_TEST_ELECTINIT	../dbinc/db.in	2035
-DB_TEST_ELECTVOTE1	../dbinc/db.in	2036
-DB_TEST_POSTDESTROY	../dbinc/db.in	2037
-DB_TEST_POSTLOG	../dbinc/db.in	2038
-DB_TEST_POSTLOGMETA	../dbinc/db.in	2039
-DB_TEST_POSTOPEN	../dbinc/db.in	2040
-DB_TEST_POSTSYNC	../dbinc/db.in	2041
-DB_TEST_PREDESTROY	../dbinc/db.in	2042
-DB_TEST_PREOPEN	../dbinc/db.in	2043
+DB_SET_DBT	../dbinc/db_int.in	/^#define	DB_SET_DBT(dbt, d, s)  do {					\\$/
+DB_SET_LOCK_TIMEOUT	../dbinc/db.in	/^#define	DB_SET_LOCK_TIMEOUT	26	\/* set_timout() */
+DB_SET_RANGE	../dbinc/db.in	/^#define	DB_SET_RANGE		27	\/* c_get() *\/$/
+DB_SET_RECNO	../dbinc/db.in	/^#define	DB_SET_RECNO		28	\/* get(), c_get() *\/$/
+DB_SET_TXN_LSNP	../dbinc/log.h	/^#define	DB_SET_TXN_LSNP(txn, blsnp, llsnp) do {			/
+DB_SET_TXN_NOW	../dbinc/db.in	/^#define	DB_SET_TXN_NOW		29	\/* set_timout() (inter/
+DB_SET_TXN_TIMEOUT	../dbinc/db.in	/^#define	DB_SET_TXN_TIMEOUT	30	\/* set_timout() *\//
+DB_SNAPSHOT	../dbinc/db.in	/^#define	DB_SNAPSHOT	      0x00400000 \/* Recno: sn/
+DB_STAT_ALL	../dbinc/db.in	/^#define	DB_STAT_ALL	      0x0000002	\/* Print: Eve/
+DB_STAT_CLEAR	../dbinc/db.in	/^#define	DB_STAT_CLEAR	      0x0000004	\/* Clear st/
+DB_STAT_LOCK_CONF	../dbinc/db.in	/^#define	DB_STAT_LOCK_CONF     0x0000008	\/* Print:/
+DB_STAT_LOCK_FLAGS	../lock/lock_stat.c	/^#define	DB_STAT_LOCK_FLAGS						\\$/
+DB_STAT_LOCK_LOCKERS	../dbinc/db.in	/^#define	DB_STAT_LOCK_LOCKERS  0x0000010	\/* Print:/
+DB_STAT_LOCK_OBJECTS	../dbinc/db.in	/^#define	DB_STAT_LOCK_OBJECTS  0x0000020	\/* Print:/
+DB_STAT_LOCK_PARAMS	../dbinc/db.in	/^#define	DB_STAT_LOCK_PARAMS   0x0000040	\/* Print:/
+DB_STAT_MEMP_FLAGS	../mp/mp_stat.c	/^#define	DB_STAT_MEMP_FLAGS						\\$/
+DB_STAT_MEMP_HASH	../dbinc/db.in	/^#define	DB_STAT_MEMP_HASH     0x0000080	\/* Print:/
+DB_STAT_NOERROR	../dbinc/db.in	/^#define	DB_STAT_NOERROR       0x0000100 \/* Intern/
+DB_STAT_SUBSYSTEM	../dbinc/db.in	/^#define	DB_STAT_SUBSYSTEM     0x0000200 \/* Print:/
+DB_SURPRISE_KID	../dbinc/db.in	/^#define	DB_SURPRISE_KID		(-30892)\/* Child commit /
+DB_SWAPBYTES	../dbinc/db.in	/^#define	DB_SWAPBYTES		(-30891)\/* Database needs b/
+DB_SYSTEM_MEM	../dbinc/db.in	/^#define	DB_SYSTEM_MEM	      0x1000000	\/* Use syst/
+DB_TEST_ELECTINIT	../dbinc/db.in	/^#define	DB_TEST_ELECTINIT	 1	\/* after __rep_elect/
+DB_TEST_ELECTVOTE1	../dbinc/db.in	/^#define	DB_TEST_ELECTVOTE1	 2	\/* after sending VO/
+DB_TEST_POSTDESTROY	../dbinc/db.in	/^#define	DB_TEST_POSTDESTROY	 3	\/* after destroy o/
+DB_TEST_POSTLOG	../dbinc/db.in	/^#define	DB_TEST_POSTLOG		 4	\/* after logging all /
+DB_TEST_POSTLOGMETA	../dbinc/db.in	/^#define	DB_TEST_POSTLOGMETA	 5	\/* after logging m/
+DB_TEST_POSTOPEN	../dbinc/db.in	/^#define	DB_TEST_POSTOPEN	 6	\/* after __os_open */
+DB_TEST_POSTSYNC	../dbinc/db.in	/^#define	DB_TEST_POSTSYNC	 7	\/* after syncing the /
+DB_TEST_PREDESTROY	../dbinc/db.in	/^#define	DB_TEST_PREDESTROY	 8	\/* before destroy o/
+DB_TEST_PREOPEN	../dbinc/db.in	/^#define	DB_TEST_PREOPEN		 9	\/* before __os_open */
 DB_TEST_RECOVERY	../dbinc/debug.h	/^#define	DB_TEST_RECOVERY(dbp, val, ret, name) do {/
-DB_TEST_RECOVERY_LABEL	../dbinc/debug.h	248
-DB_TEST_SUBDB_LOCKS	../dbinc/db.in	2044
+DB_TEST_RECOVERY_LABEL	../dbinc/debug.h	/^#define	DB_TEST_RECOVERY_LABEL	db_tr_err:$/
+DB_TEST_RECYCLE	../dbinc/db.in	/^#define	DB_TEST_RECYCLE		 10	\/* test rep and txn_/
+DB_TEST_SUBDB_LOCKS	../dbinc/db.in	/^#define	DB_TEST_SUBDB_LOCKS	 11	\/* subdb locking /
 DB_TEST_SUBLOCKS	../dbinc/debug.h	/^#define	DB_TEST_SUBLOCKS(env, flags) do {				\\$/
-DB_THREAD	../dbinc/db.in	196
-DB_TIMEOUT	../dbinc/db.in	1225
-DB_TIME_NOTGRANTED	../dbinc/db.in	289
-DB_TRAIL	../env/env_open.c	920
-DB_TRUNCATE	../dbinc/db.in	197
-DB_TXN	../dbinc/db.in	151
-DB_TXNHEAD	../dbinc/db_int.in	527
-DB_TXNLIST	../dbinc/db_int.in	528
+DB_TEST_WAIT	../dbinc/debug.h	/^#define	DB_TEST_WAIT(env, val)					\\$/
+DB_THREAD	../dbinc/db.in	/^#define	DB_THREAD	      0x0000080	\/* Applications/
+DB_THREADID_STRLEN	../dbinc/db.in	/^#define	DB_THREADID_STRLEN	128$/
+DB_THREAD_INFO	../dbinc/db_int.in	/^} DB_THREAD_INFO;$/
+DB_THREAD_STATE	../dbinc/db_int.in	/^} DB_THREAD_STATE;$/
+DB_TIMEOUT	../dbinc/db.in	/^#define	DB_TIMEOUT		(-30890)\/* Timed out waiting /
+DB_TIME_NOTGRANTED	../dbinc/db.in	/^#define	DB_TIME_NOTGRANTED    0x40000000\/* Return/
+DB_TRAIL	../env/env_open.c	/^#define	DB_TRAIL	"BDBXXXXX"$/
+DB_TRUNCATE	../dbinc/db.in	/^#define	DB_TRUNCATE	      0x0000100	\/* Discard ex/
+DB_TXN	../dbinc/db.in	/^struct __db_txn;	typedef struct __db_txn DB_TXN;$/
+DB_TXNHEAD	../dbinc/db_int.in	/^struct __db_txnhead;	typedef struct __db_txnhead D/
+DB_TXNLIST	../dbinc/db_int.in	/^struct __db_txnlist;	typedef struct __db_txnlist D/
 DB_TXNLIST_MASK	../dbinc/db_dispatch.h	/^#define	DB_TXNLIST_MASK(hp, n)  (n % hp->nslots)$/
-DB_TXNLIST_MAX_PGNO	../db/db_dispatch.c	1469
-DB_TXNLOGREC	../dbinc/txn.h	24
-DB_TXNMGR	../dbinc/db.in	154
-DB_TXNREGION	../dbinc/txn.h	23
-DB_TXNVERSION	../dbinc/db.in	795
-DB_TXN_ACTIVE	../dbinc/db.in	152
-DB_TXN_CKP	../dbinc/db.in	1226
-DB_TXN_NOSYNC	../dbinc/db.in	198
-DB_TXN_NOT_DURABLE	../dbinc/db.in	199
-DB_TXN_NOWAIT	../dbinc/db.in	267
-DB_TXN_STAT	../dbinc/db.in	153
-DB_TXN_SYNC	../dbinc/db.in	268
-DB_TXN_WRITE_NOSYNC	../dbinc/db.in	294
+DB_TXNLIST_MAX_PGNO	../db/db_dispatch.c	/^#define	DB_TXNLIST_MAX_PGNO	8		\/* A nice even num/
+DB_TXNLOGREC	../dbinc/txn.h	/^struct __txn_logrec;	typedef struct __txn_logrec D/
+DB_TXNMGR	../dbinc/db.in	/^struct __db_txnmgr;	typedef struct __db_txnmgr DB_/
+DB_TXNREGION	../dbinc/txn.h	/^struct __db_txnregion;	typedef struct __db_txnregi/
+DB_TXNVERSION	../dbinc/db.in	/^#define	DB_TXNVERSION	1$/
+DB_TXN_ACTIVE	../dbinc/db.in	/^struct __db_txn_active;	typedef struct __db_txn_ac/
+DB_TXN_CKP	../dbinc/db.in	/^#define	DB_TXN_CKP		(-30889)\/* Encountered ckp re/
+DB_TXN_NOSYNC	../dbinc/db.in	/^#define	DB_TXN_NOSYNC	      0x0000200	\/* Do not s/
+DB_TXN_NOT_DURABLE	../dbinc/db.in	/^#define	DB_TXN_NOT_DURABLE    0x0000400	\/* Do not/
+DB_TXN_NOWAIT	../dbinc/db.in	/^#define	DB_TXN_NOWAIT	      0x0004000	\/* Do not w/
+DB_TXN_SNAPSHOT	../dbinc/db.in	/^#define	DB_TXN_SNAPSHOT	      0x10000000\/* Snapsh/
+DB_TXN_STAT	../dbinc/db.in	/^struct __db_txn_stat;	typedef struct __db_txn_stat/
+DB_TXN_SYNC	../dbinc/db.in	/^#define	DB_TXN_SYNC	      0x0008000	\/* Always syn/
+DB_TXN_WRITE_NOSYNC	../dbinc/db.in	/^#define	DB_TXN_WRITE_NOSYNC   0x0000800	\/* Write /
 DB_UNDO	../dbinc/db.in	/^#define	DB_UNDO(op)	((op) == DB_TXN_ABORT ||			\\$/
-DB_UNREF	../dbinc/db.in	351
-DB_UPDATE_SECONDARY	../dbinc/db.in	1156
-DB_UPGRADE	../dbinc/db.in	300
-DB_USE_ENVIRON	../dbinc/db.in	200
-DB_USE_ENVIRON_ROOT	../dbinc/db.in	201
-DB_VERB_DEADLOCK	../dbinc/db.in	1764
-DB_VERB_RECOVERY	../dbinc/db.in	1765
-DB_VERB_REPLICATION	../dbinc/db.in	1766
-DB_VERB_WAITSFOR	../dbinc/db.in	1767
-DB_VERIFY	../dbinc/db.in	301
-DB_VERIFY_BAD	../dbinc/db.in	1211
-DB_VERIFY_FATAL	../dbinc/db.in	1227
-DB_VERSION_MAJOR	../dbinc/db.in	43
-DB_VERSION_MINOR	../dbinc/db.in	44
-DB_VERSION_MISMATCH	../dbinc/db.in	1212
-DB_VERSION_PATCH	../dbinc/db.in	45
-DB_VERSION_STRING	../dbinc/db.in	46
-DB_WRITECURSOR	../dbinc/db.in	1157
-DB_WRITELOCK	../dbinc/db.in	1158
-DB_WRITEOPEN	../dbinc/db.in	262
-DB_XA_CREATE	../dbinc/db.in	239
-DB_XIDDATASIZE	../dbinc/db.in	920
-DB_YIELDCPU	../dbinc/db.in	295
-DB_debug_FLAG	../dbinc/db.in	559
-DB_user_BEGIN	../dbinc/db.in	558
+DB_UNREF	../dbinc/db.in	/^#define	DB_UNREF	      0x0000080	\/* Report unrefe/
+DB_UPDATE_SECONDARY	../dbinc/db.in	/^#define	DB_UPDATE_SECONDARY	31	\/* c_get(), c_del(/
+DB_UPGRADE	../dbinc/db.in	/^#define	DB_UPGRADE	      0x0000001	\/* Upgrading. /
+DB_USERCOPY_GETDATA	../dbinc/db.in	/^#define	DB_USERCOPY_GETDATA	0x0001$/
+DB_USERCOPY_SETDATA	../dbinc/db.in	/^#define	DB_USERCOPY_SETDATA	0x0002$/
+DB_USE_ENVIRON	../dbinc/db.in	/^#define	DB_USE_ENVIRON	      0x0001000	\/* Use the/
+DB_USE_ENVIRON_ROOT	../dbinc/db.in	/^#define	DB_USE_ENVIRON_ROOT   0x0002000	\/* Use th/
+DB_VERB_DEADLOCK	../dbinc/db.in	/^#define	DB_VERB_DEADLOCK	0x0001	\/* Deadlock detec/
+DB_VERB_RECOVERY	../dbinc/db.in	/^#define	DB_VERB_RECOVERY	0x0002	\/* Recovery infor/
+DB_VERB_REGISTER	../dbinc/db.in	/^#define	DB_VERB_REGISTER	0x0004	\/* Dump waits-for/
+DB_VERB_REPLICATION	../dbinc/db.in	/^#define	DB_VERB_REPLICATION	0x0008	\/* Replication/
+DB_VERB_WAITSFOR	../dbinc/db.in	/^#define	DB_VERB_WAITSFOR	0x0010	\/* Dump waits-for/
+DB_VERIFY	../dbinc/db.in	/^#define	DB_VERIFY	      0x0000002	\/* Verifying. */
+DB_VERIFY_BAD	../dbinc/db.in	/^#define	DB_VERIFY_BAD		(-30973)\/* Verify failed; /
+DB_VERIFY_FATAL	../dbinc/db.in	/^#define	DB_VERIFY_FATAL		(-30888)\/* DB->verify ca/
+DB_VERSION_MAJOR	../dbinc/db.in	/^#define	DB_VERSION_MAJOR	@DB_VERSION_MAJOR@$/
+DB_VERSION_MINOR	../dbinc/db.in	/^#define	DB_VERSION_MINOR	@DB_VERSION_MINOR@$/
+DB_VERSION_MISMATCH	../dbinc/db.in	/^#define	DB_VERSION_MISMATCH	(-30972)\/* Environmen/
+DB_VERSION_PATCH	../dbinc/db.in	/^#define	DB_VERSION_PATCH	@DB_VERSION_PATCH@$/
+DB_VERSION_STRING	../dbinc/db.in	/^#define	DB_VERSION_STRING	@DB_VERSION_STRING@$/
+DB_WRITECURSOR	../dbinc/db.in	/^#define	DB_WRITECURSOR		32	\/* cursor() *\/$/
+DB_WRITELOCK	../dbinc/db.in	/^#define	DB_WRITELOCK		33	\/* cursor() (internal) */
+DB_WRITEOPEN	../dbinc/db.in	/^#define	DB_WRITEOPEN	      0x0040000	\/* UNDOC: op/
+DB_XA_CREATE	../dbinc/db.in	/^#define	DB_XA_CREATE	      0x0000002	\/* Open in a/
+DB_XIDDATASIZE	../dbinc/db.in	/^#define	DB_XIDDATASIZE	128$/
+DB_YIELDCPU	../dbinc/db.in	/^#define	DB_YIELDCPU	      0x80000000\/* Yield the /
+DB_debug_FLAG	../dbinc/db.in	/^#define	DB_debug_FLAG		0x80000000$/
+DB_user_BEGIN	../dbinc/db.in	/^#define	DB_user_BEGIN		10000$/
 DCHARHASH	../hash/hash_func.c	/^#define	DCHARHASH(h, c)	((h) = 0x63c63cd9*(h) + 0x/
-DD_INVALID_ID	../lock/lock_deadlock.c	370
+DD_INVALID_ID	../lock/lock_deadlock.c	/^#define	DD_INVALID_ID	((u_int32_t) -1)$/
 DEBUG_LREAD	../dbinc/debug.h	/^#define	DEBUG_LREAD(C, T, O, K, A, F)	LOG_OP(C, T,/
 DEBUG_LWRITE	../dbinc/debug.h	/^#define	DEBUG_LWRITE(C, T, O, K, A, F)	LOG_OP(C, T/
-DEFMINKEYPAGE	../dbinc/btree.h	53
-DEF_MAX_TXNS	../dbinc/txn.h	34
-DELOVFL	../dbinc/hash.h	129
-DELPAIR	../dbinc/hash.h	127
-DIR_DECRYPT	../crypto/rijndael/rijndael-api-fst.h	48
-DIR_ENCRYPT	../crypto/rijndael/rijndael-api-fst.h	47
+DEFMINKEYPAGE	../dbinc/btree.h	/^#define	DEFMINKEYPAGE	 (2)$/
+DEF_MAX_TXNS	../dbinc/txn.h	/^#define	DEF_MAX_TXNS	100		\/* Default max transact/
+DELOVFL	../dbinc/hash.h	/^#define	DELOVFL		0x50$/
+DELPAIR	../dbinc/hash.h	/^#define	DELPAIR		0x30$/
+DIR_DECRYPT	../crypto/rijndael/rijndael-api-fst.h	/^#define     DIR_DECRYPT           1 \/*  Are we de/
+DIR_ENCRYPT	../crypto/rijndael/rijndael-api-fst.h	/^#define     DIR_ENCRYPT           0 \/*  Are we en/
 DISCARD_CUR	../btree/bt_cursor.c	/^#define	DISCARD_CUR(dbc, ret) do {					\\$/
+DONT_NEED_LOCKS	../qam/qam.c	/^#define	DONT_NEED_LOCKS(dbc) ((dbc)->txn == NULL |/
 DO_PREPLIST	../tcl/tcl_txn.c	/^#define	DO_PREPLIST(count)						\\$/
-DO_TRADE	../txn/txn_util.c	218
+DO_TRADE	../txn/txn_util.c	/^#define	DO_TRADE do {							\\$/
 DUP_SIZE	../dbinc/hash.h	/^#define	DUP_SIZE(len)	((len) + 2 * sizeof(db_indx_/
-Db	../libdb_java/db_java_wrap.c	1737
-Db::Db	../cxx/cxx_db.cpp	/^Db::Db(DbEnv *env, u_int32_t flags)$/
-Db::cleanup	../cxx/cxx_db.cpp	/^void Db::cleanup()$/
-Db::error_policy	../cxx/cxx_db.cpp	/^int Db::error_policy()$/
-Db::errx	../cxx/cxx_db.cpp	/^void Db::errx(const char *format, ...)$/
-Db::get_app_private	../cxx/cxx_db.cpp	/^void *Db::get_app_private() const$/
-Db::get_byteswapped	../cxx/cxx_db.cpp	/^int Db::get_byteswapped(int *isswapped)$/
-Db::get_env	../cxx/cxx_db.cpp	/^DbEnv *Db::get_env()$/
-Db::get_mpf	../cxx/cxx_db.cpp	/^DbMpoolFile *Db::get_mpf()$/
-Db::initialize	../cxx/cxx_db.cpp	/^int Db::initialize()$/
-Db::pget	../cxx/cxx_db.cpp	/^int Db::pget(DbTxn *txnid, Dbt *key, Dbt *pkey, Db/
-Db::set_app_private	../cxx/cxx_db.cpp	/^void Db::set_app_private(void *value)$/
-Db::set_error_stream	../cxx/cxx_db.cpp	/^void Db::set_error_stream(__DB_STD(ostream) *error/
-Db::set_message_stream	../cxx/cxx_db.cpp	/^void Db::set_message_stream(__DB_STD(ostream) *mes/
-Db::set_msgcall	../cxx/cxx_db.cpp	/^void Db::set_msgcall(void (*arg)(const DbEnv *, co/
-Db::verify	../cxx/cxx_db.cpp	/^int Db::verify(const char *name, const char *subdb/
-Db::~Db	../cxx/cxx_db.cpp	/^Db::~Db()$/
-DbDeadlockException::DbDeadlockException	../cxx/cxx_except.cpp	/^DbDeadlockException::DbDeadlockException(const cha/
-DbDeadlockException::operator =	../cxx/cxx_except.cpp	/^&DbDeadlockException::operator =(const DbDeadlockE/
-DbDeadlockException::~DbDeadlockException	../cxx/cxx_except.cpp	/^DbDeadlockException::~DbDeadlockException() throw(/
-DbEnv	../libdb_java/db_java_wrap.c	1740
-DbEnv::DbEnv	../cxx/cxx_env.cpp	/^DbEnv::DbEnv(u_int32_t flags)$/
-DbEnv::_app_dispatch_intercept	../cxx/cxx_env.cpp	/^int DbEnv::_app_dispatch_intercept(DB_ENV *env, DB/
-DbEnv::_feedback_intercept	../cxx/cxx_env.cpp	/^void DbEnv::_feedback_intercept(DB_ENV *env, int o/
-DbEnv::_paniccall_intercept	../cxx/cxx_env.cpp	/^void DbEnv::_paniccall_intercept(DB_ENV *env, int /
-DbEnv::_rep_send_intercept	../cxx/cxx_env.cpp	/^int DbEnv::_rep_send_intercept(DB_ENV *env, const /
-DbEnv::_stream_error_function	../cxx/cxx_env.cpp	/^void DbEnv::_stream_error_function($/
-DbEnv::_stream_message_function	../cxx/cxx_env.cpp	/^void DbEnv::_stream_message_function(const DB_ENV /
-DbEnv::cleanup	../cxx/cxx_env.cpp	/^void DbEnv::cleanup()$/
-DbEnv::close	../cxx/cxx_env.cpp	/^int DbEnv::close(u_int32_t flags)$/
-DbEnv::error_policy	../cxx/cxx_env.cpp	/^int DbEnv::error_policy()$/
-DbEnv::errx	../cxx/cxx_env.cpp	/^void DbEnv::errx(const char *format, ...)$/
-DbEnv::get_app_private	../cxx/cxx_env.cpp	/^void *DbEnv::get_app_private() const$/
-DbEnv::remove	../cxx/cxx_env.cpp	/^int DbEnv::remove(const char *db_home, u_int32_t f/
-DbEnv::runtime_error	../cxx/cxx_env.cpp	/^void DbEnv::runtime_error(DbEnv *env,$/
-DbEnv::runtime_error_dbt	../cxx/cxx_env.cpp	/^void DbEnv::runtime_error_dbt(DbEnv *env,$/
-DbEnv::runtime_error_lock_get	../cxx/cxx_env.cpp	/^void DbEnv::runtime_error_lock_get(DbEnv *env,$/
-DbEnv::set_error_stream	../cxx/cxx_env.cpp	/^void DbEnv::set_error_stream(__DB_STD(ostream) *st/
-DbEnv::set_feedback	../cxx/cxx_env.cpp	/^int DbEnv::set_feedback(void (*arg)(DbEnv *, int, /
-DbEnv::set_message_stream	../cxx/cxx_env.cpp	/^void DbEnv::set_message_stream(__DB_STD(ostream) */
-DbEnv::set_paniccall	../cxx/cxx_env.cpp	/^int DbEnv::set_paniccall(void (*arg)(DbEnv *, int)/
-DbEnv::strerror	../cxx/cxx_env.cpp	/^char *DbEnv::strerror(int error)$/
-DbEnv::wrap_DB_ENV	../cxx/cxx_env.cpp	/^DbEnv *DbEnv::wrap_DB_ENV(DB_ENV *dbenv)$/
-DbEnv::~DbEnv	../cxx/cxx_env.cpp	/^DbEnv::~DbEnv()$/
-DbEnv_close	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_close(struct DbEnv *self,u_int32_t /
-DbEnv_dbremove	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_dbremove(struct DbEnv *self,DB_TXN /
-DbEnv_dbrename	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_dbrename(struct DbEnv *self,DB_TXN /
-DbEnv_err	../libdb_java/db_java_wrap.c	/^void DbEnv_err(struct DbEnv *self,int error,char c/
-DbEnv_errx	../libdb_java/db_java_wrap.c	/^void DbEnv_errx(struct DbEnv *self,char const *mes/
-DbEnv_get_cachesize	../libdb_java/db_java_wrap.c	/^jlong DbEnv_get_cachesize(struct DbEnv *self){$/
-DbEnv_get_cachesize_ncache	../libdb_java/db_java_wrap.c	/^int DbEnv_get_cachesize_ncache(struct DbEnv *self)/
-DbEnv_get_data_dirs	../libdb_java/db_java_wrap.c	/^char const **DbEnv_get_data_dirs(struct DbEnv *sel/
-DbEnv_get_encrypt_flags	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_encrypt_flags(struct DbEnv *se/
-DbEnv_get_errpfx	../libdb_java/db_java_wrap.c	/^char const *DbEnv_get_errpfx(struct DbEnv *self){$/
-DbEnv_get_flags	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_flags(struct DbEnv *self){$/
-DbEnv_get_home	../libdb_java/db_java_wrap.c	/^char const *DbEnv_get_home(struct DbEnv *self){$/
-DbEnv_get_lg_bsize	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_lg_bsize(struct DbEnv *self){$/
-DbEnv_get_lg_dir	../libdb_java/db_java_wrap.c	/^char const *DbEnv_get_lg_dir(struct DbEnv *self){$/
-DbEnv_get_lg_max	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_lg_max(struct DbEnv *self){$/
-DbEnv_get_lg_regionmax	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_lg_regionmax(struct DbEnv *sel/
-DbEnv_get_lk_conflicts	../libdb_java/db_java_wrap.c	/^struct __db_lk_conflicts DbEnv_get_lk_conflicts(st/
-DbEnv_get_lk_detect	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_lk_detect(struct DbEnv *self){/
-DbEnv_get_lk_max_lockers	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_lk_max_lockers(struct DbEnv *s/
-DbEnv_get_lk_max_locks	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_lk_max_locks(struct DbEnv *sel/
-DbEnv_get_lk_max_objects	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_lk_max_objects(struct DbEnv *s/
-DbEnv_get_mp_mmapsize	../libdb_java/db_java_wrap.c	/^size_t DbEnv_get_mp_mmapsize(struct DbEnv *self){$/
-DbEnv_get_open_flags	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_open_flags(struct DbEnv *self)/
-DbEnv_get_rep_limit	../libdb_java/db_java_wrap.c	/^jlong DbEnv_get_rep_limit(struct DbEnv *self){$/
-DbEnv_get_shm_key	../libdb_java/db_java_wrap.c	/^long DbEnv_get_shm_key(struct DbEnv *self){$/
-DbEnv_get_tas_spins	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_tas_spins(struct DbEnv *self){/
-DbEnv_get_timeout	../libdb_java/db_java_wrap.c	/^db_timeout_t DbEnv_get_timeout(struct DbEnv *self,/
-DbEnv_get_tmp_dir	../libdb_java/db_java_wrap.c	/^char const *DbEnv_get_tmp_dir(struct DbEnv *self){/
-DbEnv_get_tx_max	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_get_tx_max(struct DbEnv *self){$/
-DbEnv_get_tx_timestamp	../libdb_java/db_java_wrap.c	/^time_t DbEnv_get_tx_timestamp(struct DbEnv *self){/
-DbEnv_get_verbose	../libdb_java/db_java_wrap.c	/^int_bool DbEnv_get_verbose(struct DbEnv *self,u_in/
-DbEnv_get_version_major	../libdb_java/db_java_wrap.c	/^int DbEnv_get_version_major(){$/
-DbEnv_get_version_minor	../libdb_java/db_java_wrap.c	/^int DbEnv_get_version_minor(){$/
-DbEnv_get_version_patch	../libdb_java/db_java_wrap.c	/^int DbEnv_get_version_patch(){$/
-DbEnv_get_version_string	../libdb_java/db_java_wrap.c	/^char const *DbEnv_get_version_string(){$/
-DbEnv_lock_detect	../libdb_java/db_java_wrap.c	/^int DbEnv_lock_detect(struct DbEnv *self,u_int32_t/
-DbEnv_lock_get	../libdb_java/db_java_wrap.c	/^DB_LOCK *DbEnv_lock_get(struct DbEnv *self,u_int32/
-DbEnv_lock_id	../libdb_java/db_java_wrap.c	/^u_int32_t DbEnv_lock_id(struct DbEnv *self){$/
-DbEnv_lock_id_free	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_lock_id_free(struct DbEnv *self,u_i/
-DbEnv_lock_put	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_lock_put(struct DbEnv *self,DB_LOCK/
-DbEnv_lock_stat	../libdb_java/db_java_wrap.c	/^DB_LOCK_STAT *DbEnv_lock_stat(struct DbEnv *self,u/
-DbEnv_log_archive	../libdb_java/db_java_wrap.c	/^char **DbEnv_log_archive(struct DbEnv *self,u_int3/
-DbEnv_log_compare	../libdb_java/db_java_wrap.c	/^int DbEnv_log_compare(DB_LSN const *lsn0,DB_LSN co/
-DbEnv_log_cursor	../libdb_java/db_java_wrap.c	/^DB_LOGC *DbEnv_log_cursor(struct DbEnv *self,u_int/
-DbEnv_log_file	../libdb_java/db_java_wrap.c	/^char *DbEnv_log_file(struct DbEnv *self,DB_LSN *ls/
-DbEnv_log_flush	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_log_flush(struct DbEnv *self,DB_LSN/
-DbEnv_log_put	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_log_put(struct DbEnv *self,DB_LSN */
-DbEnv_log_stat	../libdb_java/db_java_wrap.c	/^DB_LOG_STAT *DbEnv_log_stat(struct DbEnv *self,u_i/
-DbEnv_memp_fstat	../libdb_java/db_java_wrap.c	/^DB_MPOOL_FSTAT **DbEnv_memp_fstat(struct DbEnv *se/
-DbEnv_memp_stat	../libdb_java/db_java_wrap.c	/^DB_MPOOL_STAT *DbEnv_memp_stat(struct DbEnv *self,/
-DbEnv_memp_trickle	../libdb_java/db_java_wrap.c	/^int DbEnv_memp_trickle(struct DbEnv *self,int perc/
-DbEnv_open	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_open(struct DbEnv *self,char const /
-DbEnv_remove	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_remove(struct DbEnv *self,char cons/
-DbEnv_rep_elect	../libdb_java/db_java_wrap.c	/^int DbEnv_rep_elect(struct DbEnv *self,int nsites,/
-DbEnv_rep_process_message	../libdb_java/db_java_wrap.c	/^int DbEnv_rep_process_message(struct DbEnv *self,D/
-DbEnv_rep_start	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_rep_start(struct DbEnv *self,DBT *c/
-DbEnv_rep_stat	../libdb_java/db_java_wrap.c	/^DB_REP_STAT *DbEnv_rep_stat(struct DbEnv *self,u_i/
-DbEnv_set_app_dispatch	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_app_dispatch(struct DbEnv *self/
-DbEnv_set_cachesize	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_cachesize(struct DbEnv *self,jl/
-DbEnv_set_data_dir	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_data_dir(struct DbEnv *self,cha/
-DbEnv_set_encrypt	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_encrypt(struct DbEnv *self,char/
-DbEnv_set_errcall	../libdb_java/db_java_wrap.c	/^void DbEnv_set_errcall(struct DbEnv *self,void (*d/
-DbEnv_set_errpfx	../libdb_java/db_java_wrap.c	/^void DbEnv_set_errpfx(struct DbEnv *self,char cons/
-DbEnv_set_feedback	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_feedback(struct DbEnv *self,voi/
-DbEnv_set_flags	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_flags(struct DbEnv *self,u_int3/
-DbEnv_set_lg_bsize	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_lg_bsize(struct DbEnv *self,u_i/
-DbEnv_set_lg_dir	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_lg_dir(struct DbEnv *self,char /
-DbEnv_set_lg_max	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_lg_max(struct DbEnv *self,u_int/
-DbEnv_set_lg_regionmax	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_lg_regionmax(struct DbEnv *self/
-DbEnv_set_lk_conflicts	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_lk_conflicts(struct DbEnv *self/
-DbEnv_set_lk_detect	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_lk_detect(struct DbEnv *self,u_/
-DbEnv_set_lk_max_lockers	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_lk_max_lockers(struct DbEnv *se/
-DbEnv_set_lk_max_locks	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_lk_max_locks(struct DbEnv *self/
-DbEnv_set_lk_max_objects	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_lk_max_objects(struct DbEnv *se/
-DbEnv_set_mp_mmapsize	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_mp_mmapsize(struct DbEnv *self,/
-DbEnv_set_msgcall	../libdb_java/db_java_wrap.c	/^void DbEnv_set_msgcall(struct DbEnv *self,void (*d/
-DbEnv_set_paniccall	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_paniccall(struct DbEnv *self,vo/
-DbEnv_set_rep_limit	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_rep_limit(struct DbEnv *self,jl/
-DbEnv_set_rep_transport	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_rep_transport(struct DbEnv *sel/
-DbEnv_set_rpc_server	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_rpc_server(struct DbEnv *self,v/
-DbEnv_set_shm_key	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_shm_key(struct DbEnv *self,long/
-DbEnv_set_tas_spins	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_tas_spins(struct DbEnv *self,u_/
-DbEnv_set_timeout	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_timeout(struct DbEnv *self,db_t/
-DbEnv_set_tmp_dir	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_tmp_dir(struct DbEnv *self,char/
-DbEnv_set_tx_max	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_tx_max(struct DbEnv *self,u_int/
-DbEnv_set_tx_timestamp	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_tx_timestamp(struct DbEnv *self/
-DbEnv_set_verbose	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_set_verbose(struct DbEnv *self,u_in/
-DbEnv_strerror	../libdb_java/db_java_wrap.c	/^char const *DbEnv_strerror(int error){$/
-DbEnv_txn_begin	../libdb_java/db_java_wrap.c	/^DB_TXN *DbEnv_txn_begin(struct DbEnv *self,DB_TXN /
-DbEnv_txn_checkpoint	../libdb_java/db_java_wrap.c	/^db_ret_t DbEnv_txn_checkpoint(struct DbEnv *self,u/
-DbEnv_txn_recover	../libdb_java/db_java_wrap.c	/^DB_PREPLIST *DbEnv_txn_recover(struct DbEnv *self,/
-DbEnv_txn_stat	../libdb_java/db_java_wrap.c	/^DB_TXN_STAT *DbEnv_txn_stat(struct DbEnv *self,u_i/
-DbException::DbException	../cxx/cxx_except.cpp	/^DbException::DbException(int err)$/
-DbException::describe	../cxx/cxx_except.cpp	/^void DbException::describe(const char *prefix, con/
-DbException::get_env	../cxx/cxx_except.cpp	/^DbEnv *DbException::get_env() const$/
-DbException::get_errno	../cxx/cxx_except.cpp	/^int DbException::get_errno() const$/
-DbException::operator =	../cxx/cxx_except.cpp	/^DbException &DbException::operator = (const DbExce/
-DbException::set_env	../cxx/cxx_except.cpp	/^void DbException::set_env(DbEnv *env)$/
-DbException::what	../cxx/cxx_except.cpp	/^const char *DbException::what() const throw()$/
-DbException::~DbException	../cxx/cxx_except.cpp	/^DbException::~DbException() throw()$/
-DbLock	../libdb_java/db_java_wrap.c	1741
-DbLock::DbLock	../cxx/cxx_lock.cpp	/^DbLock::DbLock(DB_LOCK value)$/
-DbLock::operator =	../cxx/cxx_lock.cpp	/^DbLock &DbLock::operator = (const DbLock &that)$/
-DbLockNotGrantedException::DbLockNotGrantedException	../cxx/cxx_except.cpp	/^DbLockNotGrantedException::DbLockNotGrantedExcepti/
-DbLockNotGrantedException::get_index	../cxx/cxx_except.cpp	/^int DbLockNotGrantedException::get_index() const$/
-DbLockNotGrantedException::get_lock	../cxx/cxx_except.cpp	/^DbLock* DbLockNotGrantedException::get_lock() cons/
-DbLockNotGrantedException::get_mode	../cxx/cxx_except.cpp	/^db_lockmode_t DbLockNotGrantedException::get_mode(/
-DbLockNotGrantedException::get_obj	../cxx/cxx_except.cpp	/^const Dbt* DbLockNotGrantedException::get_obj() co/
-DbLockNotGrantedException::get_op	../cxx/cxx_except.cpp	/^db_lockop_t DbLockNotGrantedException::get_op() co/
-DbLockNotGrantedException::operator =	../cxx/cxx_except.cpp	/^&DbLockNotGrantedException::operator =(const DbLoc/
-DbLockNotGrantedException::~DbLockNotGrantedException	../cxx/cxx_except.cpp	/^DbLockNotGrantedException::~DbLockNotGrantedExcept/
-DbLogc	../libdb_java/db_java_wrap.c	1742
-DbLogc::close	../cxx/cxx_logc.cpp	/^int DbLogc::close(u_int32_t _flags)$/
-DbLogc::get	../cxx/cxx_logc.cpp	/^int DbLogc::get(DbLsn *lsn, Dbt *data, u_int32_t _/
-DbLogc::~DbLogc	../cxx/cxx_logc.cpp	/^DbLogc::~DbLogc()$/
-DbLogc_close	../libdb_java/db_java_wrap.c	/^db_ret_t DbLogc_close(struct DbLogc *self,u_int32_/
-DbLogc_get	../libdb_java/db_java_wrap.c	/^int DbLogc_get(struct DbLogc *self,DB_LSN *lsn,DBT/
-DbLsn	../libdb_java/db_java_wrap.c	1743
-DbMemoryException::DbMemoryException	../cxx/cxx_except.cpp	/^DbMemoryException::DbMemoryException(Dbt *dbt)$/
-DbMemoryException::get_dbt	../cxx/cxx_except.cpp	/^Dbt *DbMemoryException::get_dbt() const$/
-DbMemoryException::operator =	../cxx/cxx_except.cpp	/^&DbMemoryException::operator =(const DbMemoryExcep/
-DbMemoryException::~DbMemoryException	../cxx/cxx_except.cpp	/^DbMemoryException::~DbMemoryException() throw()$/
-DbMpoolFile	../libdb_java/db_java_wrap.c	1744
-DbMpoolFile::DbMpoolFile	../cxx/cxx_mpool.cpp	/^DbMpoolFile::DbMpoolFile()$/
-DbMpoolFile::close	../cxx/cxx_mpool.cpp	/^int DbMpoolFile::close(u_int32_t flags)$/
-DbMpoolFile::~DbMpoolFile	../cxx/cxx_mpool.cpp	/^DbMpoolFile::~DbMpoolFile()$/
-DbMpoolFile_get_flags	../libdb_java/db_java_wrap.c	/^u_int32_t DbMpoolFile_get_flags(struct DbMpoolFile/
-DbMpoolFile_get_maxsize	../libdb_java/db_java_wrap.c	/^jlong DbMpoolFile_get_maxsize(struct DbMpoolFile */
-DbMpoolFile_get_priority	../libdb_java/db_java_wrap.c	/^DB_CACHE_PRIORITY DbMpoolFile_get_priority(struct /
-DbMpoolFile_set_flags	../libdb_java/db_java_wrap.c	/^db_ret_t DbMpoolFile_set_flags(struct DbMpoolFile /
-DbMpoolFile_set_maxsize	../libdb_java/db_java_wrap.c	/^db_ret_t DbMpoolFile_set_maxsize(struct DbMpoolFil/
-DbMpoolFile_set_priority	../libdb_java/db_java_wrap.c	/^db_ret_t DbMpoolFile_set_priority(struct DbMpoolFi/
-DbMultipleDataIterator::next	../cxx/cxx_multi.cpp	/^bool DbMultipleDataIterator::next(Dbt &data)$/
-DbMultipleIterator::DbMultipleIterator	../cxx/cxx_multi.cpp	/^DbMultipleIterator::DbMultipleIterator(const Dbt &/
-DbMultipleKeyDataIterator::next	../cxx/cxx_multi.cpp	/^bool DbMultipleKeyDataIterator::next(Dbt &key, Dbt/
-DbMultipleRecnoDataIterator::next	../cxx/cxx_multi.cpp	/^bool DbMultipleRecnoDataIterator::next(db_recno_t /
-DbRunRecoveryException::DbRunRecoveryException	../cxx/cxx_except.cpp	/^DbRunRecoveryException::DbRunRecoveryException(con/
-DbRunRecoveryException::operator =	../cxx/cxx_except.cpp	/^&DbRunRecoveryException::operator =(const DbRunRec/
-DbRunRecoveryException::~DbRunRecoveryException	../cxx/cxx_except.cpp	/^DbRunRecoveryException::~DbRunRecoveryException() /
-DbSequence	../libdb_java/db_java_wrap.c	1745
-DbSequence::DbSequence	../cxx/cxx_seq.cpp	/^DbSequence::DbSequence(Db *db, u_int32_t flags)$/
-DbSequence::get_key	../cxx/cxx_seq.cpp	/^Dbt *DbSequence::get_key()$/
-DbSequence::wrap_DB_SEQUENCE	../cxx/cxx_seq.cpp	/^DbSequence *DbSequence::wrap_DB_SEQUENCE(DB_SEQUEN/
-DbSequence::~DbSequence	../cxx/cxx_seq.cpp	/^DbSequence::~DbSequence()$/
-DbSequence_close	../libdb_java/db_java_wrap.c	/^db_ret_t DbSequence_close(struct DbSequence *self,/
-DbSequence_get	../libdb_java/db_java_wrap.c	/^db_seq_t DbSequence_get(struct DbSequence *self,DB/
-DbSequence_get_cachesize	../libdb_java/db_java_wrap.c	/^int32_t DbSequence_get_cachesize(struct DbSequence/
-DbSequence_get_db	../libdb_java/db_java_wrap.c	/^DB *DbSequence_get_db(struct DbSequence *self){$/
-DbSequence_get_flags	../libdb_java/db_java_wrap.c	/^u_int32_t DbSequence_get_flags(struct DbSequence */
-DbSequence_get_key	../libdb_java/db_java_wrap.c	/^db_ret_t DbSequence_get_key(struct DbSequence *sel/
-DbSequence_get_range_max	../libdb_java/db_java_wrap.c	/^db_seq_t DbSequence_get_range_max(struct DbSequenc/
-DbSequence_get_range_min	../libdb_java/db_java_wrap.c	/^db_seq_t DbSequence_get_range_min(struct DbSequenc/
-DbSequence_initial_value	../libdb_java/db_java_wrap.c	/^db_ret_t DbSequence_initial_value(struct DbSequenc/
-DbSequence_open	../libdb_java/db_java_wrap.c	/^db_ret_t DbSequence_open(struct DbSequence *self,D/
-DbSequence_remove	../libdb_java/db_java_wrap.c	/^db_ret_t DbSequence_remove(struct DbSequence *self/
-DbSequence_set_cachesize	../libdb_java/db_java_wrap.c	/^db_ret_t DbSequence_set_cachesize(struct DbSequenc/
-DbSequence_set_flags	../libdb_java/db_java_wrap.c	/^db_ret_t DbSequence_set_flags(struct DbSequence *s/
-DbSequence_set_range	../libdb_java/db_java_wrap.c	/^db_ret_t DbSequence_set_range(struct DbSequence *s/
-DbSequence_stat	../libdb_java/db_java_wrap.c	/^DB_SEQUENCE_STAT *DbSequence_stat(struct DbSequenc/
-DbTxn	../libdb_java/db_java_wrap.c	1746
-DbTxn::DbTxn	../cxx/cxx_txn.cpp	/^DbTxn::DbTxn()$/
-DbTxn::~DbTxn	../cxx/cxx_txn.cpp	/^DbTxn::~DbTxn()$/
-DbTxn_abort	../libdb_java/db_java_wrap.c	/^db_ret_t DbTxn_abort(struct DbTxn *self){$/
-DbTxn_commit	../libdb_java/db_java_wrap.c	/^db_ret_t DbTxn_commit(struct DbTxn *self,u_int32_t/
-DbTxn_discard	../libdb_java/db_java_wrap.c	/^db_ret_t DbTxn_discard(struct DbTxn *self,u_int32_/
-DbTxn_id	../libdb_java/db_java_wrap.c	/^u_int32_t DbTxn_id(struct DbTxn *self){$/
-DbTxn_prepare	../libdb_java/db_java_wrap.c	/^db_ret_t DbTxn_prepare(struct DbTxn *self,u_int8_t/
-DbTxn_set_timeout	../libdb_java/db_java_wrap.c	/^db_ret_t DbTxn_set_timeout(struct DbTxn *self,db_t/
-Db_associate	../libdb_java/db_java_wrap.c	/^db_ret_t Db_associate(struct Db *self,DB_TXN *txni/
-Db_close	../libdb_java/db_java_wrap.c	/^int Db_close(struct Db *self,u_int32_t flags){$/
-Db_cursor	../libdb_java/db_java_wrap.c	/^DBC *Db_cursor(struct Db *self,DB_TXN *txnid,u_int/
-Db_del	../libdb_java/db_java_wrap.c	/^int Db_del(struct Db *self,DB_TXN *txnid,DBT *key,/
-Db_err	../libdb_java/db_java_wrap.c	/^void Db_err(struct Db *self,int error,char const */
-Db_errx	../libdb_java/db_java_wrap.c	/^void Db_errx(struct Db *self,char const *message){/
-Db_get	../libdb_java/db_java_wrap.c	/^int Db_get(struct Db *self,DB_TXN *txnid,DBT *key,/
-Db_get_bt_minkey	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_bt_minkey(struct Db *self){$/
-Db_get_byteswapped	../libdb_java/db_java_wrap.c	/^int_bool Db_get_byteswapped(struct Db *self){$/
-Db_get_cachesize	../libdb_java/db_java_wrap.c	/^jlong Db_get_cachesize(struct Db *self){$/
-Db_get_cachesize_ncache	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_cachesize_ncache(struct Db *self)/
-Db_get_dbname	../libdb_java/db_java_wrap.c	/^char const *Db_get_dbname(struct Db *self){$/
-Db_get_encrypt_flags	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_encrypt_flags(struct Db *self){$/
-Db_get_errpfx	../libdb_java/db_java_wrap.c	/^char const *Db_get_errpfx(struct Db *self){$/
-Db_get_filename	../libdb_java/db_java_wrap.c	/^char const *Db_get_filename(struct Db *self){$/
-Db_get_flags	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_flags(struct Db *self){$/
-Db_get_h_ffactor	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_h_ffactor(struct Db *self){$/
-Db_get_h_nelem	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_h_nelem(struct Db *self){$/
-Db_get_lorder	../libdb_java/db_java_wrap.c	/^int Db_get_lorder(struct Db *self){$/
-Db_get_mpf	../libdb_java/db_java_wrap.c	/^DB_MPOOLFILE *Db_get_mpf(struct Db *self){$/
-Db_get_open_flags	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_open_flags(struct Db *self){$/
-Db_get_pagesize	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_pagesize(struct Db *self){$/
-Db_get_q_extentsize	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_q_extentsize(struct Db *self){$/
-Db_get_re_delim	../libdb_java/db_java_wrap.c	/^int Db_get_re_delim(struct Db *self){$/
-Db_get_re_len	../libdb_java/db_java_wrap.c	/^u_int32_t Db_get_re_len(struct Db *self){$/
-Db_get_re_pad	../libdb_java/db_java_wrap.c	/^int Db_get_re_pad(struct Db *self){$/
-Db_get_re_source	../libdb_java/db_java_wrap.c	/^char const *Db_get_re_source(struct Db *self){$/
-Db_get_transactional	../libdb_java/db_java_wrap.c	/^int_bool Db_get_transactional(struct Db *self){$/
-Db_get_type	../libdb_java/db_java_wrap.c	/^DBTYPE Db_get_type(struct Db *self){$/
-Db_join	../libdb_java/db_java_wrap.c	/^DBC *Db_join(struct Db *self,DBC **curslist,u_int3/
-Db_key_range	../libdb_java/db_java_wrap.c	/^db_ret_t Db_key_range(struct Db *self,DB_TXN *txni/
-Db_open	../libdb_java/db_java_wrap.c	/^db_ret_t Db_open(struct Db *self,DB_TXN *txnid,cha/
-Db_pget	../libdb_java/db_java_wrap.c	/^int Db_pget(struct Db *self,DB_TXN *txnid,DBT *key/
-Db_put	../libdb_java/db_java_wrap.c	/^int Db_put(struct Db *self,DB_TXN *txnid,DBT *key,/
-Db_remove	../libdb_java/db_java_wrap.c	/^db_ret_t Db_remove(struct Db *self,char const *fil/
-Db_rename	../libdb_java/db_java_wrap.c	/^db_ret_t Db_rename(struct Db *self,char const *fil/
-Db_set_append_recno	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_append_recno(struct Db *self,int (/
-Db_set_bt_compare	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_bt_compare(struct Db *self,int (*b/
-Db_set_bt_maxkey	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_bt_maxkey(struct Db *self,u_int32_/
-Db_set_bt_minkey	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_bt_minkey(struct Db *self,u_int32_/
-Db_set_bt_prefix	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_bt_prefix(struct Db *self,size_t (/
-Db_set_cachesize	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_cachesize(struct Db *self,jlong by/
-Db_set_dup_compare	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_dup_compare(struct Db *self,int (*/
-Db_set_encrypt	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_encrypt(struct Db *self,char const/
-Db_set_errpfx	../libdb_java/db_java_wrap.c	/^void Db_set_errpfx(struct Db *self,char const *err/
-Db_set_feedback	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_feedback(struct Db *self,void (*db/
-Db_set_flags	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_flags(struct Db *self,u_int32_t fl/
-Db_set_h_ffactor	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_h_ffactor(struct Db *self,u_int32_/
-Db_set_h_hash	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_h_hash(struct Db *self,u_int32_t (/
-Db_set_h_nelem	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_h_nelem(struct Db *self,u_int32_t /
-Db_set_lorder	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_lorder(struct Db *self,int lorder)/
-Db_set_pagesize	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_pagesize(struct Db *self,u_int32_t/
-Db_set_q_extentsize	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_q_extentsize(struct Db *self,u_int/
-Db_set_re_delim	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_re_delim(struct Db *self,int re_de/
-Db_set_re_len	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_re_len(struct Db *self,u_int32_t r/
-Db_set_re_pad	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_re_pad(struct Db *self,int re_pad)/
-Db_set_re_source	../libdb_java/db_java_wrap.c	/^db_ret_t Db_set_re_source(struct Db *self,char *so/
-Db_stat	../libdb_java/db_java_wrap.c	/^void *Db_stat(struct Db *self,DB_TXN *txnid,u_int3/
-Db_sync	../libdb_java/db_java_wrap.c	/^db_ret_t Db_sync(struct Db *self,u_int32_t flags){/
+Db	../cxx/cxx_db.cpp	/^\/\/ If the DB handle is still open, we close it. /
+DbDeadlockException	../cxx/cxx_except.cpp	/^DbDeadlockException::~DbDeadlockException() throw(/
+DbEnv	../cxx/cxx_env.cpp	/^\/\/ If the DB_ENV handle is still open, we close /
+DbEnv_cdsgroup_begin	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_TXN *DbEnv_cdsgroup_begin(struct DbE/
+DbEnv_close	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_close(struct DbEnv *self/
+DbEnv_dbremove	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_dbremove(struct DbEnv *s/
+DbEnv_dbrename	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_dbrename(struct DbEnv *s/
+DbEnv_err	../libdb_java/db_java_wrap.c	/^SWIGINTERN void DbEnv_err(struct DbEnv *self,int e/
+DbEnv_errx	../libdb_java/db_java_wrap.c	/^SWIGINTERN void DbEnv_errx(struct DbEnv *self,char/
+DbEnv_fileid_reset	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_fileid_reset(struct DbEn/
+DbEnv_get_cachesize	../libdb_java/db_java_wrap.c	/^SWIGINTERN jlong DbEnv_get_cachesize(struct DbEnv /
+DbEnv_get_cachesize_ncache	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_get_cachesize_ncache(struct D/
+DbEnv_get_data_dirs	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const **DbEnv_get_data_dirs(struct/
+DbEnv_get_encrypt_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_encrypt_flags(struc/
+DbEnv_get_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_flags(struct DbEnv /
+DbEnv_get_home	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const *DbEnv_get_home(struct DbEnv/
+DbEnv_get_lg_bsize	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_lg_bsize(struct DbE/
+DbEnv_get_lg_dir	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const *DbEnv_get_lg_dir(struct DbE/
+DbEnv_get_lg_filemode	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_get_lg_filemode(struct DbEnv /
+DbEnv_get_lg_max	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_lg_max(struct DbEnv/
+DbEnv_get_lg_regionmax	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_lg_regionmax(struct/
+DbEnv_get_lk_conflicts	../libdb_java/db_java_wrap.c	/^SWIGINTERN struct __db_lk_conflicts DbEnv_get_lk_c/
+DbEnv_get_lk_detect	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_lk_detect(struct Db/
+DbEnv_get_lk_max_lockers	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_lk_max_lockers(stru/
+DbEnv_get_lk_max_locks	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_lk_max_locks(struct/
+DbEnv_get_lk_max_objects	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_lk_max_objects(stru/
+DbEnv_get_mp_max_openfd	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_get_mp_max_openfd(struct DbEn/
+DbEnv_get_mp_max_write	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_get_mp_max_write(struct DbEnv/
+DbEnv_get_mp_max_write_sleep	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_get_mp_max_write_sleep(struct/
+DbEnv_get_mp_mmapsize	../libdb_java/db_java_wrap.c	/^SWIGINTERN size_t DbEnv_get_mp_mmapsize(struct DbE/
+DbEnv_get_open_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_open_flags(struct D/
+DbEnv_get_shm_key	../libdb_java/db_java_wrap.c	/^SWIGINTERN long DbEnv_get_shm_key(struct DbEnv *se/
+DbEnv_get_timeout	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_timeout_t DbEnv_get_timeout(struct D/
+DbEnv_get_tmp_dir	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const *DbEnv_get_tmp_dir(struct Db/
+DbEnv_get_tx_max	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_get_tx_max(struct DbEnv/
+DbEnv_get_tx_timestamp	../libdb_java/db_java_wrap.c	/^SWIGINTERN time_t DbEnv_get_tx_timestamp(struct Db/
+DbEnv_get_verbose	../libdb_java/db_java_wrap.c	/^SWIGINTERN int_bool DbEnv_get_verbose(struct DbEnv/
+DbEnv_get_version_major	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_get_version_major(){$/
+DbEnv_get_version_minor	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_get_version_minor(){$/
+DbEnv_get_version_patch	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_get_version_patch(){$/
+DbEnv_get_version_string	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const *DbEnv_get_version_string(){/
+DbEnv_is_bigendian	../libdb_java/db_java_wrap.c	/^SWIGINTERN int_bool DbEnv_is_bigendian(struct DbEn/
+DbEnv_lock_detect	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_lock_detect(struct DbEnv *sel/
+DbEnv_lock_get	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_LOCK *DbEnv_lock_get(struct DbEnv *s/
+DbEnv_lock_id	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_lock_id(struct DbEnv *s/
+DbEnv_lock_id_free	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_lock_id_free(struct DbEn/
+DbEnv_lock_put	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_lock_put(struct DbEnv *s/
+DbEnv_lock_stat	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_LOCK_STAT *DbEnv_lock_stat(struct Db/
+DbEnv_log_archive	../libdb_java/db_java_wrap.c	/^SWIGINTERN char **DbEnv_log_archive(struct DbEnv */
+DbEnv_log_compare	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_log_compare(DB_LSN const *lsn/
+DbEnv_log_cursor	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_LOGC *DbEnv_log_cursor(struct DbEnv /
+DbEnv_log_file	../libdb_java/db_java_wrap.c	/^SWIGINTERN char *DbEnv_log_file(struct DbEnv *self/
+DbEnv_log_flush	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_log_flush(struct DbEnv */
+DbEnv_log_print	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_log_print(struct DbEnv */
+DbEnv_log_put	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_log_put(struct DbEnv *se/
+DbEnv_log_stat	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_LOG_STAT *DbEnv_log_stat(struct DbEn/
+DbEnv_lsn_reset	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_lsn_reset(struct DbEnv */
+DbEnv_memp_fstat	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_MPOOL_FSTAT **DbEnv_memp_fstat(struc/
+DbEnv_memp_stat	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_MPOOL_STAT *DbEnv_memp_stat(struct D/
+DbEnv_memp_trickle	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_memp_trickle(struct DbEnv *se/
+DbEnv_mutex_get_align	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_mutex_get_align(struct /
+DbEnv_mutex_get_increment	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_mutex_get_increment(str/
+DbEnv_mutex_get_max	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_mutex_get_max(struct Db/
+DbEnv_mutex_get_tas_spins	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_mutex_get_tas_spins(str/
+DbEnv_mutex_set_align	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_mutex_set_align(struct D/
+DbEnv_mutex_set_increment	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_mutex_set_increment(stru/
+DbEnv_mutex_set_max	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_mutex_set_max(struct DbE/
+DbEnv_mutex_set_tas_spins	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_mutex_set_tas_spins(stru/
+DbEnv_mutex_stat	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_MUTEX_STAT *DbEnv_mutex_stat(struct /
+DbEnv_open	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_open(struct DbEnv *self,/
+DbEnv_remove	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_remove(struct DbEnv *sel/
+DbEnv_rep_elect	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_rep_elect(struct DbEnv *self,/
+DbEnv_rep_flush	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_rep_flush(struct DbEnv */
+DbEnv_rep_get_config	../libdb_java/db_java_wrap.c	/^SWIGINTERN int_bool DbEnv_rep_get_config(struct Db/
+DbEnv_rep_get_limit	../libdb_java/db_java_wrap.c	/^SWIGINTERN jlong DbEnv_rep_get_limit(struct DbEnv /
+DbEnv_rep_get_nsites	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_rep_get_nsites(struct DbEnv */
+DbEnv_rep_get_priority	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_rep_get_priority(struct DbEnv/
+DbEnv_rep_get_timeout	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbEnv_rep_get_timeout(struct /
+DbEnv_rep_process_message	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_rep_process_message(struct Db/
+DbEnv_rep_set_config	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_rep_set_config(struct Db/
+DbEnv_rep_set_limit	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_rep_set_limit(struct DbE/
+DbEnv_rep_set_nsites	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_rep_set_nsites(struct Db/
+DbEnv_rep_set_priority	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_rep_set_priority(struct /
+DbEnv_rep_set_timeout	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_rep_set_timeout(struct D/
+DbEnv_rep_set_transport	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_rep_set_transport(struct/
+DbEnv_rep_start	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_rep_start(struct DbEnv */
+DbEnv_rep_stat	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_REP_STAT *DbEnv_rep_stat(struct DbEn/
+DbEnv_rep_sync	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_rep_sync(struct DbEnv *s/
+DbEnv_repmgr_add_remote_site	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbEnv_repmgr_add_remote_site(struct/
+DbEnv_repmgr_get_ack_policy	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_repmgr_get_ack_policy(st/
+DbEnv_repmgr_set_ack_policy	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_repmgr_set_ack_policy(st/
+DbEnv_repmgr_set_local_site	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_repmgr_set_local_site(st/
+DbEnv_repmgr_site_list	../libdb_java/db_java_wrap.c	/^SWIGINTERN struct __db_repmgr_sites DbEnv_repmgr_s/
+DbEnv_repmgr_start	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_repmgr_start(struct DbEn/
+DbEnv_set_app_dispatch	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_app_dispatch(struct /
+DbEnv_set_cachesize	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_cachesize(struct DbE/
+DbEnv_set_data_dir	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_data_dir(struct DbEn/
+DbEnv_set_encrypt	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_encrypt(struct DbEnv/
+DbEnv_set_errcall	../libdb_java/db_java_wrap.c	/^SWIGINTERN void DbEnv_set_errcall(struct DbEnv *se/
+DbEnv_set_event_notify	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_event_notify(struct /
+DbEnv_set_feedback	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_feedback(struct DbEn/
+DbEnv_set_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_flags(struct DbEnv */
+DbEnv_set_intermediate_dir	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_intermediate_dir(str/
+DbEnv_set_lg_bsize	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lg_bsize(struct DbEn/
+DbEnv_set_lg_dir	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lg_dir(struct DbEnv /
+DbEnv_set_lg_filemode	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lg_filemode(struct D/
+DbEnv_set_lg_max	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lg_max(struct DbEnv /
+DbEnv_set_lg_regionmax	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lg_regionmax(struct /
+DbEnv_set_lk_conflicts	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lk_conflicts(struct /
+DbEnv_set_lk_detect	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lk_detect(struct DbE/
+DbEnv_set_lk_max_lockers	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lk_max_lockers(struc/
+DbEnv_set_lk_max_locks	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lk_max_locks(struct /
+DbEnv_set_lk_max_objects	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_lk_max_objects(struc/
+DbEnv_set_mp_max_openfd	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_mp_max_openfd(struct/
+DbEnv_set_mp_max_write	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_mp_max_write(struct /
+DbEnv_set_mp_mmapsize	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_mp_mmapsize(struct D/
+DbEnv_set_msgcall	../libdb_java/db_java_wrap.c	/^SWIGINTERN void DbEnv_set_msgcall(struct DbEnv *se/
+DbEnv_set_paniccall	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_paniccall(struct DbE/
+DbEnv_set_rep_request	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_rep_request(struct D/
+DbEnv_set_rpc_server	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_rpc_server(struct Db/
+DbEnv_set_shm_key	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_shm_key(struct DbEnv/
+DbEnv_set_timeout	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_timeout(struct DbEnv/
+DbEnv_set_tmp_dir	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_tmp_dir(struct DbEnv/
+DbEnv_set_tx_max	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_tx_max(struct DbEnv /
+DbEnv_set_tx_timestamp	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_tx_timestamp(struct /
+DbEnv_set_verbose	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_set_verbose(struct DbEnv/
+DbEnv_strerror	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const *DbEnv_strerror(int error){$/
+DbEnv_txn_begin	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_TXN *DbEnv_txn_begin(struct DbEnv *s/
+DbEnv_txn_checkpoint	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbEnv_txn_checkpoint(struct Db/
+DbEnv_txn_recover	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_PREPLIST *DbEnv_txn_recover(struct D/
+DbEnv_txn_stat	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_TXN_STAT *DbEnv_txn_stat(struct DbEn/
+DbException	../cxx/cxx_except.cpp	/^DbException::~DbException() throw()$/
+DbLock	../cxx/cxx_lock.cpp	/^DbLock::DbLock()$/
+DbLockNotGrantedException	../cxx/cxx_except.cpp	/^DbLockNotGrantedException::~DbLockNotGrantedExcept/
+DbLogc	../cxx/cxx_logc.cpp	/^\/\/ It's private, and should never be called,$/
+DbLogc_close	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbLogc_close(struct DbLogc *se/
+DbLogc_get	../libdb_java/db_java_wrap.c	/^SWIGINTERN int DbLogc_get(struct DbLogc *self,DB_L/
+DbLsn	../libdb_java/db_java_wrap.c	/^#define	DbLsn __db_lsn$/
+DbMemoryException	../cxx/cxx_except.cpp	/^DbMemoryException::~DbMemoryException() throw()$/
+DbMpoolFile	../cxx/cxx_mpool.cpp	/^DbMpoolFile::~DbMpoolFile()$/
+DbMpoolFile_get_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbMpoolFile_get_flags(struct /
+DbMpoolFile_get_maxsize	../libdb_java/db_java_wrap.c	/^SWIGINTERN jlong DbMpoolFile_get_maxsize(struct Db/
+DbMpoolFile_get_priority	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_CACHE_PRIORITY DbMpoolFile_get_prior/
+DbMpoolFile_set_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbMpoolFile_set_flags(struct D/
+DbMpoolFile_set_maxsize	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbMpoolFile_set_maxsize(struct/
+DbMpoolFile_set_priority	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbMpoolFile_set_priority(struc/
+DbRepHandleDeadException	../cxx/cxx_except.cpp	/^DbRepHandleDeadException::~DbRepHandleDeadExceptio/
+DbRunRecoveryException	../cxx/cxx_except.cpp	/^DbRunRecoveryException::~DbRunRecoveryException() /
+DbSequence	../cxx/cxx_seq.cpp	/^DbSequence::~DbSequence()$/
+DbSequence_close	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbSequence_close(struct DbSequ/
+DbSequence_get	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_seq_t DbSequence_get(struct DbSequen/
+DbSequence_get_cachesize	../libdb_java/db_java_wrap.c	/^SWIGINTERN int32_t DbSequence_get_cachesize(struct/
+DbSequence_get_db	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB *DbSequence_get_db(struct DbSequence/
+DbSequence_get_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbSequence_get_flags(struct D/
+DbSequence_get_key	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbSequence_get_key(struct DbSe/
+DbSequence_get_range_max	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_seq_t DbSequence_get_range_max(struc/
+DbSequence_get_range_min	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_seq_t DbSequence_get_range_min(struc/
+DbSequence_initial_value	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbSequence_initial_value(struc/
+DbSequence_open	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbSequence_open(struct DbSeque/
+DbSequence_remove	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbSequence_remove(struct DbSeq/
+DbSequence_set_cachesize	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbSequence_set_cachesize(struc/
+DbSequence_set_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbSequence_set_flags(struct Db/
+DbSequence_set_range	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbSequence_set_range(struct Db/
+DbSequence_stat	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_SEQUENCE_STAT *DbSequence_stat(struc/
+DbTxn	../cxx/cxx_txn.cpp	/^DbTxn::~DbTxn()$/
+DbTxn_abort	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbTxn_abort(struct DbTxn *self/
+DbTxn_commit	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbTxn_commit(struct DbTxn *sel/
+DbTxn_discard	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbTxn_discard(struct DbTxn *se/
+DbTxn_get_name	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const *DbTxn_get_name(struct DbTxn/
+DbTxn_id	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t DbTxn_id(struct DbTxn *self){/
+DbTxn_prepare	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbTxn_prepare(struct DbTxn *se/
+DbTxn_set_name	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbTxn_set_name(struct DbTxn *s/
+DbTxn_set_timeout	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t DbTxn_set_timeout(struct DbTxn/
+Db_associate	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_associate(struct Db *self,D/
+Db_close	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Db_close(struct Db *self,u_int32_t /
+Db_compact	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_compact(struct Db *self,DB_/
+Db_cursor	../libdb_java/db_java_wrap.c	/^SWIGINTERN DBC *Db_cursor(struct Db *self,DB_TXN */
+Db_del	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Db_del(struct Db *self,DB_TXN *txni/
+Db_err	../libdb_java/db_java_wrap.c	/^SWIGINTERN void Db_err(struct Db *self,int error,c/
+Db_errx	../libdb_java/db_java_wrap.c	/^SWIGINTERN void Db_errx(struct Db *self,char const/
+Db_get	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Db_get(struct Db *self,DB_TXN *txni/
+Db_get_bt_minkey	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_bt_minkey(struct Db *s/
+Db_get_byteswapped	../libdb_java/db_java_wrap.c	/^SWIGINTERN int_bool Db_get_byteswapped(struct Db */
+Db_get_cachesize	../libdb_java/db_java_wrap.c	/^SWIGINTERN jlong Db_get_cachesize(struct Db *self)/
+Db_get_cachesize_ncache	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_cachesize_ncache(struc/
+Db_get_dbname	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const *Db_get_dbname(struct Db *se/
+Db_get_encrypt_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_encrypt_flags(struct D/
+Db_get_filename	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const *Db_get_filename(struct Db */
+Db_get_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_flags(struct Db *self)/
+Db_get_h_ffactor	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_h_ffactor(struct Db *s/
+Db_get_h_nelem	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_h_nelem(struct Db *sel/
+Db_get_lorder	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Db_get_lorder(struct Db *self){$/
+Db_get_mpf	../libdb_java/db_java_wrap.c	/^SWIGINTERN DB_MPOOLFILE *Db_get_mpf(struct Db *sel/
+Db_get_open_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_open_flags(struct Db */
+Db_get_pagesize	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_pagesize(struct Db *se/
+Db_get_q_extentsize	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_q_extentsize(struct Db/
+Db_get_re_delim	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Db_get_re_delim(struct Db *self){$/
+Db_get_re_len	../libdb_java/db_java_wrap.c	/^SWIGINTERN u_int32_t Db_get_re_len(struct Db *self/
+Db_get_re_pad	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Db_get_re_pad(struct Db *self){$/
+Db_get_re_source	../libdb_java/db_java_wrap.c	/^SWIGINTERN char const *Db_get_re_source(struct Db /
+Db_get_transactional	../libdb_java/db_java_wrap.c	/^SWIGINTERN int_bool Db_get_transactional(struct Db/
+Db_get_type	../libdb_java/db_java_wrap.c	/^SWIGINTERN DBTYPE Db_get_type(struct Db *self){$/
+Db_join	../libdb_java/db_java_wrap.c	/^SWIGINTERN DBC *Db_join(struct Db *self,DBC **curs/
+Db_key_range	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_key_range(struct Db *self,D/
+Db_open	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_open(struct Db *self,DB_TXN/
+Db_pget	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Db_pget(struct Db *self,DB_TXN *txn/
+Db_put	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Db_put(struct Db *self,DB_TXN *txni/
+Db_remove	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_remove(struct Db *self,char/
+Db_rename	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_rename(struct Db *self,char/
+Db_set_append_recno	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_append_recno(struct Db /
+Db_set_bt_compare	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_bt_compare(struct Db *s/
+Db_set_bt_minkey	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_bt_minkey(struct Db *se/
+Db_set_bt_prefix	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_bt_prefix(struct Db *se/
+Db_set_cachesize	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_cachesize(struct Db *se/
+Db_set_dup_compare	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_dup_compare(struct Db */
+Db_set_encrypt	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_encrypt(struct Db *self/
+Db_set_feedback	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_feedback(struct Db *sel/
+Db_set_flags	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_flags(struct Db *self,u/
+Db_set_h_ffactor	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_h_ffactor(struct Db *se/
+Db_set_h_hash	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_h_hash(struct Db *self,/
+Db_set_h_nelem	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_h_nelem(struct Db *self/
+Db_set_lorder	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_lorder(struct Db *self,/
+Db_set_pagesize	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_pagesize(struct Db *sel/
+Db_set_q_extentsize	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_q_extentsize(struct Db /
+Db_set_re_delim	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_re_delim(struct Db *sel/
+Db_set_re_len	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_re_len(struct Db *self,/
+Db_set_re_pad	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_re_pad(struct Db *self,/
+Db_set_re_source	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_set_re_source(struct Db *se/
+Db_stat	../libdb_java/db_java_wrap.c	/^SWIGINTERN void *Db_stat(struct Db *self,DB_TXN *t/
+Db_sync	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_sync(struct Db *self,u_int3/
 Db_tcl_Init	../tcl/tcl_db_pkg.c	/^Db_tcl_Init(interp)$/
-Db_truncate	../libdb_java/db_java_wrap.c	/^int Db_truncate(struct Db *self,DB_TXN *txnid,u_in/
-Db_upgrade	../libdb_java/db_java_wrap.c	/^db_ret_t Db_upgrade(struct Db *self,char const *fi/
-Db_verify	../libdb_java/db_java_wrap.c	/^int_bool Db_verify(struct Db *self,char const *fil/
-Dbc	../libdb_java/db_java_wrap.c	1738
-Dbc::get	../cxx/cxx_dbc.cpp	/^int Dbc::get(Dbt* key, Dbt *data, u_int32_t _flags/
-Dbc::pget	../cxx/cxx_dbc.cpp	/^int Dbc::pget(Dbt* key, Dbt *pkey, Dbt *data, u_in/
-Dbc::~Dbc	../cxx/cxx_dbc.cpp	/^Dbc::~Dbc()$/
-Dbc_close	../libdb_java/db_java_wrap.c	/^db_ret_t Dbc_close(struct Dbc *self){$/
-Dbc_count	../libdb_java/db_java_wrap.c	/^db_recno_t Dbc_count(struct Dbc *self,u_int32_t fl/
-Dbc_del	../libdb_java/db_java_wrap.c	/^int Dbc_del(struct Dbc *self,u_int32_t flags){$/
-Dbc_dup	../libdb_java/db_java_wrap.c	/^DBC *Dbc_dup(struct Dbc *self,u_int32_t flags){$/
-Dbc_get	../libdb_java/db_java_wrap.c	/^int Dbc_get(struct Dbc *self,DBT *key,DBT *data,u_/
-Dbc_pget	../libdb_java/db_java_wrap.c	/^int Dbc_pget(struct Dbc *self,DBT *key,DBT *pkey,D/
-Dbc_put	../libdb_java/db_java_wrap.c	/^int Dbc_put(struct Dbc *self,DBT *key,DBT *data,u_/
-Dbt	../libdb_java/db_java_wrap.c	1739
-Dbt::Dbt	../cxx/cxx_dbt.cpp	/^Dbt::Dbt()$/
-Dbt::operator =	../cxx/cxx_dbt.cpp	/^Dbt &Dbt::operator = (const Dbt &that)$/
-Dbt::~Dbt	../cxx/cxx_dbt.cpp	/^Dbt::~Dbt()$/
-EMSG	../clib/getopt.c	61
+Db_truncate	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Db_truncate(struct Db *self,DB_TXN /
+Db_upgrade	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Db_upgrade(struct Db *self,cha/
+Db_verify	../libdb_java/db_java_wrap.c	/^SWIGINTERN int_bool Db_verify(struct Db *self,char/
+Dbc	../cxx/cxx_dbc.cpp	/^\/\/ It's private, and should never be called, but/
+Dbc_close	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_ret_t Dbc_close(struct Dbc *self){$/
+Dbc_count	../libdb_java/db_java_wrap.c	/^SWIGINTERN db_recno_t Dbc_count(struct Dbc *self,u/
+Dbc_del	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Dbc_del(struct Dbc *self,u_int32_t /
+Dbc_dup	../libdb_java/db_java_wrap.c	/^SWIGINTERN DBC *Dbc_dup(struct Dbc *self,u_int32_t/
+Dbc_get	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Dbc_get(struct Dbc *self,DBT *key,D/
+Dbc_pget	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Dbc_pget(struct Dbc *self,DBT *key,/
+Dbc_put	../libdb_java/db_java_wrap.c	/^SWIGINTERN int Dbc_put(struct Dbc *self,DBT *key,D/
+Dbt	../cxx/cxx_dbt.cpp	/^Dbt::Dbt()$/
+EID_FROM_SITE	../dbinc/repmgr.h	/^#define	EID_FROM_SITE(s)	((int)((s) - (&db_rep->si/
+ELECTION_MAJORITY	../dbinc/rep.h	/^#define	ELECTION_MAJORITY(n) (((n) \/ 2) + 1)$/
+ELECT_ELECTION	../dbinc/rep.h	/^#define	ELECT_ELECTION 1	\/* Call for an election./
+ELECT_FAILURE_ELECTION	../dbinc/rep.h	/^#define	ELECT_FAILURE_ELECTION 3 \/* Do election, /
+ELECT_REPSTART	../dbinc/rep.h	/^#define	ELECT_REPSTART 2	\/* Call rep_start(CLIENT/
+EMSG	../clib/getopt.c	/^#define	EMSG	""$/
+ENTRY	../dbinc/db.in	/^} ENTRY;$/
+ENV_ENTER	../dbinc/db_int.in	/^#define	ENV_ENTER(dbenv, ip) do {					\\$/
 ENV_ILLEGAL_AFTER_OPEN	../dbinc/db_int.in	/^#define	ENV_ILLEGAL_AFTER_OPEN(dbenv, name)				\\$/
-ENV_ILLEGAL_BEFORE_OPEN	../dbinc/db_int.in	/^#define	ENV_ILLEGAL_BEFORE_OPEN(dbenv, name)				\\$/
+ENV_ILLEGAL_BEFORE_OPEN	../dbinc/db_int.in	/^#define	ENV_ILLEGAL_BEFORE_OPEN(dbenv, name)				\\/
+ENV_LEAVE	../dbinc/db_int.in	/^#define	ENV_LEAVE(dbenv, ip) do {					\\$/
 ENV_NOT_CONFIGURED	../dbinc/db_int.in	/^#define	ENV_NOT_CONFIGURED(dbenv, handle, i, flags/
 ENV_REQUIRES_CONFIG	../dbinc/db_int.in	/^#define	ENV_REQUIRES_CONFIG(dbenv, handle, i, flag/
-EPG	../dbinc/btree.h	50
+ENV_REQUIRES_CONFIG_XX	../dbinc/db_int.in	/^#define	ENV_REQUIRES_CONFIG_XX(dbenv, handle, i, f/
+EPG	../dbinc/btree.h	/^struct __epg;		typedef struct __epg EPG;$/
 EPRINT	../dbinc/db_verify.h	/^#define	EPRINT(x) do {							\\$/
-FALSE	../crypto/rijndael/rijndael-api-fst.h	55
+FALSE	../dbinc/db_int.in	/^#define	FALSE		0$/
 FAST_HASH	../lock/lock_util.c	/^#define	FAST_HASH(P) {			\\$/
+FHASH	../dbinc/mp.h	/^#define	FHASH(id, len)	__ham_func5(NULL, id, (u_in/
+FILE_EXTEND_IO_SIZE	../env/env_file.c	/^#define	FILE_EXTEND_IO_SIZE	(8 * 1024)$/
+FILE_WRITE_IO_SIZE	../env/env_file.c	/^#define	FILE_WRITE_IO_SIZE	(64 * 1024)$/
+FIND_FIRST_DB_MATCH	../dbinc/db_am.h	/^#define	FIND_FIRST_DB_MATCH(dbenv, dbp, tdbp) do {/
 FLAG_CHECK	../dbinc/tcl_db.h	/^#define	FLAG_CHECK(flag) do {						\\$/
 FLAG_CHECK2	../dbinc/tcl_db.h	/^#define	FLAG_CHECK2(flag, val) do {					\\$/
+FLAG_CHECK2_STDARG	../tcl/tcl_dbcursor.c	/^#define	FLAG_CHECK2_STDARG	\\$/
 FLD_CLR	../dbinc/db_int.in	/^#define	FLD_CLR(fld, f)		(fld) &= ~(f)$/
 FLD_ISSET	../dbinc/db_int.in	/^#define	FLD_ISSET(fld, f)	((fld) & (f))$/
 FLD_SET	../dbinc/db_int.in	/^#define	FLD_SET(fld, f)		(fld) |= (f)$/
-FMAP_ENTRIES	../mp/mp_stat.c	303
-FNAME	../dbinc/db.in	158
-FREE_IF_CHANGED	../rpc_client/gen_client_ret.c	/^#define	FREE_IF_CHANGED(dbtp, orig)	do {				\\$/
-FREE_IF_NEEDED	../dbinc/db_int.in	/^#define	FREE_IF_NEEDED(sdbp, dbt)					\\$/
+FMAP_ENTRIES	../mp/mp_stat.c	/^#define	FMAP_ENTRIES	200			\/* Files we map. *\/$/
+FN	../dbinc/db_int.in	/^} FN;$/
+FNAME	../dbinc/db.in	/^struct __fname;		typedef struct __fname FNAME;$/
+FNBUCKET	../dbinc/mp.h	/^#define	FNBUCKET(id, len)						\\$/
+FREE_IF_CHANGED	../dbinc/db_server_int.h	/^#define	FREE_IF_CHANGED(dbenv, p, orig) do {				\\/
+FREE_IF_NEEDED	../dbinc/db_int.in	/^#define	FREE_IF_NEEDED(dbenv, dbt)					\\$/
 F_CLR	../dbinc/db_int.in	/^#define	F_CLR(p, f)		(p)->flags &= ~(f)$/
 F_ISSET	../dbinc/db_int.in	/^#define	F_ISSET(p, f)		((p)->flags & (f))$/
 F_SET	../dbinc/db_int.in	/^#define	F_SET(p, f)		(p)->flags |= (f)$/
+GCC_HASCLASSVISIBILITY	../libdb_java/db_java_wrap.c	/^#    define GCC_HASCLASSVISIBILITY$/
 GETU32	../crypto/rijndael/rijndael-alg-fst.c	/^#define GETU32(p) SWAP(*((u32 *)(p)))$/
 GET_BINTERNAL	../dbinc/db_page.h	/^#define	GET_BINTERNAL(dbp, pg, indx)					\\$/
 GET_BKEYDATA	../dbinc/db_page.h	/^#define	GET_BKEYDATA(dbp, pg, indx)					\\$/
 GET_BOVERFLOW	../dbinc/db_page.h	/^#define	GET_BOVERFLOW(dbp, pg, indx)					\\$/
 GET_COUNT	../lock/lock_list.c	/^#define	GET_COUNT(dp, count)	do {					\\$/
 GET_ENVLOCK	../fileops/fop_util.c	/^#define	GET_ENVLOCK(ENV, ID, L) (0)$/
-GET_HANDLE	../mutex/mut_win32.c	/^#define	GET_HANDLE(mutexp, event) do {					\\$/
 GET_PAGE	../db/db_upg_opd.c	/^#define	GET_PAGE(dbp, fhp, pgno, page) {				\\$/
 GET_PCOUNT	../lock/lock_list.c	/^#define	GET_PCOUNT(dp, count)	do {					\\$/
 GET_PGNO	../lock/lock_list.c	/^#define	GET_PGNO(dp, pgno)	do {					\\$/
 GET_RINTERNAL	../dbinc/db_page.h	/^#define	GET_RINTERNAL(dbp, pg, indx)					\\$/
 GET_SIZE	../lock/lock_list.c	/^#define	GET_SIZE(dp, size)	do {					\\$/
-GIGABYTE	../dbinc/db_int.in	77
+GIGABYTE	../dbinc/db_int.in	/^#define	GIGABYTE	1073741824$/
 GLOB_CHAR	../tcl/tcl_internal.c	/^#define	GLOB_CHAR(c)	((c) == '*' || (c) == '?')$/
-GUARD_BYTE	../dbinc/debug.h	29
-HASH4	../hash/hash_func.c	166
-HASH4a	../hash/hash_func.c	164
-HASH4b	../hash/hash_func.c	165
-HASHC	../hash/hash_func.c	113
-HASHINSERT	../dbinc/db_shash.h	/^#define	HASHINSERT(begin, ndx, type, field, elt) d/
-HASHLOOKUP	../dbinc/db_shash.h	/^#define	HASHLOOKUP(begin, ndx, type, field, elt, r/
-HASHMAGIC	../dbinc/db_185.in	138
-HASHREMOVE_EL	../dbinc/db_shash.h	/^#define	HASHREMOVE_EL(begin, ndx, type, field, obj/
-HASHVERSION	../dbinc/db_185.in	139
-HASH_UNUSED1	../dbinc/hash.h	130
-HASH_UNUSED2	../dbinc/hash.h	131
-HDR	../dbinc/log.h	59
-HDR_CRYPTO_SZ	../dbinc/log.h	134
-HDR_NORMAL_SZ	../dbinc/log.h	133
+GUARD_BYTE	../dbinc/debug.h	/^#define	GUARD_BYTE	0xdc$/
+HASH	../dbinc/hash.h	/^} HASH;$/
+HASH4	../hash/hash_func.c	/^#define	HASH4	HASH4b$/
+HASH4a	../hash/hash_func.c	/^#define	HASH4a	h = (h << 5) - h + *k++;$/
+HASH4b	../hash/hash_func.c	/^#define	HASH4b	h = (h << 5) + h + *k++;$/
+HASHC	../hash/hash_func.c	/^#define	HASHC	n = *k++ + 65599 * n$/
+HASHHDR	../dbinc/db_upgrade.h	/^} HASHHDR;$/
+HASHINFO	../dbinc/db_185.in	/^} HASHINFO;$/
+HASHMAGIC	../dbinc/db_185.in	/^#define	HASHMAGIC	0x061561$/
+HASHVERSION	../dbinc/db_185.in	/^#define	HASHVERSION	2$/
+HASH_CURSOR	../dbinc/hash.h	/^} HASH_CURSOR;$/
+HASH_UNUSED1	../dbinc/hash.h	/^#define	HASH_UNUSED1	0x60$/
+HASH_UNUSED2	../dbinc/hash.h	/^#define	HASH_UNUSED2	0x70$/
+HDR	../dbinc/log.h	/^struct __hdr;		typedef struct __hdr HDR;$/
+HDR_CRYPTO_SZ	../dbinc/log.h	/^#define	HDR_CRYPTO_SZ	12 + DB_MAC_KEY + DB_IV_BYTE/
+HDR_NORMAL_SZ	../dbinc/log.h	/^#define	HDR_NORMAL_SZ	12$/
+HKEYDATA	../dbinc/db_page.h	/^} HKEYDATA;$/
 HKEYDATA_DATA	../dbinc/db_page.h	/^#define	HKEYDATA_DATA(p)	(((u_int8_t *)p) + SSZA(H/
 HKEYDATA_PSIZE	../dbinc/db_page.h	/^#define	HKEYDATA_PSIZE(len)						\\$/
 HKEYDATA_SIZE	../dbinc/db_page.h	/^#define	HKEYDATA_SIZE(len)						\\$/
-HMAC_BLOCK_SIZE	../hmac/hmac.c	26
-HMAC_OUTPUT_SIZE	../hmac/hmac.c	25
+HMAC_BLOCK_SIZE	../hmac/hmac.c	/^#define	HMAC_BLOCK_SIZE	64$/
+HMAC_OUTPUT_SIZE	../hmac/hmac.c	/^#define	HMAC_OUTPUT_SIZE	20$/
+HMETA	../dbinc/db_page.h	/^} HMETA33, HMETA;$/
+HMETA30	../dbinc/db_upgrade.h	/^} HMETA30;$/
+HMETA31	../dbinc/db_upgrade.h	/^} HMETA31;$/
+HOFFDUP	../dbinc/db_page.h	/^} HOFFDUP;$/
 HOFFDUP_PGNO	../dbinc/db_page.h	/^#define	HOFFDUP_PGNO(p)		(((u_int8_t *)p) + SSZ(HO/
-HOFFDUP_SIZE	../dbinc/db_page.h	512
+HOFFDUP_SIZE	../dbinc/db_page.h	/^#define	HOFFDUP_SIZE		(sizeof(HOFFDUP))$/
+HOFFPAGE	../dbinc/db_page.h	/^} HOFFPAGE;$/
 HOFFPAGE_PGNO	../dbinc/db_page.h	/^#define	HOFFPAGE_PGNO(p)	(((u_int8_t *)p) + SSZ(HO/
-HOFFPAGE_PSIZE	../dbinc/db_page.h	496
-HOFFPAGE_SIZE	../dbinc/db_page.h	495
+HOFFPAGE_PSIZE	../dbinc/db_page.h	/^#define	HOFFPAGE_PSIZE		(HOFFPAGE_SIZE + sizeof(db/
+HOFFPAGE_SIZE	../dbinc/db_page.h	/^#define	HOFFPAGE_SIZE		(sizeof(HOFFPAGE))$/
 HOFFPAGE_TLEN	../dbinc/db_page.h	/^#define	HOFFPAGE_TLEN(p)	(((u_int8_t *)p) + SSZ(HO/
 HOFFSET	../dbinc/db_page.h	/^#define	HOFFSET(p)	(((PAGE *)p)->hf_offset)$/
 HPAGE_PTYPE	../dbinc/db_page.h	/^#define	HPAGE_PTYPE(p)		(*(u_int8_t *)p)$/
 HPAGE_TYPE	../dbinc/db_page.h	/^#define	HPAGE_TYPE(dbp, pg, indx)	(*P_ENTRY(dbp, p/
-HPUX_MUTEX_PAD	../dbinc/mutex.h	131
-H_CONTINUE	../dbinc/hash.h	79
+H_CONTINUE	../dbinc/hash.h	/^#define	H_CONTINUE	0x0001		\/* Join--search strict/
 H_DATAINDEX	../dbinc/db_page.h	/^#define	H_DATAINDEX(indx)		((indx) + 1)$/
-H_DELETED	../dbinc/hash.h	80
-H_DIRTY	../dbinc/hash.h	81
-H_DUPLICATE	../dbinc/db_page.h	397
-H_DUPONLY	../dbinc/hash.h	82
-H_EXPAND	../dbinc/hash.h	83
-H_ISDUP	../dbinc/hash.h	84
-H_KEYDATA	../dbinc/db_page.h	396
+H_DELETED	../dbinc/hash.h	/^#define	H_DELETED	0x0002		\/* Cursor item is delet/
+H_DUPLICATE	../dbinc/db_page.h	/^#define	H_DUPLICATE	2	\/* Duplicate key\/data item/
+H_DUPONLY	../dbinc/hash.h	/^#define	H_DUPONLY	0x0004		\/* Dups only; do not ch/
+H_EXPAND	../dbinc/hash.h	/^#define	H_EXPAND	0x0008		\/* Table expanded. *\/$/
+H_ISDUP	../dbinc/hash.h	/^#define	H_ISDUP		0x0010		\/* Cursor is within dupl/
+H_KEYDATA	../dbinc/db_page.h	/^#define	H_KEYDATA	1	\/* Key\/data item. *\/$/
 H_KEYINDEX	../dbinc/db_page.h	/^#define	H_KEYINDEX(indx)		(indx)$/
-H_NEXT_NODUP	../dbinc/hash.h	85
-H_NOMORE	../dbinc/hash.h	86
+H_NEXT_NODUP	../dbinc/hash.h	/^#define	H_NEXT_NODUP	0x0020		\/* Get next non-dup /
+H_NOMORE	../dbinc/hash.h	/^#define	H_NOMORE	0x0040		\/* No more entries in bu/
 H_NUMPAIRS	../dbinc/db_page.h	/^#define	H_NUMPAIRS(pg)			(NUM_ENT(pg) \/ 2)$/
-H_OFFDUP	../dbinc/db_page.h	399
-H_OFFPAGE	../dbinc/db_page.h	398
-H_OK	../dbinc/hash.h	87
+H_OFFDUP	../dbinc/db_page.h	/^#define	H_OFFDUP	4	\/* Overflow page of duplicates/
+H_OFFPAGE	../dbinc/db_page.h	/^#define	H_OFFPAGE	3	\/* Overflow key\/data item. */
+H_OK	../dbinc/hash.h	/^#define	H_OK		0x0080		\/* Request succeeded. *\/$/
 H_PAIRDATA	../dbinc/db_page.h	/^#define	H_PAIRDATA(dbp, pg, indx)	P_ENTRY(dbp, pg,/
 H_PAIRKEY	../dbinc/db_page.h	/^#define	H_PAIRKEY(dbp, pg, indx)	P_ENTRY(dbp, pg, /
 H_PAIRSIZE	../dbinc/db_page.h	/^#define	H_PAIRSIZE(dbp, pg, psize, indx)				\\$/
-ILLEGAL_SIZE	../env/db_salloc.c	37
-INITIAL_DEAD_ALLOC	../lock/lock_deadlock.c	698
+ILLEGAL_SIZE	../env/db_salloc.c	/^#define	ILLEGAL_SIZE	1			\/* An illegal size. *\/$/
+INFOTYPE	../dbinc/tcl_db.h	/^enum INFOTYPE {$/
+INITIAL_ALLOCATION	../repmgr/repmgr_windows.c	/^#define	INITIAL_ALLOCATION 5		\/* arbitrary size */
+INITIAL_DEAD_ALLOC	../lock/lock_deadlock.c	/^#define	INITIAL_DEAD_ALLOC	8$/
+INITIAL_SITES_ALLOCATION	../repmgr/repmgr_util.c	/^#define	INITIAL_SITES_ALLOCATION	10		\/* Arbitrary/
 INIT_LSN	../dbinc/db_int.in	/^#define	INIT_LSN(LSN)		do {					\\$/
+INPROGRESS	../dbinc/repmgr.h	/^#define	INPROGRESS		WSAEWOULDBLOCK$/
 INP_OFFSET	../db/db_vrfy.c	/^#define	INP_OFFSET(dbp, h, i)	\\$/
-INT64_FMT	../dbinc/db_int.in	59
-INT64_MAX	../dbinc/db_int.in	55
-INT64_MIN	../dbinc/db_int.in	56
-INVALID_LSNMSG	../tcl/tcl_internal.c	525
-INVALID_ORDER	../dbinc/btree.h	59
-INVALID_REGION_ID	../dbinc/region.h	107
-INVALID_REGION_SEGID	../dbinc/region.h	119
-INVALID_ROFF	../dbinc/region.h	129
-IN_ELECTION	../dbinc/rep.h	/^#define	IN_ELECTION(R)		F_ISSET((R), REP_F_EPHASE1/
+INT64_MAX	../dbinc/db_int.in	/^#define	INT64_MAX	_I64_MAX$/
+INT64_MIN	../dbinc/db_int.in	/^#define	INT64_MIN	_I64_MIN$/
+INVALID_LSNMSG	../tcl/tcl_internal.c	/^#define	INVALID_LSNMSG "Invalid LSN with %d parts./
+INVALID_ORDER	../dbinc/btree.h	/^#define	INVALID_ORDER	0$/
+INVALID_REGION_ID	../dbinc/region.h	/^#define	INVALID_REGION_ID	0	\/* Out-of-band region/
+INVALID_REGION_SEGID	../dbinc/region.h	/^#define	INVALID_REGION_SEGID	-1	\/* Segment IDs ar/
+INVALID_ROFF	../dbinc/region.h	/^#define	INVALID_ROFF		0$/
+INVALID_SOCKET	../dbinc/repmgr.h	/^#define	INVALID_SOCKET		-1$/
+IN_ELECTION	../dbinc/rep.h	/^#define	IN_ELECTION(R)							\\$/
 IN_ELECTION_TALLY	../dbinc/rep.h	/^#define	IN_ELECTION_TALLY(R) \\$/
+IO_WAITER	../dbinc/mp.h	/^#define	IO_WAITER	0x001		\/* Thread is waiting on /
 ISBIG	../dbinc/hash.h	/^#define	ISBIG(I, N)	(((N) > ((I)->hdr->dbmeta.page/
 ISDOT	../clib/getcwd.c	/^#define	ISDOT(dp) \\$/
 ISINTERNAL	../dbinc/btree.h	/^#define	ISINTERNAL(p)	(TYPE(p) == P_IBTREE || TYPE/
 ISLEAF	../dbinc/btree.h	/^#define	ISLEAF(p)	(TYPE(p) == P_LBTREE ||				\\$/
-ISSET_MAP	../lock/lock_deadlock.c	/^#define	ISSET_MAP(M, N)	((M)[(N) \/ 32] & (1 << ((N/
-IS_AUTO_COMMIT	../dbinc/db_am.h	/^#define	IS_AUTO_COMMIT(dbenv, txn, flags)				\\$/
+ISSET_MAP	../lock/lock_deadlock.c	/^#define	ISSET_MAP(M, N)	((M)[(N) \/ 32] & (1 << ((/
 IS_BTREE_PAGE	../btree/bt_rec.c	/^#define	IS_BTREE_PAGE(pagep)						\\$/
 IS_CLIENT_PGRECOVER	../dbinc/rep.h	/^#define	IS_CLIENT_PGRECOVER(dbenv)					\\$/
 IS_CUR_DELETED	../btree/bt_cursor.c	/^#define	IS_CUR_DELETED(dbc)						\\$/
 IS_CUR_DUPLICATE	../btree/bt_cursor.c	/^#define	IS_CUR_DUPLICATE(dbc, orig_pgno, orig_indx/
+IS_DB_AUTO_COMMIT	../dbinc/db_am.h	/^#define	IS_DB_AUTO_COMMIT(dbp, txn)					\\$/
 IS_DELETED	../btree/bt_cursor.c	/^#define	IS_DELETED(dbp, page, indx)					\\$/
+IS_DIRTY	../dbinc/mp.h	/^#define	IS_DIRTY(p)							\\$/
 IS_DUPLICATE	../btree/bt_cursor.c	/^#define	IS_DUPLICATE(dbc, i1, i2)					\\$/
-IS_ENV_REPLICATED	../dbinc/rep.h	/^#define	IS_ENV_REPLICATED(E) (REP_ON(E) &&		\\$/
+IS_ENV_AUTO_COMMIT	../dbinc/db_am.h	/^#define	IS_ENV_AUTO_COMMIT(dbenv, txn, flags)				/
+IS_ENV_REPLICATED	../dbinc/rep.h	/^#define	IS_ENV_REPLICATED(dbenv)					\\$/
 IS_HELP	../dbinc/tcl_db.h	/^#define	IS_HELP(s)						\\$/
 IS_INITIALIZED	../dbinc/db_int.in	/^#define	IS_INITIALIZED(dbc)	((dbc)->internal->pgno/
 IS_INIT_LSN	../dbinc/db_int.in	/^#define	IS_INIT_LSN(LSN)	((LSN).file == 1 && (LSN)/
+IS_IN_RESTORE	../qam/qam_rec.c	/^#define	IS_IN_RESTORE(dbenv)						\\$/
 IS_MAX_LSN	../dbinc/db_int.in	/^#define	IS_MAX_LSN(LSN) \\$/
 IS_NOT_LOGGED_LSN	../dbinc/db_int.in	/^#define	IS_NOT_LOGGED_LSN(LSN) \\$/
-IS_READONLY	../db/db_iface.c	/^#define	IS_READONLY(dbp)						\\$/
+IS_PEER_POLICY	../dbinc/repmgr.h	/^#define	IS_PEER_POLICY(p) ((p) == DB_REPMGR_ACKS_A/
+IS_PHASE1_DONE	../rep/rep_elect.c	/^#define	IS_PHASE1_DONE(rep)    \\$/
+IS_REAL_TXN	../dbinc/db_int.in	/^#define	IS_REAL_TXN(txn)						\\$/
 IS_RECOVERING	../dbinc/db_int.in	/^#define	IS_RECOVERING(dbenv)						\\$/
-IS_REPLICATED	../dbinc/rep.h	/^#define	IS_REPLICATED(E, D)						\\$/
 IS_REP_CLIENT	../dbinc/rep.h	/^#define	IS_REP_CLIENT(dbenv)						\\$/
 IS_REP_MASTER	../dbinc/rep.h	/^#define	IS_REP_MASTER(dbenv)						\\$/
 IS_SUBTRANSACTION	../dbinc/db_int.in	/^#define	IS_SUBTRANSACTION(txn)						\\$/
+IS_VALID_EID	../dbinc/repmgr.h	/^#define	IS_VALID_EID(e)		((e) >= 0)$/
 IS_VALID_PAGESIZE	../dbinc/db_int.in	/^#define	IS_VALID_PAGESIZE(x)						\\$/
 IS_VALID_PGNO	../dbinc/db_verify.h	/^#define	IS_VALID_PGNO(x)	((x) <= vdp->last_pgno)$/
 IS_WRITELOCK	../dbinc/lock.h	/^#define	IS_WRITELOCK(m) \\$/
 IS_ZERO_LSN	../dbinc/db_int.in	/^#define	IS_ZERO_LSN(LSN)	((LSN).file == 0 && (LSN)/
+I_HAVE_WON	../rep/rep_elect.c	/^#define	I_HAVE_WON(rep, winner)   \\$/
 JAVADB_STAT_ACTIVE	../libdb_java/db_java_wrap.c	/^#define JAVADB_STAT_ACTIVE(jenv, cl, jobj, statp, /
 JAVADB_STAT_INT	../libdb_java/db_java_wrap.c	/^#define JAVADB_STAT_INT(jenv, jobj, fid, statp, na/
 JAVADB_STAT_LONG	../libdb_java/db_java_wrap.c	/^#define JAVADB_STAT_LONG(jenv, jobj, fid, statp, n/
 JAVADB_STAT_LSN	../libdb_java/db_java_wrap.c	/^#define JAVADB_STAT_LSN(jenv, jobj, fid, statp, na/
 JAVADB_STAT_STRING	../libdb_java/db_java_wrap.c	/^#define JAVADB_STAT_STRING(jenv, jobj, fid, statp,/
 JAVADB_STAT_XID	../libdb_java/db_java_wrap.c	/^#define JAVADB_STAT_XID(jenv, jobj, fid, statp, na/
-JDBENV	../libdb_java/db_java_wrap.c	811
-JOIN_RETRY	../dbinc/db_join.h	27
+JDBENV	../libdb_java/db_java_wrap.c	/^#define	JDBENV (arg1 ? (jobject)DB_ENV_INTERNAL(ar/
+JOIN_CURSOR	../dbinc/db_join.h	/^} JOIN_CURSOR;$/
+JOIN_RETRY	../dbinc/db_join.h	/^#define	JOIN_RETRY	0x01	\/* Error on primary get; /
 Java_com_sleepycat_db_internal_DbUtil_is_1big_1endian	../libdb_java/db_java_wrap.c	/^Java_com_sleepycat_db_internal_DbUtil_is_1big_1end/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1close0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1dbremove	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1dbrename	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1err	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1errx	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1cachesize	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1cachesize_1ncache	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1data_1dirs	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1encrypt_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1errpfx	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1home	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lg_1bsize	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lg_1dir	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lg_1max	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lg_1regionmax	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1conflicts	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1detect	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1max_1lockers	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1max_1locks	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1max_1objects	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1mp_1mmapsize	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1open_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1rep_1limit	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1shm_1key	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1tas_1spins	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1timeout	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1tmp_1dir	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1tx_1max	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1tx_1timestamp	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1verbose	../libdb_java/db_java_wrap.c	/^JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_i/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1version_1major	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1version_1minor	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1version_1patch	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1version_1string	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1detect	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1get	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1id	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1id_1free	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1put	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1stat	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobject JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1vec	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1archive	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1compare	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1cursor	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1file	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1flush	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1put	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1stat	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobject JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1memp_1fstat	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1memp_1stat	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobject JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1memp_1trickle	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1open	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1remove0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1elect	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1process_1message	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1start	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1stat	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobject JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1app_1dispatch	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1cachesize	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1data_1dir	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1encrypt	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1errcall	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1errpfx	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1feedback	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lg_1bsize	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lg_1dir	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lg_1max	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lg_1regionmax	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1conflicts	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1detect	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1max_1lockers	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1max_1locks	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1max_1objects	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1mp_1mmapsize	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1msgcall	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1paniccall	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1rep_1limit	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1rep_1transport	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1rpc_1server	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1shm_1key	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1tas_1spins	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1timeout	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1tmp_1dir	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1tx_1max	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1tx_1timestamp0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1verbose	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1strerror	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1txn_1begin	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1txn_1checkpoint	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1txn_1recover	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1txn_1stat	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobject JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbLogc_1close0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbLogc_1get	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1get_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1get_1maxsize	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1get_1priority	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1set_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1set_1maxsize	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1set_1priority	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1close0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1cachesize	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1db	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1key	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1range_1max	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1range_1min	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1initial_1value	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1open	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1remove0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1set_1cachesize	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1set_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1set_1range	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1stat	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobject JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1abort0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1commit0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1discard0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1id	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1prepare	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1set_1timeout	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1associate	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1close0	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1cursor	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1del	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1err	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1errx	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1bt_1minkey	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1byteswapped	../libdb_java/db_java_wrap.c	/^JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_i/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1cachesize	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1cachesize_1ncache	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1dbname	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1encrypt_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1errpfx	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1filename	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1h_1ffactor	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1h_1nelem	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1lorder	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1mpf	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1open_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1pagesize	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1q_1extentsize	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1re_1delim	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1re_1len	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1re_1pad	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1re_1source	../libdb_java/db_java_wrap.c	/^JNIEXPORT jstring JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1transactional	../libdb_java/db_java_wrap.c	/^JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_i/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1type	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1join	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1key_1range	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1open	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1pget	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1put	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1remove0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1rename0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1append_1recno	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1bt_1compare	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1bt_1maxkey	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1bt_1minkey	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1bt_1prefix	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1cachesize	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1dup_1compare	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1encrypt	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1errpfx	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1feedback	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1flags	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1h_1ffactor	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1h_1hash	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1h_1nelem	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1lorder	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1pagesize	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1q_1extentsize	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1re_1delim	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1re_1len	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1re_1pad	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1re_1source	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1stat	../libdb_java/db_java_wrap.c	/^JNIEXPORT jobject JNICALL Java_com_sleepycat_db_in/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1sync	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1truncate	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1upgrade	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Db_1verify0	../libdb_java/db_java_wrap.c	/^JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_i/
-Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1close0	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1count	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1del	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1dup	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1get	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1pget	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
-Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1put	../libdb_java/db_java_wrap.c	/^JNIEXPORT jint JNICALL Java_com_sleepycat_db_inter/
+Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1vec	../libdb_java/db_java_wrap.c	/^Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1/
 Java_com_sleepycat_db_internal_db_1javaJNI_deleteRef0	../libdb_java/db_java_wrap.c	/^Java_com_sleepycat_db_internal_db_1javaJNI_deleteR/
-Java_com_sleepycat_db_internal_db_1javaJNI_delete_1DbLock	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
 Java_com_sleepycat_db_internal_db_1javaJNI_getDbEnv0	../libdb_java/db_java_wrap.c	/^Java_com_sleepycat_db_internal_db_1javaJNI_getDbEn/
 Java_com_sleepycat_db_internal_db_1javaJNI_initDbEnvRef0	../libdb_java/db_java_wrap.c	/^Java_com_sleepycat_db_internal_db_1javaJNI_initDbE/
 Java_com_sleepycat_db_internal_db_1javaJNI_initDbRef0	../libdb_java/db_java_wrap.c	/^Java_com_sleepycat_db_internal_db_1javaJNI_initDbR/
-Java_com_sleepycat_db_internal_db_1javaJNI_initialize	../libdb_java/db_java_wrap.c	/^Java_com_sleepycat_db_internal_db_1javaJNI_initial/
-Java_com_sleepycat_db_internal_db_1javaJNI_new_1Db	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_new_1DbEnv	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-Java_com_sleepycat_db_internal_db_1javaJNI_new_1DbSequence	../libdb_java/db_java_wrap.c	/^JNIEXPORT jlong JNICALL Java_com_sleepycat_db_inte/
-LASTCKP_CMP	../dbinc/log.h	362
-LCK_ALWAYS	../dbinc/db_am.h	114
-LCK_COUPLE	../dbinc/db_am.h	115
-LCK_COUPLE_ALWAYS	../dbinc/db_am.h	116
-LCK_DOWNGRADE	../dbinc/db_am.h	117
-LCK_ROLLBACK	../dbinc/db_am.h	118
-LEAFLEVEL	../dbinc/db_page.h	240
+Java_com_sleepycat_db_internal_db_1javaJNI_initialize	../libdb_java/db_java_wrap.c	/^JNIEXPORT void JNICALL Java_com_sleepycat_db_inter/
+LASTCKP_CMP	../dbinc/log.h	/^#define	LASTCKP_CMP	1$/
+LCK_ALWAYS	../dbinc/db_am.h	/^#define	LCK_ALWAYS		1	\/* Lock even for off page d/
+LCK_COUPLE	../dbinc/db_am.h	/^#define	LCK_COUPLE		2	\/* Lock Couple *\/$/
+LCK_COUPLE_ALWAYS	../dbinc/db_am.h	/^#define	LCK_COUPLE_ALWAYS	3	\/* Lock Couple even i/
+LCK_DOWNGRADE	../dbinc/db_am.h	/^#define	LCK_DOWNGRADE		4	\/* Downgrade the lock. (/
+LCK_ROLLBACK	../dbinc/db_am.h	/^#define	LCK_ROLLBACK		5	\/* Lock even if in rollba/
+LEAFLEVEL	../dbinc/db_page.h	/^#define	LEAFLEVEL	  1$/
 LEN_HDATA	../dbinc/db_page.h	/^#define	LEN_HDATA(dbp, p, psize, indx)					\\$/
 LEN_HITEM	../dbinc/db_page.h	/^#define	LEN_HITEM(dbp, pg, pgsize, indx)				\\$/
 LEN_HKEY	../dbinc/db_page.h	/^#define	LEN_HKEY(dbp, p, psize, indx)					\\$/
 LEN_HKEYDATA	../dbinc/db_page.h	/^#define	LEN_HKEYDATA(dbp, pg, psize, indx)				\\$/
 LEVEL	../dbinc/db_page.h	/^#define	LEVEL(p)	(((PAGE *)p)->level)$/
-LFNAME	../dbinc/log.h	64
-LFNAME_V1	../dbinc/log.h	65
-LFPREFIX	../dbinc/log.h	63
+LFNAME	../dbinc/log.h	/^#define	LFNAME		"log.%010d"	\/* Log file name temp/
+LFNAME_V1	../dbinc/log.h	/^#define	LFNAME_V1	"log.%05d"	\/* Log file name tem/
+LFPREFIX	../dbinc/log.h	/^#define	LFPREFIX	"log."		\/* Log file name prefix./
 LF_CLR	../dbinc/db_int.in	/^#define	LF_CLR(f)		((flags) &= ~(f))$/
 LF_ISSET	../dbinc/db_int.in	/^#define	LF_ISSET(f)		((flags) & (f))$/
 LF_SET	../dbinc/db_int.in	/^#define	LF_SET(f)		((flags) |= (f))$/
-LG_BASE_REGION_SIZE	../dbinc/log.h	71
-LG_BSIZE_DEFAULT	../dbinc/log.h	69
-LG_BSIZE_INMEM	../dbinc/log.h	70
-LG_MAINT_SIZE	../dbinc/log.h	277
-LG_MAX_DEFAULT	../dbinc/log.h	67
-LG_MAX_INMEM	../dbinc/log.h	68
+LG_BASE_REGION_SIZE	../dbinc/log.h	/^#define	LG_BASE_REGION_SIZE	(65000)		\/* 64KB - 53/
+LG_BSIZE_DEFAULT	../dbinc/log.h	/^#define	LG_BSIZE_DEFAULT	(32000)		\/* 32 KB - 768B/
+LG_BSIZE_INMEM	../dbinc/log.h	/^#define	LG_BSIZE_INMEM		(1 * MEGABYTE)	\/* 1 MB. */
+LG_CURSOR_BUF_SIZE	../dbinc/log.h	/^#define	LG_CURSOR_BUF_SIZE	(32000)		\/* 32KB - 768/
+LG_MAX_DEFAULT	../dbinc/log.h	/^#define	LG_MAX_DEFAULT		(10 * MEGABYTE)	\/* 10 MB./
+LG_MAX_INMEM	../dbinc/log.h	/^#define	LG_MAX_INMEM		(256 * 1024)	\/* 256 KB. *\//
 LIST_EMPTY	../dbinc/queue.h	/^#define	LIST_EMPTY(head)	((head)->lh_first == NULL/
 LIST_ENTRY	../dbinc/queue.h	/^#define	LIST_ENTRY(type)						\\$/
 LIST_FIRST	../dbinc/queue.h	/^#define	LIST_FIRST(head)	((head)->lh_first)$/
 LIST_FOREACH	../dbinc/queue.h	/^#define	LIST_FOREACH(var, head, field)					\\$/
 LIST_HEAD	../dbinc/queue.h	/^#define	LIST_HEAD(name, type)						\\$/
 LIST_HEAD_INITIALIZER	../dbinc/queue.h	/^#define	LIST_HEAD_INITIALIZER(head)					\\$/
-LIST_INCREMENT	../log/log_archive.c	209
+LIST_INCREMENT	../log/log_archive.c	/^#define	LIST_INCREMENT	64$/
 LIST_INIT	../dbinc/queue.h	/^#define	LIST_INIT(head) do {						\\$/
 LIST_INSERT_AFTER	../dbinc/queue.h	/^#define	LIST_INSERT_AFTER(listelm, elm, field) do /
 LIST_INSERT_BEFORE	../dbinc/queue.h	/^#define	LIST_INSERT_BEFORE(listelm, elm, field) do/
 LIST_INSERT_HEAD	../dbinc/queue.h	/^#define	LIST_INSERT_HEAD(head, elm, field) do {			/
 LIST_NEXT	../dbinc/queue.h	/^#define	LIST_NEXT(elm, field)	((elm)->field.le_nex/
 LIST_REMOVE	../dbinc/queue.h	/^#define	LIST_REMOVE(elm, field) do {					\\$/
-LOAD_ACTUAL_MUTEX_CODE	../mutex/mut_tas.c	22
+LOAD_ACTUAL_MUTEX_CODE	../mutex/mut_tas.c	/^#define	LOAD_ACTUAL_MUTEX_CODE$/
 LOCKER_LOCK	../dbinc/lock.h	/^#define	LOCKER_LOCK(lt, reg, locker, ndx)				\\$/
 LOCKING_ON	../dbinc/db_int.in	/^#define	LOCKING_ON(dbenv)	((dbenv)->lk_handle != N/
-LOCKREGION	../dbinc/lock.h	/^#define	LOCKREGION(dbenv, lt)  R_LOCK((dbenv), &((/
 LOCK_INIT	../dbinc/lock.h	/^#define	LOCK_INIT(lock)		((lock).off = LOCK_INVALI/
-LOCK_INVALID	../dbinc/lock.h	27
+LOCK_INVALID	../dbinc/lock.h	/^#define	LOCK_INVALID		INVALID_ROFF$/
 LOCK_ISSET	../dbinc/lock.h	/^#define	LOCK_ISSET(lock)	((lock).off != LOCK_INVAL/
+LOCK_MUTEX	../dbinc/repmgr.h	/^#define	LOCK_MUTEX(m) do {						\\$/
 LOCK_SET_TIME_INVALID	../dbinc/lock.h	/^#define	LOCK_SET_TIME_INVALID(time)	((time)->tv_se/
 LOCK_SET_TIME_MAX	../dbinc/lock.h	/^#define	LOCK_SET_TIME_MAX(time)		((time)->tv_sec =/
+LOCK_SYSTEM_LOCK	../dbinc/lock.h	/^#define	LOCK_SYSTEM_LOCK(dbenv)						\\$/
+LOCK_SYSTEM_UNLOCK	../dbinc/lock.h	/^#define	LOCK_SYSTEM_UNLOCK(dbenv)					\\$/
 LOCK_TIME_EQUAL	../dbinc/lock.h	/^#define	LOCK_TIME_EQUAL(t1, t2)						\\$/
 LOCK_TIME_GREATER	../dbinc/lock.h	/^#define	LOCK_TIME_GREATER(t1, t2)					\\$/
 LOCK_TIME_ISMAX	../dbinc/lock.h	/^#define	LOCK_TIME_ISMAX(time)		((time)->tv_sec == /
 LOCK_TIME_ISVALID	../dbinc/lock.h	/^#define	LOCK_TIME_ISVALID(time)		((time)->tv_sec !/
 LOFFSET	../dbinc/db_page.h	/^#define	LOFFSET(dbp, pg)						\\$/
-LOG	../dbinc/log.h	60
+LOG	../dbinc/log.h	/^struct __log;		typedef struct __log LOG;$/
 LOGGING_ON	../dbinc/db_int.in	/^#define	LOGGING_ON(dbenv)	((dbenv)->lg_handle != N/
-LOGP	../dbinc/log.h	61
+LOGP	../dbinc/log.h	/^struct __log_persist;	typedef struct __log_persist/
+LOG_COMPARE	../dbinc/db_int.in	/^#define	LOG_COMPARE(lsn0, lsn1)						\\$/
+LOG_HDR_SUM	../dbinc/log.h	/^#define	LOG_HDR_SUM(crypto, hdr, sum) do {				\\$/
 LOG_OP	../dbinc/debug.h	/^#define	LOG_OP(C, T, O, K, A, F) {					\\$/
-LOWER_MASK	../crypto/mersenne/mt19937db.c	41
+LOG_SYSTEM_LOCK	../dbinc/log.h	/^#define	LOG_SYSTEM_LOCK(dbenv)						\\$/
+LOG_SYSTEM_UNLOCK	../dbinc/log.h	/^#define	LOG_SYSTEM_UNLOCK(dbenv)					\\$/
+LOWER_MASK	../crypto/mersenne/mt19937db.c	/^#define LOWER_MASK 0x7fffffff \/* least significan/
 LSN	../dbinc/db_page.h	/^#define	LSN(p)		(((PAGE *)p)->lsn)$/
+LSN_COLLECTION	../dbinc/rep.h	/^} LSN_COLLECTION;$/
 LSN_NOT_LOGGED	../dbinc/db_int.in	/^#define	LSN_NOT_LOGGED(LSN) do {					\\$/
-M	../crypto/mersenne/mt19937db.c	38
+M	../crypto/mersenne/mt19937db.c	/^#define M 397$/
+MAKE_INMEM	../dbinc/fop.h	/^#define	MAKE_INMEM(D) do {					\\$/
 MAKE_STAT_LIST	../dbinc/tcl_db.h	/^#define	MAKE_STAT_LIST(s, v) do {					\\$/
 MAKE_STAT_LSN	../dbinc/tcl_db.h	/^#define	MAKE_STAT_LSN(s, lsn) do {					\\$/
 MAKE_STAT_STRLIST	../dbinc/tcl_db.h	/^#define	MAKE_STAT_STRLIST(s,s1) do {					\\$/
 MAKE_WSTAT_LIST	../dbinc/tcl_db.h	/^#define	MAKE_WSTAT_LIST(s, v) do {					\\$/
-MAP_FAILED	../mutex/tm.c	734
-MAP_FILE	../mutex/tm.c	737
-MASTER_CHECK	../rep/rep_record.c	/^#define	MASTER_CHECK(dbenv, eid, rep) do {				\\$/
+MAP_FAILED	../mutex/tm.c	/^#define	MAP_FAILED	(void *)-1$/
+MAP_FILE	../mutex/tm.c	/^#define	MAP_FILE	0$/
 MASTER_ONLY	../rep/rep_record.c	/^#define	MASTER_ONLY(rep, rp) do {					\\$/
 MASTER_UPDATE	../rep/rep_record.c	/^#define	MASTER_UPDATE(dbenv, renv) do {					\\$/
-MATRIX_A	../crypto/mersenne/mt19937db.c	39
-MAXARGS	../common/util_arg.c	34
-MAXBQUALSIZE	../dbinc/xa.h	22
-MAXBTREELEVEL	../dbinc/db_page.h	241
-MAXGTRIDSIZE	../dbinc/xa.h	21
-MAXINFOSIZE	../dbinc/xa.h	46
-MAXKB	../crypto/rijndael/rijndael-alg-fst.h	33
-MAXKC	../crypto/rijndael/rijndael-alg-fst.h	32
-MAXNR	../crypto/rijndael/rijndael-alg-fst.h	34
-MAXPATHLEN	../dbinc/db_int.in	277
-MAX_ID	../dbinc/tcl_db.h	19
-MAX_IV_SIZE	../crypto/rijndael/rijndael-api-fst.h	71
-MAX_KEY_SIZE	../crypto/rijndael/rijndael-api-fst.h	70
+MATRIX_A	../crypto/mersenne/mt19937db.c	/^#define MATRIX_A 0x9908b0df   \/* constant vector /
+MAXARGS	../common/util_arg.c	/^#define	MAXARGS	25$/
+MAXBQUALSIZE	../dbinc/xa.h	/^#define	MAXBQUALSIZE	 64		\/* maximum size in byte/
+MAXBTREELEVEL	../dbinc/db_page.h	/^#define	MAXBTREELEVEL	255$/
+MAXGTRIDSIZE	../dbinc/xa.h	/^#define	MAXGTRIDSIZE	 64		\/* maximum size in byte/
+MAXHOSTNAMELEN	../dbinc/repmgr.h	/^#define	MAXHOSTNAMELEN	256$/
+MAXINFOSIZE	../dbinc/xa.h	/^#define	MAXINFOSIZE	256		\/* maximum size in bytes/
+MAXKB	../crypto/rijndael/rijndael-alg-fst.h	/^#define MAXKB	(256\/8)$/
+MAXKC	../crypto/rijndael/rijndael-alg-fst.h	/^#define MAXKC	(256\/32)$/
+MAXNR	../crypto/rijndael/rijndael-alg-fst.h	/^#define MAXNR	14$/
+MAX_ID	../dbinc/tcl_db.h	/^#define	MAX_ID		8	\/* Maximum number of sub-id's w/
+MAX_IV_SIZE	../crypto/rijndael/rijndael-api-fst.h	/^#define     MAX_IV_SIZE          16 \/* # bytes ne/
+MAX_KEY_SIZE	../crypto/rijndael/rijndael-api-fst.h	/^#define     MAX_KEY_SIZE         64 \/* # of ASCII/
 MAX_LSN	../dbinc/db_int.in	/^#define	MAX_LSN(LSN) do {						\\$/
-MAX_LSN_TO_TEXT	../db/db.c	1010
-MAX_PAGE_NUMBER	../dbinc/db_185.in	79
-MAX_PAGE_OFFSET	../dbinc/db_185.in	81
-MAX_PGNOS	../lock/lock_list.c	54
-MAX_REC_NUMBER	../dbinc/db_185.in	83
-MEGABYTE	../dbinc/db_int.in	76
-MINFILL	../dbinc/hash.h	106
-MODE_CBC	../crypto/rijndael/rijndael-api-fst.h	50
-MODE_CFB1	../crypto/rijndael/rijndael-api-fst.h	51
-MODE_ECB	../crypto/rijndael/rijndael-api-fst.h	49
+MAX_LSN_TO_TEXT	../db/db.c	/^#define	MAX_LSN_TO_TEXT	17$/
+MAX_PAGE_NUMBER	../dbinc/db_185.in	/^#define	MAX_PAGE_NUMBER	0xffffffff	\/* >= # of pag/
+MAX_PAGE_OFFSET	../dbinc/db_185.in	/^#define	MAX_PAGE_OFFSET	65535		\/* >= # of bytes i/
+MAX_PGNOS	../lock/lock_list.c	/^#define	MAX_PGNOS	0xffff$/
+MAX_REC_NUMBER	../dbinc/db_185.in	/^#define	MAX_REC_NUMBER	0xffffffff	\/* >= # of reco/
+MAX_SITE_LOC_STRING	../dbinc/repmgr.h	/^#define	MAX_SITE_LOC_STRING (MAXHOSTNAMELEN+20)$/
+MEGABYTE	../dbinc/db_int.in	/^#define	MEGABYTE	1048576$/
+MEM_ALIGN	../repmgr/repmgr_sel.c	/^#define	MEM_ALIGN sizeof(double)$/
+MINFILL	../dbinc/hash.h	/^#define	MINFILL		4$/
+MODE_CBC	../crypto/rijndael/rijndael-api-fst.h	/^#define     MODE_CBC              2 \/*  Are we ci/
+MODE_CFB1	../crypto/rijndael/rijndael-api-fst.h	/^#define     MODE_CFB1             3 \/*  Are we ci/
+MODE_ECB	../crypto/rijndael/rijndael-api-fst.h	/^#define     MODE_ECB              1 \/*  Are we ci/
+MPFARRAY	../dbinc/qam.h	/^} MPFARRAY;$/
 MPF_ILLEGAL_AFTER_OPEN	../dbinc/mp.h	/^#define	MPF_ILLEGAL_AFTER_OPEN(dbmfp, name)				\\$/
-MPF_ILLEGAL_BEFORE_OPEN	../dbinc/mp.h	/^#define	MPF_ILLEGAL_BEFORE_OPEN(dbmfp, name)				\\$/
-MPOOL	../dbinc/mp.h	16
-MPOOLFILE	../dbinc/db.in	160
-MPOOL_BASE_DECREMENT	../dbinc/mp.h	203
+MPF_ILLEGAL_BEFORE_OPEN	../dbinc/mp.h	/^#define	MPF_ILLEGAL_BEFORE_OPEN(dbmfp, name)				\\/
+MPOOL	../dbinc/mp.h	/^struct __mpool;		typedef struct __mpool MPOOL;$/
+MPOOLFILE	../dbinc/db.in	/^struct __mpoolfile;	typedef struct __mpoolfile MPO/
+MPOOL_BASE_DECREMENT	../dbinc/mp.h	/^#define	MPOOL_BASE_DECREMENT	(UINT32_MAX - (UINT32/
+MPOOL_FILE_BUCKETS	../dbinc/mp.h	/^#define	MPOOL_FILE_BUCKETS	17$/
 MPOOL_ON	../dbinc/db_int.in	/^#define	MPOOL_ON(dbenv)		((dbenv)->mp_handle != NU/
-MPOOL_PRI_DEFAULT	../dbinc/mp.h	211
-MPOOL_PRI_DIRTY	../dbinc/mp.h	213
-MPOOL_PRI_HIGH	../dbinc/mp.h	212
-MPOOL_PRI_LOW	../dbinc/mp.h	210
-MPOOL_PRI_VERY_HIGH	../dbinc/mp.h	214
-MPOOL_PRI_VERY_LOW	../dbinc/mp.h	209
-MP_CAN_MMAP	../dbinc/mp.h	302
-MP_DIRECT	../dbinc/mp.h	303
-MP_DURABLE_UNKNOWN	../dbinc/mp.h	304
-MP_EXTENT	../dbinc/mp.h	305
-MP_FAKE_DEADFILE	../dbinc/mp.h	306
-MP_FAKE_FILEWRITTEN	../dbinc/mp.h	307
-MP_FAKE_NB	../dbinc/mp.h	308
-MP_FAKE_UOC	../dbinc/mp.h	309
-MP_FILEID_SET	../dbinc/db.in	735
-MP_FLUSH	../dbinc/db.in	736
-MP_NOT_DURABLE	../dbinc/mp.h	310
-MP_OPEN_CALLED	../dbinc/db.in	737
-MP_READONLY	../dbinc/db.in	738
-MP_TEMP	../dbinc/mp.h	311
-MSG	../mutex/mut_fcntl.c	151
-MSG1	../mutex/mut_pthread.c	23
-MSG2	../mutex/mut_pthread.c	25
-MSG_SIZE	../dbinc/tcl_db.h	13
-MS_PER_SEC	../dbinc/db_int.in	79
-MT_FILE	../mutex/tm.c	42
-MT_FILE_QUIT	../mutex/tm.c	43
-MUTEX_ALIGN	../dbinc/mutex.h	82
-MUTEX_ALLOC	../dbinc/mutex.h	830
-MUTEX_CLEAR	../dbinc/mutex.h	/^#define	MUTEX_CLEAR(mp) {						\\$/
-MUTEX_DESTROY	../dbinc/mutex.h	/^#define	MUTEX_DESTROY(x) sema_destroy(x)$/
-MUTEX_FIELDS	../dbinc/mutex.h	26
-MUTEX_IGNORE	../dbinc/mutex.h	831
-MUTEX_INIT	../dbinc/mutex.h	/^#define	MUTEX_INIT(x)	0$/
-MUTEX_INITED	../dbinc/mutex.h	832
-MUTEX_LOCK	../dbinc/mutex.h	/^#define	MUTEX_LOCK(dbenv, mp)						\\$/
-MUTEX_LOGICAL_LOCK	../dbinc/mutex.h	833
-MUTEX_MPOOL	../dbinc/mutex.h	834
-MUTEX_NO_MALLOC_LOCKS	../dbinc/mutex.h	126
-MUTEX_NO_RECORD	../dbinc/mutex.h	835
-MUTEX_NO_RLOCK	../dbinc/mutex.h	836
-MUTEX_NO_SHMGET_LOCKS	../dbinc/mutex.h	127
-MUTEX_PAUSE	../dbinc/mutex.h	364
-MUTEX_SELF_BLOCK	../dbinc/mutex.h	837
-MUTEX_SET	../dbinc/mutex.h	/^#define	MUTEX_SET(x)	(!_check_lock(x, 0, 1))$/
-MUTEX_SET_TEST	../dbinc/mutex.h	380
-MUTEX_THREAD	../dbinc/mutex.h	838
-MUTEX_THREAD_LOCK	../dbinc/mutex.h	/^#define	MUTEX_THREAD_LOCK(dbenv, mp)					\\$/
-MUTEX_THREAD_UNLOCK	../dbinc/mutex.h	/^#define	MUTEX_THREAD_UNLOCK(dbenv, mp)					\\$/
-MUTEX_UNLOCK	../dbinc/mutex.h	/^#define	MUTEX_UNLOCK(dbenv, mp)						\\$/
-MUTEX_UNSET	../dbinc/mutex.h	/^#define	MUTEX_UNSET(x)	_clear_lock(x, 0)$/
-MUTEX_WAKEME	../mutex/tm.c	58
+MPOOL_PRI_DEFAULT	../dbinc/mp.h	/^#define	MPOOL_PRI_DEFAULT	0	\/* No adjustment -- s/
+MPOOL_PRI_DIRTY	../dbinc/mp.h	/^#define	MPOOL_PRI_DIRTY		10	\/* Dirty gets a 10% b/
+MPOOL_PRI_HIGH	../dbinc/mp.h	/^#define	MPOOL_PRI_HIGH		10	\/* With the dirty buff/
+MPOOL_PRI_LOW	../dbinc/mp.h	/^#define	MPOOL_PRI_LOW		-2	\/* Low. *\/$/
+MPOOL_PRI_VERY_HIGH	../dbinc/mp.h	/^#define	MPOOL_PRI_VERY_HIGH	1	\/* Add number of bu/
+MPOOL_PRI_VERY_LOW	../dbinc/mp.h	/^#define	MPOOL_PRI_VERY_LOW	-1	\/* Dead duck.  Chec/
+MPOOL_REGION_LOCK	../dbinc/mp.h	/^#define	MPOOL_REGION_LOCK(dbenv, infop)					\\$/
+MPOOL_REGION_UNLOCK	../dbinc/mp.h	/^#define	MPOOL_REGION_UNLOCK(dbenv, infop)				\\$/
+MPOOL_SYSTEM_LOCK	../dbinc/mp.h	/^#define	MPOOL_SYSTEM_LOCK(dbenv)					\\$/
+MPOOL_SYSTEM_UNLOCK	../dbinc/mp.h	/^#define	MPOOL_SYSTEM_UNLOCK(dbenv)					\\$/
+MP_CAN_MMAP	../dbinc/mp.h	/^#define	MP_CAN_MMAP		0x001	\/* If the file can be /
+MP_DIRECT	../dbinc/mp.h	/^#define	MP_DIRECT		0x002	\/* No OS buffering. *\/$/
+MP_DURABLE_UNKNOWN	../dbinc/mp.h	/^#define	MP_DURABLE_UNKNOWN	0x004	\/* We don't care/
+MP_EXTENT	../dbinc/mp.h	/^#define	MP_EXTENT		0x008	\/* Extent file. *\/$/
+MP_FAKE_DEADFILE	../dbinc/mp.h	/^#define	MP_FAKE_DEADFILE	0x010	\/* Deadfile field:/
+MP_FAKE_FILEWRITTEN	../dbinc/mp.h	/^#define	MP_FAKE_FILEWRITTEN	0x020	\/* File_written/
+MP_FAKE_NB	../dbinc/mp.h	/^#define	MP_FAKE_NB		0x040	\/* No_backing_file fiel/
+MP_FAKE_UOC	../dbinc/mp.h	/^#define	MP_FAKE_UOC		0x080	\/* Unlink_on_close fie/
+MP_FILEID_SET	../dbinc/db.in	/^#define	MP_FILEID_SET	0x001		\/* Application suppl/
+MP_FLUSH	../dbinc/db.in	/^#define	MP_FLUSH	0x002		\/* Was opened to flush a /
+MP_MULTIVERSION	../dbinc/db.in	/^#define	MP_MULTIVERSION	0x004		\/* Opened for mult/
+MP_NOT_DURABLE	../dbinc/mp.h	/^#define	MP_NOT_DURABLE		0x100	\/* File is not dura/
+MP_OPEN_CALLED	../dbinc/db.in	/^#define	MP_OPEN_CALLED	0x008		\/* File opened. *\//
+MP_READONLY	../dbinc/db.in	/^#define	MP_READONLY	0x010		\/* File is readonly. */
+MP_TEMP	../dbinc/mp.h	/^#define	MP_TEMP			0x200	\/* Backing file is a temp/
+MP_TRUNC_RECOVER	../dbinc/mp.h	/^#define	MP_TRUNC_RECOVER	0x01$/
+MSG_SIZE	../dbinc/tcl_db.h	/^#define	MSG_SIZE 100		\/* Message size *\/$/
+MS_PER_SEC	../dbinc/db_int.in	/^#define	MS_PER_SEC	1000		\/* Milliseconds in a sec/
+MTX_APPLICATION	../dbinc/mutex.h	/^#define	MTX_APPLICATION		 1$/
+MTX_DB_HANDLE	../dbinc/mutex.h	/^#define	MTX_DB_HANDLE		 2$/
+MTX_ENV_DBLIST	../dbinc/mutex.h	/^#define	MTX_ENV_DBLIST		 3$/
+MTX_ENV_REGION	../dbinc/mutex.h	/^#define	MTX_ENV_REGION		 4$/
+MTX_LOCK_REGION	../dbinc/mutex.h	/^#define	MTX_LOCK_REGION		 5$/
+MTX_LOGICAL_LOCK	../dbinc/mutex.h	/^#define	MTX_LOGICAL_LOCK	 6$/
+MTX_LOG_FILENAME	../dbinc/mutex.h	/^#define	MTX_LOG_FILENAME	 7$/
+MTX_LOG_FLUSH	../dbinc/mutex.h	/^#define	MTX_LOG_FLUSH		 8$/
+MTX_LOG_HANDLE	../dbinc/mutex.h	/^#define	MTX_LOG_HANDLE		 9$/
+MTX_LOG_REGION	../dbinc/mutex.h	/^#define	MTX_LOG_REGION		10$/
+MTX_MAX_ENTRY	../dbinc/mutex.h	/^#define	MTX_MAX_ENTRY		28$/
+MTX_MPOOLFILE_HANDLE	../dbinc/mutex.h	/^#define	MTX_MPOOLFILE_HANDLE	11$/
+MTX_MPOOL_FH	../dbinc/mutex.h	/^#define	MTX_MPOOL_FH		12$/
+MTX_MPOOL_FILE_BUCKET	../dbinc/mutex.h	/^#define	MTX_MPOOL_FILE_BUCKET	13$/
+MTX_MPOOL_HANDLE	../dbinc/mutex.h	/^#define	MTX_MPOOL_HANDLE	14$/
+MTX_MPOOL_HASH_BUCKET	../dbinc/mutex.h	/^#define	MTX_MPOOL_HASH_BUCKET	15$/
+MTX_MPOOL_IO	../dbinc/mutex.h	/^#define	MTX_MPOOL_IO		16$/
+MTX_MPOOL_REGION	../dbinc/mutex.h	/^#define	MTX_MPOOL_REGION	17$/
+MTX_MUTEX_REGION	../dbinc/mutex.h	/^#define	MTX_MUTEX_REGION	18$/
+MTX_MUTEX_TEST	../dbinc/mutex.h	/^#define	MTX_MUTEX_TEST		19$/
+MTX_REP_DATABASE	../dbinc/mutex.h	/^#define	MTX_REP_DATABASE	20$/
+MTX_REP_REGION	../dbinc/mutex.h	/^#define	MTX_REP_REGION		21$/
+MTX_SEQUENCE	../dbinc/mutex.h	/^#define	MTX_SEQUENCE		22$/
+MTX_TWISTER	../dbinc/mutex.h	/^#define	MTX_TWISTER		23$/
+MTX_TXN_ACTIVE	../dbinc/mutex.h	/^#define	MTX_TXN_ACTIVE		24$/
+MTX_TXN_CHKPT	../dbinc/mutex.h	/^#define	MTX_TXN_CHKPT		25$/
+MTX_TXN_COMMIT	../dbinc/mutex.h	/^#define	MTX_TXN_COMMIT		26$/
+MTX_TXN_MVCC	../dbinc/mutex.h	/^#define	MTX_TXN_MVCC		27$/
+MTX_TXN_REGION	../dbinc/mutex.h	/^#define	MTX_TXN_REGION		28$/
+MT_FILE	../mutex/tm.c	/^#define	MT_FILE		"TESTDIR\/mutex.file"$/
+MT_FILE_QUIT	../mutex/tm.c	/^#define	MT_FILE_QUIT	"TESTDIR\/mutex.file.quit"$/
+MULTIVERSION	../dbinc/mp.h	/^#define	MULTIVERSION(dbp)	((dbp)->mpf->mfp->multiv/
+MUTEXP_SET	../dbinc/mutex_int.h	/^#define	MUTEXP_SET(indx)						\\$/
+MUTEX_ALIGN	../dbinc/mutex_int.h	/^#define	MUTEX_ALIGN	16$/
+MUTEX_DESTROY	../dbinc/mutex_int.h	/^#define	MUTEX_DESTROY(x) sema_destroy(x)$/
+MUTEX_FIELDS	../dbinc/mutex_int.h	/^#define	MUTEX_FIELDS							\\$/
+MUTEX_INIT	../dbinc/mutex_int.h	/^#define	MUTEX_INIT(x)	0$/
+MUTEX_INVALID	../dbinc/mutex.h	/^#define	MUTEX_INVALID	0$/
+MUTEX_LOCK	../dbinc/mutex.h	/^#define	MUTEX_LOCK(dbenv, mutex) do {					\\$/
+MUTEX_ON	../dbinc/db_int.in	/^#define	MUTEX_ON(dbenv)		((dbenv)->mutex_handle !=/
+MUTEX_PAUSE	../dbinc/mutex_int.h	/^#define	MUTEX_PAUSE		{__asm{_emit 0xf3}; __asm{_em/
+MUTEX_SET	../dbinc/mutex_int.h	/^#define	MUTEX_SET(x)	(!_check_lock(x, 0, 1))$/
+MUTEX_SYSTEM_LOCK	../dbinc/mutex_int.h	/^#define	MUTEX_SYSTEM_LOCK(dbenv)					\\$/
+MUTEX_SYSTEM_UNLOCK	../dbinc/mutex_int.h	/^#define	MUTEX_SYSTEM_UNLOCK(dbenv)					\\$/
+MUTEX_UNLOCK	../dbinc/mutex.h	/^#define	MUTEX_UNLOCK(dbenv, mutex) do {					\\$/
+MUTEX_UNSET	../dbinc/mutex_int.h	/^#define	MUTEX_UNSET(x)	_clear_lock(x, 0)$/
+MVCC_BHALIGN	../dbinc/mp.h	/^#define	MVCC_BHALIGN(mfp, p) do {					\\$/
+MVCC_BHSIZE	../dbinc/mp.h	/^#define	MVCC_BHSIZE(mfp, sz) do {					\\$/
+MVCC_BHUNALIGN	../dbinc/mp.h	/^#define	MVCC_BHUNALIGN(mfp, p) do {					\\$/
+MVCC_MPROTECT	../dbinc/mp.h	/^#define	MVCC_MPROTECT(buf, sz, mode) do {				\\$/
+MVCC_SKIP_CURADJ	../dbinc/mp.h	/^#define	MVCC_SKIP_CURADJ(dbc, pgno)					\\$/
 M_16_SWAP	../dbinc/db_swap.h	/^#define	M_16_SWAP(a) {							\\$/
 M_32_SWAP	../dbinc/db_swap.h	/^#define	M_32_SWAP(a) {							\\$/
+M_64_SWAP	../dbinc/db_swap.h	/^#define	M_64_SWAP(a) {							\\$/
 Mtm	../mutex/tm.c	/^main(argc, argv)$/
-N	../crypto/mersenne/mt19937db.c	37
+N	../crypto/mersenne/mt19937db.c	/^#define N 624$/
 NAME_TO_DB	../dbinc/tcl_db.h	/^#define	NAME_TO_DB(name)	(DB *)_NameToPtr((name))$/
 NAME_TO_DBC	../dbinc/tcl_db.h	/^#define	NAME_TO_DBC(name)	(DBC *)_NameToPtr((name)/
 NAME_TO_ENV	../dbinc/tcl_db.h	/^#define	NAME_TO_ENV(name)	(DB_ENV *)_NameToPtr((na/
@@ -1483,53 +1466,61 @@ NAME_TO_TXN	../dbinc/tcl_db.h	/^#define	NAME_TO_TXN(name)	(DB_TXN *)_NameToPtr((
 NAMLEN	../clib/getcwd.c	/^# define NAMLEN(dirent) strlen((dirent)->d_name)$/
 NBUCKET	../dbinc/mp.h	/^#define	NBUCKET(mc, mf_offset, pgno)					\\$/
 NCACHE	../dbinc/mp.h	/^#define	NCACHE(mp, mf_offset, pgno)					\\$/
-NCACHED	../dbinc/db_page.h	134
-NCACHED2X	../dbinc/db_upgrade.h	231
-NCACHED30	../dbinc/db_upgrade.h	152
-NDX_INVALID	../dbinc/hash.h	110
-NELEM	../libdb_java/db_java_wrap.c	/^#define NELEM(x) (sizeof (x) \/ sizeof (x[0]))$/
+NCACHED	../dbinc/db_page.h	/^#define	NCACHED	32		\/* number of spare points *\//
+NCACHED2X	../dbinc/db_upgrade.h	/^#define	NCACHED2X	32		\/* number of spare points */
+NCACHED30	../dbinc/db_upgrade.h	/^#define	NCACHED30	32		\/* number of spare points */
+NDX_INVALID	../dbinc/hash.h	/^#define	NDX_INVALID	0xFFFF$/
+NELEM	../libdb_java/db_java_wrap.c	/^#define	NELEM(x) (sizeof (x) \/ sizeof (x[0]))$/
 NEXT_PGNO	../dbinc/db_page.h	/^#define	NEXT_PGNO(p)	(((PAGE *)p)->next_pgno)$/
 NOWAIT_FLAG	../dbinc/db_int.in	/^#define	NOWAIT_FLAG(txn) \\$/
 NUM_ENT	../dbinc/db_page.h	/^#define	NUM_ENT(p)	(((PAGE *)p)->entries)$/
 NewStringObj	../dbinc/tcl_db.h	/^#define	NewStringObj(a, b)						\\$/
 OBJECT_LOCK	../dbinc/lock.h	/^#define	OBJECT_LOCK(lt, reg, obj, ndx)					\\$/
 OBJ_LINKS_VALID	../dbinc/lock.h	/^#define	OBJ_LINKS_VALID(L) ((L)->links.stqe_prev !/
-OKFLAGS	../db/db_iface.c	1068
-OKFLAGS_CDB	../env/env_open.c	86
-OK_CRYPTO_FLAGS	../env/env_method.c	351
-OK_FLAGS	../env/env_method.c	550
-ON_ERROR_RETURN	../dbinc/cxx_int.h	57
-ON_ERROR_THROW	../dbinc/cxx_int.h	56
-ON_ERROR_UNKNOWN	../dbinc/cxx_int.h	58
+OKFLAGS	../db/db_iface.c	/^#define	OKFLAGS								\\$/
+OKFLAGS_CDB	../env/env_open.c	/^#define	OKFLAGS_CDB							\\$/
+OK_CRYPTO_FLAGS	../env/env_method.c	/^#define	OK_CRYPTO_FLAGS	(DB_ENCRYPT_AES)$/
+OK_FLAGS	../env/env_method.c	/^#define	OK_FLAGS							\\$/
 OPCODE_OF	../dbinc/hash.h	/^#define	OPCODE_OF(N)	(N & ~PAIR_MASK)$/
 OR_MAP	../lock/lock_deadlock.c	/^#define	OR_MAP(D, S, N)	{						\\$/
-OS_VMPAGESIZE	../dbinc/region.h	292
-OS_VMROUNDOFF	../dbinc/region.h	/^#define	OS_VMROUNDOFF(i) {						\\$/
-OVERFLOW_ERROR	../clib/snprintf.c	122
+OS_BAD_PID	../mutex/tm.c	/^#define	OS_BAD_PID (os_pid_t)-1$/
+OS_VMPAGESIZE	../os/os_region.c	/^#define	OS_VMPAGESIZE		(8 * 1024)$/
+OS_VMROUNDOFF	../os/os_region.c	/^#define	OS_VMROUNDOFF(i) {						\\$/
+OUT_QUEUE_LIMIT	../repmgr/repmgr_net.c	/^#define	OUT_QUEUE_LIMIT 10	\/* arbitrary, for now /
+OUT_Q_HEADER	../dbinc/repmgr.h	/^typedef STAILQ_HEAD(__repmgr_out_q_head, __queued_/
+OVERFLOW_ERROR	../clib/snprintf.c	/^#define	OVERFLOW_ERROR	"internal buffer overflow, /
 OV_LEN	../dbinc/db_page.h	/^#define	OV_LEN(p)	(((PAGE *)p)->hf_offset)$/
 OV_REF	../dbinc/db_page.h	/^#define	OV_REF(p)	(((PAGE *)p)->entries)$/
-O_ACCMODE	../os/os_oflags.c	53
-O_INDX	../dbinc/db_page.h	596
-PAIR_DATAMASK	../dbinc/hash.h	118
-PAIR_DUPMASK	../dbinc/hash.h	119
+OWNER_RW	../dbinc/os.h	/^#define	OWNER_RW	"rw-------"$/
+O_ACCMODE	../os/os_oflags.c	/^#define	O_ACCMODE	(O_RDONLY | O_RDWR | O_WRONLY)$/
+O_INDX	../dbinc/db_page.h	/^#define	O_INDX	1$/
+PAGE	../dbinc/db_page.h	/^} PAGE;$/
+PAIR_DATAMASK	../dbinc/hash.h	/^#define	PAIR_DATAMASK		0x2$/
+PAIR_DUPMASK	../dbinc/hash.h	/^#define	PAIR_DUPMASK		0x4$/
 PAIR_ISDATABIG	../dbinc/hash.h	/^#define	PAIR_ISDATABIG(N)	(N & PAIR_DATAMASK)$/
 PAIR_ISDATADUP	../dbinc/hash.h	/^#define	PAIR_ISDATADUP(N)	(N & PAIR_DUPMASK)$/
 PAIR_ISKEYBIG	../dbinc/hash.h	/^#define	PAIR_ISKEYBIG(N)	(N & PAIR_KEYMASK)$/
-PAIR_KEYMASK	../dbinc/hash.h	117
-PAIR_MASK	../dbinc/hash.h	120
+PAIR_KEYMASK	../dbinc/hash.h	/^#define	PAIR_KEYMASK		0x1$/
+PAIR_MASK	../dbinc/hash.h	/^#define	PAIR_MASK		0xf$/
 PANIC_CHECK	../dbinc/region.h	/^#define	PANIC_CHECK(dbenv)						\\$/
-PANIC_SET	../dbinc/region.h	/^#define	PANIC_SET(dbenv, onoff)						\\$/
-PATH_DOT	../dbinc/db_int.in	279
-PATH_SEPARATOR	../dbinc/db_int.in	281
+PATH_DOT	../dbinc/db_int.in	/^#define	PATH_DOT	"."	\/* Current working directory/
+PATH_SEPARATOR	../dbinc/db_int.in	/^#define	PATH_SEPARATOR	"@PATH_SEPARATOR@"$/
 PGNO	../dbinc/db_page.h	/^#define	PGNO(p)		(((PAGE *)p)->pgno)$/
-PGNO_BASE_MD	../dbinc/db_page.h	34
-PGNO_INVALID	../dbinc/db_page.h	33
+PGNO_BASE_MD	../dbinc/db_page.h	/^#define	PGNO_BASE_MD	0	\/* Base database: metadata/
+PGNO_INVALID	../dbinc/db_page.h	/^#define	PGNO_INVALID	0	\/* Invalid page number in /
+PG_CHKSUM	../dbinc/db_page.h	/^} PG_CHKSUM;$/
+PG_CRYPTO	../dbinc/db_page.h	/^} PG_CRYPTO;$/
+PID_EMPTY	../env/env_register.c	/^#define	PID_EMPTY	"X                      0\\n"	\//
+PID_FMT	../env/env_register.c	/^#define	PID_FMT		"%24lu\\n"			\/* PID entry format/
+PID_ISEMPTY	../env/env_register.c	/^#define	PID_ISEMPTY(p)	(memcmp(p, PID_EMPTY, PID_L/
+PID_LEN	../env/env_register.c	/^#define	PID_LEN		(25)				\/* PID entry length *\/$/
 POWER_OF_TWO	../dbinc/db_int.in	/^#define	POWER_OF_TWO(x)	(((x) & ((x) - 1)) == 0)$/
-PREPLISTSIZE	../rep/rep_method.c	536
+PREPLISTSIZE	../rep/rep_method.c	/^#define	PREPLISTSIZE	50$/
 PREV_PGNO	../dbinc/db_page.h	/^#define	PREV_PGNO(p)	(((PAGE *)p)->prev_pgno)$/
-PTHREAD_UNLOCK_ATTEMPTS	../mutex/mut_pthread.c	57
-PUTOVFL	../dbinc/hash.h	128
-PUTPAIR	../dbinc/hash.h	126
+PTHREAD_UNLOCK_ATTEMPTS	../mutex/mut_pthread.c	/^#define	PTHREAD_UNLOCK_ATTEMPTS	5$/
+PTRACE	../btree/bt_compact.c	/^#define	PTRACE(dbc, location, p, start, f) do {			/
+PUTOVFL	../dbinc/hash.h	/^#define	PUTOVFL		0x40$/
+PUTPAIR	../dbinc/hash.h	/^#define	PUTPAIR		0x20$/
 PUTU32	../crypto/rijndael/rijndael-alg-fst.c	/^#define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st/
 PUT_COUNT	../lock/lock_list.c	/^#define	PUT_COUNT(dp, count)	do {	u_int32_t *ip = /
 PUT_HKEYDATA	../dbinc/db_page.h	/^#define	PUT_HKEYDATA(pe, kd, len, type) {				\\$/
@@ -1541,34 +1532,39 @@ P_16_COPY	../dbinc/db_swap.h	/^#define	P_16_COPY(a, b) {						\\$/
 P_16_SWAP	../dbinc/db_swap.h	/^#define	P_16_SWAP(a) {							\\$/
 P_32_COPY	../dbinc/db_swap.h	/^#define	P_32_COPY(a, b) {						\\$/
 P_32_SWAP	../dbinc/db_swap.h	/^#define	P_32_SWAP(a) {							\\$/
-P_BTREEMETA	../dbinc/db_page.h	46
+P_64_COPY	../dbinc/db_swap.h	/^#define	P_64_COPY(a, b) {						\\$/
+P_64_SWAP	../dbinc/db_swap.h	/^#define	P_64_SWAP(a) {							\\$/
+P_BTREEMETA	../dbinc/db_page.h	/^#define	P_BTREEMETA	9	\/* Btree metadata page. *\//
 P_CHKSUM	../dbinc/db_page.h	/^#define	P_CHKSUM(dbp, pg)						\\$/
+P_DONTEXTEND	../dbinc/db_page.h	/^#define	P_DONTEXTEND	0x8000	\/* Don't allocate if /
 P_ENTRY	../dbinc/db_page.h	/^#define	P_ENTRY(dbp, pg, indx)	((u_int8_t *)pg + P/
 P_FREESPACE	../dbinc/db_page.h	/^#define	P_FREESPACE(dbp, pg)	(HOFFSET(pg) - LOFFSE/
-P_HASH	../dbinc/db_page.h	39
-P_HASHMETA	../dbinc/db_page.h	45
-P_IBTREE	../dbinc/db_page.h	40
-P_INDX	../dbinc/db_page.h	597
+P_HASH	../dbinc/db_page.h	/^#define	P_HASH		2	\/* Hash. *\/$/
+P_HASHMETA	../dbinc/db_page.h	/^#define	P_HASHMETA	8	\/* Hash metadata page. *\/$/
+P_IBTREE	../dbinc/db_page.h	/^#define	P_IBTREE	3	\/* Btree internal. *\/$/
+P_INDX	../dbinc/db_page.h	/^#define	P_INDX	2$/
 P_INIT	../dbinc/db_page.h	/^#define	P_INIT(pg, pg_size, n, pg_prev, pg_next, b/
 P_INP	../dbinc/db_page.h	/^#define	P_INP(dbp, pg)							\\$/
-P_INVALID	../dbinc/db_page.h	37
-P_IRECNO	../dbinc/db_page.h	41
+P_INVALID	../dbinc/db_page.h	/^#define	P_INVALID	0	\/* Invalid page type. *\/$/
+P_IRECNO	../dbinc/db_page.h	/^#define	P_IRECNO	4	\/* Recno internal. *\/$/
 P_IV	../dbinc/db_page.h	/^#define	P_IV(dbp, pg)							\\$/
-P_LBTREE	../dbinc/db_page.h	42
-P_LDUP	../dbinc/db_page.h	49
-P_LRECNO	../dbinc/db_page.h	43
+P_LBTREE	../dbinc/db_page.h	/^#define	P_LBTREE	5	\/* Btree leaf. *\/$/
+P_LDUP	../dbinc/db_page.h	/^#define	P_LDUP		12	\/* Off-page duplicate leaf. */
+P_LRECNO	../dbinc/db_page.h	/^#define	P_LRECNO	6	\/* Recno leaf. *\/$/
 P_MAXSPACE	../dbinc/db_page.h	/^#define	P_MAXSPACE(dbp, psize)	((psize) - P_OVERHE/
-P_OVERFLOW	../dbinc/db_page.h	44
+P_OVERFLOW	../dbinc/db_page.h	/^#define	P_OVERFLOW	7	\/* Overflow. *\/$/
 P_OVERHEAD	../dbinc/db_page.h	/^#define	P_OVERHEAD(dbp)	P_TO_UINT16(P_INP(dbp, 0))/
 P_OVFLSPACE	../dbinc/db_page.h	/^#define	P_OVFLSPACE(dbp, psize, pg)	(P_MAXSPACE(db/
-P_PAGETYPE_MAX	../dbinc/db_page.h	50
-P_QAMDATA	../dbinc/db_page.h	48
-P_QAMMETA	../dbinc/db_page.h	47
+P_PAGETYPE_MAX	../dbinc/db_page.h	/^#define	P_PAGETYPE_MAX	13$/
+P_QAMDATA	../dbinc/db_page.h	/^#define	P_QAMDATA	11	\/* Queue data page. *\/$/
+P_QAMMETA	../dbinc/db_page.h	/^#define	P_QAMMETA	10	\/* Queue metadata page. *\/$/
 P_TO_UINT16	../dbinc/db_int.in	/^#define	P_TO_UINT16(p)	((u_int16_t)(uintptr_t)(p))/
 P_TO_UINT32	../dbinc/db_int.in	/^#define	P_TO_UINT32(p)	((u_int32_t)(uintptr_t)(p))/
 P_TO_ULONG	../dbinc/db_int.in	/^#define	P_TO_ULONG(p)	((u_long)(uintptr_t)(p))$/
+QAMDATA	../dbinc/qam.h	/^} QAMDATA;$/
 QAM_AFTER_CURRENT	../dbinc/qam.h	/^#define	QAM_AFTER_CURRENT(meta, recno)					\\$/
 QAM_BEFORE_FIRST	../dbinc/qam.h	/^#define	QAM_BEFORE_FIRST(meta, recno)					\\$/
+QAM_DIRTY	../qam/qam_rec.c	/^#define	QAM_DIRTY(dbp, pgno, pagep)					\\$/
 QAM_EXNAME	../qam/qam_files.c	/^#define	QAM_EXNAME(Q, I, B, L)						\\$/
 QAM_GET_RECORD	../dbinc/qam.h	/^#define	QAM_GET_RECORD(dbp, page, index)				\\$/
 QAM_NOT_VALID	../dbinc/qam.h	/^#define	QAM_NOT_VALID(meta, recno)					\\$/
@@ -1577,148 +1573,231 @@ QAM_RECNO_EXTENT	../dbinc/qam.h	/^#define	QAM_RECNO_EXTENT(dbp, recno)					\\$/
 QAM_RECNO_INDEX	../dbinc/qam.h	/^#define	QAM_RECNO_INDEX(dbp, pgno, recno)				\\$/
 QAM_RECNO_PAGE	../dbinc/qam.h	/^#define	QAM_RECNO_PAGE(dbp, recno)					\\$/
 QAM_RECNO_PER_PAGE	../dbinc/qam.h	/^#define	QAM_RECNO_PER_PAGE(dbp)	(((QUEUE*)(dbp)->q/
-QAM_SET	../dbinc/qam.h	19
-QAM_SETCUR	../dbinc/qam.h	141
-QAM_SETFIRST	../dbinc/qam.h	140
-QAM_TRUNCATE	../dbinc/qam.h	142
-QAM_VALID	../dbinc/qam.h	18
-QDEBUG	../qam/qam.c	611
+QAM_SET	../dbinc/qam.h	/^#define	QAM_SET		0x02$/
+QAM_SETCUR	../dbinc/qam.h	/^#define	QAM_SETCUR		0x02$/
+QAM_SETFIRST	../dbinc/qam.h	/^#define	QAM_SETFIRST		0x01$/
+QAM_TRUNCATE	../dbinc/qam.h	/^#define	QAM_TRUNCATE		0x04$/
+QAM_VALID	../dbinc/qam.h	/^#define	QAM_VALID	0x01$/
+QDEBUG	../qam/qam.c	/^#define	QDEBUG$/
 QMD_TRACE_ELEM	../dbinc/queue.h	/^#define	QMD_TRACE_ELEM(elem) do {					\\$/
 QMD_TRACE_HEAD	../dbinc/queue.h	/^#define	QMD_TRACE_HEAD(head) do {					\\$/
-QPAGE_CHKSUM	../dbinc/db_page.h	293
-QPAGE_NORMAL	../dbinc/db_page.h	292
-QPAGE_SEC	../dbinc/db_page.h	294
+QMETA	../dbinc/db_page.h	/^} QMETA33, QMETA;$/
+QMETA30	../dbinc/db_upgrade.h	/^} QMETA30;$/
+QMETA31	../dbinc/db_upgrade.h	/^} QMETA31;$/
+QMETA32	../dbinc/db_upgrade.h	/^} QMETA32;$/
+QPAGE	../dbinc/db_page.h	/^} QPAGE;$/
+QPAGE_CHKSUM	../dbinc/db_page.h	/^#define	QPAGE_CHKSUM	48$/
+QPAGE_NORMAL	../dbinc/db_page.h	/^#define	QPAGE_NORMAL	28$/
+QPAGE_SEC	../dbinc/db_page.h	/^#define	QPAGE_SEC	64$/
 QPAGE_SZ	../dbinc/db_page.h	/^#define	QPAGE_SZ(dbp)						\\$/
-QUEUE	../dbinc/qam.h	23
-QUEUE_CURSOR	../dbinc/qam.h	24
-QUEUE_EXTENT	../dbinc/qam.h	72
-QUEUE_EXTENT_HEAD	../dbinc/qam.h	73
-QUEUE_MACRO_DEBUG	../dbinc/queue.h	183
+QUEUE	../dbinc/qam.h	/^struct __queue;		typedef struct __queue QUEUE;$/
+QUEUED_OUTPUT	../dbinc/repmgr.h	/^struct __queued_output; typedef struct __queued_ou/
+QUEUE_CURSOR	../dbinc/qam.h	/^struct __qcursor;	typedef struct __qcursor QUEUE_C/
+QUEUE_EXTENT	../dbinc/qam.h	/^#define	QUEUE_EXTENT		"%s%c__dbq.%s.%d"$/
+QUEUE_EXTENT_HEAD	../dbinc/qam.h	/^#define	QUEUE_EXTENT_HEAD	"__dbq.%s."$/
+QUEUE_EXTENT_PREFIX	../dbinc/qam.h	/^#define	QUEUE_EXTENT_PREFIX	"__dbq."$/
+QUEUE_FILELIST	../dbinc/qam.h	/^} QUEUE_FILELIST;$/
+QUEUE_MACRO_DEBUG	../dbinc/queue.h	/^#define	QUEUE_MACRO_DEBUG 0$/
 R0	../hmac/sha1.c	/^#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0/
 R1	../hmac/sha1.c	/^#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x/
 R2	../hmac/sha1.c	/^#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EB/
 R3	../hmac/sha1.c	/^#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i/
 R4	../hmac/sha1.c	/^#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1/
-RECNO	../dbinc/btree.h	51
-RECNO_OOB	../dbinc/db_int.in	82
-REC_CLOSE	../dbinc/db_am.h	53
+RECNO	../dbinc/btree.h	/^struct __recno;		typedef struct __recno RECNO;$/
+RECNOINFO	../dbinc/db_185.in	/^} RECNOINFO;$/
+RECNO_OOB	../dbinc/db_int.in	/^#define	RECNO_OOB	0		\/* Illegal record number. */
+RECOVERING_LOG_SKIP	../rep/rep_record.c	/^#define	RECOVERING_LOG_SKIP do {					\\$/
+RECOVERING_SKIP	../rep/rep_record.c	/^#define	RECOVERING_SKIP do {						\\$/
+REC_CLOSE	../dbinc/db_am.h	/^#define	REC_CLOSE {							\\$/
+REC_DIRTY	../dbinc/db_am.h	/^#define	REC_DIRTY(mpf, pagep)						\\$/
 REC_FGET	../dbinc/db_am.h	/^#define	REC_FGET(mpf, pgno, pagep, cont)				\\$/
-REC_INTRO	../dbinc/db_am.h	/^#define	REC_INTRO(func, inc_count) do {					\\$/
-REC_NOOP_CLOSE	../dbinc/db_am.h	71
+REC_INTRO	../dbinc/db_am.h	/^#define	REC_INTRO(func, inc_count, do_cursor) do {/
+REC_NOOP_CLOSE	../dbinc/db_am.h	/^#define	REC_NOOP_CLOSE							\\$/
 REC_NOOP_INTRO	../dbinc/db_am.h	/^#define	REC_NOOP_INTRO(func) do {					\\$/
 REC_PRINT	../dbinc/db_am.h	/^#define	REC_PRINT(func)							\\$/
-REGINFO	../dbinc/db_int.in	526
-REGION_CREATE	../dbinc/region.h	229
-REGION_CREATE_OK	../dbinc/region.h	230
-REGION_ID_ENV	../dbinc/region.h	108
-REGION_JOIN_OK	../dbinc/region.h	231
-REPDBNAME	../rep/rep_method.c	431
-REPPAGENAME	../rep/rep_method.c	432
-REP_ALIVE	../dbinc/rep.h	13
-REP_ALIVE_REQ	../dbinc/rep.h	14
-REP_ALL_REQ	../dbinc/rep.h	15
-REP_DUPMASTER	../dbinc/rep.h	16
-REP_EGENNAME	../dbinc/rep.h	90
-REP_FILE	../dbinc/rep.h	17
-REP_FILE_FAIL	../dbinc/rep.h	18
-REP_FILE_REQ	../dbinc/rep.h	19
-REP_F_CLIENT	../dbinc/rep.h	167
-REP_F_EPHASE1	../dbinc/rep.h	168
-REP_F_EPHASE2	../dbinc/rep.h	169
-REP_F_MASTER	../dbinc/rep.h	170
-REP_F_MASTERELECT	../dbinc/rep.h	171
-REP_F_NOARCHIVE	../dbinc/rep.h	172
-REP_F_READY	../dbinc/rep.h	173
-REP_F_RECOVER_LOG	../dbinc/rep.h	174
-REP_F_RECOVER_MASK	../dbinc/rep.h	187
-REP_F_RECOVER_PAGE	../dbinc/rep.h	175
-REP_F_RECOVER_UPDATE	../dbinc/rep.h	176
-REP_F_RECOVER_VERIFY	../dbinc/rep.h	177
-REP_F_TALLY	../dbinc/rep.h	178
-REP_LOG	../dbinc/rep.h	20
-REP_LOG_MORE	../dbinc/rep.h	21
-REP_LOG_REQ	../dbinc/rep.h	22
-REP_MASTER_REQ	../dbinc/rep.h	23
-REP_NEWCLIENT	../dbinc/rep.h	24
-REP_NEWFILE	../dbinc/rep.h	25
-REP_NEWMASTER	../dbinc/rep.h	26
-REP_NEWSITE	../dbinc/rep.h	27
-REP_ON	../dbinc/db_int.in	/^#define	REP_ON(dbenv)		((dbenv)->rep_handle != NUL/
-REP_PAGE	../dbinc/rep.h	33
-REP_PAGE_FAIL	../dbinc/rep.h	34
-REP_PAGE_MORE	../dbinc/rep.h	35
-REP_PAGE_REQ	../dbinc/rep.h	36
-REP_PRINT_MESSAGE	../dbinc/rep.h	/^#define	REP_PRINT_MESSAGE(dbenv, eid, rp, str)				/
-REP_UPDATE	../dbinc/rep.h	37
-REP_UPDATE_REQ	../dbinc/rep.h	38
-REP_VERIFY	../dbinc/rep.h	39
-REP_VERIFY_FAIL	../dbinc/rep.h	40
-REP_VERIFY_REQ	../dbinc/rep.h	41
-REP_VOTE1	../dbinc/rep.h	42
-REP_VOTE2	../dbinc/rep.h	43
+REGENV	../dbinc/region.h	/^} REGENV;$/
+REGENV_REF	../dbinc/region.h	/^} REGENV_REF;$/
+REGINFO	../dbinc/db_int.in	/^struct __db_reginfo_t;	typedef struct __db_reginfo/
+REGION	../dbinc/region.h	/^} REGION;$/
+REGION_CREATE	../dbinc/region.h	/^#define	REGION_CREATE		0x01	\/* Caller created reg/
+REGION_CREATE_OK	../dbinc/region.h	/^#define	REGION_CREATE_OK	0x02	\/* Caller willing t/
+REGION_ID_ENV	../dbinc/region.h	/^#define	REGION_ID_ENV		1	\/* Primary environment I/
+REGION_JOIN_OK	../dbinc/region.h	/^#define	REGION_JOIN_OK		0x04	\/* Caller is looking/
+REGISTER_FILE	../env/env_register.c	/^#define	REGISTER_FILE	"__db.register"$/
+REGISTRY_EXCL_LOCK	../env/env_register.c	/^#define	REGISTRY_EXCL_LOCK(dbenv, nowait)				\\$/
+REGISTRY_EXCL_UNLOCK	../env/env_register.c	/^#define	REGISTRY_EXCL_UNLOCK(dbenv)					\\$/
+REGISTRY_LOCK	../env/env_register.c	/^#define	REGISTRY_LOCK(dbenv, pos, nowait)				\\$/
+REGISTRY_UNLOCK	../env/env_register.c	/^#define	REGISTRY_UNLOCK(dbenv, pos)					\\$/
+REP	../dbinc/rep.h	/^} REP;$/
+REPCTL_ELECTABLE	../dbinc/rep.h	/^#define	REPCTL_ELECTABLE	0x01	\/* Upgraded client /
+REPCTL_INIT	../dbinc/rep.h	/^#define	REPCTL_INIT		0x02	\/* Internal init messag/
+REPCTL_PERM	../dbinc/rep.h	/^#define	REPCTL_PERM		DB_LOG_PERM_42_44$/
+REPCTL_RESEND	../dbinc/rep.h	/^#define	REPCTL_RESEND		DB_LOG_RESEND_42_44$/
+REPDBNAME	../dbinc/rep.h	/^#define	REPDBNAME	"__db.rep.db"$/
+REPLICATION_WRAP	../dbinc/rep.h	/^#define	REPLICATION_WRAP(dbenv, func_call, ret) do/
+REPMGR_ACK	../dbinc/repmgr.h	/^#define	REPMGR_ACK		1	\/* Acknowledgement. *\/$/
+REPMGR_CONNECTION	../dbinc/repmgr.h	/^struct __repmgr_connection;$/
+REPMGR_FLAT	../dbinc/repmgr.h	/^} REPMGR_FLAT;$/
+REPMGR_HANDSHAKE	../dbinc/repmgr.h	/^#define	REPMGR_HANDSHAKE	2	\/* Connection establis/
+REPMGR_IOVECS	../dbinc/repmgr.h	/^} REPMGR_IOVECS;$/
+REPMGR_MESSAGE	../dbinc/repmgr.h	/^} REPMGR_MESSAGE;$/
+REPMGR_QUEUE	../dbinc/repmgr.h	/^struct __repmgr_queue; typedef struct __repmgr_que/
+REPMGR_REP_MESSAGE	../dbinc/repmgr.h	/^#define	REPMGR_REP_MESSAGE	3	\/* Normal replicatio/
+REPMGR_RETRY	../dbinc/repmgr.h	/^struct __repmgr_retry; typedef struct __repmgr_ret/
+REPMGR_RUNNABLE	../dbinc/repmgr.h	/^struct __repmgr_runnable; typedef struct __repmgr_/
+REPMGR_SITE	../dbinc/repmgr.h	/^struct __repmgr_site; typedef struct __repmgr_site/
+REPMGR_SYNC_INITED	../dbinc/repmgr.h	/^#define	REPMGR_SYNC_INITED(db_rep) (db_rep->waiter/
+REPPAGENAME	../dbinc/rep.h	/^#define	REPPAGENAME     "__db.reppg.db"$/
+REP_ALIVE	../dbinc/rep.h	/^#define	REP_ALIVE	1	\/* I am alive message. *\/$/
+REP_ALIVE_REQ	../dbinc/rep.h	/^#define	REP_ALIVE_REQ	2	\/* Request for alive mess/
+REP_ALL_REQ	../dbinc/rep.h	/^#define	REP_ALL_REQ	3	\/* Request all log records /
+REP_BULK	../dbinc/rep.h	/^} REP_BULK;$/
+REP_BULK_LOG	../dbinc/rep.h	/^#define	REP_BULK_LOG	4	\/* Bulk transfer of log re/
+REP_BULK_PAGE	../dbinc/rep.h	/^#define	REP_BULK_PAGE	5	\/* Bulk transfer of pages/
+REP_CONTROL	../dbinc/rep.h	/^} REP_CONTROL;$/
+REP_C_BULK	../dbinc/rep.h	/^#define	REP_C_BULK		0x00001		\/* Bulk transfer. */
+REP_C_DELAYCLIENT	../dbinc/rep.h	/^#define	REP_C_DELAYCLIENT	0x00002		\/* Delay clien/
+REP_C_NOAUTOINIT	../dbinc/rep.h	/^#define	REP_C_NOAUTOINIT	0x00004		\/* No auto init/
+REP_C_NOWAIT	../dbinc/rep.h	/^#define	REP_C_NOWAIT		0x00008		\/* Immediate error/
+REP_DUPMASTER	../dbinc/rep.h	/^#define	REP_DUPMASTER	6	\/* Duplicate master detec/
+REP_EGENNAME	../dbinc/rep.h	/^#define	REP_EGENNAME	"__db.rep.egen"$/
+REP_FILE	../dbinc/rep.h	/^#define	REP_FILE	7	\/* Page of a database file. NO/
+REP_FILE_FAIL	../dbinc/rep.h	/^#define	REP_FILE_FAIL	8	\/* File requested does no/
+REP_FILE_REQ	../dbinc/rep.h	/^#define	REP_FILE_REQ	9	\/* Request for a database /
+REP_F_CLIENT	../dbinc/rep.h	/^#define	REP_F_CLIENT		0x00001		\/* Client replica./
+REP_F_DELAY	../dbinc/rep.h	/^#define	REP_F_DELAY		0x00002		\/* Delaying client /
+REP_F_EPHASE1	../dbinc/rep.h	/^#define	REP_F_EPHASE1		0x00004		\/* In phase 1 of /
+REP_F_EPHASE2	../dbinc/rep.h	/^#define	REP_F_EPHASE2		0x00008		\/* In phase 2 of /
+REP_F_MASTER	../dbinc/rep.h	/^#define	REP_F_MASTER		0x00010		\/* Master replica./
+REP_F_MASTERELECT	../dbinc/rep.h	/^#define	REP_F_MASTERELECT	0x00020		\/* Master elec/
+REP_F_NOARCHIVE	../dbinc/rep.h	/^#define	REP_F_NOARCHIVE		0x00040		\/* Rep blocks l/
+REP_F_READY	../dbinc/rep.h	/^#define	REP_F_READY		0x00080		\/* Wait for txn_cnt/
+REP_F_RECOVER_LOG	../dbinc/rep.h	/^#define	REP_F_RECOVER_LOG	0x00100		\/* In recovery/
+REP_F_RECOVER_MASK	../dbinc/rep.h	/^#define	REP_F_RECOVER_MASK						\\$/
+REP_F_RECOVER_PAGE	../dbinc/rep.h	/^#define	REP_F_RECOVER_PAGE	0x00200		\/* In recover/
+REP_F_RECOVER_UPDATE	../dbinc/rep.h	/^#define	REP_F_RECOVER_UPDATE	0x00400		\/* In recov/
+REP_F_RECOVER_VERIFY	../dbinc/rep.h	/^#define	REP_F_RECOVER_VERIFY	0x00800		\/* In recov/
+REP_F_TALLY	../dbinc/rep.h	/^#define	REP_F_TALLY		0x01000		\/* Tallied vote bef/
+REP_GAP_FORCE	../dbinc/rep.h	/^#define	REP_GAP_FORCE		0x001	\/* Force a request f/
+REP_GAP_REREQUEST	../dbinc/rep.h	/^#define	REP_GAP_REREQUEST	0x002	\/* Gap request is/
+REP_INVALID	../dbinc/rep.h	/^#define	REP_INVALID	0	\/* Invalid message type. */
+REP_LOG	../dbinc/rep.h	/^#define	REP_LOG		10	\/* Log record. *\/$/
+REP_LOG_MORE	../dbinc/rep.h	/^#define	REP_LOG_MORE	11	\/* There are more log rec/
+REP_LOG_REQ	../dbinc/rep.h	/^#define	REP_LOG_REQ	12	\/* Request for a log recor/
+REP_MASTER_REQ	../dbinc/rep.h	/^#define	REP_MASTER_REQ	13	\/* Who is the master */
+REP_MAX_MSG	../dbinc/rep.h	/^#define	REP_MAX_MSG	29$/
+REP_MSG_REQ	../dbinc/rep.h	/^#define	REP_MSG_REQ(rectype)			\\$/
+REP_NEWCLIENT	../dbinc/rep.h	/^#define	REP_NEWCLIENT	14	\/* Announces the presenc/
+REP_NEWFILE	../dbinc/rep.h	/^#define	REP_NEWFILE	15	\/* Announce a log file cha/
+REP_NEWMASTER	../dbinc/rep.h	/^#define	REP_NEWMASTER	16	\/* Announces who the mas/
+REP_NEWSITE	../dbinc/rep.h	/^#define	REP_NEWSITE	17	\/* Announces that a site h/
+REP_OLD_VOTE_INFO	../dbinc/rep.h	/^} REP_OLD_VOTE_INFO;$/
+REP_ON	../dbinc/db_int.in	/^#define	REP_ON(dbenv)							\\$/
+REP_PAGE	../dbinc/rep.h	/^#define	REP_PAGE	18	\/* Database page. *\/$/
+REP_PAGE_FAIL	../dbinc/rep.h	/^#define	REP_PAGE_FAIL	19	\/* Requested page does n/
+REP_PAGE_MORE	../dbinc/rep.h	/^#define	REP_PAGE_MORE	20	\/* There are more pages /
+REP_PAGE_REQ	../dbinc/rep.h	/^#define	REP_PAGE_REQ	21	\/* Request for a database/
+REP_PRINT_MESSAGE	../dbinc/rep.h	/^#define	REP_PRINT_MESSAGE(dbenv, eid, rp, str, fl)/
+REP_REREQUEST	../dbinc/rep.h	/^#define	REP_REREQUEST	22	\/* Force rerequest. *\/$/
+REP_SYSTEM_LOCK	../dbinc/rep.h	/^#define	REP_SYSTEM_LOCK(dbenv)						\\$/
+REP_SYSTEM_UNLOCK	../dbinc/rep.h	/^#define	REP_SYSTEM_UNLOCK(dbenv)					\\$/
+REP_THROTTLE	../dbinc/rep.h	/^} REP_THROTTLE;$/
+REP_THROTTLE_ONLY	../dbinc/rep.h	/^#define	REP_THROTTLE_ONLY	0x0001	\/* Send _MORE me/
+REP_UPDATE	../dbinc/rep.h	/^#define	REP_UPDATE	23	\/* Environment hotcopy info/
+REP_UPDATE_REQ	../dbinc/rep.h	/^#define	REP_UPDATE_REQ	24	\/* Request for hotcopy /
+REP_VERIFY	../dbinc/rep.h	/^#define	REP_VERIFY	25	\/* A log record for verific/
+REP_VERIFY_FAIL	../dbinc/rep.h	/^#define	REP_VERIFY_FAIL	26	\/* The client is outda/
+REP_VERIFY_REQ	../dbinc/rep.h	/^#define	REP_VERIFY_REQ	27	\/* Request for a log re/
+REP_VOTE1	../dbinc/rep.h	/^#define	REP_VOTE1	28	\/* Send out your information/
+REP_VOTE2	../dbinc/rep.h	/^#define	REP_VOTE2	29	\/* Send a "you are master" v/
+REP_VOTE_INFO	../dbinc/rep.h	/^} REP_VOTE_INFO;$/
+REP_VTALLY	../dbinc/rep.h	/^} REP_VTALLY;$/
+RESET_MPF	../fileops/fop_util.c	/^#define	RESET_MPF(D, F) do {						\\$/
 RESET_RET_MEM	../dbinc/db_int.in	/^#define	RESET_RET_MEM(dbc)				\\$/
+RESTORE_START	../btree/bt_compact.c	/^#define	RESTORE_START							\\$/
 RETRY_CHK	../dbinc/os.h	/^#define	RETRY_CHK(op, ret) do {						\\$/
-RET_ERROR	../dbinc/db_185.in	58
+RETRY_CHK_EINTR_ONLY	../dbinc/os.h	/^#define	RETRY_CHK_EINTR_ONLY(op, ret) do {				\\$/
+RETRY_Q_HEADER	../dbinc/repmgr.h	/^typedef TAILQ_HEAD(__repmgr_retry_q, __repmgr_retr/
+RET_ERROR	../dbinc/db_185.in	/^#define	RET_ERROR	-1		\/* Return values. *\/$/
+RET_SET	../mutex/mut_pthread.c	/^#define	RET_SET(f, ret) do {						\\$/
 RET_SIZE	../lock/lock_list.c	/^#define	RET_SIZE(size, count)  ((size) +				\\$/
-RET_SPECIAL	../dbinc/db_185.in	60
-RET_SUCCESS	../dbinc/db_185.in	59
+RET_SPECIAL	../dbinc/db_185.in	/^#define	RET_SPECIAL	 1$/
+RET_SUCCESS	../dbinc/db_185.in	/^#define	RET_SUCCESS	 0$/
 RE_NREC	../dbinc/db_page.h	/^#define	RE_NREC(p)							\\$/
 RE_NREC_ADJ	../dbinc/db_page.h	/^#define	RE_NREC_ADJ(p, adj)						\\$/
 RE_NREC_SET	../dbinc/db_page.h	/^#define	RE_NREC_SET(p, num)						\\$/
 RINGBUF_LEN	../dbinc/log.h	/^#define	RINGBUF_LEN(lp, start, end)					\\$/
-RINTERNAL_PSIZE	../dbinc/db_page.h	650
-RINTERNAL_SIZE	../dbinc/db_page.h	648
-RLOCK	../log/log_get.c	25
-RMNAMESZ	../dbinc/xa.h	44
+RINTERNAL	../dbinc/db_page.h	/^} RINTERNAL;$/
+RINTERNAL_PSIZE	../dbinc/db_page.h	/^#define	RINTERNAL_PSIZE							\\$/
+RINTERNAL_SIZE	../dbinc/db_page.h	/^#define	RINTERNAL_SIZE							\\$/
+RLOCK	../log/log_get.c	/^typedef enum { L_ALREADY, L_ACQUIRED, L_NONE } RLO/
+RMNAMESZ	../dbinc/xa.h	/^#define	RMNAMESZ	32		\/* length of resource manage/
 RPC_ON	../dbinc/db_int.in	/^#define	RPC_ON(dbenv)		((dbenv)->cl_handle != NULL/
-RPRINT	../dbinc/rep.h	/^#define RPRINT(e, r, x) do {						\\$/
-RSMSG	../db185/db185.c	522
+RPRINT	../dbinc/rep.h	/^#define	RPRINT(e, x) do {						\\$/
+RSMSG	../db185/db185.c	/^#define	RSMSG \\$/
 R_ADDR	../dbinc/region.h	/^#define	R_ADDR(reginfop, offset)					\\$/
-R_CURSOR	../dbinc/db_185.in	93
-R_DUP	../dbinc/db_185.in	125
-R_FIRST	../dbinc/db_185.in	95
-R_FIXEDLEN	../dbinc/db_185.in	154
-R_IAFTER	../dbinc/db_185.in	96
-R_IBEFORE	../dbinc/db_185.in	97
-R_LAST	../dbinc/db_185.in	98
-R_LOCK	../dbinc/region.h	/^#define	R_LOCK(dbenv, reginfo)						\\$/
-R_NEXT	../dbinc/db_185.in	99
-R_NOKEY	../dbinc/db_185.in	155
-R_NOOVERWRITE	../dbinc/db_185.in	100
+R_CURSOR	../dbinc/db_185.in	/^#define	R_CURSOR	1		\/* del, put, seq *\/$/
+R_DUP	../dbinc/db_185.in	/^#define	R_DUP		0x01	\/* duplicate keys *\/$/
+R_FIRST	../dbinc/db_185.in	/^#define	R_FIRST		3		\/* seq *\/$/
+R_FIXEDLEN	../dbinc/db_185.in	/^#define	R_FIXEDLEN	0x01	\/* fixed-length records */
+R_IAFTER	../dbinc/db_185.in	/^#define	R_IAFTER	4		\/* put (RECNO) *\/$/
+R_IBEFORE	../dbinc/db_185.in	/^#define	R_IBEFORE	5		\/* put (RECNO) *\/$/
+R_LAST	../dbinc/db_185.in	/^#define	R_LAST		6		\/* seq (BTREE, RECNO) *\/$/
+R_NEXT	../dbinc/db_185.in	/^#define	R_NEXT		7		\/* seq *\/$/
+R_NOKEY	../dbinc/db_185.in	/^#define	R_NOKEY		0x02	\/* key not required *\/$/
+R_NOOVERWRITE	../dbinc/db_185.in	/^#define	R_NOOVERWRITE	8		\/* put *\/$/
 R_OFFSET	../dbinc/region.h	/^#define	R_OFFSET(reginfop, p)						\\$/
-R_PREV	../dbinc/db_185.in	101
-R_RECNOSYNC	../dbinc/db_185.in	103
-R_SETCURSOR	../dbinc/db_185.in	102
-R_SNAPSHOT	../dbinc/db_185.in	156
-R_UNLOCK	../dbinc/region.h	/^#define	R_UNLOCK(dbenv, reginfo)					\\$/
-SALVAGE_HASH	../dbinc/db_verify.h	109
-SALVAGE_IGNORE	../dbinc/db_verify.h	104
-SALVAGE_INVALID	../dbinc/db_verify.h	103
-SALVAGE_LBTREE	../dbinc/db_verify.h	108
-SALVAGE_LDUP	../dbinc/db_verify.h	105
-SALVAGE_LRECNO	../dbinc/db_verify.h	110
-SALVAGE_LRECNODUP	../dbinc/db_verify.h	106
-SALVAGE_OVERFLOW	../dbinc/db_verify.h	107
-SALVAGE_PRINTABLE	../dbinc/db_verify.h	135
-SALVAGE_PRINTFOOTER	../dbinc/db_verify.h	137
-SALVAGE_PRINTHEADER	../dbinc/db_verify.h	136
-SA_SKIPFIRSTKEY	../dbinc/db_verify.h	66
+R_PREV	../dbinc/db_185.in	/^#define	R_PREV		9		\/* seq (BTREE, RECNO) *\/$/
+R_RECNOSYNC	../dbinc/db_185.in	/^#define	R_RECNOSYNC	11		\/* sync (RECNO) *\/$/
+R_SETCURSOR	../dbinc/db_185.in	/^#define	R_SETCURSOR	10		\/* put (RECNO) *\/$/
+R_SNAPSHOT	../dbinc/db_185.in	/^#define	R_SNAPSHOT	0x04	\/* snapshot the input *\//
+SALVAGE_HASH	../dbinc/db_verify.h	/^#define	SALVAGE_HASH		6$/
+SALVAGE_IGNORE	../dbinc/db_verify.h	/^#define	SALVAGE_IGNORE		1$/
+SALVAGE_INVALID	../dbinc/db_verify.h	/^#define	SALVAGE_INVALID		0$/
+SALVAGE_LBTREE	../dbinc/db_verify.h	/^#define	SALVAGE_LBTREE		5$/
+SALVAGE_LDUP	../dbinc/db_verify.h	/^#define	SALVAGE_LDUP		2$/
+SALVAGE_LRECNO	../dbinc/db_verify.h	/^#define	SALVAGE_LRECNO		7$/
+SALVAGE_LRECNODUP	../dbinc/db_verify.h	/^#define	SALVAGE_LRECNODUP	3$/
+SALVAGE_OVERFLOW	../dbinc/db_verify.h	/^#define	SALVAGE_OVERFLOW	4$/
+SALVAGE_PRINTABLE	../dbinc/db_verify.h	/^#define	SALVAGE_PRINTABLE	0x01	\/* Output printabl/
+SALVAGE_PRINTFOOTER	../dbinc/db_verify.h	/^#define	SALVAGE_PRINTFOOTER	0x04	\/* Print the unk/
+SALVAGE_PRINTHEADER	../dbinc/db_verify.h	/^#define	SALVAGE_PRINTHEADER	0x02	\/* Print the unk/
+SAVE_START	../btree/bt_compact.c	/^#define	SAVE_START							\\$/
+SA_SKIPFIRSTKEY	../dbinc/db_verify.h	/^#define	SA_SKIPFIRSTKEY	0x00080000$/
+SELF_EID	../dbinc/repmgr.h	/^#define	SELF_EID		INT_MAX$/
 SEQ_ILLEGAL_AFTER_OPEN	../sequence/sequence.c	/^#define	SEQ_ILLEGAL_AFTER_OPEN(seq, name)				\\$/
 SEQ_ILLEGAL_BEFORE_OPEN	../sequence/sequence.c	/^#define	SEQ_ILLEGAL_BEFORE_OPEN(seq, name)				\\$/
-SEQ_OPEN_FLAGS	../sequence/sequence.c	123
-SEQ_SET_FLAGS	../sequence/sequence.c	261
-SET_LOG_FLAGS	../txn/txn.c	/^#define	SET_LOG_FLAGS(dbenv, txnp, lflags)				\\$/
-SET_MAP	../lock/lock_deadlock.c	/^#define	SET_MAP(M, B)	((M)[(B) \/ 32] |= (1 << ((B)/
+SEQ_IS_OPEN	../sequence/sequence.c	/^#define	SEQ_IS_OPEN(seq)	((seq)->seq_key.data != N/
+SEQ_OPEN_FLAGS	../sequence/sequence.c	/^#define	SEQ_OPEN_FLAGS	(DB_CREATE | DB_EXCL | DB_T/
+SEQ_SET_FLAGS	../sequence/sequence.c	/^#define	SEQ_SET_FLAGS	(DB_SEQ_WRAP | DB_SEQ_INC | /
+SEQ_SWAP	../sequence/sequence.c	/^#define	SEQ_SWAP(rp)							\\$/
+SEQ_SWAP_IN	../sequence/sequence.c	/^#define	SEQ_SWAP_IN(seq) \\$/
+SEQ_SWAP_OUT	../sequence/sequence.c	/^#define	SEQ_SWAP_OUT(seq) \\$/
+SET_LOG_FLAGS	../txn/txn.c	/^#define	SET_LOG_FLAGS(dbenv, txn, lflags)				\\$/
+SET_MAP	../lock/lock_deadlock.c	/^#define	SET_MAP(M, B)	((M)[(B) \/ 32] |= (1 << ((B/
 SET_RET_MEM	../dbinc/db_int.in	/^#define	SET_RET_MEM(dbc, owner)				\\$/
-SET_TXN	../xa/xa_db.c	/^#define	SET_TXN(PARAM, LOCAL) {						\\$/
-SHA1HANDSOFF	../hmac/sha1.c	77
-SHALLOC_FRAGMENT	../env/db_salloc.c	192
-SHM_R	../os/os_oflags.c	136
-SHM_W	../os/os_oflags.c	139
+SHA1HANDSOFF	../hmac/sha1.c	/^#define SHA1HANDSOFF$/
+SHA1_CTX	../dbinc/hmac.h	/^} SHA1_CTX;$/
+SHALLOC_FRAGMENT	../env/db_salloc.c	/^#define	SHALLOC_FRAGMENT	32$/
+SHM_R	../os/os_map.c	/^#define	SHM_R	0400$/
+SHM_W	../os/os_map.c	/^#define	SHM_W	0200$/
 SHOBJECT_LOCK	../dbinc/lock.h	/^#define	SHOBJECT_LOCK(lt, reg, shobj, ndx)				\\$/
+SH_CHAIN_ENTRY	../dbinc/shqueue.h	/^#define	SH_CHAIN_ENTRY							\\$/
+SH_CHAIN_HASNEXT	../dbinc/shqueue.h	/^#define	SH_CHAIN_HASNEXT(elm, field)	((elm)->field/
+SH_CHAIN_HASPREV	../dbinc/shqueue.h	/^#define	SH_CHAIN_HASPREV(elm, field)	((elm)->field/
+SH_CHAIN_INIT	../dbinc/shqueue.h	/^#define	SH_CHAIN_INIT(elm, field)					\\$/
+SH_CHAIN_INSERT_AFTER	../dbinc/shqueue.h	/^#define	SH_CHAIN_INSERT_AFTER(listelm, elm, field,/
+SH_CHAIN_INSERT_BEFORE	../dbinc/shqueue.h	/^#define	SH_CHAIN_INSERT_BEFORE(listelm, elm, field/
+SH_CHAIN_NEXT	../dbinc/shqueue.h	/^#define	SH_CHAIN_NEXT(elm, field, type)	(SH_CHAIN_/
+SH_CHAIN_NEXTP	../dbinc/shqueue.h	/^#define	SH_CHAIN_NEXTP(elm, field, type)				\\$/
+SH_CHAIN_PREV	../dbinc/shqueue.h	/^#define	SH_CHAIN_PREV(elm, field, type)	(SH_CHAIN_/
+SH_CHAIN_PREVP	../dbinc/shqueue.h	/^#define	SH_CHAIN_PREVP(elm, field, type)				\\$/
+SH_CHAIN_REMOVE	../dbinc/shqueue.h	/^#define	SH_CHAIN_REMOVE(elm, field, type) do {				/
+SH_CHAIN_SINGLETON	../dbinc/shqueue.h	/^#define	SH_CHAIN_SINGLETON(elm, field)					\\$/
+SH_DBT	../dbinc/lock.h	/^} SH_DBT;$/
 SH_DBT_PTR	../dbinc/lock.h	/^#define	SH_DBT_PTR(p)	((void *)(((u_int8_t *)(p)) /
 SH_LIST_EMPTY	../dbinc/shqueue.h	/^#define	SH_LIST_EMPTY(head)						\\$/
-SH_LIST_ENTRY	../dbinc/shqueue.h	49
+SH_LIST_ENTRY	../dbinc/shqueue.h	/^#define	SH_LIST_ENTRY							\\$/
 SH_LIST_FIRST	../dbinc/shqueue.h	/^#define	SH_LIST_FIRST(head, type)					\\$/
 SH_LIST_FIRSTP	../dbinc/shqueue.h	/^#define	SH_LIST_FIRSTP(head, type)					\\$/
 SH_LIST_FOREACH	../dbinc/shqueue.h	/^#define	SH_LIST_FOREACH(var, head, field, type)			/
@@ -1732,16 +1811,16 @@ SH_LIST_NEXT	../dbinc/shqueue.h	/^#define	SH_LIST_NEXT(elm, field, type)					\\$
 SH_LIST_NEXTP	../dbinc/shqueue.h	/^#define	SH_LIST_NEXTP(elm, field, type)					\\$/
 SH_LIST_NEXT_TO_PREV	../dbinc/shqueue.h	/^#define	SH_LIST_NEXT_TO_PREV(elm, field)				\\$/
 SH_LIST_PREV	../dbinc/shqueue.h	/^#define	SH_LIST_PREV(elm, field, type)					\\$/
-SH_LIST_REMOVE	../dbinc/shqueue.h	/^#define	SH_LIST_REMOVE(elm, field, type) do {				\\/
+SH_LIST_REMOVE	../dbinc/shqueue.h	/^#define	SH_LIST_REMOVE(elm, field, type) do {				/
 SH_LIST_REMOVE_HEAD	../dbinc/shqueue.h	/^#define	SH_LIST_REMOVE_HEAD(head, field, type) do /
 SH_PTR_TO_OFF	../dbinc/shqueue.h	/^#define	SH_PTR_TO_OFF(src, dest)					\\$/
 SH_TAILQ_EMPTY	../dbinc/shqueue.h	/^#define	SH_TAILQ_EMPTY(head)						\\$/
-SH_TAILQ_ENTRY	../dbinc/shqueue.h	179
+SH_TAILQ_ENTRY	../dbinc/shqueue.h	/^#define	SH_TAILQ_ENTRY							\\$/
 SH_TAILQ_FIRST	../dbinc/shqueue.h	/^#define	SH_TAILQ_FIRST(head, type)					\\$/
 SH_TAILQ_FIRSTP	../dbinc/shqueue.h	/^#define	SH_TAILQ_FIRSTP(head, type)					\\$/
 SH_TAILQ_FOREACH	../dbinc/shqueue.h	/^#define	SH_TAILQ_FOREACH(var, head, field, type)		/
 SH_TAILQ_FOREACH_REVERSE	../dbinc/shqueue.h	/^#define	SH_TAILQ_FOREACH_REVERSE(var, head, field,/
-SH_TAILQ_HEAD	../dbinc/db_shash.h	14
+SH_TAILQ_HEAD	../dbinc/shqueue.h	/^#define	SH_TAILQ_HEAD(name)						\\$/
 SH_TAILQ_HEAD_INITIALIZER	../dbinc/shqueue.h	/^#define	SH_TAILQ_HEAD_INITIALIZER(head)					\\$/
 SH_TAILQ_INIT	../dbinc/shqueue.h	/^#define	SH_TAILQ_INIT(head) {						\\$/
 SH_TAILQ_INSERT_AFTER	../dbinc/shqueue.h	/^#define	SH_TAILQ_INSERT_AFTER(head, listelm, elm, /
@@ -1749,13 +1828,17 @@ SH_TAILQ_INSERT_BEFORE	../dbinc/shqueue.h	/^#define	SH_TAILQ_INSERT_BEFORE(head,
 SH_TAILQ_INSERT_HEAD	../dbinc/shqueue.h	/^#define	SH_TAILQ_INSERT_HEAD(head, elm, field, typ/
 SH_TAILQ_INSERT_TAIL	../dbinc/shqueue.h	/^#define	SH_TAILQ_INSERT_TAIL(head, elm, field) do /
 SH_TAILQ_LAST	../dbinc/shqueue.h	/^#define	SH_TAILQ_LAST(head, field, type)				\\$/
+SH_TAILQ_LASTP	../dbinc/shqueue.h	/^#define	SH_TAILQ_LASTP(head, field, type)				\\$/
 SH_TAILQ_NEXT	../dbinc/shqueue.h	/^#define	SH_TAILQ_NEXT(elm, field, type)					\\$/
 SH_TAILQ_NEXTP	../dbinc/shqueue.h	/^#define	SH_TAILQ_NEXTP(elm, field, type)				\\$/
 SH_TAILQ_NEXT_TO_PREV	../dbinc/shqueue.h	/^#define	SH_TAILQ_NEXT_TO_PREV(elm, field)				\\$/
-SH_TAILQ_PREV	../dbinc/shqueue.h	/^#define	SH_TAILQ_PREV(head, elm, field, type)				\\/
+SH_TAILQ_PREV	../dbinc/shqueue.h	/^#define	SH_TAILQ_PREV(head, elm, field, type)				/
 SH_TAILQ_PREVP	../dbinc/shqueue.h	/^#define	SH_TAILQ_PREVP(elm, field, type)				\\$/
 SH_TAILQ_REMOVE	../dbinc/shqueue.h	/^#define	SH_TAILQ_REMOVE(head, elm, field, type) do/
-SIZEOF_PAGE	../dbinc/db_page.h	252
+SITE_CONNECTED	../dbinc/repmgr.h	/^#define	SITE_CONNECTED 2$/
+SITE_FROM_EID	../dbinc/repmgr.h	/^#define	SITE_FROM_EID(eid)	(&db_rep->sites[eid])$/
+SITE_IDLE	../dbinc/repmgr.h	/^#define	SITE_IDLE 1		\/* Waiting til time to retry/
+SIZEOF_PAGE	../dbinc/db_page.h	/^#define	SIZEOF_PAGE	26$/
 SLIST_EMPTY	../dbinc/queue.h	/^#define	SLIST_EMPTY(head)	((head)->slh_first == NU/
 SLIST_ENTRY	../dbinc/queue.h	/^#define	SLIST_ENTRY(type)						\\$/
 SLIST_FIRST	../dbinc/queue.h	/^#define	SLIST_FIRST(head)	((head)->slh_first)$/
@@ -1769,10 +1852,34 @@ SLIST_INSERT_HEAD	../dbinc/queue.h	/^#define	SLIST_INSERT_HEAD(head, elm, field)
 SLIST_NEXT	../dbinc/queue.h	/^#define	SLIST_NEXT(elm, field)	((elm)->field.sle_n/
 SLIST_REMOVE	../dbinc/queue.h	/^#define	SLIST_REMOVE(head, elm, type, field) do {	/
 SLIST_REMOVE_HEAD	../dbinc/queue.h	/^#define	SLIST_REMOVE_HEAD(head, field) do {				\\$/
+SOCKET_ERROR	../dbinc/repmgr.h	/^#define	SOCKET_ERROR		-1$/
 SORTED_SET	../db/db_join.c	/^#define	SORTED_SET(jc, n)   ((jc)->j_curslist[(n)]/
-SPLITNEW	../dbinc/hash.h	133
-SPLITOLD	../dbinc/hash.h	132
-SPL_NRECS	../dbinc/btree.h	69
+SPLITNEW	../dbinc/hash.h	/^#define	SPLITNEW	0x90$/
+SPLITOLD	../dbinc/hash.h	/^#define	SPLITOLD	0x80$/
+SPL_NRECS	../dbinc/btree.h	/^#define	SPL_NRECS	0x01		\/* Split tree has record /
+SR_APPEND	../dbinc/btree.h	/^#define	SR_APPEND	0x00040		\/* Append to the tree./
+SR_DEL	../dbinc/btree.h	/^#define	SR_DEL		0x40000		\/* Get the tree to delet/
+SR_DELETE	../dbinc/btree.h	/^#define	SR_DELETE							\\$/
+SR_DELNO	../dbinc/btree.h	/^#define	SR_DELNO	0x00080		\/* Don't return deleted/
+SR_DUPFIRST	../dbinc/btree.h	/^#define	SR_DUPFIRST	0x00100		\/* Return first dupl/
+SR_DUPLAST	../dbinc/btree.h	/^#define	SR_DUPLAST	0x00200		\/* Return last duplic/
+SR_EXACT	../dbinc/btree.h	/^#define	SR_EXACT	0x00400		\/* Exact items only. */
+SR_FIND	../dbinc/btree.h	/^#define	SR_FIND		(SR_READ | SR_DUPFIRST | SR_DELNO/
+SR_FIND_WR	../dbinc/btree.h	/^#define	SR_FIND_WR	(SR_WRITE | SR_DUPFIRST | SR_DE/
+SR_INSERT	../dbinc/btree.h	/^#define	SR_INSERT	(SR_WRITE | SR_DUPLAST | SR_PAST/
+SR_KEYFIRST	../dbinc/btree.h	/^#define	SR_KEYFIRST	(SR_WRITE | SR_DUPFIRST | SR_P/
+SR_KEYLAST	../dbinc/btree.h	/^#define	SR_KEYLAST	(SR_WRITE | SR_DUPLAST | SR_PAS/
+SR_MAX	../dbinc/btree.h	/^#define	SR_MAX		0x08000		\/* Get the right most ke/
+SR_MIN	../dbinc/btree.h	/^#define	SR_MIN		0x10000		\/* Get the left most key/
+SR_NEXT	../dbinc/btree.h	/^#define	SR_NEXT		0x20000		\/* Get the page after t/
+SR_PARENT	../dbinc/btree.h	/^#define	SR_PARENT	0x00800		\/* Lock page pair. *\//
+SR_PAST_EOF	../dbinc/btree.h	/^#define	SR_PAST_EOF	0x02000		\/* If doing insert s/
+SR_READ	../dbinc/btree.h	/^#define	SR_READ		0x00001		\/* Read locks. *\/$/
+SR_STACK	../dbinc/btree.h	/^#define	SR_STACK	0x01000		\/* Need a complete stac/
+SR_START	../dbinc/btree.h	/^#define	SR_START	0x80000		\/* Level to start stack/
+SR_STK_ONLY	../dbinc/btree.h	/^#define	SR_STK_ONLY	0x04000		\/* Just return info /
+SR_WRITE	../dbinc/btree.h	/^#define	SR_WRITE	0x00002		\/* Write locks. *\/$/
+SR_WRPAIR	../dbinc/btree.h	/^#define	SR_WRPAIR	(SR_WRITE | SR_DUPLAST | SR_PAST/
 SSZ	../dbinc/db_int.in	/^#define	SSZ(name, field)  P_TO_UINT16(&(((name *)0/
 SSZA	../dbinc/db_int.in	/^#define	SSZA(name, field) P_TO_UINT16(&(((name *)0/
 STACK_TO_CURSOR	../btree/bt_recno.c	/^#define	STACK_TO_CURSOR(cp, ret) {					\\$/
@@ -1790,59 +1897,57 @@ STAILQ_INSERT_TAIL	../dbinc/queue.h	/^#define	STAILQ_INSERT_TAIL(head, elm, fiel
 STAILQ_LAST	../dbinc/queue.h	/^#define	STAILQ_LAST(head, type, field)					\\$/
 STAILQ_NEXT	../dbinc/queue.h	/^#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe/
 STAILQ_REMOVE	../dbinc/queue.h	/^#define	STAILQ_REMOVE(head, elm, type, field) do {/
-STAILQ_REMOVE_HEAD	../dbinc/queue.h	/^#define	STAILQ_REMOVE_HEAD(head, field) do {				\\$/
+STAILQ_REMOVE_HEAD	../dbinc/queue.h	/^#define	STAILQ_REMOVE_HEAD(head, field) do {				\\/
 STAILQ_REMOVE_HEAD_UNTIL	../dbinc/queue.h	/^#define	STAILQ_REMOVE_HEAD_UNTIL(head, elm, field)/
 STAT_FMT	../dbinc/db_int.in	/^#define	STAT_FMT(msg, fmt, type, v) do {				\\$/
 STAT_HEX	../dbinc/db_int.in	/^#define	STAT_HEX(msg, v)						\\$/
 STAT_ISSET	../dbinc/db_int.in	/^#define	STAT_ISSET(msg, p)						\\$/
 STAT_LONG	../dbinc/db_int.in	/^#define	STAT_LONG(msg, v)						\\$/
 STAT_LSN	../dbinc/db_int.in	/^#define	STAT_LSN(msg, lsnp)						\\$/
+STAT_POINTER	../dbinc/db_int.in	/^#define	STAT_POINTER(msg, v)						\\$/
 STAT_STRING	../dbinc/db_int.in	/^#define	STAT_STRING(msg, p) do {					\\$/
 STAT_ULONG	../dbinc/db_int.in	/^#define	STAT_ULONG(msg, v)						\\$/
-STDERR_FILENO	../clib/snprintf.c	124
+STDERR_FILENO	../clib/snprintf.c	/^#define	STDERR_FILENO	2$/
 STD_LOCKING	../dbinc/db_int.in	/^#define	STD_LOCKING(dbc)						\\$/
-STK_CLRDBC	../dbinc/btree.h	75
-STK_NOLOCK	../dbinc/btree.h	76
-ST_DUPOK	../dbinc/db_verify.h	52
-ST_DUPSET	../dbinc/db_verify.h	53
-ST_DUPSORT	../dbinc/db_verify.h	54
-ST_IS_RECNO	../dbinc/db_verify.h	55
-ST_OVFL_LEAF	../dbinc/db_verify.h	56
-ST_RECNUM	../dbinc/db_verify.h	57
-ST_RELEN	../dbinc/db_verify.h	58
-ST_TOPLEVEL	../dbinc/db_verify.h	59
+STK_CLRDBC	../dbinc/btree.h	/^#define	STK_CLRDBC	0x01		\/* Clear dbc->page refer/
+STK_NOLOCK	../dbinc/btree.h	/^#define	STK_NOLOCK	0x02		\/* Don't retain locks. */
+STK_PGONLY	../dbinc/btree.h	/^#define	STK_PGONLY	0x04$/
+STRIP_AUTO_COMMIT	../dbinc/db_am.h	/^#define	STRIP_AUTO_COMMIT(f)	FLD_CLR((f), DB_AUTO_/
+ST_DUPOK	../dbinc/db_verify.h	/^#define	ST_DUPOK	0x00010000	\/* Duplicates are acc/
+ST_DUPSET	../dbinc/db_verify.h	/^#define	ST_DUPSET	0x00020000	\/* Subtree is in a d/
+ST_DUPSORT	../dbinc/db_verify.h	/^#define	ST_DUPSORT	0x00040000	\/* Duplicates are s/
+ST_IS_RECNO	../dbinc/db_verify.h	/^#define	ST_IS_RECNO	0x00080000	\/* Subtree is a re/
+ST_OVFL_LEAF	../dbinc/db_verify.h	/^#define	ST_OVFL_LEAF	0x00100000	\/* Overflow reffe/
+ST_RECNUM	../dbinc/db_verify.h	/^#define	ST_RECNUM	0x00200000	\/* Subtree has recor/
+ST_RELEN	../dbinc/db_verify.h	/^#define	ST_RELEN	0x00400000	\/* Subtree has fixed-/
+ST_TOPLEVEL	../dbinc/db_verify.h	/^#define	ST_TOPLEVEL	0x00800000	\/* Subtree == enti/
 SWAP	../crypto/rijndael/rijndael-alg-fst.c	/^#define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrot/
 SWAP16	../dbinc/db_swap.h	/^#define	SWAP16(p) {							\\$/
 SWAP32	../dbinc/db_swap.h	/^#define	SWAP32(p) {							\\$/
-SWIG_JavaExceptionCodes	../libdb_java/db_java_wrap.c	31
-SWIG_JavaThrowException	../libdb_java/db_java_wrap.c	/^static void SWIG_JavaThrowException(JNIEnv *jenv, /
-SWIG_NOINCLUDE	../libdb_java/db_java_wrap.c	75
+SWAP_IF_NEEDED	../dbinc/db_am.h	/^#define	SWAP_IF_NEEDED(sdbp, pkey)					\\$/
+SWIGEXPORT	../libdb_java/db_java_wrap.c	/^#     define SWIGEXPORT$/
+SWIGINLINE	../libdb_java/db_java_wrap.c	/^#   define SWIGINLINE inline$/
+SWIGINTERN	../libdb_java/db_java_wrap.c	/^# define SWIGINTERN static SWIGUNUSED$/
+SWIGINTERNINLINE	../libdb_java/db_java_wrap.c	/^# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE$/
+SWIGSTDCALL	../libdb_java/db_java_wrap.c	/^#   define SWIGSTDCALL __stdcall$/
+SWIGTEMPLATEDISAMBIGUATOR	../libdb_java/db_java_wrap.c	/^#     define SWIGTEMPLATEDISAMBIGUATOR template$/
+SWIGUNUSED	../libdb_java/db_java_wrap.c	/^#     define SWIGUNUSED __attribute__ ((__unused__/
+SWIGUNUSEDPARM	../libdb_java/db_java_wrap.c	/^#   define SWIGUNUSEDPARM(p)$/
+SWIG_JavaExceptionCodes	../libdb_java/db_java_wrap.c	/^} SWIG_JavaExceptionCodes;$/
+SWIG_JavaExceptions_t	../libdb_java/db_java_wrap.c	/^} SWIG_JavaExceptions_t;$/
+SWIG_JavaThrowException	../libdb_java/db_java_wrap.c	/^static void SWIGUNUSED SWIG_JavaThrowException(JNI/
+SWIG_NOINCLUDE	../libdb_java/db_java_wrap.c	/^#define	SWIG_NOINCLUDE 1$/
 SWIG_contract_assert	../libdb_java/db_java_wrap.c	/^#define SWIG_contract_assert(nullreturn, expr, msg/
-S_APPEND	../dbinc/btree.h	103
-S_DELETE	../dbinc/btree.h	117
-S_DELNO	../dbinc/btree.h	104
-S_DUPFIRST	../dbinc/btree.h	105
-S_DUPLAST	../dbinc/btree.h	106
-S_EXACT	../dbinc/btree.h	107
-S_FIND	../dbinc/btree.h	118
-S_FIND_WR	../dbinc/btree.h	119
-S_INSERT	../dbinc/btree.h	120
-S_IRGRP	../os/os_oflags.c	74
-S_IROTH	../os/os_oflags.c	80
-S_IRUSR	../os/os_oflags.c	68
+S_IRGRP	../os/os_oflags.c	/^#define	S_IRGRP	0		\/* R for group *\/$/
+S_IROTH	../os/os_oflags.c	/^#define	S_IROTH	0		\/* R for other *\/$/
+S_IRUSR	../os/os_oflags.c	/^#define	S_IRUSR	S_IREAD		\/* R for owner *\/$/
 S_ISDIR	../os/os_stat.c	/^#define	S_ISDIR(m)	(_S_IFDIR & (m))$/
-S_IWGRP	../os/os_oflags.c	77
-S_IWOTH	../os/os_oflags.c	83
-S_IWUSR	../os/os_oflags.c	71
-S_KEYFIRST	../dbinc/btree.h	121
-S_KEYLAST	../dbinc/btree.h	122
-S_PARENT	../dbinc/btree.h	108
-S_PAST_EOF	../dbinc/btree.h	110
-S_READ	../dbinc/btree.h	100
-S_STACK	../dbinc/btree.h	109
-S_STK_ONLY	../dbinc/btree.h	115
-S_WRITE	../dbinc/btree.h	101
-S_WRPAIR	../dbinc/btree.h	123
+S_IWGRP	../os/os_oflags.c	/^#define	S_IWGRP	0		\/* W for group *\/$/
+S_IWOTH	../os/os_oflags.c	/^#define	S_IWOTH	0		\/* W for other *\/$/
+S_IWUSR	../os/os_oflags.c	/^#define	S_IWUSR	S_IWRITE	\/* W for owner *\/$/
+S_IXGRP	../os/os_oflags.c	/^#define	S_IXGRP	0		\/* X for group *\/$/
+S_IXOTH	../os/os_oflags.c	/^#define	S_IXOTH	0		\/* X for other *\/$/
+S_IXUSR	../os/os_oflags.c	/^#define	S_IXUSR	0		\/* X for owner *\/$/
 TAILQ_CONCAT	../dbinc/queue.h	/^#define	TAILQ_CONCAT(head1, head2, field) do {				/
 TAILQ_EMPTY	../dbinc/queue.h	/^#define	TAILQ_EMPTY(head)	((head)->tqh_first == NU/
 TAILQ_ENTRY	../dbinc/queue.h	/^#define	TAILQ_ENTRY(type)						\\$/
@@ -1860,190 +1965,213 @@ TAILQ_LAST	../dbinc/queue.h	/^#define	TAILQ_LAST(head, headname)					\\$/
 TAILQ_NEXT	../dbinc/queue.h	/^#define	TAILQ_NEXT(elm, field) ((elm)->field.tqe_n/
 TAILQ_PREV	../dbinc/queue.h	/^#define	TAILQ_PREV(elm, headname, field)				\\$/
 TAILQ_REMOVE	../dbinc/queue.h	/^#define	TAILQ_REMOVE(head, elm, field) do {				\\$/
-TCLDB_SENDITEMS	../tcl/tcl_db_pkg.c	3467
-TEMPERING_MASK_B	../crypto/mersenne/mt19937db.c	44
-TEMPERING_MASK_C	../crypto/mersenne/mt19937db.c	45
+TCLDB_EVENTITEMS	../tcl/tcl_internal.c	/^#define	TCLDB_EVENTITEMS 2	\/* Event name and any /
+TCLDB_MAXREPFLAGS	../tcl/tcl_db_pkg.c	/^#define	TCLDB_MAXREPFLAGS 32$/
+TCLDB_SENDEVENT	../tcl/tcl_internal.c	/^#define	TCLDB_SENDEVENT 2$/
+TCLDB_SENDITEMS	../tcl/tcl_db_pkg.c	/^#define	TCLDB_SENDITEMS	7$/
+TEMPERING_MASK_B	../crypto/mersenne/mt19937db.c	/^#define TEMPERING_MASK_B 0x9d2c5680$/
+TEMPERING_MASK_C	../crypto/mersenne/mt19937db.c	/^#define TEMPERING_MASK_C 0xefc60000$/
 TEMPERING_SHIFT_L	../crypto/mersenne/mt19937db.c	/^#define TEMPERING_SHIFT_L(y)  (y >> 18)$/
 TEMPERING_SHIFT_S	../crypto/mersenne/mt19937db.c	/^#define TEMPERING_SHIFT_S(y)  (y << 7)$/
 TEMPERING_SHIFT_T	../crypto/mersenne/mt19937db.c	/^#define TEMPERING_SHIFT_T(y)  (y << 15)$/
 TEMPERING_SHIFT_U	../crypto/mersenne/mt19937db.c	/^#define TEMPERING_SHIFT_U(y)  (y >> 11)$/
-TIMESTAMP_CHECK	../rep/rep_util.c	/^#define	TIMESTAMP_CHECK(dbenv, ts, renv)			\\$/
+TESTDIR	../mutex/tm.c	/^#define	TESTDIR		"TESTDIR"		\/* Working area *\/$/
+THREAD_INFO	../dbinc/db_int.in	/^} THREAD_INFO;$/
+TIMESTAMP_CHECK	../rep/rep_util.c	/^#define	TIMESTAMP_CHECK(dbenv, ts, renv) do {				/
 TLOOP	../clib/memmove.c	/^#define	TLOOP(s) if (t) TLOOP1(s)$/
 TLOOP1	../clib/memmove.c	/^#define	TLOOP1(s) do { s; } while (--t)$/
-TMASYNC	../dbinc/xa.h	90
-TMENDRSCAN	../dbinc/xa.h	104
-TMER_INVAL	../dbinc/xa.h	122
-TMER_PROTO	../dbinc/xa.h	123
-TMER_TMERR	../dbinc/xa.h	120
-TMFAIL	../dbinc/xa.h	93
-TMJOIN	../dbinc/xa.h	107
-TMMIGRATE	../dbinc/xa.h	109
-TMMULTIPLE	../dbinc/xa.h	105
-TMNOFLAGS	../dbinc/xa.h	78
-TMNOMIGRATE	../dbinc/xa.h	82
-TMNOWAIT	../dbinc/xa.h	95
-TMONEPHASE	../dbinc/xa.h	91
-TMREGISTER	../dbinc/xa.h	80
-TMRESUME	../dbinc/xa.h	97
-TMSTARTRSCAN	../dbinc/xa.h	103
-TMSUCCESS	../dbinc/xa.h	99
-TMSUSPEND	../dbinc/xa.h	101
-TMUSEASYNC	../dbinc/xa.h	84
-TM_JOIN	../dbinc/xa.h	115
-TM_OK	../dbinc/xa.h	119
-TM_RESUME	../dbinc/xa.h	117
-TRACEBUF	../dbinc/queue.h	193
+TM	../mutex/tm.c	/^} TM;$/
+TMASYNC	../dbinc/xa.h	/^#define	TMASYNC		0x80000000L	\/* perform routine a/
+TMENDRSCAN	../dbinc/xa.h	/^#define	TMENDRSCAN	0x00800000L	\/* end a recovery /
+TMER_INVAL	../dbinc/xa.h	/^#define	TMER_INVAL	-2		\/* invalid arguments were /
+TMER_PROTO	../dbinc/xa.h	/^#define	TMER_PROTO	-3		\/* routine invoked in an i/
+TMER_TMERR	../dbinc/xa.h	/^#define	TMER_TMERR	-1		\/* an error occurred in th/
+TMFAIL	../dbinc/xa.h	/^#define	TMFAIL		0x20000000L	\/* dissociates caller/
+TMJOIN	../dbinc/xa.h	/^#define	TMJOIN		0x00200000L	\/* caller is joining /
+TMMIGRATE	../dbinc/xa.h	/^#define	TMMIGRATE	0x00100000L	\/* caller intends t/
+TMMULTIPLE	../dbinc/xa.h	/^#define	TMMULTIPLE	0x00400000L	\/* wait for any as/
+TMNOFLAGS	../dbinc/xa.h	/^#define	TMNOFLAGS	0x00000000L	\/* no resource mana/
+TMNOMIGRATE	../dbinc/xa.h	/^#define	TMNOMIGRATE	0x00000002L	\/* resource manag/
+TMNOWAIT	../dbinc/xa.h	/^#define	TMNOWAIT	0x10000000L	\/* return if blockin/
+TMONEPHASE	../dbinc/xa.h	/^#define	TMONEPHASE	0x40000000L	\/* caller is using/
+TMREGISTER	../dbinc/xa.h	/^#define	TMREGISTER	0x00000001L	\/* resource manage/
+TMRESUME	../dbinc/xa.h	/^#define	TMRESUME	0x08000000L	\/* caller is resumin/
+TMSTARTRSCAN	../dbinc/xa.h	/^#define	TMSTARTRSCAN	0x01000000L	\/* start a recov/
+TMSUCCESS	../dbinc/xa.h	/^#define	TMSUCCESS	0x04000000L	\/* dissociate calle/
+TMSUSPEND	../dbinc/xa.h	/^#define	TMSUSPEND	0x02000000L	\/* caller is suspen/
+TMUSEASYNC	../dbinc/xa.h	/^#define	TMUSEASYNC	0x00000004L	\/* resource manage/
+TM_JOIN	../dbinc/xa.h	/^#define	TM_JOIN		2		\/* caller is joining existing/
+TM_OK	../dbinc/xa.h	/^#define	TM_OK		0		\/* normal execution *\/$/
+TM_RESUME	../dbinc/xa.h	/^#define	TM_RESUME	1		\/* caller is resuming associ/
+TRACEBUF	../dbinc/queue.h	/^#define	TRACEBUF	struct qm_trace trace;$/
 TRASHIT	../dbinc/queue.h	/^#define	TRASHIT(x)	do {(x) = (void *)-1;} while (0/
-TRUE	../crypto/rijndael/rijndael-api-fst.h	53
-TXN2JDBENV	../libdb_java/db_java_wrap.c	814
-TXNLIST_NEW	../dbinc/db_dispatch.h	101
-TXN_ABORT	../dbinc/txn.h	207
-TXN_ABORTED	../dbinc/txn.h	47
-TXN_BUBBLE	../db/db_dispatch.c	/^#define	TXN_BUBBLE(AP, MAX) {						\\$/
-TXN_CHILDCOMMIT	../dbinc/db.in	898
-TXN_COMMIT	../dbinc/txn.h	205
-TXN_COMMITTED	../dbinc/txn.h	49
-TXN_COMPENSATE	../dbinc/db.in	899
-TXN_DEADLOCK	../dbinc/db.in	900
-TXN_DEGREE_2	../dbinc/db.in	901
-TXN_DIRTY_READ	../dbinc/db.in	902
-TXN_DTL_COLLECTED	../dbinc/txn.h	51
-TXN_DTL_RESTORED	../dbinc/txn.h	52
-TXN_EVENT	../txn/txn_util.c	25
-TXN_EVENT_T	../dbinc/txn.h	21
-TXN_EXPECTED	../dbinc/txn.h	209
-TXN_IGNORE	../dbinc/txn.h	208
-TXN_INVALID	../dbinc/txn.h	32
-TXN_IN_RECOVERY	../dbinc/txn.h	115
-TXN_LOCKTIMEOUT	../dbinc/db.in	903
-TXN_MAINT_SIZE	../dbinc/txn.h	120
-TXN_MALLOC	../dbinc/db.in	904
-TXN_MAXIMUM	../dbinc/txn.h	31
-TXN_MINIMUM	../dbinc/txn.h	30
-TXN_NOSYNC	../dbinc/db.in	905
-TXN_NOWAIT	../dbinc/db.in	906
-TXN_OK	../dbinc/txn.h	204
+TRUE	../dbinc/db_int.in	/^#define	TRUE		(!FALSE)$/
+TXN2JDBENV	../libdb_java/db_java_wrap.c	/^#define	TXN2JDBENV ((jobject)DB_ENV_INTERNAL(arg1-/
+TXN_ABORT	../dbinc/txn.h	/^#define	TXN_ABORT	3$/
+TXN_ABORTED	../dbinc/db.in	/^#define	TXN_ABORTED		1$/
+TXN_CDSGROUP	../dbinc/db.in	/^#define	TXN_CDSGROUP		0x0002	\/* CDS group handle./
+TXN_CHILDCOMMIT	../dbinc/db.in	/^#define	TXN_CHILDCOMMIT		0x0001	\/* Txn has commit/
+TXN_COMMIT	../dbinc/txn.h	/^#define	TXN_COMMIT	1$/
+TXN_COMMITTED	../dbinc/db.in	/^#define	TXN_COMMITTED		2$/
+TXN_COMPENSATE	../dbinc/db.in	/^#define	TXN_COMPENSATE		0x0004	\/* Compensating tr/
+TXN_DEADLOCK	../dbinc/db.in	/^#define	TXN_DEADLOCK		0x0008	\/* Txn has deadlocke/
+TXN_DETAIL	../dbinc/txn.h	/^} TXN_DETAIL;$/
+TXN_DTL_COLLECTED	../dbinc/txn.h	/^#define	TXN_DTL_COLLECTED	0x1	\/* collected during/
+TXN_DTL_INMEMORY	../dbinc/txn.h	/^#define	TXN_DTL_INMEMORY	0x4	\/* uses in memory lo/
+TXN_DTL_RESTORED	../dbinc/txn.h	/^#define	TXN_DTL_RESTORED	0x2	\/* prepared txn rest/
+TXN_EVENT	../txn/txn_util.c	/^typedef struct __txn_event TXN_EVENT;$/
+TXN_EVENT_T	../dbinc/txn.h	/^} TXN_EVENT_T;$/
+TXN_EXPECTED	../dbinc/txn.h	/^#define	TXN_EXPECTED	5$/
+TXN_IGNORE	../dbinc/txn.h	/^#define	TXN_IGNORE	4$/
+TXN_INVALID	../dbinc/txn.h	/^#define	TXN_INVALID	0		\/* Invalid transaction ID./
+TXN_IN_RECOVERY	../dbinc/txn.h	/^#define	TXN_IN_RECOVERY	 0x01		\/* environment is /
+TXN_LOCKTIMEOUT	../dbinc/db.in	/^#define	TXN_LOCKTIMEOUT		0x0010	\/* Txn has a lock/
+TXN_MALLOC	../dbinc/db.in	/^#define	TXN_MALLOC		0x0020	\/* Structure allocated/
+TXN_MAXIMUM	../dbinc/txn.h	/^#define	TXN_MAXIMUM	0xffffffff	\/* Maximum number /
+TXN_MINIMUM	../dbinc/txn.h	/^#define	TXN_MINIMUM	0x80000000$/
+TXN_NOSYNC	../dbinc/db.in	/^#define	TXN_NOSYNC		0x0040	\/* Do not sync on prep/
+TXN_NOWAIT	../dbinc/db.in	/^#define	TXN_NOWAIT		0x0080	\/* Do not wait on lock/
+TXN_OK	../dbinc/txn.h	/^#define	TXN_OK		0$/
 TXN_ON	../dbinc/db_int.in	/^#define	TXN_ON(dbenv)		((dbenv)->tx_handle != NULL/
-TXN_PREPARE	../dbinc/txn.h	206
-TXN_PREPARED	../dbinc/txn.h	48
-TXN_RESTORED	../dbinc/db.in	907
-TXN_RUNNING	../dbinc/txn.h	46
-TXN_SYNC	../dbinc/db.in	908
-TXN_UNEXPECTED	../dbinc/txn.h	210
-TXN_XA_ABORTED	../dbinc/txn.h	57
-TXN_XA_DEADLOCKED	../dbinc/txn.h	58
-TXN_XA_ENDED	../dbinc/txn.h	59
-TXN_XA_PREPARED	../dbinc/txn.h	60
-TXN_XA_STARTED	../dbinc/txn.h	61
-TXN_XA_SUSPENDED	../dbinc/txn.h	62
+TXN_PREPARE	../dbinc/txn.h	/^#define	TXN_PREPARE	2$/
+TXN_PREPARED	../dbinc/db.in	/^#define	TXN_PREPARED		3$/
+TXN_PRIVATE	../dbinc/db.in	/^#define	TXN_PRIVATE		0x0100	\/* Txn owned by curso/
+TXN_READ_COMMITTED	../dbinc/db.in	/^#define	TXN_READ_COMMITTED	0x0200	\/* Txn has degr/
+TXN_READ_UNCOMMITTED	../dbinc/db.in	/^#define	TXN_READ_UNCOMMITTED	0x0400	\/* Txn has de/
+TXN_RESTORED	../dbinc/db.in	/^#define	TXN_RESTORED		0x0800	\/* Txn has been rest/
+TXN_RUNNING	../dbinc/db.in	/^#define	TXN_RUNNING		4$/
+TXN_SNAPSHOT	../dbinc/db.in	/^#define	TXN_SNAPSHOT		0x1000	\/* Snapshot Isolatio/
+TXN_SYNC	../dbinc/db.in	/^#define	TXN_SYNC		0x2000	\/* Write and sync on pre/
+TXN_SYNC_FLAGS	../dbinc/db.in	/^#define	TXN_SYNC_FLAGS (TXN_SYNC | TXN_NOSYNC | TX/
+TXN_SYSTEM_LOCK	../dbinc/txn.h	/^#define	TXN_SYSTEM_LOCK(dbenv)						\\$/
+TXN_SYSTEM_UNLOCK	../dbinc/txn.h	/^#define	TXN_SYSTEM_UNLOCK(dbenv)					\\$/
+TXN_UNEXPECTED	../dbinc/txn.h	/^#define	TXN_UNEXPECTED	6$/
+TXN_WRITE_NOSYNC	../dbinc/db.in	/^#define	TXN_WRITE_NOSYNC	0x4000	\/* Write only on /
+TXN_XA_ABORTED	../dbinc/db.in	/^#define	TXN_XA_ABORTED		1$/
+TXN_XA_DEADLOCKED	../dbinc/db.in	/^#define	TXN_XA_DEADLOCKED	2$/
+TXN_XA_ENDED	../dbinc/db.in	/^#define	TXN_XA_ENDED		3$/
+TXN_XA_PREPARED	../dbinc/db.in	/^#define	TXN_XA_PREPARED		4$/
+TXN_XA_STARTED	../dbinc/db.in	/^#define	TXN_XA_STARTED		5$/
+TXN_XA_SUSPENDED	../dbinc/db.in	/^#define	TXN_XA_SUSPENDED	6$/
 TYPE	../dbinc/db_page.h	/^#define	TYPE(p)		(((PAGE *)p)->type)$/
-TYPE_ERR_PRINT	../dbinc/db_verify.h	/^#define	TYPE_ERR_PRINT(dbenv, func, pgno, ptype)		/
 T_RESTORED	../db/db_dispatch.c	/^#define	T_RESTORED(txn)       ((txn) != NULL && F_/
-UINT16_MAX	../dbinc/db_int.in	39
+UINT16_MAX	../dbinc/db_int.in	/^#define	UINT16_MAX	65535		\/* Maximum 16-bit unsig/
 UINT32_CMP	../lock/lock_list.c	/^#define	UINT32_CMP(A, B)	((A) == (B) ? 0 : ((A) > /
-UINT32_MAX	../dbinc/db_int.in	43
-UINT64_FMT	../dbinc/db_int.in	60
-UINT64_MAX	../dbinc/db_int.in	57
+UINT32_MAX	../dbinc/db_int.in	/^#define	UINT32_MAX	4294967295U	\/* Maximum 32-bit /
+UINT64_MAX	../dbinc/db_int.in	/^#define	UINT64_MAX	_UI64_MAX$/
 UMRW_SET	../dbinc/debug.h	/^#define	UMRW_SET(v)	(v) = 0$/
-UNLOCKREGION	../dbinc/lock.h	/^#define	UNLOCKREGION(dbenv, lt)  R_UNLOCK((dbenv),/
-UPPER_MASK	../crypto/mersenne/mt19937db.c	40
-UPREFIX	../clib/strerror.c	55
-USEC_PER_MS	../dbinc/db_int.in	80
-VERIFY_FLAGS	../db/db_vrfy.c	65
-VRFY_CHILDINFO	../dbinc/db_int.in	529
-VRFY_DBINFO	../dbinc/db_int.in	530
-VRFY_DUPS_UNSORTED	../dbinc/db_verify.h	182
-VRFY_HAS_DUPS	../dbinc/db_verify.h	183
-VRFY_HAS_DUPSORT	../dbinc/db_verify.h	184
-VRFY_HAS_RECNUMS	../dbinc/db_verify.h	186
-VRFY_HAS_SUBDBS	../dbinc/db_verify.h	185
-VRFY_INCOMPLETE	../dbinc/db_verify.h	187
-VRFY_IS_ALLZEROES	../dbinc/db_verify.h	188
-VRFY_IS_FIXEDLEN	../dbinc/db_verify.h	189
-VRFY_IS_RECNO	../dbinc/db_verify.h	190
-VRFY_IS_RRECNO	../dbinc/db_verify.h	191
-VRFY_ITEM	../btree/bt_verify.c	507
-VRFY_LEAFCHAIN_BROKEN	../dbinc/db_verify.h	138
-VRFY_OVFL_LEAFSEEN	../dbinc/db_verify.h	192
-VRFY_PAGEINFO	../dbinc/db_int.in	531
-VRFY_QMETA_SET	../dbinc/db_verify.h	139
-V_DUPLICATE	../dbinc/db_verify.h	203
-V_OVERFLOW	../dbinc/db_verify.h	204
-V_RECNO	../dbinc/db_verify.h	205
-WRAPPED_CLASS	../dbinc/cxx_int.h	/^#define	WRAPPED_CLASS(_WRAPPER_CLASS, _IMP_CLASS, /
-XAER_ASYNC	../dbinc/xa.h	164
-XAER_DUPID	../dbinc/xa.h	173
-XAER_INVAL	../dbinc/xa.h	169
-XAER_NOTA	../dbinc/xa.h	168
-XAER_OUTSIDE	../dbinc/xa.h	174
-XAER_PROTO	../dbinc/xa.h	170
-XAER_RMERR	../dbinc/xa.h	166
-XAER_RMFAIL	../dbinc/xa.h	172
-XA_FLAGS	../xa/xa.c	174
-XA_H	../dbinc/xa.h	15
-XA_HEURCOM	../dbinc/xa.h	152
-XA_HEURHAZ	../dbinc/xa.h	150
-XA_HEURMIX	../dbinc/xa.h	156
-XA_HEURRB	../dbinc/xa.h	154
-XA_NOMIGRATE	../dbinc/xa.h	148
-XA_OK	../dbinc/xa.h	163
-XA_RBBASE	../dbinc/xa.h	129
-XA_RBCOMMFAIL	../dbinc/xa.h	133
-XA_RBDEADLOCK	../dbinc/xa.h	135
-XA_RBEND	../dbinc/xa.h	146
-XA_RBINTEGRITY	../dbinc/xa.h	136
-XA_RBOTHER	../dbinc/xa.h	139
-XA_RBPROTO	../dbinc/xa.h	142
-XA_RBROLLBACK	../dbinc/xa.h	131
-XA_RBTIMEOUT	../dbinc/xa.h	144
-XA_RBTRANSIENT	../dbinc/xa.h	145
-XA_RDONLY	../dbinc/xa.h	161
-XA_RETRY	../dbinc/xa.h	159
-XID	../dbinc/xa.h	30
-XIDDATASIZE	../dbinc/xa.h	20
+UNLOCK_MUTEX	../dbinc/repmgr.h	/^#define	UNLOCK_MUTEX(m) do {						\\$/
+UPPER_MASK	../crypto/mersenne/mt19937db.c	/^#define UPPER_MASK 0x80000000 \/* most significant/
+USEC_PER_MS	../dbinc/db_int.in	/^#define	USEC_PER_MS	1000		\/* Microseconds in a mi/
+VERIFY_FLAGS	../db/db_vrfy.c	/^#define	VERIFY_FLAGS							\\$/
+VISIBLE_LSN	../dbinc/mp.h	/^#define	VISIBLE_LSN(dbenv, bhp)						\\$/
+VM_PAGESIZE	../dbinc/mp.h	/^#define	VM_PAGESIZE 4096$/
+VRFY_CHILDINFO	../dbinc/db_int.in	/^struct __vrfy_childinfo;typedef struct __vrfy_chil/
+VRFY_DBINFO	../dbinc/db_int.in	/^struct __vrfy_dbinfo;   typedef struct __vrfy_dbin/
+VRFY_DUPS_UNSORTED	../dbinc/db_verify.h	/^#define	VRFY_DUPS_UNSORTED	0x0001	\/* Have to flag/
+VRFY_HAS_CHKSUM	../dbinc/db_verify.h	/^#define	VRFY_HAS_CHKSUM		0x0002$/
+VRFY_HAS_DUPS	../dbinc/db_verify.h	/^#define	VRFY_HAS_DUPS		0x0004$/
+VRFY_HAS_DUPSORT	../dbinc/db_verify.h	/^#define	VRFY_HAS_DUPSORT	0x0008	\/* Has the flag s/
+VRFY_HAS_RECNUMS	../dbinc/db_verify.h	/^#define	VRFY_HAS_RECNUMS	0x0010$/
+VRFY_HAS_SUBDBS	../dbinc/db_verify.h	/^#define	VRFY_HAS_SUBDBS		0x0020$/
+VRFY_INCOMPLETE	../dbinc/db_verify.h	/^#define	VRFY_INCOMPLETE		0x0040	\/* Meta or item o/
+VRFY_IS_ALLZEROES	../dbinc/db_verify.h	/^#define	VRFY_IS_ALLZEROES	0x0080	\/* Hash page we /
+VRFY_IS_FIXEDLEN	../dbinc/db_verify.h	/^#define	VRFY_IS_FIXEDLEN	0x0100$/
+VRFY_IS_RECNO	../dbinc/db_verify.h	/^#define	VRFY_IS_RECNO		0x0200$/
+VRFY_IS_RRECNO	../dbinc/db_verify.h	/^#define	VRFY_IS_RRECNO		0x0400$/
+VRFY_ITEM	../btree/bt_verify.c	/^typedef enum { VRFY_ITEM_NOTSET=0, VRFY_ITEM_BEGIN/
+VRFY_LEAFCHAIN_BROKEN	../dbinc/db_verify.h	/^#define	VRFY_LEAFCHAIN_BROKEN	0x08	\/* Lost one or/
+VRFY_OVFL_LEAFSEEN	../dbinc/db_verify.h	/^#define	VRFY_OVFL_LEAFSEEN	0x0800$/
+VRFY_PAGEINFO	../dbinc/db_int.in	/^struct __vrfy_pageinfo; typedef struct __vrfy_page/
+VRFY_QMETA_SET	../dbinc/db_verify.h	/^#define	VRFY_QMETA_SET		0x10    \/* We've seen a Q/
+V_DUPLICATE	../dbinc/db_verify.h	/^#define	V_DUPLICATE	1		\/* off-page dup metadata */
+V_OVERFLOW	../dbinc/db_verify.h	/^#define	V_OVERFLOW	2		\/* overflow page *\/$/
+V_RECNO	../dbinc/db_verify.h	/^#define	V_RECNO		3		\/* btree internal or leaf pag/
+WAITER_SLOT_IN_USE	../repmgr/repmgr_windows.c	/^#define	WAITER_SLOT_IN_USE(w) ((w)->lsnp != NULL)$/
+WOULDBLOCK	../dbinc/repmgr.h	/^#define	WOULDBLOCK		WSAEWOULDBLOCK$/
+WRAPPED_CLASS	../dbinc/cxx_int.h	/^\/\/$/
+XAER_ASYNC	../dbinc/xa.h	/^#define	XAER_ASYNC	-2		\/* asynchronous operation /
+XAER_DUPID	../dbinc/xa.h	/^#define	XAER_DUPID	-8		\/* the XID already exists /
+XAER_INVAL	../dbinc/xa.h	/^#define	XAER_INVAL	-5		\/* invalid arguments were /
+XAER_NOTA	../dbinc/xa.h	/^#define	XAER_NOTA	-4		\/* the XID is not valid *\//
+XAER_OUTSIDE	../dbinc/xa.h	/^#define	XAER_OUTSIDE	-9		\/* resource manager doin/
+XAER_PROTO	../dbinc/xa.h	/^#define	XAER_PROTO	-6		\/* routine invoked in an i/
+XAER_RMERR	../dbinc/xa.h	/^#define	XAER_RMERR	-3		\/* a resource manager erro/
+XAER_RMFAIL	../dbinc/xa.h	/^#define	XAER_RMFAIL	-7		\/* resource manager unava/
+XA_FLAGS	../xa/xa.c	/^#define	XA_FLAGS \\$/
+XA_HEURCOM	../dbinc/xa.h	/^#define	XA_HEURCOM	7		\/* the transaction branch h/
+XA_HEURHAZ	../dbinc/xa.h	/^#define	XA_HEURHAZ	8		\/* the transaction branch m/
+XA_HEURMIX	../dbinc/xa.h	/^#define	XA_HEURMIX	5		\/* the transaction branch h/
+XA_HEURRB	../dbinc/xa.h	/^#define	XA_HEURRB	6		\/* the transaction branch ha/
+XA_METHODS	../xa/xa_db.c	/^} XA_METHODS;$/
+XA_NOMIGRATE	../dbinc/xa.h	/^#define	XA_NOMIGRATE	9		\/* resumption must occur /
+XA_OK	../dbinc/xa.h	/^#define	XA_OK		0		\/* normal execution *\/$/
+XA_RBBASE	../dbinc/xa.h	/^#define	XA_RBBASE	100		\/* The inclusive lower bou/
+XA_RBCOMMFAIL	../dbinc/xa.h	/^#define	XA_RBCOMMFAIL	XA_RBBASE+1	\/* The rollback/
+XA_RBDEADLOCK	../dbinc/xa.h	/^#define	XA_RBDEADLOCK	XA_RBBASE+2	\/* A deadlock w/
+XA_RBEND	../dbinc/xa.h	/^#define	XA_RBEND	XA_RBTRANSIENT	\/* The inclusive /
+XA_RBINTEGRITY	../dbinc/xa.h	/^#define	XA_RBINTEGRITY	XA_RBBASE+3	\/* A condition/
+XA_RBOTHER	../dbinc/xa.h	/^#define	XA_RBOTHER	XA_RBBASE+4	\/* The resource ma/
+XA_RBPROTO	../dbinc/xa.h	/^#define	XA_RBPROTO	XA_RBBASE+5	\/* A protocol erro/
+XA_RBROLLBACK	../dbinc/xa.h	/^#define	XA_RBROLLBACK	XA_RBBASE	\/* The rollback w/
+XA_RBTIMEOUT	../dbinc/xa.h	/^#define	XA_RBTIMEOUT	XA_RBBASE+6	\/* A transaction/
+XA_RBTRANSIENT	../dbinc/xa.h	/^#define	XA_RBTRANSIENT	XA_RBBASE+7	\/* May retry t/
+XA_RDONLY	../dbinc/xa.h	/^#define	XA_RDONLY	3		\/* the transaction branch wa/
+XA_RETRY	../dbinc/xa.h	/^#define	XA_RETRY	4		\/* routine returned with no e/
+XID	../dbinc/xa.h	/^typedef	struct xid_t XID;$/
+XIDDATASIZE	../dbinc/xa.h	/^#define	XIDDATASIZE	128		\/* size in bytes *\/$/
+XID_FIELD_IS_SET	../txn/txn_stat.c	/^#define	XID_FIELD_IS_SET(p)						\\$/
 ZEROPG_ERR_PRINT	../dbinc/db_verify.h	/^#define	ZEROPG_ERR_PRINT(dbenv, pgno, str) do {			/
 ZERO_LSN	../dbinc/db_int.in	/^#define	ZERO_LSN(LSN) do {						\\$/
-ZF_LARGE_WRITE	../os/os_rw.c	273
-_CXX_INT_H_	../dbinc/cxx_int.h	11
+ZF_LARGE_WRITE	../os/os_fzero.c	/^#define	ZF_LARGE_WRITE	(64 * 1024)$/
+_CRT_SECURE_NO_DEPRECATE	../libdb_java/db_java_wrap.c	/^# define _CRT_SECURE_NO_DEPRECATE$/
 _CopyObjBytes	../tcl/tcl_internal.c	/^_CopyObjBytes(interp, obj, newp, sizep, freep)$/
-_DB_185_H_	../dbinc/db_185.in	39
-_DB_AM_H_	../dbinc/db_am.h	10
-_DB_BTREE_H_	../dbinc/btree.h	45
-_DB_CRYPTO_H_	../dbinc/crypto.h	11
-_DB_CXX_H_	../dbinc/db_cxx.in	11
-_DB_DEBUG_H_	../dbinc/debug.h	11
-_DB_DISPATCH_H_	../dbinc/db_dispatch.h	39
-_DB_HASH_H_	../dbinc/hash.h	46
-_DB_HMAC_H_	../dbinc/hmac.h	11
-_DB_H_	../dbinc/db.in	22
-_DB_INTERNAL_H_	../dbinc/db_int.in	11
-_DB_JOIN_H_	../dbinc/db_join.h	11
-_DB_LOCK_H_	../dbinc/lock.h	11
-_DB_MP_H_	../dbinc/mp.h	11
-_DB_MUTEX_H_	../dbinc/mutex.h	11
-_DB_OS_H_	../dbinc/os.h	11
-_DB_PAGE_H_	../dbinc/db_page.h	11
-_DB_QAM_H_	../dbinc/qam.h	11
-_DB_QUEUE_H_	../dbinc/queue.h	39
-_DB_REGION_H_	../dbinc/region.h	11
-_DB_SERVER_INT_H_	../dbinc/db_server_int.h	11
-_DB_SHASH_H_	../dbinc/db_shash.h	11
-_DB_SWAP_H_	../dbinc/db_swap.h	39
-_DB_TCL_DB_H_	../dbinc/tcl_db.h	11
-_DB_UPGRADE_H_	../dbinc/db_upgrade.h	11
-_DB_VERIFY_H_	../dbinc/db_verify.h	11
+_DB_185_H_	../dbinc/db_185.in	/^#define	_DB_185_H_$/
+_DB_AM_H_	../dbinc/db_am.h	/^#define	_DB_AM_H_$/
+_DB_BTREE_H_	../dbinc/btree.h	/^#define	_DB_BTREE_H_$/
+_DB_CRYPTO_H_	../dbinc/crypto.h	/^#define	_DB_CRYPTO_H_$/
+_DB_CXX_H_	../dbinc/db_cxx.in	/^#define	_DB_CXX_H_$/
+_DB_CXX_INT_H_	../dbinc/cxx_int.h	/^#define	_DB_CXX_INT_H_$/
+_DB_DEBUG_H_	../dbinc/debug.h	/^#define	_DB_DEBUG_H_$/
+_DB_DISPATCH_H_	../dbinc/db_dispatch.h	/^#define	_DB_DISPATCH_H_$/
+_DB_FOP_H_	../dbinc/fop.h	/^#define	_DB_FOP_H_$/
+_DB_GLOBALS_H_	../dbinc/globals.h	/^#define	_DB_GLOBALS_H_$/
+_DB_HASH_H_	../dbinc/hash.h	/^#define	_DB_HASH_H_$/
+_DB_HMAC_H_	../dbinc/hmac.h	/^#define	_DB_HMAC_H_$/
+_DB_H_	../dbinc/db.in	/^#define	_DB_H_$/
+_DB_INT_H_	../dbinc/db_int.in	/^#define	_DB_INT_H_$/
+_DB_JOIN_H_	../dbinc/db_join.h	/^#define	_DB_JOIN_H_$/
+_DB_LOCK_H_	../dbinc/lock.h	/^#define	_DB_LOCK_H_$/
+_DB_LOG_H_	../dbinc/log.h	/^#define	_DB_LOG_H_$/
+_DB_MP_H_	../dbinc/mp.h	/^#define	_DB_MP_H_$/
+_DB_MUTEX_H_	../dbinc/mutex.h	/^#define	_DB_MUTEX_H_$/
+_DB_MUTEX_INT_H_	../dbinc/mutex_int.h	/^#define	_DB_MUTEX_INT_H_$/
+_DB_OS_H_	../dbinc/os.h	/^#define	_DB_OS_H_$/
+_DB_PAGE_H_	../dbinc/db_page.h	/^#define	_DB_PAGE_H_$/
+_DB_QAM_H_	../dbinc/qam.h	/^#define	_DB_QAM_H_$/
+_DB_QUEUE_H_	../dbinc/queue.h	/^#define	_DB_QUEUE_H_$/
+_DB_REGION_H_	../dbinc/region.h	/^#define	_DB_REGION_H_$/
+_DB_REPMGR_H_	../dbinc/repmgr.h	/^#define	_DB_REPMGR_H_$/
+_DB_REP_H_	../dbinc/rep.h	/^#define	_DB_REP_H_$/
+_DB_SERVER_INT_H_	../dbinc/db_server_int.h	/^#define	_DB_SERVER_INT_H_$/
+_DB_SHQUEUE_H_	../dbinc/shqueue.h	/^#define	_DB_SHQUEUE_H_$/
+_DB_SWAP_H_	../dbinc/db_swap.h	/^#define	_DB_SWAP_H_$/
+_DB_TCL_DB_H_	../dbinc/tcl_db.h	/^#define	_DB_TCL_DB_H_$/
+_DB_TXN_H_	../dbinc/txn.h	/^#define	_DB_TXN_H_$/
+_DB_UPGRADE_H_	../dbinc/db_upgrade.h	/^#define	_DB_UPGRADE_H_$/
+_DB_VERIFY_H_	../dbinc/db_verify.h	/^#define	_DB_VERIFY_H_$/
+_DB_XA_H_	../dbinc/xa.h	/^#define	_DB_XA_H_$/
 _DbInfoDelete	../tcl/tcl_db.c	/^_DbInfoDelete(interp, dbip)$/
 _DeleteInfo	../tcl/tcl_internal.c	/^_DeleteInfo(p)$/
 _EnvInfoDelete	../tcl/tcl_env.c	/^_EnvInfoDelete(interp, envip)$/
 _ErrorFunc	../tcl/tcl_internal.c	/^_ErrorFunc(dbenv, pfx, msg)$/
 _ErrorSetup	../tcl/tcl_internal.c	/^_ErrorSetup(interp, ret, errmsg)$/
-_FOP_H_	../dbinc/fop.h	11
+_EventFunc	../tcl/tcl_internal.c	/^_EventFunc(dbenv, event, info)$/
 _GetFlagsList	../tcl/tcl_internal.c	/^_GetFlagsList(interp, flags, fnp)$/
 _GetGlobPrefix	../tcl/tcl_internal.c	/^_GetGlobPrefix(pattern, prefix)$/
 _GetLsn	../tcl/tcl_internal.c	/^_GetLsn(interp, obj, lsn)$/
 _GetThisLock	../tcl/tcl_lock.c	/^_GetThisLock(interp, envp, lockid, flag, objp, mod/
 _GetUInt32	../tcl/tcl_internal.c	/^_GetUInt32(interp, obj, resp)$/
-_LOG_H_	../dbinc/log.h	11
 _LockMode	../tcl/tcl_lock.c	/^_LockMode(interp, obj, mode)$/
 _LockPutInfo	../tcl/tcl_lock.c	/^_LockPutInfo(interp, op, lock, lockid, objp)$/
 _MpInfoDelete	../tcl/tcl_mp.c	/^_MpInfoDelete(interp, mpip)$/
@@ -2051,9 +2179,7 @@ _NameToInfo	../tcl/tcl_internal.c	/^_NameToInfo(name)$/
 _NameToPtr	../tcl/tcl_internal.c	/^_NameToPtr(name)$/
 _NewInfo	../tcl/tcl_internal.c	/^_NewInfo(interp, anyp, name, type)$/
 _PtrToInfo	../tcl/tcl_internal.c	/^_PtrToInfo(ptr)$/
-_REP_H_	../dbinc/rep.h	9
 _ReturnSetup	../tcl/tcl_internal.c	/^_ReturnSetup(interp, ret, ok, errmsg)$/
-_SYS_SHQUEUE_H_	../dbinc/shqueue.h	11
 _Set3DBTList	../tcl/tcl_internal.c	/^_Set3DBTList(interp, list, elem1, is1recno, elem2,/
 _SetInfoData	../tcl/tcl_internal.c	/^_SetInfoData(p, data)$/
 _SetListElem	../tcl/tcl_internal.c	/^_SetListElem(interp, list, elem1, e1cnt, elem2, e2/
@@ -2061,24 +2187,25 @@ _SetListElemInt	../tcl/tcl_internal.c	/^_SetListElemInt(interp, list, elem1, ele
 _SetListElemWideInt	../tcl/tcl_internal.c	/^_SetListElemWideInt(interp, list, elem1, elem2)$/
 _SetListRecnoElem	../tcl/tcl_internal.c	/^_SetListRecnoElem(interp, list, elem1, elem2, e2si/
 _SetMultiList	../tcl/tcl_internal.c	/^_SetMultiList(interp, list, key, data, type, flag)/
-_TXN_H_	../dbinc/txn.h	11
 _TxnInfoDelete	../tcl/tcl_txn.c	/^_TxnInfoDelete(interp, txnip)$/
-__BIT_TYPES_DEFINED__	../dbinc/db.in	62
-__DBC_INTERNAL	../dbinc/db_int.in	376
-__DB_OVFL	../env/env_open.c	/^#define	__DB_OVFL(v, max)						\\$/
+__BIT_TYPES_DEFINED__	../dbinc/db.in	/^#define	__BIT_TYPES_DEFINED__$/
+__DBC_INTERNAL	../dbinc/db_int.in	/^#define	__DBC_INTERNAL							\\$/
 __DB_STD	../dbinc/db_cxx.in	/^#define	__DB_STD(x)	std::x$/
-__ENV_LPUT	../dbinc/db_am.h	/^#define	__ENV_LPUT(dbenv, lock, flags)					\\$/
+__ENV_LPUT	../dbinc/db_am.h	/^#define	__ENV_LPUT(dbenv, lock)						\\$/
+__INCLUDE_NETWORKING	../clib/getaddrinfo.c	/^#define	__INCLUDE_NETWORKING	1$/
+__INCLUDE_SELECT_H	../os/os_sleep.c	/^#define	__INCLUDE_SELECT_H	1$/
 __LPUT	../dbinc/db_am.h	/^#define	__LPUT(dbc, lock)						\\$/
-__P	../dbinc/db_185.in	/^#define	__P(protos)	protos		\/* ANSI C prototypes */
-__P_DUPLICATE	../dbinc/db_page.h	38
-__RIJNDAEL_ALG_FST_H	../crypto/rijndael/rijndael-alg-fst.h	30
-__RIJNDAEL_API_FST_H	../crypto/rijndael/rijndael-api-fst.h	42
-__R_UNUSED	../dbinc/db_185.in	94
+__P	../dbinc/db_185.in	/^#define	__P(protos)	protos		\/* ANSI C prototypes /
+__P_DUPLICATE	../dbinc/db_page.h	/^#define	__P_DUPLICATE	1	\/* Duplicate. DEPRECATED /
+__RIJNDAEL_ALG_FST_H	../crypto/rijndael/rijndael-alg-fst.h	/^#define __RIJNDAEL_ALG_FST_H$/
+__RIJNDAEL_API_FST_H	../crypto/rijndael/rijndael-api-fst.h	/^#define __RIJNDAEL_API_FST_H$/
+__R_UNUSED	../dbinc/db_185.in	/^#define	__R_UNUSED	2		\/* UNUSED *\/$/
 __SH_LIST_PREV_OFF	../dbinc/shqueue.h	/^#define	__SH_LIST_PREV_OFF(elm, field)					\\$/
 __SH_TAILQ_LAST_OFF	../dbinc/shqueue.h	/^#define	__SH_TAILQ_LAST_OFF(head)					\\$/
 __SH_TAILQ_PREV_OFF	../dbinc/shqueue.h	/^#define	__SH_TAILQ_PREV_OFF(elm, field)					\\$/
 __TLPUT	../dbinc/db_am.h	/^#define	__TLPUT(dbc, lock)						\\$/
 __absname	../log/log_archive.c	/^__absname(dbenv, pref, name, newnamep)$/
+__ack_waiters_table	../repmgr/repmgr_windows.c	/^struct __ack_waiters_table {$/
 __aes_adj_size	../crypto/aes_method.c	/^__aes_adj_size(len)$/
 __aes_close	../crypto/aes_method.c	/^__aes_close(dbenv, data)$/
 __aes_decrypt	../crypto/aes_method.c	/^__aes_decrypt(dbenv, aes_data, iv, cipher, cipher_/
@@ -2091,7 +2218,7 @@ __attribute__	../dbinc/debug.h	/^#define	__attribute__(s)$/
 __bam_30_btreemeta	../btree/bt_upgrade.c	/^__bam_30_btreemeta(dbp, real_name, buf)$/
 __bam_31_btreemeta	../btree/bt_upgrade.c	/^__bam_31_btreemeta(dbp, real_name, flags, fhp, h, /
 __bam_31_lbtree	../btree/bt_upgrade.c	/^__bam_31_lbtree(dbp, real_name, flags, fhp, h, dir/
-__bam_adj_log	../btree/btree_auto.c	/^__bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, l/
+__bam_adj_log	../btree/btree_auto.c	/^__bam_adj_log(dbp, txnp, ret_lsnp, flags, pgno, ls/
 __bam_adj_print	../btree/btree_autop.c	/^__bam_adj_print(dbenv, dbtp, lsnp, notused2, notus/
 __bam_adj_read	../btree/btree_auto.c	/^__bam_adj_read(dbenv, recbuf, argpp)$/
 __bam_adj_recover	../btree/bt_rec.c	/^__bam_adj_recover(dbenv, dbtp, lsnp, op, info)$/
@@ -2107,11 +2234,9 @@ __bam_c_count	../btree/bt_cursor.c	/^__bam_c_count(dbc, recnop)$/
 __bam_c_del	../btree/bt_cursor.c	/^__bam_c_del(dbc)$/
 __bam_c_destroy	../btree/bt_cursor.c	/^__bam_c_destroy(dbc)$/
 __bam_c_dup	../btree/bt_cursor.c	/^__bam_c_dup(orig_dbc, new_dbc)$/
-__bam_c_first	../btree/bt_cursor.c	/^__bam_c_first(dbc)$/
 __bam_c_get	../btree/bt_cursor.c	/^__bam_c_get(dbc, key, data, flags, pgnop)$/
 __bam_c_getstack	../btree/bt_cursor.c	/^__bam_c_getstack(dbc)$/
 __bam_c_init	../btree/bt_cursor.c	/^__bam_c_init(dbc, dbtype)$/
-__bam_c_last	../btree/bt_cursor.c	/^__bam_c_last(dbc)$/
 __bam_c_next	../btree/bt_cursor.c	/^__bam_c_next(dbc, initial_move, deleted_okay)$/
 __bam_c_physdel	../btree/bt_cursor.c	/^__bam_c_physdel(dbc)$/
 __bam_c_prev	../btree/bt_cursor.c	/^__bam_c_prev(dbc)$/
@@ -2120,24 +2245,28 @@ __bam_c_refresh	../btree/bt_cursor.c	/^__bam_c_refresh(dbc)$/
 __bam_c_rget	../btree/bt_cursor.c	/^__bam_c_rget(dbc, data)$/
 __bam_c_search	../btree/bt_cursor.c	/^__bam_c_search(dbc, root_pgno, key, flags, exactp)/
 __bam_c_writelock	../btree/bt_cursor.c	/^__bam_c_writelock(dbc)$/
-__bam_ca_delete	../btree/bt_curadj.c	/^__bam_ca_delete(dbp, pgno, indx, delete)$/
+__bam_ca_delete	../btree/bt_curadj.c	/^__bam_ca_delete(dbp, pgno, indx, delete, countp)$/
 __bam_ca_di	../btree/bt_curadj.c	/^__bam_ca_di(my_dbc, pgno, indx, adjust)$/
 __bam_ca_dup	../btree/bt_curadj.c	/^__bam_ca_dup(my_dbc, first, fpgno, fi, tpgno, ti)$/
 __bam_ca_rsplit	../btree/bt_curadj.c	/^__bam_ca_rsplit(my_dbc, fpgno, tpgno)$/
 __bam_ca_split	../btree/bt_curadj.c	/^__bam_ca_split(my_dbc, ppgno, lpgno, rpgno, split_/
 __bam_ca_undodup	../btree/bt_curadj.c	/^__bam_ca_undodup(dbp, first, fpgno, fi, ti)$/
 __bam_ca_undosplit	../btree/bt_curadj.c	/^__bam_ca_undosplit(dbp, frompgno, topgno, lpgno, s/
-__bam_cadjust_log	../btree/btree_auto.c	/^__bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgn/
+__bam_cadjust_log	../btree/btree_auto.c	/^__bam_cadjust_log(dbp, txnp, ret_lsnp, flags, pgno/
 __bam_cadjust_print	../btree/btree_autop.c	/^__bam_cadjust_print(dbenv, dbtp, lsnp, notused2, n/
 __bam_cadjust_read	../btree/btree_auto.c	/^__bam_cadjust_read(dbenv, recbuf, argpp)$/
 __bam_cadjust_recover	../btree/bt_rec.c	/^__bam_cadjust_recover(dbenv, dbtp, lsnp, op, info)/
-__bam_cdel_log	../btree/btree_auto.c	/^__bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, /
+__bam_cdel_log	../btree/btree_auto.c	/^__bam_cdel_log(dbp, txnp, ret_lsnp, flags, pgno, l/
 __bam_cdel_print	../btree/btree_autop.c	/^__bam_cdel_print(dbenv, dbtp, lsnp, notused2, notu/
 __bam_cdel_read	../btree/btree_auto.c	/^__bam_cdel_read(dbenv, recbuf, argpp)$/
 __bam_cdel_recover	../btree/bt_rec.c	/^__bam_cdel_recover(dbenv, dbtp, lsnp, op, info)$/
-__bam_cmp	../btree/bt_compare.c	/^__bam_cmp(dbp, dbt, h, indx, func, cmpp)$/
+__bam_cmp	../btree/bt_compare.c	/^__bam_cmp(dbp, txn, dbt, h, indx, func, cmpp)$/
+__bam_compact	../btree/bt_compact.c	/^__bam_compact(dbp, txn, start, stop, c_data, flags/
+__bam_compact_dups	../btree/bt_compact.c	/^__bam_compact_dups(dbc, ppg, factor, have_lock, c_/
+__bam_compact_int	../btree/bt_compact.c	/^__bam_compact_int(dbc, start, stop, factor, spanp,/
 __bam_copy	../btree/bt_split.c	/^__bam_copy(dbp, pp, cp, nxt, stop)$/
-__bam_curadj_log	../btree/btree_auto.c	/^__bam_curadj_log(dbp, txnid, ret_lsnp, flags, mode/
+__bam_csearch	../btree/bt_compact.c	/^__bam_csearch(dbc, start, sflag, level)$/
+__bam_curadj_log	../btree/btree_auto.c	/^__bam_curadj_log(dbp, txnp, ret_lsnp, flags, mode,/
 __bam_curadj_print	../btree/btree_autop.c	/^__bam_curadj_print(dbenv, dbtp, lsnp, notused2, no/
 __bam_curadj_read	../btree/btree_auto.c	/^__bam_curadj_read(dbenv, recbuf, argpp)$/
 __bam_curadj_recover	../btree/bt_rec.c	/^__bam_curadj_recover(dbenv, dbtp, lsnp, op, info)$/
@@ -2146,10 +2275,13 @@ __bam_db_create	../btree/bt_method.c	/^__bam_db_create(dbp)$/
 __bam_defcmp	../btree/bt_compare.c	/^__bam_defcmp(dbp, a, b)$/
 __bam_defpfx	../btree/bt_compare.c	/^__bam_defpfx(dbp, a, b)$/
 __bam_ditem	../btree/bt_delete.c	/^__bam_ditem(dbc, h, indx)$/
-__bam_dpages	../btree/bt_delete.c	/^__bam_dpages(dbc, stack_epg)$/
-__bam_dup_convert	../btree/bt_put.c	/^__bam_dup_convert(dbc, h, indx)$/
+__bam_dpages	../btree/bt_delete.c	/^__bam_dpages(dbc, use_top, update)$/
+__bam_dup_check	../btree/bt_put.c	/^__bam_dup_check(dbc, op, h, indx, sz, cntp)$/
+__bam_dup_convert	../btree/bt_put.c	/^__bam_dup_convert(dbc, h, indx, cnt)$/
+__bam_free_freelist	../btree/bt_compact.c	/^__bam_free_freelist(dbp, txn)$/
 __bam_get_bt_minkey	../btree/bt_method.c	/^__bam_get_bt_minkey(dbp, bt_minkeyp)$/
 __bam_get_prev	../btree/bt_cursor.c	/^__bam_get_prev(dbc)$/
+__bam_get_root	../btree/bt_search.c	/^__bam_get_root(dbc, pg, slevel, flags, stack)$/
 __bam_getboth_finddatum	../btree/bt_cursor.c	/^__bam_getboth_finddatum(dbc, data, flags)$/
 __bam_getbothc	../btree/bt_cursor.c	/^__bam_getbothc(dbc, data)$/
 __bam_iitem	../btree/bt_put.c	/^__bam_iitem(dbc, key, data, op, flags)$/
@@ -2159,6 +2291,14 @@ __bam_init_recover	../btree/btree_auto.c	/^__bam_init_recover(dbenv, dtabp, dtab
 __bam_isopd	../btree/bt_cursor.c	/^__bam_isopd(dbc, pgnop)$/
 __bam_key_range	../btree/bt_stat.c	/^__bam_key_range(dbc, dbt, kp, flags)$/
 __bam_map_flags	../btree/bt_method.c	/^__bam_map_flags(dbp, inflagsp, outflagsp)$/
+__bam_merge	../btree/bt_compact.c	/^__bam_merge(dbc, ndbc, factor, stop, c_data, donep/
+__bam_merge_internal	../btree/bt_compact.c	/^__bam_merge_internal(dbc, ndbc, level, c_data, mer/
+__bam_merge_log	../btree/btree_auto.c	/^__bam_merge_log(dbp, txnp, ret_lsnp, flags, pgno, /
+__bam_merge_pages	../btree/bt_compact.c	/^__bam_merge_pages(dbc, ndbc, c_data)$/
+__bam_merge_print	../btree/btree_autop.c	/^__bam_merge_print(dbenv, dbtp, lsnp, notused2, not/
+__bam_merge_read	../btree/btree_auto.c	/^__bam_merge_read(dbenv, recbuf, argpp)$/
+__bam_merge_records	../btree/bt_compact.c	/^__bam_merge_records(dbc, ndbc, factor, c_data)$/
+__bam_merge_recover	../btree/bt_rec.c	/^__bam_merge_recover(dbenv, dbtp, lsnp, op, info)$/
 __bam_meta2pgset	../btree/bt_verify.c	/^__bam_meta2pgset(dbp, vdp, btmeta, flags, pgset)$/
 __bam_metachk	../btree/bt_open.c	/^__bam_metachk(dbp, name, btm)$/
 __bam_mswap	../btree/bt_conv.c	/^__bam_mswap(pg)$/
@@ -2166,52 +2306,62 @@ __bam_new_file	../btree/bt_open.c	/^__bam_new_file(dbp, txn, fhp, name)$/
 __bam_new_subdb	../btree/bt_open.c	/^__bam_new_subdb(mdbp, dbp, txn)$/
 __bam_nrecs	../btree/bt_rsearch.c	/^__bam_nrecs(dbc, rep)$/
 __bam_opd_cursor	../btree/bt_curadj.c	/^__bam_opd_cursor(dbp, dbc, first, tpgno, ti)$/
+__bam_opd_exists	../btree/bt_cursor.c	/^__bam_opd_exists(dbc, pgno)$/
 __bam_open	../btree/bt_open.c	/^__bam_open(dbp, txn, name, base_pgno, flags)$/
 __bam_ovput	../btree/bt_put.c	/^__bam_ovput(dbc, type, pgno, h, indx, item)$/
 __bam_page	../btree/bt_split.c	/^__bam_page(dbc, pp, cp)$/
 __bam_partsize	../btree/bt_put.c	/^__bam_partsize(dbp, op, data, h, indx)$/
 __bam_pgin	../btree/bt_conv.c	/^__bam_pgin(dbenv, dummydbp, pg, pp, cookie)$/
+__bam_pgno_log	../btree/btree_auto.c	/^__bam_pgno_log(dbp, txnp, ret_lsnp, flags, pgno, l/
+__bam_pgno_print	../btree/btree_autop.c	/^__bam_pgno_print(dbenv, dbtp, lsnp, notused2, notu/
+__bam_pgno_read	../btree/btree_auto.c	/^__bam_pgno_read(dbenv, recbuf, argpp)$/
+__bam_pgno_recover	../btree/bt_rec.c	/^__bam_pgno_recover(dbenv, dbtp, lsnp, op, info)$/
 __bam_pgout	../btree/bt_conv.c	/^__bam_pgout(dbenv, dummydbp, pg, pp, cookie)$/
-__bam_pinsert	../btree/bt_split.c	/^__bam_pinsert(dbc, parent, lchild, rchild, space_c/
+__bam_pinsert	../btree/bt_split.c	/^__bam_pinsert(dbc, parent, lchild, rchild, flags)$/
 __bam_print_cursor	../btree/bt_stat.c	/^__bam_print_cursor(dbc)$/
 __bam_psplit	../btree/bt_split.c	/^__bam_psplit(dbc, cp, lp, rp, splitret)$/
-__bam_rcuradj_log	../btree/btree_auto.c	/^__bam_rcuradj_log(dbp, txnid, ret_lsnp, flags, mod/
+__bam_pupdate	../btree/bt_delete.c	/^__bam_pupdate(dbc, lpg)$/
+__bam_rcuradj_log	../btree/btree_auto.c	/^__bam_rcuradj_log(dbp, txnp, ret_lsnp, flags, mode/
 __bam_rcuradj_print	../btree/btree_autop.c	/^__bam_rcuradj_print(dbenv, dbtp, lsnp, notused2, n/
 __bam_rcuradj_read	../btree/btree_auto.c	/^__bam_rcuradj_read(dbenv, recbuf, argpp)$/
 __bam_rcuradj_recover	../btree/bt_rec.c	/^__bam_rcuradj_recover(dbenv, dbtp, lsnp, op, info)/
 __bam_read_root	../btree/bt_open.c	/^__bam_read_root(dbp, txn, base_pgno, flags)$/
 __bam_reclaim	../btree/bt_reclaim.c	/^__bam_reclaim(dbp, txn)$/
-__bam_relink	../btree/bt_delete.c	/^__bam_relink(dbc, pagep, new_next)$/
-__bam_relink_log	../btree/btree_auto.c	/^__bam_relink_log(dbp, txnid, ret_lsnp, flags, pgno/
+__bam_relink	../btree/bt_delete.c	/^__bam_relink(dbc, pagep, new_pgno)$/
+__bam_relink_43_print	../btree/btree_autop.c	/^__bam_relink_43_print(dbenv, dbtp, lsnp, notused2,/
+__bam_relink_43_read	../btree/btree_auto.c	/^__bam_relink_43_read(dbenv, recbuf, argpp)$/
+__bam_relink_43_recover	../btree/bt_rec.c	/^__bam_relink_43_recover(dbenv, dbtp, lsnp, op, inf/
+__bam_relink_log	../btree/btree_auto.c	/^__bam_relink_log(dbp, txnp, ret_lsnp, flags, pgno,/
 __bam_relink_print	../btree/btree_autop.c	/^__bam_relink_print(dbenv, dbtp, lsnp, notused2, no/
 __bam_relink_read	../btree/btree_auto.c	/^__bam_relink_read(dbenv, recbuf, argpp)$/
 __bam_relink_recover	../btree/bt_rec.c	/^__bam_relink_recover(dbenv, dbtp, lsnp, op, info)$/
-__bam_repl_log	../btree/btree_auto.c	/^__bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, /
+__bam_repl_log	../btree/btree_auto.c	/^__bam_repl_log(dbp, txnp, ret_lsnp, flags, pgno, l/
 __bam_repl_print	../btree/btree_autop.c	/^__bam_repl_print(dbenv, dbtp, lsnp, notused2, notu/
 __bam_repl_read	../btree/btree_auto.c	/^__bam_repl_read(dbenv, recbuf, argpp)$/
 __bam_repl_recover	../btree/bt_rec.c	/^__bam_repl_recover(dbenv, dbtp, lsnp, op, info)$/
 __bam_ritem	../btree/bt_put.c	/^__bam_ritem(dbc, h, indx, data)$/
 __bam_root	../btree/bt_split.c	/^__bam_root(dbc, cp)$/
-__bam_root_log	../btree/btree_auto.c	/^__bam_root_log(dbp, txnid, ret_lsnp, flags, meta_p/
+__bam_root_log	../btree/btree_auto.c	/^__bam_root_log(dbp, txnp, ret_lsnp, flags, meta_pg/
 __bam_root_print	../btree/btree_autop.c	/^__bam_root_print(dbenv, dbtp, lsnp, notused2, notu/
 __bam_root_read	../btree/btree_auto.c	/^__bam_root_read(dbenv, recbuf, argpp)$/
 __bam_root_recover	../btree/bt_rec.c	/^__bam_root_recover(dbenv, dbtp, lsnp, op, info)$/
 __bam_rsearch	../btree/bt_rsearch.c	/^__bam_rsearch(dbc, recnop, flags, stop, exactp)$/
-__bam_rsplit_log	../btree/btree_auto.c	/^__bam_rsplit_log(dbp, txnid, ret_lsnp, flags, pgno/
+__bam_rsplit_log	../btree/btree_auto.c	/^__bam_rsplit_log(dbp, txnp, ret_lsnp, flags, pgno,/
 __bam_rsplit_print	../btree/btree_autop.c	/^__bam_rsplit_print(dbenv, dbtp, lsnp, notused2, no/
 __bam_rsplit_read	../btree/btree_auto.c	/^__bam_rsplit_read(dbenv, recbuf, argpp)$/
 __bam_rsplit_recover	../btree/bt_rec.c	/^__bam_rsplit_recover(dbenv, dbtp, lsnp, op, info)$/
 __bam_safe_getdata	../btree/bt_verify.c	/^__bam_safe_getdata(dbp, h, i, ovflok, dbt, freedbt/
 __bam_salvage	../btree/bt_verify.c	/^__bam_salvage(dbp, vdp, pgno, pgtype, h, handle, c/
 __bam_salvage_walkdupint	../btree/bt_verify.c	/^__bam_salvage_walkdupint(dbp, vdp, h, key, handle,/
-__bam_search	../btree/bt_search.c	/^__bam_search(dbc, root_pgno, key, flags, stop, rec/
+__bam_savekey	../btree/bt_compact.c	/^__bam_savekey(dbc, next, start)$/
+__bam_search	../btree/bt_search.c	/^__bam_search(dbc, root_pgno, key, flags, slevel, r/
 __bam_set_bt_compare	../btree/bt_method.c	/^__bam_set_bt_compare(dbp, func)$/
-__bam_set_bt_maxkey	../btree/bt_method.c	/^__bam_set_bt_maxkey(dbp, bt_maxkey)$/
 __bam_set_bt_minkey	../btree/bt_method.c	/^__bam_set_bt_minkey(dbp, bt_minkey)$/
 __bam_set_bt_prefix	../btree/bt_method.c	/^__bam_set_bt_prefix(dbp, func)$/
 __bam_set_flags	../btree/bt_method.c	/^__bam_set_flags(dbp, flagsp)$/
+__bam_setup_freelist	../btree/bt_compact.c	/^__bam_setup_freelist(dbp, list, nelems)$/
 __bam_split	../btree/bt_split.c	/^__bam_split(dbc, arg, root_pgnop)$/
-__bam_split_log	../btree/btree_auto.c	/^__bam_split_log(dbp, txnid, ret_lsnp, flags, left,/
+__bam_split_log	../btree/btree_auto.c	/^__bam_split_log(dbp, txnp, ret_lsnp, flags, left, /
 __bam_split_print	../btree/btree_autop.c	/^__bam_split_print(dbenv, dbtp, lsnp, notused2, not/
 __bam_split_read	../btree/btree_auto.c	/^__bam_split_read(dbenv, recbuf, argpp)$/
 __bam_split_recover	../btree/bt_rec.c	/^__bam_split_recover(dbenv, dbtp, lsnp, op, info)$/
@@ -2223,19 +2373,54 @@ __bam_stkrel	../btree/bt_search.c	/^__bam_stkrel(dbc, flags)$/
 __bam_total	../btree/bt_rsearch.c	/^__bam_total(dbp, h)$/
 __bam_traverse	../btree/bt_stat.c	/^__bam_traverse(dbc, mode, root_pgno, callback, coo/
 __bam_truncate	../btree/bt_reclaim.c	/^__bam_truncate(dbc, countp)$/
+__bam_truncate_internal	../btree/bt_compact.c	/^__bam_truncate_internal(dbp, txn, c_data)$/
+__bam_truncate_internal_overflow	../btree/bt_compact.c	/^__bam_truncate_internal_overflow(dbc, page, c_data/
+__bam_truncate_overflow	../btree/bt_compact.c	/^__bam_truncate_overflow(dbc, pgno, pg_lock, c_data/
+__bam_truncate_page	../btree/bt_compact.c	/^__bam_truncate_page(dbc, pgp, update_parent)$/
+__bam_truncate_root_page	../btree/bt_compact.c	/^__bam_truncate_root_page(dbc, pg, indx, c_data)$/
 __bam_vrfy	../btree/bt_verify.c	/^__bam_vrfy(dbp, vdp, h, pgno, flags)$/
 __bam_vrfy_inp	../btree/bt_verify.c	/^__bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags/
 __bam_vrfy_itemorder	../btree/bt_verify.c	/^__bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, /
 __bam_vrfy_meta	../btree/bt_verify.c	/^__bam_vrfy_meta(dbp, vdp, meta, pgno, flags)$/
 __bam_vrfy_structure	../btree/bt_verify.c	/^__bam_vrfy_structure(dbp, vdp, meta_pgno, flags)$/
 __bam_vrfy_subtree	../btree/bt_verify.c	/^__bam_vrfy_subtree(dbp, vdp, pgno, l, r, flags, le/
-__bam_vrfy_treeorder	../btree/bt_verify.c	/^__bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, f/
+__bam_vrfy_treeorder	../btree/bt_verify.c	/^__bam_vrfy_treeorder(dbp, h, lp, rp, func, flags)$/
+__bh	../dbinc/mp.h	/^struct __bh {$/
+__bh_frozen_a	../dbinc/mp.h	/^struct __bh_frozen_a {$/
+__bh_frozen_p	../dbinc/mp.h	/^struct __bh_frozen_p {$/
 __bhcmp	../mp/mp_sync.c	/^__bhcmp(p1, p2)$/
+__btree	../dbinc/btree.h	/^struct __btree {			\/* Btree access method. *\/$/
 __build_data	../log/log_archive.c	/^__build_data(dbenv, pref, listp)$/
+__cdsgroup_abort	../db/db_cds.c	/^static int __cdsgroup_abort(txn)$/
+__cdsgroup_begin	../db/db_cds.c	/^int __cdsgroup_begin(dbenv, txnpp)$/
+__cdsgroup_commit	../db/db_cds.c	/^static int __cdsgroup_commit(txn, flags)$/
+__cdsgroup_discard	../db/db_cds.c	/^static int __cdsgroup_discard(txn, flags)$/
+__cdsgroup_id	../db/db_cds.c	/^static u_int32_t __cdsgroup_id(txn)$/
+__cdsgroup_notsup	../db/db_cds.c	/^__cdsgroup_notsup(dbenv, meth)$/
+__cdsgroup_prepare	../db/db_cds.c	/^static int __cdsgroup_prepare(txn, gid)$/
+__cdsgroup_set_name	../db/db_cds.c	/^static int __cdsgroup_set_name(txn, name)$/
+__cdsgroup_set_timeout	../db/db_cds.c	/^static int __cdsgroup_set_timeout(txn, timeout, fl/
 __cmpfunc	../log/log_archive.c	/^__cmpfunc(p1, p2)$/
+__config_parse	../env/env_config.c	/^__config_parse(dbenv, s, lc)$/
+__config_split	../env/env_config.c	/^__config_split(input, argv)$/
+__cq_aq	../dbinc/db.in	/^	struct __cq_aq {$/
+__cq_fq	../dbinc/db.in	/^	struct __cq_fq {$/
+__cq_jq	../dbinc/db.in	/^	struct __cq_jq {$/
 __crdel_init_print	../db/crdel_autop.c	/^__crdel_init_print(dbenv, dtabp, dtabsizep)$/
 __crdel_init_recover	../db/crdel_auto.c	/^__crdel_init_recover(dbenv, dtabp, dtabsizep)$/
-__crdel_metasub_log	../db/crdel_auto.c	/^__crdel_metasub_log(dbp, txnid, ret_lsnp, flags, p/
+__crdel_inmem_create_log	../db/crdel_auto.c	/^__crdel_inmem_create_log(dbenv, txnp, ret_lsnp, fl/
+__crdel_inmem_create_print	../db/crdel_autop.c	/^__crdel_inmem_create_print(dbenv, dbtp, lsnp, notu/
+__crdel_inmem_create_read	../db/crdel_auto.c	/^__crdel_inmem_create_read(dbenv, recbuf, argpp)$/
+__crdel_inmem_create_recover	../db/crdel_rec.c	/^__crdel_inmem_create_recover(dbenv, dbtp, lsnp, op/
+__crdel_inmem_remove_log	../db/crdel_auto.c	/^__crdel_inmem_remove_log(dbenv, txnp, ret_lsnp, fl/
+__crdel_inmem_remove_print	../db/crdel_autop.c	/^__crdel_inmem_remove_print(dbenv, dbtp, lsnp, notu/
+__crdel_inmem_remove_read	../db/crdel_auto.c	/^__crdel_inmem_remove_read(dbenv, recbuf, argpp)$/
+__crdel_inmem_remove_recover	../db/crdel_rec.c	/^__crdel_inmem_remove_recover(dbenv, dbtp, lsnp, op/
+__crdel_inmem_rename_log	../db/crdel_auto.c	/^__crdel_inmem_rename_log(dbenv, txnp, ret_lsnp, fl/
+__crdel_inmem_rename_print	../db/crdel_autop.c	/^__crdel_inmem_rename_print(dbenv, dbtp, lsnp, notu/
+__crdel_inmem_rename_read	../db/crdel_auto.c	/^__crdel_inmem_rename_read(dbenv, recbuf, argpp)$/
+__crdel_inmem_rename_recover	../db/crdel_rec.c	/^__crdel_inmem_rename_recover(dbenv, dbtp, lsnp, op/
+__crdel_metasub_log	../db/crdel_auto.c	/^__crdel_metasub_log(dbp, txnp, ret_lsnp, flags, pg/
 __crdel_metasub_print	../db/crdel_autop.c	/^__crdel_metasub_print(dbenv, dbtp, lsnp, notused2,/
 __crdel_metasub_read	../db/crdel_auto.c	/^__crdel_metasub_read(dbenv, recbuf, argpp)$/
 __crdel_metasub_recover	../db/crdel_rec.c	/^__crdel_metasub_recover(dbenv, dbtp, lsnp, op, inf/
@@ -2245,6 +2430,9 @@ __crypto_decrypt_meta	../crypto/crypto.c	/^__crypto_decrypt_meta(dbenv, dbp, mbu
 __crypto_region_destroy	../crypto/crypto.c	/^__crypto_region_destroy(dbenv)$/
 __crypto_region_init	../crypto/crypto.c	/^__crypto_region_init(dbenv)$/
 __crypto_set_passwd	../crypto/crypto.c	/^__crypto_set_passwd(dbenv_src, dbenv_dest)$/
+__cursor	../dbinc/btree.h	/^struct __cursor {$/
+__data	../env/db_salloc.c	/^struct __data {$/
+__db	../dbinc/db.in	/^struct __db {$/
 __db185_open	../db185/db185.c	/^__db185_open(file, oflags, mode, type, openinfo)$/
 __db_31_offdup	../db/db_upg_opd.c	/^__db_31_offdup(dbp, real_name, fhp, sorted, pgnop)/
 __db_SHA1Final	../hmac/sha1.c	/^__db_SHA1Final(digest, context)$/
@@ -2252,30 +2440,30 @@ __db_SHA1Init	../hmac/sha1.c	/^__db_SHA1Init(context)$/
 __db_SHA1Transform	../hmac/sha1.c	/^__db_SHA1Transform(state, buffer)$/
 __db_SHA1Update	../hmac/sha1.c	/^__db_SHA1Update(context, data, len)$/
 __db_SHAPrintContext	../hmac/sha1.c	/^__db_SHAPrintContext(context, msg)$/
-__db_add_limbo	../db/db_dispatch.c	/^__db_add_limbo(dbenv, info, fileid, pgno, count)$/
+__db_add_limbo	../db/db_dispatch.c	/^__db_add_limbo(dbenv, hp, fileid, pgno, count)$/
 __db_add_recovery	../db/db_dispatch.c	/^__db_add_recovery(dbenv, dtab, dtabsize, func, ndx/
-__db_addrem_log	../db/db_auto.c	/^__db_addrem_log(dbp, txnid, ret_lsnp, flags,$/
+__db_addrem_log	../db/db_auto.c	/^__db_addrem_log(dbp, txnp, ret_lsnp, flags,$/
 __db_addrem_print	../db/db_autop.c	/^__db_addrem_print(dbenv, dbtp, lsnp, notused2, not/
 __db_addrem_read	../db/db_auto.c	/^__db_addrem_read(dbenv, recbuf, argpp)$/
 __db_addrem_recover	../db/db_rec.c	/^__db_addrem_recover(dbenv, dbtp, lsnp, op, info)$/
+__db_allocinfo	../os/os_alloc.c	/^union __db_allocinfo {$/
 __db_append_primary	../db/db_am.c	/^__db_append_primary(dbc, key, data)$/
 __db_appname	../env/env_open.c	/^__db_appname(dbenv, appname, file, tmp_oflags, fhp/
 __db_apprec	../env/env_recover.c	/^__db_apprec(dbenv, max_lsn, trunclsn, update, flag/
-__db_assert	../common/db_err.c	/^__db_assert(failedexpr, file, line)$/
+__db_assert	../common/db_err.c	/^__db_assert(dbenv, e, file, line)$/
 __db_associate	../db/db_am.c	/^__db_associate(dbp, txn, sdbp, callback, flags)$/
 __db_associate_arg	../db/db_iface.c	/^__db_associate_arg(dbp, sdbp, callback, flags)$/
 __db_associate_pp	../db/db_iface.c	/^__db_associate_pp(dbp, txn, sdbp, callback, flags)/
 __db_associate_proc	../rpc_server/c/db_server_proc.c	/^__db_associate_proc(dbpcl_id, txnpcl_id, sdbpcl_id/
 __db_backup_name	../db/db.c	/^__db_backup_name(dbenv, name, txn, backup)$/
-__db_big_log	../db/db_auto.c	/^__db_big_log(dbp, txnid, ret_lsnp, flags,$/
+__db_big_log	../db/db_auto.c	/^__db_big_log(dbp, txnp, ret_lsnp, flags,$/
 __db_big_print	../db/db_autop.c	/^__db_big_print(dbenv, dbtp, lsnp, notused2, notuse/
 __db_big_read	../db/db_auto.c	/^__db_big_read(dbenv, recbuf, argpp)$/
 __db_big_recover	../db/db_rec.c	/^__db_big_recover(dbenv, dbtp, lsnp, op, info)$/
 __db_blockDecrypt	../crypto/rijndael/rijndael-api-fst.c	/^__db_blockDecrypt(cipher, key, input, inputLen, ou/
 __db_blockEncrypt	../crypto/rijndael/rijndael-api-fst.c	/^__db_blockEncrypt(cipher, key, input, inputLen, ou/
 __db_bmeta	../db/db_pr.c	/^__db_bmeta(dbp, h, flags)$/
-__db_bt_maxkey_proc	../rpc_server/c/db_server_proc.c	/^__db_bt_maxkey_proc(dbpcl_id, maxkey, replyp)$/
-__db_bt_minkey_proc	../rpc_server/c/db_server_proc.c	/^__db_bt_minkey_proc(dbpcl_id, minkey, replyp)$/
+__db_bt_stat	../dbinc/db.in	/^struct __db_bt_stat {$/
 __db_build_bi	../db/db_upg_opd.c	/^__db_build_bi(dbp, fhp, ipage, page, indx, nomemp)/
 __db_build_ri	../db/db_upg_opd.c	/^__db_build_ri(dbp, fhp, ipage, page, indx, nomemp)/
 __db_buildpartial	../db/db_cam.c	/^__db_buildpartial(dbp, oldrec, partial, newrec)$/
@@ -2288,6 +2476,7 @@ __db_c_count	../db/db_cam.c	/^__db_c_count(dbc, recnop)$/
 __db_c_count_pp	../db/db_iface.c	/^__db_c_count_pp(dbc, recnop, flags)$/
 __db_c_del	../db/db_cam.c	/^__db_c_del(dbc, flags)$/
 __db_c_del_arg	../db/db_iface.c	/^__db_c_del_arg(dbc, flags)$/
+__db_c_del_oldskey	../db/db_cam.c	/^__db_c_del_oldskey(sdbp, dbc_arg, skey, pkey, oldd/
 __db_c_del_pp	../db/db_iface.c	/^__db_c_del_pp(dbc, flags)$/
 __db_c_del_primary	../db/db_cam.c	/^__db_c_del_primary(dbc)$/
 __db_c_del_secondary	../db/db_cam.c	/^__db_c_del_secondary(dbc)$/
@@ -2307,14 +2496,15 @@ __db_c_put	../db/db_cam.c	/^__db_c_put(dbc_arg, key, data, flags)$/
 __db_c_put_arg	../db/db_iface.c	/^__db_c_put_arg(dbc, key, data, flags)$/
 __db_c_put_pp	../db/db_iface.c	/^__db_c_put_pp(dbc, key, data, flags)$/
 __db_c_secondary_get_pp	../db/db_cam.c	/^__db_c_secondary_get_pp(dbc, skey, data, flags)$/
-__db_check_chksum	../hmac/hmac.c	/^__db_check_chksum(dbenv, db_cipher, chksum, data, /
+__db_check_chksum	../hmac/hmac.c	/^__db_check_chksum(dbenv, hdr, db_cipher, chksum, d/
 __db_check_lsn	../common/db_err.c	/^__db_check_lsn(dbenv, lsn, prev)$/
 __db_check_txn	../common/db_err.c	/^__db_check_txn(dbp, txn, assoc_lid, read_op)$/
 __db_chk_meta	../db/db_open.c	/^__db_chk_meta(dbenv, dbp, meta, do_metachk)$/
-__db_chksum	../hmac/hmac.c	/^__db_chksum(data, data_len, mac_key, store)$/
+__db_chksum	../hmac/hmac.c	/^__db_chksum(hdr, data, data_len, mac_key, store)$/
+__db_cipher	../dbinc/crypto.h	/^struct __db_cipher {$/
 __db_cipherInit	../crypto/rijndael/rijndael-api-fst.c	/^__db_cipherInit(cipher, mode, IV)$/
 __db_cipherUpdateRounds	../crypto/rijndael/rijndael-api-fst.c	/^__db_cipherUpdateRounds(cipher, key, input, inputL/
-__db_cksum_log	../db/db_auto.c	/^__db_cksum_log(dbenv, txnid, ret_lsnp, flags)$/
+__db_cksum_log	../db/db_auto.c	/^__db_cksum_log(dbenv, txnp, ret_lsnp, flags)$/
 __db_cksum_print	../db/db_autop.c	/^__db_cksum_print(dbenv, dbtp, lsnp, notused2, notu/
 __db_cksum_read	../db/db_auto.c	/^__db_cksum_read(dbenv, recbuf, argpp)$/
 __db_cksum_recover	../db/db_rec.c	/^__db_cksum_recover(dbenv, dbtp, lsnp, op, info)$/
@@ -2322,7 +2512,11 @@ __db_close	../db/db.c	/^__db_close(dbp, txn, flags)$/
 __db_close_int	../rpc_server/c/db_server_util.c	/^__db_close_int(id, flags)$/
 __db_close_pp	../db/db_iface.c	/^__db_close_pp(dbp, flags)$/
 __db_close_proc	../rpc_server/c/db_server_proc.c	/^__db_close_proc(dbpcl_id, flags, replyp)$/
+__db_commit	../dbinc/log.h	/^struct __db_commit {$/
+__db_compact	../dbinc/db.in	/^struct __db_compact {$/
+__db_compact_pp	../db/db_iface.c	/^__db_compact_pp(dbp, txn, start, stop, c_data, fla/
 __db_create_proc	../rpc_server/c/db_server_proc.c	/^__db_create_proc(dbenvcl_id, flags, replyp)$/
+__db_ctime	../clib/ctime.c	/^__db_ctime(tod, time_buf)$/
 __db_curinval	../db/db_iface.c	/^__db_curinval(dbenv)$/
 __db_cursor	../db/db_iface.c	/^__db_cursor(dbp, txn, dbcp, flags)$/
 __db_cursor_arg	../db/db_iface.c	/^__db_cursor_arg(dbp, flags)$/
@@ -2330,56 +2524,55 @@ __db_cursor_check	../db/db_truncate.c	/^__db_cursor_check(dbp)$/
 __db_cursor_int	../db/db_am.c	/^__db_cursor_int(dbp, txn, dbtype, root, is_opd, lo/
 __db_cursor_pp	../db/db_iface.c	/^__db_cursor_pp(dbp, txn, dbcp, flags)$/
 __db_cursor_proc	../rpc_server/c/db_server_proc.c	/^__db_cursor_proc(dbpcl_id, txnpcl_id, flags, reply/
-__db_db_associate_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_associate_4003__SVCSUFFIX__(msg, req)$/
-__db_db_bt_maxkey_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_bt_maxkey_4003__SVCSUFFIX__(msg, req)$/
-__db_db_bt_minkey_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_bt_minkey_4003__SVCSUFFIX__(msg, req)$/
-__db_db_close_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_close_4003__SVCSUFFIX__(msg, req)$/
-__db_db_create_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_create_4003__SVCSUFFIX__(msg, req)$/
-__db_db_cursor_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_cursor_4003__SVCSUFFIX__(msg, req)$/
-__db_db_del_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_del_4003__SVCSUFFIX__(msg, req)$/
-__db_db_encrypt_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_encrypt_4003__SVCSUFFIX__(msg, req)$/
-__db_db_extentsize_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_extentsize_4003__SVCSUFFIX__(msg, req)$/
-__db_db_flags_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_flags_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_bt_minkey_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_bt_minkey_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_encrypt_flags_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_encrypt_flags_4003__SVCSUFFIX__(msg, r/
-__db_db_get_extentsize_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_extentsize_4003__SVCSUFFIX__(msg, req)/
-__db_db_get_flags_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_flags_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_h_ffactor_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_h_ffactor_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_h_nelem_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_h_nelem_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_lorder_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_lorder_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_name_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_name_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_open_flags_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_open_flags_4003__SVCSUFFIX__(msg, req)/
-__db_db_get_pagesize_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_pagesize_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_re_delim_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_re_delim_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_re_len_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_re_len_4003__SVCSUFFIX__(msg, req)$/
-__db_db_get_re_pad_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_re_pad_4003__SVCSUFFIX__(msg, req)$/
-__db_db_h_ffactor_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_h_ffactor_4003__SVCSUFFIX__(msg, req)$/
-__db_db_h_nelem_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_h_nelem_4003__SVCSUFFIX__(msg, req)$/
-__db_db_join_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_join_4003__SVCSUFFIX__(msg, req)$/
-__db_db_key_range_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_key_range_4003__SVCSUFFIX__(msg, req)$/
-__db_db_lorder_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_lorder_4003__SVCSUFFIX__(msg, req)$/
-__db_db_open_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_open_4003__SVCSUFFIX__(msg, req)$/
-__db_db_pagesize_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_pagesize_4003__SVCSUFFIX__(msg, req)$/
-__db_db_pget_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_pget_4003__SVCSUFFIX__(msg, req)$/
-__db_db_put_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_put_4003__SVCSUFFIX__(msg, req)$/
-__db_db_re_delim_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_re_delim_4003__SVCSUFFIX__(msg, req)$/
-__db_db_re_len_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_re_len_4003__SVCSUFFIX__(msg, req)$/
-__db_db_re_pad_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_re_pad_4003__SVCSUFFIX__(msg, req)$/
-__db_db_remove_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_remove_4003__SVCSUFFIX__(msg, req)$/
-__db_db_rename_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_rename_4003__SVCSUFFIX__(msg, req)$/
-__db_db_stat_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_stat_4003__SVCSUFFIX__(msg, req)$/
-__db_db_sync_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_sync_4003__SVCSUFFIX__(msg, req)$/
-__db_db_truncate_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_truncate_4003__SVCSUFFIX__(msg, req)$/
-__db_dbc_close_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_close_4003__SVCSUFFIX__(msg, req)$/
-__db_dbc_count_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_count_4003__SVCSUFFIX__(msg, req)$/
-__db_dbc_del_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_del_4003__SVCSUFFIX__(msg, req)$/
-__db_dbc_dup_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_dup_4003__SVCSUFFIX__(msg, req)$/
-__db_dbc_get_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_get_4003__SVCSUFFIX__(msg, req)$/
-__db_dbc_pget_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_pget_4003__SVCSUFFIX__(msg, req)$/
-__db_dbc_put_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_put_4003__SVCSUFFIX__(msg, req)$/
+__db_db_associate_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_associate_4005__SVCSUFFIX__(msg, req)$/
+__db_db_close_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_close_4005__SVCSUFFIX__(msg, req)$/
+__db_db_create_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_create_4005__SVCSUFFIX__(msg, req)$/
+__db_db_cursor_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_cursor_4005__SVCSUFFIX__(msg, req)$/
+__db_db_del_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_del_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_bt_minkey_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_bt_minkey_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_dbname_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_dbname_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_encrypt_flags_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_encrypt_flags_4005__SVCSUFFIX__(msg, r/
+__db_db_get_flags_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_flags_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_h_ffactor_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_h_ffactor_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_h_nelem_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_h_nelem_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_lorder_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_lorder_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_open_flags_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_open_flags_4005__SVCSUFFIX__(msg, req)/
+__db_db_get_pagesize_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_pagesize_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_q_extentsize_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_q_extentsize_4005__SVCSUFFIX__(msg, re/
+__db_db_get_re_delim_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_re_delim_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_re_len_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_re_len_4005__SVCSUFFIX__(msg, req)$/
+__db_db_get_re_pad_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_get_re_pad_4005__SVCSUFFIX__(msg, req)$/
+__db_db_join_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_join_4005__SVCSUFFIX__(msg, req)$/
+__db_db_key_range_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_key_range_4005__SVCSUFFIX__(msg, req)$/
+__db_db_open_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_open_4005__SVCSUFFIX__(msg, req)$/
+__db_db_pget_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_pget_4005__SVCSUFFIX__(msg, req)$/
+__db_db_put_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_put_4005__SVCSUFFIX__(msg, req)$/
+__db_db_remove_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_remove_4005__SVCSUFFIX__(msg, req)$/
+__db_db_rename_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_rename_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_bt_minkey_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_bt_minkey_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_encrypt_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_encrypt_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_flags_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_flags_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_h_ffactor_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_h_ffactor_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_h_nelem_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_h_nelem_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_lorder_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_lorder_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_pagesize_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_pagesize_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_q_extentsize_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_q_extentsize_4005__SVCSUFFIX__(msg, re/
+__db_db_set_re_delim_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_re_delim_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_re_len_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_re_len_4005__SVCSUFFIX__(msg, req)$/
+__db_db_set_re_pad_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_set_re_pad_4005__SVCSUFFIX__(msg, req)$/
+__db_db_stat_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_stat_4005__SVCSUFFIX__(msg, req)$/
+__db_db_sync_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_sync_4005__SVCSUFFIX__(msg, req)$/
+__db_db_truncate_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_db_truncate_4005__SVCSUFFIX__(msg, req)$/
+__db_dbc_c_close_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_c_close_4005__SVCSUFFIX__(msg, req)$/
+__db_dbc_c_count_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_c_count_4005__SVCSUFFIX__(msg, req)$/
+__db_dbc_c_del_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_c_del_4005__SVCSUFFIX__(msg, req)$/
+__db_dbc_c_dup_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_c_dup_4005__SVCSUFFIX__(msg, req)$/
+__db_dbc_c_get_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_c_get_4005__SVCSUFFIX__(msg, req)$/
+__db_dbc_c_pget_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_c_pget_4005__SVCSUFFIX__(msg, req)$/
+__db_dbc_c_put_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_dbc_c_put_4005__SVCSUFFIX__(msg, req)$/
 __db_dbenv_mpool	../db/db.c	/^__db_dbenv_mpool(dbp, fname, flags)$/
-__db_dbenv_setup	../db/db.c	/^__db_dbenv_setup(dbp, txn, fname, id, flags)$/
+__db_dbenv_setup	../db/db.c	/^__db_dbenv_setup(dbp, txn, fname, dname, id, flags/
 __db_dbm_close	../dbm/dbm.c	/^__db_dbm_close()$/
 __db_dbm_delete	../dbm/dbm.c	/^__db_dbm_delete(key)$/
 __db_dbm_fetch	../dbm/dbm.c	/^__db_dbm_fetch(key)$/
@@ -2387,19 +2580,21 @@ __db_dbm_firstkey	../dbm/dbm.c	/^__db_dbm_firstkey()$/
 __db_dbm_init	../dbm/dbm.c	/^__db_dbm_init(file)$/
 __db_dbm_nextkey	../dbm/dbm.c	/^__db_dbm_nextkey(key)$/
 __db_dbm_store	../dbm/dbm.c	/^__db_dbm_store(key, dat)$/
-__db_dbtxn_remove	../db/db_remove.c	/^__db_dbtxn_remove(dbp, txn, name)$/
+__db_dbt	../dbinc/db.in	/^struct __db_dbt {$/
+__db_dbtxn_remove	../db/db_remove.c	/^__db_dbtxn_remove(dbp, txn, name, subdb)$/
 __db_dbtype_to_string	../db/db_pr.c	/^__db_dbtype_to_string(type)$/
-__db_debug_log	../db/db_auto.c	/^__db_debug_log(dbenv, txnid, ret_lsnp, flags,$/
+__db_debug_log	../db/db_auto.c	/^__db_debug_log(dbenv, txnp, ret_lsnp, flags,$/
 __db_debug_print	../db/db_autop.c	/^__db_debug_print(dbenv, dbtp, lsnp, notused2, notu/
 __db_debug_read	../db/db_auto.c	/^__db_debug_read(dbenv, recbuf, argpp)$/
 __db_debug_recover	../db/db_rec.c	/^__db_debug_recover(dbenv, dbtp, lsnp, op, info)$/
 __db_del	../db/db_am.c	/^__db_del(dbp, txn, key, flags)$/
-__db_del_arg	../db/db_iface.c	/^__db_del_arg(dbp, flags)$/
+__db_del_arg	../db/db_iface.c	/^__db_del_arg(dbp, key, flags)$/
 __db_del_pp	../db/db_iface.c	/^__db_del_pp(dbp, txn, key, flags)$/
 __db_del_proc	../rpc_server/c/db_server_proc.c	/^__db_del_proc(dbpcl_id, txnpcl_id, keydlen, keydof/
 __db_derive_mac	../hmac/hmac.c	/^__db_derive_mac(passwd, plen, mac_key)$/
-__db_des_destroy	../env/env_region.c	/^__db_des_destroy(dbenv, rp, shmem_safe)$/
+__db_des_destroy	../env/env_region.c	/^__db_des_destroy(dbenv, rp)$/
 __db_des_get	../env/env_region.c	/^__db_des_get(dbenv, env_infop, infop, rpp)$/
+__db_difftime	../common/db_clock.c	/^__db_difftime(ssec, esec, susec, eusec, secp, usec/
 __db_disassociate	../db/db.c	/^__db_disassociate(sdbp)$/
 __db_dispatch	../db/db_dispatch.c	/^__db_dispatch(dbenv, dtab, dtabsize, db, lsnp, red/
 __db_ditem	../db/db_dup.c	/^__db_ditem(dbc, pagep, indx, nbytes)$/
@@ -2410,46 +2605,57 @@ __db_do_the_limbo	../db/db_dispatch.c	/^__db_do_the_limbo(dbenv, ptxn, txn, hp,
 __db_doff	../db/db_overflow.c	/^__db_doff(dbc, pgno)$/
 __db_dump	../db/db_pr.c	/^__db_dump(dbp, subname, callback, handle, pflag, k/
 __db_dump_pp	../db/db_pr.c	/^__db_dump_pp(dbp, subname, callback, handle, pflag/
-__db_dumptree	../db/db_pr.c	/^__db_dumptree(dbp, op, name)$/
+__db_dumptree	../db/db_pr.c	/^__db_dumptree(dbp, txn, op, name)$/
 __db_duperr	../db/db_cam.c	/^__db_duperr(dbp, flags)$/
 __db_e_attach	../env/env_region.c	/^__db_e_attach(dbenv, init_flagsp)$/
 __db_e_detach	../env/env_region.c	/^__db_e_detach(dbenv, destroy)$/
+__db_e_golive	../env/env_region.c	/^__db_e_golive(dbenv)$/
 __db_e_remfile	../env/env_region.c	/^__db_e_remfile(dbenv)$/
 __db_e_remove	../env/env_region.c	/^__db_e_remove(dbenv, flags)$/
-__db_encrypt_proc	../rpc_server/c/db_server_proc.c	/^__db_encrypt_proc(dbpcl_id, passwd, flags, replyp)/
-__db_env_cachesize_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_cachesize_4003__SVCSUFFIX__(msg, req)$/
-__db_env_close_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_close_4003__SVCSUFFIX__(msg, req)$/
+__db_env	../dbinc/db.in	/^struct __db_env {$/
+__db_env_cdsgroup_begin_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_cdsgroup_begin_4005__SVCSUFFIX__(msg, req/
+__db_env_close_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_close_4005__SVCSUFFIX__(msg, req)$/
 __db_env_config	../env/env_method.c	/^__db_env_config(dbenv, i, flags)$/
-__db_env_create_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_create_4003__SVCSUFFIX__(msg, req)$/
-__db_env_dbremove_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_dbremove_4003__SVCSUFFIX__(msg, req)$/
-__db_env_dbrename_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_dbrename_4003__SVCSUFFIX__(msg, req)$/
-__db_env_encrypt_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_encrypt_4003__SVCSUFFIX__(msg, req)$/
-__db_env_flags_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_flags_4003__SVCSUFFIX__(msg, req)$/
-__db_env_get_cachesize_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_cachesize_4003__SVCSUFFIX__(msg, req)/
-__db_env_get_encrypt_flags_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_encrypt_flags_4003__SVCSUFFIX__(msg, /
-__db_env_get_flags_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_flags_4003__SVCSUFFIX__(msg, req)$/
-__db_env_get_home_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_home_4003__SVCSUFFIX__(msg, req)$/
-__db_env_get_open_flags_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_open_flags_4003__SVCSUFFIX__(msg, req/
-__db_env_open_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_open_4003__SVCSUFFIX__(msg, req)$/
-__db_env_remove_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_remove_4003__SVCSUFFIX__(msg, req)$/
-__db_err	../common/db_err.c	/^__db_err(const DB_ENV *dbenv, const char *fmt, .../
+__db_env_create_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_create_4005__SVCSUFFIX__(msg, req)$/
+__db_env_dbremove_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_dbremove_4005__SVCSUFFIX__(msg, req)$/
+__db_env_dbrename_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_dbrename_4005__SVCSUFFIX__(msg, req)$/
+__db_env_destroy	../env/env_method.c	/^__db_env_destroy(dbenv)$/
+__db_env_get_cachesize_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_cachesize_4005__SVCSUFFIX__(msg, req)/
+__db_env_get_encrypt_flags_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_encrypt_flags_4005__SVCSUFFIX__(msg, /
+__db_env_get_flags_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_flags_4005__SVCSUFFIX__(msg, req)$/
+__db_env_get_home_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_home_4005__SVCSUFFIX__(msg, req)$/
+__db_env_get_open_flags_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_get_open_flags_4005__SVCSUFFIX__(msg, req/
+__db_env_open_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_open_4005__SVCSUFFIX__(msg, req)$/
+__db_env_remove_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_remove_4005__SVCSUFFIX__(msg, req)$/
+__db_env_set_cachesize_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_set_cachesize_4005__SVCSUFFIX__(msg, req)/
+__db_env_set_encrypt_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_set_encrypt_4005__SVCSUFFIX__(msg, req)$/
+__db_env_set_flags_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_set_flags_4005__SVCSUFFIX__(msg, req)$/
+__db_env_txn_begin_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_txn_begin_4005__SVCSUFFIX__(msg, req)$/
+__db_env_txn_recover_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_env_txn_recover_4005__SVCSUFFIX__(msg, req)$/
+__db_err	../common/db_err.c	/^__db_err(dbenv, error fmt, va_alist)$/
 __db_errcall	../common/db_err.c	/^__db_errcall(dbenv, error, error_set, fmt, ap)$/
 __db_errfile	../common/db_err.c	/^__db_errfile(dbenv, error, error_set, fmt, ap)$/
-__db_extentsize_proc	../rpc_server/c/db_server_proc.c	/^__db_extentsize_proc(dbpcl_id, extentsize, replyp)/
+__db_errx	../common/db_err.c	/^__db_errx(dbenv, fmt, va_alist)$/
+__db_failed	../common/db_err.c	/^__db_failed(dbenv, msg, pid, tid)$/
 __db_faultmem	../env/env_region.c	/^__db_faultmem(dbenv, addr, size, created)$/
 __db_fcchk	../common/db_err.c	/^__db_fcchk(dbenv, name, flags, flag1, flag2)$/
 __db_fchk	../common/db_err.c	/^__db_fchk(dbenv, name, flags, ok_flags)$/
-__db_fcntl_mutex_destroy	../mutex/mut_fcntl.c	/^__db_fcntl_mutex_destroy(mutexp)$/
-__db_fcntl_mutex_init	../mutex/mut_fcntl.c	/^__db_fcntl_mutex_init(dbenv, mutexp, offset)$/
-__db_fcntl_mutex_lock	../mutex/mut_fcntl.c	/^__db_fcntl_mutex_lock(dbenv, mutexp)$/
-__db_fcntl_mutex_unlock	../mutex/mut_fcntl.c	/^__db_fcntl_mutex_unlock(dbenv, mutexp)$/
+__db_fcntl_mutex_destroy	../mutex/mut_fcntl.c	/^__db_fcntl_mutex_destroy(dbenv, mutex)$/
+__db_fcntl_mutex_init	../mutex/mut_fcntl.c	/^__db_fcntl_mutex_init(dbenv, mutex, flags)$/
+__db_fcntl_mutex_lock	../mutex/mut_fcntl.c	/^__db_fcntl_mutex_lock(dbenv, mutex)$/
+__db_fcntl_mutex_unlock	../mutex/mut_fcntl.c	/^__db_fcntl_mutex_unlock(dbenv, mutex)$/
 __db_fd_pp	../db/db_iface.c	/^__db_fd_pp(dbp, fdp)$/
 __db_ferr	../common/db_err.c	/^__db_ferr(dbenv, name, iscombo)$/
-__db_fileid_reset	../db/db_setid.c	/^__db_fileid_reset(dbenv, name, passwd)$/
-__db_fileinit	../env/env_file.c	/^__db_fileinit(dbenv, fhp, size, zerofill)$/
-__db_flags_proc	../rpc_server/c/db_server_proc.c	/^__db_flags_proc(dbpcl_id, flags, replyp)$/
+__db_file_extend	../env/env_file.c	/^__db_file_extend(dbenv, fhp, size)$/
+__db_file_multi_write	../env/env_file.c	/^__db_file_multi_write(dbenv, path)$/
+__db_file_write	../env/env_file.c	/^__db_file_write(dbenv, fhp, mbytes, bytes, pattern/
+__db_filestart	../dbinc/log.h	/^struct __db_filestart {$/
 __db_fnl	../common/db_err.c	/^__db_fnl(dbenv, name)$/
 __db_free	../db/db_meta.c	/^__db_free(dbc, h)$/
+__db_free_truncate	../db/db_meta.c	/^__db_free_truncate(dbp, txn, flags, c_data, listp,/
+__db_freeaddrinfo	../clib/getaddrinfo.c	/^__db_freeaddrinfo(dbenv, ai)$/
+__db_freelist_pos	../db/db_meta.c	/^__db_freelist_pos(pgno, list, nelem, posp)$/
+__db_freelist_sort	../db/db_meta.c	/^__db_freelist_sort(list, nelems)$/
 __db_generate_iv	../crypto/mersenne/mt19937db.c	/^__db_generate_iv(dbenv, iv)$/
 __db_genrand	../crypto/mersenne/mt19937db.c	/^__db_genrand(dbenv)$/
 __db_get	../db/db_iface.c	/^__db_get(dbp, txn, key, data, flags)$/
@@ -2458,12 +2664,12 @@ __db_get_bt_minkey_proc	../rpc_server/c/db_server_proc.c	/^__db_get_bt_minkey_pr
 __db_get_byteswapped	../db/db_method.c	/^__db_get_byteswapped(dbp, isswapped)$/
 __db_get_cachesize	../db/db_method.c	/^__db_get_cachesize(dbp, cache_gbytesp, cache_bytes/
 __db_get_dbname	../db/db_method.c	/^__db_get_dbname(dbp, fnamep, dnamep)$/
+__db_get_dbname_proc	../rpc_server/c/db_server_proc.c	/^__db_get_dbname_proc(dbpcl_id, replyp)$/
 __db_get_encrypt_flags	../db/db_method.c	/^__db_get_encrypt_flags(dbp, flagsp)$/
 __db_get_encrypt_flags_proc	../rpc_server/c/db_server_proc.c	/^__db_get_encrypt_flags_proc(dbpcl_id, replyp)$/
 __db_get_env	../db/db_method.c	/^__db_get_env(dbp)$/
 __db_get_errfile	../db/db_method.c	/^__db_get_errfile(dbp, errfilep)$/
 __db_get_errpfx	../db/db_method.c	/^__db_get_errpfx(dbp, errpfxp)$/
-__db_get_extentsize_proc	../rpc_server/c/db_server_proc.c	/^__db_get_extentsize_proc(dbpcl_id, replyp)$/
 __db_get_flags	../db/db_method.c	/^__db_get_flags(dbp, flagsp)$/
 __db_get_flags_fn	../db/db_pr.c	/^__db_get_flags_fn()$/
 __db_get_flags_proc	../rpc_server/c/db_server_proc.c	/^__db_get_flags_proc(dbpcl_id, replyp)$/
@@ -2471,41 +2677,43 @@ __db_get_h_ffactor_proc	../rpc_server/c/db_server_proc.c	/^__db_get_h_ffactor_pr
 __db_get_h_nelem_proc	../rpc_server/c/db_server_proc.c	/^__db_get_h_nelem_proc(dbpcl_id, replyp)$/
 __db_get_lorder	../db/db_method.c	/^__db_get_lorder(dbp, db_lorderp)$/
 __db_get_lorder_proc	../rpc_server/c/db_server_proc.c	/^__db_get_lorder_proc(dbpcl_id, replyp)$/
+__db_get_mpf	../db/db_method.c	/^__db_get_mpf(dbp)$/
 __db_get_msgfile	../db/db_method.c	/^__db_get_msgfile(dbp, msgfilep)$/
-__db_get_name_proc	../rpc_server/c/db_server_proc.c	/^__db_get_name_proc(dbpcl_id, replyp)$/
 __db_get_open_flags	../db/db_open.c	/^__db_get_open_flags(dbp, flagsp)$/
 __db_get_open_flags_proc	../rpc_server/c/db_server_proc.c	/^__db_get_open_flags_proc(dbpcl_id, replyp)$/
 __db_get_pagesize	../db/db_method.c	/^__db_get_pagesize(dbp, db_pagesizep)$/
 __db_get_pagesize_proc	../rpc_server/c/db_server_proc.c	/^__db_get_pagesize_proc(dbpcl_id, replyp)$/
 __db_get_pp	../db/db_iface.c	/^__db_get_pp(dbp, txn, key, data, flags)$/
 __db_get_proc	../rpc_server/c/db_server_proc.c	/^__db_get_proc(dbpcl_id, txnpcl_id, keydlen, keydof/
+__db_get_q_extentsize_proc	../rpc_server/c/db_server_proc.c	/^__db_get_q_extentsize_proc(dbpcl_id, replyp)$/
 __db_get_re_delim_proc	../rpc_server/c/db_server_proc.c	/^__db_get_re_delim_proc(dbpcl_id, replyp)$/
 __db_get_re_len_proc	../rpc_server/c/db_server_proc.c	/^__db_get_re_len_proc(dbpcl_id, replyp)$/
 __db_get_re_pad_proc	../rpc_server/c/db_server_proc.c	/^__db_get_re_pad_proc(dbpcl_id, replyp)$/
 __db_get_seq_flags_fn	../sequence/seq_stat.c	/^__db_get_seq_flags_fn()$/
 __db_get_transactional	../db/db_method.c	/^__db_get_transactional(dbp)$/
 __db_get_type	../db/db_method.c	/^__db_get_type(dbp, dbtype)$/
+__db_getaddrinfo	../clib/getaddrinfo.c	/^__db_getaddrinfo(dbenv, nodename, port, servname, /
 __db_getlong	../common/db_getlong.c	/^__db_getlong(dbenv, progname, p, min, max, storep)/
 __db_getulong	../common/db_getlong.c	/^__db_getulong(dbenv, progname, p, min, max, storep/
-__db_goff	../db/db_overflow.c	/^__db_goff(dbp, dbt, tlen, pgno, bpp, bpsz)$/
+__db_goff	../db/db_overflow.c	/^__db_goff(dbp, txn, dbt, tlen, pgno, bpp, bpsz)$/
 __db_guesspgsize	../db/db_vrfy.c	/^__db_guesspgsize(dbenv, fhp)$/
-__db_h_ffactor_proc	../rpc_server/c/db_server_proc.c	/^__db_h_ffactor_proc(dbpcl_id, ffactor, replyp)$/
-__db_h_nelem_proc	../rpc_server/c/db_server_proc.c	/^__db_h_nelem_proc(dbpcl_id, nelem, replyp)$/
+__db_h_stat	../dbinc/db.in	/^struct __db_h_stat {$/
 __db_hashinit	../env/db_shash.c	/^__db_hashinit(begin, nelements)$/
 __db_hcreate	../hsearch/hsearch.c	/^__db_hcreate(nel)$/
 __db_hdestroy	../hsearch/hsearch.c	/^__db_hdestroy()$/
 __db_hmac	../hmac/hmac.c	/^__db_hmac(k, data, data_len, mac)$/
 __db_hmeta	../db/db_pr.c	/^__db_hmeta(dbp, h, flags)$/
-__db_home	../env/env_open.c	/^__db_home(dbenv, db_home, flags)$/
 __db_hsearch	../hsearch/hsearch.c	/^__db_hsearch(item, action)$/
 __db_idcmp	../common/db_idspace.c	/^__db_idcmp(a, b)$/
 __db_idspace	../common/db_idspace.c	/^__db_idspace(inuse, n, minp, maxp)$/
-__db_infohead	../dbinc/tcl_db.h	155
-__db_init	../db/db_method.c	/^__db_init(dbp, flags)$/
+__db_ilock	../dbinc/db.in	/^struct __db_ilock {$/
+__db_infohead	../dbinc/tcl_db.h	/^#define	__db_infohead __dbtcl_global.g_infohead$/
+__db_init	../db/db_method.c	/^__db_init(dbenv, dbp, flags)$/
 __db_init_meta	../db/db_meta.c	/^__db_init_meta(dbp, p, pgno, pgtype)$/
 __db_init_print	../db/db_autop.c	/^__db_init_print(dbenv, dtabp, dtabsizep)$/
 __db_init_recover	../db/db_auto.c	/^__db_init_recover(dbenv, dtabp, dtabsizep)$/
 __db_init_subdb	../db/db_open.c	/^__db_init_subdb(mdbp, dbp, name, txn)$/
+__db_inmem_remove	../db/db_remove.c	/^__db_inmem_remove(dbp, txn, name)$/
 __db_is_valid_magicno	../db/db_vrfy.c	/^__db_is_valid_magicno(magic, typep)$/
 __db_is_valid_pagetype	../db/db_vrfy.c	/^__db_is_valid_pagetype(type)$/
 __db_isbigendian	../common/db_byteorder.c	/^__db_isbigendian()$/
@@ -2530,24 +2738,30 @@ __db_limbo_bucket	../db/db_dispatch.c	/^__db_limbo_bucket(dbenv, txn, elp, state
 __db_limbo_fix	../db/db_dispatch.c	/^__db_limbo_fix(dbp, ctxn, elp, lastp, meta, state)/
 __db_limbo_move	../db/db_dispatch.c	/^__db_limbo_move(dbenv, ptxn, txn, elp)$/
 __db_limbo_prepare	../db/db_dispatch.c	/^__db_limbo_prepare(dbp, txn, elp)$/
+__db_lk_conflicts	../libdb_java/db_java_wrap.c	/^struct __db_lk_conflicts {$/
 __db_loadme	../db/db_pr.c	/^__db_loadme()$/
+__db_lock	../dbinc/lock.h	/^struct __db_lock {$/
 __db_lock_move	../db/db_dispatch.c	/^__db_lock_move(dbenv, fileid, pgno, mode, ptxn, tx/
+__db_lock_stat	../dbinc/db.in	/^struct __db_lock_stat {$/
+__db_lock_u	../dbinc/db.in	/^struct __db_lock_u {$/
 __db_lockmode_to_string	../db/db_pr.c	/^__db_lockmode_to_string(mode)$/
+__db_lockreq	../dbinc/db.in	/^struct __db_lockreq {$/
+__db_locktab	../dbinc/lock.h	/^struct __db_locktab {$/
+__db_log	../dbinc/log.h	/^struct __db_log {$/
 __db_log2	../common/db_log2.c	/^__db_log2(num)$/
 __db_log_corrupt	../env/env_recover.c	/^__db_log_corrupt(dbenv, lsnp)$/
+__db_log_cursor	../dbinc/db.in	/^struct __db_log_cursor {$/
 __db_log_page	../db/db.c	/^__db_log_page(dbp, txn, lsn, pgno, page)$/
-__db_logmsg	../common/db_err.c	/^__db_logmsg(const DB_ENV *dbenv,$/
-__db_lorder_proc	../rpc_server/c/db_server_proc.c	/^__db_lorder_proc(dbpcl_id, lorder, replyp)$/
+__db_log_stat	../dbinc/db.in	/^struct __db_log_stat {$/
 __db_lprint	../db/db_meta.c	/^__db_lprint(dbc)$/
 __db_lput	../db/db_meta.c	/^__db_lput(dbc, lockp)$/
 __db_lsgenrand	../crypto/mersenne/mt19937db.c	/^__db_lsgenrand(seed_array, mt, mtip)$/
-__db_lsn_reset	../db/db_setlsn.c	/^__db_lsn_reset(dbenv, name, passwd)$/
-__db_maintinit	../dbinc/mutex.h	/^#define	__db_maintinit(a, b, c)		__db_shreg_mainti/
+__db_lsn	../dbinc/db.in	/^struct __db_lsn {$/
 __db_makeKey	../crypto/rijndael/rijndael-api-fst.c	/^__db_makeKey(key, direction, keyLen, keyMaterial)$/
 __db_makecopy	../db/db.c	/^__db_makecopy(dbenv, src, dest)$/
 __db_map_flags	../db/db_method.c	/^__db_map_flags(dbp, inflagsp, outflagsp)$/
 __db_map_rmid	../xa/xa_map.c	/^__db_map_rmid(rmid, dbenv)$/
-__db_map_xid	../xa/xa_map.c	/^__db_map_xid(dbenv, xid, off)$/
+__db_map_xid	../xa/xa_map.c	/^__db_map_xid(dbenv, xid, td)$/
 __db_master_open	../db/db.c	/^__db_master_open(subdbp, txn, name, flags, mode, d/
 __db_master_update	../db/db.c	/^__db_master_update(mdbp, sdbp, txn, subdb, type, a/
 __db_meta	../db/db_pr.c	/^__db_meta(dbp, dbmeta, fn, flags)$/
@@ -2556,20 +2770,21 @@ __db_meta_setup	../db/db_open.c	/^__db_meta_setup(dbenv, dbp, name, meta, oflags
 __db_metaswap	../db/db_conv.c	/^__db_metaswap(pg)$/
 __db_mi_env	../env/env_method.c	/^__db_mi_env(dbenv, name)$/
 __db_mi_open	../env/env_method.c	/^__db_mi_open(dbenv, name, after)$/
-__db_moff	../db/db_overflow.c	/^__db_moff(dbp, dbt, pgno, tlen, cmpfunc, cmpp)$/
-__db_msg	../common/db_err.c	/^__db_msg(const DB_ENV *dbenv, const char *fmt, .../
-__db_msgadd	../common/db_err.c	/^__db_msgadd(DB_ENV *dbenv, DB_MSGBUF *mbp, const c/
+__db_mkpath	../common/mkpath.c	/^__db_mkpath(dbenv, name)$/
+__db_moff	../db/db_overflow.c	/^__db_moff(dbp, txn, dbt, pgno, tlen, cmpfunc, cmpp/
+__db_mpool	../dbinc/mp.h	/^struct __db_mpool {$/
+__db_mpool_fstat	../dbinc/db.in	/^struct __db_mpool_fstat {$/
+__db_mpool_hash	../dbinc/mp.h	/^struct __db_mpool_hash {$/
+__db_mpool_stat	../dbinc/db.in	/^struct __db_mpool_stat {$/
+__db_mpoolfile	../dbinc/db.in	/^struct __db_mpoolfile {$/
+__db_mpreg	../dbinc/mp.h	/^struct __db_mpreg {$/
+__db_msg	../common/db_err.c	/^__db_msg(dbenv, fmt, va_alist)$/
+__db_msgadd	../common/db_err.c	/^__db_msgadd(dbenv, mbp, fmt, va_alist)$/
 __db_msgcall	../common/db_err.c	/^__db_msgcall(dbenv, fmt, ap)$/
 __db_msgfile	../common/db_err.c	/^__db_msgfile(dbenv, fmt, ap)$/
-__db_mutex_alloc_int	../mutex/mutex.c	/^__db_mutex_alloc_int(dbenv, infop, storep)$/
-__db_mutex_destroy	../dbinc/mutex.h	/^#define	__db_mutex_destroy(a)		__db_pthread_mutex_/
-__db_mutex_free	../mutex/mutex.c	/^__db_mutex_free(dbenv, infop, mutexp)$/
-__db_mutex_init	../dbinc/mutex.h	/^#define	__db_mutex_init(a, b, c, d, e, f)	\\$/
-__db_mutex_init_int	../dbinc/mutex.h	/^#define	__db_mutex_init_int(a, b, c, d)	__db_pthre/
-__db_mutex_lock	../dbinc/mutex.h	/^#define	__db_mutex_lock(a, b)		__db_pthread_mutex_/
-__db_mutex_maint	../mutex/mutex.c	/^__db_mutex_maint(dbenv, infop)$/
-__db_mutex_setup	../mutex/mutex.c	/^__db_mutex_setup(dbenv, infop, ptr, flags)$/
-__db_mutex_unlock	../dbinc/mutex.h	/^#define	__db_mutex_unlock(a, b)		__db_pthread_mute/
+__db_mutex_stat	../dbinc/db.in	/^struct __db_mutex_stat {$/
+__db_mutex_t	../dbinc/mutex_int.h	/^struct __db_mutex_t {			\/* Mutex. *\/$/
+__db_mutexmgr	../dbinc/mutex_int.h	/^struct __db_mutexmgr {$/
 __db_ndbm_clearerr	../dbm/dbm.c	/^__db_ndbm_clearerr(dbm)$/
 __db_ndbm_close	../dbm/dbm.c	/^__db_ndbm_close(dbm)$/
 __db_ndbm_delete	../dbm/dbm.c	/^__db_ndbm_delete(dbm, key)$/
@@ -2585,11 +2800,11 @@ __db_ndbm_store	../dbm/dbm.c	/^__db_ndbm_store(dbm, key, data, flags)$/
 __db_new	../db/db_meta.c	/^__db_new(dbc, type, pagepp)$/
 __db_new_file	../db/db_open.c	/^__db_new_file(dbp, txn, fhp, name)$/
 __db_no_open	../dbm/dbm.c	/^__db_no_open()$/
-__db_noop_log	../db/db_auto.c	/^__db_noop_log(dbp, txnid, ret_lsnp, flags, pgno, p/
+__db_noop_log	../db/db_auto.c	/^__db_noop_log(dbp, txnp, ret_lsnp, flags, pgno, pr/
 __db_noop_print	../db/db_autop.c	/^__db_noop_print(dbenv, dbtp, lsnp, notused2, notus/
 __db_noop_read	../db/db_auto.c	/^__db_noop_read(dbenv, recbuf, argpp)$/
 __db_noop_recover	../db/db_rec.c	/^__db_noop_recover(dbenv, dbtp, lsnp, op, info)$/
-__db_nosystemmem	../os/os_map.c	/^__db_nosystemmem(dbenv)$/
+__db_norepmgr	../env/env_method.c	/^__db_norepmgr(dbenv)$/
 __db_not_txn_env	../common/db_err.c	/^__db_not_txn_env(dbenv)$/
 __db_oflags	../os/os_oflags.c	/^__db_oflags(oflags)$/
 __db_omode	../os/os_oflags.c	/^__db_omode(perm)$/
@@ -2597,47 +2812,60 @@ __db_open	../db/db_open.c	/^__db_open(dbp, txn, fname, dname, type, flags, mod/
 __db_open_arg	../db/db_iface.c	/^__db_open_arg(dbp, txn, fname, dname, type, flags)/
 __db_open_pp	../db/db_iface.c	/^__db_open_pp(dbp, txn, fname, dname, type, flags, /
 __db_open_proc	../rpc_server/c/db_server_proc.c	/^__db_open_proc(dbpcl_id, txnpcl_id, name, subdb, t/
-__db_overwrite	../env/env_file.c	/^__db_overwrite(dbenv, path)$/
-__db_overwrite_pass	../env/env_file.c	/^__db_overwrite_pass(dbenv, path, fhp, mbytes, byte/
-__db_ovref	../db/db_overflow.c	/^__db_ovref(dbc, pgno, adjust)$/
-__db_ovref_log	../db/db_auto.c	/^__db_ovref_log(dbp, txnid, ret_lsnp, flags, pgno, /
+__db_out_stream	../libdb_java/db_java_wrap.c	/^struct __db_out_stream {$/
+__db_ovref	../db/db_overflow.c	/^__db_ovref(dbc, pgno)$/
+__db_ovref_log	../db/db_auto.c	/^__db_ovref_log(dbp, txnp, ret_lsnp, flags, pgno, a/
 __db_ovref_print	../db/db_autop.c	/^__db_ovref_print(dbenv, dbtp, lsnp, notused2, notu/
 __db_ovref_read	../db/db_auto.c	/^__db_ovref_read(dbenv, recbuf, argpp)$/
 __db_ovref_recover	../db/db_rec.c	/^__db_ovref_recover(dbenv, dbtp, lsnp, op, info)$/
 __db_padDecrypt	../crypto/rijndael/rijndael-api-fst.c	/^__db_padDecrypt(cipher, key, input, inputOctets, o/
 __db_padEncrypt	../crypto/rijndael/rijndael-api-fst.c	/^__db_padEncrypt(cipher, key, input, inputOctets, o/
 __db_page_pass	../db/db_upg.c	/^__db_page_pass(dbp, real_name, flags, fl, fhp)$/
-__db_pagesize_proc	../rpc_server/c/db_server_proc.c	/^__db_pagesize_proc(dbpcl_id, pagesize, replyp)$/
 __db_pagetype_to_string	../db/db_pr.c	/^__db_pagetype_to_string(type)$/
 __db_panic	../common/db_err.c	/^__db_panic(dbenv, errval)$/
 __db_panic_msg	../common/db_err.c	/^__db_panic_msg(dbenv)$/
-__db_parse	../env/env_open.c	/^__db_parse(dbenv, s)$/
+__db_panic_set	../common/db_err.c	/^__db_panic_set(dbenv, on)$/
 __db_partsize	../db/db_cam.c	/^__db_partsize(nbytes, data)$/
-__db_pg_alloc_log	../db/db_auto.c	/^__db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, met/
+__db_pg_alloc_42_print	../db/db_autop.c	/^__db_pg_alloc_42_print(dbenv, dbtp, lsnp, notused2/
+__db_pg_alloc_42_read	../db/db_auto.c	/^__db_pg_alloc_42_read(dbenv, recbuf, argpp)$/
+__db_pg_alloc_42_recover	../db/db_rec.c	/^__db_pg_alloc_42_recover(dbenv, dbtp, lsnp, op, in/
+__db_pg_alloc_log	../db/db_auto.c	/^__db_pg_alloc_log(dbp, txnp, ret_lsnp, flags, meta/
 __db_pg_alloc_print	../db/db_autop.c	/^__db_pg_alloc_print(dbenv, dbtp, lsnp, notused2, n/
 __db_pg_alloc_read	../db/db_auto.c	/^__db_pg_alloc_read(dbenv, recbuf, argpp)$/
 __db_pg_alloc_recover	../db/db_rec.c	/^__db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)/
-__db_pg_free_log	../db/db_auto.c	/^__db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno/
+__db_pg_free_42_print	../db/db_autop.c	/^__db_pg_free_42_print(dbenv, dbtp, lsnp, notused2,/
+__db_pg_free_42_read	../db/db_auto.c	/^__db_pg_free_42_read(dbenv, recbuf, argpp)$/
+__db_pg_free_42_recover	../db/db_rec.c	/^__db_pg_free_42_recover(dbenv, dbtp, lsnp, op, inf/
+__db_pg_free_log	../db/db_auto.c	/^__db_pg_free_log(dbp, txnp, ret_lsnp, flags, pgno,/
 __db_pg_free_print	../db/db_autop.c	/^__db_pg_free_print(dbenv, dbtp, lsnp, notused2, no/
 __db_pg_free_read	../db/db_auto.c	/^__db_pg_free_read(dbenv, recbuf, argpp)$/
 __db_pg_free_recover	../db/db_rec.c	/^__db_pg_free_recover(dbenv, dbtp, lsnp, op, info)$/
+__db_pg_free_recover_42_int	../db/db_rec.c	/^__db_pg_free_recover_42_int(dbenv, argp, file_dbp,/
 __db_pg_free_recover_int	../db/db_rec.c	/^__db_pg_free_recover_int(dbenv, argp, file_dbp, ls/
-__db_pg_freedata_log	../db/db_auto.c	/^__db_pg_freedata_log(dbp, txnid, ret_lsnp, flags, /
+__db_pg_freedata_42_print	../db/db_autop.c	/^__db_pg_freedata_42_print(dbenv, dbtp, lsnp, notus/
+__db_pg_freedata_42_read	../db/db_auto.c	/^__db_pg_freedata_42_read(dbenv, recbuf, argpp)$/
+__db_pg_freedata_42_recover	../db/db_rec.c	/^__db_pg_freedata_42_recover(dbenv, dbtp, lsnp, op,/
+__db_pg_freedata_log	../db/db_auto.c	/^__db_pg_freedata_log(dbp, txnp, ret_lsnp, flags, p/
 __db_pg_freedata_print	../db/db_autop.c	/^__db_pg_freedata_print(dbenv, dbtp, lsnp, notused2/
 __db_pg_freedata_read	../db/db_auto.c	/^__db_pg_freedata_read(dbenv, recbuf, argpp)$/
 __db_pg_freedata_recover	../db/db_rec.c	/^__db_pg_freedata_recover(dbenv, dbtp, lsnp, op, in/
-__db_pg_init_log	../db/db_auto.c	/^__db_pg_init_log(dbp, txnid, ret_lsnp, flags, pgno/
+__db_pg_init_log	../db/db_auto.c	/^__db_pg_init_log(dbp, txnp, ret_lsnp, flags, pgno,/
 __db_pg_init_print	../db/db_autop.c	/^__db_pg_init_print(dbenv, dbtp, lsnp, notused2, no/
 __db_pg_init_read	../db/db_auto.c	/^__db_pg_init_read(dbenv, recbuf, argpp)$/
 __db_pg_init_recover	../db/db_rec.c	/^__db_pg_init_recover(dbenv, dbtp, lsnp, op, info)$/
-__db_pg_new_log	../db/db_auto.c	/^__db_pg_new_log(dbp, txnid, ret_lsnp, flags, pgno,/
+__db_pg_new_log	../db/db_auto.c	/^__db_pg_new_log(dbp, txnp, ret_lsnp, flags, pgno, /
 __db_pg_new_print	../db/db_autop.c	/^__db_pg_new_print(dbenv, dbtp, lsnp, notused2, not/
 __db_pg_new_read	../db/db_auto.c	/^__db_pg_new_read(dbenv, recbuf, argpp)$/
 __db_pg_new_recover	../db/db_rec.c	/^__db_pg_new_recover(dbenv, dbtp, lsnp, op, info)$/
-__db_pg_prepare_log	../db/db_auto.c	/^__db_pg_prepare_log(dbp, txnid, ret_lsnp, flags, p/
+__db_pg_prepare_log	../db/db_auto.c	/^__db_pg_prepare_log(dbp, txnp, ret_lsnp, flags, pg/
 __db_pg_prepare_print	../db/db_autop.c	/^__db_pg_prepare_print(dbenv, dbtp, lsnp, notused2,/
 __db_pg_prepare_read	../db/db_auto.c	/^__db_pg_prepare_read(dbenv, recbuf, argpp)$/
 __db_pg_prepare_recover	../db/db_rec.c	/^__db_pg_prepare_recover(dbenv, dbtp, lsnp, op, inf/
+__db_pg_sort_log	../db/db_auto.c	/^__db_pg_sort_log(dbp, txnp, ret_lsnp, flags, meta,/
+__db_pg_sort_print	../db/db_autop.c	/^__db_pg_sort_print(dbenv, dbtp, lsnp, notused2, no/
+__db_pg_sort_read	../db/db_auto.c	/^__db_pg_sort_read(dbenv, recbuf, argpp)$/
+__db_pg_sort_recover	../db/db_rec.c	/^__db_pg_sort_recover(dbenv, dbtp, lsnp, op, info)$/
+__db_pg_truncate	../db/db_meta.c	/^__db_pg_truncate(mpf, txn, list, c_data, nelemp, l/
 __db_pgerr	../common/db_err.c	/^__db_pgerr(dbp, pgno, errval)$/
 __db_pget	../db/db_iface.c	/^__db_pget(dbp, txn, skey, pkey, data, flags)$/
 __db_pget_arg	../db/db_iface.c	/^__db_pget_arg(dbp, pkey, flags)$/
@@ -2645,6 +2873,7 @@ __db_pget_pp	../db/db_iface.c	/^__db_pget_pp(dbp, txn, skey, pkey, data, flags)$
 __db_pget_proc	../rpc_server/c/db_server_proc.c	/^__db_pget_proc(dbpcl_id, txnpcl_id, skeydlen, skey/
 __db_pgfmt	../common/db_err.c	/^__db_pgfmt(dbenv, pgno)$/
 __db_pgin	../db/db_conv.c	/^__db_pgin(dbenv, pg, pp, cookie)$/
+__db_pglistcmp	../db/db_meta.c	/^__db_pglistcmp(a, b)$/
 __db_pgout	../db/db_conv.c	/^__db_pgout(dbenv, pg, pp, cookie)$/
 __db_pitem	../db/db_dup.c	/^__db_pitem(dbc, pagep, indx, nbytes, hdr, data)$/
 __db_poff	../db/db_overflow.c	/^__db_poff(dbc, dbt, pgnop)$/
@@ -2652,42 +2881,43 @@ __db_pr	../db/db_pr.c	/^__db_pr(dbenv, mbp, p, len)$/
 __db_pr_callback	../db/db_pr.c	/^__db_pr_callback(handle, str_arg)$/
 __db_prdb	../db/db_pr.c	/^__db_prdb(dbp, flags)$/
 __db_prdbt	../db/db_pr.c	/^__db_prdbt(dbtp, checkprint, prefix, handle, callb/
+__db_preplist	../dbinc/db.in	/^struct __db_preplist {$/
 __db_prflags	../db/db_pr.c	/^__db_prflags(dbenv, mbp, flags, fn, prefix, suffix/
 __db_prfooter	../db/db_pr.c	/^__db_prfooter(handle, callback)$/
 __db_prheader	../db/db_pr.c	/^__db_prheader(dbp, subname, pflag, keyflag, handle/
 __db_print_all	../db/db_stati.c	/^__db_print_all(dbp, flags)$/
 __db_print_citem	../db/db_stati.c	/^int __db_print_citem(dbc)$/
 __db_print_cursor	../db/db_stati.c	/^__db_print_cursor(dbp)$/
-__db_print_fh	../env/env_stat.c	/^__db_print_fh(dbenv, fh, flags)$/
+__db_print_fh	../env/env_stat.c	/^__db_print_fh(dbenv, tag, fh, flags)$/
 __db_print_fileid	../env/env_stat.c	/^__db_print_fileid(dbenv, id, suffix)$/
-__db_print_mutex	../env/env_stat.c	/^__db_print_mutex(dbenv, mbp, mutex, suffix, flags)/
 __db_print_reginfo	../env/env_stat.c	/^__db_print_reginfo(dbenv, infop, s)$/
 __db_print_stats	../db/db_stati.c	/^__db_print_stats(dbp, flags)$/
-__db_prnpage	../db/db_pr.c	/^__db_prnpage(dbp, pgno)$/
+__db_prnpage	../db/db_pr.c	/^__db_prnpage(dbp, txn, pgno)$/
 __db_proff	../db/db_pr.c	/^__db_proff(dbenv, mbp, vp)$/
 __db_prpage	../db/db_pr.c	/^__db_prpage(dbp, h, flags)$/
 __db_prqueue	../qam/qam_method.c	/^__db_prqueue(dbp, flags)$/
-__db_prtree	../db/db_pr.c	/^__db_prtree(dbp, flags)$/
-__db_pthread_mutex_destroy	../mutex/mut_pthread.c	/^__db_pthread_mutex_destroy(mutexp)$/
-__db_pthread_mutex_init	../mutex/mut_pthread.c	/^__db_pthread_mutex_init(dbenv, mutexp, flags)$/
-__db_pthread_mutex_lock	../mutex/mut_pthread.c	/^__db_pthread_mutex_lock(dbenv, mutexp)$/
-__db_pthread_mutex_unlock	../mutex/mut_pthread.c	/^__db_pthread_mutex_unlock(dbenv, mutexp)$/
+__db_prtree	../db/db_pr.c	/^__db_prtree(dbp, txn, flags)$/
+__db_pthread_mutex_destroy	../mutex/mut_pthread.c	/^__db_pthread_mutex_destroy(dbenv, mutex)$/
+__db_pthread_mutex_init	../mutex/mut_pthread.c	/^__db_pthread_mutex_init(dbenv, mutex, flags)$/
+__db_pthread_mutex_lock	../mutex/mut_pthread.c	/^__db_pthread_mutex_lock(dbenv, mutex)$/
+__db_pthread_mutex_unlock	../mutex/mut_pthread.c	/^__db_pthread_mutex_unlock(dbenv, mutex)$/
 __db_put	../db/db_am.c	/^__db_put(dbp, txn, key, data, flags)$/
 __db_put_arg	../db/db_iface.c	/^__db_put_arg(dbp, key, data, flags)$/
 __db_put_pp	../db/db_iface.c	/^__db_put_pp(dbp, txn, key, data, flags)$/
 __db_put_proc	../rpc_server/c/db_server_proc.c	/^__db_put_proc(dbpcl_id, txnpcl_id, keydlen, keydof/
+__db_qam_stat	../dbinc/db.in	/^struct __db_qam_stat {$/
 __db_qmeta	../db/db_pr.c	/^__db_qmeta(dbp, h, flags)$/
 __db_r_attach	../env/env_region.c	/^__db_r_attach(dbenv, infop, size)$/
 __db_r_detach	../env/env_region.c	/^__db_r_detach(dbenv, infop, destroy)$/
-__db_rdonly	../db/db_iface.c	/^__db_rdonly(dbenv, name)$/
-__db_re_delim_proc	../rpc_server/c/db_server_proc.c	/^__db_re_delim_proc(dbpcl_id, delim, replyp)$/
-__db_re_len_proc	../rpc_server/c/db_server_proc.c	/^__db_re_len_proc(dbpcl_id, len, replyp)$/
-__db_re_pad_proc	../rpc_server/c/db_server_proc.c	/^__db_re_pad_proc(dbpcl_id, pad, replyp)$/
+__db_rdonly	../common/db_err.c	/^__db_rdonly(dbenv, name)$/
 __db_rec_repl	../common/db_err.c	/^__db_rec_repl(dbenv, data_size, data_dlen)$/
 __db_rec_toobig	../common/db_err.c	/^__db_rec_toobig(dbenv, data_len, fixed_rec_len)$/
 __db_reclaim_callback	../db/db_reclaim.c	/^__db_reclaim_callback(dbp, p, cookie, putp)$/
-__db_refresh	../db/db.c	/^__db_refresh(dbp, txn, flags, deferred_closep)$/
-__db_region_destroy	../env/env_region.c	/^__db_region_destroy(dbenv, infop)$/
+__db_refresh	../db/db.c	/^__db_refresh(dbp, txn, flags, deferred_closep, reu/
+__db_reginfo_t	../dbinc/region.h	/^struct __db_reginfo_t {		\/* __db_r_attach IN para/
+__db_relink_42_print	../db/db_autop.c	/^__db_relink_42_print(dbenv, dbtp, lsnp, notused2, /
+__db_relink_42_read	../db/db_auto.c	/^__db_relink_42_read(dbenv, recbuf, argpp)$/
+__db_relink_42_recover	../db/db_rec.c	/^__db_relink_42_recover(dbenv, dbtp, lsnp, op, info/
 __db_remove	../db/db_remove.c	/^__db_remove(dbp, txn, name, subdb, flags)$/
 __db_remove_int	../db/db_remove.c	/^__db_remove_int(dbp, txn, name, subdb, flags)$/
 __db_remove_pp	../db/db_remove.c	/^__db_remove_pp(dbp, name, subdb, flags)$/
@@ -2696,8 +2926,12 @@ __db_rename	../db/db_rename.c	/^__db_rename(dbp, txn, name, subdb, newname)$/
 __db_rename_int	../db/db_rename.c	/^__db_rename_int(dbp, txn, name, subdb, newname)$/
 __db_rename_pp	../db/db_rename.c	/^__db_rename_pp(dbp, name, subdb, newname, flags)$/
 __db_rename_proc	../rpc_server/c/db_server_proc.c	/^__db_rename_proc(dbpcl_id, name, subdb, newname, f/
+__db_rep	../dbinc/rep.h	/^struct __db_rep {$/
 __db_rep_enter	../rep/rep_util.c	/^__db_rep_enter(dbp, checkgen, checklock, return_no/
-__db_ret	../db/db_ret.c	/^__db_ret(dbp, h, indx, dbt, memp, memsize)$/
+__db_rep_stat	../dbinc/db.in	/^struct __db_rep_stat {$/
+__db_repmgr_site	../dbinc/db.in	/^struct __db_repmgr_site {$/
+__db_repmgr_sites	../libdb_java/db_java_wrap.c	/^struct __db_repmgr_sites {$/
+__db_ret	../db/db_ret.c	/^__db_ret(dbp, txn, h, indx, dbt, memp, memsize)$/
 __db_retcopy	../db/db_ret.c	/^__db_retcopy(dbenv, dbt, data, len, memp, memsize)/
 __db_rijndaelDecrypt	../crypto/rijndael/rijndael-alg-fst.c	/^__db_rijndaelDecrypt(rk, Nr, ct, pt)$/
 __db_rijndaelDecryptRound	../crypto/rijndael/rijndael-alg-fst.c	/^__db_rijndaelDecryptRound(rk, Nr, pt, ct)$/
@@ -2707,14 +2941,15 @@ __db_rijndaelKeySetupDec	../crypto/rijndael/rijndael-alg-fst.c	/^__db_rijndaelKe
 __db_rijndaelKeySetupEnc	../crypto/rijndael/rijndael-alg-fst.c	/^__db_rijndaelKeySetupEnc(rk, cipherKey, keyBits)$/
 __db_rmid_to_env	../xa/xa_map.c	/^__db_rmid_to_env(rmid, dbenvp)$/
 __db_rpath	../os/os_rpath.c	/^__db_rpath(path)$/
+__db_s_count	../db/db_cam.c	/^__db_s_count(pdbp)$/
 __db_s_done	../db/db_cam.c	/^__db_s_done(sdbp)$/
-__db_s_first	../db/db_cam.c	/^__db_s_first(pdbp)$/
+__db_s_first	../db/db_cam.c	/^__db_s_first(pdbp, sdbpp)$/
 __db_s_next	../db/db_cam.c	/^__db_s_next(sdbpp)$/
 __db_safe_goff	../db/db_ovfl_vrfy.c	/^__db_safe_goff(dbp, vdp, pgno, dbt, buf, flags)$/
 __db_salvage	../db/db_vrfy.c	/^__db_salvage(dbp, vdp, pgno, h, handle, callback, /
 __db_salvage_destroy	../db/db_vrfyutil.c	/^__db_salvage_destroy(vdp)$/
 __db_salvage_duptree	../db/db_vrfy.c	/^__db_salvage_duptree(dbp, vdp, pgno, key, handle, /
-__db_salvage_getnext	../db/db_vrfyutil.c	/^__db_salvage_getnext(vdp, pgnop, pgtypep)$/
+__db_salvage_getnext	../db/db_vrfyutil.c	/^__db_salvage_getnext(vdp, dbcp, pgnop, pgtypep, sk/
 __db_salvage_init	../db/db_vrfyutil.c	/^__db_salvage_init(vdp)$/
 __db_salvage_isdone	../db/db_vrfyutil.c	/^__db_salvage_isdone(vdp, pgno)$/
 __db_salvage_markdone	../db/db_vrfyutil.c	/^__db_salvage_markdone(vdp, pgno)$/
@@ -2726,35 +2961,43 @@ __db_secondary_close	../db/db_am.c	/^__db_secondary_close(sdbp, flags)$/
 __db_secondary_close_pp	../db/db_iface.c	/^__db_secondary_close_pp(dbp, flags)$/
 __db_secondary_corrupt	../db/db_join.c	/^__db_secondary_corrupt(dbp)$/
 __db_secondary_get	../db/db_am.c	/^__db_secondary_get(sdbp, txn, skey, data, flags)$/
+__db_seq_record	../dbinc/db.in	/^struct __db_seq_record {$/
+__db_seq_stat	../dbinc/db.in	/^struct __db_seq_stat {$/
+__db_sequence	../dbinc/db.in	/^struct __db_sequence {$/
 __db_set_alloc	../db/db_method.c	/^__db_set_alloc(dbp, mal_func, real_func, free_func/
 __db_set_append_recno	../db/db_method.c	/^__db_set_append_recno(dbp, func)$/
+__db_set_bt_minkey_proc	../rpc_server/c/db_server_proc.c	/^__db_set_bt_minkey_proc(dbpcl_id, minkey, replyp)$/
 __db_set_cachesize	../db/db_method.c	/^__db_set_cachesize(dbp, cache_gbytes, cache_bytes,/
 __db_set_dup_compare	../db/db_method.c	/^__db_set_dup_compare(dbp, func)$/
 __db_set_encrypt	../db/db_method.c	/^__db_set_encrypt(dbp, passwd, flags)$/
+__db_set_encrypt_proc	../rpc_server/c/db_server_proc.c	/^__db_set_encrypt_proc(dbpcl_id, passwd, flags, rep/
 __db_set_errcall	../db/db_method.c	/^__db_set_errcall(dbp, errcall)$/
 __db_set_errfile	../db/db_method.c	/^__db_set_errfile(dbp, errfile)$/
 __db_set_errpfx	../db/db_method.c	/^__db_set_errpfx(dbp, errpfx)$/
 __db_set_feedback	../db/db_method.c	/^__db_set_feedback(dbp, feedback)$/
 __db_set_flags	../db/db_method.c	/^__db_set_flags(dbp, flags)$/
+__db_set_flags_proc	../rpc_server/c/db_server_proc.c	/^__db_set_flags_proc(dbpcl_id, flags, replyp)$/
+__db_set_h_ffactor_proc	../rpc_server/c/db_server_proc.c	/^__db_set_h_ffactor_proc(dbpcl_id, ffactor, replyp)/
+__db_set_h_nelem_proc	../rpc_server/c/db_server_proc.c	/^__db_set_h_nelem_proc(dbpcl_id, nelem, replyp)$/
+__db_set_lastpgno	../db/db_upg.c	/^__db_set_lastpgno(dbp, real_name, fhp)$/
 __db_set_lorder	../db/db_method.c	/^__db_set_lorder(dbp, db_lorder)$/
+__db_set_lorder_proc	../rpc_server/c/db_server_proc.c	/^__db_set_lorder_proc(dbpcl_id, lorder, replyp)$/
 __db_set_msgcall	../db/db_method.c	/^__db_set_msgcall(dbp, msgcall)$/
 __db_set_msgfile	../db/db_method.c	/^__db_set_msgfile(dbp, msgfile)$/
 __db_set_pagesize	../db/db_method.c	/^__db_set_pagesize(dbp, db_pagesize)$/
+__db_set_pagesize_proc	../rpc_server/c/db_server_proc.c	/^__db_set_pagesize_proc(dbpcl_id, pagesize, replyp)/
 __db_set_paniccall	../db/db_method.c	/^__db_set_paniccall(dbp, paniccall)$/
+__db_set_q_extentsize_proc	../rpc_server/c/db_server_proc.c	/^__db_set_q_extentsize_proc(dbpcl_id, extentsize, r/
+__db_set_re_delim_proc	../rpc_server/c/db_server_proc.c	/^__db_set_re_delim_proc(dbpcl_id, delim, replyp)$/
+__db_set_re_len_proc	../rpc_server/c/db_server_proc.c	/^__db_set_re_len_proc(dbpcl_id, len, replyp)$/
+__db_set_re_pad_proc	../rpc_server/c/db_server_proc.c	/^__db_set_re_pad_proc(dbpcl_id, pad, replyp)$/
 __db_sgenrand	../crypto/mersenne/mt19937db.c	/^__db_sgenrand(seed, mt, mtip)$/
 __db_shalloc	../env/db_salloc.c	/^__db_shalloc(infop, len, align, retp)$/
 __db_shalloc_free	../env/db_salloc.c	/^__db_shalloc_free(infop, ptr)$/
 __db_shalloc_init	../env/db_salloc.c	/^__db_shalloc_init(infop, size)$/
 __db_shalloc_size	../env/db_salloc.c	/^__db_shalloc_size(len, align)$/
 __db_shalloc_sizeof	../env/db_salloc.c	/^__db_shalloc_sizeof(ptr)$/
-__db_shlocks_clear	../dbinc/mutex.h	/^#define	__db_shlocks_clear(a, b, c)	__db_shreg_loc/
-__db_shlocks_destroy	../dbinc/mutex.h	/^#define	__db_shlocks_destroy(a, b)	__db_shreg_lock/
-__db_shm_mode	../os/os_oflags.c	/^__db_shm_mode(dbenv)$/
-__db_shreg_locks_clear	../mutex/mutex.c	/^__db_shreg_locks_clear(mutexp, infop, rp)$/
-__db_shreg_locks_destroy	../mutex/mutex.c	/^__db_shreg_locks_destroy(infop, rp)$/
-__db_shreg_locks_record	../mutex/mutex.c	/^__db_shreg_locks_record(dbenv, mutexp, infop, rp)$/
-__db_shreg_maintinit	../mutex/mutex.c	/^__db_shreg_maintinit(infop, addr, size)$/
-__db_shreg_mutex_init	../mutex/mutex.c	/^__db_shreg_mutex_init(dbenv, mutexp, offset, flags/
+__db_space_err	../common/db_err.c	/^__db_space_err(dbp)$/
 __db_stat	../db/db_stati.c	/^__db_stat(dbp, txn, spp, flags)$/
 __db_stat_arg	../db/db_stati.c	/^__db_stat_arg(dbp, flags)$/
 __db_stat_not_built	../env/env_stat.c	/^__db_stat_not_built(dbenv)$/
@@ -2768,41 +3011,53 @@ __db_subdb_rename	../db/db_rename.c	/^__db_subdb_rename(dbp, txn, name, subdb, n
 __db_sync	../db/db_am.c	/^__db_sync(dbp)$/
 __db_sync_pp	../db/db_iface.c	/^__db_sync_pp(dbp, flags)$/
 __db_sync_proc	../rpc_server/c/db_server_proc.c	/^__db_sync_proc(dbpcl_id, flags, replyp)$/
+__db_syserr	../common/db_err.c	/^__db_syserr(dbenv, error fmt, va_alist)$/
 __db_tablesize	../env/db_shash.c	/^__db_tablesize(n_buckets)$/
-__db_tas_mutex_destroy	../mutex/mut_tas.c	/^__db_tas_mutex_destroy(mutexp)$/
-__db_tas_mutex_init	../mutex/mut_tas.c	/^__db_tas_mutex_init(dbenv, mutexp, flags)$/
-__db_tas_mutex_lock	../mutex/mut_tas.c	/^__db_tas_mutex_lock(dbenv, mutexp)$/
-__db_tas_mutex_unlock	../mutex/mut_tas.c	/^__db_tas_mutex_unlock(dbenv, mutexp)$/
+__db_tas_mutex_destroy	../mutex/mut_tas.c	/^__db_tas_mutex_destroy(dbenv, mutex)$/
+__db_tas_mutex_init	../mutex/mut_tas.c	/^__db_tas_mutex_init(dbenv, mutex, flags)$/
+__db_tas_mutex_lock	../mutex/mut_tas.c	/^__db_tas_mutex_lock(dbenv, mutex)$/
+__db_tas_mutex_unlock	../mutex/mut_tas.c	/^__db_tas_mutex_unlock(dbenv, mutex)$/
 __db_testcopy	../db/db.c	/^__db_testcopy(dbenv, dbp, name)$/
 __db_testdocopy	../db/db.c	/^__db_testdocopy(dbenv, name)$/
+__db_threadid	../env/env_failchk.c	/^struct __db_threadid {$/
 __db_tmp_open	../env/env_open.c	/^__db_tmp_open(dbenv, tmp_oflags, path, fhpp)$/
-__db_traverse_big	../db/db_reclaim.c	/^__db_traverse_big(dbp, pgno, callback, cookie)$/
+__db_traverse_big	../db/db_reclaim.c	/^__db_traverse_big(dbp, pgno, txn, callback, cookie/
 __db_truncate	../db/db_truncate.c	/^__db_truncate(dbp, txn, countp)$/
 __db_truncate_callback	../db/db_reclaim.c	/^__db_truncate_callback(dbp, p, cookie, putp)$/
+__db_truncate_freelist	../db/db_meta.c	/^__db_truncate_freelist(dbc, meta, h, list, start, /
 __db_truncate_pp	../db/db_truncate.c	/^__db_truncate_pp(dbp, txn, countp, flags)$/
 __db_truncate_proc	../rpc_server/c/db_server_proc.c	/^__db_truncate_proc(dbpcl_id, txnpcl_id, flags, rep/
-__db_txn_abort_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_abort_4003__SVCSUFFIX__(msg, req)$/
+__db_txn	../dbinc/db.in	/^struct __db_txn {$/
+__db_txn_abort_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_abort_4005__SVCSUFFIX__(msg, req)$/
+__db_txn_active	../dbinc/db.in	/^struct __db_txn_active {$/
 __db_txn_auto_init	../db/db_iface.c	/^__db_txn_auto_init(dbenv, txnidp)$/
 __db_txn_auto_resolve	../db/db_iface.c	/^__db_txn_auto_resolve(dbenv, txn, nosync, ret)$/
-__db_txn_begin_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_begin_4003__SVCSUFFIX__(msg, req)$/
-__db_txn_commit_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_commit_4003__SVCSUFFIX__(msg, req)$/
-__db_txn_discard_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_discard_4003__SVCSUFFIX__(msg, req)$/
-__db_txn_prepare_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_prepare_4003__SVCSUFFIX__(msg, req)$/
-__db_txn_recover_4003__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_recover_4003__SVCSUFFIX__(msg, req)$/
-__db_txnlist_add	../db/db_dispatch.c	/^__db_txnlist_add(dbenv, listp, txnid, status, lsn)/
-__db_txnlist_ckp	../db/db_dispatch.c	/^__db_txnlist_ckp(dbenv, listp, ckp_lsn)$/
-__db_txnlist_end	../db/db_dispatch.c	/^__db_txnlist_end(dbenv, listp)$/
-__db_txnlist_find	../db/db_dispatch.c	/^__db_txnlist_find(dbenv, listp, txnid, statusp)$/
+__db_txn_commit_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_commit_4005__SVCSUFFIX__(msg, req)$/
+__db_txn_deadlock_err	../common/db_err.c	/^__db_txn_deadlock_err(dbenv)$/
+__db_txn_discard_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_discard_4005__SVCSUFFIX__(msg, req)$/
+__db_txn_prepare_4005__SVCSUFFIX__	../rpc_server/c/gen_db_server.c	/^__db_txn_prepare_4005__SVCSUFFIX__(msg, req)$/
+__db_txn_stat	../dbinc/db.in	/^struct __db_txn_stat {$/
+__db_txnhead	../dbinc/db_dispatch.h	/^struct __db_txnhead {$/
+__db_txnlist	../dbinc/db_dispatch.h	/^struct __db_txnlist {$/
+__db_txnlist_add	../db/db_dispatch.c	/^__db_txnlist_add(dbenv, hp, txnid, status, lsn)$/
+__db_txnlist_ckp	../db/db_dispatch.c	/^__db_txnlist_ckp(dbenv, hp, ckp_lsn)$/
+__db_txnlist_end	../db/db_dispatch.c	/^__db_txnlist_end(dbenv, hp)$/
+__db_txnlist_find	../db/db_dispatch.c	/^__db_txnlist_find(dbenv, hp, txnid, statusp)$/
 __db_txnlist_find_internal	../db/db_dispatch.c	/^__db_txnlist_find_internal(dbenv,$/
-__db_txnlist_gen	../db/db_dispatch.c	/^__db_txnlist_gen(dbenv, listp, incr, min, max)$/
+__db_txnlist_gen	../db/db_dispatch.c	/^__db_txnlist_gen(dbenv, hp, incr, min, max)$/
 __db_txnlist_init	../db/db_dispatch.c	/^__db_txnlist_init(dbenv, low_txn, hi_txn, trunc_ls/
-__db_txnlist_lsnadd	../db/db_dispatch.c	/^__db_txnlist_lsnadd(dbenv, listp, lsnp, flags)$/
+__db_txnlist_lsnadd	../db/db_dispatch.c	/^__db_txnlist_lsnadd(dbenv, hp, lsnp)$/
+__db_txnlist_lsnget	../db/db_dispatch.c	/^__db_txnlist_lsnget(dbenv, hp, lsnp, flags)$/
 __db_txnlist_lsninit	../db/db_dispatch.c	/^__db_txnlist_lsninit(dbenv, hp, lsnp)$/
 __db_txnlist_pgnoadd	../db/db_dispatch.c	/^__db_txnlist_pgnoadd(dbenv, hp, fileid, uid, fname/
-__db_txnlist_print	../db/db_dispatch.c	/^__db_txnlist_print(listp)$/
-__db_txnlist_remove	../db/db_dispatch.c	/^__db_txnlist_remove(dbenv, listp, txnid)$/
-__db_txnlist_update	../db/db_dispatch.c	/^__db_txnlist_update(dbenv, listp, txnid, status, l/
+__db_txnlist_print	../db/db_dispatch.c	/^__db_txnlist_print(hp)$/
+__db_txnlist_remove	../db/db_dispatch.c	/^__db_txnlist_remove(dbenv, hp, txnid)$/
+__db_txnlist_update	../db/db_dispatch.c	/^__db_txnlist_update(dbenv, hp, txnid, status, lsn,/
+__db_txnmgr	../dbinc/txn.h	/^struct __db_txnmgr {$/
+__db_txnregion	../dbinc/txn.h	/^struct __db_txnregion {$/
+__db_unknown_error	../common/db_err.c	/^__db_unknown_error(error)$/
 __db_unknown_flag	../common/db_err.c	/^__db_unknown_flag(dbenv, routine, flag)$/
+__db_unknown_path	../common/db_err.c	/^__db_unknown_path(dbenv, routine)$/
 __db_unknown_type	../common/db_err.c	/^__db_unknown_type(dbenv, routine, type)$/
 __db_unmap_rmid	../xa/xa_map.c	/^__db_unmap_rmid(rmid)$/
 __db_unmap_xid	../xa/xa_map.c	/^__db_unmap_xid(dbenv, xid, off)$/
@@ -2838,7 +3093,7 @@ __db_vrfy_meta	../db/db_vrfy.c	/^__db_vrfy_meta(dbp, vdp, meta, pgno, flags)$/
 __db_vrfy_orderchkonly	../db/db_vrfy.c	/^__db_vrfy_orderchkonly(dbp, vdp, name, subdb, flag/
 __db_vrfy_overflow	../db/db_ovfl_vrfy.c	/^__db_vrfy_overflow(dbp, vdp, h, pgno, flags)$/
 __db_vrfy_ovfl_structure	../db/db_ovfl_vrfy.c	/^__db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, fla/
-__db_vrfy_pageinfo_create	../db/db_vrfyutil.c	/^__db_vrfy_pageinfo_create(dbenv, pgipp)$/
+__db_vrfy_pageinfo_create	../db/db_vrfyutil.c	/^__db_vrfy_pageinfo_create(dbenv, pipp)$/
 __db_vrfy_pagezero	../db/db_vrfy.c	/^__db_vrfy_pagezero(dbp, vdp, fhp, flags)$/
 __db_vrfy_pgset	../db/db_vrfyutil.c	/^__db_vrfy_pgset(dbenv, pgsize, dbpp)$/
 __db_vrfy_pgset_get	../db/db_vrfyutil.c	/^__db_vrfy_pgset_get(dbp, pgno, valp)$/
@@ -2850,10 +3105,10 @@ __db_vrfy_struct_feedback	../db/db_vrfy.c	/^__db_vrfy_struct_feedback(dbp, vdp)$
 __db_vrfy_structure	../db/db_vrfy.c	/^__db_vrfy_structure(dbp, vdp, dbname, meta_pgno, f/
 __db_vrfy_subdbs	../db/db_vrfy.c	/^__db_vrfy_subdbs(dbp, vdp, dbname, flags)$/
 __db_vrfy_walkpages	../db/db_vrfy.c	/^__db_vrfy_walkpages(dbp, vdp, handle, callback, fl/
-__db_win32_mutex_destroy	../mutex/mut_win32.c	/^__db_win32_mutex_destroy(mutexp)$/
-__db_win32_mutex_init	../mutex/mut_win32.c	/^__db_win32_mutex_init(dbenv, mutexp, flags)$/
-__db_win32_mutex_lock	../mutex/mut_win32.c	/^__db_win32_mutex_lock(dbenv, mutexp)$/
-__db_win32_mutex_unlock	../mutex/mut_win32.c	/^__db_win32_mutex_unlock(dbenv, mutexp)$/
+__db_win32_mutex_destroy	../mutex/mut_win32.c	/^__db_win32_mutex_destroy(dbenv, mutex)$/
+__db_win32_mutex_init	../mutex/mut_win32.c	/^__db_win32_mutex_init(dbenv, mutex, flags)$/
+__db_win32_mutex_lock	../mutex/mut_win32.c	/^__db_win32_mutex_lock(dbenv, mutex)$/
+__db_win32_mutex_unlock	../mutex/mut_win32.c	/^__db_win32_mutex_unlock(dbenv, mutex)$/
 __db_wrlock_err	../db/db_cam.c	/^__db_wrlock_err(dbenv)$/
 __db_xa_close	../xa/xa.c	/^__db_xa_close(xa_info, rmid, arg_flags)$/
 __db_xa_commit	../xa/xa.c	/^__db_xa_commit(xid, rmid, arg_flags)$/
@@ -2867,24 +3122,21 @@ __db_xa_recover	../xa/xa.c	/^__db_xa_recover(xids, count, rmid, flags)$/
 __db_xa_rollback	../xa/xa.c	/^__db_xa_rollback(xid, rmid, arg_flags)$/
 __db_xa_start	../xa/xa.c	/^__db_xa_start(xid, rmid, arg_flags)$/
 __db_xid_to_txn	../xa/xa_map.c	/^__db_xid_to_txn(dbenv, xid, offp)$/
+__dbc	../dbinc/db.in	/^struct __dbc {$/
+__dbc_c_close_proc	../rpc_server/c/db_server_proc.c	/^__dbc_c_close_proc(dbccl_id, replyp)$/
+__dbc_c_count_proc	../rpc_server/c/db_server_proc.c	/^__dbc_c_count_proc(dbccl_id, flags, replyp)$/
+__dbc_c_del_proc	../rpc_server/c/db_server_proc.c	/^__dbc_c_del_proc(dbccl_id, flags, replyp)$/
+__dbc_c_dup_proc	../rpc_server/c/db_server_proc.c	/^__dbc_c_dup_proc(dbccl_id, flags, replyp)$/
+__dbc_c_get_proc	../rpc_server/c/db_server_proc.c	/^__dbc_c_get_proc(dbccl_id, keydlen, keydoff, keyul/
+__dbc_c_pget_proc	../rpc_server/c/db_server_proc.c	/^__dbc_c_pget_proc(dbccl_id, skeydlen, skeydoff, sk/
+__dbc_c_put_proc	../rpc_server/c/db_server_proc.c	/^__dbc_c_put_proc(dbccl_id, keydlen, keydoff, keyul/
 __dbc_close_int	../rpc_server/c/db_server_util.c	/^__dbc_close_int(dbc_ctp)$/
-__dbc_close_proc	../rpc_server/c/db_server_proc.c	/^__dbc_close_proc(dbccl_id, replyp)$/
-__dbc_count_proc	../rpc_server/c/db_server_proc.c	/^__dbc_count_proc(dbccl_id, flags, replyp)$/
-__dbc_del_proc	../rpc_server/c/db_server_proc.c	/^__dbc_del_proc(dbccl_id, flags, replyp)$/
-__dbc_dup_proc	../rpc_server/c/db_server_proc.c	/^__dbc_dup_proc(dbccl_id, flags, replyp)$/
-__dbc_get_proc	../rpc_server/c/db_server_proc.c	/^__dbc_get_proc(dbccl_id, keydlen, keydoff, keyulen/
-__dbc_pget_proc	../rpc_server/c/db_server_proc.c	/^__dbc_pget_proc(dbccl_id, skeydlen, skeydoff, skey/
-__dbc_put_proc	../rpc_server/c/db_server_proc.c	/^__dbc_put_proc(dbccl_id, keydlen, keydoff, keyulen/
+__dbc_internal	../dbinc/db_int.in	/^struct __dbc_internal {$/
+__dbc_logging	../common/db_err.c	/^__dbc_logging(dbc)$/
 __dbcl_c_destroy	../rpc_client/client.c	/^__dbcl_c_destroy(dbc)$/
 __dbcl_c_refresh	../rpc_client/client.c	/^__dbcl_c_refresh(dbc)$/
 __dbcl_c_setup	../rpc_client/client.c	/^__dbcl_c_setup(cl_id, dbp, dbcp)$/
-__dbcl_db_alloc	../rpc_client/gen_client.c	/^__dbcl_db_alloc(dbp, func0, func1, func2)$/
 __dbcl_db_associate	../rpc_client/gen_client.c	/^__dbcl_db_associate(dbp, txnp, sdbp, func0, flags)/
-__dbcl_db_bt_compare	../rpc_client/gen_client.c	/^__dbcl_db_bt_compare(dbp, func0)$/
-__dbcl_db_bt_maxkey	../rpc_client/gen_client.c	/^__dbcl_db_bt_maxkey(dbp, maxkey)$/
-__dbcl_db_bt_minkey	../rpc_client/gen_client.c	/^__dbcl_db_bt_minkey(dbp, minkey)$/
-__dbcl_db_bt_prefix	../rpc_client/gen_client.c	/^__dbcl_db_bt_prefix(dbp, func0)$/
-__dbcl_db_cachesize	../rpc_client/gen_client.c	/^__dbcl_db_cachesize(dbp, gbytes, bytes, ncache)$/
 __dbcl_db_close	../rpc_client/gen_client.c	/^__dbcl_db_close(dbp, flags)$/
 __dbcl_db_close_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_close_ret(dbp, flags, replyp)$/
 __dbcl_db_create	../rpc_client/gen_client.c	/^__dbcl_db_create(dbp, dbenv, flags)$/
@@ -2892,86 +3144,79 @@ __dbcl_db_create_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_create_ret(dbp,
 __dbcl_db_cursor	../rpc_client/gen_client.c	/^__dbcl_db_cursor(dbp, txnp, dbcpp, flags)$/
 __dbcl_db_cursor_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_cursor_ret(dbp, txnp, dbcp, flags, reply/
 __dbcl_db_del	../rpc_client/gen_client.c	/^__dbcl_db_del(dbp, txnp, key, flags)$/
-__dbcl_db_dup_compare	../rpc_client/gen_client.c	/^__dbcl_db_dup_compare(dbp, func0)$/
-__dbcl_db_encrypt	../rpc_client/gen_client.c	/^__dbcl_db_encrypt(dbp, passwd, flags)$/
-__dbcl_db_extentsize	../rpc_client/gen_client.c	/^__dbcl_db_extentsize(dbp, extentsize)$/
-__dbcl_db_fd	../rpc_client/gen_client.c	/^__dbcl_db_fd(dbp, fdp)$/
-__dbcl_db_feedback	../rpc_client/gen_client.c	/^__dbcl_db_feedback(dbp, func0)$/
-__dbcl_db_flags	../rpc_client/gen_client.c	/^__dbcl_db_flags(dbp, flags)$/
 __dbcl_db_get	../rpc_client/gen_client.c	/^__dbcl_db_get(dbp, txnp, key, data, flags)$/
 __dbcl_db_get_bt_minkey	../rpc_client/gen_client.c	/^__dbcl_db_get_bt_minkey(dbp, minkeyp)$/
-__dbcl_db_get_cachesize	../rpc_client/gen_client.c	/^__dbcl_db_get_cachesize(dbp, gbytesp, bytesp, ncac/
+__dbcl_db_get_dbname	../rpc_client/gen_client.c	/^__dbcl_db_get_dbname(dbp, filenamep, dbnamep)$/
 __dbcl_db_get_encrypt_flags	../rpc_client/gen_client.c	/^__dbcl_db_get_encrypt_flags(dbp, flagsp)$/
-__dbcl_db_get_extentsize	../rpc_client/gen_client.c	/^__dbcl_db_get_extentsize(dbp, extentsizep)$/
 __dbcl_db_get_flags	../rpc_client/gen_client.c	/^__dbcl_db_get_flags(dbp, flagsp)$/
 __dbcl_db_get_h_ffactor	../rpc_client/gen_client.c	/^__dbcl_db_get_h_ffactor(dbp, ffactorp)$/
 __dbcl_db_get_h_nelem	../rpc_client/gen_client.c	/^__dbcl_db_get_h_nelem(dbp, nelemp)$/
 __dbcl_db_get_lorder	../rpc_client/gen_client.c	/^__dbcl_db_get_lorder(dbp, lorderp)$/
-__dbcl_db_get_name	../rpc_client/gen_client.c	/^__dbcl_db_get_name(dbp, filenamep, dbnamep)$/
 __dbcl_db_get_open_flags	../rpc_client/gen_client.c	/^__dbcl_db_get_open_flags(dbp, flagsp)$/
 __dbcl_db_get_pagesize	../rpc_client/gen_client.c	/^__dbcl_db_get_pagesize(dbp, pagesizep)$/
+__dbcl_db_get_q_extentsize	../rpc_client/gen_client.c	/^__dbcl_db_get_q_extentsize(dbp, extentsizep)$/
 __dbcl_db_get_re_delim	../rpc_client/gen_client.c	/^__dbcl_db_get_re_delim(dbp, delimp)$/
 __dbcl_db_get_re_len	../rpc_client/gen_client.c	/^__dbcl_db_get_re_len(dbp, lenp)$/
 __dbcl_db_get_re_pad	../rpc_client/gen_client.c	/^__dbcl_db_get_re_pad(dbp, padp)$/
-__dbcl_db_get_re_source	../rpc_client/gen_client.c	/^__dbcl_db_get_re_source(dbp, re_sourcep)$/
 __dbcl_db_get_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_get_ret(dbp, txnp, key, data, flags, rep/
-__dbcl_db_h_ffactor	../rpc_client/gen_client.c	/^__dbcl_db_h_ffactor(dbp, ffactor)$/
-__dbcl_db_h_hash	../rpc_client/gen_client.c	/^__dbcl_db_h_hash(dbp, func0)$/
-__dbcl_db_h_nelem	../rpc_client/gen_client.c	/^__dbcl_db_h_nelem(dbp, nelem)$/
 __dbcl_db_join	../rpc_client/gen_client.c	/^__dbcl_db_join(dbp, curs, dbcp, flags)$/
 __dbcl_db_join_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp)/
 __dbcl_db_key_range	../rpc_client/gen_client.c	/^__dbcl_db_key_range(dbp, txnp, key, range, flags)$/
 __dbcl_db_key_range_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_key_range_ret(dbp, txnp, key, range, fla/
-__dbcl_db_lorder	../rpc_client/gen_client.c	/^__dbcl_db_lorder(dbp, lorder)$/
 __dbcl_db_open	../rpc_client/gen_client.c	/^__dbcl_db_open(dbp, txnp, name, subdb, type, flags/
 __dbcl_db_open_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_open_ret(dbp, txn, name, subdb, type, fl/
 __dbcl_db_open_wrap	../rpc_client/client.c	/^__dbcl_db_open_wrap(dbp, txnp, name, subdb, type, /
-__dbcl_db_pagesize	../rpc_client/gen_client.c	/^__dbcl_db_pagesize(dbp, pagesize)$/
-__dbcl_db_panic	../rpc_client/gen_client.c	/^__dbcl_db_panic(dbp, func0)$/
 __dbcl_db_pget	../rpc_client/gen_client.c	/^__dbcl_db_pget(dbp, txnp, skey, pkey, data, flags)/
 __dbcl_db_pget_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_pget_ret(dbp, txnp, skey, pkey, data, fl/
 __dbcl_db_put	../rpc_client/gen_client.c	/^__dbcl_db_put(dbp, txnp, key, data, flags)$/
 __dbcl_db_put_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_put_ret(dbp, txnp, key, data, flags, rep/
-__dbcl_db_re_delim	../rpc_client/gen_client.c	/^__dbcl_db_re_delim(dbp, delim)$/
-__dbcl_db_re_len	../rpc_client/gen_client.c	/^__dbcl_db_re_len(dbp, len)$/
-__dbcl_db_re_pad	../rpc_client/gen_client.c	/^__dbcl_db_re_pad(dbp, pad)$/
-__dbcl_db_re_source	../rpc_client/gen_client.c	/^__dbcl_db_re_source(dbp, re_source)$/
 __dbcl_db_remove	../rpc_client/gen_client.c	/^__dbcl_db_remove(dbp, name, subdb, flags)$/
 __dbcl_db_remove_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_remove_ret(dbp, name, subdb, flags, repl/
 __dbcl_db_rename	../rpc_client/gen_client.c	/^__dbcl_db_rename(dbp, name, subdb, newname, flags)/
 __dbcl_db_rename_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_rename_ret(dbp, name, subdb, newname, fl/
-__dbcl_db_set_append_recno	../rpc_client/gen_client.c	/^__dbcl_db_set_append_recno(dbp, func0)$/
+__dbcl_db_set_bt_minkey	../rpc_client/gen_client.c	/^__dbcl_db_set_bt_minkey(dbp, minkey)$/
+__dbcl_db_set_encrypt	../rpc_client/gen_client.c	/^__dbcl_db_set_encrypt(dbp, passwd, flags)$/
+__dbcl_db_set_flags	../rpc_client/gen_client.c	/^__dbcl_db_set_flags(dbp, flags)$/
+__dbcl_db_set_h_ffactor	../rpc_client/gen_client.c	/^__dbcl_db_set_h_ffactor(dbp, ffactor)$/
+__dbcl_db_set_h_nelem	../rpc_client/gen_client.c	/^__dbcl_db_set_h_nelem(dbp, nelem)$/
+__dbcl_db_set_lorder	../rpc_client/gen_client.c	/^__dbcl_db_set_lorder(dbp, lorder)$/
+__dbcl_db_set_pagesize	../rpc_client/gen_client.c	/^__dbcl_db_set_pagesize(dbp, pagesize)$/
+__dbcl_db_set_q_extentsize	../rpc_client/gen_client.c	/^__dbcl_db_set_q_extentsize(dbp, extentsize)$/
+__dbcl_db_set_re_delim	../rpc_client/gen_client.c	/^__dbcl_db_set_re_delim(dbp, delim)$/
+__dbcl_db_set_re_len	../rpc_client/gen_client.c	/^__dbcl_db_set_re_len(dbp, len)$/
+__dbcl_db_set_re_pad	../rpc_client/gen_client.c	/^__dbcl_db_set_re_pad(dbp, pad)$/
 __dbcl_db_stat	../rpc_client/gen_client.c	/^__dbcl_db_stat(dbp, txnp, sp, flags)$/
 __dbcl_db_stat_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_stat_ret(dbp, txnp, sp, flags, replyp)$/
 __dbcl_db_sync	../rpc_client/gen_client.c	/^__dbcl_db_sync(dbp, flags)$/
 __dbcl_db_truncate	../rpc_client/gen_client.c	/^__dbcl_db_truncate(dbp, txnp, countp, flags)$/
 __dbcl_db_truncate_ret	../rpc_client/gen_client_ret.c	/^__dbcl_db_truncate_ret(dbp, txnp, countp, flags, r/
-__dbcl_db_upgrade	../rpc_client/gen_client.c	/^__dbcl_db_upgrade(dbp, fname, flags)$/
-__dbcl_db_verify	../rpc_client/gen_client.c	/^__dbcl_db_verify(dbp, fname, subdb, outfile, flags/
-__dbcl_dbc_close	../rpc_client/gen_client.c	/^__dbcl_dbc_close(dbc)$/
-__dbcl_dbc_close_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_close_ret(dbc, replyp)$/
-__dbcl_dbc_count	../rpc_client/gen_client.c	/^__dbcl_dbc_count(dbc, countp, flags)$/
-__dbcl_dbc_count_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_count_ret(dbc, countp, flags, replyp)$/
-__dbcl_dbc_del	../rpc_client/gen_client.c	/^__dbcl_dbc_del(dbc, flags)$/
-__dbcl_dbc_dup	../rpc_client/gen_client.c	/^__dbcl_dbc_dup(dbc, dbcp, flags)$/
-__dbcl_dbc_dup_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp)$/
-__dbcl_dbc_get	../rpc_client/gen_client.c	/^__dbcl_dbc_get(dbc, key, data, flags)$/
-__dbcl_dbc_get_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_get_ret(dbc, key, data, flags, replyp)$/
-__dbcl_dbc_pget	../rpc_client/gen_client.c	/^__dbcl_dbc_pget(dbc, skey, pkey, data, flags)$/
-__dbcl_dbc_pget_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_pget_ret(dbc, skey, pkey, data, flags, /
-__dbcl_dbc_put	../rpc_client/gen_client.c	/^__dbcl_dbc_put(dbc, key, data, flags)$/
-__dbcl_dbc_put_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_put_ret(dbc, key, data, flags, replyp)$/
+__dbcl_dbc_c_close	../rpc_client/gen_client.c	/^__dbcl_dbc_c_close(dbc)$/
+__dbcl_dbc_c_close_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_c_close_ret(dbc, replyp)$/
+__dbcl_dbc_c_count	../rpc_client/gen_client.c	/^__dbcl_dbc_c_count(dbc, countp, flags)$/
+__dbcl_dbc_c_count_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_c_count_ret(dbc, countp, flags, replyp)/
+__dbcl_dbc_c_del	../rpc_client/gen_client.c	/^__dbcl_dbc_c_del(dbc, flags)$/
+__dbcl_dbc_c_dup	../rpc_client/gen_client.c	/^__dbcl_dbc_c_dup(dbc, dbcp, flags)$/
+__dbcl_dbc_c_dup_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_c_dup_ret(dbc, dbcp, flags, replyp)$/
+__dbcl_dbc_c_get	../rpc_client/gen_client.c	/^__dbcl_dbc_c_get(dbc, key, data, flags)$/
+__dbcl_dbc_c_get_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_c_get_ret(dbc, key, data, flags, replyp/
+__dbcl_dbc_c_pget	../rpc_client/gen_client.c	/^__dbcl_dbc_c_pget(dbc, skey, pkey, data, flags)$/
+__dbcl_dbc_c_pget_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_c_pget_ret(dbc, skey, pkey, data, flags/
+__dbcl_dbc_c_put	../rpc_client/gen_client.c	/^__dbcl_dbc_c_put(dbc, key, data, flags)$/
+__dbcl_dbc_c_put_ret	../rpc_client/gen_client_ret.c	/^__dbcl_dbc_c_put_ret(dbc, key, data, flags, replyp/
+__dbcl_dbc_init	../rpc_client/gen_client.c	/^__dbcl_dbc_init(dbc)$/
 __dbcl_dbclose_common	../rpc_client/client.c	/^__dbcl_dbclose_common(dbp)$/
-__dbcl_env_alloc	../rpc_client/gen_client.c	/^__dbcl_env_alloc(dbenv, func0, func1, func2)$/
-__dbcl_env_cachesize	../rpc_client/gen_client.c	/^__dbcl_env_cachesize(dbenv, gbytes, bytes, ncache)/
+__dbcl_dbenv_illegal	../rpc_client/gen_client.c	/^__dbcl_dbenv_illegal(dbenv)$/
+__dbcl_dbenv_init	../rpc_client/gen_client.c	/^__dbcl_dbenv_init(dbenv)$/
+__dbcl_dbp_illegal	../rpc_client/gen_client.c	/^__dbcl_dbp_illegal(dbp)$/
+__dbcl_dbp_init	../rpc_client/gen_client.c	/^__dbcl_dbp_init(dbp)$/
+__dbcl_env_cdsgroup_begin	../rpc_client/gen_client.c	/^__dbcl_env_cdsgroup_begin(dbenv, txnpp)$/
+__dbcl_env_cdsgroup_begin_ret	../rpc_client/gen_client_ret.c	/^__dbcl_env_cdsgroup_begin_ret(envp, txnpp, replyp)/
 __dbcl_env_close	../rpc_client/gen_client.c	/^__dbcl_env_close(dbenv, flags)$/
 __dbcl_env_close_wrap	../rpc_client/client.c	/^__dbcl_env_close_wrap(dbenv, flags)$/
 __dbcl_env_create	../rpc_client/gen_client.c	/^__dbcl_env_create(dbenv, timeout)$/
 __dbcl_env_create_ret	../rpc_client/gen_client_ret.c	/^__dbcl_env_create_ret(dbenv, timeout, replyp)$/
 __dbcl_env_dbremove	../rpc_client/gen_client.c	/^__dbcl_env_dbremove(dbenv, txnp, name, subdb, flag/
 __dbcl_env_dbrename	../rpc_client/gen_client.c	/^__dbcl_env_dbrename(dbenv, txnp, name, subdb, newn/
-__dbcl_env_encrypt	../rpc_client/gen_client.c	/^__dbcl_env_encrypt(dbenv, passwd, flags)$/
-__dbcl_env_flags	../rpc_client/gen_client.c	/^__dbcl_env_flags(dbenv, flags, onoff)$/
 __dbcl_env_get_cachesize	../rpc_client/gen_client.c	/^__dbcl_env_get_cachesize(dbenv, gbytesp, bytesp, n/
 __dbcl_env_get_encrypt_flags	../rpc_client/gen_client.c	/^__dbcl_env_get_encrypt_flags(dbenv, flagsp)$/
 __dbcl_env_get_flags	../rpc_client/gen_client.c	/^__dbcl_env_get_flags(dbenv, flagsp)$/
@@ -2980,177 +3225,37 @@ __dbcl_env_get_open_flags	../rpc_client/gen_client.c	/^__dbcl_env_get_open_flags
 __dbcl_env_open	../rpc_client/gen_client.c	/^__dbcl_env_open(dbenv, home, flags, mode)$/
 __dbcl_env_open_ret	../rpc_client/gen_client_ret.c	/^__dbcl_env_open_ret(dbenv, home, flags, mode, repl/
 __dbcl_env_open_wrap	../rpc_client/client.c	/^__dbcl_env_open_wrap(dbenv, home, flags, mode)$/
-__dbcl_env_paniccall	../rpc_client/gen_client.c	/^__dbcl_env_paniccall(dbenv, func0)$/
 __dbcl_env_remove	../rpc_client/gen_client.c	/^__dbcl_env_remove(dbenv, home, flags)$/
 __dbcl_env_remove_ret	../rpc_client/gen_client_ret.c	/^__dbcl_env_remove_ret(dbenv, home, flags, replyp)$/
-__dbcl_env_set_feedback	../rpc_client/gen_client.c	/^__dbcl_env_set_feedback(dbenv, func0)$/
-__dbcl_envrpcserver	../rpc_client/client.c	/^__dbcl_envrpcserver(dbenv, clnt, host, tsec, ssec,/
-__dbcl_get_data_dirs	../rpc_client/gen_client.c	/^__dbcl_get_data_dirs(dbenv, dirpp)$/
-__dbcl_get_lg_bsize	../rpc_client/gen_client.c	/^__dbcl_get_lg_bsize(dbenv, bsizep)$/
-__dbcl_get_lg_dir	../rpc_client/gen_client.c	/^__dbcl_get_lg_dir(dbenv, dirp)$/
-__dbcl_get_lg_max	../rpc_client/gen_client.c	/^__dbcl_get_lg_max(dbenv, maxp)$/
-__dbcl_get_lg_regionmax	../rpc_client/gen_client.c	/^__dbcl_get_lg_regionmax(dbenv, maxp)$/
-__dbcl_get_lk_conflicts	../rpc_client/gen_client.c	/^__dbcl_get_lk_conflicts(dbenv, conflicts, modes)$/
-__dbcl_get_lk_detect	../rpc_client/gen_client.c	/^__dbcl_get_lk_detect(dbenv, detectp)$/
-__dbcl_get_lk_max_lockers	../rpc_client/gen_client.c	/^__dbcl_get_lk_max_lockers(dbenv, maxp)$/
-__dbcl_get_lk_max_locks	../rpc_client/gen_client.c	/^__dbcl_get_lk_max_locks(dbenv, maxp)$/
-__dbcl_get_lk_max_objects	../rpc_client/gen_client.c	/^__dbcl_get_lk_max_objects(dbenv, maxp)$/
-__dbcl_get_mp_max_openfd	../rpc_client/gen_client.c	/^__dbcl_get_mp_max_openfd(dbenv, nopenp)$/
-__dbcl_get_mp_max_write	../rpc_client/gen_client.c	/^__dbcl_get_mp_max_write(dbenv, nwritep, nsleepp)$/
-__dbcl_get_mp_mmapsize	../rpc_client/gen_client.c	/^__dbcl_get_mp_mmapsize(dbenv, mmapsizep)$/
-__dbcl_get_shm_key	../rpc_client/gen_client.c	/^__dbcl_get_shm_key(dbenv, shm_keyp)$/
-__dbcl_get_tas_spins	../rpc_client/gen_client.c	/^__dbcl_get_tas_spins(dbenv, tas_spinsp)$/
-__dbcl_get_timeout	../rpc_client/gen_client.c	/^__dbcl_get_timeout(dbenv, timeoutp, flags)$/
-__dbcl_get_tmp_dir	../rpc_client/gen_client.c	/^__dbcl_get_tmp_dir(dbenv, dirp)$/
-__dbcl_get_tx_max	../rpc_client/gen_client.c	/^__dbcl_get_tx_max(dbenv, maxp)$/
-__dbcl_get_tx_timestamp	../rpc_client/gen_client.c	/^__dbcl_get_tx_timestamp(dbenv, maxp)$/
-__dbcl_get_verbose	../rpc_client/gen_client.c	/^__dbcl_get_verbose(dbenv, which, onoffp)$/
-__dbcl_init	../db/db_method.c	/^__dbcl_init(dbp, dbenv, flags)$/
-__dbcl_lock_detect	../rpc_client/gen_client.c	/^__dbcl_lock_detect(dbenv, flags, atype, aborted)$/
-__dbcl_lock_get	../rpc_client/gen_client.c	/^__dbcl_lock_get(dbenv, locker, flags, obj, mode, l/
-__dbcl_lock_id	../rpc_client/gen_client.c	/^__dbcl_lock_id(dbenv, idp)$/
-__dbcl_lock_id_free	../rpc_client/gen_client.c	/^__dbcl_lock_id_free(dbenv, id)$/
-__dbcl_lock_put	../rpc_client/gen_client.c	/^__dbcl_lock_put(dbenv, lock)$/
-__dbcl_lock_stat	../rpc_client/gen_client.c	/^__dbcl_lock_stat(dbenv, statp, flags)$/
-__dbcl_lock_vec	../rpc_client/gen_client.c	/^__dbcl_lock_vec(dbenv, locker, flags, list, nlist,/
-__dbcl_log_archive	../rpc_client/gen_client.c	/^__dbcl_log_archive(dbenv, listp, flags)$/
-__dbcl_log_cursor	../rpc_client/gen_client.c	/^__dbcl_log_cursor(dbenv, logcp, flags)$/
-__dbcl_log_file	../rpc_client/gen_client.c	/^__dbcl_log_file(dbenv, lsn, namep, len)$/
-__dbcl_log_flush	../rpc_client/gen_client.c	/^__dbcl_log_flush(dbenv, lsn)$/
-__dbcl_log_put	../rpc_client/gen_client.c	/^__dbcl_log_put(dbenv, lsn, data, flags)$/
-__dbcl_log_stat	../rpc_client/gen_client.c	/^__dbcl_log_stat(dbenv, statp, flags)$/
-__dbcl_memp_fget	../rpc_client/gen_client.c	/^__dbcl_memp_fget(dbmfp, pgnoaddr, flags, addrp)$/
-__dbcl_memp_fopen	../rpc_client/gen_client.c	/^__dbcl_memp_fopen(dbmfp, path, flags, mode, pagesi/
-__dbcl_memp_fput	../rpc_client/gen_client.c	/^__dbcl_memp_fput(dbmfp, pgaddr, flags)$/
-__dbcl_memp_fset	../rpc_client/gen_client.c	/^__dbcl_memp_fset(dbmfp, pgaddr, flags)$/
-__dbcl_memp_fsync	../rpc_client/gen_client.c	/^__dbcl_memp_fsync(dbmfp)$/
-__dbcl_memp_get_clear_len	../rpc_client/gen_client.c	/^__dbcl_memp_get_clear_len(dbmfp, clear_lenp)$/
-__dbcl_memp_get_fileid	../rpc_client/gen_client.c	/^__dbcl_memp_get_fileid(dbmfp, fileid)$/
-__dbcl_memp_get_flags	../rpc_client/gen_client.c	/^__dbcl_memp_get_flags(dbmfp, flagsp)$/
-__dbcl_memp_get_ftype	../rpc_client/gen_client.c	/^__dbcl_memp_get_ftype(dbmfp, ftype)$/
-__dbcl_memp_get_lsn_offset	../rpc_client/gen_client.c	/^__dbcl_memp_get_lsn_offset(dbmfp, lsn_offsetp)$/
-__dbcl_memp_get_maxsize	../rpc_client/gen_client.c	/^__dbcl_memp_get_maxsize(dbmfp, gbytesp, bytesp)$/
-__dbcl_memp_get_pgcookie	../rpc_client/gen_client.c	/^__dbcl_memp_get_pgcookie(dbmfp, pgcookie)$/
-__dbcl_memp_get_priority	../rpc_client/gen_client.c	/^__dbcl_memp_get_priority(dbmfp, priorityp)$/
-__dbcl_memp_register	../rpc_client/gen_client.c	/^__dbcl_memp_register(dbenv, ftype, func0, func1)$/
-__dbcl_memp_set_clear_len	../rpc_client/gen_client.c	/^__dbcl_memp_set_clear_len(dbmfp, clear_len)$/
-__dbcl_memp_set_fileid	../rpc_client/gen_client.c	/^__dbcl_memp_set_fileid(dbmfp, fileid)$/
-__dbcl_memp_set_flags	../rpc_client/gen_client.c	/^__dbcl_memp_set_flags(dbmfp, flags, onoff)$/
-__dbcl_memp_set_ftype	../rpc_client/gen_client.c	/^__dbcl_memp_set_ftype(dbmfp, ftype)$/
-__dbcl_memp_set_lsn_offset	../rpc_client/gen_client.c	/^__dbcl_memp_set_lsn_offset(dbmfp, lsn_offset)$/
-__dbcl_memp_set_maxsize	../rpc_client/gen_client.c	/^__dbcl_memp_set_maxsize(dbmfp, gbytes, bytes)$/
-__dbcl_memp_set_pgcookie	../rpc_client/gen_client.c	/^__dbcl_memp_set_pgcookie(dbmfp, pgcookie)$/
-__dbcl_memp_set_priority	../rpc_client/gen_client.c	/^__dbcl_memp_set_priority(dbmfp, priority)$/
-__dbcl_memp_stat	../rpc_client/gen_client.c	/^__dbcl_memp_stat(dbenv, gstatp, fstatp, flags)$/
-__dbcl_memp_sync	../rpc_client/gen_client.c	/^__dbcl_memp_sync(dbenv, lsn)$/
-__dbcl_memp_trickle	../rpc_client/gen_client.c	/^__dbcl_memp_trickle(dbenv, pct, nwrotep)$/
+__dbcl_env_set_cachesize	../rpc_client/gen_client.c	/^__dbcl_env_set_cachesize(dbenv, gbytes, bytes, nca/
+__dbcl_env_set_encrypt	../rpc_client/gen_client.c	/^__dbcl_env_set_encrypt(dbenv, passwd, flags)$/
+__dbcl_env_set_flags	../rpc_client/gen_client.c	/^__dbcl_env_set_flags(dbenv, flags, onoff)$/
+__dbcl_env_set_rpc_server	../rpc_client/client.c	/^__dbcl_env_set_rpc_server(dbenv, clnt, host, tsec,/
+__dbcl_env_txn_begin	../rpc_client/gen_client.c	/^__dbcl_env_txn_begin(dbenv, parent, txnpp, flags)$/
+__dbcl_env_txn_begin_ret	../rpc_client/gen_client_ret.c	/^__dbcl_env_txn_begin_ret(envp, parent, txnpp, flag/
+__dbcl_env_txn_recover	../rpc_client/gen_client.c	/^__dbcl_env_txn_recover(dbenv, preplist, count, ret/
+__dbcl_env_txn_recover_ret	../rpc_client/gen_client_ret.c	/^__dbcl_env_txn_recover_ret(dbenv, preplist, count,/
 __dbcl_noserver	../rpc_client/gen_client.c	/^__dbcl_noserver(dbenv)$/
 __dbcl_refresh	../rpc_client/client.c	/^__dbcl_refresh(dbenv)$/
-__dbcl_rep_elect	../rpc_client/gen_client.c	/^__dbcl_rep_elect(dbenv, nsites, nvotes, pri, timeo/
-__dbcl_rep_flush	../rpc_client/gen_client.c	/^__dbcl_rep_flush(dbenv)$/
-__dbcl_rep_get_limit	../rpc_client/gen_client.c	/^__dbcl_rep_get_limit(dbenv, mbytesp, bytesp)$/
-__dbcl_rep_process_message	../rpc_client/gen_client.c	/^__dbcl_rep_process_message(dbenv, rec, control, id/
-__dbcl_rep_set_limit	../rpc_client/gen_client.c	/^__dbcl_rep_set_limit(dbenv, mbytes, bytes)$/
-__dbcl_rep_set_rep_transport	../rpc_client/gen_client.c	/^__dbcl_rep_set_rep_transport(dbenv, id, func0)$/
-__dbcl_rep_set_request	../rpc_client/gen_client.c	/^__dbcl_rep_set_request(dbenv, min, max)$/
-__dbcl_rep_start	../rpc_client/gen_client.c	/^__dbcl_rep_start(dbenv, cdata, flags)$/
-__dbcl_rep_stat	../rpc_client/gen_client.c	/^__dbcl_rep_stat(dbenv, statp, flags)$/
 __dbcl_retcopy	../rpc_client/client.c	/^__dbcl_retcopy(dbenv, dbt, data, len, memp, memsiz/
-__dbcl_rpc_illegal	../rpc_client/gen_client.c	/^__dbcl_rpc_illegal(dbenv, name)$/
-__dbcl_set_app_dispatch	../rpc_client/gen_client.c	/^__dbcl_set_app_dispatch(dbenv, func0)$/
-__dbcl_set_data_dir	../rpc_client/gen_client.c	/^__dbcl_set_data_dir(dbenv, dir)$/
-__dbcl_set_lg_bsize	../rpc_client/gen_client.c	/^__dbcl_set_lg_bsize(dbenv, bsize)$/
-__dbcl_set_lg_dir	../rpc_client/gen_client.c	/^__dbcl_set_lg_dir(dbenv, dir)$/
-__dbcl_set_lg_max	../rpc_client/gen_client.c	/^__dbcl_set_lg_max(dbenv, max)$/
-__dbcl_set_lg_regionmax	../rpc_client/gen_client.c	/^__dbcl_set_lg_regionmax(dbenv, max)$/
-__dbcl_set_lk_conflict	../rpc_client/gen_client.c	/^__dbcl_set_lk_conflict(dbenv, conflicts, modes)$/
-__dbcl_set_lk_detect	../rpc_client/gen_client.c	/^__dbcl_set_lk_detect(dbenv, detect)$/
-__dbcl_set_lk_max	../rpc_client/gen_client.c	/^__dbcl_set_lk_max(dbenv, max)$/
-__dbcl_set_lk_max_lockers	../rpc_client/gen_client.c	/^__dbcl_set_lk_max_lockers(dbenv, max)$/
-__dbcl_set_lk_max_locks	../rpc_client/gen_client.c	/^__dbcl_set_lk_max_locks(dbenv, max)$/
-__dbcl_set_lk_max_objects	../rpc_client/gen_client.c	/^__dbcl_set_lk_max_objects(dbenv, max)$/
-__dbcl_set_mp_max_openfd	../rpc_client/gen_client.c	/^__dbcl_set_mp_max_openfd(dbenv, nopen)$/
-__dbcl_set_mp_max_write	../rpc_client/gen_client.c	/^__dbcl_set_mp_max_write(dbenv, nwrite, nsleep)$/
-__dbcl_set_mp_mmapsize	../rpc_client/gen_client.c	/^__dbcl_set_mp_mmapsize(dbenv, mmapsize)$/
-__dbcl_set_shm_key	../rpc_client/gen_client.c	/^__dbcl_set_shm_key(dbenv, shm_key)$/
-__dbcl_set_tas_spins	../rpc_client/gen_client.c	/^__dbcl_set_tas_spins(dbenv, tas_spins)$/
-__dbcl_set_timeout	../rpc_client/gen_client.c	/^__dbcl_set_timeout(dbenv, timeout, flags)$/
-__dbcl_set_tmp_dir	../rpc_client/gen_client.c	/^__dbcl_set_tmp_dir(dbenv, dir)$/
-__dbcl_set_tx_max	../rpc_client/gen_client.c	/^__dbcl_set_tx_max(dbenv, max)$/
-__dbcl_set_tx_timestamp	../rpc_client/gen_client.c	/^__dbcl_set_tx_timestamp(dbenv, max)$/
-__dbcl_set_verbose	../rpc_client/gen_client.c	/^__dbcl_set_verbose(dbenv, which, onoff)$/
 __dbcl_txn_abort	../rpc_client/gen_client.c	/^__dbcl_txn_abort(txnp)$/
 __dbcl_txn_abort_ret	../rpc_client/gen_client_ret.c	/^__dbcl_txn_abort_ret(txnp, replyp)$/
-__dbcl_txn_begin	../rpc_client/gen_client.c	/^__dbcl_txn_begin(dbenv, parent, txnpp, flags)$/
-__dbcl_txn_begin_ret	../rpc_client/gen_client_ret.c	/^__dbcl_txn_begin_ret(envp, parent, txnpp, flags, r/
-__dbcl_txn_checkpoint	../rpc_client/gen_client.c	/^__dbcl_txn_checkpoint(dbenv, kbyte, min, flags)$/
 __dbcl_txn_close	../rpc_client/client.c	/^__dbcl_txn_close(dbenv)$/
 __dbcl_txn_commit	../rpc_client/gen_client.c	/^__dbcl_txn_commit(txnp, flags)$/
 __dbcl_txn_commit_ret	../rpc_client/gen_client_ret.c	/^__dbcl_txn_commit_ret(txnp, flags, replyp)$/
 __dbcl_txn_discard	../rpc_client/gen_client.c	/^__dbcl_txn_discard(txnp, flags)$/
 __dbcl_txn_discard_ret	../rpc_client/gen_client_ret.c	/^__dbcl_txn_discard_ret(txnp, flags, replyp)$/
 __dbcl_txn_end	../rpc_client/client.c	/^__dbcl_txn_end(txnp)$/
+__dbcl_txn_illegal	../rpc_client/gen_client.c	/^__dbcl_txn_illegal(txn)$/
+__dbcl_txn_init	../rpc_client/gen_client.c	/^__dbcl_txn_init(txn)$/
 __dbcl_txn_prepare	../rpc_client/gen_client.c	/^__dbcl_txn_prepare(txnp, gid)$/
-__dbcl_txn_recover	../rpc_client/gen_client.c	/^__dbcl_txn_recover(dbenv, preplist, count, retp, f/
-__dbcl_txn_recover_ret	../rpc_client/gen_client_ret.c	/^__dbcl_txn_recover_ret(dbenv, preplist, count, ret/
 __dbcl_txn_setup	../rpc_client/client.c	/^__dbcl_txn_setup(dbenv, txn, parent, id)$/
-__dbcl_txn_stat	../rpc_client/gen_client.c	/^__dbcl_txn_stat(dbenv, statp, flags)$/
-__dbcl_txn_timeout	../rpc_client/gen_client.c	/^__dbcl_txn_timeout(txnp, timeout, flags)$/
 __dbclear_child	../rpc_server/c/db_server_util.c	/^__dbclear_child(parent)$/
 __dbclear_ctp	../rpc_server/c/db_server_util.c	/^__dbclear_ctp(ctp)$/
 __dbdel_ctp	../rpc_server/c/db_server_util.c	/^__dbdel_ctp(parent)$/
-__dbenv_close	../env/env_open.c	/^__dbenv_close(dbenv, rep_check)$/
-__dbenv_close_int	../rpc_server/c/db_server_util.c	/^__dbenv_close_int(id, flags, force)$/
-__dbenv_close_pp	../env/env_open.c	/^__dbenv_close_pp(dbenv, flags)$/
-__dbenv_config	../env/env_open.c	/^__dbenv_config(dbenv, db_home, flags)$/
-__dbenv_dbremove_pp	../db/db_remove.c	/^__dbenv_dbremove_pp(dbenv, txn, name, subdb, flags/
-__dbenv_dbrename	../db/db_rename.c	/^__dbenv_dbrename(dbenv, txn, name, subdb, newname,/
-__dbenv_dbrename_pp	../db/db_rename.c	/^__dbenv_dbrename_pp(dbenv, txn, name, subdb, newna/
-__dbenv_err	../env/env_method.c	/^__dbenv_err(const DB_ENV *dbenv, int error, const /
-__dbenv_errx	../env/env_method.c	/^__dbenv_errx(const DB_ENV *dbenv, const char *fmt,/
-__dbenv_get_data_dirs	../env/env_method.c	/^__dbenv_get_data_dirs(dbenv, dirpp)$/
-__dbenv_get_encrypt_flags	../env/env_method.c	/^__dbenv_get_encrypt_flags(dbenv, flagsp)$/
-__dbenv_get_errfile	../env/env_method.c	/^__dbenv_get_errfile(dbenv, errfilep)$/
-__dbenv_get_errpfx	../env/env_method.c	/^__dbenv_get_errpfx(dbenv, errpfxp)$/
-__dbenv_get_flags	../env/env_method.c	/^__dbenv_get_flags(dbenv, flagsp)$/
-__dbenv_get_home	../env/env_method.c	/^__dbenv_get_home(dbenv, homep)$/
-__dbenv_get_msgfile	../env/env_method.c	/^__dbenv_get_msgfile(dbenv, msgfilep)$/
-__dbenv_get_open_flags	../env/env_open.c	/^__dbenv_get_open_flags(dbenv, flagsp)$/
-__dbenv_get_shm_key	../env/env_method.c	/^__dbenv_get_shm_key(dbenv, shm_keyp)$/
-__dbenv_get_tas_spins	../env/env_method.c	/^__dbenv_get_tas_spins(dbenv, tas_spinsp)$/
-__dbenv_get_tmp_dir	../env/env_method.c	/^__dbenv_get_tmp_dir(dbenv, dirp)$/
-__dbenv_get_verbose	../env/env_method.c	/^__dbenv_get_verbose(dbenv, which, onoffp)$/
-__dbenv_init	../env/env_method.c	/^__dbenv_init(dbenv)$/
-__dbenv_map_flags	../env/env_method.c	/^__dbenv_map_flags(dbenv, inflagsp, outflagsp)$/
-__dbenv_open	../env/env_open.c	/^__dbenv_open(dbenv, db_home, flags, mode)$/
-__dbenv_print_all	../env/env_stat.c	/^__dbenv_print_all(dbenv, flags)$/
-__dbenv_print_stats	../env/env_stat.c	/^__dbenv_print_stats(dbenv, flags)$/
-__dbenv_refresh	../env/env_open.c	/^__dbenv_refresh(dbenv, orig_flags, rep_check)$/
-__dbenv_remove	../env/env_open.c	/^__dbenv_remove(dbenv, db_home, flags)$/
-__dbenv_remove_int	../env/env_open.c	/^__dbenv_remove_int(dbenv, db_home, flags)$/
-__dbenv_set_alloc	../env/env_method.c	/^__dbenv_set_alloc(dbenv, mal_func, real_func, free/
-__dbenv_set_app_dispatch	../env/env_method.c	/^__dbenv_set_app_dispatch(dbenv, app_dispatch)$/
-__dbenv_set_data_dir	../env/env_method.c	/^__dbenv_set_data_dir(dbenv, dir)$/
-__dbenv_set_encrypt	../env/env_method.c	/^__dbenv_set_encrypt(dbenv, passwd, flags)$/
-__dbenv_set_errcall	../env/env_method.c	/^__dbenv_set_errcall(dbenv, errcall)$/
-__dbenv_set_errfile	../env/env_method.c	/^__dbenv_set_errfile(dbenv, errfile)$/
-__dbenv_set_errpfx	../env/env_method.c	/^__dbenv_set_errpfx(dbenv, errpfx)$/
-__dbenv_set_feedback	../env/env_method.c	/^__dbenv_set_feedback(dbenv, feedback)$/
-__dbenv_set_flags	../env/env_method.c	/^__dbenv_set_flags(dbenv, flags, on)$/
-__dbenv_set_intermediate_dir	../env/env_method.c	/^__dbenv_set_intermediate_dir(dbenv, mode, flags)$/
-__dbenv_set_msgcall	../env/env_method.c	/^__dbenv_set_msgcall(dbenv, msgcall)$/
-__dbenv_set_msgfile	../env/env_method.c	/^__dbenv_set_msgfile(dbenv, msgfile)$/
-__dbenv_set_paniccall	../env/env_method.c	/^__dbenv_set_paniccall(dbenv, paniccall)$/
-__dbenv_set_rpc_server_noclnt	../env/env_method.c	/^__dbenv_set_rpc_server_noclnt(dbenv, cl, host, tse/
-__dbenv_set_shm_key	../env/env_method.c	/^__dbenv_set_shm_key(dbenv, shm_key)$/
-__dbenv_set_tas_spins	../env/env_method.c	/^__dbenv_set_tas_spins(dbenv, tas_spins)$/
-__dbenv_set_tmp_dir	../env/env_method.c	/^__dbenv_set_tmp_dir(dbenv, dir)$/
-__dbenv_set_verbose	../env/env_method.c	/^__dbenv_set_verbose(dbenv, which, on)$/
-__dbenv_stat_print	../env/env_stat.c	/^__dbenv_stat_print(dbenv, flags)$/
-__dbenv_stat_print_pp	../env/env_stat.c	/^__dbenv_stat_print_pp(dbenv, flags)$/
 __dbh_am_chk	../db/db_method.c	/^__dbh_am_chk(dbp, flags)$/
-__dbh_err	../db/db_method.c	/^__dbh_err(DB *dbp, int error, const char *fmt, .../
-__dbh_errx	../db/db_method.c	/^__dbh_errx(DB *dbp, const char *fmt, ...)$/
+__dbh_err	../db/db_method.c	/^__dbh_err(dbp, error, fmt, va_alist)$/
+__dbh_errx	../db/db_method.c	/^__dbh_errx(dbp, fmt, va_alist)$/
 __dbj_app_dispatch	../libdb_java/db_java_wrap.c	/^static int __dbj_app_dispatch(DB_ENV *dbenv,$/
 __dbj_append_recno	../libdb_java/db_java_wrap.c	/^static int __dbj_append_recno(DB *db, DBT *dbt, db/
 __dbj_bt_compare	../libdb_java/db_java_wrap.c	/^static int __dbj_bt_compare(DB *db, const DBT *dbt/
@@ -3158,21 +3263,25 @@ __dbj_bt_prefix	../libdb_java/db_java_wrap.c	/^static size_t __dbj_bt_prefix(DB
 __dbj_db_feedback	../libdb_java/db_java_wrap.c	/^static void __dbj_db_feedback(DB *db, int opcode, /
 __dbj_dbt_copyin	../libdb_java/db_java_wrap.c	/^static int __dbj_dbt_copyin($/
 __dbj_dbt_copyout	../libdb_java/db_java_wrap.c	/^static void __dbj_dbt_copyout($/
+__dbj_dbt_memcopy	../libdb_java/db_java_wrap.c	/^static int __dbj_dbt_memcopy(DBT *dbt, u_int32_t o/
 __dbj_dbt_release	../libdb_java/db_java_wrap.c	/^static void __dbj_dbt_release($/
 __dbj_dup_compare	../libdb_java/db_java_wrap.c	/^static int __dbj_dup_compare(DB *db, const DBT *db/
 __dbj_env_feedback	../libdb_java/db_java_wrap.c	/^static void __dbj_env_feedback(DB_ENV *dbenv, int /
-__dbj_error	../libdb_java/db_java_wrap.c	/^static void __dbj_error(const DB_ENV *dbenv, const/
-__dbj_fill_bt_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_bt_stat(JNIEnv *jnienv, $/
-__dbj_fill_h_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_h_stat(JNIEnv *jnienv, $/
-__dbj_fill_lock_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_lock_stat(JNIEnv *jnienv, $/
-__dbj_fill_log_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_log_stat(JNIEnv *jnienv, $/
-__dbj_fill_mpool_fstat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_mpool_fstat(JNIEnv *jnienv, /
-__dbj_fill_mpool_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_mpool_stat(JNIEnv *jnienv, $/
-__dbj_fill_qam_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_qam_stat(JNIEnv *jnienv, $/
-__dbj_fill_rep_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_rep_stat(JNIEnv *jnienv, $/
-__dbj_fill_seq_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_seq_stat(JNIEnv *jnienv, $/
-__dbj_fill_txn_active	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_txn_active(JNIEnv *jnienv, $/
-__dbj_fill_txn_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_txn_stat(JNIEnv *jnienv, $/
+__dbj_error	../libdb_java/db_java_wrap.c	/^static void __dbj_error(const DB_ENV *dbenv,$/
+__dbj_event_notify	../libdb_java/db_java_wrap.c	/^static void __dbj_event_notify(DB_ENV *dbenv, u_in/
+__dbj_fill_bt_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_bt_stat(JNIEnv *jnienv,$/
+__dbj_fill_compact	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_compact(JNIEnv *jnienv,$/
+__dbj_fill_h_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_h_stat(JNIEnv *jnienv,$/
+__dbj_fill_lock_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_lock_stat(JNIEnv *jnienv,$/
+__dbj_fill_log_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_log_stat(JNIEnv *jnienv,$/
+__dbj_fill_mpool_fstat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_mpool_fstat(JNIEnv *jnienv,$/
+__dbj_fill_mpool_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_mpool_stat(JNIEnv *jnienv,$/
+__dbj_fill_mutex_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_mutex_stat(JNIEnv *jnienv,$/
+__dbj_fill_qam_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_qam_stat(JNIEnv *jnienv,$/
+__dbj_fill_rep_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_rep_stat(JNIEnv *jnienv,$/
+__dbj_fill_seq_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_seq_stat(JNIEnv *jnienv,$/
+__dbj_fill_txn_active	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_txn_active(JNIEnv *jnienv,$/
+__dbj_fill_txn_stat	../libdb_java/java_stat_auto.c	/^static int __dbj_fill_txn_stat(JNIEnv *jnienv,$/
 __dbj_get_except	../libdb_java/db_java_wrap.c	/^static jthrowable __dbj_get_except(JNIEnv *jenv,$/
 __dbj_get_jnienv	../libdb_java/db_java_wrap.c	/^static JNIEnv *__dbj_get_jnienv(void)$/
 __dbj_h_hash	../libdb_java/db_java_wrap.c	/^static u_int32_t __dbj_h_hash(DB *db, const void */
@@ -3182,8 +3291,9 @@ __dbj_rep_transport	../libdb_java/db_java_wrap.c	/^static int __dbj_rep_transpor
 __dbj_seckey_create	../libdb_java/db_java_wrap.c	/^static int __dbj_seckey_create(DB *db,$/
 __dbj_throw	../libdb_java/db_java_wrap.c	/^static int __dbj_throw(JNIEnv *jenv,$/
 __dbj_verify_callback	../libdb_java/db_java_wrap.c	/^static int __dbj_verify_callback(void *handle, con/
+__dbj_verify_data	../libdb_java/db_java_wrap.c	/^struct __dbj_verify_data {$/
 __dbj_wrap_DB_LSN	../libdb_java/db_java_wrap.c	/^static jobject __dbj_wrap_DB_LSN(JNIEnv *jenv, DB_/
-__dblist_get	../db/db.c	/^__dblist_get(dbenv, adjid)$/
+__dblist	../dbinc/db.in	/^	struct __dblist {$/
 __dbreg_add_dbentry	../dbreg/dbreg_util.c	/^__dbreg_add_dbentry(dbenv, dblp, dbp, ndx)$/
 __dbreg_assign_id	../dbreg/dbreg.c	/^__dbreg_assign_id(dbp, id)$/
 __dbreg_check_master	../dbreg/dbreg_util.c	/^__dbreg_check_master(dbenv, uid, name)$/
@@ -3198,22 +3308,26 @@ __dbreg_id_to_db_int	../dbreg/dbreg_util.c	/^__dbreg_id_to_db_int(dbenv, txn, db
 __dbreg_id_to_fname	../dbreg/dbreg_util.c	/^__dbreg_id_to_fname(dblp, id, have_lock, fnamep)$/
 __dbreg_init_print	../dbreg/dbreg_autop.c	/^__dbreg_init_print(dbenv, dtabp, dtabsizep)$/
 __dbreg_init_recover	../dbreg/dbreg_auto.c	/^__dbreg_init_recover(dbenv, dtabp, dtabsizep)$/
+__dbreg_invalidate_files	../dbreg/dbreg_util.c	/^__dbreg_invalidate_files(dbenv)$/
 __dbreg_lazy_id	../dbreg/dbreg_util.c	/^__dbreg_lazy_id(dbp)$/
+__dbreg_log_close	../dbreg/dbreg.c	/^__dbreg_log_close(dbenv, fnp, txn, op)$/
 __dbreg_log_files	../dbreg/dbreg_util.c	/^__dbreg_log_files(dbenv)$/
+__dbreg_log_id	../dbreg/dbreg.c	/^__dbreg_log_id(dbp, txn, id, needlock)$/
 __dbreg_new_id	../dbreg/dbreg.c	/^__dbreg_new_id(dbp, txn)$/
 __dbreg_open_file	../dbreg/dbreg_rec.c	/^__dbreg_open_file(dbenv, txn, argp, info)$/
 __dbreg_pluck_id	../dbreg/dbreg.c	/^__dbreg_pluck_id(dbenv, id)$/
 __dbreg_pop_id	../dbreg/dbreg.c	/^__dbreg_pop_id(dbenv, id)$/
 __dbreg_print_dblist	../dbreg/dbreg_stat.c	/^__dbreg_print_dblist(dbenv, flags)$/
 __dbreg_print_fname	../dbreg/dbreg_stat.c	/^__dbreg_print_fname(dbenv, fnp)$/
-__dbreg_push_id	../dbreg/dbreg.c	/^__dbreg_push_id(dbenv, id)$/
-__dbreg_register_log	../dbreg/dbreg_auto.c	/^__dbreg_register_log(dbenv, txnid, ret_lsnp, flags/
+__dbreg_push_id	../dbreg/dbreg.c	/^__dbreg_push_id(dbenv, dbp, id)$/
+__dbreg_register_log	../dbreg/dbreg_auto.c	/^__dbreg_register_log(dbenv, txnp, ret_lsnp, flags,/
 __dbreg_register_print	../dbreg/dbreg_autop.c	/^__dbreg_register_print(dbenv, dbtp, lsnp, notused2/
 __dbreg_register_read	../dbreg/dbreg_auto.c	/^__dbreg_register_read(dbenv, recbuf, argpp)$/
 __dbreg_register_recover	../dbreg/dbreg_rec.c	/^__dbreg_register_recover(dbenv, dbtp, lsnp, op, in/
 __dbreg_rem_dbentry	../dbreg/dbreg_util.c	/^__dbreg_rem_dbentry(dblp, ndx)$/
 __dbreg_revoke_id	../dbreg/dbreg.c	/^__dbreg_revoke_id(dbp, have_lock, force_id)$/
 __dbreg_setup	../dbreg/dbreg.c	/^__dbreg_setup(dbp, name, create_txnid)$/
+__dbreg_stat_print	../dbreg/dbreg_stat.c	/^__dbreg_stat_print(dbenv, flags)$/
 __dbreg_teardown	../dbreg/dbreg.c	/^__dbreg_teardown(dbp)$/
 __dbsrv_active	../rpc_server/c/db_server_util.c	/^__dbsrv_active(ctp)$/
 __dbsrv_settimeout	../rpc_server/c/db_server_util.c	/^__dbsrv_settimeout(ctp, to)$/
@@ -3221,60 +3335,145 @@ __dbsrv_sharedb	../rpc_server/c/db_server_util.c	/^__dbsrv_sharedb(db_ctp, name,
 __dbsrv_shareenv	../rpc_server/c/db_server_util.c	/^__dbsrv_shareenv(env_ctp, home, flags)$/
 __dbsrv_timeout	../rpc_server/c/db_server_util.c	/^__dbsrv_timeout(force)$/
 __dbt_ferr	../db/db_iface.c	/^__dbt_ferr(dbp, name, dbt, check_thread)$/
-__dd_abort	../lock/lock_deadlock.c	/^__dd_abort(dbenv, info)$/
+__dbt_usercopy	../db/db_iface.c	/^__dbt_usercopy(dbenv, dbt)$/
+__dbt_userfree	../db/db_iface.c	/^__dbt_userfree(dbenv, key, pkey, data)$/
+__dd_abort	../lock/lock_deadlock.c	/^__dd_abort(dbenv, info, statusp)$/
 __dd_build	../lock/lock_deadlock.c	/^__dd_build(dbenv, atype, bmp, nlockers, allocp, id/
 __dd_debug	../lock/lock_deadlock.c	/^__dd_debug(dbenv, idmap, bitmap, nlockers, nalloc)/
 __dd_find	../lock/lock_deadlock.c	/^__dd_find(dbenv, bmp, idmap, nlockers, nalloc, dea/
 __dd_isolder	../lock/lock_deadlock.c	/^__dd_isolder(a, b, lock_max, txn_max)$/
 __dd_verify	../lock/lock_deadlock.c	/^__dd_verify(idmap, deadmap, tmpmap, origmap, nlock/
-__env_cachesize_proc	../rpc_server/c/db_server_proc.c	/^__env_cachesize_proc(dbenvcl_id, gbytes, bytes, nc/
+__env_cdsgroup_begin_proc	../rpc_server/c/db_server_proc.c	/^__env_cdsgroup_begin_proc(dbenvcl_id, replyp)$/
+__env_close	../env/env_open.c	/^__env_close(dbenv, rep_check)$/
+__env_close_int	../rpc_server/c/db_server_util.c	/^__env_close_int(id, flags, force)$/
+__env_close_pp	../env/env_open.c	/^__env_close_pp(dbenv, flags)$/
 __env_close_proc	../rpc_server/c/db_server_proc.c	/^__env_close_proc(dbenvcl_id, flags, replyp)$/
+__env_config	../env/env_open.c	/^__env_config(dbenv, db_home, flags, mode)$/
 __env_create_proc	../rpc_server/c/db_server_proc.c	/^__env_create_proc(timeout, replyp)$/
 __env_db_rep_exit	../rep/rep_util.c	/^__env_db_rep_exit(dbenv)$/
+__env_dbremove_pp	../db/db_remove.c	/^__env_dbremove_pp(dbenv, txn, name, subdb, flags)$/
 __env_dbremove_proc	../rpc_server/c/db_server_proc.c	/^__env_dbremove_proc(dbenvcl_id, txnpcl_id, name, s/
+__env_dbrename_pp	../db/db_rename.c	/^__env_dbrename_pp(dbenv, txn, name, subdb, newname/
 __env_dbrename_proc	../rpc_server/c/db_server_proc.c	/^__env_dbrename_proc(dbenvcl_id, txnpcl_id, name, s/
-__env_encrypt_proc	../rpc_server/c/db_server_proc.c	/^__env_encrypt_proc(dbenvcl_id, passwd, flags, repl/
-__env_flags_proc	../rpc_server/c/db_server_proc.c	/^__env_flags_proc(dbenvcl_id, flags, onoff, replyp)/
+__env_err	../env/env_method.c	/^__env_err(dbenv, error, fmt, va_alist)$/
+__env_errx	../env/env_method.c	/^__env_errx(dbenv, fmt, va_alist)$/
+__env_failchk_pp	../env/env_failchk.c	/^__env_failchk_pp(dbenv, flags)$/
+__env_fileid_reset	../db/db_setid.c	/^__env_fileid_reset(dbenv, name, encrypted)$/
+__env_fileid_reset_pp	../db/db_setid.c	/^__env_fileid_reset_pp(dbenv, name, flags)$/
 __env_get_cachesize_proc	../rpc_server/c/db_server_proc.c	/^__env_get_cachesize_proc(dbenvcl_id, replyp)$/
+__env_get_data_dirs	../env/env_method.c	/^__env_get_data_dirs(dbenv, dirpp)$/
+__env_get_encrypt_flags	../env/env_method.c	/^__env_get_encrypt_flags(dbenv, flagsp)$/
 __env_get_encrypt_flags_proc	../rpc_server/c/db_server_proc.c	/^__env_get_encrypt_flags_proc(dbenvcl_id, replyp)$/
+__env_get_errfile	../env/env_method.c	/^__env_get_errfile(dbenv, errfilep)$/
+__env_get_errpfx	../env/env_method.c	/^__env_get_errpfx(dbenv, errpfxp)$/
+__env_get_flags	../env/env_method.c	/^__env_get_flags(dbenv, flagsp)$/
 __env_get_flags_proc	../rpc_server/c/db_server_proc.c	/^__env_get_flags_proc(dbenvcl_id, replyp)$/
+__env_get_home	../env/env_method.c	/^__env_get_home(dbenv, homep)$/
 __env_get_home_proc	../rpc_server/c/db_server_proc.c	/^__env_get_home_proc(dbenvcl_id, replyp)$/
+__env_get_msgfile	../env/env_method.c	/^__env_get_msgfile(dbenv, msgfilep)$/
+__env_get_open_flags	../env/env_open.c	/^__env_get_open_flags(dbenv, flagsp)$/
 __env_get_open_flags_proc	../rpc_server/c/db_server_proc.c	/^__env_get_open_flags_proc(dbenvcl_id, replyp)$/
+__env_get_shm_key	../env/env_method.c	/^__env_get_shm_key(dbenv, shm_keyp)$/
+__env_get_tmp_dir	../env/env_method.c	/^__env_get_tmp_dir(dbenv, dirp)$/
+__env_get_verbose	../env/env_method.c	/^__env_get_verbose(dbenv, which, onoffp)$/
+__env_in_api	../env/env_failchk.c	/^__env_in_api(dbenv)$/
+__env_init	../env/env_method.c	/^__env_init(dbenv)$/
+__env_init_rec	../env/env_recover.c	/^__env_init_rec(dbenv, version)$/
+__env_init_rec_42	../env/env_recover.c	/^__env_init_rec_42(dbenv)$/
+__env_init_rec_43	../env/env_recover.c	/^__env_init_rec_43(dbenv)$/
+__env_init_rec_45	../env/env_recover.c	/^__env_init_rec_45(dbenv)$/
+__env_lsn_reset	../db/db_setlsn.c	/^__env_lsn_reset(dbenv, name, encrypted)$/
+__env_lsn_reset_pp	../db/db_setlsn.c	/^__env_lsn_reset_pp(dbenv, name, flags)$/
+__env_map_flags	../env/env_method.c	/^__env_map_flags(dbenv, inflagsp, outflagsp)$/
+__env_open	../env/env_open.c	/^__env_open(dbenv, db_home, flags, mode)$/
+__env_open_pp	../env/env_open.c	/^__env_open_pp(dbenv, db_home, flags, mode)$/
 __env_open_proc	../rpc_server/c/db_server_proc.c	/^__env_open_proc(dbenvcl_id, home, flags, mode, rep/
 __env_openfiles	../env/env_recover.c	/^__env_openfiles(dbenv, logc, txninfo,$/
+__env_print_all	../env/env_stat.c	/^__env_print_all(dbenv, flags)$/
+__env_print_stats	../env/env_stat.c	/^__env_print_stats(dbenv, flags)$/
+__env_print_threads	../env/env_stat.c	/^__env_print_threads(dbenv)$/
+__env_read_db_config	../env/env_config.c	/^__env_read_db_config(dbenv)$/
+__env_refresh	../env/env_open.c	/^__env_refresh(dbenv, orig_flags, rep_check)$/
+__env_remove	../env/env_open.c	/^__env_remove(dbenv, db_home, flags)$/
 __env_remove_proc	../rpc_server/c/db_server_proc.c	/^__env_remove_proc(dbenvcl_id, home, flags, replyp)/
-__env_rep_enter	../rep/rep_util.c	/^__env_rep_enter(dbenv)$/
+__env_rep_enter	../rep/rep_util.c	/^__env_rep_enter(dbenv, checklock)$/
+__env_set_alloc	../env/env_method.c	/^__env_set_alloc(dbenv, mal_func, real_func, free_f/
+__env_set_app_dispatch	../env/env_method.c	/^__env_set_app_dispatch(dbenv, app_dispatch)$/
+__env_set_cachesize_proc	../rpc_server/c/db_server_proc.c	/^__env_set_cachesize_proc(dbenvcl_id, gbytes, bytes/
+__env_set_data_dir	../env/env_method.c	/^__env_set_data_dir(dbenv, dir)$/
+__env_set_encrypt	../env/env_method.c	/^__env_set_encrypt(dbenv, passwd, flags)$/
+__env_set_encrypt_proc	../rpc_server/c/db_server_proc.c	/^__env_set_encrypt_proc(dbenvcl_id, passwd, flags, /
+__env_set_errcall	../env/env_method.c	/^__env_set_errcall(dbenv, errcall)$/
+__env_set_errfile	../env/env_method.c	/^__env_set_errfile(dbenv, errfile)$/
+__env_set_errpfx	../env/env_method.c	/^__env_set_errpfx(dbenv, errpfx)$/
+__env_set_event_notify	../env/env_method.c	/^__env_set_event_notify(dbenv, event_func)$/
+__env_set_feedback	../env/env_method.c	/^__env_set_feedback(dbenv, feedback)$/
+__env_set_flags	../env/env_method.c	/^__env_set_flags(dbenv, flags, on)$/
+__env_set_flags_proc	../rpc_server/c/db_server_proc.c	/^__env_set_flags_proc(dbenvcl_id, flags, onoff, rep/
+__env_set_intermediate_dir	../env/env_method.c	/^__env_set_intermediate_dir(dbenv, mode, flags)$/
+__env_set_isalive	../env/env_method.c	/^__env_set_isalive(dbenv, is_alive)$/
+__env_set_msgcall	../env/env_method.c	/^__env_set_msgcall(dbenv, msgcall)$/
+__env_set_msgfile	../env/env_method.c	/^__env_set_msgfile(dbenv, msgfile)$/
+__env_set_paniccall	../env/env_method.c	/^__env_set_paniccall(dbenv, paniccall)$/
+__env_set_rpc_server	../env/env_method.c	/^__env_set_rpc_server(dbenv, cl, host, tsec, ssec, /
+__env_set_shm_key	../env/env_method.c	/^__env_set_shm_key(dbenv, shm_key)$/
+__env_set_state	../env/env_failchk.c	/^__env_set_state(dbenv, ipp, state)$/
+__env_set_thread_count	../env/env_method.c	/^__env_set_thread_count(dbenv, count)$/
+__env_set_thread_id	../env/env_method.c	/^__env_set_thread_id(dbenv, id)$/
+__env_set_thread_id_string	../env/env_method.c	/^__env_set_thread_id_string(dbenv, thread_id_string/
+__env_set_tmp_dir	../env/env_method.c	/^__env_set_tmp_dir(dbenv, dir)$/
+__env_set_verbose	../env/env_method.c	/^__env_set_verbose(dbenv, which, on)$/
+__env_stat_print	../env/env_stat.c	/^__env_stat_print(dbenv, flags)$/
+__env_stat_print_pp	../env/env_stat.c	/^__env_stat_print_pp(dbenv, flags)$/
+__env_thread_id_string	../env/env_failchk.c	/^__env_thread_id_string(dbenv, pid, tid, buf)$/
+__env_thread_init	../env/env_failchk.c	/^__env_thread_init(dbenv, created)$/
+__env_thread_state_print	../env/env_stat.c	/^__env_thread_state_print(state)$/
+__env_txn_begin_proc	../rpc_server/c/db_server_proc.c	/^__env_txn_begin_proc(dbenvcl_id, parentcl_id, flag/
+__env_txn_recover_proc	../rpc_server/c/db_server_proc.c	/^__env_txn_recover_proc(dbenvcl_id, count, flags, r/
+__envreg_add	../env/env_register.c	/^__envreg_add(dbenv, need_recoveryp)$/
+__envreg_register	../env/env_register.c	/^__envreg_register(dbenv, need_recoveryp)$/
+__envreg_unregister	../env/env_register.c	/^__envreg_unregister(dbenv, recovery_failed)$/
+__envreg_xunlock	../env/env_register.c	/^__envreg_xunlock(dbenv)$/
+__epg	../dbinc/btree.h	/^struct __epg {$/
+__fh_t	../dbinc/os.h	/^struct __fh_t {$/
+__fname	../dbinc/log.h	/^struct __fname {$/
 __fop_create	../fileops/fop_basic.c	/^__fop_create(dbenv, txn, fhpp, name, appname, mode/
-__fop_create_log	../fileops/fileops_auto.c	/^__fop_create_log(dbenv, txnid, ret_lsnp, flags,$/
+__fop_create_log	../fileops/fileops_auto.c	/^__fop_create_log(dbenv, txnp, ret_lsnp, flags,$/
 __fop_create_print	../fileops/fileops_autop.c	/^__fop_create_print(dbenv, dbtp, lsnp, notused2, no/
 __fop_create_read	../fileops/fileops_auto.c	/^__fop_create_read(dbenv, recbuf, argpp)$/
 __fop_create_recover	../fileops/fop_rec.c	/^__fop_create_recover(dbenv, dbtp, lsnp, op, info)$/
 __fop_dbrename	../fileops/fop_util.c	/^__fop_dbrename(dbp, old, new)$/
 __fop_dummy	../fileops/fop_util.c	/^__fop_dummy(dbp, txn, old, new, flags)$/
-__fop_file_remove_log	../fileops/fileops_auto.c	/^__fop_file_remove_log(dbenv, txnid, ret_lsnp, flag/
+__fop_file_remove_log	../fileops/fileops_auto.c	/^__fop_file_remove_log(dbenv, txnp, ret_lsnp, flags/
 __fop_file_remove_print	../fileops/fileops_autop.c	/^__fop_file_remove_print(dbenv, dbtp, lsnp, notused/
 __fop_file_remove_read	../fileops/fileops_auto.c	/^__fop_file_remove_read(dbenv, recbuf, argpp)$/
 __fop_file_remove_recover	../fileops/fop_rec.c	/^__fop_file_remove_recover(dbenv, dbtp, lsnp, op, i/
 __fop_file_setup	../fileops/fop_util.c	/^__fop_file_setup(dbp, txn, name, mode, flags, reti/
 __fop_init_print	../fileops/fileops_autop.c	/^__fop_init_print(dbenv, dtabp, dtabsizep)$/
 __fop_init_recover	../fileops/fileops_auto.c	/^__fop_init_recover(dbenv, dtabp, dtabsizep)$/
+__fop_inmem_create	../fileops/fop_util.c	/^__fop_inmem_create(dbp, name, txn, flags)$/
+__fop_inmem_dummy	../fileops/fop_util.c	/^__fop_inmem_dummy(dbp, txn, name, mbuf)$/
+__fop_inmem_read_meta	../fileops/fop_util.c	/^__fop_inmem_read_meta(dbp, txn, name, flags)$/
+__fop_inmem_swap	../fileops/fop_util.c	/^__fop_inmem_swap(olddbp, backdbp, txn, old, new, b/
 __fop_lock_handle	../fileops/fop_util.c	/^__fop_lock_handle(dbenv, dbp, locker, mode, elockp/
+__fop_ondisk_dummy	../fileops/fop_util.c	/^__fop_ondisk_dummy(dbp, txn, name, mbuf, flags)$/
+__fop_ondisk_swap	../fileops/fop_util.c	/^__fop_ondisk_swap(dbp, tmpdbp, txn, old, new, back/
 __fop_read_meta	../fileops/fop_util.c	/^__fop_read_meta(dbenv, name, buf, size, fhp, errok/
 __fop_remove	../fileops/fop_basic.c	/^__fop_remove(dbenv, txn, fileid, name, appname, fl/
-__fop_remove_log	../fileops/fileops_auto.c	/^__fop_remove_log(dbenv, txnid, ret_lsnp, flags,$/
+__fop_remove_log	../fileops/fileops_auto.c	/^__fop_remove_log(dbenv, txnp, ret_lsnp, flags,$/
 __fop_remove_print	../fileops/fileops_autop.c	/^__fop_remove_print(dbenv, dbtp, lsnp, notused2, no/
 __fop_remove_read	../fileops/fileops_auto.c	/^__fop_remove_read(dbenv, recbuf, argpp)$/
 __fop_remove_recover	../fileops/fop_rec.c	/^__fop_remove_recover(dbenv, dbtp, lsnp, op, info)$/
 __fop_remove_setup	../fileops/fop_util.c	/^__fop_remove_setup(dbp, txn, name, flags)$/
 __fop_rename	../fileops/fop_basic.c	/^__fop_rename(dbenv, txn, oldname, newname, fid, ap/
-__fop_rename_log	../fileops/fileops_auto.c	/^__fop_rename_log(dbenv, txnid, ret_lsnp, flags,$/
+__fop_rename_log	../fileops/fileops_auto.c	/^__fop_rename_log(dbenv, txnp, ret_lsnp, flags,$/
 __fop_rename_print	../fileops/fileops_autop.c	/^__fop_rename_print(dbenv, dbtp, lsnp, notused2, no/
 __fop_rename_read	../fileops/fileops_auto.c	/^__fop_rename_read(dbenv, recbuf, argpp)$/
 __fop_rename_recover	../fileops/fop_rec.c	/^__fop_rename_recover(dbenv, dbtp, lsnp, op, info)$/
 __fop_set_pgsize	../fileops/fop_util.c	/^__fop_set_pgsize(dbp, fhp, name)$/
 __fop_subdb_setup	../fileops/fop_util.c	/^__fop_subdb_setup(dbp, txn, mname, name, mode, fla/
 __fop_write	../fileops/fop_basic.c	/^__fop_write(dbenv,$/
-__fop_write_log	../fileops/fileops_auto.c	/^__fop_write_log(dbenv, txnid, ret_lsnp, flags,$/
+__fop_write_log	../fileops/fileops_auto.c	/^__fop_write_log(dbenv, txnp, ret_lsnp, flags,$/
 __fop_write_print	../fileops/fileops_autop.c	/^__fop_write_print(dbenv, dbtp, lsnp, notused2, not/
 __fop_write_read	../fileops/fileops_auto.c	/^__fop_write_read(dbenv, recbuf, argpp)$/
 __fop_write_recover	../fileops/fop_rec.c	/^__fop_write_recover(dbenv, dbtp, lsnp, op, info)$/
@@ -3285,7 +3484,8 @@ __ham_31_hashmeta	../hash/hash_upgrade.c	/^__ham_31_hashmeta(dbp, real_name, fla
 __ham_add_dup	../hash/hash_dup.c	/^__ham_add_dup(dbc, nval, flags, pgnop)$/
 __ham_add_el	../hash/hash_page.c	/^__ham_add_el(dbc, key, val, type)$/
 __ham_add_ovflpage	../hash/hash_page.c	/^__ham_add_ovflpage(dbc, pagep, release, pp)$/
-__ham_alloc_pages	../hash/hash_rec.c	/^__ham_alloc_pages(dbp, argp, lsnp)$/
+__ham_alloc_pages	../hash/hash_rec.c	/^__ham_alloc_pages(file_dbp, argp, lsnp)$/
+__ham_alloc_pages_42	../hash/hash_rec.c	/^__ham_alloc_pages_42(dbp, argp, lsnp)$/
 __ham_bulk	../hash/hash.c	/^__ham_bulk(dbc, data, flags)$/
 __ham_c_chgpg	../hash/hash_dup.c	/^__ham_c_chgpg(dbc, old_pgno, old_index, new_pgno, /
 __ham_c_close	../hash/hash.c	/^__ham_c_close(dbc, root_pgno, rmroot)$/
@@ -3301,16 +3501,16 @@ __ham_c_update	../hash/hash.c	/^__ham_c_update(dbc, len, add, is_dup)$/
 __ham_c_writelock	../hash/hash.c	/^__ham_c_writelock(dbc)$/
 __ham_call_hash	../hash/hash.c	/^__ham_call_hash(dbc, k, len)$/
 __ham_check_move	../hash/hash_dup.c	/^__ham_check_move(dbc, add_len)$/
-__ham_chgpg_log	../hash/hash_auto.c	/^__ham_chgpg_log(dbp, txnid, ret_lsnp, flags, mode,/
+__ham_chgpg_log	../hash/hash_auto.c	/^__ham_chgpg_log(dbp, txnp, ret_lsnp, flags, mode, /
 __ham_chgpg_print	../hash/hash_autop.c	/^__ham_chgpg_print(dbenv, dbtp, lsnp, notused2, not/
 __ham_chgpg_read	../hash/hash_auto.c	/^__ham_chgpg_read(dbenv, recbuf, argpp)$/
 __ham_chgpg_recover	../hash/hash_rec.c	/^__ham_chgpg_recover(dbenv, dbtp, lsnp, op, info)$/
 __ham_copy_item	../hash/hash_page.c	/^__ham_copy_item(dbp, src_page, src_ndx, dest_page)/
-__ham_copypage_log	../hash/hash_auto.c	/^__ham_copypage_log(dbp, txnid, ret_lsnp, flags, pg/
+__ham_copypage_log	../hash/hash_auto.c	/^__ham_copypage_log(dbp, txnp, ret_lsnp, flags, pgn/
 __ham_copypage_print	../hash/hash_autop.c	/^__ham_copypage_print(dbenv, dbtp, lsnp, notused2, /
 __ham_copypage_read	../hash/hash_auto.c	/^__ham_copypage_read(dbenv, recbuf, argpp)$/
 __ham_copypage_recover	../hash/hash_rec.c	/^__ham_copypage_recover(dbenv, dbtp, lsnp, op, info/
-__ham_curadj_log	../hash/hash_auto.c	/^__ham_curadj_log(dbp, txnid, ret_lsnp, flags, pgno/
+__ham_curadj_log	../hash/hash_auto.c	/^__ham_curadj_log(dbp, txnp, ret_lsnp, flags, pgno,/
 __ham_curadj_print	../hash/hash_autop.c	/^__ham_curadj_print(dbenv, dbtp, lsnp, notused2, no/
 __ham_curadj_read	../hash/hash_auto.c	/^__ham_curadj_read(dbenv, recbuf, argpp)$/
 __ham_curadj_recover	../hash/hash_rec.c	/^__ham_curadj_recover(dbenv, dbtp, lsnp, op, info)$/
@@ -3318,7 +3518,7 @@ __ham_db_close	../hash/hash_method.c	/^__ham_db_close(dbp)$/
 __ham_db_create	../hash/hash_method.c	/^__ham_db_create(dbp)$/
 __ham_dcursor	../hash/hash_dup.c	/^__ham_dcursor(dbc, pgno, indx)$/
 __ham_del_pair	../hash/hash_page.c	/^__ham_del_pair(dbc, reclaim_page)$/
-__ham_dirty_meta	../hash/hash_meta.c	/^__ham_dirty_meta(dbc)$/
+__ham_dirty_meta	../hash/hash_meta.c	/^__ham_dirty_meta(dbc, flags)$/
 __ham_dpair	../hash/hash_page.c	/^__ham_dpair(dbp, p, indx)$/
 __ham_dsearch	../hash/hash_dup.c	/^__ham_dsearch(dbc, dbt, offp, cmpp, flags)$/
 __ham_dup_convert	../hash/hash_dup.c	/^__ham_dup_convert(dbc)$/
@@ -3334,7 +3534,10 @@ __ham_get_cpage	../hash/hash_page.c	/^__ham_get_cpage(dbc, mode)$/
 __ham_get_h_ffactor	../hash/hash_method.c	/^__ham_get_h_ffactor(dbp, h_ffactorp)$/
 __ham_get_h_nelem	../hash/hash_method.c	/^__ham_get_h_nelem(dbp, h_nelemp)$/
 __ham_get_meta	../hash/hash_meta.c	/^__ham_get_meta(dbc)$/
-__ham_groupalloc_log	../hash/hash_auto.c	/^__ham_groupalloc_log(dbp, txnid, ret_lsnp, flags, /
+__ham_groupalloc_42_print	../hash/hash_autop.c	/^__ham_groupalloc_42_print(dbenv, dbtp, lsnp, notus/
+__ham_groupalloc_42_read	../hash/hash_auto.c	/^__ham_groupalloc_42_read(dbenv, recbuf, argpp)$/
+__ham_groupalloc_42_recover	../hash/hash_rec.c	/^__ham_groupalloc_42_recover(dbenv, dbtp, lsnp, op,/
+__ham_groupalloc_log	../hash/hash_auto.c	/^__ham_groupalloc_log(dbp, txnp, ret_lsnp, flags, m/
 __ham_groupalloc_print	../hash/hash_autop.c	/^__ham_groupalloc_print(dbenv, dbtp, lsnp, notused2/
 __ham_groupalloc_read	../hash/hash_auto.c	/^__ham_groupalloc_read(dbenv, recbuf, argpp)$/
 __ham_groupalloc_recover	../hash/hash_rec.c	/^__ham_groupalloc_recover(dbenv, dbtp, lsnp, op, in/
@@ -3342,7 +3545,7 @@ __ham_init_dbt	../hash/hash.c	/^__ham_init_dbt(dbenv, dbt, size, bufp, sizep)$/
 __ham_init_meta	../hash/hash_open.c	/^__ham_init_meta(dbp, meta, pgno, lsnp)$/
 __ham_init_print	../hash/hash_autop.c	/^__ham_init_print(dbenv, dtabp, dtabsizep)$/
 __ham_init_recover	../hash/hash_auto.c	/^__ham_init_recover(dbenv, dtabp, dtabsizep)$/
-__ham_insdel_log	../hash/hash_auto.c	/^__ham_insdel_log(dbp, txnid, ret_lsnp, flags,$/
+__ham_insdel_log	../hash/hash_auto.c	/^__ham_insdel_log(dbp, txnp, ret_lsnp, flags,$/
 __ham_insdel_print	../hash/hash_autop.c	/^__ham_insdel_print(dbenv, dbtp, lsnp, notused2, no/
 __ham_insdel_read	../hash/hash_auto.c	/^__ham_insdel_read(dbenv, recbuf, argpp)$/
 __ham_insdel_recover	../hash/hash_rec.c	/^__ham_insdel_recover(dbenv, dbtp, lsnp, op, info)$/
@@ -3356,9 +3559,12 @@ __ham_item_reset	../hash/hash_page.c	/^__ham_item_reset(dbc)$/
 __ham_lock_bucket	../hash/hash_page.c	/^__ham_lock_bucket(dbc, mode)$/
 __ham_lookup	../hash/hash.c	/^__ham_lookup(dbc, key, sought, mode, pgnop)$/
 __ham_make_dup	../hash/hash_dup.c	/^__ham_make_dup(dbenv, notdup, duplicate, bufp, siz/
-__ham_meta2pgset	../hash/hash_verify.c	/^int __ham_meta2pgset(dbp, vdp, hmeta, flags, pgset/
+__ham_meta2pgset	../hash/hash_verify.c	/^__ham_meta2pgset(dbp, vdp, hmeta, flags, pgset)$/
 __ham_metachk	../hash/hash_open.c	/^__ham_metachk(dbp, name, hashm)$/
-__ham_metagroup_log	../hash/hash_auto.c	/^__ham_metagroup_log(dbp, txnid, ret_lsnp, flags, b/
+__ham_metagroup_42_print	../hash/hash_autop.c	/^__ham_metagroup_42_print(dbenv, dbtp, lsnp, notuse/
+__ham_metagroup_42_read	../hash/hash_auto.c	/^__ham_metagroup_42_read(dbenv, recbuf, argpp)$/
+__ham_metagroup_42_recover	../hash/hash_rec.c	/^__ham_metagroup_42_recover(dbenv, dbtp, lsnp, op, /
+__ham_metagroup_log	../hash/hash_auto.c	/^__ham_metagroup_log(dbp, txnp, ret_lsnp, flags, bu/
 __ham_metagroup_print	../hash/hash_autop.c	/^__ham_metagroup_print(dbenv, dbtp, lsnp, notused2,/
 __ham_metagroup_read	../hash/hash_auto.c	/^__ham_metagroup_read(dbenv, recbuf, argpp)$/
 __ham_metagroup_recover	../hash/hash_rec.c	/^__ham_metagroup_recover(dbenv, dbtp, lsnp, op, inf/
@@ -3366,11 +3572,11 @@ __ham_move_offpage	../hash/hash_dup.c	/^__ham_move_offpage(dbc, pagep, ndx, pgno
 __ham_mswap	../hash/hash_conv.c	/^__ham_mswap(pg)$/
 __ham_new_file	../hash/hash_open.c	/^__ham_new_file(dbp, txn, fhp, name)$/
 __ham_new_subdb	../hash/hash_open.c	/^__ham_new_subdb(mdbp, dbp, txn)$/
-__ham_newpage_log	../hash/hash_auto.c	/^__ham_newpage_log(dbp, txnid, ret_lsnp, flags,$/
+__ham_newpage_log	../hash/hash_auto.c	/^__ham_newpage_log(dbp, txnp, ret_lsnp, flags,$/
 __ham_newpage_print	../hash/hash_autop.c	/^__ham_newpage_print(dbenv, dbtp, lsnp, notused2, n/
 __ham_newpage_read	../hash/hash_auto.c	/^__ham_newpage_read(dbenv, recbuf, argpp)$/
 __ham_newpage_recover	../hash/hash_rec.c	/^__ham_newpage_recover(dbenv, dbtp, lsnp, op, info)/
-__ham_next_cpage	../hash/hash_page.c	/^__ham_next_cpage(dbc, pgno, dirty)$/
+__ham_next_cpage	../hash/hash_page.c	/^__ham_next_cpage(dbc, pgno)$/
 __ham_onpage_replace	../hash/hash_page.c	/^__ham_onpage_replace(dbp, pagep, ndx, off, change,/
 __ham_open	../hash/hash_open.c	/^__ham_open(dbp, txn, name, base_pgno, flags)$/
 __ham_overwrite	../hash/hash.c	/^__ham_overwrite(dbc, nval, flags)$/
@@ -3381,7 +3587,7 @@ __ham_putitem	../hash/hash_page.c	/^__ham_putitem(dbp, p, dbt, type)$/
 __ham_quick_delete	../hash/hash.c	/^__ham_quick_delete(dbc)$/
 __ham_reclaim	../hash/hash_reclaim.c	/^__ham_reclaim(dbp, txn)$/
 __ham_release_meta	../hash/hash_meta.c	/^__ham_release_meta(dbc)$/
-__ham_replace_log	../hash/hash_auto.c	/^__ham_replace_log(dbp, txnid, ret_lsnp, flags, pgn/
+__ham_replace_log	../hash/hash_auto.c	/^__ham_replace_log(dbp, txnp, ret_lsnp, flags, pgno/
 __ham_replace_print	../hash/hash_autop.c	/^__ham_replace_print(dbenv, dbtp, lsnp, notused2, n/
 __ham_replace_read	../hash/hash_auto.c	/^__ham_replace_read(dbenv, recbuf, argpp)$/
 __ham_replace_recover	../hash/hash_rec.c	/^__ham_replace_recover(dbenv, dbtp, lsnp, op, info)/
@@ -3392,7 +3598,7 @@ __ham_set_h_ffactor	../hash/hash_method.c	/^__ham_set_h_ffactor(dbp, h_ffactor)$
 __ham_set_h_hash	../hash/hash_method.c	/^__ham_set_h_hash(dbp, func)$/
 __ham_set_h_nelem	../hash/hash_method.c	/^__ham_set_h_nelem(dbp, h_nelem)$/
 __ham_split_page	../hash/hash_page.c	/^__ham_split_page(dbc, obucket, nbucket)$/
-__ham_splitdata_log	../hash/hash_auto.c	/^__ham_splitdata_log(dbp, txnid, ret_lsnp, flags, o/
+__ham_splitdata_log	../hash/hash_auto.c	/^__ham_splitdata_log(dbp, txnp, ret_lsnp, flags, op/
 __ham_splitdata_print	../hash/hash_autop.c	/^__ham_splitdata_print(dbenv, dbtp, lsnp, notused2,/
 __ham_splitdata_read	../hash/hash_auto.c	/^__ham_splitdata_read(dbenv, recbuf, argpp)$/
 __ham_splitdata_recover	../hash/hash_rec.c	/^__ham_splitdata_recover(dbenv, dbtp, lsnp, op, inf/
@@ -3408,11 +3614,13 @@ __ham_vrfy_hashing	../hash/hash_verify.c	/^__ham_vrfy_hashing(dbp, nentries, m,
 __ham_vrfy_item	../hash/hash_verify.c	/^__ham_vrfy_item(dbp, vdp, pgno, h, i, flags)$/
 __ham_vrfy_meta	../hash/hash_verify.c	/^__ham_vrfy_meta(dbp, vdp, m, pgno, flags)$/
 __ham_vrfy_structure	../hash/hash_verify.c	/^__ham_vrfy_structure(dbp, vdp, meta_pgno, flags)$/
-__int64	../libdb_java/db_java_wrap.c	13
+__hdr	../dbinc/log.h	/^struct __hdr {$/
+__int64	../libdb_java/db_java_wrap.c	/^  typedef long long __int64;$/
+__key_range	../dbinc/db.in	/^struct __key_range {$/
+__kids	../dbinc/db.in	/^	struct __kids {$/
 __lock_addfamilylocker	../lock/lock_id.c	/^__lock_addfamilylocker(dbenv, pid, id)$/
-__lock_cmp	../lock/lock_util.c	/^__lock_cmp(dbt, lock_obj)$/
-__lock_dbenv_close	../lock/lock_method.c	/^__lock_dbenv_close(dbenv)$/
 __lock_dbenv_create	../lock/lock_method.c	/^__lock_dbenv_create(dbenv)$/
+__lock_dbenv_destroy	../lock/lock_method.c	/^__lock_dbenv_destroy(dbenv)$/
 __lock_dbenv_refresh	../lock/lock_region.c	/^__lock_dbenv_refresh(dbenv)$/
 __lock_detect	../lock/lock_deadlock.c	/^__lock_detect(dbenv, atype, abortp)$/
 __lock_detect_pp	../lock/lock_deadlock.c	/^__lock_detect_pp(dbenv, flags, atype, abortp)$/
@@ -3421,6 +3629,7 @@ __lock_dump_locker	../lock/lock_stat.c	/^__lock_dump_locker(dbenv, mbp, lt, lip)
 __lock_dump_object	../lock/lock_stat.c	/^__lock_dump_object(lt, mbp, op)$/
 __lock_expired	../lock/lock_timer.c	/^__lock_expired(dbenv, now, timevalp)$/
 __lock_expires	../lock/lock_timer.c	/^__lock_expires(dbenv, timevalp, timeout)$/
+__lock_failchk	../lock/lock_failchk.c	/^__lock_failchk(dbenv)$/
 __lock_fix_list	../lock/lock_list.c	/^__lock_fix_list(dbenv, list_dbt, nlocks)$/
 __lock_freefamilylocker	../lock/lock_id.c	/^__lock_freefamilylocker(lt, locker)$/
 __lock_freelock	../lock/lock.c	/^__lock_freelock(lt, lockp, locker, flags)$/
@@ -3437,7 +3646,7 @@ __lock_get_lk_max_objects	../lock/lock_method.c	/^__lock_get_lk_max_objects(dben
 __lock_get_pp	../lock/lock.c	/^__lock_get_pp(dbenv, locker, flags, obj, lock_mode/
 __lock_getlocker	../lock/lock_id.c	/^__lock_getlocker(lt, locker, indx, create, retp)$/
 __lock_getobj	../lock/lock.c	/^__lock_getobj(lt, obj, ndx, create, retp)$/
-__lock_id	../lock/lock_id.c	/^__lock_id(dbenv, idp)$/
+__lock_id	../lock/lock_id.c	/^__lock_id(dbenv, idp, lkp)$/
 __lock_id_free	../lock/lock_id.c	/^__lock_id_free(dbenv, id)$/
 __lock_id_free_pp	../lock/lock_id.c	/^__lock_id_free_pp(dbenv, id)$/
 __lock_id_pp	../lock/lock_id.c	/^__lock_id_pp(dbenv, idp)$/
@@ -3447,8 +3656,7 @@ __lock_inherit_timeout	../lock/lock_timer.c	/^__lock_inherit_timeout(dbenv, pare
 __lock_is_parent	../lock/lock.c	/^__lock_is_parent(lt, locker, sh_locker)$/
 __lock_lhash	../lock/lock_util.c	/^__lock_lhash(lock_obj)$/
 __lock_list_print	../lock/lock_list.c	/^__lock_list_print(dbenv, list)$/
-__lock_locker_cmp	../lock/lock_util.c	/^__lock_locker_cmp(locker, sh_locker)$/
-__lock_locker_hash	../lock/lock_util.c	/^__lock_locker_hash(locker)$/
+__lock_locker_hash	../dbinc/lock.h	/^#define	__lock_locker_hash(locker)	(locker)$/
 __lock_locker_is_parent	../lock/lock.c	/^__lock_locker_is_parent(dbenv, locker, child, retp/
 __lock_nomem	../lock/lock_util.c	/^__lock_nomem(dbenv, res)$/
 __lock_ohash	../lock/lock_util.c	/^__lock_ohash(dbt)$/
@@ -3457,23 +3665,22 @@ __lock_print_all	../lock/lock_stat.c	/^__lock_print_all(dbenv, flags)$/
 __lock_print_header	../lock/lock_stat.c	/^__lock_print_header(dbenv)$/
 __lock_print_stats	../lock/lock_stat.c	/^__lock_print_stats(dbenv, flags)$/
 __lock_printlock	../lock/lock_stat.c	/^__lock_printlock(lt, mbp, lp, ispgno)$/
-__lock_promote	../lock/lock.c	/^__lock_promote(lt, obj, flags)$/
-__lock_put	../lock/lock.c	/^__lock_put(dbenv, lock, flags)$/
+__lock_promote	../lock/lock.c	/^__lock_promote(lt, obj, state_changedp, flags)$/
+__lock_put	../lock/lock.c	/^__lock_put(dbenv, lock)$/
 __lock_put_internal	../lock/lock.c	/^__lock_put_internal(lt, lockp, obj_ndx, flags)$/
 __lock_put_nolock	../lock/lock.c	/^__lock_put_nolock(dbenv, lock, runp, flags)$/
 __lock_put_pp	../lock/lock.c	/^__lock_put_pp(dbenv, lock)$/
-__lock_region_destroy	../lock/lock_region.c	/^__lock_region_destroy(dbenv, infop)$/
 __lock_region_init	../lock/lock_region.c	/^__lock_region_init(dbenv, lt)$/
-__lock_region_maint	../lock/lock_region.c	/^__lock_region_maint(dbenv)$/
+__lock_region_mutex_count	../lock/lock_region.c	/^__lock_region_mutex_count(dbenv)$/
 __lock_region_size	../lock/lock_region.c	/^__lock_region_size(dbenv)$/
 __lock_remove_waiter	../lock/lock.c	/^__lock_remove_waiter(lt, sh_obj, lockp, status)$/
 __lock_set_env_timeout	../lock/lock_method.c	/^__lock_set_env_timeout(dbenv, timeout, flags)$/
 __lock_set_lk_conflicts	../lock/lock_method.c	/^__lock_set_lk_conflicts(dbenv, lk_conflicts, lk_mo/
 __lock_set_lk_detect	../lock/lock_method.c	/^__lock_set_lk_detect(dbenv, lk_detect)$/
-__lock_set_lk_max	../lock/lock_method.c	/^__lock_set_lk_max(dbenv, lk_max)$/
 __lock_set_lk_max_lockers	../lock/lock_method.c	/^__lock_set_lk_max_lockers(dbenv, lk_max)$/
 __lock_set_lk_max_locks	../lock/lock_method.c	/^__lock_set_lk_max_locks(dbenv, lk_max)$/
 __lock_set_lk_max_objects	../lock/lock_method.c	/^__lock_set_lk_max_objects(dbenv, lk_max)$/
+__lock_set_thread_id	../lock/lock_id.c	/^__lock_set_thread_id(lref, pid, tid)$/
 __lock_set_timeout	../lock/lock_timer.c	/^__lock_set_timeout(dbenv, locker, timeout, op)$/
 __lock_set_timeout_internal	../lock/lock_timer.c	/^__lock_set_timeout_internal(dbenv, locker, timeout/
 __lock_sort_cmp	../lock/lock_list.c	/^__lock_sort_cmp(a, b)$/
@@ -3484,6 +3691,7 @@ __lock_stat_print_pp	../lock/lock_stat.c	/^__lock_stat_print_pp(dbenv, flags)$/
 __lock_trade	../lock/lock.c	/^__lock_trade(dbenv, lock, new_locker)$/
 __lock_vec	../lock/lock.c	/^__lock_vec(dbenv, locker, flags, list, nlist, elis/
 __lock_vec_pp	../lock/lock.c	/^__lock_vec_pp(dbenv, locker, flags, list, nlist, e/
+__log	../dbinc/log.h	/^struct __log {$/
 __log_archive	../log/log_archive.c	/^__log_archive(dbenv, listp, flags)$/
 __log_archive_pp	../log/log_archive.c	/^__log_archive_pp(dbenv, listp, flags)$/
 __log_autoremove	../log/log_archive.c	/^__log_autoremove(dbenv)$/
@@ -3500,10 +3708,15 @@ __log_c_io	../log/log_get.c	/^__log_c_io(logc, fnum, offset, p, nrp, eofp)$/
 __log_c_ondisk	../log/log_get.c	/^__log_c_ondisk(logc, lsn, last_lsn, flags, hdr, pp/
 __log_c_set_maxrec	../log/log_get.c	/^__log_c_set_maxrec(logc, np)$/
 __log_c_shortread	../log/log_get.c	/^__log_c_shortread(logc, lsn, check_silent)$/
+__log_c_version	../log/log_get.c	/^__log_c_version(logc, versionp)$/
+__log_c_version_pp	../log/log_get.c	/^__log_c_version_pp(logc, versionp, flags)$/
+__log_check_page_lsn	../log/log_compare.c	/^__log_check_page_lsn(dbenv, dbp, lsnp)$/
 __log_check_sizes	../log/log_method.c	/^__log_check_sizes(dbenv, lg_max, lg_bsize)$/
+__log_current_lsn	../log/log_put.c	/^__log_current_lsn(dbenv, lsnp, mbytesp, bytesp)$/
 __log_cursor	../log/log_get.c	/^__log_cursor(dbenv, logcp)$/
 __log_cursor_pp	../log/log_get.c	/^__log_cursor_pp(dbenv, logcp, flags)$/
 __log_dbenv_create	../log/log_method.c	/^__log_dbenv_create(dbenv)$/
+__log_dbenv_destroy	../log/log_method.c	/^__log_dbenv_destroy(dbenv)$/
 __log_dbenv_refresh	../log/log.c	/^__log_dbenv_refresh(dbenv)$/
 __log_earliest	../env/env_recover.c	/^__log_earliest(dbenv, logc, lowtime, lowlsn)$/
 __log_encrypt_record	../log/log_put.c	/^__log_encrypt_record(dbenv, dbt, hdr, orig)$/
@@ -3519,64 +3732,87 @@ __log_get_cached_ckp_lsn	../log/log.c	/^__log_get_cached_ckp_lsn(dbenv, ckp_lsnp
 __log_get_flags	../log/log_method.c	/^__log_get_flags(dbenv, flagsp)$/
 __log_get_lg_bsize	../log/log_method.c	/^__log_get_lg_bsize(dbenv, lg_bsizep)$/
 __log_get_lg_dir	../log/log_method.c	/^__log_get_lg_dir(dbenv, dirp)$/
+__log_get_lg_filemode	../log/log_method.c	/^__log_get_lg_filemode(dbenv, lg_modep)$/
 __log_get_lg_max	../log/log_method.c	/^__log_get_lg_max(dbenv, lg_maxp)$/
 __log_get_lg_regionmax	../log/log_method.c	/^__log_get_lg_regionmax(dbenv, lg_regionmaxp)$/
+__log_get_oldversion	../log/log.c	/^__log_get_oldversion(dbenv, ver)$/
+__log_get_stable_lsn	../log/log_archive.c	/^__log_get_stable_lsn(dbenv, stable_lsn)$/
 __log_init	../log/log.c	/^__log_init(dbenv, dblp)$/
 __log_inmem_chkspace	../log/log.c	/^__log_inmem_chkspace(dblp, len)$/
 __log_inmem_copyin	../log/log.c	/^__log_inmem_copyin(dblp, offset, buf, size)$/
 __log_inmem_copyout	../log/log.c	/^__log_inmem_copyout(dblp, offset, buf, size)$/
-__log_inmem_lsnoff	../log/log.c	/^__log_inmem_lsnoff(dblp, lsn, offsetp)$/
+__log_inmem_lsnoff	../log/log.c	/^__log_inmem_lsnoff(dblp, lsnp, offsetp)$/
 __log_inmem_newfile	../log/log.c	/^__log_inmem_newfile(dblp, file)$/
 __log_is_outdated	../log/log.c	/^__log_is_outdated(dbenv, fnum, outdatedp)$/
 __log_name	../log/log_put.c	/^__log_name(dblp, filenumber, namep, fhpp, flags)$/
 __log_newfh	../log/log_put.c	/^__log_newfh(dblp, create)$/
-__log_newfile	../log/log_put.c	/^__log_newfile(dblp, lsnp, logfile)$/
+__log_newfile	../log/log_put.c	/^__log_newfile(dblp, lsnp, logfile, version)$/
 __log_open	../log/log.c	/^__log_open(dbenv)$/
+__log_persist	../dbinc/log.h	/^struct __log_persist {$/
 __log_print_all	../log/log_stat.c	/^__log_print_all(dbenv, flags)$/
 __log_print_stats	../log/log_stat.c	/^__log_print_stats(dbenv, flags)$/
+__log_printf	../log/log_debug.c	/^__log_printf(dbenv, txnid, fmt, va_alist)$/
+__log_printf_capi	../log/log_debug.c	/^__log_printf_capi(dbenv, txnid, fmt, va_alist)$/
+__log_printf_int	../log/log_debug.c	/^__log_printf_int(dbenv, txnid, fmt, ap)$/
+__log_printf_pp	../log/log_debug.c	/^__log_printf_pp(dbenv, txnid, fmt, ap)$/
 __log_put	../log/log_put.c	/^__log_put(dbenv, lsnp, udbt, flags)$/
 __log_put_next	../log/log_put.c	/^__log_put_next(dbenv, lsn, dbt, hdr, old_lsnp)$/
 __log_put_pp	../log/log_put.c	/^__log_put_pp(dbenv, lsnp, udbt, flags)$/
 __log_putr	../log/log_put.c	/^__log_putr(dblp, lsn, dbt, prev, h)$/
 __log_recover	../log/log.c	/^__log_recover(dblp)$/
-__log_region_destroy	../log/log.c	/^__log_region_destroy(dbenv, infop)$/
+__log_region_mutex_count	../log/log.c	/^__log_region_mutex_count(dbenv)$/
 __log_region_size	../log/log.c	/^__log_region_size(dbenv)$/
 __log_rep_put	../log/log_put.c	/^__log_rep_put(dbenv, lsnp, rec)$/
+__log_rep_split	../log/log_get.c	/^__log_rep_split(dbenv, rp, rec, ret_lsnp, last_lsn/
 __log_set_flags	../log/log_method.c	/^__log_set_flags(dbenv, flags, on)$/
 __log_set_lg_bsize	../log/log_method.c	/^__log_set_lg_bsize(dbenv, lg_bsize)$/
 __log_set_lg_dir	../log/log_method.c	/^__log_set_lg_dir(dbenv, dir)$/
+__log_set_lg_filemode	../log/log_method.c	/^__log_set_lg_filemode(dbenv, lg_mode)$/
 __log_set_lg_max	../log/log_method.c	/^__log_set_lg_max(dbenv, lg_max)$/
 __log_set_lg_regionmax	../log/log_method.c	/^__log_set_lg_regionmax(dbenv, lg_regionmax)$/
+__log_set_version	../log/log.c	/^__log_set_version(dbenv, newver)$/
 __log_stat	../log/log_stat.c	/^__log_stat(dbenv, statp, flags)$/
 __log_stat_pp	../log/log_stat.c	/^__log_stat_pp(dbenv, statp, flags)$/
 __log_stat_print	../log/log_stat.c	/^__log_stat_print(dbenv, flags)$/
 __log_stat_print_pp	../log/log_stat.c	/^__log_stat_print_pp(dbenv, flags)$/
-__log_txn_lsn	../log/log_put.c	/^__log_txn_lsn(dbenv, lsnp, mbytesp, bytesp)$/
 __log_valid	../log/log.c	/^__log_valid(dblp, number, set_persist, fhpp, flags/
 __log_vtruncate	../log/log.c	/^__log_vtruncate(dbenv, lsn, ckplsn, trunclsn)$/
 __log_write	../log/log_put.c	/^__log_write(dblp, addr, len)$/
 __log_zero	../log/log.c	/^__log_zero(dbenv, from_lsn, to_lsn)$/
 __lsn_diff	../env/env_recover.c	/^__lsn_diff(low, high, current, max, is_forward)$/
 __memp_alloc	../mp/mp_alloc.c	/^__memp_alloc(dbmp, infop, mfp, len, offsetp, retp)/
-__memp_bad_buffer	../mp/mp_alloc.c	/^__memp_bad_buffer(hp)$/
+__memp_alloc_freelist	../mp/mp_method.c	/^__memp_alloc_freelist(dbmfp, nelems, listp)$/
+__memp_bad_buffer	../mp/mp_alloc.c	/^__memp_bad_buffer(dbenv, hp)$/
+__memp_bh_freeze	../mp/mp_mvcc.c	/^__memp_bh_freeze(dbmp, infop, hp, bhp, need_frozen/
+__memp_bh_priority	../mp/mp_mvcc.c	/^__memp_bh_priority(bhp)$/
+__memp_bh_settxn	../mp/mp_mvcc.c	/^int __memp_bh_settxn(dbmp, mfp, bhp, vtd)$/
+__memp_bh_thaw	../mp/mp_mvcc.c	/^__memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_/
 __memp_bhfree	../mp/mp_bh.c	/^__memp_bhfree(dbmp, hp, bhp, flags)$/
 __memp_bhwrite	../mp/mp_bh.c	/^__memp_bhwrite(dbmp, hp, mfp, bhp, open_extents)$/
-__memp_check_order	../mp/mp_alloc.c	/^__memp_check_order(hp)$/
+__memp_bucket_reorder	../mp/mp_mvcc.c	/^__memp_bucket_reorder(dbenv, hp, bhp)$/
+__memp_check_order	../mp/mp_alloc.c	/^__memp_check_order(dbenv, hp)$/
 __memp_close_flush_files	../mp/mp_sync.c	/^__memp_close_flush_files(dbenv, dbmp, dosync)$/
+__memp_count_files	../mp/mp_stat.c	/^__memp_count_files(dbenv, mfp, argp, countp, flags/
 __memp_dbenv_create	../mp/mp_method.c	/^__memp_dbenv_create(dbenv)$/
+__memp_dbenv_destroy	../mp/mp_method.c	/^__memp_dbenv_destroy(dbenv)$/
 __memp_dbenv_refresh	../mp/mp_region.c	/^__memp_dbenv_refresh(dbenv)$/
+__memp_dirty	../mp/mp_fset.c	/^__memp_dirty(dbmfp, addrp, txn, flags)$/
+__memp_extend_freelist	../mp/mp_method.c	/^__memp_extend_freelist(dbmfp, count, listp)$/
 __memp_fclose	../mp/mp_fopen.c	/^__memp_fclose(dbmfp, flags)$/
 __memp_fclose_pp	../mp/mp_fopen.c	/^__memp_fclose_pp(dbmfp, flags)$/
 __memp_fcreate	../mp/mp_fmethod.c	/^__memp_fcreate(dbenv, retp)$/
 __memp_fcreate_pp	../mp/mp_fmethod.c	/^__memp_fcreate_pp(dbenv, retp, flags)$/
-__memp_fget	../mp/mp_fget.c	/^__memp_fget(dbmfp, pgnoaddr, flags, addrp)$/
-__memp_fget_pp	../mp/mp_fget.c	/^__memp_fget_pp(dbmfp, pgnoaddr, flags, addrp)$/
+__memp_fget	../mp/mp_fget.c	/^__memp_fget(dbmfp, pgnoaddr, txn, flags, addrp)$/
+__memp_fget_pp	../mp/mp_fget.c	/^__memp_fget_pp(dbmfp, pgnoaddr, txnp, flags, addrp/
+__memp_file_stats	../mp/mp_stat.c	/^__memp_file_stats(dbenv, mfp, argp, countp, flags)/
 __memp_fn	../mp/mp_fmethod.c	/^__memp_fn(dbmfp)$/
 __memp_fns	../mp/mp_fmethod.c	/^__memp_fns(dbmp, mfp)$/
 __memp_fopen	../mp/mp_fopen.c	/^__memp_fopen(dbmfp, mfp, path, flags, mode, pgsize/
 __memp_fopen_pp	../mp/mp_fopen.c	/^__memp_fopen_pp(dbmfp, path, flags, mode, pagesize/
 __memp_fput	../mp/mp_fput.c	/^__memp_fput(dbmfp, pgaddr, flags)$/
 __memp_fput_pp	../mp/mp_fput.c	/^__memp_fput_pp(dbmfp, pgaddr, flags)$/
+__memp_free	../mp/mp_alloc.c	/^__memp_free(infop, mfp, buf)$/
+__memp_free_freelist	../mp/mp_method.c	/^__memp_free_freelist(dbmfp)$/
 __memp_fset	../mp/mp_fset.c	/^__memp_fset(dbmfp, pgaddr, flags)$/
 __memp_fset_pp	../mp/mp_fset.c	/^__memp_fset_pp(dbmfp, pgaddr, flags)$/
 __memp_fsync	../mp/mp_sync.c	/^__memp_fsync(dbmfp)$/
@@ -3585,7 +3821,9 @@ __memp_ftruncate	../mp/mp_method.c	/^__memp_ftruncate(dbmfp, pgno, flags)$/
 __memp_get_cachesize	../mp/mp_method.c	/^__memp_get_cachesize(dbenv, gbytesp, bytesp, ncach/
 __memp_get_clear_len	../mp/mp_fmethod.c	/^__memp_get_clear_len(dbmfp, clear_lenp)$/
 __memp_get_fileid	../mp/mp_fmethod.c	/^__memp_get_fileid(dbmfp, fileid)$/
+__memp_get_files	../mp/mp_stat.c	/^__memp_get_files(dbenv, mfp, argp, countp, flags)$/
 __memp_get_flags	../mp/mp_fmethod.c	/^__memp_get_flags(dbmfp, flagsp)$/
+__memp_get_freelist	../mp/mp_method.c	/^__memp_get_freelist(dbmfp, nelemp, listp)$/
 __memp_get_ftype	../mp/mp_fmethod.c	/^__memp_get_ftype(dbmfp, ftypep)$/
 __memp_get_lsn_offset	../mp/mp_fmethod.c	/^__memp_get_lsn_offset(dbmfp, lsn_offsetp)$/
 __memp_get_maxsize	../mp/mp_fmethod.c	/^__memp_get_maxsize(dbmfp, gbytesp, bytesp)$/
@@ -3594,23 +3832,25 @@ __memp_get_mp_max_write	../mp/mp_method.c	/^__memp_get_mp_max_write(dbenv, maxwr
 __memp_get_mp_mmapsize	../mp/mp_method.c	/^__memp_get_mp_mmapsize(dbenv, mp_mmapsizep)$/
 __memp_get_pgcookie	../mp/mp_fmethod.c	/^__memp_get_pgcookie(dbmfp, pgcookie)$/
 __memp_get_priority	../mp/mp_fmethod.c	/^__memp_get_priority(dbmfp, priorityp)$/
-__memp_get_refcnt	../mp/mp_method.c	/^__memp_get_refcnt(dbenv, fileid, refp)$/
 __memp_init	../mp/mp_region.c	/^__memp_init(dbenv, dbmp, reginfo_off, htab_buckets/
 __memp_init_config	../mp/mp_region.c	/^__memp_init_config(dbenv, mp)$/
+__memp_inmemlist	../mp/mp_fopen.c	/^__memp_inmemlist(dbenv, namesp, cntp)$/
 __memp_last_pgno	../mp/mp_fmethod.c	/^__memp_last_pgno(dbmfp, pgnoaddr)$/
 __memp_mf_discard	../mp/mp_fopen.c	/^__memp_mf_discard(dbmp, mfp)$/
-__memp_mf_sync	../mp/mp_sync.c	/^__memp_mf_sync(dbmp, mfp)$/
+__memp_mf_sync	../mp/mp_sync.c	/^__memp_mf_sync(dbmp, mfp, region_locked)$/
+__memp_mfp_alloc	../mp/mp_fopen.c	/^__memp_mfp_alloc(dbmp, dbmfp, path, pagesize, flag/
 __memp_nameop	../mp/mp_method.c	/^__memp_nameop(dbenv, fileid, newname, fullold, ful/
 __memp_open	../mp/mp_region.c	/^__memp_open(dbenv)$/
 __memp_pg	../mp/mp_bh.c	/^__memp_pg(dbmfp, bhp, is_pgin)$/
-__memp_pgread	../mp/mp_bh.c	/^__memp_pgread(dbmfp, mutexp, bhp, can_create)$/
+__memp_pgread	../mp/mp_bh.c	/^__memp_pgread(dbmfp, hp, bhp, can_create)$/
 __memp_pgwrite	../mp/mp_bh.c	/^__memp_pgwrite(dbenv, dbmfp, hp, bhp)$/
 __memp_print_all	../mp/mp_stat.c	/^__memp_print_all(dbenv, flags)$/
-__memp_print_bh	../mp/mp_stat.c	/^__memp_print_bh(dbenv, dbmp, bhp, fmap, flags)$/
+__memp_print_bh	../mp/mp_stat.c	/^__memp_print_bh(dbenv, dbmp, prefix, bhp, fmap)$/
+__memp_print_files	../mp/mp_stat.c	/^__memp_print_files(dbenv, mfp, argp, countp, flags/
 __memp_print_hash	../mp/mp_stat.c	/^__memp_print_hash(dbenv, dbmp, reginfo, fmap, flag/
 __memp_print_stats	../mp/mp_stat.c	/^__memp_print_stats(dbenv, flags)$/
-__memp_region_destroy	../mp/mp_region.c	/^__memp_region_destroy(dbenv, infop)$/
-__memp_region_maint	../mp/mp_region.c	/^__memp_region_maint(infop)$/
+__memp_region_mutex_count	../mp/mp_region.c	/^__memp_region_mutex_count(dbenv)$/
+__memp_region_size	../mp/mp_region.c	/^__memp_region_size(dbenv, reg_sizep, htab_bucketsp/
 __memp_register	../mp/mp_register.c	/^__memp_register(dbenv, ftype, pgin, pgout)$/
 __memp_register_pp	../mp/mp_register.c	/^__memp_register_pp(dbenv, ftype, pgin, pgout)$/
 __memp_reset_lru	../mp/mp_fput.c	/^__memp_reset_lru(dbenv, infop)$/
@@ -3626,20 +3866,62 @@ __memp_set_mp_max_write	../mp/mp_method.c	/^__memp_set_mp_max_write(dbenv, maxwr
 __memp_set_mp_mmapsize	../mp/mp_method.c	/^__memp_set_mp_mmapsize(dbenv, mp_mmapsize)$/
 __memp_set_pgcookie	../mp/mp_fmethod.c	/^__memp_set_pgcookie(dbmfp, pgcookie)$/
 __memp_set_priority	../mp/mp_fmethod.c	/^__memp_set_priority(dbmfp, priority)$/
+__memp_skip_curadj	../mp/mp_mvcc.c	/^__memp_skip_curadj(dbc, pgno)$/
 __memp_stat	../mp/mp_stat.c	/^__memp_stat(dbenv, gspp, fspp, flags)$/
 __memp_stat_hash	../mp/mp_stat.c	/^__memp_stat_hash(reginfo, mp, dirtyp)$/
 __memp_stat_pp	../mp/mp_stat.c	/^__memp_stat_pp(dbenv, gspp, fspp, flags)$/
 __memp_stat_print	../mp/mp_stat.c	/^__memp_stat_print(dbenv, flags)$/
 __memp_stat_print_pp	../mp/mp_stat.c	/^__memp_stat_print_pp(dbenv, flags)$/
-__memp_stat_wait	../mp/mp_stat.c	/^__memp_stat_wait(reginfo, mp, mstat, flags)$/
+__memp_stat_wait	../mp/mp_stat.c	/^__memp_stat_wait(dbenv, reginfo, mp, mstat, flags)/
 __memp_sync	../mp/mp_sync.c	/^__memp_sync(dbenv, lsnp)$/
+__memp_sync_file	../mp/mp_sync.c	/^__memp_sync_file(dbenv, mfp, argp, countp, flags)$/
 __memp_sync_files	../mp/mp_sync.c	/^int __memp_sync_files(dbenv, dbmp)$/
 __memp_sync_int	../mp/mp_sync.c	/^__memp_sync_int(dbenv, dbmfp, trickle_max, op, wro/
 __memp_sync_pp	../mp/mp_sync.c	/^__memp_sync_pp(dbenv, lsnp)$/
 __memp_trickle	../mp/mp_trickle.c	/^__memp_trickle(dbenv, pct, nwrotep)$/
 __memp_trickle_pp	../mp/mp_trickle.c	/^__memp_trickle_pp(dbenv, pct, nwrotep)$/
+__memp_walk_files	../mp/mp_sync.c	/^__memp_walk_files(dbenv, mp, func, arg, countp, fl/
 __mp_xxx_fh	../mp/mp_sync.c	/^__mp_xxx_fh(dbmfp, fhp)$/
 __mpe_fsync	../os/os_fsync.c	/^__mpe_fsync(fd)$/
+__mpool	../dbinc/mp.h	/^struct __mpool {$/
+__mpoolfile	../dbinc/mp.h	/^struct __mpoolfile {$/
+__mut_failchk	../mutex/mut_failchk.c	/^__mut_failchk(dbenv)$/
+__mutex_alloc	../mutex/mut_alloc.c	/^__mutex_alloc(dbenv, alloc_id, flags, indxp)$/
+__mutex_alloc_int	../mutex/mut_alloc.c	/^__mutex_alloc_int(dbenv, locksys, alloc_id, flags,/
+__mutex_alloc_pp	../mutex/mut_method.c	/^__mutex_alloc_pp(dbenv, flags, indxp)$/
+__mutex_clear	../mutex/mut_stat.c	/^__mutex_clear(dbenv, mutex)$/
+__mutex_dbenv_refresh	../mutex/mut_region.c	/^__mutex_dbenv_refresh(dbenv)$/
+__mutex_destroy	../dbinc/mutex.h	/^#define	__mutex_destroy(a, b)		__db_pthread_mutex_/
+__mutex_free	../mutex/mut_alloc.c	/^__mutex_free(dbenv, indxp)$/
+__mutex_free_int	../mutex/mut_alloc.c	/^__mutex_free_int(dbenv, locksys, indxp)$/
+__mutex_free_pp	../mutex/mut_method.c	/^__mutex_free_pp(dbenv, indx)$/
+__mutex_get_align	../mutex/mut_method.c	/^__mutex_get_align(dbenv, alignp)$/
+__mutex_get_increment	../mutex/mut_method.c	/^__mutex_get_increment(dbenv, incrementp)$/
+__mutex_get_max	../mutex/mut_method.c	/^__mutex_get_max(dbenv, maxp)$/
+__mutex_get_tas_spins	../mutex/mut_method.c	/^__mutex_get_tas_spins(dbenv, tas_spinsp)$/
+__mutex_init	../dbinc/mutex.h	/^#define	__mutex_init(a, b, c)		__db_pthread_mutex_/
+__mutex_lock	../dbinc/mutex.h	/^#define	__mutex_lock(a, b)		__db_pthread_mutex_loc/
+__mutex_lock_pp	../mutex/mut_method.c	/^__mutex_lock_pp(dbenv, indx)$/
+__mutex_open	../mutex/mut_region.c	/^__mutex_open(dbenv)$/
+__mutex_print_all	../mutex/mut_stat.c	/^__mutex_print_all(dbenv, flags)$/
+__mutex_print_debug_single	../mutex/mut_stat.c	/^__mutex_print_debug_single(dbenv, tag, mutex, flag/
+__mutex_print_debug_stats	../mutex/mut_stat.c	/^__mutex_print_debug_stats(dbenv, mbp, mutex, flags/
+__mutex_print_id	../mutex/mut_stat.c	/^__mutex_print_id(alloc_id)$/
+__mutex_print_stats	../mutex/mut_stat.c	/^__mutex_print_stats(dbenv, flags)$/
+__mutex_print_summary	../mutex/mut_stat.c	/^__mutex_print_summary(dbenv)$/
+__mutex_region_init	../mutex/mut_region.c	/^__mutex_region_init(dbenv, mtxmgr)$/
+__mutex_region_size	../mutex/mut_region.c	/^__mutex_region_size(dbenv)$/
+__mutex_resource_return	../mutex/mut_region.c	/^__mutex_resource_return(dbenv, infop)$/
+__mutex_set_align	../mutex/mut_method.c	/^__mutex_set_align(dbenv, align)$/
+__mutex_set_increment	../mutex/mut_method.c	/^__mutex_set_increment(dbenv, increment)$/
+__mutex_set_max	../mutex/mut_method.c	/^__mutex_set_max(dbenv, max)$/
+__mutex_set_tas_spins	../mutex/mut_method.c	/^__mutex_set_tas_spins(dbenv, tas_spins)$/
+__mutex_set_wait_info	../mutex/mut_stat.c	/^__mutex_set_wait_info(dbenv, mutex, waitp, nowaitp/
+__mutex_stat	../mutex/mut_stat.c	/^__mutex_stat(dbenv, statp, flags)$/
+__mutex_stat_print	../mutex/mut_stat.c	/^__mutex_stat_print(dbenv, flags)$/
+__mutex_unlock	../dbinc/mutex.h	/^#define	__mutex_unlock(a, b)		__db_pthread_mutex_u/
+__mutex_unlock_pp	../mutex/mut_method.c	/^__mutex_unlock_pp(dbenv, indx)$/
+__no_system_mem	../os/os_map.c	/^__no_system_mem(dbenv)$/
 __op_rep_enter	../rep/rep_util.c	/^__op_rep_enter(dbenv)$/
 __op_rep_exit	../rep/rep_util.c	/^__op_rep_exit(dbenv)$/
 __os_abspath	../os/os_abs.c	/^__os_abspath(path)$/
@@ -3648,28 +3930,31 @@ __os_clock	../os/os_clock.c	/^__os_clock(dbenv, secsp, usecsp)$/
 __os_closehandle	../os/os_handle.c	/^__os_closehandle(dbenv, fhp)$/
 __os_dirfree	../os/os_dir.c	/^__os_dirfree(dbenv, names, cnt)$/
 __os_dirlist	../os/os_dir.c	/^__os_dirlist(dbenv, dir, namesp, cntp)$/
-__os_exists	../os/os_stat.c	/^__os_exists(path, isdirp)$/
+__os_exists	../os/os_stat.c	/^__os_exists(dbenv, path, isdirp)$/
+__os_fdlock	../os/os_flock.c	/^__os_fdlock(dbenv, fhp, offset, acquire, nowait)$/
 __os_fileid	../os/os_fid.c	/^__os_fileid(dbenv, fname, unique_okay, fidp)$/
 __os_free	../os/os_alloc.c	/^__os_free(dbenv, ptr)$/
 __os_fs_notzero	../os/os_config.c	/^__os_fs_notzero()$/
 __os_fsync	../os/os_fsync.c	/^__os_fsync(dbenv, fhp)$/
 __os_get_errno	../os/os_errno.c	/^__os_get_errno()$/
 __os_get_errno_ret_zero	../os/os_errno.c	/^__os_get_errno_ret_zero()$/
+__os_get_neterr	../os/os_errno.c	/^__os_get_neterr()$/
+__os_get_syserr	../os/os_errno.c	/^__os_get_syserr()$/
+__os_getenv	../os/os_getenv.c	/^__os_getenv(dbenv, name, bpp, buflen)$/
 __os_guard	../os/os_alloc.c	/^__os_guard(dbenv)$/
-__os_have_direct	../os/os_open.c	/^__os_have_direct()$/
-__os_id	../os/os_id.c	/^__os_id(idp)$/
-__os_intermediate_dir	../os/os_open.c	/^__os_intermediate_dir(dbenv, name)$/
-__os_io	../os/os_rw.c	/^__os_io(dbenv, op, fhp, pgno, pagesize, buf, niop)/
+__os_id	../os/os_pid.c	/^__os_id(dbenv, pidp, tidp)$/
+__os_io	../os/os_rw.c	/^__os_io(dbenv, op, fhp, pgno, pgsize, relative, io/
 __os_ioinfo	../os/os_stat.c	/^__os_ioinfo(dbenv, path, fhp, mbytesp, bytesp, ios/
 __os_isroot	../os/os_root.c	/^__os_isroot()$/
 __os_malloc	../os/os_alloc.c	/^__os_malloc(dbenv, size, storep)$/
 __os_map	../os/os_map.c	/^__os_map(dbenv, path, fhp, len, is_region, is_rdon/
 __os_mapfile	../os/os_map.c	/^__os_mapfile(dbenv, path, fhp, len, is_rdonly, add/
-__os_mkdir	../os/os_open.c	/^__os_mkdir(dbenv, name)$/
+__os_mkdir	../os/os_mkdir.c	/^__os_mkdir(dbenv, name, mode)$/
 __os_open	../os/os_open.c	/^__os_open(dbenv, name, flags, mode, fhpp)$/
 __os_open_extend	../os/os_open.c	/^__os_open_extend(dbenv, name, page_size, flags, mo/
 __os_openhandle	../os/os_handle.c	/^__os_openhandle(dbenv, name, flags, mode, fhpp)$/
 __os_physwrite	../os/os_rw.c	/^__os_physwrite(dbenv, fhp, addr, len, nwp)$/
+__os_posix_err	../os/os_errno.c	/^__os_posix_err(error)$/
 __os_pstat_getdynamic	../os/os_spin.c	/^__os_pstat_getdynamic()$/
 __os_qnx_region_open	../os/os_open.c	/^__os_qnx_region_open(dbenv, name, oflags, mode, fh/
 __os_r_attach	../os/os_region.c	/^__os_r_attach(dbenv, infop, rp)$/
@@ -3680,27 +3965,32 @@ __os_read	../os/os_rw.c	/^__os_read(dbenv, fhp, addr, len, nrp)$/
 __os_realloc	../os/os_alloc.c	/^__os_realloc(dbenv, size, storep)$/
 __os_region_unlink	../os/os_unlink.c	/^__os_region_unlink(dbenv, path)$/
 __os_rename	../os/os_rename.c	/^__os_rename(dbenv, old, new, silent)$/
-__os_seek	../os/os_seek.c	/^__os_seek(dbenv, fhp, pgsize, pageno, relative, is/
+__os_seek	../os/os_seek.c	/^__os_seek(dbenv, fhp, pgno, pgsize, relative)$/
 __os_set_errno	../os/os_errno.c	/^__os_set_errno(evalue)$/
 __os_shmname	../os/os_open.c	/^__os_shmname(dbenv, name, newnamep)$/
 __os_sleep	../os/os_sleep.c	/^__os_sleep(dbenv, secs, usecs)$/
 __os_spin	../os/os_spin.c	/^__os_spin(dbenv)$/
 __os_strdup	../os/os_alloc.c	/^__os_strdup(dbenv, str, storep)$/
+__os_strerror	../os/os_errno.c	/^__os_strerror(error, buf, len)$/
+__os_support_db_register	../os/os_config.c	/^__os_support_db_register()$/
+__os_support_direct_io	../os/os_config.c	/^__os_support_direct_io()$/
+__os_support_replication	../os/os_config.c	/^__os_support_replication()$/
 __os_sysconf	../os/os_spin.c	/^__os_sysconf()$/
 __os_tmpdir	../os/os_tmpdir.c	/^__os_tmpdir(dbenv, flags)$/
 __os_truncate	../os/os_truncate.c	/^__os_truncate(dbenv, fhp, pgno, pgsize)$/
 __os_ufree	../os/os_alloc.c	/^__os_ufree(dbenv, ptr)$/
 __os_umalloc	../os/os_alloc.c	/^__os_umalloc(dbenv, size, storep)$/
-__os_unique_id	../os/os_id.c	/^__os_unique_id(dbenv, idp)$/
+__os_unique_id	../os/os_uid.c	/^__os_unique_id(dbenv, idp)$/
 __os_unlink	../os/os_unlink.c	/^__os_unlink(dbenv, path)$/
 __os_unmapfile	../os/os_map.c	/^__os_unmapfile(dbenv, addr, len)$/
 __os_urealloc	../os/os_alloc.c	/^__os_urealloc(dbenv, size, storep)$/
 __os_write	../os/os_rw.c	/^__os_write(dbenv, fhp, addr, len, nwp)$/
-__os_yield	../os/os_spin.c	/^__os_yield(dbenv, usecs)$/
-__os_zerofill	../os/os_rw.c	/^__os_zerofill(dbenv, fhp)$/
+__os_yield	../os/os_yield.c	/^__os_yield(dbenv)$/
+__os_zerofill	../os/os_fzero.c	/^__os_zerofill(dbenv, fhp)$/
+__pgno_cmp	../mp/mp_mvcc.c	/^__pgno_cmp(a, b)$/
 __qam_31_qammeta	../qam/qam_upgrade.c	/^__qam_31_qammeta(dbp, real_name, buf)$/
 __qam_32_qammeta	../qam/qam_upgrade.c	/^__qam_32_qammeta(dbp, real_name, buf)$/
-__qam_add_log	../qam/qam_auto.c	/^__qam_add_log(dbp, txnid, ret_lsnp, flags, lsn, pg/
+__qam_add_log	../qam/qam_auto.c	/^__qam_add_log(dbp, txnp, ret_lsnp, flags, lsn, pgn/
 __qam_add_print	../qam/qam_autop.c	/^__qam_add_print(dbenv, dbtp, lsnp, notused2, notus/
 __qam_add_read	../qam/qam_auto.c	/^__qam_add_read(dbenv, recbuf, argpp)$/
 __qam_add_recover	../qam/qam_rec.c	/^__qam_add_recover(dbenv, dbtp, lsnp, op, info)$/
@@ -3716,25 +4006,27 @@ __qam_c_put	../qam/qam.c	/^__qam_c_put(dbc, key, data, flags, pgnop)$/
 __qam_consume	../qam/qam.c	/^__qam_consume(dbc, meta, first)$/
 __qam_db_close	../qam/qam_method.c	/^__qam_db_close(dbp, flags)$/
 __qam_db_create	../qam/qam_method.c	/^__qam_db_create(dbp)$/
-__qam_del_log	../qam/qam_auto.c	/^__qam_del_log(dbp, txnid, ret_lsnp, flags, lsn, pg/
+__qam_del_log	../qam/qam_auto.c	/^__qam_del_log(dbp, txnp, ret_lsnp, flags, lsn, pgn/
 __qam_del_print	../qam/qam_autop.c	/^__qam_del_print(dbenv, dbtp, lsnp, notused2, notus/
 __qam_del_read	../qam/qam_auto.c	/^__qam_del_read(dbenv, recbuf, argpp)$/
 __qam_del_recover	../qam/qam_rec.c	/^__qam_del_recover(dbenv, dbtp, lsnp, op, info)$/
-__qam_delext_log	../qam/qam_auto.c	/^__qam_delext_log(dbp, txnid, ret_lsnp, flags, lsn,/
+__qam_delete	../qam/qam.c	/^__qam_delete(dbc, key)$/
+__qam_delext_log	../qam/qam_auto.c	/^__qam_delext_log(dbp, txnp, ret_lsnp, flags, lsn, /
 __qam_delext_print	../qam/qam_autop.c	/^__qam_delext_print(dbenv, dbtp, lsnp, notused2, no/
 __qam_delext_read	../qam/qam_auto.c	/^__qam_delext_read(dbenv, recbuf, argpp)$/
 __qam_delext_recover	../qam/qam_rec.c	/^__qam_delext_recover(dbenv, dbtp, lsnp, op, info)$/
+__qam_dirty	../dbinc/qam.h	/^#define	__qam_dirty(dbp, pgno, pagep, lsnp, flags)/
 __qam_exid	../qam/qam_files.c	/^__qam_exid(dbp, fidp, exnum)$/
 __qam_extent_names	../qam/qam_files.c	/^__qam_extent_names(dbenv, name, namelistp)$/
 __qam_fclose	../qam/qam_files.c	/^__qam_fclose(dbp, pgnoaddr)$/
-__qam_fget	../dbinc/qam.h	/^#define	__qam_fget(dbp, pgnoaddr, flags, addrp) \\$/
-__qam_fprobe	../qam/qam_files.c	/^__qam_fprobe(dbp, pgno, addrp, mode, flags)$/
-__qam_fput	../dbinc/qam.h	/^#define	__qam_fput(dbp, pageno, addrp, flags) \\$/
+__qam_fget	../dbinc/qam.h	/^#define	__qam_fget(dbp, pgnoaddr, lsnp, flags, add/
+__qam_fprobe	../qam/qam_files.c	/^__qam_fprobe(dbp, pgno, txn, addrp, mode, flags)$/
+__qam_fput	../dbinc/qam.h	/^#define	__qam_fput(dbp, pgno, addrp, flags) \\$/
 __qam_fremove	../qam/qam_files.c	/^__qam_fremove(dbp, pgnoaddr)$/
 __qam_gen_filelist	../qam/qam_files.c	/^__qam_gen_filelist(dbp, filelistp)$/
 __qam_get_extentsize	../qam/qam_method.c	/^__qam_get_extentsize(dbp, q_extentsizep)$/
 __qam_getno	../qam/qam.c	/^__qam_getno(dbp, key, rep)$/
-__qam_incfirst_log	../qam/qam_auto.c	/^__qam_incfirst_log(dbp, txnid, ret_lsnp, flags, re/
+__qam_incfirst_log	../qam/qam_auto.c	/^__qam_incfirst_log(dbp, txnp, ret_lsnp, flags, rec/
 __qam_incfirst_print	../qam/qam_autop.c	/^__qam_incfirst_print(dbenv, dbtp, lsnp, notused2, /
 __qam_incfirst_read	../qam/qam_auto.c	/^__qam_incfirst_read(dbenv, recbuf, argpp)$/
 __qam_incfirst_recover	../qam/qam_rec.c	/^__qam_incfirst_recover(dbenv, dbtp, lsnp, op, info/
@@ -3744,7 +4036,7 @@ __qam_init_recover	../qam/qam_auto.c	/^__qam_init_recover(dbenv, dtabp, dtabsize
 __qam_map_flags	../qam/qam_method.c	/^__qam_map_flags(dbp, inflagsp, outflagsp)$/
 __qam_metachk	../qam/qam_open.c	/^__qam_metachk(dbp, name, qmeta)$/
 __qam_mswap	../qam/qam_conv.c	/^__qam_mswap(pg)$/
-__qam_mvptr_log	../qam/qam_auto.c	/^__qam_mvptr_log(dbp, txnid, ret_lsnp, flags,$/
+__qam_mvptr_log	../qam/qam_auto.c	/^__qam_mvptr_log(dbp, txnp, ret_lsnp, flags,$/
 __qam_mvptr_print	../qam/qam_autop.c	/^__qam_mvptr_print(dbenv, dbtp, lsnp, notused2, not/
 __qam_mvptr_read	../qam/qam_auto.c	/^__qam_mvptr_read(dbenv, recbuf, argpp)$/
 __qam_mvptr_recover	../qam/qam_rec.c	/^__qam_mvptr_recover(dbenv, dbtp, lsnp, op, info)$/
@@ -3753,7 +4045,7 @@ __qam_new_file	../qam/qam_open.c	/^__qam_new_file(dbp, txn, fhp, name)$/
 __qam_open	../qam/qam_open.c	/^__qam_open(dbp, txn, name, base_pgno, mode, flags)/
 __qam_pgin_out	../qam/qam_conv.c	/^__qam_pgin_out(dbenv, pg, pp, cookie)$/
 __qam_pitem	../qam/qam.c	/^__qam_pitem(dbc, pagep, indx, recno, data)$/
-__qam_position	../qam/qam.c	/^__qam_position(dbc, recnop, mode, exactp)$/
+__qam_position	../qam/qam.c	/^__qam_position(dbc, recnop, lock_mode, get_mode, e/
 __qam_remove	../qam/qam_method.c	/^__qam_remove(dbp, txn, name, subdb)$/
 __qam_rename	../qam/qam_method.c	/^__qam_rename(dbp, txn, name, subdb, newname)$/
 __qam_rr	../qam/qam_method.c	/^__qam_rr(dbp, txn, name, subdb, newname, op)$/
@@ -3770,14 +4062,18 @@ __qam_vrfy_data	../qam/qam_verify.c	/^__qam_vrfy_data(dbp, vdp, h, pgno, flags)$
 __qam_vrfy_meta	../qam/qam_verify.c	/^__qam_vrfy_meta(dbp, vdp, meta, pgno, flags)$/
 __qam_vrfy_structure	../qam/qam_verify.c	/^__qam_vrfy_structure(dbp, vdp, flags)$/
 __qam_vrfy_walkqueue	../qam/qam_verify.c	/^__qam_vrfy_walkqueue(dbp, vdp, handle, callback, f/
+__qcursor	../dbinc/qam.h	/^struct __qcursor {$/
+__qmpf	../dbinc/qam.h	/^	struct __qmpf {$/
+__queue	../dbinc/qam.h	/^struct __queue {$/
 __queue_pageinfo	../qam/qam_method.c	/^__queue_pageinfo(dbp, firstp, lastp, emptyp, prpag/
+__queued_output	../dbinc/repmgr.h	/^struct __queued_output {$/
 __ram_add	../btree/bt_recno.c	/^__ram_add(dbc, recnop, data, flags, bi_flags)$/
 __ram_append	../btree/bt_recno.c	/^__ram_append(dbc, key, data)$/
 __ram_c_del	../btree/bt_recno.c	/^__ram_c_del(dbc)$/
 __ram_c_get	../btree/bt_recno.c	/^__ram_c_get(dbc, key, data, flags, pgnop)$/
 __ram_c_put	../btree/bt_recno.c	/^__ram_c_put(dbc, key, data, flags, pgnop)$/
-__ram_ca	../btree/bt_recno.c	/^__ram_ca(dbc_arg, op)$/
-__ram_ca_delete	../btree/bt_curadj.c	/^__ram_ca_delete(dbp, root_pgno)$/
+__ram_ca	../btree/bt_recno.c	/^__ram_ca(dbc_arg, op, foundp)$/
+__ram_ca_delete	../btree/bt_curadj.c	/^__ram_ca_delete(dbp, root_pgno, foundp)$/
 __ram_get_re_delim	../btree/bt_method.c	/^__ram_get_re_delim(dbp, re_delimp)$/
 __ram_get_re_len	../btree/bt_method.c	/^__ram_get_re_len(dbp, re_lenp)$/
 __ram_get_re_pad	../btree/bt_method.c	/^__ram_get_re_pad(dbp, re_padp)$/
@@ -3799,85 +4095,209 @@ __ram_vrfy_leaf	../btree/bt_verify.c	/^__ram_vrfy_leaf(dbp, vdp, h, pgno, flags)
 __ram_writeback	../btree/bt_recno.c	/^__ram_writeback(dbp)$/
 __reg_type	../env/env_stat.c	/^__reg_type(t)$/
 __rep_abort_prepared	../rep/rep_method.c	/^__rep_abort_prepared(dbenv)$/
-__rep_apply	../rep/rep_record.c	/^__rep_apply(dbenv, rp, rec, ret_lsnp, is_dupp)$/
+__rep_allreq	../rep/rep_log.c	/^__rep_allreq(dbenv, rp, eid)$/
+__rep_apply	../rep/rep_record.c	/^__rep_apply(dbenv, rp, rec, ret_lsnp, is_dupp, las/
 __rep_bt_cmp	../rep/rep_method.c	/^__rep_bt_cmp(dbp, dbt1, dbt2)$/
+__rep_bulk_alloc	../rep/rep_util.c	/^__rep_bulk_alloc(dbenv, bulkp, eid, offp, flagsp, /
+__rep_bulk_free	../rep/rep_util.c	/^__rep_bulk_free(dbenv, bulkp, flags)$/
+__rep_bulk_log	../rep/rep_log.c	/^__rep_bulk_log(dbenv, rp, rec, savetime, ret_lsnp)/
+__rep_bulk_message	../rep/rep_util.c	/^__rep_bulk_message(dbenv, bulk, repth, lsn, dbt, f/
+__rep_bulk_page	../rep/rep_backup.c	/^__rep_bulk_page(dbenv, eid, rp, rec)$/
 __rep_check_doreq	../rep/rep_record.c	/^__rep_check_doreq(dbenv, rep)$/
+__rep_check_uid	../rep/rep_backup.c	/^__rep_check_uid(dbenv, fp, endfp, uid)$/
+__rep_chk_newfile	../rep/rep_log.c	/^__rep_chk_newfile(dbenv, logc, rep, rp, eid)$/
 __rep_client_dbinit	../rep/rep_method.c	/^__rep_client_dbinit(dbenv, startup, which)$/
-__rep_cmp_vote	../rep/rep_record.c	/^__rep_cmp_vote(dbenv, rep, eidp, lsnp, priority, g/
-__rep_cmp_vote2	../rep/rep_record.c	/^__rep_cmp_vote2(dbenv, rep, eid, egen)$/
+__rep_close	../rep/rep_region.c	/^__rep_close(dbenv)$/
+__rep_closefiles	../rep/rep_region.c	/^__rep_closefiles(dbenv)$/
+__rep_cmp_vote	../rep/rep_elect.c	/^__rep_cmp_vote(dbenv, rep, eid, lsnp, priority, ge/
 __rep_collect_txn	../rep/rep_record.c	/^__rep_collect_txn(dbenv, lsnp, lc)$/
-__rep_dbenv_close	../rep/rep_region.c	/^__rep_dbenv_close(dbenv)$/
+__rep_config_map	../rep/rep_method.c	/^__rep_config_map(dbenv, inflagsp, outflagsp)$/
+__rep_conv_vers	../rep/rep_method.c	/^__rep_conv_vers(dbenv, log_ver)$/
 __rep_dbenv_create	../rep/rep_method.c	/^__rep_dbenv_create(dbenv)$/
+__rep_dbenv_destroy	../rep/rep_method.c	/^__rep_dbenv_destroy(dbenv)$/
 __rep_dbenv_refresh	../rep/rep_region.c	/^__rep_dbenv_refresh(dbenv)$/
 __rep_do_ckp	../rep/rep_record.c	/^__rep_do_ckp(dbenv, rec, rp)$/
-__rep_dorecovery	../rep/rep_record.c	/^__rep_dorecovery(dbenv, lsnp, trunclsnp)$/
+__rep_dorecovery	../rep/rep_verify.c	/^__rep_dorecovery(dbenv, lsnp, trunclsnp)$/
 __rep_egen_init	../rep/rep_region.c	/^__rep_egen_init(dbenv, rep)$/
-__rep_elect	../rep/rep_method.c	/^__rep_elect(dbenv, nsites, nvotes, priority, timeo/
+__rep_elect	../rep/rep_elect.c	/^__rep_elect(dbenv, given_nsites, nvotes, eidp, fla/
 __rep_elect_done	../rep/rep_util.c	/^__rep_elect_done(dbenv, rep)$/
-__rep_elect_init	../rep/rep_method.c	/^__rep_elect_init(dbenv, lsnp, nsites, nvotes, prio/
-__rep_elect_master	../rep/rep_method.c	/^__rep_elect_master(dbenv, rep, eidp)$/
+__rep_elect_init	../rep/rep_elect.c	/^__rep_elect_init(dbenv, lsnp, nsites, nvotes, begi/
+__rep_elect_master	../rep/rep_elect.c	/^__rep_elect_master(dbenv, rep, eidp)$/
 __rep_filedone	../rep/rep_backup.c	/^__rep_filedone(dbenv, eid, rep, msgfp, type)$/
 __rep_fileinfo_buf	../rep/rep_auto.c	/^__rep_fileinfo_buf(buf, max, lenp,$/
 __rep_fileinfo_read	../rep/rep_auto.c	/^__rep_fileinfo_read(dbenv, recbuf, nextp, argpp)$/
-__rep_files_data	../rep/rep_backup.c	/^__rep_files_data(dbenv, fp, fileszp, filelenp, fil/
-__rep_files_inmem	../rep/rep_backup.c	/^__rep_files_inmem(dbenv, fp, fileszp, filelenp, fi/
+__rep_find_dbs	../rep/rep_backup.c	/^__rep_find_dbs(dbenv, fp, fileszp, filelenp, filec/
 __rep_finfo_alloc	../rep/rep_backup.c	/^__rep_finfo_alloc(dbenv, rfpsrc, rfpp)$/
 __rep_flush	../rep/rep_method.c	/^__rep_flush(dbenv)$/
-__rep_get_fileinfo	../rep/rep_backup.c	/^__rep_get_fileinfo(dbenv, file, rfp, uid, filecntp/
+__rep_get_config	../rep/rep_method.c	/^__rep_get_config(dbenv, which, onp)$/
+__rep_get_fileinfo	../rep/rep_backup.c	/^__rep_get_fileinfo(dbenv, file, subdb, rfp, uid, f/
 __rep_get_gen	../rep/rep_util.c	/^__rep_get_gen(dbenv, genp)$/
 __rep_get_limit	../rep/rep_method.c	/^__rep_get_limit(dbenv, gbytesp, bytesp)$/
+__rep_get_nsites	../rep/rep_method.c	/^__rep_get_nsites(dbenv, n)$/
+__rep_get_priority	../rep/rep_method.c	/^__rep_get_priority(dbenv, priority)$/
+__rep_get_request	../rep/rep_method.c	/^__rep_get_request(dbenv, minp, maxp)$/
+__rep_get_timeout	../rep/rep_method.c	/^__rep_get_timeout(dbenv, which, timeout)$/
 __rep_getnext	../rep/rep_record.c	/^__rep_getnext(dbenv)$/
 __rep_grow_sites	../rep/rep_util.c	/^__rep_grow_sites(dbenv, nsites)$/
-__rep_is_client	../rep/rep_util.c	/^__rep_is_client(dbenv)$/
-__rep_lockout	../rep/rep_record.c	/^__rep_lockout(dbenv, db_rep, rep, msg_th)$/
+__rep_init_cleanup	../rep/rep_backup.c	/^__rep_init_cleanup(dbenv, rep, force)$/
+__rep_lockout_api	../rep/rep_util.c	/^__rep_lockout_api(dbenv, rep)$/
+__rep_lockout_msg	../rep/rep_util.c	/^__rep_lockout_msg(dbenv, rep, msg_th)$/
+__rep_log	../rep/rep_log.c	/^__rep_log(dbenv, rp, rec, savetime, ret_lsnp)$/
+__rep_log_backup	../rep/rep_verify.c	/^__rep_log_backup(dbenv, rep, logc, lsn)$/
 __rep_log_setup	../rep/rep_backup.c	/^__rep_log_setup(dbenv, rep)$/
-__rep_loggap_req	../rep/rep_backup.c	/^__rep_loggap_req(dbenv, rep, lsnp, moregap)$/
+__rep_loggap_req	../rep/rep_log.c	/^__rep_loggap_req(dbenv, rep, lsnp, gapflags)$/
+__rep_logready	../rep/rep_log.c	/^__rep_logready(dbenv, rep, savetime, last_lsnp)$/
+__rep_logreq	../rep/rep_log.c	/^__rep_logreq(dbenv, rp, rec, eid)$/
 __rep_lsn_cmp	../rep/rep_record.c	/^__rep_lsn_cmp(lsn1, lsn2)$/
-__rep_mpf_open	../rep/rep_backup.c	/^__rep_mpf_open(dbenv, mpfp, rfp)$/
+__rep_mpf_open	../rep/rep_backup.c	/^__rep_mpf_open(dbenv, mpfp, rfp, flags)$/
+__rep_msg_from_old	../rep/rep_util.c	/^__rep_msg_from_old(version, rectype)$/
+__rep_msg_to_old	../rep/rep_util.c	/^__rep_msg_to_old(version, rectype)$/
 __rep_new_master	../rep/rep_util.c	/^__rep_new_master(dbenv, cntrl, eid)$/
-__rep_newfile	../rep/rep_record.c	/^__rep_newfile(dbenv, rc, lsnp)$/
+__rep_newfile	../rep/rep_record.c	/^__rep_newfile(dbenv, rc, rec, lsnp)$/
+__rep_newmaster_empty	../rep/rep_util.c	/^__rep_newmaster_empty(dbenv, lsnp, cntrl, eid)$/
 __rep_noarchive	../rep/rep_util.c	/^__rep_noarchive(dbenv)$/
-__rep_open	../rep/rep_method.c	/^__rep_open(dbenv)$/
+__rep_open	../rep/rep_region.c	/^__rep_open(dbenv)$/
 __rep_page	../rep/rep_backup.c	/^__rep_page(dbenv, eid, rp, rec)$/
 __rep_page_fail	../rep/rep_backup.c	/^__rep_page_fail(dbenv, eid, rec)$/
 __rep_page_gap	../rep/rep_backup.c	/^__rep_page_gap(dbenv, rep, msgfp, type)$/
 __rep_page_req	../rep/rep_backup.c	/^__rep_page_req(dbenv, eid, rec)$/
 __rep_page_sendpages	../rep/rep_backup.c	/^__rep_page_sendpages(dbenv, eid, msgfp, mpf, dbp)$/
-__rep_pggap_req	../rep/rep_backup.c	/^__rep_pggap_req(dbenv, rep, reqfp, moregap)$/
-__rep_preclose	../rep/rep_region.c	/^__rep_preclose(dbenv, do_closefiles)$/
+__rep_pggap_req	../rep/rep_backup.c	/^__rep_pggap_req(dbenv, rep, reqfp, gapflags)$/
+__rep_preclose	../rep/rep_region.c	/^__rep_preclose(dbenv)$/
 __rep_print_all	../rep/rep_stat.c	/^__rep_print_all(dbenv, flags)$/
 __rep_print_logmsg	../rep/rep_util.c	/^__rep_print_logmsg(dbenv, logdbt, lsnp)$/
-__rep_print_message	../rep/rep_util.c	/^__rep_print_message(dbenv, eid, rp, str)$/
+__rep_print_message	../rep/rep_util.c	/^__rep_print_message(dbenv, eid, rp, str, flags)$/
 __rep_print_stats	../rep/rep_stat.c	/^__rep_print_stats(dbenv, flags)$/
 __rep_process_message	../rep/rep_record.c	/^__rep_process_message(dbenv, control, rec, eidp, r/
 __rep_process_rec	../rep/rep_record.c	/^__rep_process_rec(dbenv, rp, rec, typep, ret_lsnp)/
 __rep_process_txn	../rep/rep_record.c	/^__rep_process_txn(dbenv, rec)$/
 __rep_queue_filedone	../rep/rep_backup.c	/^__rep_queue_filedone(dbenv, rep, rfp)$/
 __rep_region_destroy	../rep/rep_region.c	/^__rep_region_destroy(dbenv)$/
-__rep_region_init	../rep/rep_region.c	/^__rep_region_init(dbenv)$/
 __rep_remfirst	../rep/rep_record.c	/^__rep_remfirst(dbenv, cntrl, rec)$/
-__rep_resend_req	../rep/rep_record.c	/^__rep_resend_req(dbenv, eid)$/
+__rep_remove_dbs	../rep/rep_backup.c	/^__rep_remove_dbs(dbenv)$/
+__rep_remove_logs	../rep/rep_backup.c	/^__rep_remove_logs(dbenv)$/
+__rep_resend_req	../rep/rep_record.c	/^__rep_resend_req(dbenv, rereq)$/
 __rep_restore_prepared	../rep/rep_method.c	/^__rep_restore_prepared(dbenv)$/
-__rep_send_message	../rep/rep_util.c	/^__rep_send_message(dbenv, eid, rtype, lsnp, dbtp, /
+__rep_send_bulk	../rep/rep_util.c	/^__rep_send_bulk(dbenv, bulkp, ctlflags)$/
+__rep_send_message	../rep/rep_util.c	/^__rep_send_message(dbenv, eid, rtype, lsnp, dbt, c/
+__rep_send_throttle	../rep/rep_util.c	/^__rep_send_throttle(dbenv, eid, repth, flags)$/
 __rep_send_vote	../rep/rep_util.c	/^__rep_send_vote(dbenv, lsnp, nsites, nvotes, pri, /
+__rep_set_config	../rep/rep_method.c	/^__rep_set_config(dbenv, which, on)$/
 __rep_set_limit	../rep/rep_method.c	/^__rep_set_limit(dbenv, gbytes, bytes)$/
-__rep_set_rep_transport	../rep/rep_method.c	/^__rep_set_rep_transport(dbenv, eid, f_send)$/
+__rep_set_nsites	../rep/rep_method.c	/^__rep_set_nsites(dbenv, n)$/
+__rep_set_priority	../rep/rep_method.c	/^__rep_set_priority(dbenv, priority)$/
 __rep_set_request	../rep/rep_method.c	/^__rep_set_request(dbenv, min, max)$/
+__rep_set_timeout	../rep/rep_method.c	/^__rep_set_timeout(dbenv, which, timeout)$/
+__rep_set_transport	../rep/rep_method.c	/^__rep_set_transport(dbenv, eid, f_send)$/
+__rep_skip_msg	../rep/rep_record.c	/^__rep_skip_msg(dbenv, rep, eid, rectype)$/
 __rep_start	../rep/rep_method.c	/^__rep_start(dbenv, dbt, flags)$/
 __rep_stat	../rep/rep_stat.c	/^__rep_stat(dbenv, statp, flags)$/
 __rep_stat_pp	../rep/rep_stat.c	/^__rep_stat_pp(dbenv, statp, flags)$/
 __rep_stat_print	../rep/rep_stat.c	/^__rep_stat_print(dbenv, flags)$/
 __rep_stat_print_pp	../rep/rep_stat.c	/^__rep_stat_print_pp(dbenv, flags)$/
-__rep_tally	../rep/rep_record.c	/^__rep_tally(dbenv, rep, eid, countp, egen, vtoff)$/
+__rep_sync	../rep/rep_method.c	/^__rep_sync(dbenv, flags)$/
+__rep_tally	../rep/rep_elect.c	/^__rep_tally(dbenv, rep, eid, countp, egen, vtoff)$/
 __rep_update_buf	../rep/rep_auto.c	/^__rep_update_buf(buf, max, lenp,$/
 __rep_update_read	../rep/rep_auto.c	/^__rep_update_read(dbenv, recbuf, nextp, argpp)$/
 __rep_update_req	../rep/rep_backup.c	/^__rep_update_req(dbenv, eid)$/
 __rep_update_setup	../rep/rep_backup.c	/^__rep_update_setup(dbenv, eid, rp, rec)$/
-__rep_verify_match	../rep/rep_record.c	/^__rep_verify_match(dbenv, reclsnp, savetime)$/
-__rep_wait	../rep/rep_method.c	/^__rep_wait(dbenv, timeout, eidp, flags)$/
-__rep_walk_dir	../rep/rep_backup.c	/^__rep_walk_dir(dbenv, dir, fp, fileszp, filelenp, /
+__rep_verify	../rep/rep_verify.c	/^__rep_verify(dbenv, rp, rec, eid, savetime)$/
+__rep_verify_fail	../rep/rep_verify.c	/^__rep_verify_fail(dbenv, rp, eid)$/
+__rep_verify_match	../rep/rep_verify.c	/^__rep_verify_match(dbenv, reclsnp, savetime)$/
+__rep_verify_req	../rep/rep_verify.c	/^__rep_verify_req(dbenv, rp, eid)$/
+__rep_vote1	../rep/rep_elect.c	/^__rep_vote1(dbenv, rp, rec, eidp)$/
+__rep_vote2	../rep/rep_elect.c	/^__rep_vote2(dbenv, rec, eidp)$/
+__rep_wait	../rep/rep_elect.c	/^__rep_wait(dbenv, timeout, eidp, flags)$/
+__rep_walk_dir	../rep/rep_backup.c	/^__rep_walk_dir(dbenv, dir, fp, origfp, fileszp, fi/
 __rep_write_egen	../rep/rep_region.c	/^__rep_write_egen(dbenv, egen)$/
 __rep_write_page	../rep/rep_backup.c	/^__rep_write_page(dbenv, rep, msgfp)$/
+__repmgr_accept	../repmgr/repmgr_sel.c	/^__repmgr_accept(dbenv)$/
+__repmgr_add_buffer	../repmgr/repmgr_util.c	/^__repmgr_add_buffer(v, address, length)$/
+__repmgr_add_dbt	../repmgr/repmgr_util.c	/^__repmgr_add_dbt(v, dbt)$/
+__repmgr_add_remote_site	../repmgr/repmgr_method.c	/^__repmgr_add_remote_site(dbenv, host, port, eidp, /
+__repmgr_add_site	../repmgr/repmgr_net.c	/^__repmgr_add_site(dbenv, host, port, newsitep)$/
+__repmgr_available_site	../repmgr/repmgr_net.c	/^__repmgr_available_site(dbenv, eid)$/
+__repmgr_await_ack	../repmgr/repmgr_posix.c	/^__repmgr_await_ack(dbenv, lsnp)$/
+__repmgr_await_threads	../repmgr/repmgr_method.c	/^__repmgr_await_threads(dbenv)$/
+__repmgr_become_master	../repmgr/repmgr_elect.c	/^__repmgr_become_master(dbenv)$/
+__repmgr_bust_connection	../repmgr/repmgr_net.c	/^__repmgr_bust_connection(dbenv, conn, do_close)$/
+__repmgr_cleanup_connection	../repmgr/repmgr_net.c	/^__repmgr_cleanup_connection(dbenv, conn)$/
+__repmgr_cleanup_netaddr	../repmgr/repmgr_util.c	/^__repmgr_cleanup_netaddr(dbenv, addr)$/
+__repmgr_close	../repmgr/repmgr_method.c	/^__repmgr_close(dbenv)$/
+__repmgr_close_sync	../repmgr/repmgr_posix.c	/^__repmgr_close_sync(dbenv)$/
+__repmgr_compute_wait_deadline	../repmgr/repmgr_posix.c	/^__repmgr_compute_wait_deadline(dbenv, result, wait/
+__repmgr_connect	../repmgr/repmgr_sel.c	/^__repmgr_connect(dbenv, socket_result, site)$/
+__repmgr_connect_site	../repmgr/repmgr_sel.c	/^__repmgr_connect_site(dbenv, eid)$/
+__repmgr_connection	../dbinc/repmgr.h	/^struct __repmgr_connection {$/
+__repmgr_dbenv_create	../repmgr/repmgr_method.c	/^__repmgr_dbenv_create(dbenv, db_rep)$/
+__repmgr_dbenv_destroy	../repmgr/repmgr_method.c	/^__repmgr_dbenv_destroy(dbenv, db_rep)$/
+__repmgr_elect_main	../repmgr/repmgr_elect.c	/^__repmgr_elect_main(dbenv)$/
+__repmgr_elect_thread	../repmgr/repmgr_elect.c	/^__repmgr_elect_thread(args)$/
+__repmgr_find_site	../repmgr/repmgr_net.c	/^__repmgr_find_site(dbenv, host, port)$/
+__repmgr_first_try_connections	../repmgr/repmgr_sel.c	/^__repmgr_first_try_connections(dbenv)$/
+__repmgr_format_eid_loc	../repmgr/repmgr_util.c	/^__repmgr_format_eid_loc(db_rep, eid, buffer)$/
+__repmgr_format_site_loc	../repmgr/repmgr_util.c	/^__repmgr_format_site_loc(site, buffer)$/
+__repmgr_get_ack_policy	../repmgr/repmgr_method.c	/^__repmgr_get_ack_policy(dbenv, policy)$/
+__repmgr_get_nsites	../repmgr/repmgr_util.c	/^__repmgr_get_nsites(db_rep)$/
+__repmgr_getaddr	../repmgr/repmgr_net.c	/^__repmgr_getaddr(dbenv, host, port, flags, result)/
+__repmgr_init_election	../repmgr/repmgr_elect.c	/^__repmgr_init_election(dbenv, initial_operation)$/
+__repmgr_init_sync	../repmgr/repmgr_posix.c	/^__repmgr_init_sync(dbenv, db_rep)$/
+__repmgr_iovec_init	../repmgr/repmgr_util.c	/^__repmgr_iovec_init(v)$/
+__repmgr_is_permanent	../repmgr/repmgr_net.c	/^__repmgr_is_permanent(dbenv, lsnp)$/
+__repmgr_is_ready	../repmgr/repmgr_elect.c	/^__repmgr_is_ready(dbenv)$/
+__repmgr_listen	../repmgr/repmgr_net.c	/^__repmgr_listen(dbenv)$/
+__repmgr_lock_mutex	../repmgr/repmgr_posix.c	/^__repmgr_lock_mutex(mutex)$/
+__repmgr_msg_thread	../repmgr/repmgr_msg.c	/^__repmgr_msg_thread(args)$/
+__repmgr_net_close	../repmgr/repmgr_net.c	/^__repmgr_net_close(dbenv)$/
+__repmgr_net_create	../repmgr/repmgr_net.c	/^__repmgr_net_create(dbenv, db_rep)$/
+__repmgr_net_destroy	../repmgr/repmgr_net.c	/^__repmgr_net_destroy(dbenv, db_rep)$/
+__repmgr_net_init	../repmgr/repmgr_posix.c	/^__repmgr_net_init(dbenv, db_rep)$/
+__repmgr_new_connection	../repmgr/repmgr_util.c	/^__repmgr_new_connection(dbenv, connp, s, flags)$/
+__repmgr_new_site	../repmgr/repmgr_util.c	/^__repmgr_new_site(dbenv, sitep, addr, state)$/
+__repmgr_pack_netaddr	../repmgr/repmgr_net.c	/^__repmgr_pack_netaddr(dbenv, host, port, list, add/
+__repmgr_prepare_my_addr	../repmgr/repmgr_util.c	/^__repmgr_prepare_my_addr(dbenv, dbt)$/
+__repmgr_print_stats	../repmgr/repmgr_stat.c	/^__repmgr_print_stats(dbenv)$/
+__repmgr_queue_create	../repmgr/repmgr_queue.c	/^__repmgr_queue_create(dbenv, db_rep)$/
+__repmgr_queue_destroy	../repmgr/repmgr_queue.c	/^__repmgr_queue_destroy(dbenv)$/
+__repmgr_queue_get	../repmgr/repmgr_queue.c	/^__repmgr_queue_get(dbenv, msgp)$/
+__repmgr_queue_put	../repmgr/repmgr_queue.c	/^__repmgr_queue_put(dbenv, msg)$/
+__repmgr_queue_size	../repmgr/repmgr_queue.c	/^__repmgr_queue_size(dbenv)$/
+__repmgr_read_from_site	../repmgr/repmgr_sel.c	/^__repmgr_read_from_site(dbenv, conn)$/
+__repmgr_readv	../repmgr/repmgr_posix.c	/^__repmgr_readv(fd, iovec, buf_count, byte_count_p)/
+__repmgr_reset_for_reading	../repmgr/repmgr_util.c	/^__repmgr_reset_for_reading(con)$/
+__repmgr_retry	../dbinc/repmgr.h	/^struct __repmgr_retry {$/
+__repmgr_retry_connections	../repmgr/repmgr_sel.c	/^__repmgr_retry_connections(dbenv)$/
+__repmgr_runnable	../dbinc/repmgr.h	/^struct __repmgr_runnable {$/
+__repmgr_schedule_connection_attempt	../repmgr/repmgr_util.c	/^__repmgr_schedule_connection_attempt(dbenv, eid, i/
+__repmgr_select_loop	../repmgr/repmgr_posix.c	/^__repmgr_select_loop(dbenv)$/
+__repmgr_select_thread	../repmgr/repmgr_sel.c	/^__repmgr_select_thread(args)$/
+__repmgr_send	../repmgr/repmgr_net.c	/^__repmgr_send(dbenv, control, rec, lsnp, eid, flag/
+__repmgr_send_broadcast	../repmgr/repmgr_net.c	/^__repmgr_send_broadcast(dbenv, control, rec, nsite/
+__repmgr_send_handshake	../repmgr/repmgr_sel.c	/^__repmgr_send_handshake(dbenv, conn)$/
+__repmgr_send_internal	../repmgr/repmgr_net.c	/^__repmgr_send_internal(dbenv, conn, msg)$/
+__repmgr_send_one	../repmgr/repmgr_net.c	/^__repmgr_send_one(dbenv, conn, msg_type, control, /
+__repmgr_set_ack_policy	../repmgr/repmgr_method.c	/^__repmgr_set_ack_policy(dbenv, policy)$/
+__repmgr_set_local_site	../repmgr/repmgr_method.c	/^__repmgr_set_local_site(dbenv, host, port, flags)$/
+__repmgr_set_nonblocking	../repmgr/repmgr_posix.c	/^int __repmgr_set_nonblocking(fd)$/
+__repmgr_signal	../repmgr/repmgr_posix.c	/^__repmgr_signal(v)$/
+__repmgr_site	../dbinc/repmgr.h	/^struct __repmgr_site {$/
+__repmgr_site_list	../repmgr/repmgr_stat.c	/^__repmgr_site_list(dbenv, countp, listp)$/
+__repmgr_start	../repmgr/repmgr_method.c	/^__repmgr_start(dbenv, nthreads, flags)$/
+__repmgr_stash_generation	../repmgr/repmgr_msg.c	/^__repmgr_stash_generation(dbenv)$/
+__repmgr_stop_threads	../repmgr/repmgr_method.c	/^__repmgr_stop_threads(dbenv)$/
+__repmgr_thread_failure	../repmgr/repmgr_util.c	/^__repmgr_thread_failure(dbenv, why)$/
+__repmgr_thread_join	../repmgr/repmgr_posix.c	/^__repmgr_thread_join(thread)$/
+__repmgr_thread_start	../repmgr/repmgr_posix.c	/^__repmgr_thread_start(dbenv, runnable)$/
+__repmgr_timeval_cmp	../repmgr/repmgr_util.c	/^__repmgr_timeval_cmp(a, b)$/
+__repmgr_timeval_diff_current	../repmgr/repmgr_posix.c	/^__repmgr_timeval_diff_current(dbenv, when, result)/
+__repmgr_unlock_mutex	../repmgr/repmgr_posix.c	/^__repmgr_unlock_mutex(mutex)$/
+__repmgr_update_consumed	../repmgr/repmgr_util.c	/^__repmgr_update_consumed(v, byte_count)$/
+__repmgr_wake_main_thread	../repmgr/repmgr_posix.c	/^__repmgr_wake_main_thread(dbenv)$/
+__repmgr_wake_waiting_senders	../repmgr/repmgr_posix.c	/^__repmgr_wake_waiting_senders(dbenv)$/
+__repmgr_write_some	../repmgr/repmgr_sel.c	/^__repmgr_write_some(dbenv, conn)$/
+__repmgr_writev	../repmgr/repmgr_posix.c	/^__repmgr_writev(fd, iovec, buf_count, byte_count_p/
+__repmgr_wsa_init	../repmgr/repmgr_windows.c	/^__repmgr_wsa_init(dbenv)$/
+__seq_chk_cachesize	../sequence/sequence.c	/^__seq_chk_cachesize(dbenv, cachesize, max, min)$/
 __seq_close	../sequence/sequence.c	/^__seq_close(seq, flags)$/
 __seq_get	../sequence/sequence.c	/^__seq_get(seq, txn, delta, retp, flags)$/
 __seq_get_cachesize	../sequence/sequence.c	/^__seq_get_cachesize(seq, cachesize)$/
@@ -3886,7 +4306,7 @@ __seq_get_flags	../sequence/sequence.c	/^__seq_get_flags(seq, flagsp)$/
 __seq_get_key	../sequence/sequence.c	/^__seq_get_key(seq, key)$/
 __seq_get_range	../sequence/sequence.c	/^__seq_get_range(seq, minp, maxp)$/
 __seq_initial_value	../sequence/sequence.c	/^__seq_initial_value(seq, value)$/
-__seq_open	../sequence/sequence.c	/^__seq_open(seq, txn, keyp, flags)$/
+__seq_open_pp	../sequence/sequence.c	/^__seq_open_pp(seq, txn, keyp, flags)$/
 __seq_print_all	../sequence/seq_stat.c	/^__seq_print_all(seq, flags)$/
 __seq_print_stats	../sequence/seq_stat.c	/^__seq_print_stats(seq, flags)$/
 __seq_remove	../sequence/sequence.c	/^__seq_remove(seq, txn, flags)$/
@@ -3896,97 +4316,115 @@ __seq_set_range	../sequence/sequence.c	/^__seq_set_range(seq, min, max)$/
 __seq_stat	../sequence/seq_stat.c	/^__seq_stat(seq, spp, flags)$/
 __seq_stat_print	../sequence/seq_stat.c	/^__seq_stat_print(seq, flags)$/
 __seq_update	../sequence/sequence.c	/^__seq_update(seq, txn, delta, flags)$/
-__txn_abort	../txn/txn.c	/^__txn_abort(txnp)$/
-__txn_abort_pp	../txn/txn.c	/^__txn_abort_pp(txnp)$/
+__shm_mode	../os/os_map.c	/^__shm_mode(dbenv)$/
+__txn_abort	../txn/txn.c	/^__txn_abort(txn)$/
+__txn_abort_pp	../txn/txn.c	/^__txn_abort_pp(txn)$/
 __txn_abort_proc	../rpc_server/c/db_server_proc.c	/^__txn_abort_proc(txnpcl_id, replyp)$/
-__txn_activekids	../txn/txn.c	/^__txn_activekids(dbenv, rectype, txnp)$/
+__txn_activekids	../txn/txn.c	/^__txn_activekids(dbenv, rectype, txn)$/
+__txn_add_buffer	../txn/txn_region.c	/^int __txn_add_buffer(dbenv, td)$/
 __txn_begin	../txn/txn.c	/^__txn_begin(dbenv, parent, txnpp, flags)$/
 __txn_begin_int	../txn/txn.c	/^__txn_begin_int(txn, internal)$/
 __txn_begin_pp	../txn/txn.c	/^__txn_begin_pp(dbenv, parent, txnpp, flags)$/
-__txn_begin_proc	../rpc_server/c/db_server_proc.c	/^__txn_begin_proc(dbenvcl_id, parentcl_id, flags, r/
-__txn_checkpoint	../txn/txn.c	/^__txn_checkpoint(dbenv, kbytes, minutes, flags)$/
-__txn_checkpoint_pp	../txn/txn.c	/^__txn_checkpoint_pp(dbenv, kbytes, minutes, flags)/
-__txn_child_log	../txn/txn_auto.c	/^__txn_child_log(dbenv, txnid, ret_lsnp, flags,$/
+__txn_checkpoint	../txn/txn_chkpt.c	/^__txn_checkpoint(dbenv, kbytes, minutes, flags)$/
+__txn_checkpoint_pp	../txn/txn_chkpt.c	/^__txn_checkpoint_pp(dbenv, kbytes, minutes, flags)/
+__txn_child_log	../txn/txn_auto.c	/^__txn_child_log(dbenv, txnp, ret_lsnp, flags,$/
 __txn_child_print	../txn/txn_autop.c	/^__txn_child_print(dbenv, dbtp, lsnp, notused2, not/
 __txn_child_read	../txn/txn_auto.c	/^__txn_child_read(dbenv, recbuf, argpp)$/
 __txn_child_recover	../txn/txn_rec.c	/^__txn_child_recover(dbenv, dbtp, lsnp, op, info)$/
-__txn_ckp_log	../txn/txn_auto.c	/^__txn_ckp_log(dbenv, txnid, ret_lsnp, flags,$/
+__txn_ckp_42_print	../txn/txn_autop.c	/^__txn_ckp_42_print(dbenv, dbtp, lsnp, notused2, no/
+__txn_ckp_42_read	../txn/txn_auto.c	/^__txn_ckp_42_read(dbenv, recbuf, argpp)$/
+__txn_ckp_42_recover	../txn/txn_rec.c	/^__txn_ckp_42_recover(dbenv, dbtp, lsnp, op, info)$/
+__txn_ckp_log	../txn/txn_auto.c	/^__txn_ckp_log(dbenv, txnp, ret_lsnp, flags,$/
 __txn_ckp_print	../txn/txn_autop.c	/^__txn_ckp_print(dbenv, dbtp, lsnp, notused2, notus/
 __txn_ckp_read	../txn/txn_auto.c	/^__txn_ckp_read(dbenv, recbuf, argpp)$/
 __txn_ckp_recover	../txn/txn_rec.c	/^__txn_ckp_recover(dbenv, dbtp, lsnp, op, info)$/
 __txn_closeevent	../txn/txn_util.c	/^__txn_closeevent(dbenv, txn, dbp)$/
-__txn_commit	../txn/txn.c	/^__txn_commit(txnp, flags)$/
-__txn_commit_pp	../txn/txn.c	/^__txn_commit_pp(txnp, flags)$/
+__txn_commit	../txn/txn.c	/^__txn_commit(txn, flags)$/
+__txn_commit_pp	../txn/txn.c	/^__txn_commit_pp(txn, flags)$/
 __txn_commit_proc	../rpc_server/c/db_server_proc.c	/^__txn_commit_proc(txnpcl_id, flags, replyp)$/
 __txn_compare	../txn/txn_stat.c	/^__txn_compare(a1, b1)$/
 __txn_compensate_begin	../txn/txn.c	/^__txn_compensate_begin(dbenv, txnpp)$/
-__txn_continue	../txn/txn_recover.c	/^__txn_continue(env, txnp, td, off)$/
+__txn_continue	../txn/txn.c	/^__txn_continue(env, txn, td)$/
 __txn_dbenv_create	../txn/txn_method.c	/^__txn_dbenv_create(dbenv)$/
+__txn_dbenv_destroy	../txn/txn_method.c	/^__txn_dbenv_destroy(dbenv)$/
 __txn_dbenv_refresh	../txn/txn_region.c	/^__txn_dbenv_refresh(dbenv)$/
-__txn_discard	../txn/txn.c	/^__txn_discard(txnp, flags)$/
-__txn_discard_pp	../txn/txn.c	/^__txn_discard_pp(txnp, flags)$/
+__txn_discard	../txn/txn.c	/^__txn_discard(txn, flags)$/
+__txn_discard_int	../txn/txn.c	/^__txn_discard_int(txn, flags)$/
 __txn_discard_proc	../rpc_server/c/db_server_proc.c	/^__txn_discard_proc(txnpcl_id, flags, replyp)$/
-__txn_dispatch_undo	../txn/txn.c	/^__txn_dispatch_undo(dbenv, txnp, rdbt, key_lsn, tx/
+__txn_dispatch_undo	../txn/txn.c	/^__txn_dispatch_undo(dbenv, txn, rdbt, key_lsn, txn/
 __txn_doevents	../txn/txn_util.c	/^__txn_doevents(dbenv, txn, opcode, preprocess)$/
-__txn_end	../txn/txn.c	/^__txn_end(txnp, is_commit)$/
+__txn_end	../txn/txn.c	/^__txn_end(txn, is_commit)$/
+__txn_event	../txn/txn_util.c	/^struct __txn_event {$/
+__txn_failchk	../txn/txn_failchk.c	/^__txn_failchk(dbenv)$/
 __txn_findlastckp	../txn/txn_region.c	/^__txn_findlastckp(dbenv, lsnp, max_lsn)$/
 __txn_force_abort	../txn/txn.c	/^__txn_force_abort(dbenv, buffer)$/
+__txn_get_name	../txn/txn.c	/^__txn_get_name(txn, namep)$/
 __txn_get_prepared	../txn/txn_recover.c	/^__txn_get_prepared(dbenv, xids, txns, count, retp,/
 __txn_get_tx_max	../txn/txn_method.c	/^__txn_get_tx_max(dbenv, tx_maxp)$/
 __txn_get_tx_timestamp	../txn/txn_method.c	/^__txn_get_tx_timestamp(dbenv, timestamp)$/
-__txn_getactive	../txn/txn.c	/^__txn_getactive(dbenv, lsnp)$/
-__txn_getckp	../txn/txn.c	/^__txn_getckp(dbenv, lsnp)$/
-__txn_id	../txn/txn.c	/^__txn_id(txnp)$/
+__txn_getactive	../txn/txn_chkpt.c	/^__txn_getactive(dbenv, lsnp)$/
+__txn_getckp	../txn/txn_chkpt.c	/^__txn_getckp(dbenv, lsnp)$/
+__txn_gid	../txn/txn_stat.c	/^__txn_gid(dbenv, mbp, txn)$/
+__txn_id	../txn/txn.c	/^__txn_id(txn)$/
 __txn_id_set	../txn/txn_region.c	/^__txn_id_set(dbenv, cur_txnid, max_txnid)$/
-__txn_init	../txn/txn_region.c	/^__txn_init(dbenv, tmgrp)$/
+__txn_init	../txn/txn_region.c	/^__txn_init(dbenv, mgr)$/
 __txn_init_print	../txn/txn_autop.c	/^__txn_init_print(dbenv, dtabp, dtabsizep)$/
 __txn_init_recover	../txn/txn_auto.c	/^__txn_init_recover(dbenv, dtabp, dtabsizep)$/
-__txn_isvalid	../txn/txn.c	/^__txn_isvalid(txnp, tdp, op)$/
+__txn_isvalid	../txn/txn.c	/^__txn_isvalid(txn, op)$/
 __txn_lockevent	../txn/txn_util.c	/^__txn_lockevent(dbenv, txn, dbp, lock, locker)$/
+__txn_logrec	../dbinc/txn.h	/^struct __txn_logrec {$/
 __txn_map_gid	../txn/txn_recover.c	/^__txn_map_gid(dbenv, gid, tdp, offp)$/
+__txn_oldest_reader	../txn/txn_region.c	/^__txn_oldest_reader(dbenv, lsnp)$/
 __txn_open	../txn/txn_region.c	/^__txn_open(dbenv)$/
 __txn_openfiles	../txn/txn_recover.c	/^__txn_openfiles(dbenv, min, force)$/
 __txn_preclose	../txn/txn.c	/^__txn_preclose(dbenv)$/
-__txn_prepare	../txn/txn.c	/^__txn_prepare(txnp, gid)$/
+__txn_prepare	../txn/txn.c	/^__txn_prepare(txn, gid)$/
 __txn_prepare_proc	../rpc_server/c/db_server_proc.c	/^__txn_prepare_proc(txnpcl_id, gid, replyp)$/
 __txn_print_all	../txn/txn_stat.c	/^__txn_print_all(dbenv, flags)$/
 __txn_print_stats	../txn/txn_stat.c	/^__txn_print_stats(dbenv, flags)$/
 __txn_recover	../txn/txn_recover.c	/^__txn_recover(dbenv, preplist, count, retp, flags)/
 __txn_recover_pp	../txn/txn_recover.c	/^__txn_recover_pp(dbenv, preplist, count, retp, fla/
-__txn_recover_proc	../rpc_server/c/db_server_proc.c	/^__txn_recover_proc(dbenvcl_id, count, flags, reply/
-__txn_recycle_log	../txn/txn_auto.c	/^__txn_recycle_log(dbenv, txnid, ret_lsnp, flags,$/
+__txn_recycle_id	../txn/txn.c	/^__txn_recycle_id(dbenv)$/
+__txn_recycle_log	../txn/txn_auto.c	/^__txn_recycle_log(dbenv, txnp, ret_lsnp, flags,$/
 __txn_recycle_print	../txn/txn_autop.c	/^__txn_recycle_print(dbenv, dbtp, lsnp, notused2, n/
 __txn_recycle_read	../txn/txn_auto.c	/^__txn_recycle_read(dbenv, recbuf, argpp)$/
 __txn_recycle_recover	../txn/txn_rec.c	/^__txn_recycle_recover(dbenv, dbtp, lsnp, op, info)/
-__txn_region_destroy	../txn/txn_region.c	/^__txn_region_destroy(dbenv, infop)$/
 __txn_region_size	../txn/txn_region.c	/^__txn_region_size(dbenv)$/
-__txn_regop_log	../txn/txn_auto.c	/^__txn_regop_log(dbenv, txnid, ret_lsnp, flags,$/
+__txn_regop_42_print	../txn/txn_autop.c	/^__txn_regop_42_print(dbenv, dbtp, lsnp, notused2, /
+__txn_regop_42_read	../txn/txn_auto.c	/^__txn_regop_42_read(dbenv, recbuf, argpp)$/
+__txn_regop_42_recover	../txn/txn_rec.c	/^__txn_regop_42_recover(dbenv, dbtp, lsnp, op, info/
+__txn_regop_log	../txn/txn_auto.c	/^__txn_regop_log(dbenv, txnp, ret_lsnp, flags,$/
 __txn_regop_print	../txn/txn_autop.c	/^__txn_regop_print(dbenv, dbtp, lsnp, notused2, not/
 __txn_regop_read	../txn/txn_auto.c	/^__txn_regop_read(dbenv, recbuf, argpp)$/
 __txn_regop_recover	../txn/txn_rec.c	/^__txn_regop_recover(dbenv, dbtp, lsnp, op, info)$/
-__txn_remevent	../txn/txn_util.c	/^__txn_remevent(dbenv, txn, name, fileid)$/
+__txn_remevent	../txn/txn_util.c	/^__txn_remevent(dbenv, txn, name, fileid, inmem)$/
 __txn_remlock	../txn/txn_util.c	/^__txn_remlock(dbenv, txn, lock, locker)$/
+__txn_remove_buffer	../txn/txn_region.c	/^int __txn_remove_buffer(dbenv, td, hash_mtx)$/
 __txn_remrem	../txn/txn_util.c	/^__txn_remrem(dbenv, txn, name)$/
 __txn_reset	../txn/txn.c	/^__txn_reset(dbenv)$/
 __txn_restore_txn	../txn/txn_rec.c	/^__txn_restore_txn(dbenv, lsnp, argp)$/
-__txn_set_begin_lsnp	../txn/txn.c	/^__txn_set_begin_lsnp(txn, rlsnp)$/
-__txn_set_timeout	../txn/txn.c	/^__txn_set_timeout(txnp, timeout, op)$/
+__txn_set_name	../txn/txn.c	/^__txn_set_name(txn, name)$/
+__txn_set_timeout	../txn/txn.c	/^__txn_set_timeout(txn, timeout, op)$/
 __txn_set_tx_max	../txn/txn_method.c	/^__txn_set_tx_max(dbenv, tx_max)$/
 __txn_set_tx_timestamp	../txn/txn_method.c	/^__txn_set_tx_timestamp(dbenv, timestamp)$/
+__txn_set_txn_lsnp	../txn/txn.c	/^__txn_set_txn_lsnp(txn, blsnp, llsnp)$/
 __txn_stat	../txn/txn_stat.c	/^__txn_stat(dbenv, statp, flags)$/
 __txn_stat_pp	../txn/txn_stat.c	/^__txn_stat_pp(dbenv, statp, flags)$/
 __txn_stat_print	../txn/txn_stat.c	/^__txn_stat_print(dbenv, flags)$/
 __txn_stat_print_pp	../txn/txn_stat.c	/^__txn_stat_print_pp(dbenv, flags)$/
-__txn_undo	../txn/txn.c	/^__txn_undo(txnp)$/
-__txn_updateckp	../txn/txn.c	/^__txn_updateckp(dbenv, lsnp)$/
+__txn_status	../txn/txn_stat.c	/^__txn_status(txn)$/
+__txn_undo	../txn/txn.c	/^__txn_undo(txn)$/
+__txn_updateckp	../txn/txn_chkpt.c	/^__txn_updateckp(dbenv, lsnp)$/
 __txn_xa_begin	../txn/txn.c	/^__txn_xa_begin(dbenv, txn)$/
-__txn_xa_regop_log	../txn/txn_auto.c	/^__txn_xa_regop_log(dbenv, txnid, ret_lsnp, flags,$/
+__txn_xa_regop_log	../txn/txn_auto.c	/^__txn_xa_regop_log(dbenv, txnp, ret_lsnp, flags,$/
 __txn_xa_regop_print	../txn/txn_autop.c	/^__txn_xa_regop_print(dbenv, dbtp, lsnp, notused2, /
 __txn_xa_regop_read	../txn/txn_auto.c	/^__txn_xa_regop_read(dbenv, recbuf, argpp)$/
 __txn_xa_regop_recover	../txn/txn_rec.c	/^__txn_xa_regop_recover(dbenv, dbtp, lsnp, op, info/
-__txn_xid_stats	../txn/txn_stat.c	/^__txn_xid_stats(dbenv, mbp, txnp)$/
 __ua_memcpy	../os/os_alloc.c	/^__ua_memcpy(dst, src, len)$/
 __usermem	../log/log_archive.c	/^__usermem(dbenv, listp)$/
+__vrfy_childinfo	../dbinc/db_verify.h	/^struct __vrfy_childinfo {$/
+__vrfy_dbinfo	../dbinc/db_verify.h	/^struct __vrfy_dbinfo {$/
+__vrfy_pageinfo	../dbinc/db_verify.h	/^struct __vrfy_pageinfo {$/
 __vx_fsync	../os/os_fsync.c	/^__vx_fsync(fd)$/
 __xa_close	../xa/xa_db.c	/^__xa_close(dbp, flags)$/
 __xa_cursor	../xa/xa_db.c	/^__xa_cursor(dbp, txn, dbcp, flags)$/
@@ -3996,16 +4434,39 @@ __xa_get_txn	../xa/xa.c	/^__xa_get_txn(dbenv, txnp, do_init)$/
 __xa_open	../xa/xa_db.c	/^__xa_open(dbp, txn, name, subdb, type, flags, mode/
 __xa_put	../xa/xa_db.c	/^__xa_put(dbp, txn, key, data, flags)$/
 __xa_put_txn	../xa/xa.c	/^__xa_put_txn(dbenv, txnp)$/
+__xa_set_txn	../xa/xa_db.c	/^__xa_set_txn(dbp, txnpp, no_xa_txn)$/
+__xa_truncate	../xa/xa_db.c	/^__xa_truncate(dbp, txn, countp, flags)$/
+__xa_txn	../dbinc/db.in	/^	struct __xa_txn {	\/* XA Active Transactions. *\//
+_app_dispatch_intercept	../cxx/cxx_env.cpp	/^int DbEnv::_app_dispatch_intercept(DB_ENV *env, DB/
 _app_dispatch_intercept_c	../cxx/cxx_env.cpp	/^int _app_dispatch_intercept_c(DB_ENV *env, DBT *db/
 _debug_check	../tcl/tcl_internal.c	/^_debug_check()$/
-_exported	../dbinc/db_cxx.in	132
+_event_func_intercept	../cxx/cxx_env.cpp	/^void DbEnv::_event_func_intercept($/
+_event_func_intercept_c	../cxx/cxx_env.cpp	/^void _event_func_intercept_c(DB_ENV *env, u_int32_/
+_exported	../dbinc/db_cxx.in	/^#    define _exported __declspec(dllexport)      /
+_feedback_intercept	../cxx/cxx_env.cpp	/^void DbEnv::_feedback_intercept(DB_ENV *env, int o/
 _feedback_intercept_c	../cxx/cxx_env.cpp	/^void _feedback_intercept_c(DB_ENV *env, int opcode/
+_isalive_intercept	../cxx/cxx_env.cpp	/^int DbEnv::_isalive_intercept($/
+_isalive_intercept_c	../cxx/cxx_env.cpp	/^int _isalive_intercept_c($/
+_paniccall_intercept	../cxx/cxx_env.cpp	/^void DbEnv::_paniccall_intercept(DB_ENV *env, int /
 _paniccall_intercept_c	../cxx/cxx_env.cpp	/^void _paniccall_intercept_c(DB_ENV *env, int errva/
+_rep_send_intercept	../cxx/cxx_env.cpp	/^int DbEnv::_rep_send_intercept(DB_ENV *env, const /
 _rep_send_intercept_c	../cxx/cxx_env.cpp	/^int _rep_send_intercept_c(DB_ENV *env, const DBT */
+_stream_error_function	../cxx/cxx_env.cpp	/^void DbEnv::_stream_error_function($/
 _stream_error_function_c	../cxx/cxx_env.cpp	/^void _stream_error_function_c(const DB_ENV *env,$/
+_stream_message_function	../cxx/cxx_env.cpp	/^void DbEnv::_stream_message_function(const DB_ENV /
 _stream_message_function_c	../cxx/cxx_env.cpp	/^void _stream_message_function_c(const DB_ENV *env,/
+_thread_id_intercept	../cxx/cxx_env.cpp	/^void DbEnv::_thread_id_intercept(DB_ENV *env,$/
+_thread_id_intercept_c	../cxx/cxx_env.cpp	/^void _thread_id_intercept_c(DB_ENV *env, pid_t *pi/
+_thread_id_string_intercept	../cxx/cxx_env.cpp	/^char *DbEnv::_thread_id_string_intercept(DB_ENV *e/
+_thread_id_string_intercept_c	../cxx/cxx_env.cpp	/^char *_thread_id_string_intercept_c(DB_ENV *env, p/
+abort	../clib/abort.c	/^abort()$/
+ack_message	../repmgr/repmgr_msg.c	/^ack_message(dbenv, generation, lsn)$/
 add_home	../rpc_server/c/db_server_util.c	/^add_home(home)$/
 add_passwd	../rpc_server/c/db_server_util.c	/^add_passwd(passwd)$/
+allocate_wait_slot	../repmgr/repmgr_windows.c	/^allocate_wait_slot(dbenv, resultp)$/
+archopts	../tcl/tcl_log.c	/^	enum archopts {$/
+atoi	../clib/atoi.c	/^atoi(str)$/
+atol	../clib/atol.c	/^atol(str)$/
 bdb_DbOpen	../tcl/tcl_db_pkg.c	/^bdb_DbOpen(interp, objc, objv, ip, dbp)$/
 bdb_DbRemove	../tcl/tcl_db_pkg.c	/^bdb_DbRemove(interp, objc, objv)$/
 bdb_DbRename	../tcl/tcl_db_pkg.c	/^bdb_DbRename(interp, objc, objv)$/
@@ -4013,6 +4474,7 @@ bdb_DbUpgrade	../tcl/tcl_db_pkg.c	/^bdb_DbUpgrade(interp, objc, objv)$/
 bdb_DbVerify	../tcl/tcl_db_pkg.c	/^bdb_DbVerify(interp, objc, objv)$/
 bdb_DbmCommand	../tcl/tcl_compat.c	/^bdb_DbmCommand(interp, objc, objv, flag, dbm)$/
 bdb_EnvOpen	../tcl/tcl_db_pkg.c	/^bdb_EnvOpen(interp, objc, objv, ip, env)$/
+bdb_GetConfig	../tcl/tcl_db_pkg.c	/^bdb_GetConfig(interp, objc, objv)$/
 bdb_HCommand	../tcl/tcl_compat.c	/^bdb_HCommand(interp, objc, objv)$/
 bdb_Handles	../tcl/tcl_db_pkg.c	/^bdb_Handles(interp, objc, objv)$/
 bdb_MsgType	../tcl/tcl_db_pkg.c	/^bdb_MsgType(interp, objc, objv)$/
@@ -4020,23 +4482,41 @@ bdb_NdbmOpen	../tcl/tcl_compat.c	/^bdb_NdbmOpen(interp, objc, objv, dbpp)$/
 bdb_RandCommand	../tcl/tcl_util.c	/^bdb_RandCommand(interp, objc, objv)$/
 bdb_SeqOpen	../tcl/tcl_db_pkg.c	/^bdb_SeqOpen(interp, objc, objv, ip, seqp)$/
 bdb_Version	../tcl/tcl_db_pkg.c	/^bdb_Version(interp, objc, objv)$/
+bdbenvopen	../tcl/tcl_db_pkg.c	/^	enum bdbenvopen {$/
+bdbmv	../tcl/tcl_db_pkg.c	/^	enum bdbmv {$/
+bdbopen	../tcl/tcl_db_pkg.c	/^	enum bdbopen {$/
+bdbrem	../tcl/tcl_db_pkg.c	/^	enum bdbrem {$/
+bdbupg	../tcl/tcl_db_pkg.c	/^	enum bdbupg {$/
+bdbver	../tcl/tcl_db_pkg.c	/^	enum bdbver {$/
+bdbvrfy	../tcl/tcl_db_pkg.c	/^	enum bdbvrfy {$/
 berkdb_Cmd	../tcl/tcl_db_pkg.c	/^berkdb_Cmd(notused, interp, objc, objv)$/
+berkdbcmds	../tcl/tcl_db_pkg.c	/^	enum berkdbcmds {$/
 blk	../hmac/sha1.c	/^#define blk(i) (block->l[i&15] = rol(block->l[(i+1/
 blk0	../hmac/sha1.c	/^#define blk0(i) is_bigendian ? block->l[i] : \\$/
-bt_compare_fcn_type	../dbinc/db_cxx.in	159
-bt_prefix_fcn_type	../dbinc/db_cxx.in	161
-ca_recno_arg	../dbinc/btree.h	84
-const	../dbinc/db_185.in	54
-ct_anyp	../dbinc/db_server_int.h	126
-ct_dbc	../dbinc/db_server_int.h	125
-ct_dbdata	../dbinc/db_server_int.h	65
-ct_dbdp	../dbinc/db_server_int.h	129
-ct_dbp	../dbinc/db_server_int.h	124
-ct_entry	../dbinc/db_server_int.h	89
-ct_envdata	../dbinc/db_server_int.h	64
-ct_envdp	../dbinc/db_server_int.h	128
-ct_envp	../dbinc/db_server_int.h	122
-ct_txnp	../dbinc/db_server_int.h	123
+ca_recno_arg	../dbinc/btree.h	/^} ca_recno_arg;$/
+cdsgroup_begin	../cxx/cxx_env.cpp	/^int DbEnv::cdsgroup_begin(DbTxn **tid)$/
+cipherInstance	../crypto/rijndael/rijndael-api-fst.h	/^} cipherInstance;$/
+cleanup	../cxx/cxx_db.cpp	/^\/\/ private method to cleanup after destructor or/
+close	../cxx/cxx_env.cpp	/^int DbEnv::close(u_int32_t flags)$/
+closesocket	../dbinc/repmgr.h	/^#define	closesocket(fd)		close(fd)$/
+commitopt	../tcl/tcl_txn.c	/^	enum commitopt {$/
+cond_var_t	../dbinc/repmgr.h	/^typedef HANDLE cond_var_t;$/
+confonoff	../tcl/tcl_rep.c	/^	enum confonoff {$/
+confwhich	../tcl/tcl_rep.c	/^	enum confwhich {$/
+const	../dbinc/db_185.in	/^#define	const$/
+ct_anyp	../dbinc/db_server_int.h	/^#define	ct_anyp handle_u.anyp$/
+ct_dbc	../dbinc/db_server_int.h	/^#define	ct_dbc handle_u.dbc$/
+ct_dbdata	../dbinc/db_server_int.h	/^typedef struct ct_dbdata ct_dbdata;$/
+ct_dbdp	../dbinc/db_server_int.h	/^#define	ct_dbdp private_u.dbdp$/
+ct_dbp	../dbinc/db_server_int.h	/^#define	ct_dbp handle_u.dbp$/
+ct_entry	../dbinc/db_server_int.h	/^typedef struct ct_entry ct_entry;$/
+ct_envdata	../dbinc/db_server_int.h	/^typedef struct ct_envdata ct_envdata;$/
+ct_envdp	../dbinc/db_server_int.h	/^#define	ct_envdp private_u.envdp$/
+ct_envp	../dbinc/db_server_int.h	/^#define	ct_envp handle_u.envp$/
+ct_txnp	../dbinc/db_server_int.h	/^#define	ct_txnp handle_u.txnp$/
+data	../dbinc/tcl_db.h	/^	union data {$/
+data2	../dbinc/tcl_db.h	/^	union data2 {$/
+datum	../dbinc/db.in	/^} datum;$/
 db185_close	../db185/db185.c	/^db185_close(db185p)$/
 db185_compare	../db185/db185.c	/^db185_compare(dbp, a, b)$/
 db185_del	../db185/db185.c	/^db185_del(db185p, key185, flags)$/
@@ -4048,7 +4528,7 @@ db185_put	../db185/db185.c	/^db185_put(db185p, key185, data185, flags)$/
 db185_seq	../db185/db185.c	/^db185_seq(db185p, key185, data185, flags)$/
 db185_sync	../db185/db185.c	/^db185_sync(db185p, flags)$/
 db_Cmd	../tcl/tcl_db.c	/^db_Cmd(clientData, interp, objc, objv)$/
-db_ca_mode	../dbinc/btree.h	316
+db_ca_mode	../dbinc/btree.h	/^} db_ca_mode;$/
 db_create	../db/db_method.c	/^db_create(dbpp, dbenv, flags)$/
 db_env_create	../env/env_method.c	/^db_env_create(dbenvpp, flags)$/
 db_env_set_func_close	../os/os_method.c	/^db_env_set_func_close(func_close)$/
@@ -4073,26 +4553,41 @@ db_env_set_func_unlink	../os/os_method.c	/^db_env_set_func_unlink(func_unlink)$/
 db_env_set_func_unmap	../os/os_method.c	/^db_env_set_func_unmap(func_unmap)$/
 db_env_set_func_write	../os/os_method.c	/^db_env_set_func_write(func_write)$/
 db_env_set_func_yield	../os/os_method.c	/^db_env_set_func_yield(func_yield)$/
-db_free_fcn_type	../dbinc/db_cxx.in	157
-db_ham_mode	../dbinc/hash.h	142
-db_indx_t	../dbinc/db.in	106
-db_limbo_state	../dbinc/db_dispatch.h	113
-db_lockmode_t	../dbinc/db.in	413
-db_lockop_t	../dbinc/db.in	430
-db_malloc_fcn_type	../dbinc/db_cxx.in	153
-db_pgno_t	../dbinc/db.in	105
-db_realloc_fcn_type	../dbinc/db_cxx.in	155
-db_recno_t	../dbinc/db.in	109
-db_recops	../dbinc/db.in	806
-db_ret_t	../libdb_java/db_java_wrap.c	1724
+db_error_set_t	../dbinc/debug.h	/^} db_error_set_t;$/
+db_ham_mode	../dbinc/hash.h	/^} db_ham_mode;$/
+db_indx_t	../dbinc/db.in	/^typedef	u_int16_t	db_indx_t;	\/* Page offset type./
+db_iovec_t	../dbinc/repmgr.h	/^typedef WSABUF db_iovec_t;$/
+db_limbo_state	../dbinc/db_dispatch.h	/^} db_limbo_state;$/
+db_lockmode_t	../dbinc/db.in	/^} db_lockmode_t;$/
+db_lockop_t	../dbinc/db.in	/^} db_lockop_t;$/
+db_mutex_t	../dbinc/db.in	/^typedef u_int32_t	db_mutex_t;$/
+db_pgno_t	../dbinc/db.in	/^typedef	u_int32_t	db_pgno_t;	\/* Page number type./
+db_recno_t	../dbinc/db.in	/^typedef	u_int32_t	db_recno_t;	\/* Record number ty/
+db_recops	../dbinc/db.in	/^} db_recops;$/
+db_ret_t	../libdb_java/db_java_wrap.c	/^typedef int db_ret_t;$/
 db_sequence_create	../sequence/sequence.c	/^db_sequence_create(seqp, dbp, flags)$/
-db_status_t	../dbinc/db.in	446
+db_status_t	../dbinc/db.in	/^}db_status_t;$/
 db_strerror	../common/db_err.c	/^db_strerror(error)$/
-db_sync_op	../dbinc/mp.h	37
-db_timeout_t	../dbinc/db.in	112
-db_txnlist_type	../dbinc/db_dispatch.h	51
+db_sync_op	../dbinc/mp.h	/^} db_sync_op;$/
+db_timeout_t	../dbinc/db.in	/^typedef u_int32_t	db_timeout_t;	\/* Type of a time/
+db_timeval_t	../dbinc/lock.h	/^} db_timeval_t;$/
+db_trunc_param	../dbinc/db_am.h	/^} db_trunc_param;$/
+db_txnlist_type	../dbinc/db_dispatch.h	/^} db_txnlist_type;$/
 db_version	../env/env_open.c	/^db_version(majverp, minverp, patchp)$/
+dbaopts	../tcl/tcl_db.c	/^	enum dbaopts {$/
 dbc_Cmd	../tcl/tcl_dbcursor.c	/^dbc_Cmd(clientData, interp, objc, objv)$/
+dbccmds	../tcl/tcl_dbcursor.c	/^	enum dbccmds {$/
+dbcdupopts	../tcl/tcl_dbcursor.c	/^	enum dbcdupopts {$/
+dbcgetopts	../tcl/tcl_dbcursor.c	/^	enum dbcgetopts {$/
+dbclose	../tcl/tcl_db.c	/^	enum dbclose {$/
+dbcmds	../tcl/tcl_db.c	/^	enum dbcmds {$/
+dbcuropts	../tcl/tcl_db.c	/^	enum dbcuropts {$/
+dbcutopts	../tcl/tcl_dbcursor.c	/^	enum dbcutopts {$/
+dbdelopts	../tcl/tcl_db.c	/^	enum dbdelopts {$/
+dbgetjopts	../tcl/tcl_db.c	/^	enum dbgetjopts {$/
+dbgetopts	../tcl/tcl_db.c	/^	enum dbgetopts {$/
+dbjopts	../tcl/tcl_db.c	/^	enum dbjopts {$/
+dbkeyropts	../tcl/tcl_db.c	/^	enum dbkeyropts {$/
 dbm_clearerr	../dbinc/db.in	/^#define	dbm_clearerr(a)		__db_ndbm_clearerr@DB_VER/
 dbm_close	../dbinc/db.in	/^#define	dbm_close(a)		__db_ndbm_close@DB_VERSION_U/
 dbm_delete	../dbinc/db.in	/^#define	dbm_delete(a, b)	__db_ndbm_delete@DB_VERSI/
@@ -4105,15 +4600,23 @@ dbm_open	../dbinc/db.in	/^#define	dbm_open(a, b, c)	__db_ndbm_open@DB_VERSIO/
 dbm_pagfno	../dbinc/db.in	/^#define	dbm_pagfno(a)		__db_ndbm_pagfno@DB_VERSION/
 dbm_rdonly	../dbinc/db.in	/^#define	dbm_rdonly(a)		__db_ndbm_rdonly@DB_VERSION/
 dbm_store	../dbinc/db.in	/^#define	dbm_store(a, b, c, d) \\$/
-dbmclose	../dbinc/db.in	2135
+dbmclose	../dbinc/db.in	/^#define	dbmclose	__db_dbm_close@DB_VERSION_UNIQUE_/
+dbmcmds	../tcl/tcl_compat.c	/^	enum dbmcmds {$/
 dbminit	../dbinc/db.in	/^#define	dbminit(a)	__db_dbm_init@DB_VERSION_UNIQUE/
-dbopen	../dbinc/db_185.in	167
+dbopen	../dbinc/db_185.in	/^#define	dbopen __db185_open@DB_VERSION_UNIQUE_NAME/
+dbputapp	../tcl/tcl_db.c	/^	enum dbputapp { DBPUT_APPEND0 };$/
+dbputopts	../tcl/tcl_db.c	/^	enum dbputopts {$/
+dbstatopts	../tcl/tcl_db.c	/^	enum dbstatopts {$/
+dbt_	../cxx/cxx_except.cpp	/^,	dbt_(dbt)$/
 delete	../dbinc/db.in	/^#define	delete(a)	__db_dbm_delete@DB_VERSION_UNIQU/
-delete_DbLock	../libdb_java/db_java_wrap.c	/^void delete_DbLock(struct DbLock *self){$/
-dirent	../clib/getcwd.c	48
+delete_DbLock	../libdb_java/db_java_wrap.c	/^SWIGINTERN void delete_DbLock(struct DbLock *self)/
+describe	../cxx/cxx_except.cpp	/^void DbException::describe(const char *prefix, con/
+dirent	../clib/getcwd.c	/^# define dirent direct$/
 dirfd	../clib/getcwd.c	/^#define   dirfd(dirp)     ((dirp)->dd_fd)$/
-dupString	../cxx/cxx_except.cpp	/^static char *dupString(const char *s)$/
-dup_compare_fcn_type	../dbinc/db_cxx.in	163
+dispatch_phase_completion	../repmgr/repmgr_sel.c	/^dispatch_phase_completion(dbenv, conn)$/
+dupString	../cxx/cxx_except.cpp	/^\/\/ Note: would not be needed if we can inherit f/
+enqueue_msg	../repmgr/repmgr_net.c	/^enqueue_msg(dbenv, conn, msg, offset)$/
+env_	../cxx/cxx_except.cpp	/^,	env_(0)$/
 env_Cmd	../tcl/tcl_env.c	/^env_Cmd(clientData, interp, objc, objv)$/
 env_DbRemove	../tcl/tcl_env.c	/^env_DbRemove(interp, objc, objv, dbenv)$/
 env_DbRename	../tcl/tcl_env.c	/^env_DbRename(interp, objc, objv, dbenv)$/
@@ -4123,126 +4626,239 @@ env_GetOpenFlag	../tcl/tcl_env.c	/^env_GetOpenFlag(interp, objc, objv, dbenv)$/
 env_GetTimeout	../tcl/tcl_env.c	/^env_GetTimeout(interp, objc, objv, dbenv)$/
 env_GetVerbose	../tcl/tcl_env.c	/^env_GetVerbose(interp, objc, objv, dbenv)$/
 env_recover	../rpc_server/c/db_server_util.c	/^env_recover(progname)$/
-exec_proc	../mutex/tm.c	/^exec_proc(id, tmpath, typearg)$/
+envcmds	../tcl/tcl_env.c	/^	enum envcmds {$/
+envdbmv	../tcl/tcl_env.c	/^	enum envdbmv {$/
+envdbrem	../tcl/tcl_env.c	/^	enum envdbrem {$/
+envopen	../tcl/tcl_db_pkg.c	/^	enum envopen {$/
+envremopts	../tcl/tcl_env.c	/^	enum envremopts {$/
+envtestat	../tcl/tcl_env.c	/^	enum envtestat {$/
+envtestcmd	../tcl/tcl_env.c	/^	enum envtestcmd {$/
+error_policy	../cxx/cxx_db.cpp	/^\/\/ Return a tristate value corresponding to whet/
+errx	../cxx/cxx_db.cpp	/^void Db::errx(const char *format, ...)$/
 fetch	../dbinc/db.in	/^#define	fetch(a)	__db_dbm_fetch@DB_VERSION_UNIQUE_/
-firstkey	../dbinc/db.in	2140
+finish_connecting	../repmgr/repmgr_posix.c	/^finish_connecting(dbenv, conn)$/
+firstkey	../dbinc/db.in	/^#define	firstkey	__db_dbm_firstkey@DB_VERSION_UNIQ/
+flatten	../repmgr/repmgr_net.c	/^flatten(dbenv, msg)$/
+fprintf	../clib/printf.c	/^fprintf(fp, fmt, va_alist)$/
+free_wait_slot	../repmgr/repmgr_windows.c	/^free_wait_slot(dbenv, slot)$/
 fsync	../os/os_fsync.c	/^#define	fsync(fd)	__vx_fsync(fd)$/
+get	../cxx/cxx_dbc.cpp	/^int Dbc::get(Dbt* key, Dbt *data, u_int32_t _flags/
+get_app_private	../cxx/cxx_env.cpp	/^void *DbEnv::get_app_private() const$/
+get_byteswapped	../cxx/cxx_db.cpp	/^int Db::get_byteswapped(int *isswapped)$/
+get_dbt	../cxx/cxx_except.cpp	/^Dbt *DbMemoryException::get_dbt() const$/
+get_env	../cxx/cxx_db.cpp	/^DbEnv *Db::get_env()$/
+get_errno	../cxx/cxx_except.cpp	/^int DbException::get_errno() const$/
+get_error_stream	../cxx/cxx_env.cpp	/^__DB_STD(ostream) *DbEnv::get_error_stream()$/
 get_fullhome	../rpc_server/c/db_server_util.c	/^get_fullhome(name)$/
+get_handle	../mutex/mut_win32.c	/^static __inline int get_handle(dbenv, mutexp, even/
+get_index	../cxx/cxx_except.cpp	/^int DbLockNotGrantedException::get_index() const$/
+get_key	../cxx/cxx_seq.cpp	/^Dbt *DbSequence::get_key()$/
+get_lock	../cxx/cxx_except.cpp	/^DbLock* DbLockNotGrantedException::get_lock() cons/
+get_message_stream	../cxx/cxx_env.cpp	/^__DB_STD(ostream) *DbEnv::get_message_stream()$/
+get_mode	../cxx/cxx_except.cpp	/^db_lockmode_t DbLockNotGrantedException::get_mode(/
+get_mpf	../cxx/cxx_db.cpp	/^DbMpoolFile *Db::get_mpf()$/
+get_obj	../cxx/cxx_except.cpp	/^const Dbt* DbLockNotGrantedException::get_obj() co/
+get_op	../cxx/cxx_except.cpp	/^db_lockop_t DbLockNotGrantedException::get_op() co/
 get_tableent	../rpc_server/c/db_server_util.c	/^get_tableent(id)$/
 getcwd	../clib/getcwd.c	/^getcwd(pt, size)$/
 getopt	../clib/getopt.c	/^getopt(nargc, nargv, ostr)$/
-h_hash_fcn_type	../dbinc/db_cxx.in	165
+h_hash_callback_	../cxx/cxx_db.cpp	/^,	h_hash_callback_(0)$/
+handle_completion	../repmgr/repmgr_windows.c	/^handle_completion(dbenv, conn)$/
+handle_newsite	../repmgr/repmgr_msg.c	/^handle_newsite(dbenv, rec)$/
+hcmds	../tcl/tcl_compat.c	/^	enum hcmds {$/
 hcreate	../dbinc/db.in	/^#define	hcreate(a)	__db_hcreate@DB_VERSION_UNIQUE_/
-hdestroy	../dbinc/db.in	2157
-home_entry	../dbinc/db_server_int.h	40
+hdestroy	../dbinc/db.in	/^#define	hdestroy	__db_hdestroy@DB_VERSION_UNIQUE_N/
+header	../repmgr/repmgr_queue.c	/^};$/
+home_entry	../dbinc/db_server_int.h	/^typedef struct home_entry home_entry;$/
 hsearch	../dbinc/db.in	/^#define	hsearch(a, b)	__db_hsearch@DB_VERSION_UNIQ/
-i_anyp	../dbinc/tcl_db.h	123
-i_data	../dbinc/tcl_db.h	134
-i_data2	../dbinc/tcl_db.h	137
-i_dbcp	../dbinc/tcl_db.h	127
-i_dbdbcid	../dbinc/tcl_db.h	148
-i_dbp	../dbinc/tcl_db.h	126
-i_envlockid	../dbinc/tcl_db.h	142
-i_envlogcid	../dbinc/tcl_db.h	144
-i_envmpid	../dbinc/tcl_db.h	141
-i_envmutexid	../dbinc/tcl_db.h	143
-i_envp	../dbinc/tcl_db.h	125
-i_envtxnid	../dbinc/tcl_db.h	140
-i_lock	../dbinc/tcl_db.h	130
-i_locker	../dbinc/tcl_db.h	136
-i_logc	../dbinc/tcl_db.h	132
-i_mp	../dbinc/tcl_db.h	129
-i_mppgid	../dbinc/tcl_db.h	146
-i_mutex	../dbinc/tcl_db.h	131
-i_pagep	../dbinc/tcl_db.h	124
-i_pgno	../dbinc/tcl_db.h	135
-i_pgsz	../dbinc/tcl_db.h	138
-i_txnp	../dbinc/tcl_db.h	128
-indx_t	../dbinc/db_185.in	82
-int_bool	../libdb_java/db_java_wrap.c	1725
-item	../hsearch/hsearch.c	/^	ENTRY item;$/
+i_anyp	../dbinc/tcl_db.h	/^#define	i_anyp un.anyp$/
+i_cdata	../dbinc/tcl_db.h	/^#define	i_cdata und2.c_data$/
+i_data	../dbinc/tcl_db.h	/^#define	i_data und.anydata$/
+i_data2	../dbinc/tcl_db.h	/^#define	i_data2 und2.anydata$/
+i_dbcp	../dbinc/tcl_db.h	/^#define	i_dbcp un.dbcp$/
+i_dbdbcid	../dbinc/tcl_db.h	/^#define	i_dbdbcid i_otherid[0]$/
+i_dbp	../dbinc/tcl_db.h	/^#define	i_dbp un.dbp$/
+i_envlockid	../dbinc/tcl_db.h	/^#define	i_envlockid i_otherid[2]$/
+i_envlogcid	../dbinc/tcl_db.h	/^#define	i_envlogcid i_otherid[3]$/
+i_envmpid	../dbinc/tcl_db.h	/^#define	i_envmpid i_otherid[1]$/
+i_envp	../dbinc/tcl_db.h	/^#define	i_envp un.envp$/
+i_envtxnid	../dbinc/tcl_db.h	/^#define	i_envtxnid i_otherid[0]$/
+i_lock	../dbinc/tcl_db.h	/^#define	i_lock un.lock$/
+i_locker	../dbinc/tcl_db.h	/^#define	i_locker und.lockid$/
+i_logc	../dbinc/tcl_db.h	/^#define	i_logc un.logc$/
+i_mp	../dbinc/tcl_db.h	/^#define	i_mp un.mp$/
+i_mppgid	../dbinc/tcl_db.h	/^#define	i_mppgid  i_otherid[0]$/
+i_pagep	../dbinc/tcl_db.h	/^#define	i_pagep un.anyp$/
+i_pgno	../dbinc/tcl_db.h	/^#define	i_pgno und.pgno$/
+i_pgsz	../dbinc/tcl_db.h	/^#define	i_pgsz und2.pagesz$/
+i_txnp	../dbinc/tcl_db.h	/^#define	i_txnp un.txnp$/
+idwhich	../tcl/tcl_env.c	/^	enum idwhich {$/
+imp_	../cxx/cxx_mpool.cpp	/^:	imp_(0)$/
+index_	../cxx/cxx_except.cpp	/^,	index_(index)$/
+indx_t	../dbinc/db_185.in	/^typedef u_int16_t	indx_t;$/
+infop	../dbinc/tcl_db.h	/^	union infop {$/
+initialize	../cxx/cxx_db.cpp	/^\/\/ private method to initialize during construct/
+int	../db/db_upg.c	/^static int (* const func_31_list[P_PAGETYPE_MAX])$/
+int_bool	../libdb_java/db_java_wrap.c	/^typedef int int_bool;$/
+iov_base	../dbinc/repmgr.h	/^#define	iov_base buf$/
+iov_len	../dbinc/repmgr.h	/^#define	iov_len len$/
+isalpha	../clib/isalpha.c	/^isalpha(c)$/
+isdigit	../clib/isdigit.c	/^isdigit(c)$/
+isprint	../clib/isprint.c	/^isprint(c)$/
+isspace	../clib/isspace.c	/^isspace(c)$/
+keyInstance	../crypto/rijndael/rijndael-api-fst.h	/^} keyInstance;$/
+ldopts	../tcl/tcl_lock.c	/^	enum ldopts {$/
+lgopts	../tcl/tcl_lock.c	/^	enum lgopts {$/
+linfo_t	../dbinc/rep.h	/^} linfo_t;$/
+lkcmds	../tcl/tcl_lock.c	/^	enum lkcmds {$/
+lkmode	../tcl/tcl_lock.c	/^	enum lkmode {$/
+lkops	../tcl/tcl_lock.c	/^	enum lkops {$/
+lock_	../cxx/cxx_lock.cpp	/^:	lock_(value)$/
 lock_Cmd	../tcl/tcl_lock.c	/^lock_Cmd(clientData, interp, objc, objv)$/
+locker_info	../lock/lock_deadlock.c	/^} locker_info;$/
+locker_start	../mutex/tm.c	/^locker_start(id)$/
+locker_wait	../mutex/tm.c	/^locker_wait()$/
 log_compare	../log/log_compare.c	/^log_compare(lsn0, lsn1)$/
 logc_Cmd	../tcl/tcl_log.c	/^logc_Cmd(clientData, interp, objc, objv)$/
-logfile_validity	../dbinc/log.h	374
-m	../dbinc/tcl_db.h	42
-map_file	../mutex/tm.c	/^map_file(gm_addrp, tm_addrp, lm_addrp, fdp)$/
+logccmds	../tcl/tcl_log.c	/^	enum logccmds {$/
+logcgetopts	../tcl/tcl_log.c	/^	enum logcgetopts {$/
+logfile_validity	../dbinc/log.h	/^} logfile_validity;$/
+logputopts	../tcl/tcl_log.c	/^	enum logputopts {$/
+lsnwhich	../tcl/tcl_env.c	/^	enum lsnwhich {$/
+lvopts	../tcl/tcl_lock.c	/^	enum lvopts {$/
+map_file	../mutex/tm.c	/^map_file(gm_addrp, tm_addrp, lm_addrp, fhpp)$/
 memcmp	../clib/memcmp.c	/^memcmp(s1, s2, n)$/
-memcpy	../clib/memmove.c	/^memcpy(dst0, src0, length)$/
+message_loop	../repmgr/repmgr_msg.c	/^message_loop(dbenv)$/
+mgr_mutex_t	../dbinc/repmgr.h	/^typedef HANDLE mgr_mutex_t;$/
 mp_Cmd	../tcl/tcl_mp.c	/^mp_Cmd(clientData, interp, objc, objv)$/
-mu_action	../dbinc/db_int.in	392
-mutex_Cmd	../tcl/tcl_util.c	/^mutex_Cmd(clientData, interp, objc, objv)$/
+mpcmds	../tcl/tcl_mp.c	/^	enum mpcmds {$/
+mpget	../tcl/tcl_mp.c	/^	enum mpget {$/
+mpopts	../tcl/tcl_mp.c	/^	enum mpopts {$/
+mu_action	../dbinc/db_int.in	/^typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_/
+ndbcmds	../tcl/tcl_compat.c	/^	enum ndbcmds {$/
 ndbm_Cmd	../tcl/tcl_compat.c	/^ndbm_Cmd(clientData, interp, objc, objv)$/
-new_Db	../libdb_java/db_java_wrap.c	/^struct Db *new_Db(DB_ENV *dbenv,u_int32_t flags){$/
-new_DbEnv	../libdb_java/db_java_wrap.c	/^struct DbEnv *new_DbEnv(u_int32_t flags){$/
-new_DbSequence	../libdb_java/db_java_wrap.c	/^struct DbSequence *new_DbSequence(DB *db,u_int32_t/
+ndbopen	../tcl/tcl_compat.c	/^	enum ndbopen {$/
+net_errno	../dbinc/repmgr.h	/^#define	net_errno		WSAGetLastError()$/
+new_Db	../libdb_java/db_java_wrap.c	/^SWIGINTERN struct Db *new_Db(DB_ENV *dbenv,u_int32/
+new_DbEnv	../libdb_java/db_java_wrap.c	/^SWIGINTERN struct DbEnv *new_DbEnv(u_int32_t flags/
+new_DbSequence	../libdb_java/db_java_wrap.c	/^SWIGINTERN struct DbSequence *new_DbSequence(DB *d/
 new_ct_ent	../rpc_server/c/db_server_util.c	/^new_ct_ent(errp)$/
+next	../cxx/cxx_multi.cpp	/^bool DbMultipleDataIterator::next(Dbt &data)$/
 nextkey	../dbinc/db.in	/^#define	nextkey(a)	__db_dbm_nextkey@DB_VERSION_UNI/
-onint	../common/util_sig.c	/^onint(signo)$/
+notify_handshake	../repmgr/repmgr_sel.c	/^notify_handshake(dbenv, conn)$/
+op_is_remove	../mp/mp_method.c	/^#define	op_is_remove	(newname == NULL)$/
+os_pid_t	../mutex/tm.c	/^typedef HANDLE os_pid_t;$/
+os_spawn	../mutex/tm.c	/^os_spawn(path, argv)$/
+os_thread_create	../mutex/tm.c	/^#define	os_thread_create(thrp, attr, func, arg)			/
+os_thread_join	../mutex/tm.c	/^#define	os_thread_join(thr, statusp)					\\$/
+os_thread_self	../mutex/tm.c	/^#define	os_thread_self() GetCurrentThreadId()$/
+os_thread_t	../mutex/tm.c	/^typedef HANDLE os_thread_t;$/
+os_wait	../mutex/tm.c	/^os_wait(procs, nprocs)$/
+p_	../cxx/cxx_multi.cpp	/^   p_((u_int32_t*)(data_ + dbt.get_ulen() - sizeof/
 pg_Cmd	../tcl/tcl_mp.c	/^pg_Cmd(clientData, interp, objc, objv)$/
-pgin_fcn_type	../dbinc/db_cxx.in	167
-pgno_t	../dbinc/db_185.in	76
-pgout_fcn_type	../dbinc/db_cxx.in	169
+pgcmds	../tcl/tcl_mp.c	/^	enum pgcmds {$/
+pgcookie	../dbinc/db_cxx.in	/^		(DB_ENV *dbenv, db_pgno_t pgno, void *pgaddr, DB/
+pget	../cxx/cxx_db.cpp	/^int Db::pget(DbTxn *txnid, Dbt *key, Dbt *pkey, Db/
+pglist	../dbinc/db_page.h	/^struct pglist {$/
+pgno_t	../dbinc/db_185.in	/^#define	pgno_t	db_pgno_t$/
+pgopt	../tcl/tcl_mp.c	/^	enum pgopt {$/
+phase_t	../dbinc/repmgr.h	/^} phase_t;$/
+printf	../clib/printf.c	/^printf(fmt, va_alist)$/
+process_message	../repmgr/repmgr_msg.c	/^process_message(dbenv, control, rec, eid)$/
 pthread_cond_destroy	../mutex/mut_pthread.c	/^#define	pthread_cond_destroy(x)		0$/
-pthread_cond_signal	../mutex/mut_pthread.c	33
-pthread_cond_wait	../mutex/mut_pthread.c	34
+pthread_cond_signal	../mutex/mut_pthread.c	/^#define	pthread_cond_signal		_lwp_cond_signal$/
+pthread_cond_wait	../mutex/mut_pthread.c	/^#define	pthread_cond_wait		_lwp_cond_wait$/
 pthread_mutex_destroy	../mutex/mut_pthread.c	/^#define	pthread_mutex_destroy(x)	0$/
-pthread_mutex_lock	../mutex/mut_pthread.c	36
-pthread_mutex_trylock	../mutex/mut_pthread.c	37
-pthread_mutex_unlock	../mutex/mut_pthread.c	38
-pthread_self	../mutex/mut_pthread.c	54
-qam_name_op	../dbinc/qam.h	166
-qam_position_mode	../dbinc/qam.h	151
-qam_probe_mode	../dbinc/qam.h	157
+pthread_mutex_lock	../mutex/mut_pthread.c	/^#define	pthread_mutex_lock		_lwp_mutex_lock$/
+pthread_mutex_trylock	../mutex/mut_pthread.c	/^#define	pthread_mutex_trylock		_lwp_mutex_trylock$/
+pthread_mutex_unlock	../mutex/mut_pthread.c	/^#define	pthread_mutex_unlock		_lwp_mutex_unlock$/
+qam_name_op	../dbinc/qam.h	/^} qam_name_op;$/
+qam_probe_mode	../dbinc/qam.h	/^} qam_probe_mode;$/
+qm_trace	../dbinc/queue.h	/^struct qm_trace {$/
 raise	../clib/raise.c	/^raise(s)$/
-recno_t	../dbinc/db_185.in	84
-reg_type_t	../dbinc/region.h	117
-repdb_t	../dbinc/rep.h	98
-retval	../hsearch/hsearch.c	/^static ENTRY	 retval;$/
-roff_t	../dbinc/db.in	121
+rand	../clib/rand.c	/^int rand(void)	\/* RAND_MAX assumed to be 32767 */
+rcmds	../tcl/tcl_util.c	/^	enum rcmds {$/
+recno_t	../dbinc/db_185.in	/^typedef u_int32_t	recno_t;$/
+record_ack	../repmgr/repmgr_sel.c	/^record_ack(dbenv, site, ack)$/
+reg_type_t	../dbinc/region.h	/^	REGION_TYPE_TXN } reg_type_t;$/
+remove	../cxx/cxx_env.cpp	/^int DbEnv::remove(const char *db_home, u_int32_t f/
+rep_send_callback_	../cxx/cxx_env.cpp	/^,	rep_send_callback_(0)$/
+repdb_t	../dbinc/rep.h	/^} repdb_t;$/
+repmgr_netaddr_t	../dbinc/repmgr.h	/^} repmgr_netaddr_t;$/
+repmgr_timeval_t	../dbinc/repmgr.h	/^} repmgr_timeval_t;$/
+rmgr	../tcl/tcl_rep.c	/^	enum rmgr {$/
+roff_t	../dbinc/db.in	/^typedef	uintptr_t	roff_t;$/
 rol	../hmac/sha1.c	/^#define rol(value, bits) (((value) << (bits)) | ((/
-run_locker	../mutex/tm.c	/^run_locker(id)$/
 run_lthread	../mutex/tm.c	/^run_lthread(arg)$/
-run_wakeup	../mutex/tm.c	/^run_wakeup(id)$/
 run_wthread	../mutex/tm.c	/^run_wthread(arg)$/
+runtime_error	../cxx/cxx_env.cpp	/^\/\/ Report an error associated with the DbEnv.$/
+runtime_error_dbt	../cxx/cxx_env.cpp	/^\/\/ Like DbEnv::runtime_error, but issue a DbMemo/
+runtime_error_lock_get	../cxx/cxx_env.cpp	/^\/\/ Like DbEnv::runtime_error, but issue a DbLock/
+select_timeout_t	../dbinc/repmgr.h	/^typedef DWORD select_timeout_t;$/
+sending_msg	../repmgr/repmgr_net.c	/^struct sending_msg {$/
 seq_Cmd	../tcl/tcl_seq.c	/^seq_Cmd(clientData, interp, objc, objv)$/
-shm_open	../mutex/tm.c	25
-shm_unlink	../mutex/tm.c	26
-snprintf	../clib/snprintf.c	/^snprintf(char *str, size_t n, const char *fmt, .../
+seqcmds	../tcl/tcl_seq.c	/^	enum seqcmds {$/
+seqgetopts	../tcl/tcl_seq.c	/^	enum seqgetopts {$/
+seqopen	../tcl/tcl_db_pkg.c	/^	enum seqopen {$/
+set_env	../cxx/cxx_except.cpp	/^void DbException::set_env(DbEnv *env)$/
+set_error_stream	../cxx/cxx_env.cpp	/^void DbEnv::set_error_stream(__DB_STD(ostream) *st/
+set_event_notify	../cxx/cxx_env.cpp	/^int DbEnv::set_event_notify(void (*arg)(DbEnv *, u/
+set_feedback	../cxx/cxx_env.cpp	/^int DbEnv::set_feedback(void (*arg)(DbEnv *, int, /
+set_message_stream	../cxx/cxx_env.cpp	/^void DbEnv::set_message_stream(__DB_STD(ostream) */
+set_paniccall	../cxx/cxx_env.cpp	/^int DbEnv::set_paniccall(void (*arg)(DbEnv *, int)/
+set_signal	../common/util_sig.c	/^set_signal(s, is_dflt)$/
+set_thread_id_string	../cxx/cxx_env.cpp	/^int DbEnv::set_thread_id_string($/
+setup_sending_msg	../repmgr/repmgr_net.c	/^setup_sending_msg(msg, type, control, rec)$/
+sfonoff	../tcl/tcl_env.c	/^	enum sfonoff {$/
+sfwhich	../tcl/tcl_env.c	/^	enum sfwhich {$/
+signal_handler	../common/util_sig.c	/^signal_handler(signo)$/
+size_t	../dbinc/db_cxx.in	/^		(size_t);$/
+snprintf	../clib/snprintf.c	/^snprintf(str, n, fmt, va_alist)$/
+socket_t	../dbinc/repmgr.h	/^typedef SOCKET socket_t;$/
+socklen_t	../dbinc/repmgr.h	/^typedef int socklen_t;$/
+sockopt_t	../dbinc/repmgr.h	/^typedef char * sockopt_t;$/
+spawn_proc	../mutex/tm.c	/^spawn_proc(id, tmpath, typearg)$/
 sprintf_overflow	../clib/snprintf.c	/^sprintf_overflow()$/
 sprintf_retcharpnt	../clib/snprintf.c	/^sprintf_retcharpnt()$/
+srand	../clib/rand.c	/^void srand(unsigned int seed)$/
+srchacts	../tcl/tcl_compat.c	/^	enum srchacts {$/
+start_election_thread	../repmgr/repmgr_elect.c	/^start_election_thread(dbenv)$/
+stflag	../tcl/tcl_compat.c	/^	enum stflag {$/
 store	../dbinc/db.in	/^#define	store(a, b)	__db_dbm_store@DB_VERSION_UNIQ/
 strcasecmp	../clib/strcasecmp.c	/^strcasecmp(s1, s2)$/
+strcat	../clib/strcat.c	/^strcat(char *s, const char *append)$/
+strchr	../clib/strchr.c	/^char *strchr(const char *p, int ch)$/
 strdup	../clib/strdup.c	/^strdup(str)$/
 strerror	../clib/strerror.c	/^strerror(num)$/
 strncasecmp	../clib/strcasecmp.c	/^strncasecmp(s1, s2, n)$/
+strncat	../clib/strncat.c	/^strncat(char *dst, const char *src, size_t n)$/
+strncmp	../clib/strncmp.c	/^strncmp(s1, s2, n)$/
+strrchr	../clib/strrchr.c	/^char *strrchr(const char *p, int ch)$/
+strsep	../clib/strsep.c	/^strsep(stringp, delim)$/
 strtol	../clib/strtol.c	/^strtol(nptr, endptr, base)$/
 strtoul	../clib/strtoul.c	/^strtoul(nptr, endptr, base)$/
+tcl_CDSGroup	../tcl/tcl_txn.c	/^tcl_CDSGroup(interp, objc, objv, envp, envip)$/
 tcl_DbAssociate	../tcl/tcl_db.c	/^tcl_DbAssociate(interp, objc, objv, dbp)$/
 tcl_DbClose	../tcl/tcl_db.c	/^tcl_DbClose(interp, objc, objv, dbp, dbip)$/
-tcl_DbCount	../tcl/tcl_db.c	/^tcl_DbCount(interp, objc, objv, dbp)$/
 tcl_DbCursor	../tcl/tcl_db.c	/^tcl_DbCursor(interp, objc, objv, dbp, dbcp)$/
 tcl_DbDelete	../tcl/tcl_db.c	/^tcl_DbDelete(interp, objc, objv, dbp)$/
 tcl_DbGet	../tcl/tcl_db.c	/^tcl_DbGet(interp, objc, objv, dbp, ispget)$/
-tcl_DbGetFlags	../tcl/tcl_db.c	/^tcl_DbGetFlags(interp, objc, objv, dbp)$/
-tcl_DbGetOpenFlags	../tcl/tcl_db.c	/^tcl_DbGetOpenFlags(interp, objc, objv, dbp)$/
-tcl_DbGetjoin	../tcl/tcl_db.c	/^tcl_DbGetjoin(interp, objc, objv, dbp)$/
-tcl_DbJoin	../tcl/tcl_db.c	/^tcl_DbJoin(interp, objc, objv, dbp, dbcp)$/
-tcl_DbKeyRange	../tcl/tcl_db.c	/^tcl_DbKeyRange(interp, objc, objv, dbp)$/
 tcl_DbPut	../tcl/tcl_db.c	/^tcl_DbPut(interp, objc, objv, dbp)$/
 tcl_DbStat	../tcl/tcl_db.c	/^tcl_DbStat(interp, objc, objv, dbp)$/
-tcl_DbTruncate	../tcl/tcl_db.c	/^tcl_DbTruncate(interp, objc, objv, dbp)$/
 tcl_DbcDup	../tcl/tcl_dbcursor.c	/^tcl_DbcDup(interp, objc, objv, dbc)$/
 tcl_DbcGet	../tcl/tcl_dbcursor.c	/^tcl_DbcGet(interp, objc, objv, dbc, ispget)$/
 tcl_DbcPut	../tcl/tcl_dbcursor.c	/^tcl_DbcPut(interp, objc, objv, dbc)$/
 tcl_EnvAttr	../tcl/tcl_env.c	/^tcl_EnvAttr(interp, objc, objv, dbenv)$/
 tcl_EnvGetEncryptFlags	../tcl/tcl_env.c	/^tcl_EnvGetEncryptFlags(interp, objc, objv, dbenv)$/
+tcl_EnvIdReset	../tcl/tcl_env.c	/^tcl_EnvIdReset(interp, objc, objv, dbenv)$/
+tcl_EnvLsnReset	../tcl/tcl_env.c	/^tcl_EnvLsnReset(interp, objc, objv, dbenv)$/
 tcl_EnvRemove	../tcl/tcl_env.c	/^tcl_EnvRemove(interp, objc, objv, dbenv, envip)$/
 tcl_EnvSetErrfile	../tcl/tcl_env.c	/^tcl_EnvSetErrfile(interp, dbenv, ip, errf)$/
 tcl_EnvSetErrpfx	../tcl/tcl_env.c	/^tcl_EnvSetErrpfx(interp, dbenv, ip, pfx)$/
 tcl_EnvSetFlags	../tcl/tcl_env.c	/^tcl_EnvSetFlags(interp, dbenv, which, onoff)$/
 tcl_EnvTest	../tcl/tcl_env.c	/^tcl_EnvTest(interp, objc, objv, dbenv)$/
 tcl_EnvVerbose	../tcl/tcl_env.c	/^tcl_EnvVerbose(interp, dbenv, which, onoff)$/
+tcl_EventNotify	../tcl/tcl_env.c	/^tcl_EventNotify(interp, dbenv, eobj, ip)$/
 tcl_LockDetect	../tcl/tcl_lock.c	/^tcl_LockDetect(interp, objc, objv, envp)$/
 tcl_LockGet	../tcl/tcl_lock.c	/^tcl_LockGet(interp, objc, objv, envp)$/
 tcl_LockStat	../tcl/tcl_lock.c	/^tcl_LockStat(interp, objc, objv, envp)$/
@@ -4261,17 +4877,21 @@ tcl_MpGet	../tcl/tcl_mp.c	/^tcl_MpGet(interp, objc, objv, mp, mpip)$/
 tcl_MpStat	../tcl/tcl_mp.c	/^tcl_MpStat(interp, objc, objv, envp)$/
 tcl_MpSync	../tcl/tcl_mp.c	/^tcl_MpSync(interp, objc, objv, envp)$/
 tcl_MpTrickle	../tcl/tcl_mp.c	/^tcl_MpTrickle(interp, objc, objv, envp)$/
-tcl_Mutex	../tcl/tcl_util.c	/^tcl_Mutex(interp, objc, objv, envp, envip)$/
 tcl_Pg	../tcl/tcl_mp.c	/^tcl_Pg(interp, objc, objv, page, mp, pgip, putop)$/
 tcl_PgInit	../tcl/tcl_mp.c	/^tcl_PgInit(interp, objc, objv, page, pgip)$/
 tcl_PgIsset	../tcl/tcl_mp.c	/^tcl_PgIsset(interp, objc, objv, page, pgip)$/
+tcl_RepConfig	../tcl/tcl_rep.c	/^tcl_RepConfig(interp, dbenv, list)$/
 tcl_RepElect	../tcl/tcl_rep.c	/^tcl_RepElect(interp, objc, objv, dbenv)$/
 tcl_RepFlush	../tcl/tcl_rep.c	/^tcl_RepFlush(interp, objc, objv, dbenv)$/
+tcl_RepGetConfig	../tcl/tcl_rep.c	/^tcl_RepGetConfig(interp, dbenv, which)$/
 tcl_RepLimit	../tcl/tcl_rep.c	/^tcl_RepLimit(interp, objc, objv, dbenv)$/
+tcl_RepMgr	../tcl/tcl_rep.c	/^tcl_RepMgr(interp, objc, objv, dbenv)$/
 tcl_RepProcessMessage	../tcl/tcl_rep.c	/^tcl_RepProcessMessage(interp, objc, objv, dbenv)$/
 tcl_RepRequest	../tcl/tcl_rep.c	/^tcl_RepRequest(interp, objc, objv, dbenv)$/
 tcl_RepStart	../tcl/tcl_rep.c	/^tcl_RepStart(interp, objc, objv, dbenv)$/
 tcl_RepStat	../tcl/tcl_rep.c	/^tcl_RepStat(interp, objc, objv, dbenv)$/
+tcl_RepSync	../tcl/tcl_rep.c	/^tcl_RepSync(interp, objc, objv, dbenv)$/
+tcl_RepTransport	../tcl/tcl_rep.c	/^tcl_RepTransport(interp, objc, objv, dbenv, ip)$/
 tcl_SeqClose	../tcl/tcl_seq.c	/^tcl_SeqClose(interp, objc, objv, seq, ip)$/
 tcl_SeqGet	../tcl/tcl_seq.c	/^tcl_SeqGet(interp, objc, objv, seq)$/
 tcl_SeqGetFlags	../tcl/tcl_seq.c	/^tcl_SeqGetFlags(interp, objc, objv, seq)$/
@@ -4291,22 +4911,41 @@ tcl_db_realloc	../tcl/tcl_db_pkg.c	/^tcl_db_realloc(ptr, size)$/
 tcl_dup_compare	../tcl/tcl_db_pkg.c	/^tcl_dup_compare(dbp, dbta, dbtb)$/
 tcl_h_hash	../tcl/tcl_db_pkg.c	/^tcl_h_hash(dbp, buf, len)$/
 tcl_rep_send	../tcl/tcl_db_pkg.c	/^tcl_rep_send(dbenv, control, rec, lsnp, eid, flags/
-tcl_second_call	../tcl/tcl_db.c	/^tcl_second_call(dbp, pkey, data, skey)$/
+tclrpstrt	../tcl/tcl_rep.c	/^	enum tclrpstrt {$/
+thread_id_t	../dbinc/repmgr.h	/^typedef HANDLE thread_id_t;$/
+threadsync_timeout_t	../dbinc/repmgr.h	/^typedef DWORD threadsync_timeout_t;$/
+tm_env_close	../mutex/tm.c	/^tm_env_close()$/
+tm_env_init	../mutex/tm.c	/^tm_env_init()$/
 tm_file_init	../mutex/tm.c	/^tm_file_init()$/
 tm_mutex_destroy	../mutex/tm.c	/^tm_mutex_destroy()$/
 tm_mutex_init	../mutex/tm.c	/^tm_mutex_init()$/
 tm_mutex_stats	../mutex/tm.c	/^tm_mutex_stats()$/
-tsl_t	../dbinc/mutex.h	79
+tsl_t	../dbinc/mutex_int.h	/^typedef int tsl_t;$/
 txn_Cmd	../tcl/tcl_txn.c	/^txn_Cmd(clientData, interp, objc, objv)$/
-txnop_t	../txn/txn.c	96
-u16	../crypto/rijndael/rijndael-alg-fst.h	37
-u32	../crypto/rijndael/rijndael-alg-fst.h	38
-u8	../crypto/rijndael/rijndael-alg-fst.h	36
-unmap_file	../mutex/tm.c	/^unmap_file(addr, fd)$/
+txn_begin	../cxx/cxx_env.cpp	/^int DbEnv::txn_begin(DbTxn *pid, DbTxn **tid, u_in/
+txnckpopts	../tcl/tcl_txn.c	/^	enum txnckpopts {$/
+txncmds	../tcl/tcl_txn.c	/^	enum txncmds {$/
+txnop_t	../txn/txn.c	/^} txnop_t;$/
+txnopts	../tcl/tcl_txn.c	/^	enum txnopts {$/
+u16	../crypto/rijndael/rijndael-alg-fst.h	/^typedef u_int16_t	u16;$/
+u32	../crypto/rijndael/rijndael-alg-fst.h	/^typedef u_int32_t	u32;$/
+u8	../crypto/rijndael/rijndael-alg-fst.h	/^typedef u_int8_t	u8;$/
+u_int32_t	../dbinc/db_cxx.in	/^		(DB *, const void *, u_int32_t);$/
+unmap_file	../mutex/tm.c	/^unmap_file(addr, fhp)$/
 usage	../mutex/tm.c	/^usage()$/
-val	../dbinc/tcl_db.h	43
+verbonoff	../tcl/tcl_env.c	/^	enum verbonoff {$/
+verbwhich	../tcl/tcl_env.c	/^	enum verbwhich {$/
 version_check	../rpc_server/c/db_server_util.c	/^version_check()$/
+vfprintf	../clib/printf.c	/^vfprintf(fp, fmt, ap)$/
+void	../dbinc/db_cxx.in	/^		(void *);$/
 vsnprintf	../clib/snprintf.c	/^vsnprintf(str, n, fmt, ap)$/
-wmask	../clib/memmove.c	53
-word	../clib/memmove.c	48
-wsize	../clib/memmove.c	51
+wakeup_start	../mutex/tm.c	/^wakeup_start(id)$/
+wakeup_wait	../mutex/tm.c	/^wakeup_wait()$/
+what	../cxx/cxx_except.cpp	/^const char *DbException::what() const throw()$/
+wmask	../clib/memmove.c	/^#define	wmask	(wsize - 1)$/
+word	../clib/memmove.c	/^typedef	int word;		\/* "word" used for optimal cop/
+wrap_DB_ENV	../cxx/cxx_env.cpp	/^\/\/ static method$/
+wrap_DB_SEQUENCE	../cxx/cxx_seq.cpp	/^\/\/ static method$/
+wsize	../clib/memmove.c	/^#define	wsize	sizeof(word)$/
+xa_switch_t	../dbinc/xa.h	/^struct xa_switch_t {$/
+xid_t	../dbinc/xa.h	/^struct xid_t {$/
diff --git a/db/dist/template/db_server_proc b/db/dist/template/db_server_proc
index 224c83684..04ada6b5d 100644
--- a/db/dist/template/db_server_proc
+++ b/db/dist/template/db_server_proc
@@ -1,32 +1,21 @@
 #include "db_config.h"
 
+#include "db_int.h"
 #ifndef NO_SYSTEM_INCLUDES
-#include 
-
 #include 
-
-#include 
 #endif
-
 #include "db_server.h"
-
-#include "db_int.h"
 #include "dbinc/db_server_int.h"
 
-/* BEGIN __env_get_cachesize_proc */
+/* BEGIN __env_create_proc */
 void
-__env_get_cachesize_proc(dbenvcl_id,
-		replyp)
-	long dbenvcl_id;
-	__env_get_cachesize_reply *replyp;
-/* END __env_get_cachesize_proc */
+__env_create_proc(timeout, replyp)
+	u_int32_t timeout;
+	__env_create_reply *replyp;
+/* END __env_create_proc */
 {
 	int ret;
-	DB_ENV * dbenv;
-	ct_entry *dbenv_ctp;
 
-	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
-	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -36,16 +25,12 @@ __env_get_cachesize_proc(dbenvcl_id,
 	return;
 }
 
-/* BEGIN __env_cachesize_proc */
+/* BEGIN __env_cdsgroup_begin_proc */
 void
-__env_cachesize_proc(dbenvcl_id, gbytes, bytes,
-		ncache, replyp)
-	long dbenvcl_id;
-	u_int32_t gbytes;
-	u_int32_t bytes;
-	u_int32_t ncache;
-	__env_cachesize_reply *replyp;
-/* END __env_cachesize_proc */
+__env_cdsgroup_begin_proc(dbenvcl_id, replyp)
+	unsigned int dbenvcl_id;
+	__env_cdsgroup_begin_reply *replyp;
+/* END __env_cdsgroup_begin_proc */
 {
 	int ret;
 	DB_ENV * dbenv;
@@ -65,7 +50,7 @@ __env_cachesize_proc(dbenvcl_id, gbytes, bytes,
 /* BEGIN __env_close_proc */
 void
 __env_close_proc(dbenvcl_id, flags, replyp)
-	long dbenvcl_id;
+	unsigned int dbenvcl_id;
 	u_int32_t flags;
 	__env_close_reply *replyp;
 /* END __env_close_proc */
@@ -85,30 +70,12 @@ __env_close_proc(dbenvcl_id, flags, replyp)
 	return;
 }
 
-/* BEGIN __env_create_proc */
-void
-__env_create_proc(timeout, replyp)
-	u_int32_t timeout;
-	__env_create_reply *replyp;
-/* END __env_create_proc */
-{
-	int ret;
-
-
-	/*
-	 * XXX Code goes here
-	 */
-
-	replyp->status = ret;
-	return;
-}
-
 /* BEGIN __env_dbremove_proc */
 void
 __env_dbremove_proc(dbenvcl_id, txnpcl_id, name,
 		subdb, flags, replyp)
-	long dbenvcl_id;
-	long txnpcl_id;
+	unsigned int dbenvcl_id;
+	unsigned int txnpcl_id;
 	char *name;
 	char *subdb;
 	u_int32_t flags;
@@ -138,8 +105,8 @@ __env_dbremove_proc(dbenvcl_id, txnpcl_id, name,
 void
 __env_dbrename_proc(dbenvcl_id, txnpcl_id, name,
 		subdb, newname, flags, replyp)
-	long dbenvcl_id;
-	long txnpcl_id;
+	unsigned int dbenvcl_id;
+	unsigned int txnpcl_id;
 	char *name;
 	char *subdb;
 	char *newname;
@@ -166,12 +133,13 @@ __env_dbrename_proc(dbenvcl_id, txnpcl_id, name,
 	return;
 }
 
-/* BEGIN __env_get_encrypt_flags_proc */
+/* BEGIN __env_get_cachesize_proc */
 void
-__env_get_encrypt_flags_proc(dbenvcl_id, replyp)
-	long dbenvcl_id;
-	__env_get_encrypt_flags_reply *replyp;
-/* END __env_get_encrypt_flags_proc */
+__env_get_cachesize_proc(dbenvcl_id,
+		replyp)
+	unsigned int dbenvcl_id;
+	__env_get_cachesize_reply *replyp;
+/* END __env_get_cachesize_proc */
 {
 	int ret;
 	DB_ENV * dbenv;
@@ -188,14 +156,12 @@ __env_get_encrypt_flags_proc(dbenvcl_id, replyp)
 	return;
 }
 
-/* BEGIN __env_encrypt_proc */
+/* BEGIN __env_get_encrypt_flags_proc */
 void
-__env_encrypt_proc(dbenvcl_id, passwd, flags, replyp)
-	long dbenvcl_id;
-	char *passwd;
-	u_int32_t flags;
-	__env_encrypt_reply *replyp;
-/* END __env_encrypt_proc */
+__env_get_encrypt_flags_proc(dbenvcl_id, replyp)
+	unsigned int dbenvcl_id;
+	__env_get_encrypt_flags_reply *replyp;
+/* END __env_get_encrypt_flags_proc */
 {
 	int ret;
 	DB_ENV * dbenv;
@@ -215,7 +181,7 @@ __env_encrypt_proc(dbenvcl_id, passwd, flags, replyp)
 /* BEGIN __env_get_flags_proc */
 void
 __env_get_flags_proc(dbenvcl_id, replyp)
-	long dbenvcl_id;
+	unsigned int dbenvcl_id;
 	__env_get_flags_reply *replyp;
 /* END __env_get_flags_proc */
 {
@@ -234,34 +200,10 @@ __env_get_flags_proc(dbenvcl_id, replyp)
 	return;
 }
 
-/* BEGIN __env_flags_proc */
-void
-__env_flags_proc(dbenvcl_id, flags, onoff, replyp)
-	long dbenvcl_id;
-	u_int32_t flags;
-	u_int32_t onoff;
-	__env_flags_reply *replyp;
-/* END __env_flags_proc */
-{
-	int ret;
-	DB_ENV * dbenv;
-	ct_entry *dbenv_ctp;
-
-	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
-	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
-
-	/*
-	 * XXX Code goes here
-	 */
-
-	replyp->status = ret;
-	return;
-}
-
 /* BEGIN __env_get_home_proc */
 void
 __env_get_home_proc(dbenvcl_id, replyp)
-	long dbenvcl_id;
+	unsigned int dbenvcl_id;
 	__env_get_home_reply *replyp;
 /* END __env_get_home_proc */
 {
@@ -283,7 +225,7 @@ __env_get_home_proc(dbenvcl_id, replyp)
 /* BEGIN __env_get_open_flags_proc */
 void
 __env_get_open_flags_proc(dbenvcl_id, replyp)
-	long dbenvcl_id;
+	unsigned int dbenvcl_id;
 	__env_get_open_flags_reply *replyp;
 /* END __env_get_open_flags_proc */
 {
@@ -306,7 +248,7 @@ __env_get_open_flags_proc(dbenvcl_id, replyp)
 void
 __env_open_proc(dbenvcl_id, home, flags,
 		mode, replyp)
-	long dbenvcl_id;
+	unsigned int dbenvcl_id;
 	char *home;
 	u_int32_t flags;
 	u_int32_t mode;
@@ -331,7 +273,7 @@ __env_open_proc(dbenvcl_id, home, flags,
 /* BEGIN __env_remove_proc */
 void
 __env_remove_proc(dbenvcl_id, home, flags, replyp)
-	long dbenvcl_id;
+	unsigned int dbenvcl_id;
 	char *home;
 	u_int32_t flags;
 	__env_remove_reply *replyp;
@@ -352,19 +294,23 @@ __env_remove_proc(dbenvcl_id, home, flags, replyp)
 	return;
 }
 
-/* BEGIN __txn_abort_proc */
+/* BEGIN __env_set_cachesize_proc */
 void
-__txn_abort_proc(txnpcl_id, replyp)
-	long txnpcl_id;
-	__txn_abort_reply *replyp;
-/* END __txn_abort_proc */
+__env_set_cachesize_proc(dbenvcl_id, gbytes, bytes,
+		ncache, replyp)
+	unsigned int dbenvcl_id;
+	u_int32_t gbytes;
+	u_int32_t bytes;
+	u_int32_t ncache;
+	__env_set_cachesize_reply *replyp;
+/* END __env_set_cachesize_proc */
 {
 	int ret;
-	DB_TXN * txnp;
-	ct_entry *txnp_ctp;
+	DB_ENV * dbenv;
+	ct_entry *dbenv_ctp;
 
-	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
-	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -374,26 +320,21 @@ __txn_abort_proc(txnpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __txn_begin_proc */
+/* BEGIN __env_set_encrypt_proc */
 void
-__txn_begin_proc(dbenvcl_id, parentcl_id,
-		flags, replyp)
-	long dbenvcl_id;
-	long parentcl_id;
+__env_set_encrypt_proc(dbenvcl_id, passwd, flags, replyp)
+	unsigned int dbenvcl_id;
+	char *passwd;
 	u_int32_t flags;
-	__txn_begin_reply *replyp;
-/* END __txn_begin_proc */
+	__env_set_encrypt_reply *replyp;
+/* END __env_set_encrypt_proc */
 {
 	int ret;
 	DB_ENV * dbenv;
 	ct_entry *dbenv_ctp;
-	DB_TXN * parent;
-	ct_entry *parent_ctp;
 
 	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
 	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
-	ACTIVATE_CTP(parent_ctp, parentcl_id, CT_TXN);
-	parent = (DB_TXN *)parent_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -403,20 +344,21 @@ __txn_begin_proc(dbenvcl_id, parentcl_id,
 	return;
 }
 
-/* BEGIN __txn_commit_proc */
+/* BEGIN __env_set_flags_proc */
 void
-__txn_commit_proc(txnpcl_id, flags, replyp)
-	long txnpcl_id;
+__env_set_flags_proc(dbenvcl_id, flags, onoff, replyp)
+	unsigned int dbenvcl_id;
 	u_int32_t flags;
-	__txn_commit_reply *replyp;
-/* END __txn_commit_proc */
+	u_int32_t onoff;
+	__env_set_flags_reply *replyp;
+/* END __env_set_flags_proc */
 {
 	int ret;
-	DB_TXN * txnp;
-	ct_entry *txnp_ctp;
+	DB_ENV * dbenv;
+	ct_entry *dbenv_ctp;
 
-	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
-	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -426,20 +368,26 @@ __txn_commit_proc(txnpcl_id, flags, replyp)
 	return;
 }
 
-/* BEGIN __txn_discard_proc */
+/* BEGIN __env_txn_begin_proc */
 void
-__txn_discard_proc(txnpcl_id, flags, replyp)
-	long txnpcl_id;
+__env_txn_begin_proc(dbenvcl_id, parentcl_id,
+		flags, replyp)
+	unsigned int dbenvcl_id;
+	unsigned int parentcl_id;
 	u_int32_t flags;
-	__txn_discard_reply *replyp;
-/* END __txn_discard_proc */
+	__env_txn_begin_reply *replyp;
+/* END __env_txn_begin_proc */
 {
 	int ret;
-	DB_TXN * txnp;
-	ct_entry *txnp_ctp;
+	DB_ENV * dbenv;
+	ct_entry *dbenv_ctp;
+	DB_TXN * parent;
+	ct_entry *parent_ctp;
 
-	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
-	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+	ACTIVATE_CTP(parent_ctp, parentcl_id, CT_TXN);
+	parent = (DB_TXN *)parent_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -449,20 +397,23 @@ __txn_discard_proc(txnpcl_id, flags, replyp)
 	return;
 }
 
-/* BEGIN __txn_prepare_proc */
+/* BEGIN __env_txn_recover_proc */
 void
-__txn_prepare_proc(txnpcl_id, gid, replyp)
-	long txnpcl_id;
-	u_int8_t *gid;
-	__txn_prepare_reply *replyp;
-/* END __txn_prepare_proc */
+__env_txn_recover_proc(dbenvcl_id, count,
+		flags, replyp, freep)
+	unsigned int dbenvcl_id;
+	u_int32_t count;
+	u_int32_t flags;
+	__env_txn_recover_reply *replyp;
+	int * freep;
+/* END __env_txn_recover_proc */
 {
 	int ret;
-	DB_TXN * txnp;
-	ct_entry *txnp_ctp;
+	DB_ENV * dbenv;
+	ct_entry *dbenv_ctp;
 
-	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
-	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -472,16 +423,13 @@ __txn_prepare_proc(txnpcl_id, gid, replyp)
 	return;
 }
 
-/* BEGIN __txn_recover_proc */
+/* BEGIN __db_create_proc */
 void
-__txn_recover_proc(dbenvcl_id, count,
-		flags, replyp, freep)
-	long dbenvcl_id;
-	u_int32_t count;
+__db_create_proc(dbenvcl_id, flags, replyp)
+	unsigned int dbenvcl_id;
 	u_int32_t flags;
-	__txn_recover_reply *replyp;
-	int * freep;
-/* END __txn_recover_proc */
+	__db_create_reply *replyp;
+/* END __db_create_proc */
 {
 	int ret;
 	DB_ENV * dbenv;
@@ -502,9 +450,9 @@ __txn_recover_proc(dbenvcl_id, count,
 void
 __db_associate_proc(dbpcl_id, txnpcl_id, sdbpcl_id,
 		flags, replyp)
-	long dbpcl_id;
-	long txnpcl_id;
-	long sdbpcl_id;
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
+	unsigned int sdbpcl_id;
 	u_int32_t flags;
 	__db_associate_reply *replyp;
 /* END __db_associate_proc */
@@ -532,78 +480,10 @@ __db_associate_proc(dbpcl_id, txnpcl_id, sdbpcl_id,
 	return;
 }
 
-/* BEGIN __db_bt_maxkey_proc */
-void
-__db_bt_maxkey_proc(dbpcl_id, maxkey, replyp)
-	long dbpcl_id;
-	u_int32_t maxkey;
-	__db_bt_maxkey_reply *replyp;
-/* END __db_bt_maxkey_proc */
-{
-	int ret;
-	DB * dbp;
-	ct_entry *dbp_ctp;
-
-	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
-	dbp = (DB *)dbp_ctp->ct_anyp;
-
-	/*
-	 * XXX Code goes here
-	 */
-
-	replyp->status = ret;
-	return;
-}
-
-/* BEGIN __db_get_bt_minkey_proc */
-void
-__db_get_bt_minkey_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_bt_minkey_reply *replyp;
-/* END __db_get_bt_minkey_proc */
-{
-	int ret;
-	DB * dbp;
-	ct_entry *dbp_ctp;
-
-	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
-	dbp = (DB *)dbp_ctp->ct_anyp;
-
-	/*
-	 * XXX Code goes here
-	 */
-
-	replyp->status = ret;
-	return;
-}
-
-/* BEGIN __db_bt_minkey_proc */
-void
-__db_bt_minkey_proc(dbpcl_id, minkey, replyp)
-	long dbpcl_id;
-	u_int32_t minkey;
-	__db_bt_minkey_reply *replyp;
-/* END __db_bt_minkey_proc */
-{
-	int ret;
-	DB * dbp;
-	ct_entry *dbp_ctp;
-
-	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
-	dbp = (DB *)dbp_ctp->ct_anyp;
-
-	/*
-	 * XXX Code goes here
-	 */
-
-	replyp->status = ret;
-	return;
-}
-
 /* BEGIN __db_close_proc */
 void
 __db_close_proc(dbpcl_id, flags, replyp)
-	long dbpcl_id;
+	unsigned int dbpcl_id;
 	u_int32_t flags;
 	__db_close_reply *replyp;
 /* END __db_close_proc */
@@ -623,20 +503,26 @@ __db_close_proc(dbpcl_id, flags, replyp)
 	return;
 }
 
-/* BEGIN __db_create_proc */
+/* BEGIN __db_cursor_proc */
 void
-__db_create_proc(dbenvcl_id, flags, replyp)
-	long dbenvcl_id;
+__db_cursor_proc(dbpcl_id, txnpcl_id,
+		flags, replyp)
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
 	u_int32_t flags;
-	__db_create_reply *replyp;
-/* END __db_create_proc */
+	__db_cursor_reply *replyp;
+/* END __db_cursor_proc */
 {
 	int ret;
-	DB_ENV * dbenv;
-	ct_entry *dbenv_ctp;
+	DB * dbp;
+	ct_entry *dbp_ctp;
+	DB_TXN * txnp;
+	ct_entry *txnp_ctp;
 
-	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
-	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+	dbp = (DB *)dbp_ctp->ct_anyp;
+	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -651,8 +537,8 @@ void
 __db_del_proc(dbpcl_id, txnpcl_id, keydlen,
 		keydoff, keyulen, keyflags, keydata,
 		keysize, flags, replyp)
-	long dbpcl_id;
-	long txnpcl_id;
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
 	u_int32_t keydlen;
 	u_int32_t keydoff;
 	u_int32_t keyulen;
@@ -682,19 +568,41 @@ __db_del_proc(dbpcl_id, txnpcl_id, keydlen,
 	return;
 }
 
-/* BEGIN __db_get_encrypt_flags_proc */
+/* BEGIN __db_get_proc */
 void
-__db_get_encrypt_flags_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_encrypt_flags_reply *replyp;
-/* END __db_get_encrypt_flags_proc */
+__db_get_proc(dbpcl_id, txnpcl_id, keydlen,
+		keydoff, keyulen, keyflags, keydata,
+		keysize, datadlen, datadoff, dataulen,
+		dataflags, datadata, datasize, flags, replyp, freep)
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
+	u_int32_t keydlen;
+	u_int32_t keydoff;
+	u_int32_t keyulen;
+	u_int32_t keyflags;
+	void *keydata;
+	u_int32_t keysize;
+	u_int32_t datadlen;
+	u_int32_t datadoff;
+	u_int32_t dataulen;
+	u_int32_t dataflags;
+	void *datadata;
+	u_int32_t datasize;
+	u_int32_t flags;
+	__db_get_reply *replyp;
+	int * freep;
+/* END __db_get_proc */
 {
 	int ret;
 	DB * dbp;
 	ct_entry *dbp_ctp;
+	DB_TXN * txnp;
+	ct_entry *txnp_ctp;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
+	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -704,14 +612,12 @@ __db_get_encrypt_flags_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_encrypt_proc */
+/* BEGIN __db_get_bt_minkey_proc */
 void
-__db_encrypt_proc(dbpcl_id, passwd, flags, replyp)
-	long dbpcl_id;
-	char *passwd;
-	u_int32_t flags;
-	__db_encrypt_reply *replyp;
-/* END __db_encrypt_proc */
+__db_get_bt_minkey_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_bt_minkey_reply *replyp;
+/* END __db_get_bt_minkey_proc */
 {
 	int ret;
 	DB * dbp;
@@ -728,12 +634,12 @@ __db_encrypt_proc(dbpcl_id, passwd, flags, replyp)
 	return;
 }
 
-/* BEGIN __db_get_extentsize_proc */
+/* BEGIN __db_get_dbname_proc */
 void
-__db_get_extentsize_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_extentsize_reply *replyp;
-/* END __db_get_extentsize_proc */
+__db_get_dbname_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_dbname_reply *replyp;
+/* END __db_get_dbname_proc */
 {
 	int ret;
 	DB * dbp;
@@ -750,13 +656,12 @@ __db_get_extentsize_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_extentsize_proc */
+/* BEGIN __db_get_encrypt_flags_proc */
 void
-__db_extentsize_proc(dbpcl_id, extentsize, replyp)
-	long dbpcl_id;
-	u_int32_t extentsize;
-	__db_extentsize_reply *replyp;
-/* END __db_extentsize_proc */
+__db_get_encrypt_flags_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_encrypt_flags_reply *replyp;
+/* END __db_get_encrypt_flags_proc */
 {
 	int ret;
 	DB * dbp;
@@ -776,7 +681,7 @@ __db_extentsize_proc(dbpcl_id, extentsize, replyp)
 /* BEGIN __db_get_flags_proc */
 void
 __db_get_flags_proc(dbpcl_id, replyp)
-	long dbpcl_id;
+	unsigned int dbpcl_id;
 	__db_get_flags_reply *replyp;
 /* END __db_get_flags_proc */
 {
@@ -795,13 +700,12 @@ __db_get_flags_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_flags_proc */
+/* BEGIN __db_get_h_ffactor_proc */
 void
-__db_flags_proc(dbpcl_id, flags, replyp)
-	long dbpcl_id;
-	u_int32_t flags;
-	__db_flags_reply *replyp;
-/* END __db_flags_proc */
+__db_get_h_ffactor_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_h_ffactor_reply *replyp;
+/* END __db_get_h_ffactor_proc */
 {
 	int ret;
 	DB * dbp;
@@ -818,41 +722,19 @@ __db_flags_proc(dbpcl_id, flags, replyp)
 	return;
 }
 
-/* BEGIN __db_get_proc */
+/* BEGIN __db_get_h_nelem_proc */
 void
-__db_get_proc(dbpcl_id, txnpcl_id, keydlen,
-		keydoff, keyulen, keyflags, keydata,
-		keysize, datadlen, datadoff, dataulen,
-		dataflags, datadata, datasize, flags, replyp, freep)
-	long dbpcl_id;
-	long txnpcl_id;
-	u_int32_t keydlen;
-	u_int32_t keydoff;
-	u_int32_t keyulen;
-	u_int32_t keyflags;
-	void *keydata;
-	u_int32_t keysize;
-	u_int32_t datadlen;
-	u_int32_t datadoff;
-	u_int32_t dataulen;
-	u_int32_t dataflags;
-	void *datadata;
-	u_int32_t datasize;
-	u_int32_t flags;
-	__db_get_reply *replyp;
-	int * freep;
-/* END __db_get_proc */
+__db_get_h_nelem_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_h_nelem_reply *replyp;
+/* END __db_get_h_nelem_proc */
 {
 	int ret;
 	DB * dbp;
 	ct_entry *dbp_ctp;
-	DB_TXN * txnp;
-	ct_entry *txnp_ctp;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
-	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
-	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -862,12 +744,12 @@ __db_get_proc(dbpcl_id, txnpcl_id, keydlen,
 	return;
 }
 
-/* BEGIN __db_get_name_proc */
+/* BEGIN __db_get_lorder_proc */
 void
-__db_get_name_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_name_reply *replyp;
-/* END __db_get_name_proc */
+__db_get_lorder_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_lorder_reply *replyp;
+/* END __db_get_lorder_proc */
 {
 	int ret;
 	DB * dbp;
@@ -887,7 +769,7 @@ __db_get_name_proc(dbpcl_id, replyp)
 /* BEGIN __db_get_open_flags_proc */
 void
 __db_get_open_flags_proc(dbpcl_id, replyp)
-	long dbpcl_id;
+	unsigned int dbpcl_id;
 	__db_get_open_flags_reply *replyp;
 /* END __db_get_open_flags_proc */
 {
@@ -906,12 +788,12 @@ __db_get_open_flags_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_get_h_ffactor_proc */
+/* BEGIN __db_get_pagesize_proc */
 void
-__db_get_h_ffactor_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_h_ffactor_reply *replyp;
-/* END __db_get_h_ffactor_proc */
+__db_get_pagesize_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_pagesize_reply *replyp;
+/* END __db_get_pagesize_proc */
 {
 	int ret;
 	DB * dbp;
@@ -928,13 +810,12 @@ __db_get_h_ffactor_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_h_ffactor_proc */
+/* BEGIN __db_get_q_extentsize_proc */
 void
-__db_h_ffactor_proc(dbpcl_id, ffactor, replyp)
-	long dbpcl_id;
-	u_int32_t ffactor;
-	__db_h_ffactor_reply *replyp;
-/* END __db_h_ffactor_proc */
+__db_get_q_extentsize_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_q_extentsize_reply *replyp;
+/* END __db_get_q_extentsize_proc */
 {
 	int ret;
 	DB * dbp;
@@ -951,12 +832,12 @@ __db_h_ffactor_proc(dbpcl_id, ffactor, replyp)
 	return;
 }
 
-/* BEGIN __db_get_h_nelem_proc */
+/* BEGIN __db_get_re_delim_proc */
 void
-__db_get_h_nelem_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_h_nelem_reply *replyp;
-/* END __db_get_h_nelem_proc */
+__db_get_re_delim_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_re_delim_reply *replyp;
+/* END __db_get_re_delim_proc */
 {
 	int ret;
 	DB * dbp;
@@ -973,13 +854,12 @@ __db_get_h_nelem_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_h_nelem_proc */
+/* BEGIN __db_get_re_len_proc */
 void
-__db_h_nelem_proc(dbpcl_id, nelem, replyp)
-	long dbpcl_id;
-	u_int32_t nelem;
-	__db_h_nelem_reply *replyp;
-/* END __db_h_nelem_proc */
+__db_get_re_len_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_re_len_reply *replyp;
+/* END __db_get_re_len_proc */
 {
 	int ret;
 	DB * dbp;
@@ -996,33 +876,19 @@ __db_h_nelem_proc(dbpcl_id, nelem, replyp)
 	return;
 }
 
-/* BEGIN __db_key_range_proc */
+/* BEGIN __db_get_re_pad_proc */
 void
-__db_key_range_proc(dbpcl_id, txnpcl_id, keydlen,
-		keydoff, keyulen, keyflags, keydata,
-		keysize, flags, replyp)
-	long dbpcl_id;
-	long txnpcl_id;
-	u_int32_t keydlen;
-	u_int32_t keydoff;
-	u_int32_t keyulen;
-	u_int32_t keyflags;
-	void *keydata;
-	u_int32_t keysize;
-	u_int32_t flags;
-	__db_key_range_reply *replyp;
-/* END __db_key_range_proc */
+__db_get_re_pad_proc(dbpcl_id, replyp)
+	unsigned int dbpcl_id;
+	__db_get_re_pad_reply *replyp;
+/* END __db_get_re_pad_proc */
 {
 	int ret;
 	DB * dbp;
 	ct_entry *dbp_ctp;
-	DB_TXN * txnp;
-	ct_entry *txnp_ctp;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
-	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
-	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -1032,12 +898,16 @@ __db_key_range_proc(dbpcl_id, txnpcl_id, keydlen,
 	return;
 }
 
-/* BEGIN __db_get_lorder_proc */
+/* BEGIN __db_join_proc */
 void
-__db_get_lorder_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_lorder_reply *replyp;
-/* END __db_get_lorder_proc */
+__db_join_proc(dbpcl_id, curs, curslen,
+		flags, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t * curs;
+	u_int32_t curslen;
+	u_int32_t flags;
+	__db_join_reply *replyp;
+/* END __db_join_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1054,20 +924,33 @@ __db_get_lorder_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_lorder_proc */
+/* BEGIN __db_key_range_proc */
 void
-__db_lorder_proc(dbpcl_id, lorder, replyp)
-	long dbpcl_id;
-	u_int32_t lorder;
-	__db_lorder_reply *replyp;
-/* END __db_lorder_proc */
+__db_key_range_proc(dbpcl_id, txnpcl_id, keydlen,
+		keydoff, keyulen, keyflags, keydata,
+		keysize, flags, replyp)
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
+	u_int32_t keydlen;
+	u_int32_t keydoff;
+	u_int32_t keyulen;
+	u_int32_t keyflags;
+	void *keydata;
+	u_int32_t keysize;
+	u_int32_t flags;
+	__db_key_range_reply *replyp;
+/* END __db_key_range_proc */
 {
 	int ret;
 	DB * dbp;
 	ct_entry *dbp_ctp;
+	DB_TXN * txnp;
+	ct_entry *txnp_ctp;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
+	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -1081,8 +964,8 @@ __db_lorder_proc(dbpcl_id, lorder, replyp)
 void
 __db_open_proc(dbpcl_id, txnpcl_id, name,
 		subdb, type, flags, mode, replyp)
-	long dbpcl_id;
-	long txnpcl_id;
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
 	char *name;
 	char *subdb;
 	u_int32_t type;
@@ -1095,57 +978,12 @@ __db_open_proc(dbpcl_id, txnpcl_id, name,
 	DB * dbp;
 	ct_entry *dbp_ctp;
 	DB_TXN * txnp;
-	ct_entry *txnp_ctp;
-
-	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
-	dbp = (DB *)dbp_ctp->ct_anyp;
-	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
-	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
-
-	/*
-	 * XXX Code goes here
-	 */
-
-	replyp->status = ret;
-	return;
-}
-
-/* BEGIN __db_get_pagesize_proc */
-void
-__db_get_pagesize_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_pagesize_reply *replyp;
-/* END __db_get_pagesize_proc */
-{
-	int ret;
-	DB * dbp;
-	ct_entry *dbp_ctp;
-
-	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
-	dbp = (DB *)dbp_ctp->ct_anyp;
-
-	/*
-	 * XXX Code goes here
-	 */
-
-	replyp->status = ret;
-	return;
-}
-
-/* BEGIN __db_pagesize_proc */
-void
-__db_pagesize_proc(dbpcl_id, pagesize, replyp)
-	long dbpcl_id;
-	u_int32_t pagesize;
-	__db_pagesize_reply *replyp;
-/* END __db_pagesize_proc */
-{
-	int ret;
-	DB * dbp;
-	ct_entry *dbp_ctp;
+	ct_entry *txnp_ctp;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
+	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -1163,8 +1001,8 @@ __db_pget_proc(dbpcl_id, txnpcl_id, skeydlen,
 		pkeyflags, pkeydata, pkeysize, datadlen,
 		datadoff, dataulen, dataflags, datadata,
 		datasize, flags, replyp, freep)
-	long dbpcl_id;
-	long txnpcl_id;
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
 	u_int32_t skeydlen;
 	u_int32_t skeydoff;
 	u_int32_t skeyulen;
@@ -1213,8 +1051,8 @@ __db_put_proc(dbpcl_id, txnpcl_id, keydlen,
 		keydoff, keyulen, keyflags, keydata,
 		keysize, datadlen, datadoff, dataulen,
 		dataflags, datadata, datasize, flags, replyp, freep)
-	long dbpcl_id;
-	long txnpcl_id;
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
 	u_int32_t keydlen;
 	u_int32_t keydoff;
 	u_int32_t keyulen;
@@ -1251,12 +1089,16 @@ __db_put_proc(dbpcl_id, txnpcl_id, keydlen,
 	return;
 }
 
-/* BEGIN __db_get_re_delim_proc */
+/* BEGIN __db_remove_proc */
 void
-__db_get_re_delim_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_re_delim_reply *replyp;
-/* END __db_get_re_delim_proc */
+__db_remove_proc(dbpcl_id, name, subdb,
+		flags, replyp)
+	unsigned int dbpcl_id;
+	char *name;
+	char *subdb;
+	u_int32_t flags;
+	__db_remove_reply *replyp;
+/* END __db_remove_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1273,13 +1115,17 @@ __db_get_re_delim_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_re_delim_proc */
+/* BEGIN __db_rename_proc */
 void
-__db_re_delim_proc(dbpcl_id, delim, replyp)
-	long dbpcl_id;
-	u_int32_t delim;
-	__db_re_delim_reply *replyp;
-/* END __db_re_delim_proc */
+__db_rename_proc(dbpcl_id, name, subdb,
+		newname, flags, replyp)
+	unsigned int dbpcl_id;
+	char *name;
+	char *subdb;
+	char *newname;
+	u_int32_t flags;
+	__db_rename_reply *replyp;
+/* END __db_rename_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1296,12 +1142,13 @@ __db_re_delim_proc(dbpcl_id, delim, replyp)
 	return;
 }
 
-/* BEGIN __db_get_re_len_proc */
+/* BEGIN __db_set_bt_minkey_proc */
 void
-__db_get_re_len_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_re_len_reply *replyp;
-/* END __db_get_re_len_proc */
+__db_set_bt_minkey_proc(dbpcl_id, minkey, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t minkey;
+	__db_set_bt_minkey_reply *replyp;
+/* END __db_set_bt_minkey_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1318,13 +1165,14 @@ __db_get_re_len_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_re_len_proc */
+/* BEGIN __db_set_encrypt_proc */
 void
-__db_re_len_proc(dbpcl_id, len, replyp)
-	long dbpcl_id;
-	u_int32_t len;
-	__db_re_len_reply *replyp;
-/* END __db_re_len_proc */
+__db_set_encrypt_proc(dbpcl_id, passwd, flags, replyp)
+	unsigned int dbpcl_id;
+	char *passwd;
+	u_int32_t flags;
+	__db_set_encrypt_reply *replyp;
+/* END __db_set_encrypt_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1341,13 +1189,13 @@ __db_re_len_proc(dbpcl_id, len, replyp)
 	return;
 }
 
-/* BEGIN __db_re_pad_proc */
+/* BEGIN __db_set_flags_proc */
 void
-__db_re_pad_proc(dbpcl_id, pad, replyp)
-	long dbpcl_id;
-	u_int32_t pad;
-	__db_re_pad_reply *replyp;
-/* END __db_re_pad_proc */
+__db_set_flags_proc(dbpcl_id, flags, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t flags;
+	__db_set_flags_reply *replyp;
+/* END __db_set_flags_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1364,12 +1212,13 @@ __db_re_pad_proc(dbpcl_id, pad, replyp)
 	return;
 }
 
-/* BEGIN __db_get_re_pad_proc */
+/* BEGIN __db_set_h_ffactor_proc */
 void
-__db_get_re_pad_proc(dbpcl_id, replyp)
-	long dbpcl_id;
-	__db_get_re_pad_reply *replyp;
-/* END __db_get_re_pad_proc */
+__db_set_h_ffactor_proc(dbpcl_id, ffactor, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t ffactor;
+	__db_set_h_ffactor_reply *replyp;
+/* END __db_set_h_ffactor_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1386,16 +1235,13 @@ __db_get_re_pad_proc(dbpcl_id, replyp)
 	return;
 }
 
-/* BEGIN __db_remove_proc */
+/* BEGIN __db_set_h_nelem_proc */
 void
-__db_remove_proc(dbpcl_id, name, subdb,
-		flags, replyp)
-	long dbpcl_id;
-	char *name;
-	char *subdb;
-	u_int32_t flags;
-	__db_remove_reply *replyp;
-/* END __db_remove_proc */
+__db_set_h_nelem_proc(dbpcl_id, nelem, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t nelem;
+	__db_set_h_nelem_reply *replyp;
+/* END __db_set_h_nelem_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1412,17 +1258,13 @@ __db_remove_proc(dbpcl_id, name, subdb,
 	return;
 }
 
-/* BEGIN __db_rename_proc */
+/* BEGIN __db_set_lorder_proc */
 void
-__db_rename_proc(dbpcl_id, name, subdb,
-		newname, flags, replyp)
-	long dbpcl_id;
-	char *name;
-	char *subdb;
-	char *newname;
-	u_int32_t flags;
-	__db_rename_reply *replyp;
-/* END __db_rename_proc */
+__db_set_lorder_proc(dbpcl_id, lorder, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t lorder;
+	__db_set_lorder_reply *replyp;
+/* END __db_set_lorder_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1439,27 +1281,20 @@ __db_rename_proc(dbpcl_id, name, subdb,
 	return;
 }
 
-/* BEGIN __db_stat_proc */
+/* BEGIN __db_set_pagesize_proc */
 void
-__db_stat_proc(dbpcl_id, txnpcl_id,
-		flags, replyp, freep)
-	long dbpcl_id;
-	long txnpcl_id;
-	u_int32_t flags;
-	__db_stat_reply *replyp;
-	int * freep;
-/* END __db_stat_proc */
+__db_set_pagesize_proc(dbpcl_id, pagesize, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t pagesize;
+	__db_set_pagesize_reply *replyp;
+/* END __db_set_pagesize_proc */
 {
 	int ret;
 	DB * dbp;
 	ct_entry *dbp_ctp;
-	DB_TXN * txnp;
-	ct_entry *txnp_ctp;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
-	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
-	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -1469,13 +1304,13 @@ __db_stat_proc(dbpcl_id, txnpcl_id,
 	return;
 }
 
-/* BEGIN __db_sync_proc */
+/* BEGIN __db_set_q_extentsize_proc */
 void
-__db_sync_proc(dbpcl_id, flags, replyp)
-	long dbpcl_id;
-	u_int32_t flags;
-	__db_sync_reply *replyp;
-/* END __db_sync_proc */
+__db_set_q_extentsize_proc(dbpcl_id, extentsize, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t extentsize;
+	__db_set_q_extentsize_reply *replyp;
+/* END __db_set_q_extentsize_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1492,15 +1327,85 @@ __db_sync_proc(dbpcl_id, flags, replyp)
 	return;
 }
 
-/* BEGIN __db_truncate_proc */
+/* BEGIN __db_set_re_delim_proc */
 void
-__db_truncate_proc(dbpcl_id, txnpcl_id,
-		flags, replyp)
-	long dbpcl_id;
-	long txnpcl_id;
+__db_set_re_delim_proc(dbpcl_id, delim, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t delim;
+	__db_set_re_delim_reply *replyp;
+/* END __db_set_re_delim_proc */
+{
+	int ret;
+	DB * dbp;
+	ct_entry *dbp_ctp;
+
+	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+	dbp = (DB *)dbp_ctp->ct_anyp;
+
+	/*
+	 * XXX Code goes here
+	 */
+
+	replyp->status = ret;
+	return;
+}
+
+/* BEGIN __db_set_re_len_proc */
+void
+__db_set_re_len_proc(dbpcl_id, len, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t len;
+	__db_set_re_len_reply *replyp;
+/* END __db_set_re_len_proc */
+{
+	int ret;
+	DB * dbp;
+	ct_entry *dbp_ctp;
+
+	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+	dbp = (DB *)dbp_ctp->ct_anyp;
+
+	/*
+	 * XXX Code goes here
+	 */
+
+	replyp->status = ret;
+	return;
+}
+
+/* BEGIN __db_set_re_pad_proc */
+void
+__db_set_re_pad_proc(dbpcl_id, pad, replyp)
+	unsigned int dbpcl_id;
+	u_int32_t pad;
+	__db_set_re_pad_reply *replyp;
+/* END __db_set_re_pad_proc */
+{
+	int ret;
+	DB * dbp;
+	ct_entry *dbp_ctp;
+
+	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+	dbp = (DB *)dbp_ctp->ct_anyp;
+
+	/*
+	 * XXX Code goes here
+	 */
+
+	replyp->status = ret;
+	return;
+}
+
+/* BEGIN __db_stat_proc */
+void
+__db_stat_proc(dbpcl_id, txnpcl_id,
+		flags, replyp, freep)
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
 	u_int32_t flags;
-	__db_truncate_reply *replyp;
-/* END __db_truncate_proc */
+	__db_stat_reply *replyp;
+	int * freep;
+/* END __db_stat_proc */
 {
 	int ret;
 	DB * dbp;
@@ -1521,26 +1426,20 @@ __db_truncate_proc(dbpcl_id, txnpcl_id,
 	return;
 }
 
-/* BEGIN __db_cursor_proc */
+/* BEGIN __db_sync_proc */
 void
-__db_cursor_proc(dbpcl_id, txnpcl_id,
-		flags, replyp)
-	long dbpcl_id;
-	long txnpcl_id;
+__db_sync_proc(dbpcl_id, flags, replyp)
+	unsigned int dbpcl_id;
 	u_int32_t flags;
-	__db_cursor_reply *replyp;
-/* END __db_cursor_proc */
+	__db_sync_reply *replyp;
+/* END __db_sync_proc */
 {
 	int ret;
 	DB * dbp;
 	ct_entry *dbp_ctp;
-	DB_TXN * txnp;
-	ct_entry *txnp_ctp;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
-	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
-	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -1550,23 +1449,26 @@ __db_cursor_proc(dbpcl_id, txnpcl_id,
 	return;
 }
 
-/* BEGIN __db_join_proc */
+/* BEGIN __db_truncate_proc */
 void
-__db_join_proc(dbpcl_id, curs, curslen,
+__db_truncate_proc(dbpcl_id, txnpcl_id,
 		flags, replyp)
-	long dbpcl_id;
-	u_int32_t * curs;
-	u_int32_t curslen;
+	unsigned int dbpcl_id;
+	unsigned int txnpcl_id;
 	u_int32_t flags;
-	__db_join_reply *replyp;
-/* END __db_join_proc */
+	__db_truncate_reply *replyp;
+/* END __db_truncate_proc */
 {
 	int ret;
 	DB * dbp;
 	ct_entry *dbp_ctp;
+	DB_TXN * txnp;
+	ct_entry *txnp_ctp;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
+	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
 
 	/*
 	 * XXX Code goes here
@@ -1576,12 +1478,12 @@ __db_join_proc(dbpcl_id, curs, curslen,
 	return;
 }
 
-/* BEGIN __dbc_close_proc */
+/* BEGIN __dbc_c_close_proc */
 void
-__dbc_close_proc(dbccl_id, replyp)
-	long dbccl_id;
-	__dbc_close_reply *replyp;
-/* END __dbc_close_proc */
+__dbc_c_close_proc(dbccl_id, replyp)
+	unsigned int dbccl_id;
+	__dbc_c_close_reply *replyp;
+/* END __dbc_c_close_proc */
 {
 	int ret;
 	DBC * dbc;
@@ -1598,13 +1500,13 @@ __dbc_close_proc(dbccl_id, replyp)
 	return;
 }
 
-/* BEGIN __dbc_count_proc */
+/* BEGIN __dbc_c_count_proc */
 void
-__dbc_count_proc(dbccl_id, flags, replyp)
-	long dbccl_id;
+__dbc_c_count_proc(dbccl_id, flags, replyp)
+	unsigned int dbccl_id;
 	u_int32_t flags;
-	__dbc_count_reply *replyp;
-/* END __dbc_count_proc */
+	__dbc_c_count_reply *replyp;
+/* END __dbc_c_count_proc */
 {
 	int ret;
 	DBC * dbc;
@@ -1621,13 +1523,13 @@ __dbc_count_proc(dbccl_id, flags, replyp)
 	return;
 }
 
-/* BEGIN __dbc_del_proc */
+/* BEGIN __dbc_c_del_proc */
 void
-__dbc_del_proc(dbccl_id, flags, replyp)
-	long dbccl_id;
+__dbc_c_del_proc(dbccl_id, flags, replyp)
+	unsigned int dbccl_id;
 	u_int32_t flags;
-	__dbc_del_reply *replyp;
-/* END __dbc_del_proc */
+	__dbc_c_del_reply *replyp;
+/* END __dbc_c_del_proc */
 {
 	int ret;
 	DBC * dbc;
@@ -1644,13 +1546,13 @@ __dbc_del_proc(dbccl_id, flags, replyp)
 	return;
 }
 
-/* BEGIN __dbc_dup_proc */
+/* BEGIN __dbc_c_dup_proc */
 void
-__dbc_dup_proc(dbccl_id, flags, replyp)
-	long dbccl_id;
+__dbc_c_dup_proc(dbccl_id, flags, replyp)
+	unsigned int dbccl_id;
 	u_int32_t flags;
-	__dbc_dup_reply *replyp;
-/* END __dbc_dup_proc */
+	__dbc_c_dup_reply *replyp;
+/* END __dbc_c_dup_proc */
 {
 	int ret;
 	DBC * dbc;
@@ -1667,13 +1569,13 @@ __dbc_dup_proc(dbccl_id, flags, replyp)
 	return;
 }
 
-/* BEGIN __dbc_get_proc */
+/* BEGIN __dbc_c_get_proc */
 void
-__dbc_get_proc(dbccl_id, keydlen, keydoff,
+__dbc_c_get_proc(dbccl_id, keydlen, keydoff,
 		keyulen, keyflags, keydata, keysize,
 		datadlen, datadoff, dataulen, dataflags,
 		datadata, datasize, flags, replyp, freep)
-	long dbccl_id;
+	unsigned int dbccl_id;
 	u_int32_t keydlen;
 	u_int32_t keydoff;
 	u_int32_t keyulen;
@@ -1687,9 +1589,9 @@ __dbc_get_proc(dbccl_id, keydlen, keydoff,
 	void *datadata;
 	u_int32_t datasize;
 	u_int32_t flags;
-	__dbc_get_reply *replyp;
+	__dbc_c_get_reply *replyp;
 	int * freep;
-/* END __dbc_get_proc */
+/* END __dbc_c_get_proc */
 {
 	int ret;
 	DBC * dbc;
@@ -1706,15 +1608,15 @@ __dbc_get_proc(dbccl_id, keydlen, keydoff,
 	return;
 }
 
-/* BEGIN __dbc_pget_proc */
+/* BEGIN __dbc_c_pget_proc */
 void
-__dbc_pget_proc(dbccl_id, skeydlen, skeydoff,
+__dbc_c_pget_proc(dbccl_id, skeydlen, skeydoff,
 		skeyulen, skeyflags, skeydata, skeysize,
 		pkeydlen, pkeydoff, pkeyulen, pkeyflags,
 		pkeydata, pkeysize, datadlen, datadoff,
 		dataulen, dataflags, datadata, datasize,
 		flags, replyp, freep)
-	long dbccl_id;
+	unsigned int dbccl_id;
 	u_int32_t skeydlen;
 	u_int32_t skeydoff;
 	u_int32_t skeyulen;
@@ -1734,9 +1636,9 @@ __dbc_pget_proc(dbccl_id, skeydlen, skeydoff,
 	void *datadata;
 	u_int32_t datasize;
 	u_int32_t flags;
-	__dbc_pget_reply *replyp;
+	__dbc_c_pget_reply *replyp;
 	int * freep;
-/* END __dbc_pget_proc */
+/* END __dbc_c_pget_proc */
 {
 	int ret;
 	DBC * dbc;
@@ -1753,13 +1655,13 @@ __dbc_pget_proc(dbccl_id, skeydlen, skeydoff,
 	return;
 }
 
-/* BEGIN __dbc_put_proc */
+/* BEGIN __dbc_c_put_proc */
 void
-__dbc_put_proc(dbccl_id, keydlen, keydoff,
+__dbc_c_put_proc(dbccl_id, keydlen, keydoff,
 		keyulen, keyflags, keydata, keysize,
 		datadlen, datadoff, dataulen, dataflags,
 		datadata, datasize, flags, replyp, freep)
-	long dbccl_id;
+	unsigned int dbccl_id;
 	u_int32_t keydlen;
 	u_int32_t keydoff;
 	u_int32_t keyulen;
@@ -1773,9 +1675,9 @@ __dbc_put_proc(dbccl_id, keydlen, keydoff,
 	void *datadata;
 	u_int32_t datasize;
 	u_int32_t flags;
-	__dbc_put_reply *replyp;
+	__dbc_c_put_reply *replyp;
 	int * freep;
-/* END __dbc_put_proc */
+/* END __dbc_c_put_proc */
 {
 	int ret;
 	DBC * dbc;
@@ -1792,3 +1694,94 @@ __dbc_put_proc(dbccl_id, keydlen, keydoff,
 	return;
 }
 
+/* BEGIN __txn_abort_proc */
+void
+__txn_abort_proc(txnpcl_id, replyp)
+	unsigned int txnpcl_id;
+	__txn_abort_reply *replyp;
+/* END __txn_abort_proc */
+{
+	int ret;
+	DB_TXN * txnp;
+	ct_entry *txnp_ctp;
+
+	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+
+	/*
+	 * XXX Code goes here
+	 */
+
+	replyp->status = ret;
+	return;
+}
+
+/* BEGIN __txn_commit_proc */
+void
+__txn_commit_proc(txnpcl_id, flags, replyp)
+	unsigned int txnpcl_id;
+	u_int32_t flags;
+	__txn_commit_reply *replyp;
+/* END __txn_commit_proc */
+{
+	int ret;
+	DB_TXN * txnp;
+	ct_entry *txnp_ctp;
+
+	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+
+	/*
+	 * XXX Code goes here
+	 */
+
+	replyp->status = ret;
+	return;
+}
+
+/* BEGIN __txn_discard_proc */
+void
+__txn_discard_proc(txnpcl_id, flags, replyp)
+	unsigned int txnpcl_id;
+	u_int32_t flags;
+	__txn_discard_reply *replyp;
+/* END __txn_discard_proc */
+{
+	int ret;
+	DB_TXN * txnp;
+	ct_entry *txnp_ctp;
+
+	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+
+	/*
+	 * XXX Code goes here
+	 */
+
+	replyp->status = ret;
+	return;
+}
+
+/* BEGIN __txn_prepare_proc */
+void
+__txn_prepare_proc(txnpcl_id, gid, replyp)
+	unsigned int txnpcl_id;
+	u_int8_t *gid;
+	__txn_prepare_reply *replyp;
+/* END __txn_prepare_proc */
+{
+	int ret;
+	DB_TXN * txnp;
+	ct_entry *txnp_ctp;
+
+	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+
+	/*
+	 * XXX Code goes here
+	 */
+
+	replyp->status = ret;
+	return;
+}
+
diff --git a/db/dist/template/gen_client_ret b/db/dist/template/gen_client_ret
index 3d897e609..8d679a749 100644
--- a/db/dist/template/gen_client_ret
+++ b/db/dist/template/gen_client_ret
@@ -1,11 +1,6 @@
 /* Do not edit: automatically built by gen_rpc.awk. */
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
 #include "db_int.h"
 #include "dbinc/txn.h"
 
@@ -34,23 +29,21 @@ __dbcl_env_create_ret(dbenv, timeout, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_env_open_ret __P((DB_ENV *, const char *, u_int32_t, int,
- * PUBLIC:      __env_open_reply *));
+ * PUBLIC: int __dbcl_env_cdsgroup_begin_ret __P((DB_ENV *, DB_TXN **,
+ * PUBLIC:      __env_cdsgroup_begin_reply *));
  */
 int
-__dbcl_env_open_ret(dbenv, home, flags, mode, replyp)
+__dbcl_env_cdsgroup_begin_ret(dbenv, txnpp, replyp)
 	DB_ENV * dbenv;
-	const char * home;
-	u_int32_t flags;
-	int mode;
-	__env_open_reply *replyp;
+	DB_TXN ** txnpp;
+	__env_cdsgroup_begin_reply *replyp;
 {
 	int ret;
-	long env;
+	long txnid;
 
 	if (replyp->status != 0)
 		return (replyp->status);
-	env = replyp->envcl_id;
+	txnid = replyp->txnidcl_id;
 
 	/*
 	 * XXX Code goes here
@@ -60,20 +53,23 @@ __dbcl_env_open_ret(dbenv, home, flags, mode, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_env_remove_ret __P((DB_ENV *, const char *, u_int32_t,
- * PUBLIC:      __env_remove_reply *));
+ * PUBLIC: int __dbcl_env_open_ret __P((DB_ENV *, const char *, u_int32_t, int,
+ * PUBLIC:      __env_open_reply *));
  */
 int
-__dbcl_env_remove_ret(dbenv, home, flags, replyp)
+__dbcl_env_open_ret(dbenv, home, flags, mode, replyp)
 	DB_ENV * dbenv;
 	const char * home;
 	u_int32_t flags;
-	__env_remove_reply *replyp;
+	int mode;
+	__env_open_reply *replyp;
 {
 	int ret;
+	long env;
 
 	if (replyp->status != 0)
 		return (replyp->status);
+	env = replyp->envcl_id;
 
 	/*
 	 * XXX Code goes here
@@ -83,12 +79,15 @@ __dbcl_env_remove_ret(dbenv, home, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_abort_ret __P((DB_TXN *, __txn_abort_reply *));
+ * PUBLIC: int __dbcl_env_remove_ret __P((DB_ENV *, const char *, u_int32_t,
+ * PUBLIC:      __env_remove_reply *));
  */
 int
-__dbcl_txn_abort_ret(txnp, replyp)
-	DB_TXN * txnp;
-	__txn_abort_reply *replyp;
+__dbcl_env_remove_ret(dbenv, home, flags, replyp)
+	DB_ENV * dbenv;
+	const char * home;
+	u_int32_t flags;
+	__env_remove_reply *replyp;
 {
 	int ret;
 
@@ -103,16 +102,16 @@ __dbcl_txn_abort_ret(txnp, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_begin_ret __P((DB_ENV *, DB_TXN *, DB_TXN **,
- * PUBLIC:      u_int32_t, __txn_begin_reply *));
+ * PUBLIC: int __dbcl_env_txn_begin_ret __P((DB_ENV *, DB_TXN *, DB_TXN **,
+ * PUBLIC:      u_int32_t, __env_txn_begin_reply *));
  */
 int
-__dbcl_txn_begin_ret(dbenv, parent, txnpp, flags, replyp)
+__dbcl_env_txn_begin_ret(dbenv, parent, txnpp, flags, replyp)
 	DB_ENV * dbenv;
 	DB_TXN * parent;
 	DB_TXN ** txnpp;
 	u_int32_t flags;
-	__txn_begin_reply *replyp;
+	__env_txn_begin_reply *replyp;
 {
 	int ret;
 	long txnid;
@@ -129,41 +128,36 @@ __dbcl_txn_begin_ret(dbenv, parent, txnpp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_commit_ret __P((DB_TXN *, u_int32_t,
- * PUBLIC:      __txn_commit_reply *));
+ * PUBLIC: int __dbcl_env_txn_recover_ret __P((DB_ENV *, DB_PREPLIST *, long,
+ * PUBLIC:      long *, u_int32_t, __env_txn_recover_reply *));
  */
 int
-__dbcl_txn_commit_ret(txnp, flags, replyp)
-	DB_TXN * txnp;
+__dbcl_env_txn_recover_ret(dbenv, preplist, count, retp, flags, replyp)
+	DB_ENV * dbenv;
+	DB_PREPLIST * preplist;
+	long count;
+	long * retp;
 	u_int32_t flags;
-	__txn_commit_reply *replyp;
+	__env_txn_recover_reply *replyp;
 {
 	int ret;
+	u_int32_t *__db_txn;
+	u_int8_t *__db_gid;
+	long retcount;
 
 	if (replyp->status != 0)
 		return (replyp->status);
 
 	/*
-	 * XXX Code goes here
+	 * XXX Handle list
 	 */
 
-	return (replyp->status);
-}
 
-/*
- * PUBLIC: int __dbcl_txn_discard_ret __P((DB_TXN *, u_int32_t,
- * PUBLIC:      __txn_discard_reply *));
- */
-int
-__dbcl_txn_discard_ret(txnp, flags, replyp)
-	DB_TXN * txnp;
-	u_int32_t flags;
-	__txn_discard_reply *replyp;
-{
-	int ret;
+	/*
+	 * XXX Handle list
+	 */
 
-	if (replyp->status != 0)
-		return (replyp->status);
+	retcount = replyp->retcount;
 
 	/*
 	 * XXX Code goes here
@@ -173,36 +167,22 @@ __dbcl_txn_discard_ret(txnp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_recover_ret __P((DB_ENV *, DB_PREPLIST *, long,
- * PUBLIC:      long *, u_int32_t, __txn_recover_reply *));
+ * PUBLIC: int __dbcl_db_create_ret __P((DB *, DB_ENV *, u_int32_t,
+ * PUBLIC:      __db_create_reply *));
  */
 int
-__dbcl_txn_recover_ret(dbenv, preplist, count, retp, flags, replyp)
+__dbcl_db_create_ret(dbp, dbenv, flags, replyp)
+	DB * dbp;
 	DB_ENV * dbenv;
-	DB_PREPLIST * preplist;
-	long count;
-	long * retp;
 	u_int32_t flags;
-	__txn_recover_reply *replyp;
+	__db_create_reply *replyp;
 {
 	int ret;
-	u_int32_t *__db_txn;
-	u_int8_t *__db_gid;
-	long retcount;
+	long db;
 
 	if (replyp->status != 0)
 		return (replyp->status);
-
-	/*
-	 * XXX Handle list
-	 */
-
-
-	/*
-	 * XXX Handle list
-	 */
-
-	retcount = replyp->retcount;
+	db = replyp->dbcl_id;
 
 	/*
 	 * XXX Code goes here
@@ -233,22 +213,23 @@ __dbcl_db_close_ret(dbp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_create_ret __P((DB *, DB_ENV *, u_int32_t,
- * PUBLIC:      __db_create_reply *));
+ * PUBLIC: int __dbcl_db_cursor_ret __P((DB *, DB_TXN *, DBC **, u_int32_t,
+ * PUBLIC:      __db_cursor_reply *));
  */
 int
-__dbcl_db_create_ret(dbp, dbenv, flags, replyp)
+__dbcl_db_cursor_ret(dbp, txnp, dbcpp, flags, replyp)
 	DB * dbp;
-	DB_ENV * dbenv;
+	DB_TXN * txnp;
+	DBC ** dbcpp;
 	u_int32_t flags;
-	__db_create_reply *replyp;
+	__db_cursor_reply *replyp;
 {
 	int ret;
-	long db;
+	long dbcid;
 
 	if (replyp->status != 0)
 		return (replyp->status);
-	db = replyp->dbcl_id;
+	dbcid = replyp->dbcidcl_id;
 
 	/*
 	 * XXX Code goes here
@@ -286,6 +267,32 @@ __dbcl_db_get_ret(dbp, txnp, key, data, flags, replyp)
 	return (replyp->status);
 }
 
+/*
+ * PUBLIC: int __dbcl_db_join_ret __P((DB *, DBC **, DBC **, u_int32_t,
+ * PUBLIC:      __db_join_reply *));
+ */
+int
+__dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp)
+	DB * dbp;
+	DBC ** curs;
+	DBC ** dbcp;
+	u_int32_t flags;
+	__db_join_reply *replyp;
+{
+	int ret;
+	long dbcid;
+
+	if (replyp->status != 0)
+		return (replyp->status);
+	dbcid = replyp->dbcidcl_id;
+
+	/*
+	 * XXX Code goes here
+	 */
+
+	return (replyp->status);
+}
+
 /*
  * PUBLIC: int __dbcl_db_key_range_ret __P((DB *, DB_TXN *, DBT *,
  * PUBLIC:      DB_KEY_RANGE *, u_int32_t, __db_key_range_reply *));
@@ -515,23 +522,17 @@ __dbcl_db_truncate_ret(dbp, txnp, countp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_cursor_ret __P((DB *, DB_TXN *, DBC **, u_int32_t,
- * PUBLIC:      __db_cursor_reply *));
+ * PUBLIC: int __dbcl_dbc_c_close_ret __P((DBC *, __dbc_c_close_reply *));
  */
 int
-__dbcl_db_cursor_ret(dbp, txnp, dbcpp, flags, replyp)
-	DB * dbp;
-	DB_TXN * txnp;
-	DBC ** dbcpp;
-	u_int32_t flags;
-	__db_cursor_reply *replyp;
+__dbcl_dbc_c_close_ret(dbc, replyp)
+	DBC * dbc;
+	__dbc_c_close_reply *replyp;
 {
 	int ret;
-	long dbcid;
 
 	if (replyp->status != 0)
 		return (replyp->status);
-	dbcid = replyp->dbcidcl_id;
 
 	/*
 	 * XXX Code goes here
@@ -541,23 +542,22 @@ __dbcl_db_cursor_ret(dbp, txnp, dbcpp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_join_ret __P((DB *, DBC **, DBC **, u_int32_t,
- * PUBLIC:      __db_join_reply *));
+ * PUBLIC: int __dbcl_dbc_c_count_ret __P((DBC *, db_recno_t *, u_int32_t,
+ * PUBLIC:      __dbc_c_count_reply *));
  */
 int
-__dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp)
-	DB * dbp;
-	DBC ** curs;
-	DBC ** dbcp;
+__dbcl_dbc_c_count_ret(dbc, countp, flags, replyp)
+	DBC * dbc;
+	db_recno_t * countp;
 	u_int32_t flags;
-	__db_join_reply *replyp;
+	__dbc_c_count_reply *replyp;
 {
 	int ret;
-	long dbcid;
+	db_recno_t dupcount;
 
 	if (replyp->status != 0)
 		return (replyp->status);
-	dbcid = replyp->dbcidcl_id;
+	dupcount = replyp->dupcount;
 
 	/*
 	 * XXX Code goes here
@@ -567,17 +567,22 @@ __dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_close_ret __P((DBC *, __dbc_close_reply *));
+ * PUBLIC: int __dbcl_dbc_c_dup_ret __P((DBC *, DBC **, u_int32_t,
+ * PUBLIC:      __dbc_c_dup_reply *));
  */
 int
-__dbcl_dbc_close_ret(dbc, replyp)
+__dbcl_dbc_c_dup_ret(dbc, dbcp, flags, replyp)
 	DBC * dbc;
-	__dbc_close_reply *replyp;
+	DBC ** dbcp;
+	u_int32_t flags;
+	__dbc_c_dup_reply *replyp;
 {
 	int ret;
+	long dbcid;
 
 	if (replyp->status != 0)
 		return (replyp->status);
+	dbcid = replyp->dbcidcl_id;
 
 	/*
 	 * XXX Code goes here
@@ -587,22 +592,25 @@ __dbcl_dbc_close_ret(dbc, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_count_ret __P((DBC *, db_recno_t *, u_int32_t,
- * PUBLIC:      __dbc_count_reply *));
+ * PUBLIC: int __dbcl_dbc_c_get_ret __P((DBC *, DBT *, DBT *, u_int32_t,
+ * PUBLIC:      __dbc_c_get_reply *));
  */
 int
-__dbcl_dbc_count_ret(dbc, countp, flags, replyp)
+__dbcl_dbc_c_get_ret(dbc, key, data, flags, replyp)
 	DBC * dbc;
-	db_recno_t * countp;
+	DBT * key;
+	DBT * data;
 	u_int32_t flags;
-	__dbc_count_reply *replyp;
+	__dbc_c_get_reply *replyp;
 {
 	int ret;
-	db_recno_t dupcount;
+	/* DBT key; */
+	/* DBT data; */
 
 	if (replyp->status != 0)
 		return (replyp->status);
-	dupcount = replyp->dupcount;
+	/* Handle replyp->keydata; */
+	/* Handle replyp->datadata; */
 
 	/*
 	 * XXX Code goes here
@@ -612,22 +620,28 @@ __dbcl_dbc_count_ret(dbc, countp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_dup_ret __P((DBC *, DBC **, u_int32_t,
- * PUBLIC:      __dbc_dup_reply *));
+ * PUBLIC: int __dbcl_dbc_c_pget_ret __P((DBC *, DBT *, DBT *, DBT *, u_int32_t,
+ * PUBLIC:      __dbc_c_pget_reply *));
  */
 int
-__dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp)
+__dbcl_dbc_c_pget_ret(dbc, skey, pkey, data, flags, replyp)
 	DBC * dbc;
-	DBC ** dbcp;
+	DBT * skey;
+	DBT * pkey;
+	DBT * data;
 	u_int32_t flags;
-	__dbc_dup_reply *replyp;
+	__dbc_c_pget_reply *replyp;
 {
 	int ret;
-	long dbcid;
+	/* DBT skey; */
+	/* DBT pkey; */
+	/* DBT data; */
 
 	if (replyp->status != 0)
 		return (replyp->status);
-	dbcid = replyp->dbcidcl_id;
+	/* Handle replyp->skeydata; */
+	/* Handle replyp->pkeydata; */
+	/* Handle replyp->datadata; */
 
 	/*
 	 * XXX Code goes here
@@ -637,25 +651,23 @@ __dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_get_ret __P((DBC *, DBT *, DBT *, u_int32_t,
- * PUBLIC:      __dbc_get_reply *));
+ * PUBLIC: int __dbcl_dbc_c_put_ret __P((DBC *, DBT *, DBT *, u_int32_t,
+ * PUBLIC:      __dbc_c_put_reply *));
  */
 int
-__dbcl_dbc_get_ret(dbc, key, data, flags, replyp)
+__dbcl_dbc_c_put_ret(dbc, key, data, flags, replyp)
 	DBC * dbc;
 	DBT * key;
 	DBT * data;
 	u_int32_t flags;
-	__dbc_get_reply *replyp;
+	__dbc_c_put_reply *replyp;
 {
 	int ret;
 	/* DBT key; */
-	/* DBT data; */
 
 	if (replyp->status != 0)
 		return (replyp->status);
 	/* Handle replyp->keydata; */
-	/* Handle replyp->datadata; */
 
 	/*
 	 * XXX Code goes here
@@ -665,28 +677,39 @@ __dbcl_dbc_get_ret(dbc, key, data, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_pget_ret __P((DBC *, DBT *, DBT *, DBT *, u_int32_t,
- * PUBLIC:      __dbc_pget_reply *));
+ * PUBLIC: int __dbcl_txn_abort_ret __P((DB_TXN *, __txn_abort_reply *));
  */
 int
-__dbcl_dbc_pget_ret(dbc, skey, pkey, data, flags, replyp)
-	DBC * dbc;
-	DBT * skey;
-	DBT * pkey;
-	DBT * data;
+__dbcl_txn_abort_ret(txnp, replyp)
+	DB_TXN * txnp;
+	__txn_abort_reply *replyp;
+{
+	int ret;
+
+	if (replyp->status != 0)
+		return (replyp->status);
+
+	/*
+	 * XXX Code goes here
+	 */
+
+	return (replyp->status);
+}
+
+/*
+ * PUBLIC: int __dbcl_txn_commit_ret __P((DB_TXN *, u_int32_t,
+ * PUBLIC:      __txn_commit_reply *));
+ */
+int
+__dbcl_txn_commit_ret(txnp, flags, replyp)
+	DB_TXN * txnp;
 	u_int32_t flags;
-	__dbc_pget_reply *replyp;
+	__txn_commit_reply *replyp;
 {
 	int ret;
-	/* DBT skey; */
-	/* DBT pkey; */
-	/* DBT data; */
 
 	if (replyp->status != 0)
 		return (replyp->status);
-	/* Handle replyp->skeydata; */
-	/* Handle replyp->pkeydata; */
-	/* Handle replyp->datadata; */
 
 	/*
 	 * XXX Code goes here
@@ -696,23 +719,19 @@ __dbcl_dbc_pget_ret(dbc, skey, pkey, data, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_put_ret __P((DBC *, DBT *, DBT *, u_int32_t,
- * PUBLIC:      __dbc_put_reply *));
+ * PUBLIC: int __dbcl_txn_discard_ret __P((DB_TXN *, u_int32_t,
+ * PUBLIC:      __txn_discard_reply *));
  */
 int
-__dbcl_dbc_put_ret(dbc, key, data, flags, replyp)
-	DBC * dbc;
-	DBT * key;
-	DBT * data;
+__dbcl_txn_discard_ret(txnp, flags, replyp)
+	DB_TXN * txnp;
 	u_int32_t flags;
-	__dbc_put_reply *replyp;
+	__txn_discard_reply *replyp;
 {
 	int ret;
-	/* DBT key; */
 
 	if (replyp->status != 0)
 		return (replyp->status);
-	/* Handle replyp->keydata; */
 
 	/*
 	 * XXX Code goes here
diff --git a/db/dist/template/rec_btree b/db/dist/template/rec_btree
index 0b2c96182..64a123ae3 100644
--- a/db/dist/template/rec_btree
+++ b/db/dist/template/rec_btree
@@ -1,11 +1,5 @@
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/__bam.h"
@@ -631,3 +625,189 @@ __bam_relink_recover(dbenv, dbtp, lsnp, op, info)
 out:	REC_CLOSE;
 }
 
+/*
+ * __bam_relink_recover --
+ *	Recovery function for relink.
+ *
+ * PUBLIC: int __bam_relink_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__bam_relink_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__bam_relink_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	int cmp_n, cmp_p, modified, ret;
+
+	REC_PRINT(__bam_relink_print);
+	REC_INTRO(__bam_relink_read, 1);
+
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
+		if (DB_REDO(op)) {
+			if ((ret = mpf->get(mpf,
+			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+				goto out;
+		} else {
+			*lsnp = argp->prev_lsn;
+			ret = 0;
+			goto out;
+		}
+
+	modified = 0;
+	cmp_n = log_compare(lsnp, &LSN(pagep));
+
+	/*
+	 * Use this when there is something like "pagelsn" in the argp
+	 * structure.  Sometimes, you might need to compare meta-data
+	 * lsn's instead.
+	 *
+	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
+	 */
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo update described. */
+		modified = 1;
+	} else if (cmp_n == 0 && !DB_REDO(op)) {
+		/* Need to undo update described. */
+		modified = 1;
+	}
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+		goto out;
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	REC_CLOSE;
+}
+
+/*
+ * __bam_merge_recover --
+ *	Recovery function for merge.
+ *
+ * PUBLIC: int __bam_merge_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__bam_merge_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__bam_merge_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	int cmp_n, cmp_p, modified, ret;
+
+	REC_PRINT(__bam_merge_print);
+	REC_INTRO(__bam_merge_read, 1);
+
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
+		if (DB_REDO(op)) {
+			if ((ret = mpf->get(mpf,
+			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+				goto out;
+		} else {
+			*lsnp = argp->prev_lsn;
+			ret = 0;
+			goto out;
+		}
+
+	modified = 0;
+	cmp_n = log_compare(lsnp, &LSN(pagep));
+
+	/*
+	 * Use this when there is something like "pagelsn" in the argp
+	 * structure.  Sometimes, you might need to compare meta-data
+	 * lsn's instead.
+	 *
+	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
+	 */
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo update described. */
+		modified = 1;
+	} else if (cmp_n == 0 && !DB_REDO(op)) {
+		/* Need to undo update described. */
+		modified = 1;
+	}
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+		goto out;
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	REC_CLOSE;
+}
+
+/*
+ * __bam_pgno_recover --
+ *	Recovery function for pgno.
+ *
+ * PUBLIC: int __bam_pgno_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__bam_pgno_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__bam_pgno_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	int cmp_n, cmp_p, modified, ret;
+
+	REC_PRINT(__bam_pgno_print);
+	REC_INTRO(__bam_pgno_read, 1);
+
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
+		if (DB_REDO(op)) {
+			if ((ret = mpf->get(mpf,
+			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+				goto out;
+		} else {
+			*lsnp = argp->prev_lsn;
+			ret = 0;
+			goto out;
+		}
+
+	modified = 0;
+	cmp_n = log_compare(lsnp, &LSN(pagep));
+
+	/*
+	 * Use this when there is something like "pagelsn" in the argp
+	 * structure.  Sometimes, you might need to compare meta-data
+	 * lsn's instead.
+	 *
+	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
+	 */
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo update described. */
+		modified = 1;
+	} else if (cmp_n == 0 && !DB_REDO(op)) {
+		/* Need to undo update described. */
+		modified = 1;
+	}
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+		goto out;
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	REC_CLOSE;
+}
+
diff --git a/db/dist/template/rec_crdel b/db/dist/template/rec_crdel
index 352e9ae5f..3909fe620 100644
--- a/db/dist/template/rec_crdel
+++ b/db/dist/template/rec_crdel
@@ -1,77 +1,9 @@
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
-#include "db_page.h"
-#include "crdel.h"
-#include "log.h"
-
-/*
- * __crdel_fileopen_recover --
- *	Recovery function for fileopen.
- *
- * PUBLIC: int __crdel_fileopen_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
- */
-int
-__crdel_fileopen_recover(dbenv, dbtp, lsnp, op, info)
-	DB_ENV *dbenv;
-	DBT *dbtp;
-	DB_LSN *lsnp;
-	db_recops op;
-	void *info;
-{
-	__crdel_fileopen_args *argp;
-	DB *file_dbp;
-	DBC *dbc;
-	DB_MPOOLFILE *mpf;
-	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
-
-	REC_PRINT(__crdel_fileopen_print);
-	REC_INTRO(__crdel_fileopen_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
-		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
-			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
-				goto out;
-		} else {
-			*lsnp = argp->prev_lsn;
-			ret = 0;
-			goto out;
-		}
-
-	modified = 0;
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-
-	/*
-	 * Use this when there is something like "pagelsn" in the argp
-	 * structure.  Sometimes, you might need to compare meta-data
-	 * lsn's instead.
-	 *
-	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
-	 */
-	if (cmp_p == 0 && DB_REDO(op)) {
-		/* Need to redo update described. */
-		modified = 1;
-	} else if (cmp_n == 0 && !DB_REDO(op)) {
-		/* Need to undo update described. */
-		modified = 1;
-	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
-		goto out;
-
-	*lsnp = argp->prev_lsn;
-	ret = 0;
-
-out:	REC_CLOSE;
-}
+#include "dbinc/db_page.h"
+#include "dbinc/__crdel.h"
+#include "dbinc/log.h"
 
 /*
  * __crdel_metasub_recover --
@@ -96,73 +28,11 @@ __crdel_metasub_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__crdel_metasub_print);
-	REC_INTRO(__crdel_metasub_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
-		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
-			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
-				goto out;
-		} else {
-			*lsnp = argp->prev_lsn;
-			ret = 0;
-			goto out;
-		}
-
-	modified = 0;
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-
-	/*
-	 * Use this when there is something like "pagelsn" in the argp
-	 * structure.  Sometimes, you might need to compare meta-data
-	 * lsn's instead.
-	 *
-	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
-	 */
-	if (cmp_p == 0 && DB_REDO(op)) {
-		/* Need to redo update described. */
-		modified = 1;
-	} else if (cmp_n == 0 && !DB_REDO(op)) {
-		/* Need to undo update described. */
-		modified = 1;
-	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
-		goto out;
-
-	*lsnp = argp->prev_lsn;
-	ret = 0;
-
-out:	REC_CLOSE;
-}
-
-/*
- * __crdel_metapage_recover --
- *	Recovery function for metapage.
- *
- * PUBLIC: int __crdel_metapage_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
- */
-int
-__crdel_metapage_recover(dbenv, dbtp, lsnp, op, info)
-	DB_ENV *dbenv;
-	DBT *dbtp;
-	DB_LSN *lsnp;
-	db_recops op;
-	void *info;
-{
-	__crdel_metapage_args *argp;
-	DB *file_dbp;
-	DBC *dbc;
-	DB_MPOOLFILE *mpf;
-	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
-
-	REC_PRINT(__crdel_metapage_print);
-	REC_INTRO(__crdel_metapage_read);
+	REC_INTRO(__crdel_metasub_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -188,7 +58,7 @@ __crdel_metapage_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -198,33 +68,33 @@ out:	REC_CLOSE;
 }
 
 /*
- * __crdel_old_delete_recover --
- *	Recovery function for old_delete.
+ * __crdel_inmem_create_recover --
+ *	Recovery function for inmem_create.
  *
- * PUBLIC: int __crdel_old_delete_recover
+ * PUBLIC: int __crdel_inmem_create_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__crdel_old_delete_recover(dbenv, dbtp, lsnp, op, info)
+__crdel_inmem_create_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__crdel_old_delete_args *argp;
+	__crdel_inmem_create_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__crdel_old_delete_print);
-	REC_INTRO(__crdel_old_delete_read);
+	REC_PRINT(__crdel_inmem_create_print);
+	REC_INTRO(__crdel_inmem_create_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -250,7 +120,7 @@ __crdel_old_delete_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -260,33 +130,33 @@ out:	REC_CLOSE;
 }
 
 /*
- * __crdel_rename_recover --
- *	Recovery function for rename.
+ * __crdel_inmem_rename_recover --
+ *	Recovery function for inmem_rename.
  *
- * PUBLIC: int __crdel_rename_recover
+ * PUBLIC: int __crdel_inmem_rename_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__crdel_rename_recover(dbenv, dbtp, lsnp, op, info)
+__crdel_inmem_rename_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__crdel_rename_args *argp;
+	__crdel_inmem_rename_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__crdel_rename_print);
-	REC_INTRO(__crdel_rename_read);
+	REC_PRINT(__crdel_inmem_rename_print);
+	REC_INTRO(__crdel_inmem_rename_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -312,7 +182,7 @@ __crdel_rename_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -322,33 +192,33 @@ out:	REC_CLOSE;
 }
 
 /*
- * __crdel_delete_recover --
- *	Recovery function for delete.
+ * __crdel_inmem_remove_recover --
+ *	Recovery function for inmem_remove.
  *
- * PUBLIC: int __crdel_delete_recover
+ * PUBLIC: int __crdel_inmem_remove_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__crdel_delete_recover(dbenv, dbtp, lsnp, op, info)
+__crdel_inmem_remove_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__crdel_delete_args *argp;
+	__crdel_inmem_remove_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__crdel_delete_print);
-	REC_INTRO(__crdel_delete_read);
+	REC_PRINT(__crdel_inmem_remove_print);
+	REC_INTRO(__crdel_inmem_remove_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -374,7 +244,7 @@ __crdel_delete_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
diff --git a/db/dist/template/rec_ctemp b/db/dist/template/rec_ctemp
index 6be6d3166..2951189c5 100644
--- a/db/dist/template/rec_ctemp
+++ b/db/dist/template/rec_ctemp
@@ -1,31 +1,31 @@
 /*
- * __PREF_FUNC_recover --
+ * PREF_FUNC_recover --
  *	Recovery function for FUNC.
  *
- * PUBLIC: int __PREF_FUNC_recover
+ * PUBLIC: int PREF_FUNC_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__PREF_FUNC_recover(dbenv, dbtp, lsnp, op, info)
+PREF_FUNC_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__PREF_FUNC_args *argp;
+	PREF_FUNC_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__PREF_FUNC_print);
-	REC_INTRO(__PREF_FUNC_read);
+	REC_PRINT(PREF_FUNC_print);
+	REC_INTRO(PREF_FUNC_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -51,7 +51,7 @@ __PREF_FUNC_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
diff --git a/db/dist/template/rec_db b/db/dist/template/rec_db
index 5c4c8f08d..5e3f70cef 100644
--- a/db/dist/template/rec_db
+++ b/db/dist/template/rec_db
@@ -1,11 +1,5 @@
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/__db.h"
@@ -197,6 +191,68 @@ __db_ovref_recover(dbenv, dbtp, lsnp, op, info)
 out:	REC_CLOSE;
 }
 
+/*
+ * __db_relink_recover --
+ *	Recovery function for relink.
+ *
+ * PUBLIC: int __db_relink_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_relink_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__db_relink_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	int cmp_n, cmp_p, modified, ret;
+
+	REC_PRINT(__db_relink_print);
+	REC_INTRO(__db_relink_read, 1);
+
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
+		if (DB_REDO(op)) {
+			if ((ret = mpf->get(mpf,
+			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+				goto out;
+		} else {
+			*lsnp = argp->prev_lsn;
+			ret = 0;
+			goto out;
+		}
+
+	modified = 0;
+	cmp_n = log_compare(lsnp, &LSN(pagep));
+
+	/*
+	 * Use this when there is something like "pagelsn" in the argp
+	 * structure.  Sometimes, you might need to compare meta-data
+	 * lsn's instead.
+	 *
+	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
+	 */
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo update described. */
+		modified = 1;
+	} else if (cmp_n == 0 && !DB_REDO(op)) {
+		/* Need to undo update described. */
+		modified = 1;
+	}
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+		goto out;
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	REC_CLOSE;
+}
+
 /*
  * __db_debug_recover --
  *	Recovery function for debug.
@@ -383,6 +439,130 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 out:	REC_CLOSE;
 }
 
+/*
+ * __db_pg_alloc_recover --
+ *	Recovery function for pg_alloc.
+ *
+ * PUBLIC: int __db_pg_alloc_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__db_pg_alloc_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	int cmp_n, cmp_p, modified, ret;
+
+	REC_PRINT(__db_pg_alloc_print);
+	REC_INTRO(__db_pg_alloc_read, 1);
+
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
+		if (DB_REDO(op)) {
+			if ((ret = mpf->get(mpf,
+			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+				goto out;
+		} else {
+			*lsnp = argp->prev_lsn;
+			ret = 0;
+			goto out;
+		}
+
+	modified = 0;
+	cmp_n = log_compare(lsnp, &LSN(pagep));
+
+	/*
+	 * Use this when there is something like "pagelsn" in the argp
+	 * structure.  Sometimes, you might need to compare meta-data
+	 * lsn's instead.
+	 *
+	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
+	 */
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo update described. */
+		modified = 1;
+	} else if (cmp_n == 0 && !DB_REDO(op)) {
+		/* Need to undo update described. */
+		modified = 1;
+	}
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+		goto out;
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	REC_CLOSE;
+}
+
+/*
+ * __db_pg_free_recover --
+ *	Recovery function for pg_free.
+ *
+ * PUBLIC: int __db_pg_free_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_pg_free_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__db_pg_free_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	int cmp_n, cmp_p, modified, ret;
+
+	REC_PRINT(__db_pg_free_print);
+	REC_INTRO(__db_pg_free_read, 1);
+
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
+		if (DB_REDO(op)) {
+			if ((ret = mpf->get(mpf,
+			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+				goto out;
+		} else {
+			*lsnp = argp->prev_lsn;
+			ret = 0;
+			goto out;
+		}
+
+	modified = 0;
+	cmp_n = log_compare(lsnp, &LSN(pagep));
+
+	/*
+	 * Use this when there is something like "pagelsn" in the argp
+	 * structure.  Sometimes, you might need to compare meta-data
+	 * lsn's instead.
+	 *
+	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
+	 */
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo update described. */
+		modified = 1;
+	} else if (cmp_n == 0 && !DB_REDO(op)) {
+		/* Need to undo update described. */
+		modified = 1;
+	}
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+		goto out;
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	REC_CLOSE;
+}
+
 /*
  * __db_pg_free_recover --
  *	Recovery function for pg_free.
@@ -569,6 +749,68 @@ __db_pg_freedata_recover(dbenv, dbtp, lsnp, op, info)
 out:	REC_CLOSE;
 }
 
+/*
+ * __db_pg_freedata_recover --
+ *	Recovery function for pg_freedata.
+ *
+ * PUBLIC: int __db_pg_freedata_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_pg_freedata_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__db_pg_freedata_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	int cmp_n, cmp_p, modified, ret;
+
+	REC_PRINT(__db_pg_freedata_print);
+	REC_INTRO(__db_pg_freedata_read, 1);
+
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
+		if (DB_REDO(op)) {
+			if ((ret = mpf->get(mpf,
+			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+				goto out;
+		} else {
+			*lsnp = argp->prev_lsn;
+			ret = 0;
+			goto out;
+		}
+
+	modified = 0;
+	cmp_n = log_compare(lsnp, &LSN(pagep));
+
+	/*
+	 * Use this when there is something like "pagelsn" in the argp
+	 * structure.  Sometimes, you might need to compare meta-data
+	 * lsn's instead.
+	 *
+	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
+	 */
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo update described. */
+		modified = 1;
+	} else if (cmp_n == 0 && !DB_REDO(op)) {
+		/* Need to undo update described. */
+		modified = 1;
+	}
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+		goto out;
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	REC_CLOSE;
+}
+
 /*
  * __db_pg_prepare_recover --
  *	Recovery function for pg_prepare.
@@ -755,3 +997,65 @@ __db_pg_init_recover(dbenv, dbtp, lsnp, op, info)
 out:	REC_CLOSE;
 }
 
+/*
+ * __db_pg_sort_recover --
+ *	Recovery function for pg_sort.
+ *
+ * PUBLIC: int __db_pg_sort_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ */
+int
+__db_pg_sort_recover(dbenv, dbtp, lsnp, op, info)
+	DB_ENV *dbenv;
+	DBT *dbtp;
+	DB_LSN *lsnp;
+	db_recops op;
+	void *info;
+{
+	__db_pg_sort_args *argp;
+	DB *file_dbp;
+	DBC *dbc;
+	DB_MPOOLFILE *mpf;
+	PAGE *pagep;
+	int cmp_n, cmp_p, modified, ret;
+
+	REC_PRINT(__db_pg_sort_print);
+	REC_INTRO(__db_pg_sort_read, 1);
+
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
+		if (DB_REDO(op)) {
+			if ((ret = mpf->get(mpf,
+			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
+				goto out;
+		} else {
+			*lsnp = argp->prev_lsn;
+			ret = 0;
+			goto out;
+		}
+
+	modified = 0;
+	cmp_n = log_compare(lsnp, &LSN(pagep));
+
+	/*
+	 * Use this when there is something like "pagelsn" in the argp
+	 * structure.  Sometimes, you might need to compare meta-data
+	 * lsn's instead.
+	 *
+	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
+	 */
+	if (cmp_p == 0 && DB_REDO(op)) {
+		/* Need to redo update described. */
+		modified = 1;
+	} else if (cmp_n == 0 && !DB_REDO(op)) {
+		/* Need to undo update described. */
+		modified = 1;
+	}
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+		goto out;
+
+	*lsnp = argp->prev_lsn;
+	ret = 0;
+
+out:	REC_CLOSE;
+}
+
diff --git a/db/dist/template/rec_dbreg b/db/dist/template/rec_dbreg
index bbdf19d5f..765424ccb 100644
--- a/db/dist/template/rec_dbreg
+++ b/db/dist/template/rec_dbreg
@@ -1,11 +1,5 @@
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/__dbreg.h"
diff --git a/db/dist/template/rec_fileops b/db/dist/template/rec_fileops
index c1487835e..492208635 100644
--- a/db/dist/template/rec_fileops
+++ b/db/dist/template/rec_fileops
@@ -1,11 +1,5 @@
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/__fop.h"
diff --git a/db/dist/template/rec_hash b/db/dist/template/rec_hash
index bcee2131c..dc0303139 100644
--- a/db/dist/template/rec_hash
+++ b/db/dist/template/rec_hash
@@ -1,15 +1,9 @@
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
-#include "db_page.h"
-#include "ham.h"
-#include "log.h"
+#include "dbinc/db_page.h"
+#include "dbinc/__ham.h"
+#include "dbinc/log.h"
 
 /*
  * __ham_insdel_recover --
@@ -34,11 +28,11 @@ __ham_insdel_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__ham_insdel_print);
-	REC_INTRO(__ham_insdel_read);
+	REC_INTRO(__ham_insdel_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -64,7 +58,7 @@ __ham_insdel_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -96,11 +90,11 @@ __ham_newpage_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__ham_newpage_print);
-	REC_INTRO(__ham_newpage_read);
+	REC_INTRO(__ham_newpage_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -126,69 +120,7 @@ __ham_newpage_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
-		goto out;
-
-	*lsnp = argp->prev_lsn;
-	ret = 0;
-
-out:	REC_CLOSE;
-}
-
-/*
- * __ham_splitmeta_recover --
- *	Recovery function for splitmeta.
- *
- * PUBLIC: int __ham_splitmeta_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
- */
-int
-__ham_splitmeta_recover(dbenv, dbtp, lsnp, op, info)
-	DB_ENV *dbenv;
-	DBT *dbtp;
-	DB_LSN *lsnp;
-	db_recops op;
-	void *info;
-{
-	__ham_splitmeta_args *argp;
-	DB *file_dbp;
-	DBC *dbc;
-	DB_MPOOLFILE *mpf;
-	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
-
-	REC_PRINT(__ham_splitmeta_print);
-	REC_INTRO(__ham_splitmeta_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
-		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
-			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
-				goto out;
-		} else {
-			*lsnp = argp->prev_lsn;
-			ret = 0;
-			goto out;
-		}
-
-	modified = 0;
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-
-	/*
-	 * Use this when there is something like "pagelsn" in the argp
-	 * structure.  Sometimes, you might need to compare meta-data
-	 * lsn's instead.
-	 *
-	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
-	 */
-	if (cmp_p == 0 && DB_REDO(op)) {
-		/* Need to redo update described. */
-		modified = 1;
-	} else if (cmp_n == 0 && !DB_REDO(op)) {
-		/* Need to undo update described. */
-		modified = 1;
-	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -220,11 +152,11 @@ __ham_splitdata_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__ham_splitdata_print);
-	REC_INTRO(__ham_splitdata_read);
+	REC_INTRO(__ham_splitdata_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -250,7 +182,7 @@ __ham_splitdata_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -282,73 +214,11 @@ __ham_replace_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__ham_replace_print);
-	REC_INTRO(__ham_replace_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
-		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
-			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
-				goto out;
-		} else {
-			*lsnp = argp->prev_lsn;
-			ret = 0;
-			goto out;
-		}
-
-	modified = 0;
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-
-	/*
-	 * Use this when there is something like "pagelsn" in the argp
-	 * structure.  Sometimes, you might need to compare meta-data
-	 * lsn's instead.
-	 *
-	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
-	 */
-	if (cmp_p == 0 && DB_REDO(op)) {
-		/* Need to redo update described. */
-		modified = 1;
-	} else if (cmp_n == 0 && !DB_REDO(op)) {
-		/* Need to undo update described. */
-		modified = 1;
-	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
-		goto out;
-
-	*lsnp = argp->prev_lsn;
-	ret = 0;
+	REC_INTRO(__ham_replace_read, 1);
 
-out:	REC_CLOSE;
-}
-
-/*
- * __ham_newpgno_recover --
- *	Recovery function for newpgno.
- *
- * PUBLIC: int __ham_newpgno_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
- */
-int
-__ham_newpgno_recover(dbenv, dbtp, lsnp, op, info)
-	DB_ENV *dbenv;
-	DBT *dbtp;
-	DB_LSN *lsnp;
-	db_recops op;
-	void *info;
-{
-	__ham_newpgno_args *argp;
-	DB *file_dbp;
-	DBC *dbc;
-	DB_MPOOLFILE *mpf;
-	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
-
-	REC_PRINT(__ham_newpgno_print);
-	REC_INTRO(__ham_newpgno_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -374,69 +244,7 @@ __ham_newpgno_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
-		goto out;
-
-	*lsnp = argp->prev_lsn;
-	ret = 0;
-
-out:	REC_CLOSE;
-}
-
-/*
- * __ham_ovfl_recover --
- *	Recovery function for ovfl.
- *
- * PUBLIC: int __ham_ovfl_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
- */
-int
-__ham_ovfl_recover(dbenv, dbtp, lsnp, op, info)
-	DB_ENV *dbenv;
-	DBT *dbtp;
-	DB_LSN *lsnp;
-	db_recops op;
-	void *info;
-{
-	__ham_ovfl_args *argp;
-	DB *file_dbp;
-	DBC *dbc;
-	DB_MPOOLFILE *mpf;
-	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
-
-	REC_PRINT(__ham_ovfl_print);
-	REC_INTRO(__ham_ovfl_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
-		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
-			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
-				goto out;
-		} else {
-			*lsnp = argp->prev_lsn;
-			ret = 0;
-			goto out;
-		}
-
-	modified = 0;
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-
-	/*
-	 * Use this when there is something like "pagelsn" in the argp
-	 * structure.  Sometimes, you might need to compare meta-data
-	 * lsn's instead.
-	 *
-	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
-	 */
-	if (cmp_p == 0 && DB_REDO(op)) {
-		/* Need to redo update described. */
-		modified = 1;
-	} else if (cmp_n == 0 && !DB_REDO(op)) {
-		/* Need to undo update described. */
-		modified = 1;
-	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -468,11 +276,11 @@ __ham_copypage_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__ham_copypage_print);
-	REC_INTRO(__ham_copypage_read);
+	REC_INTRO(__ham_copypage_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -498,7 +306,7 @@ __ham_copypage_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -530,11 +338,11 @@ __ham_metagroup_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__ham_metagroup_print);
-	REC_INTRO(__ham_metagroup_read);
+	REC_INTRO(__ham_metagroup_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -560,7 +368,7 @@ __ham_metagroup_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -570,33 +378,33 @@ out:	REC_CLOSE;
 }
 
 /*
- * __ham_groupalloc1_recover --
- *	Recovery function for groupalloc1.
+ * __ham_metagroup_recover --
+ *	Recovery function for metagroup.
  *
- * PUBLIC: int __ham_groupalloc1_recover
+ * PUBLIC: int __ham_metagroup_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__ham_groupalloc1_recover(dbenv, dbtp, lsnp, op, info)
+__ham_metagroup_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__ham_groupalloc1_args *argp;
+	__ham_metagroup_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__ham_groupalloc1_print);
-	REC_INTRO(__ham_groupalloc1_read);
+	REC_PRINT(__ham_metagroup_print);
+	REC_INTRO(__ham_metagroup_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -622,7 +430,7 @@ __ham_groupalloc1_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -632,33 +440,33 @@ out:	REC_CLOSE;
 }
 
 /*
- * __ham_groupalloc2_recover --
- *	Recovery function for groupalloc2.
+ * __ham_groupalloc_recover --
+ *	Recovery function for groupalloc.
  *
- * PUBLIC: int __ham_groupalloc2_recover
+ * PUBLIC: int __ham_groupalloc_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__ham_groupalloc2_recover(dbenv, dbtp, lsnp, op, info)
+__ham_groupalloc_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__ham_groupalloc2_args *argp;
+	__ham_groupalloc_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__ham_groupalloc2_print);
-	REC_INTRO(__ham_groupalloc2_read);
+	REC_PRINT(__ham_groupalloc_print);
+	REC_INTRO(__ham_groupalloc_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -684,7 +492,7 @@ __ham_groupalloc2_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -716,11 +524,11 @@ __ham_groupalloc_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__ham_groupalloc_print);
-	REC_INTRO(__ham_groupalloc_read);
+	REC_INTRO(__ham_groupalloc_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -746,7 +554,7 @@ __ham_groupalloc_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -778,11 +586,11 @@ __ham_curadj_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__ham_curadj_print);
-	REC_INTRO(__ham_curadj_read);
+	REC_INTRO(__ham_curadj_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -808,7 +616,7 @@ __ham_curadj_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -840,11 +648,11 @@ __ham_chgpg_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__ham_chgpg_print);
-	REC_INTRO(__ham_chgpg_read);
+	REC_INTRO(__ham_chgpg_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -870,7 +678,7 @@ __ham_chgpg_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
diff --git a/db/dist/template/rec_qam b/db/dist/template/rec_qam
index fcd24d6a2..af4f4e97a 100644
--- a/db/dist/template/rec_qam
+++ b/db/dist/template/rec_qam
@@ -1,77 +1,9 @@
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
-#include "db_page.h"
-#include "qam.h"
-#include "log.h"
-
-/*
- * __qam_inc_recover --
- *	Recovery function for inc.
- *
- * PUBLIC: int __qam_inc_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
- */
-int
-__qam_inc_recover(dbenv, dbtp, lsnp, op, info)
-	DB_ENV *dbenv;
-	DBT *dbtp;
-	DB_LSN *lsnp;
-	db_recops op;
-	void *info;
-{
-	__qam_inc_args *argp;
-	DB *file_dbp;
-	DBC *dbc;
-	DB_MPOOLFILE *mpf;
-	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
-
-	REC_PRINT(__qam_inc_print);
-	REC_INTRO(__qam_inc_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
-		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
-			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
-				goto out;
-		} else {
-			*lsnp = argp->prev_lsn;
-			ret = 0;
-			goto out;
-		}
-
-	modified = 0;
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-
-	/*
-	 * Use this when there is something like "pagelsn" in the argp
-	 * structure.  Sometimes, you might need to compare meta-data
-	 * lsn's instead.
-	 *
-	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
-	 */
-	if (cmp_p == 0 && DB_REDO(op)) {
-		/* Need to redo update described. */
-		modified = 1;
-	} else if (cmp_n == 0 && !DB_REDO(op)) {
-		/* Need to undo update described. */
-		modified = 1;
-	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
-		goto out;
-
-	*lsnp = argp->prev_lsn;
-	ret = 0;
-
-out:	REC_CLOSE;
-}
+#include "dbinc/db_page.h"
+#include "dbinc/__qam.h"
+#include "dbinc/log.h"
 
 /*
  * __qam_incfirst_recover --
@@ -96,11 +28,11 @@ __qam_incfirst_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__qam_incfirst_print);
-	REC_INTRO(__qam_incfirst_read);
+	REC_INTRO(__qam_incfirst_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -126,7 +58,7 @@ __qam_incfirst_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -158,11 +90,11 @@ __qam_mvptr_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__qam_mvptr_print);
-	REC_INTRO(__qam_mvptr_read);
+	REC_INTRO(__qam_mvptr_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -188,7 +120,7 @@ __qam_mvptr_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -220,11 +152,11 @@ __qam_del_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__qam_del_print);
-	REC_INTRO(__qam_del_read);
+	REC_INTRO(__qam_del_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -250,7 +182,7 @@ __qam_del_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -282,135 +214,11 @@ __qam_add_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__qam_add_print);
-	REC_INTRO(__qam_add_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
-		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
-			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
-				goto out;
-		} else {
-			*lsnp = argp->prev_lsn;
-			ret = 0;
-			goto out;
-		}
-
-	modified = 0;
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-
-	/*
-	 * Use this when there is something like "pagelsn" in the argp
-	 * structure.  Sometimes, you might need to compare meta-data
-	 * lsn's instead.
-	 *
-	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
-	 */
-	if (cmp_p == 0 && DB_REDO(op)) {
-		/* Need to redo update described. */
-		modified = 1;
-	} else if (cmp_n == 0 && !DB_REDO(op)) {
-		/* Need to undo update described. */
-		modified = 1;
-	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
-		goto out;
-
-	*lsnp = argp->prev_lsn;
-	ret = 0;
-
-out:	REC_CLOSE;
-}
-
-/*
- * __qam_delete_recover --
- *	Recovery function for delete.
- *
- * PUBLIC: int __qam_delete_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
- */
-int
-__qam_delete_recover(dbenv, dbtp, lsnp, op, info)
-	DB_ENV *dbenv;
-	DBT *dbtp;
-	DB_LSN *lsnp;
-	db_recops op;
-	void *info;
-{
-	__qam_delete_args *argp;
-	DB *file_dbp;
-	DBC *dbc;
-	DB_MPOOLFILE *mpf;
-	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
-
-	REC_PRINT(__qam_delete_print);
-	REC_INTRO(__qam_delete_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
-		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
-			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
-				goto out;
-		} else {
-			*lsnp = argp->prev_lsn;
-			ret = 0;
-			goto out;
-		}
-
-	modified = 0;
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-
-	/*
-	 * Use this when there is something like "pagelsn" in the argp
-	 * structure.  Sometimes, you might need to compare meta-data
-	 * lsn's instead.
-	 *
-	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
-	 */
-	if (cmp_p == 0 && DB_REDO(op)) {
-		/* Need to redo update described. */
-		modified = 1;
-	} else if (cmp_n == 0 && !DB_REDO(op)) {
-		/* Need to undo update described. */
-		modified = 1;
-	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
-		goto out;
-
-	*lsnp = argp->prev_lsn;
-	ret = 0;
-
-out:	REC_CLOSE;
-}
-
-/*
- * __qam_rename_recover --
- *	Recovery function for rename.
- *
- * PUBLIC: int __qam_rename_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
- */
-int
-__qam_rename_recover(dbenv, dbtp, lsnp, op, info)
-	DB_ENV *dbenv;
-	DBT *dbtp;
-	DB_LSN *lsnp;
-	db_recops op;
-	void *info;
-{
-	__qam_rename_args *argp;
-	DB *file_dbp;
-	DBC *dbc;
-	DB_MPOOLFILE *mpf;
-	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
-
-	REC_PRINT(__qam_rename_print);
-	REC_INTRO(__qam_rename_read);
+	REC_INTRO(__qam_add_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -436,7 +244,7 @@ __qam_rename_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -468,11 +276,11 @@ __qam_delext_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__qam_delext_print);
-	REC_INTRO(__qam_delext_read);
+	REC_INTRO(__qam_delext_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -498,7 +306,7 @@ __qam_delext_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
diff --git a/db/dist/template/rec_rep b/db/dist/template/rec_rep
index 872812cd0..8008c9de9 100644
--- a/db/dist/template/rec_rep
+++ b/db/dist/template/rec_rep
@@ -1,11 +1,5 @@
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
 #include "dbinc/db_page.h"
 #include "dbinc/__rep.h"
diff --git a/db/dist/template/rec_txn b/db/dist/template/rec_txn
index c66d604f5..d48d51739 100644
--- a/db/dist/template/rec_txn
+++ b/db/dist/template/rec_txn
@@ -1,44 +1,38 @@
 #include "db_config.h"
 
-#ifndef NO_SYSTEM_INCLUDES
-#include 
-
-#include 
-#endif
-
 #include "db_int.h"
-#include "db_page.h"
-#include "txn.h"
-#include "log.h"
+#include "dbinc/db_page.h"
+#include "dbinc/__txn.h"
+#include "dbinc/log.h"
 
 /*
- * __txn_old_regop_recover --
- *	Recovery function for old_regop.
+ * __txn_regop_recover --
+ *	Recovery function for regop.
  *
- * PUBLIC: int __txn_old_regop_recover
+ * PUBLIC: int __txn_regop_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__txn_old_regop_recover(dbenv, dbtp, lsnp, op, info)
+__txn_regop_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__txn_old_regop_args *argp;
+	__txn_regop_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__txn_old_regop_print);
-	REC_INTRO(__txn_old_regop_read);
+	REC_PRINT(__txn_regop_print);
+	REC_INTRO(__txn_regop_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -64,7 +58,7 @@ __txn_old_regop_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -96,11 +90,11 @@ __txn_regop_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__txn_regop_print);
-	REC_INTRO(__txn_regop_read);
+	REC_INTRO(__txn_regop_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -126,7 +120,7 @@ __txn_regop_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -136,33 +130,33 @@ out:	REC_CLOSE;
 }
 
 /*
- * __txn_old_ckp_recover --
- *	Recovery function for old_ckp.
+ * __txn_ckp_recover --
+ *	Recovery function for ckp.
  *
- * PUBLIC: int __txn_old_ckp_recover
+ * PUBLIC: int __txn_ckp_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__txn_old_ckp_recover(dbenv, dbtp, lsnp, op, info)
+__txn_ckp_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__txn_old_ckp_args *argp;
+	__txn_ckp_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__txn_old_ckp_print);
-	REC_INTRO(__txn_old_ckp_read);
+	REC_PRINT(__txn_ckp_print);
+	REC_INTRO(__txn_ckp_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -188,7 +182,7 @@ __txn_old_ckp_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -220,11 +214,11 @@ __txn_ckp_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__txn_ckp_print);
-	REC_INTRO(__txn_ckp_read);
+	REC_INTRO(__txn_ckp_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -250,7 +244,7 @@ __txn_ckp_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -260,33 +254,33 @@ out:	REC_CLOSE;
 }
 
 /*
- * __txn_xa_regop_old_recover --
- *	Recovery function for xa_regop_old.
+ * __txn_child_recover --
+ *	Recovery function for child.
  *
- * PUBLIC: int __txn_xa_regop_old_recover
+ * PUBLIC: int __txn_child_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__txn_xa_regop_old_recover(dbenv, dbtp, lsnp, op, info)
+__txn_child_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__txn_xa_regop_old_args *argp;
+	__txn_child_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__txn_xa_regop_old_print);
-	REC_INTRO(__txn_xa_regop_old_read);
+	REC_PRINT(__txn_child_print);
+	REC_INTRO(__txn_child_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -312,7 +306,7 @@ __txn_xa_regop_old_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -344,73 +338,11 @@ __txn_xa_regop_recover(dbenv, dbtp, lsnp, op, info)
 	int cmp_n, cmp_p, modified, ret;
 
 	REC_PRINT(__txn_xa_regop_print);
-	REC_INTRO(__txn_xa_regop_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
-		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
-			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
-				goto out;
-		} else {
-			*lsnp = argp->prev_lsn;
-			ret = 0;
-			goto out;
-		}
-
-	modified = 0;
-	cmp_n = log_compare(lsnp, &LSN(pagep));
-
-	/*
-	 * Use this when there is something like "pagelsn" in the argp
-	 * structure.  Sometimes, you might need to compare meta-data
-	 * lsn's instead.
-	 *
-	 * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
-	 */
-	if (cmp_p == 0 && DB_REDO(op)) {
-		/* Need to redo update described. */
-		modified = 1;
-	} else if (cmp_n == 0 && !DB_REDO(op)) {
-		/* Need to undo update described. */
-		modified = 1;
-	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
-		goto out;
-
-	*lsnp = argp->prev_lsn;
-	ret = 0;
-
-out:	REC_CLOSE;
-}
+	REC_INTRO(__txn_xa_regop_read, 1);
 
-/*
- * __txn_child_old_recover --
- *	Recovery function for child_old.
- *
- * PUBLIC: int __txn_child_old_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
- */
-int
-__txn_child_old_recover(dbenv, dbtp, lsnp, op, info)
-	DB_ENV *dbenv;
-	DBT *dbtp;
-	DB_LSN *lsnp;
-	db_recops op;
-	void *info;
-{
-	__txn_child_old_args *argp;
-	DB *file_dbp;
-	DBC *dbc;
-	DB_MPOOLFILE *mpf;
-	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
-
-	REC_PRINT(__txn_child_old_print);
-	REC_INTRO(__txn_child_old_read);
-
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -436,7 +368,7 @@ __txn_child_old_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
@@ -446,33 +378,33 @@ out:	REC_CLOSE;
 }
 
 /*
- * __txn_child_recover --
- *	Recovery function for child.
+ * __txn_recycle_recover --
+ *	Recovery function for recycle.
  *
- * PUBLIC: int __txn_child_recover
+ * PUBLIC: int __txn_recycle_recover
  * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
  */
 int
-__txn_child_recover(dbenv, dbtp, lsnp, op, info)
+__txn_recycle_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
 	void *info;
 {
-	__txn_child_args *argp;
+	__txn_recycle_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	int cmp_n, cmp_p, modified, ret;
 
-	REC_PRINT(__txn_child_print);
-	REC_INTRO(__txn_child_read);
+	REC_PRINT(__txn_recycle_print);
+	REC_INTRO(__txn_recycle_read, 1);
 
-	if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
+	if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
 		if (DB_REDO(op)) {
-			if ((ret = memp_fget(mpf,
+			if ((ret = mpf->get(mpf,
 			    &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
 				goto out;
 		} else {
@@ -498,7 +430,7 @@ __txn_child_recover(dbenv, dbtp, lsnp, op, info)
 		/* Need to undo update described. */
 		modified = 1;
 	}
-	if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
+	if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
 		goto out;
 
 	*lsnp = argp->prev_lsn;
diff --git a/db/dist/vx_2.0/wpj.in b/db/dist/vx_2.0/wpj.in
index a38cf7251..88b27dff2 100644
--- a/db/dist/vx_2.0/wpj.in
+++ b/db/dist/vx_2.0/wpj.in
@@ -134,27 +134,3 @@ PENTIUMgnu
  CORE_INFO_VERSION
 2.0
 
-
- FILE___DB_APPLICATION_NAME__.c_dependDone
-FALSE
-
-
- FILE___DB_APPLICATION_NAME__.c_dependencies
-
-
-
- FILE___DB_APPLICATION_NAME__.c_objects
-__DB_APPLICATION_NAME__.o
-
-
- FILE___DB_APPLICATION_NAME__.c_tool
-C/C++ compiler
-
-
- PROJECT_FILES
-$(PRJ_DIR)/__DB_APPLICATION_NAME__.c
-
-
- userComments
-__DB_APPLICATION_NAME__
-
diff --git a/db/dist/vx_2.2/wpj.in b/db/dist/vx_2.2/wpj.in
index d883ef2b1..17816d9d1 100644
--- a/db/dist/vx_2.2/wpj.in
+++ b/db/dist/vx_2.2/wpj.in
@@ -168,27 +168,3 @@ PENTIUM2gnu
  CORE_INFO_VERSION
 2.2
 
-
- FILE___DB_APPLICATION_NAME__.c_dependDone
-FALSE
-
-
- FILE___DB_APPLICATION_NAME__.c_dependencies
-
-
-
- FILE___DB_APPLICATION_NAME__.c_objects
-__DB_APPLICATION_NAME__.o
-
-
- FILE___DB_APPLICATION_NAME__.c_tool
-C/C++ compiler
-
-
- PROJECT_FILES
-$(PRJ_DIR)/__DB_APPLICATION_NAME__.c
-
-
- userComments
-__DB_APPLICATION_NAME__
-
diff --git a/db/dist/vx_buildcd b/db/dist/vx_buildcd
index a94d78db9..11f473bd9 100755
--- a/db/dist/vx_buildcd
+++ b/db/dist/vx_buildcd
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$Id: vx_buildcd,v 1.6 2001/11/05 21:05:58 sue Exp $
+#	$Id: vx_buildcd,v 12.1 2006/08/24 14:45:35 bostic Exp $
 #
 # Build the Setup SDK CD image on the VxWorks host machine.
 
@@ -75,7 +75,7 @@ f=$D/filelist.demo
 (sed -f $s $D/vx_demofile.in) > $t
     (echo "Building $f" && rm -f $f && cp $t $f)
 
-# Copy the Sleepycat specific files into the SetupSDK area.
+# Copy files into the SetupSDK area.
 (cd $D && cp README.TXT $S)
 (cd $D && cp LICENSE.TXT $S)
 (cd $D && cp CONFIG.TCL $S/RESOURCE/TCL)
@@ -88,7 +88,7 @@ f=$D/filelist.demo
 f=../docs/LIB
 (echo "Building $f" && rm -f $f)
 cat <> $f
-{BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH} {Sleepycat Software Berkeley DB} {BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH} {BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH} {Sleepycat BerkeleyDB} {} {} {}
+{BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH} {Berkeley DB} {BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH} {BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH} {BerkeleyDB} {} {} {}
 ENDOFLIBTEXT
 
 #
diff --git a/db/dist/vx_config.in b/db/dist/vx_config.in
index 29e679e54..2f9b7d1a0 100644
--- a/db/dist/vx_config.in
+++ b/db/dist/vx_config.in
@@ -31,12 +31,30 @@
 /* Define to 1 if you want a version with run-time diagnostic checking. */
 /* #undef DIAGNOSTIC */
 
+/* Define to 1 if 64-bit types are available. */
+#define HAVE_64BIT_TYPES 1
+
+/* Define to 1 if you have the `abort' function. */
+#define HAVE_ABORT 1
+
+/* Define to 1 if you have the `atoi' function. */
+#define HAVE_ATOI 1
+
+/* Define to 1 if you have the `atol' function. */
+#define HAVE_ATOL 1
+
 /* Define to 1 if you have the `clock_gettime' function. */
 #define HAVE_CLOCK_GETTIME 1
 
 /* Define to 1 if Berkeley DB release includes strong cryptography. */
 #define HAVE_CRYPTO 1
 
+/* Define to 1 if you have the `ctime_r' function. */
+#define HAVE_CTIME_R 1
+
+/* Define to 1 if ctime_r takes a buffer length as a third argument. */
+#define HAVE_CTIME_R_3ARG 1
+
 /* Define to 1 if you have the `directio' function. */
 /* #undef HAVE_DIRECTIO */
 
@@ -50,6 +68,12 @@
 /* Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines. */
 #define HAVE_EXIT_SUCCESS 1
 
+/* Define to 1 if you have the `fchmod' function. */
+/* #undef HAVE_FCHMOD */
+
+/* Define to 1 if you have the `fcntl' function. */
+/* #undef HAVE_FCNTL */
+
 /* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */
 /* #undef HAVE_FCNTL_F_SETFD */
 
@@ -60,11 +84,17 @@
 #define HAVE_FILESYSTEM_NOTZERO 1
 
 /* Define to 1 if you have the `ftruncate' function. */
-/* #undef HAVE_FTRUNCATE */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+/* #undef HAVE_GETADDRINFO */
 
 /* Define to 1 if you have the `getcwd' function. */
 #define HAVE_GETCWD 1
 
+/* Define to 1 if you have the `getenv' function. */
+#define HAVE_GETENV 1
+
 /* Define to 1 if you have the `getopt' function. */
 /* #undef HAVE_GETOPT */
 
@@ -83,11 +113,17 @@
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_INTTYPES_H */
 
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-/* #undef HAVE_LIBNSL */
+/* Define to 1 if you have the `isalpha' function. */
+#define HAVE_ISALPHA 1
+
+/* Define to 1 if you have the `isdigit' function. */
+#define HAVE_ISDIGIT 1
+
+/* Define to 1 if you have the `isprint' function. */
+#define HAVE_ISPRINT 1
 
-/* Define to 1 if the system has the type `long long'. */
-/* #undef HAVE_LONG_LONG */
+/* Define to 1 if you have the `isspace' function. */
+#define HAVE_ISSPACE 1
 
 /* Define to 1 if you have the `memcmp' function. */
 #define HAVE_MEMCMP 1
@@ -107,6 +143,9 @@
 /* Define to 1 if you have the `mmap' function. */
 /* #undef HAVE_MMAP */
 
+/* Define to 1 if you have the `mprotect' function. */
+/* #undef HAVE_MPROTECT */
+
 /* Define to 1 if you have the `munlock' function. */
 /* #undef HAVE_MUNLOCK */
 
@@ -141,6 +180,9 @@
 /* Define to 1 to use the GCC compiler and IA64 assembly language mutexes. */
 /* #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY */
 
+/* Define to 1 to use the GCC compiler and MIPS assembly language mutexes. */
+/* #undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY */
+
 /* Define to 1 to use the msem_XXX mutexes on systems other than HP-UX. */
 /* #undef HAVE_MUTEX_MSEM_INIT */
 
@@ -182,9 +224,6 @@
 /* Define to 1 if mutexes hold system resources. */
 #define HAVE_MUTEX_SYSTEM_RESOURCES 1
 
-/* Define to 1 if fast mutexes are available. */
-#define HAVE_MUTEX_THREADS 1
-
 /* Define to 1 to configure mutexes intra-process only. */
 /* #undef HAVE_MUTEX_THREAD_ONLY */
 
@@ -209,6 +248,9 @@
 /* Define to 1 to use the GCC compiler and Windows mutexes. */
 /* #undef HAVE_MUTEX_WIN32_GCC */
 
+/* Define to 1 to use the GCC compiler and amd64 assembly language mutexes. */
+/* #undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY */
+
 /* Define to 1 to use the GCC compiler and x86 assembly language mutexes. */
 /* #undef HAVE_MUTEX_X86_GCC_ASSEMBLY */
 
@@ -221,9 +263,18 @@
 /* Define to 1 if you have the `pread' function. */
 /* #undef HAVE_PREAD */
 
+/* Define to 1 if you have the `printf' function. */
+#define HAVE_PRINTF 1
+
 /* Define to 1 if you have the `pstat_getdynamic' function. */
 /* #undef HAVE_PSTAT_GETDYNAMIC */
 
+/* Define to 1 to configure Berkeley DB for POSIX pthread API. */
+/* #undef HAVE_PTHREAD_API */
+
+/* Define to 1 if you have the `pthread_yield' function. */
+#define HAVE_PTHREAD_YIELD 1
+
 /* Define to 1 if you have the `pwrite' function. */
 /* #undef HAVE_PWRITE */
 
@@ -242,6 +293,9 @@
 /* Define to 1 if building replication support. */
 #define HAVE_REPLICATION 1
 
+/* Define to 1 if building the Berkeley DB replication framework. */
+/* #undef HAVE_REPLICATION_THREADS */
+
 /* Define to 1 if building RPC client/server. */
 /* #undef HAVE_RPC */
 
@@ -251,17 +305,20 @@
 /* Define to 1 if you have the `select' function. */
 #define HAVE_SELECT 1
 
-/* Define to 1 if building sequence support. */
-/* #undef HAVE_SEQUENCE */
-
 /* Define to 1 if you have the `shmget' function. */
 /* #undef HAVE_SHMGET */
 
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef HAVE_SIGACTION */
+
+/* Define to 1 if thread identifier type db_threadid_t is integral. */
+#define HAVE_SIMPLE_THREAD_TYPE 1
+
 /* Define to 1 if you have the `snprintf' function. */
 /* #undef HAVE_SNPRINTF */
 
-/* Define to 1 if you have the `srand' function. */
-#define HAVE_SRAND 1
+/* Define to 1 if you have the `stat' function. */
+#define HAVE_STAT 1
 
 /* Define to 1 if building statistics support. */
 #define HAVE_STATISTICS 1
@@ -275,18 +332,39 @@
 /* Define to 1 if you have the `strcasecmp' function. */
 /* #undef HAVE_STRCASECMP */
 
+/* Define to 1 if you have the `strcat' function. */
+#define HAVE_STRCAT 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
 /* Define to 1 if you have the `strdup' function. */
 /* #undef HAVE_STRDUP */
 
 /* Define to 1 if you have the `strerror' function. */
 #define HAVE_STRERROR 1
 
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_STRINGS_H 1
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_STRING_H 1
 
+/* Define to 1 if you have the `strncat' function. */
+#define HAVE_STRNCAT 1
+
+/* Define to 1 if you have the `strncmp' function. */
+#define HAVE_STRNCMP 1
+
+/* Define to 1 if you have the `strrchr' function. */
+#define HAVE_STRRCHR 1
+
+/* Define to 1 if you have the `strsep' function. */
+/* #undef HAVE_STRSEP */
+
 /* Define to 1 if you have the `strtol' function. */
 #define HAVE_STRTOL 1
 
@@ -328,9 +406,6 @@
 /* Define to 1 if unlink of file with open file descriptors will fail. */
 #define HAVE_UNLINK_WITH_OPEN_FAILURE 1
 
-/* Define to 1 if the system has the type `unsigned long long'. */
-/* #undef HAVE_UNSIGNED_LONG_LONG */
-
 /* Define to 1 if building access method verification support. */
 #define HAVE_VERIFY 1
 
@@ -346,11 +421,8 @@
 /* Define to 1 if you have the `_fstati64' function. */
 /* #undef HAVE__FSTATI64 */
 
-/* Define to a value if using non-standard mutex alignment. */
-/* #undef MUTEX_ALIGN */
-
 /* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "support@sleepycat.com"
+#define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum"
 
 /* Define to the full name of this package. */
 #define PACKAGE_NAME "Berkeley DB"
@@ -385,58 +457,5 @@
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */
 
-/*
- * Exit success/failure macros.
- */
-#ifndef	HAVE_EXIT_SUCCESS
-#define	EXIT_FAILURE	1
-#define	EXIT_SUCCESS	0
-#endif
-
-/*
- * Don't step on the namespace.  Other libraries may have their own
- * implementations of these functions, we don't want to use their
- * implementations or force them to use ours based on the load order.
- */
-#ifndef	HAVE_GETCWD
-#define	getcwd		__db_Cgetcwd
-#endif
-#ifndef	HAVE_GETOPT
-#define	getopt		__db_Cgetopt
-#define	optarg		__db_Coptarg
-#define	opterr		__db_Copterr
-#define	optind		__db_Coptind
-#define	optopt		__db_Coptopt
-#endif
-#ifndef	HAVE_MEMCMP
-#define	memcmp		__db_Cmemcmp
-#endif
-#ifndef	HAVE_MEMCPY
-#define	memcpy		__db_Cmemcpy
-#endif
-#ifndef	HAVE_MEMMOVE
-#define	memmove		__db_Cmemmove
-#endif
-#ifndef	HAVE_RAISE
-#define	raise		__db_Craise
-#endif
-#ifndef	HAVE_SNPRINTF
-#define	snprintf	__db_Csnprintf
-#endif
-#ifndef	HAVE_STRCASECMP
-#define	strcasecmp	__db_Cstrcasecmp
-#define	strncasecmp	__db_Cstrncasecmp
-#endif
-#ifndef	HAVE_STRERROR
-#define	strerror	__db_Cstrerror
-#endif
-#ifndef	HAVE_VSNPRINTF
-#define	vsnprintf	__db_Cvsnprintf
-#endif
-
-/*
- * !!!
- * The following is not part of the automatic configuration setup, but
- * provides the information necessary to build Berkeley DB on VxWorks.
- */
+#include "clib_port.h"
 #include "vxWorks.h"
diff --git a/db/dist/vx_setup/LICENSE.TXT b/db/dist/vx_setup/LICENSE.TXT
index f31971375..7a7fe62bc 100644
--- a/db/dist/vx_setup/LICENSE.TXT
+++ b/db/dist/vx_setup/LICENSE.TXT
@@ -1,3 +1,3 @@
-Copyright (c) 1996-2004
-	Sleepycat Software.  All rights reserved.
+Copyright (c) 1996-2006
+ *	Oracle Corporation.  All rights reserved.
 See the file LICENSE for redistribution information.
diff --git a/db/dist/vx_setup/README.in b/db/dist/vx_setup/README.in
index f96948c37..c8cefacad 100644
--- a/db/dist/vx_setup/README.in
+++ b/db/dist/vx_setup/README.in
@@ -1,7 +1,7 @@
-README.TXT: Sleepycat Software Berkeley DB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@ Release v@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
+README.TXT: Oracle Corporation Berkeley DB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@ Release v@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
 
 Information on known problems, changes introduced with the
 current revision of the CD-ROM, and other product bulletins
-can be obtained from the Sleepycat Software web site:
+can be obtained from the Oracle Corporation web site:
 
 	http://www.sleepycat.com/
diff --git a/db/dist/vx_setup/SETUP.BMP b/db/dist/vx_setup/SETUP.BMP
index 2918480b8..1b79293d0 100644
Binary files a/db/dist/vx_setup/SETUP.BMP and b/db/dist/vx_setup/SETUP.BMP differ
diff --git a/db/dist/vx_setup/vx_setup.in b/db/dist/vx_setup/vx_setup.in
index 7bc3f510c..24fbabc86 100644
--- a/db/dist/vx_setup/vx_setup.in
+++ b/db/dist/vx_setup/vx_setup.in
@@ -1,8 +1,8 @@
-Sleepycat Software BerkeleyDB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
+Oracle Corporation BerkeleyDB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
 db@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@ demo-db@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
 BerkeleyDB.@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
 @DB_SETUP_DIR@
-Sleepycat Software BerkeleyDB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
+Oracle Corporation BerkeleyDB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
 db@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
 @DB_SETUP_DIR@/filelist.all
 BerkeleyDB.@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@-Demo
@@ -10,4 +10,4 @@ BerkeleyDB.@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@-Demo
 BerkeleyDB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@ Demo program
 demo-db@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
 @DB_SETUP_DIR@/filelist.demo
-Sleepycat Software BerkeleyDB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
+Oracle Corporation BerkeleyDB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@
diff --git a/db/dist/win_config.in b/db/dist/win_config.in
index 3406c8774..809b73b8e 100644
--- a/db/dist/win_config.in
+++ b/db/dist/win_config.in
@@ -8,7 +8,6 @@
 #define DB_WIN32 1
 
 /* Define to 1 if you want a debugging version. */
-/* #undef DEBUG */
 #if defined(_DEBUG)
 #if !defined(DEBUG)
 #define DEBUG 1
@@ -24,6 +23,18 @@
 /* Define to 1 if you want a version with run-time diagnostic checking. */
 /* #undef DIAGNOSTIC */
 
+/* Define to 1 if 64-bit types are available. */
+#define HAVE_64BIT_TYPES 1
+
+/* Define to 1 if you have the `abort' function. */
+#define HAVE_ABORT 1
+
+/* Define to 1 if you have the `atoi' function. */
+#define HAVE_ATOI 1
+
+/* Define to 1 if you have the `atol' function. */
+#define HAVE_ATOL 1
+
 /* Define to 1 if you have the `clock_gettime' function. */
 /* #undef HAVE_CLOCK_GETTIME */
 
@@ -32,6 +43,12 @@
 #define HAVE_CRYPTO 1
 #endif
 
+/* Define to 1 if you have the `ctime_r' function. */
+/* #undef HAVE_CTIME_R  */
+
+/* Define to 1 if ctime_r takes a buffer length as a third argument. */
+/* #undef HAVE_CTIME_R_3ARG */
+
 /* Define to 1 if you have the `directio' function. */
 /* #undef HAVE_DIRECTIO */
 
@@ -45,6 +62,12 @@
 /* Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines. */
 #define HAVE_EXIT_SUCCESS 1
 
+/* Define to 1 if you have the `fchmod' function. */
+/* #undef HAVE_FCHMOD */
+
+/* Define to 1 if you have the `fcntl' function. */
+/* #undef HAVE_FCNTL */
+
 /* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */
 /* #undef HAVE_FCNTL_F_SETFD */
 
@@ -57,11 +80,21 @@
 /* Define to 1 if you have the `ftruncate' function. */
 #define HAVE_FTRUNCATE 1
 
+/* Define to 1 if you have the `getaddrinfo' function. */
+/* #undef HAVE_GETADDRINFO */
+
 /* Define to 1 if you have the `getcwd' function. */
 #define HAVE_GETCWD 1
 
+/* Define to 1 if you have the `getenv' function. */
+#define HAVE_GETENV 1
+
 /* Define to 1 if you have the `getopt' function. */
-/* #undef HAVE_GETOPT */
+/*
+ * Windows does not have the getopt function, but as Berkeley DB example
+ * programs require getopt, we handle it outside of this configuration.
+ */
+#define	HAVE_GETOPT 1
 
 /* Define to 1 if you have the `getrusage' function. */
 /* #undef HAVE_GETRUSAGE */
@@ -80,11 +113,17 @@
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_INTTYPES_H */
 
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-/* #undef HAVE_LIBNSL */
+/* Define to 1 if you have the `isalpha' function. */
+#define HAVE_ISALPHA 1
+
+/* Define to 1 if you have the `isdigit' function. */
+#define HAVE_ISDIGIT 1
 
-/* Define to 1 if the system has the type `long long'. */
-#define HAVE_LONG_LONG 1
+/* Define to 1 if you have the `isprint' function. */
+#define HAVE_ISPRINT 1
+
+/* Define to 1 if you have the `isspace' function. */
+#define HAVE_ISSPACE 1
 
 /* Define to 1 if you have the `memcmp' function. */
 #define HAVE_MEMCMP 1
@@ -104,6 +143,9 @@
 /* Define to 1 if you have the `mmap' function. */
 /* #undef HAVE_MMAP */
 
+/* Define to 1 if you have the `mprotect' function. */
+/* #undef HAVE_MPROTECT */
+
 /* Define to 1 if you have the `munlock' function. */
 /* #undef HAVE_MUNLOCK */
 
@@ -138,6 +180,9 @@
 /* Define to 1 to use the GCC compiler and IA64 assembly language mutexes. */
 /* #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY */
 
+/* Define to 1 to use the GCC compiler and MIPS assembly language mutexes. */
+/* #undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY */
+
 /* Define to 1 to use the msem_XXX mutexes on systems other than HP-UX. */
 /* #undef HAVE_MUTEX_MSEM_INIT */
 
@@ -179,9 +224,6 @@
 /* Define to 1 if mutexes hold system resources. */
 /* #undef HAVE_MUTEX_SYSTEM_RESOURCES */
 
-/* Define to 1 if fast mutexes are available. */
-#define HAVE_MUTEX_THREADS 1
-
 /* Define to 1 to configure mutexes intra-process only. */
 /* #undef HAVE_MUTEX_THREAD_ONLY */
 
@@ -206,6 +248,9 @@
 /* Define to 1 to use the GCC compiler and Windows mutexes. */
 /* #undef HAVE_MUTEX_WIN32_GCC */
 
+/* Define to 1 to use the GCC compiler and amd64 assembly language mutexes. */
+/* #undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY */
+
 /* Define to 1 to use the GCC compiler and x86 assembly language mutexes. */
 /* #undef HAVE_MUTEX_X86_GCC_ASSEMBLY */
 
@@ -218,9 +263,18 @@
 /* Define to 1 if you have the `pread' function. */
 /* #undef HAVE_PREAD */
 
+/* Define to 1 if you have the `printf' function. */
+#define HAVE_PRINTF 1
+
 /* Define to 1 if you have the `pstat_getdynamic' function. */
 /* #undef HAVE_PSTAT_GETDYNAMIC */
 
+/* Define to 1 to configure Berkeley DB for POSIX pthread API. */
+/* #undef HAVE_PTHREAD_API */
+
+/* Define to 1 if you have the `pthread_yield' function. */
+/* #undef HAVE_PTHREAD_YIELD */
+
 /* Define to 1 if you have the `pwrite' function. */
 /* #undef HAVE_PWRITE */
 
@@ -243,6 +297,11 @@
 #define HAVE_REPLICATION 1
 #endif
 
+/* Define to 1 if building the Berkeley DB replication framework. */
+#ifndef HAVE_SMALLBUILD
+#define HAVE_REPLICATION_THREADS 1
+#endif
+
 /* Define to 1 if building RPC client/server. */
 /* #undef HAVE_RPC */
 
@@ -252,17 +311,20 @@
 /* Define to 1 if you have the `select' function. */
 /* #undef HAVE_SELECT */
 
-/* Define to 1 if building sequence support. */
-#define HAVE_SEQUENCE 1
-
 /* Define to 1 if you have the `shmget' function. */
 /* #undef HAVE_SHMGET */
 
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef HAVE_SIGACTION */
+
+/* Define to 1 if thread identifier type db_threadid_t is integral. */
+#define HAVE_SIMPLE_THREAD_TYPE 1
+
 /* Define to 1 if you have the `snprintf' function. */
 #define HAVE_SNPRINTF 1
 
-/* Define to 1 if you have the `srand' function. */
-#define HAVE_SRAND 1
+/* Define to 1 if you have the `stat' function. */
+#define HAVE_STAT 1
 
 /* Define to 1 if building statistics support. */
 #define HAVE_STATISTICS 1
@@ -276,18 +338,39 @@
 /* Define to 1 if you have the `strcasecmp' function. */
 /* #undef HAVE_STRCASECMP */
 
+/* Define to 1 if you have the `strcat' function. */
+#define HAVE_STRCAT 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
 /* Define to 1 if you have the `strdup' function. */
 #define HAVE_STRDUP 1
 
 /* Define to 1 if you have the `strerror' function. */
 #define HAVE_STRERROR 1
 
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_STRINGS_H 1
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_STRING_H 1
 
+/* Define to 1 if you have the `strncat' function. */
+#define HAVE_STRNCAT 1
+
+/* Define to 1 if you have the `strncmp' function. */
+#define HAVE_STRNCMP 1
+
+/* Define to 1 if you have the `strrchr' function. */
+#define HAVE_STRRCHR 1
+
+/* Define to 1 if you have the `strsep' function. */
+/* #undef HAVE_STRSEP */
+
 /* Define to 1 if you have the `strtol' function. */
 #define HAVE_STRTOL 1
 
@@ -329,9 +412,6 @@
 /* Define to 1 if unlink of file with open file descriptors will fail. */
 /* #undef HAVE_UNLINK_WITH_OPEN_FAILURE */
 
-/* Define to 1 if the system has the type `unsigned long long'. */
-#define HAVE_UNSIGNED_LONG_LONG 1
-
 /* Define to 1 if building access method verification support. */
 #ifndef HAVE_SMALLBUILD
 #define HAVE_VERIFY 1
@@ -349,11 +429,8 @@
 /* Define to 1 if you have the `_fstati64' function. */
 #define HAVE__FSTATI64 1
 
-/* Define to a value if using non-standard mutex alignment. */
-/* #undef MUTEX_ALIGN */
-
 /* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "support@sleepycat.com"
+#define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum"
 
 /* Define to the full name of this package. */
 #define PACKAGE_NAME "Berkeley DB"
@@ -388,48 +465,7 @@
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */
 
-/*
- * Exit success/failure macros.
- */
-#ifndef	HAVE_EXIT_SUCCESS
-#define	EXIT_FAILURE	1
-#define	EXIT_SUCCESS	0
-#endif
-
-/*
- * Don't step on the namespace.  Other libraries may have their own
- * implementations of these functions, we don't want to use their
- * implementations or force them to use ours based on the load order.
- */
-#ifndef	HAVE_GETCWD
-#define	getcwd		__db_Cgetcwd
-#endif
-#ifndef	HAVE_MEMCMP
-#define	memcmp		__db_Cmemcmp
-#endif
-#ifndef	HAVE_MEMCPY
-#define	memcpy		__db_Cmemcpy
-#endif
-#ifndef	HAVE_MEMMOVE
-#define	memmove		__db_Cmemmove
-#endif
-#ifndef	HAVE_RAISE
-#define	raise		__db_Craise
-#endif
-#ifndef	HAVE_SNPRINTF
-#define	snprintf	__db_Csnprintf
-#endif
-#ifndef	HAVE_STRCASECMP
-#define	strcasecmp	__db_Cstrcasecmp
-#define	strncasecmp	__db_Cstrncasecmp
-#endif
-#ifndef	HAVE_STRERROR
-#define	strerror	__db_Cstrerror
-#endif
-#ifndef	HAVE_VSNPRINTF
-#define	vsnprintf	__db_Cvsnprintf
-#endif
-
+#include "clib_port.h"
 #include "win_db.h"
 
 /*
diff --git a/db/dist/win_db.in b/db/dist/win_db.in
index d623610f4..7e0e6f15b 100644
--- a/db/dist/win_db.in
+++ b/db/dist/win_db.in
@@ -1,14 +1,28 @@
 /*-
- * $Id: win_db.in,v 11.4 2004/10/07 13:59:24 carol Exp $
+ * $Id: win_db.in,v 12.19 2006/06/19 15:56:39 bostic Exp $
  *
  * The following provides the information necessary to build Berkeley
  * DB on native Windows, and other Windows environments such as MinGW.
  */
 
+/*
+ * Avoid warnings with Visual Studio 8.
+ */
+#define	_CRT_SECURE_NO_DEPRECATE 1
+
+/*
+ * Windows NT 4.0 and later required for the replication manager.
+ */
+#ifdef HAVE_REPLICATION_THREADS
+#define	_WIN32_WINNT 0x0400
+#endif
+
 #include 
 #include 
+#include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -19,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 
 /*
  * To build Tcl interface libraries, the include path must be configured to
@@ -32,6 +45,16 @@
 
 #define	WIN32_LEAN_AND_MEAN
 #include 
+#include 
+
+#ifdef HAVE_GETADDRINFO
+/*
+ * Need explicit includes for IPv6 support on Windows.  Both are necessary to
+ * ensure that pre WinXP versions have an implementation of the getaddrinfo API.
+ */
+#include 
+#include 
+#endif
 
 /*
  * All of the necessary includes have been included, ignore the #includes
@@ -40,47 +63,61 @@
 #define	NO_SYSTEM_INCLUDES
 
 /*
- * Win32 has getcwd, snprintf and vsnprintf, but under different names.
+ * Microsoft's C runtime library has fsync, getcwd, getpid, snprintf and
+ * vsnprintf, but under different names.
  */
+#define	fsync			_commit
 #define	getcwd(buf, size)	_getcwd(buf, size)
+#define	getpid			_getpid
 #define	snprintf		_snprintf
 #define	vsnprintf		_vsnprintf
 
+#define	h_errno			WSAGetLastError()
+
+/*
+ * Windows defines off_t to long (i.e., 32 bits).  We need to pass 64-bit
+ * file offsets, so we declare our own.
+ */
+#define	off_t	__db_off_t
+typedef __int64 off_t;
+
 /*
- * Win32 does not define getopt and friends in any header file, so we must.
+ * Win32 does not have getopt.
+ *
+ * The externs are here (instead of using db_config.h and clib_port.h),
+ * because Berkeley DB example programs use getopt and they can't #include
+ * those files.
  */
 #if defined(__cplusplus)
 extern "C" {
 #endif
-extern int optind;
-extern char *optarg;
 extern int getopt(int, char * const *, const char *);
 #if defined(__cplusplus)
 }
 #endif
 
 #ifdef _UNICODE
-#define TO_TSTRING(dbenv, s, ts, ret) do {				\
-		int __len = strlen(s) + 1;				\
+#define	TO_TSTRING(dbenv, s, ts, ret) do {				\
+		int __len = (int)strlen(s) + 1;				\
 		ts = NULL;						\
 		if ((ret = __os_malloc((dbenv),				\
-		    __len * sizeof (_TCHAR), &(ts))) == 0 &&		\
+		    __len * sizeof(_TCHAR), &(ts))) == 0 &&		\
 		    MultiByteToWideChar(CP_UTF8, 0,			\
 		    (s), -1, (ts), __len) == 0)				\
-			ret = __os_get_errno();				\
+			ret = __os_posix_err(__os_get_syserr());	\
 	} while (0)
 
-#define FROM_TSTRING(dbenv, ts, s, ret) {				\
+#define	FROM_TSTRING(dbenv, ts, s, ret) {				\
 		int __len = WideCharToMultiByte(CP_UTF8, 0, ts, -1,	\
 		    NULL, 0, NULL, NULL);				\
 		s = NULL;						\
 		if ((ret = __os_malloc((dbenv), __len, &(s))) == 0 &&	\
 		    WideCharToMultiByte(CP_UTF8, 0,			\
 		    (ts), -1, (s), __len, NULL, NULL) == 0)		\
-			ret = __os_get_errno();				\
+			ret = __os_posix_err(__os_get_syserr());	\
 	} while (0)
 
-#define FREE_STRING(dbenv, s) do {					\
+#define	FREE_STRING(dbenv, s) do {					\
 		if ((s) != NULL) {					\
 			__os_free((dbenv), (s));			\
 			(s) = NULL;					\
@@ -88,7 +125,19 @@ extern int getopt(int, char * const *, const char *);
 	} while (0)
 
 #else
-#define TO_TSTRING(dbenv, s, ts, ret) (ret) = 0, (ts) = (_TCHAR *)(s)
-#define FROM_TSTRING(dbenv, ts, s, ret) (ret) = 0, (s) = (char *)(ts)
-#define FREE_STRING(dbenv, ts)
+#define	TO_TSTRING(dbenv, s, ts, ret) (ret) = 0, (ts) = (_TCHAR *)(s)
+#define	FROM_TSTRING(dbenv, ts, s, ret) (ret) = 0, (s) = (char *)(ts)
+#define	FREE_STRING(dbenv, ts)
+#endif
+
+#ifndef INVALID_HANDLE_VALUE
+#define	INVALID_HANDLE_VALUE ((HANDLE)-1)
+#endif
+
+#ifndef INVALID_FILE_ATTRIBUTES
+#define	INVALID_FILE_ATTRIBUTES ((DWORD)-1)
+#endif
+
+#ifndef INVALID_SET_FILE_POINTER
+#define	INVALID_SET_FILE_POINTER ((DWORD)-1)
 #endif
diff --git a/db/dist/win_exports.in b/db/dist/win_exports.in
index 9087875cc..e1d3023d7 100644
--- a/db/dist/win_exports.in
+++ b/db/dist/win_exports.in
@@ -1,4 +1,4 @@
-# $Id: win_exports.in,v 1.41 2004/10/12 17:44:10 bostic Exp $
+# $Id: win_exports.in,v 12.20 2006/08/10 08:21:51 alexg Exp $
 
 # Standard interfaces.
 	db_create
@@ -9,30 +9,6 @@
 	db_xa_switch
 	log_compare
 
-# Library configuration interfaces.
-	db_env_set_func_close
-	db_env_set_func_dirfree
-	db_env_set_func_dirlist
-	db_env_set_func_exists
-	db_env_set_func_free
-	db_env_set_func_fsync
-	db_env_set_func_ftruncate
-	db_env_set_func_ioinfo
-	db_env_set_func_malloc
-	db_env_set_func_map
-	db_env_set_func_open
-	db_env_set_func_pread
-	db_env_set_func_pwrite
-	db_env_set_func_read
-	db_env_set_func_realloc
-	db_env_set_func_rename
-	db_env_set_func_seek
-	db_env_set_func_sleep
-	db_env_set_func_unlink
-	db_env_set_func_unmap
-	db_env_set_func_write
-	db_env_set_func_yield
-
 # Needed for application-specific logging and recovery routines.
 	__db_add_recovery
 
@@ -65,9 +41,6 @@
 	__db_panic
 	__db_r_attach
 	__db_r_detach
-	__db_win32_mutex_init
-	__db_win32_mutex_lock
-	__db_win32_mutex_unlock
 	__ham_func2
 	__ham_func3
 	__ham_func4
@@ -76,58 +49,78 @@
 	__lock_id_set
 	__os_calloc
 	__os_closehandle
+	__os_dirfree
+	__os_dirlist
 	__os_free
+	__os_get_syserr
+	__os_getenv
 	__os_ioinfo
 	__os_malloc
+	__os_mkdir
 	__os_open
 	__os_openhandle
+	__os_posix_err
 	__os_read
 	__os_realloc
 	__os_strdup
 	__os_umalloc
+	__os_unlink
 	__os_write
 	__txn_id_set
 
-#These are needed for linking tools or java.
+# These are needed for linking tools or java.
 	__bam_adj_read
 	__bam_cadjust_read
 	__bam_cdel_read
 	__bam_curadj_read
+	__bam_merge_read
 	__bam_pgin
+	__bam_pgno_read
 	__bam_pgout
 	__bam_rcuradj_read
+	__bam_relink_43_read
 	__bam_relink_read
 	__bam_repl_read
 	__bam_root_read
 	__bam_rsplit_read
 	__bam_split_read
+	__crdel_inmem_create_read
+	__crdel_inmem_remove_read
+	__crdel_inmem_rename_read
 	__crdel_metasub_read
 	__db_addrem_read
 	__db_big_read
 	__db_cksum_read
+	__db_ctime
 	__db_debug_read
 	__db_dispatch
+	__db_dl
 	__db_dumptree
 	__db_err
-	__db_fileid_reset
+	__db_errx
 	__db_getlong
 	__db_getulong
 	__db_global_values
 	__db_isbigendian
-	__db_lsn_reset
+	__db_mkpath
+	__db_msg
 	__db_noop_read
 	__db_omode
-	__db_overwrite
 	__db_ovref_read
+	__db_pg_alloc_42_read
 	__db_pg_alloc_read
+	__db_pg_free_42_read
 	__db_pg_free_read
+	__db_pg_freedata_42_read
 	__db_pg_freedata_read
 	__db_pg_init_read
 	__db_pg_new_read
 	__db_pg_prepare_read
+	__db_pg_sort_read
 	__db_pgin
 	__db_pgout
 	__db_pr_callback
+	__db_relink_42_read
 	__db_rpath
 	__db_stat_pp
 	__db_stat_print_pp
@@ -147,8 +140,10 @@
 	__ham_copypage_read
 	__ham_curadj_read
 	__ham_get_meta
+	__ham_groupalloc_42_read
 	__ham_groupalloc_read
 	__ham_insdel_read
+	__ham_metagroup_42_read
 	__ham_metagroup_read
 	__ham_newpage_read
 	__ham_pgin
@@ -158,12 +153,19 @@
 	__ham_splitdata_read
 	__lock_list_print
 	__log_stat_pp
+	__mutex_set_wait_info
+	__os_abspath
 	__os_clock
+	__os_exists
 	__os_get_errno
 	__os_id
+	__os_mapfile
+	__os_seek
 	__os_set_errno
 	__os_sleep
+	__os_spin
 	__os_ufree
+	__os_unmapfile
 	__os_yield
 	__qam_add_read
 	__qam_del_read
@@ -173,7 +175,9 @@
 	__qam_pgin_out
 	__rep_stat_print
 	__txn_child_read
+	__txn_ckp_42_read
 	__txn_ckp_read
 	__txn_recycle_read
+	__txn_regop_42_read
 	__txn_regop_read
 	__txn_xa_regop_read
diff --git a/db/dist/winmsi/dbcorewix.in b/db/dist/winmsi/dbcorewix.in
new file mode 100644
index 000000000..2ac664a61
--- /dev/null
+++ b/db/dist/winmsi/dbcorewix.in
@@ -0,0 +1,196 @@
+
+
+m4_include(WIX_DB_SHARED_WINMSIDIR/dbwix.m4)   
+
+
+
+  
+  
+
+    
+    
+
+    
+
+    COMMON_PROPERTIES()
+
+    
+    WIX_DB_ENV_FEATURE_PROPS()
+
+    
+       =500]]>
+
+    
+      NOT Priviledged
+    
+
+    
+      
+      
+
+      
+        
+          
+            
+            
+
+
+            
+            
+
+              
+              
+	      
+              
+            
+
+            COMMON_COMPONENTS()
+
+            
+	    WIX_DB_DIRECTORY_STRUCTURE()
+
+          
+        
+      
+      
+        
+      
+    
+
+    
+    WIX_DB_LINKS()
+
+    COMMON_FEATURES(`Berkeley DB')
+
+    
+    
+
+      
+      
+
+      DIALOG_WELCOME(MainWelcomeDlg, , ShowLicenseDlg)
+      DIALOG_LICENSE(ShowLicenseDlg, MainWelcomeDlg, TargetFolderDlg,
+                     `Berkeley DB')
+      DIALOG_TARGET(TargetFolderDlg, ShowLicenseDlg, FeatureSelectionDlg)
+      DIALOG_FEATURE(FeatureSelectionDlg, TargetFolderDlg, EnvVarDlg,
+                     `Debug libraries are needed for working C/C++ examples.')
+      DIALOG_ENVIRONMENT(EnvVarDlg, FeatureSelectionDlg, ReadyToInstallDlg)
+      DIALOG_READY(ReadyToInstallDlg, EnvVarDlg, )
+
+      DIALOG_PROGRESS(ShowProgressDlg, , )
+      DIALOG_SUCCESS(InstallSuccessDlg, , , `Berkeley DB',
+                     `Oracle Technology Network Berkeley DB forum')
+
+
+      
+      DIALOG_ADMIN_CANCEL(CancelInstallerDlg)
+      DIALOG_ADMIN_NOSPACE(OutOfSpaceDlg, FeatureSelectionDlg)
+      DIALOG_ADMIN_INTERRUPTED(InstallErrorDlg, Return)
+      DIALOG_ADMIN_INTERRUPTED(InstallCancelledDlg, Exit)
+
+
+      
+      
+        
+        
+        
+        
+        
+      
+
+      COMMON_UI_TEXT()
+      49 MB
+
+
+    
+
+    COMMON_EXECUTE_SEQUENCE()
+
+  
+
diff --git a/db/dist/winmsi/dbvarsbat.in b/db/dist/winmsi/dbvarsbat.in
new file mode 100644
index 000000000..a39e9d425
--- /dev/null
+++ b/db/dist/winmsi/dbvarsbat.in
@@ -0,0 +1,25 @@
+@echo off
+
+:: $Id: dbvarsbat.in,v 1.3 2006/09/14 15:50:50 mjc Exp $
+:: This file sets the environment variables needed to run Berkeley DB.
+
+set DBROOTDIR=
+for /F "tokens=3 delims=	" %%A in ('REG QUERY "HKLM\SOFTWARE\Oracle\Berkeley DB\WIX_DB_VERSION" /v RootDirectory') do set DBROOTDIR=%%A
+if ERRORLEVEL 2 goto MISSING
+if not defined DBROOTDIR goto MISSING
+
+echo Setting environment variables for Berkeley DB, installed in %DBROOTDIR%
+
+set PATH=%DBROOTDIR%\bin;%DBROOTDIR%\bin\debug;%PATH%
+set CLASSPATH=%CLASSPATH%;%DBROOTDIR%\jar\debug\db.jar;%DBROOTDIR%\jar\debug\dbexamples.jar;%CLASSPATH%;%DBROOTDIR%\jar\db.jar;%DBROOTDIR%\jar\dbexamples.jar
+goto END
+
+:MISSING
+echo
+echo NOTE:
+echo   The Berkeley DB version could not be determined.
+echo   If you are running on Windows 2000, make sure the
+echo   REG.EXE program is installed from the Tools disk"
+echo
+
+:END
diff --git a/db/dist/winmsi/dbwix.m4 b/db/dist/winmsi/dbwix.m4
new file mode 100644
index 000000000..a7fb9b326
--- /dev/null
+++ b/db/dist/winmsi/dbwix.m4
@@ -0,0 +1,833 @@
+
+
+
+m4_define(`DIALOG_WIDTH', `390')
+m4_define(`DIALOG_HEIGHT', `320')
+m4_define(`BOTTOMSTRIPE_Y', `m4_eval(DIALOG_HEIGHT-32)')
+m4_define(`NAVBUTTON_Y', `m4_eval(DIALOG_HEIGHT-23)')
+m4_define(`NAVBUTTON_DIM', `X="`$1'" Y="NAVBUTTON_Y" Width="66" Height="17"')
+
+
+m4_define(`_YPOS', `0')
+m4_define(`SETY', `m4_define(`_YPOS', `$1')')
+m4_define(`INCY', `SETY(m4_eval(_YPOS+(`$1')))')
+
+
+m4_define(`PARTIALHEIGHT', `Y="_YPOS" Height="`$1'" INCY(`$1') INCY(_GETGAP(`$2'))')
+m4_define(`_GETGAP', `m4_ifelse(`',`$1', 10, `$1')')
+m4_define(`FULLHEIGHT', `Y="_YPOS" Height="m4_eval(BOTTOMSTRIPE_Y - _YPOS - 10)"')
+
+
+m4_define(`BOTTOM_Y', `m4_eval(BOTTOMSTRIPE_Y - 10)')
+
+m4_define(`DIALOGPROP', `Width="DIALOG_WIDTH" Height="DIALOG_HEIGHT"
+        Title="[ProductName] - Installer" NoMinimize="yes"')
+
+m4_define(`TOPSTRIPE', `
+        SETY(`$1')
+        INCY(10)
+
+        
+        
+          {&MSSansBold8}`$2'
+        
+        
+          `$3'
+        ')
+
+m4_define(`TEXTCONTROL', `
+        
+          `$3'
+        
+        INCY(`$2')')
+
+
+m4_define(`TEXTCONTROL2', `
+        
+          `$3'
+        ')
+
+m4_define(`BOTTOMSTRIPE', `
+        ')
+
+m4_define(`NEWDIALOGEVENT', `
+          
+                   
+          ')
+
+m4_define(`SPAWNDIALOGEVENT', `
+          
+                   
+          ')
+
+
+m4_define(`BACKBUTTON_GENERIC', `
+        
+           `$3'
+        ')
+
+
+m4_define(`NEXTBUTTON_GENERIC', `
+        
+           `$3'
+        ')
+
+m4_define(`CANCELBUTTON_GENERIC', `
+        
+          `$3'
+        ')
+
+m4_define(`NEXTBUTTON_NOTDEFAULT', `
+        
+           `$3'
+        ')
+
+
+m4_define(`BACKBUTTON_DISABLED', `BACKBUTTON_GENERIC(Back, Disabled="yes")')
+m4_define(`BACKBUTTON', `BACKBUTTON_GENERIC(Back, , NEWDIALOGEVENT(`$1'))')
+m4_define(`NEXTBUTTON_DISABLED', `NEXTBUTTON_GENERIC(Next, Disabled="yes")')
+m4_define(`NEXTBUTTON', `NEXTBUTTON_GENERIC(Next, , NEWDIALOGEVENT(`$1'))')
+m4_define(`CANCELBUTTON', `CANCELBUTTON_GENERIC(Cancel, Cancel="yes",
+                          SPAWNDIALOGEVENT(CancelInstallerDlg))')
+
+
+m4_define(`_GUIDSUFFIX', `10000000')
+m4_define(`_SETGUID', `m4_define(`_GUIDSUFFIX', `$1')')
+m4_define(`_GUIDINC', `_SETGUID(m4_eval(_GUIDSUFFIX+1))')
+m4_define(`GUID_CREATE_UNIQUE', `_GUIDINC()WIX_DB_GUID_PREFIX()`'_GUIDSUFFIX()')
+
+
+m4_define(`_WIXDB_PRODUCT', WIX_DB_PRODUCT_NAME)
+m4_define(`_WIXDB_VERSION', WIX_DB_VERSION)
+m4_define(`_WIXDB_CURDIR', `unknown')
+m4_define(`_WIXDB_CURFILE', `unknown')
+m4_define(`_WIXDB_SUBDIR', `')
+
+
+m4_define(`WIX_DB_SET_PRODUCT', `m4_define(`_WIXDB_PRODUCT', `$1')')
+m4_define(`WIX_DB_SET_VERSION', `m4_define(`_WIXDB_VERSION', `$1')')
+m4_define(`WIX_DB_SET_CURDIR', `m4_define(`_WIXDB_CURDIR', `$1')')
+m4_define(`WIX_DB_SET_CURFILE', `m4_define(`_WIXDB_CURFILE', `$1')')
+m4_define(`WIX_DB_SET_SUBDIR', `m4_define(`_WIXDB_SUBDIR', `$1')')
+
+m4_define(`_LASTCHAR', `m4_substr(`$1',m4_eval(m4_len(`$1')-1))')
+m4_define(`_LOPCHAR', `m4_substr(`$1',0,m4_eval(m4_len(`$1')-1))')
+m4_define(`_CHOPNAME', `m4_ifelse(_LASTCHAR(`$1'),/,`$1',`_CHOPNAME(_LOPCHAR(`$1'))')')
+m4_define(`WIX_DB_BEGIN_SUBDIR', `WIX_DB_SET_SUBDIR(_WIXDB_SUBDIR/`$1')')
+m4_define(`WIX_DB_END_SUBDIR', `WIX_DB_SET_SUBDIR(_LOPCHAR(_CHOPNAME(_WIXDB_SUBDIR)))')
+m4_define(`WIX_DB_CLEAR_SUBDIR', `WIX_DB_SET_SUBDIR()')
+
+
+m4_define(`WIX_DB_PERSISTENT_GUID', `m4_esyscmd(echo "_WIXDB_PRODUCT @@ _WIXDB_VERSION @@ _WIXDB_CURDIR @@ _WIXDB_SUBDIR @@ _WIXDB_CURFILE" | openssl md5 | sed -e "s/^\(........\)\(....\)\(....\)\(....\)\(....\)\(............\)/\1-\2-\3-\4-\5/")')
+
+m4_define(`DB_LICENSE_INTRO', `The following license applies to this copy of software you are about to install.  Please read it carefully before proceeding.  Select below the nature of the license by which you will use this product.  For more information about Oracle Corporation's licensing please contact us at berkeleydb-info_us@oracle.com')
+
+m4_define(`DB_ENVIRONMENT_INTRO', `[ProductName] will need to modify certain environment variables to work properly.  If you elect not to set these variables you may find that some utilities`,' scripts and other parts of [ProductName] won't work properly.  Please indicate that you skipped this step if you request support help from us.')
+
+m4_define(`COMMON_PROPERTIES', `
+    
+    
+
+    
+    
+    
+    
+    
+    
+    
+
+    
+    
+
+    
+    
+    
+    
+    
+    
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    dda
+    msg.exe
+
+    
+    
+
+    
+    
+    
+    
+
+    

Description: DB->associate

@@ -78,8 +78,12 @@ iterations and range queries will reflect only the corresponding subset of the database. If this is not desirable, the application should ensure that the callback function is well-defined for all possible values and never returns DB_DONOTINDEX.

-
flags
The flags parameter must be set to 0 or -the following value: +

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.

+
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_CREATE
If the secondary database is empty, walk through the primary and create an index to it in the empty secondary. This operation is potentially @@ -96,13 +100,17 @@ another thread of control, until the DB->associate call has returned successfully in the first thread. If transactions are being used, Berkeley DB will perform appropriate locking and the application need not do any special operation ordering.

-
-In addition, the following flag may be set by -bitwise inclusively OR'ing it into the flags parameter: -
-
DB_AUTO_COMMIT
Enclose the DB->associate call within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. +
DB_IMMUTABLE_KEY
Specifies the secondary key is immutable. +

This flag can be used to optimize updates when the secondary key in a +primary record will never be changed after the primary record is +inserted. For immutable secondary keys, a best effort is made to avoid +calling the secondary callback function when primary records are +updated. This optimization may reduce the overhead of update operations +significantly if the callback function is expensive.

+

Be sure to specify this flag only if the secondary key in the primary +record is never changed. If this rule is violated, the secondary index +will become corrupted, that is, it will become out of sync with the +primary.

primary
The primary parameter should be a database handle for the primary database that is to be indexed. @@ -116,10 +124,15 @@ with the DB_THREAD flag it is saf of control after the DB->associate method has returned. Note also that either secondary keys must be unique or the secondary database must be configured with support for duplicate data items. -
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The DB->associate method @@ -127,6 +140,7 @@ may fail and return one of the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If the secondary database handle has already been associated with this or @@ -143,6 +157,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_class.html b/db/docs/api_c/db_class.html index bba37b470..04c525b81 100644 --- a/db/docs/api_c/db_class.html +++ b/db/docs/api_c/db_class.html @@ -1,5 +1,5 @@ - - + + @@ -38,13 +38,15 @@ The handle should not be closed while any other handle that refers to the database is in use; for example, database handles must not be closed while cursor handles into the database remain open, or transactions that include operations on the database have not yet been committed or -aborted. Once the DB->close, DB->remove, or -DB->rename methods are called, the handle may not be accessed again, -regardless of the method's return.

-

The db_create method creates a DB structure that is the -handle for a Berkeley DB database. Calling the DB->close, -DB->remove or DB->rename methods will discard the returned -handle.

+aborted. Once the DB->close, DB->remove, +DB->rename, or DB->verify methods are called, the handle may +not be accessed again, regardless of the method's return.

+

The db_create function creates a DB structure that is +the handle for a Berkeley DB database. This function allocates memory for the +structure, returning a pointer to the structure in the memory to which +dbp refers. To release the allocated memory and discard the +handle, call the DB->close, DB->remove, +DB->rename, or DB->verify methods.

The DB handle contains a special field, "app_private", which is declared as type "void *". This field is provided for the use of the application program. It is initialized to NULL and is not further used @@ -92,6 +94,6 @@ DB

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_close.html b/db/docs/api_c/db_close.html index 5860930fa..b510ee19c 100644 --- a/db/docs/api_c/db_close.html +++ b/db/docs/api_c/db_close.html @@ -1,5 +1,5 @@ - + @@ -88,6 +88,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_compact.html b/db/docs/api_c/db_compact.html new file mode 100644 index 000000000..05fcb7609 --- /dev/null +++ b/db/docs/api_c/db_compact.html @@ -0,0 +1,140 @@ + + + + + + +Berkeley DB: DB->compact + + + + + + + +
+

DB->compact

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB->compact(DB *db, DB_TXN *txnid, + DBT *start, DBT *stop, DB_COMPACT *c_data, u_int32_t flags, DBT *end); +

+
+

Description: DB->compact

+

The DB->compact method compacts Btree and Recno access method +databases, and optionally returns unused Btree, Hash or Recno database +pages to the underlying filesystem.

+

The DB->compact method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +DB_ENV->txn_begin; otherwise NULL. If no transaction handle is +specified, but the operation occurs in a transactional database, the +operation will be implicitly transaction protected using multiple +transactions. These transactions will be periodically committed to +avoid locking large sections of the tree. Any deadlocks encountered +cause the compaction operation to retried from the point of the last +transaction commit. +
start
If non-NULL, the start parameter is the starting point for +compaction in a Btree or Recno database. Compaction will start at the +smallest key greater than or equal to the specified key. If NULL, +compaction will start at the beginning of the database. +
stop
If non-NULL, the stop parameter is the stopping point for +compaction in a Btree or Recno database. Compaction will stop at the +page with the smallest key greater than the specified key. If NULL, +compaction will stop at the end of the database. +
c_data

If non-NULL, the c_data parameter contains additional compaction +configuration parameters, and returns compaction operation statistics, +in a structure of type DB_COMPACT.

+

The following input configuration fields are available from the +DB_COMPACT structure:

+
+
int compact_fillpercent;
If non-zero, the goal for filling pages, specified as a percentage +between 1 and 100. Any page in a Btree or Recno databases not at or +above this percentage full will be considered for compaction. The +default behavior is to consider every page for compaction, regardless +of its page fill percentage. +
int compact_pages;
If non-zero, the call will return after that number of pages have been +freed. +
db_timeout_t compact_timeout;
If non-zero, and no txnid parameter was specified, the lock +timeout set for implicit transactions, in microseconds. +
+

The following output statistics fields are available from the +DB_COMPACT structure:

+
+
u_int32_t compact_deadlock;
An output statistics parameter: if no txnid parameter was +specified, the number of deadlocks which occurred. +
u_int32_t compact_pages_examine;
An output statistics parameter: the number of database pages reviewed +during the compaction phase. +
u_int32_t compact_pages_free;
An output statistics parameter: the number of database pages freed during +the compaction phase. +
u_int32_t compact_levels;
An output statistics parameter: the number of levels removed from the +Btree or Recno database during the compaction phase. +
u_int32_t compact_pages_truncated;
An output statistics parameter: the number of database pages returned +to the filesystem. +
+
flags
The flags parameter must be set to 0 or +one of the following values: +
+
DB_FREELIST_ONLY
Do no page compaction, only returning pages to the filesystem that are +already free and at the end of the file. This flag must be set if the +database is a Hash access method database. +
DB_FREE_SPACE
Return pages to the filesystem when possible. +If this flag is not specified, pages emptied as a result of compaction +will be placed on the free list for re-use, but never returned to the +filesystem. +

Note that only pages at the end of a file can be returned to the +filesystem. Because of the one-pass nature of the compaction algorithm, +any unemptied page near the end of the file inhibits returning pages to +the file system. A repeated call to the DB->compact method with a low +compact_fillpercent may be used to return pages in this case.

+
+
end
If non-NULL, the end parameter will be filled in with the +database key marking the end of the compaction operation in a Btree or +Recno database. This is generally the first key of the page where the +operation stopped. +
+

Errors

+

The DB->compact method +may fail and return one of the following non-zero errors:

+
+
DB_LOCK_DEADLOCK
A transactional database environment operation was selected to resolve +a deadlock. +
DB_LOCK_NOTGRANTED
A Berkeley DB Concurrent Data Store database environment configured for lock timeouts was unable +to grant a lock in the allowed time. +
+
+
DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election +unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization. +
+
+
EACCES
An attempt was made to modify a read-only database. +
+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB +

See Also

+Databases and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/db_cursor.html b/db/docs/api_c/db_cursor.html index 2e8c89421..ee39e73c2 100644 --- a/db/docs/api_c/db_cursor.html +++ b/db/docs/api_c/db_cursor.html @@ -1,5 +1,5 @@ - - + + @@ -28,7 +28,9 @@ DB->cursor(DB *db,


Description: DB->cursor

-The DB->cursor method returns a created database cursor. +

The DB->cursor method returns a created database cursor.

+

Cursors may span threads, but only serially, that is, the application +must serialize access to the cursor handle.

The DB->cursor method returns a non-zero error value on failure and 0 on success. @@ -36,27 +38,38 @@ and 0 on success.

Parameters

cursorp
The cursorp parameter references memory into which -a pointer to the allocated cursor is copied. +a pointer to the allocated cursor is copied.
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_DEGREE_2
This cursor will have degree 2 isolation. This ensures the stability -of the current data item read by this cursor but permits data read -by this cursor to be modified or deleted prior to the commit of -the transaction for this cursor. -
DB_DIRTY_READ
All read operations performed by the cursor may return modified but not -yet committed data. Silently ignored if the DB_DIRTY_READ flag -was not specified when the underlying database was opened. +
DB_READ_COMMITTED
This cursor will have degree 2 isolation. This ensures the stability +of the current data item read by this cursor but permits data read by +this cursor to be modified or deleted prior to the commit of the +transaction for this cursor. +
DB_READ_UNCOMMITTED
This cursor will have degree 1 isolation. Read operations performed by +the cursor may return modified but not yet committed data. Silently +ignored if the DB_READ_UNCOMMITTED flag was not specified when +the underlying database was opened.
DB_WRITECURSOR
Specify that the cursor will be used to update the database. The underlying database environment must have been opened using the DB_INIT_CDB flag. +
DB_TXN_SNAPSHOT
Specify that the cursor operate with read-only +snapshot isolation. For databases +with the DB_MULTIVERSION flag set, data values will be read as +they are when the cursor is opened, without taking read locks. This +flag implicitly begins a transaction that is committed when the cursor +is closed. Silently ignored if DB_MULTIVERSION not set on the +underlying database or if a transaction is supplied in the txnid +parameter.
-
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. To transaction-protect cursor operations, cursors must be opened and -closed within the context of a transaction, and the txnid -parameter specifies the transaction context in which the cursor may be -used. +
txnid
Cursor operations are not automatically transaction-protected, even if +the DB_AUTO_COMMIT flag is specified to the +DB_ENV->set_flags or DB->open methods. If cursor operations are +to be transaction-protected, the txnid parameter must be a +transaction handle returned from DB_ENV->txn_begin; otherwise, NULL. To +transaction-protect cursor operations, cursors must be opened and closed +within the context of a transaction, and the txnid parameter +specifies the transaction context in which the cursor may be used.

Errors

The DB->cursor method @@ -64,6 +77,7 @@ may fail and return one of the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
An @@ -78,6 +92,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_del.html b/db/docs/api_c/db_del.html index d836f5ce0..df370a156 100644 --- a/db/docs/api_c/db_del.html +++ b/db/docs/api_c/db_del.html @@ -1,5 +1,5 @@ - - + + @@ -44,18 +44,17 @@ and 0 on success.

Parameters

+
flags
The flags parameter is currently unused, and must be set to 0.
key
The key DBT operated on. -
flags
The flags parameter must be set to 0 or -the following value: -
-
DB_AUTO_COMMIT
Enclose the DB->del call within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. -
-
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The DB->del method @@ -69,6 +68,7 @@ to grant a lock in the allowed time.

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -89,6 +89,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_err.html b/db/docs/api_c/db_err.html index f9f19080e..660034861 100644 --- a/db/docs/api_c/db_err.html +++ b/db/docs/api_c/db_err.html @@ -1,6 +1,6 @@ - - + + @@ -34,8 +34,8 @@ DB->errx(DB *db, const char *fmt, ...);

The DB_ENV->err, DB_ENV->errx, DB->err and DB->errx methods provide error-messaging functionality for applications written using the Berkeley DB library.

-

The DB_ENV->err method constructs an error message consisting of the -following elements:

+

The DB->err and DB_ENV->err methods constructs an error message +consisting of the following elements:

An optional prefix string
If no error callback function has been set using the DB_ENV->set_errcall method, any prefix string specified using the @@ -49,6 +49,10 @@ are converted for output. error value, as returned by the db_strerror method.
+

The DB->errx and DB_ENV->errx methods are the same as the +DB->err and DB_ENV->err methods, except they do not append the +final separator characters and standard error string to the error +message.

This constructed error message is then handled as follows:

If an error callback function has been set (see DB->set_errcall and DB_ENV->set_errcall), that function is called with two @@ -66,17 +70,6 @@ is written to stderr, the standard error output stream.

string.
fmt
The fmt parameter is an optional printf-style message to display.
-

The DB_ENV->errx and DB->errx methods perform identically to the -DB_ENV->err and DB->err methods, except that they do not append -the final separator characters and standard error string to the error -message.

-

Parameters

-
-
error
The error parameter is the error value for which the -DB_ENV->err and DB->err methods will display a explanatory -string. -
fmt
The fmt parameter is an optional printf-style message to display. -

Class

DB @@ -86,6 +79,6 @@ string.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_fd.html b/db/docs/api_c/db_fd.html index 9a527721e..4a16f872c 100644 --- a/db/docs/api_c/db_fd.html +++ b/db/docs/api_c/db_fd.html @@ -1,5 +1,5 @@ - - + + @@ -32,9 +32,7 @@ of the underlying database. A file descriptor referring to the same file will be returned to all processes that call DB->open with the same file parameter.

This file descriptor may be safely used as a parameter to the -fcntl(2) and flock(2) locking functions. The file -descriptor is not necessarily associated with any of the underlying -files actually used by the access method.

+fcntl(2) and flock(2) locking functions.

The DB->fd method only supports a coarse-grained form of locking. Applications should instead use the Berkeley DB lock manager where possible.

The DB->fd method @@ -44,7 +42,7 @@ and 0 on success.

Parameters

fdp
The fdp parameter references memory into which - the current file descriptor is copied. + the current file descriptor is copied.

Class

@@ -55,6 +53,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_get.html b/db/docs/api_c/db_get.html index 2b58ea571..ff73c65d6 100644 --- a/db/docs/api_c/db_get.html +++ b/db/docs/api_c/db_get.html @@ -1,5 +1,5 @@ - - + + @@ -96,16 +96,6 @@ of type Btree, and it must have been created with the DB_RECNUM flag.

In addition, the following flags may be set by bitwise inclusively OR'ing them into the flags parameter:
-
DB_AUTO_COMMIT
Enclose the DB->get call within a transaction. If the call -succeeds, changes made by the operation will be recoverable. If the -call fails, the operation will have made no changes. This flag may only -be specified with the DB_CONSUME and DB_CONSUME_WAIT -flags. -
DB_DEGREE_2
Perform the get operation with degree 2 isolation. -The read is not repeatable. -
DB_DIRTY_READ
Read modified but not yet committed data. Silently ignored if the -DB_DIRTY_READ flag was not specified when the underlying -database was opened.
DB_MULTIPLE
Return multiple data items in the buffer to which the data parameter refers.

In the case of Btree or Hash databases, all of the data items associated @@ -131,6 +121,12 @@ into secondary indices using the DB->ass

See DB_MULTIPLE_INIT for more information.

+
DB_READ_COMMITTED
Perform the get operation with degree 2 isolation. The read is not +repeatable. +
DB_READ_UNCOMMITTED
Perform the get operation with degree 1 isolation, reading modified but +not yet committed data. Silently ignored if the +DB_READ_UNCOMMITTED flag was not specified when the underlying +database was opened.
DB_RMW
Acquire write locks instead of read locks when doing the retrieval. Setting this flag can eliminate deadlock during a read-modify-write cycle by acquiring the write lock during the read part of the cycle so @@ -143,14 +139,23 @@ transactions.

key
The key DBT operated on.
pkey
The pkey parameter is the return key from the primary database. -
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The DB->get method may fail and return one of the following non-zero errors:

+
DB_BUFFER_SMALL
The requested item could not be returned due to undersized buffer. +
+
DB_LOCK_DEADLOCK
A transactional database environment operation was selected to resolve a deadlock.
DB_LOCK_NOTGRANTED
A Berkeley DB Concurrent Data Store database environment configured for lock timeouts was unable @@ -163,6 +168,7 @@ timers were configured and the lock could not be granted before the wait-time ex
DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -176,9 +182,6 @@ the DB->pget method was called with a DB refer to a secondary index; or if an invalid flag value or parameter was specified.
-
-
DB_BUFFER_SMALL
The requested item could not be returned due to undersized buffer. -

Class

DB @@ -188,6 +191,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_get_byteswapped.html b/db/docs/api_c/db_get_byteswapped.html index 2b9aecb35..73dae3fb3 100644 --- a/db/docs/api_c/db_get_byteswapped.html +++ b/db/docs/api_c/db_get_byteswapped.html @@ -1,5 +1,5 @@ - + @@ -63,6 +63,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_get_mpf.html b/db/docs/api_c/db_get_mpf.html index cbc9d1e01..bf2a64f0e 100644 --- a/db/docs/api_c/db_get_mpf.html +++ b/db/docs/api_c/db_get_mpf.html @@ -1,17 +1,17 @@ - - + + -Berkeley DB: DB->mpf +Berkeley DB: DB->get_mpf
-

DB->mpf

+

DB->get_mpf

API @@ -22,15 +22,14 @@

 #include <db.h>
 

-DB_MPOOLFILE *DB->mpf +DB_MPOOLFILE * +DB->get_mpf(DB *db);


-

Description: DB->mpf

-

The DB->mpf method returns the Db.get_mpf.

-

The DB->mpf method may be called at any time during the life of the +

Description: DB->get_mpf

+

The DB->get_mpf method returns the handle for the cache file underlying the database.

+

The DB->get_mpf method may be called at any time during the life of the application.

-

DB->mpf gives access to the DB_MPOOLFILE associated -with a DB object.


Class

DB @@ -40,6 +39,6 @@ with a DB object.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_get_type.html b/db/docs/api_c/db_get_type.html index 220d7cbae..8860df9f6 100644 --- a/db/docs/api_c/db_get_type.html +++ b/db/docs/api_c/db_get_type.html @@ -1,5 +1,5 @@ - + @@ -41,7 +41,7 @@ and 0 on success.

Parameters

type
The type parameter references memory into which - the type of the underlying access method is copied. + the type of the underlying access method is copied.

Errors

The DB->get_type method @@ -59,6 +59,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_getenv.html b/db/docs/api_c/db_getenv.html index 8c941b9c8..68c891326 100644 --- a/db/docs/api_c/db_getenv.html +++ b/db/docs/api_c/db_getenv.html @@ -1,5 +1,5 @@ - - + + @@ -27,7 +27,7 @@ DB->get_env(DB *db);


Description: DB->get_env

-

The DB->get_env method returns the Db.getDbEnv.

+

The DB->get_env method returns the handle for the database environment underlying the database.

The DB->get_env method may be called at any time during the life of the application.


@@ -39,6 +39,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_join.html b/db/docs/api_c/db_join.html index af4143c25..f39fef408 100644 --- a/db/docs/api_c/db_join.html +++ b/db/docs/api_c/db_join.html @@ -1,5 +1,5 @@ - - + + @@ -52,8 +52,8 @@ The data parameter is left unchanged. In addition, the following flag may be set by bitwise inclusively OR'ing it into the flags parameter:

-
DB_DIRTY_READ
Read modified but not yet committed data. Silently ignored if the -DB_DIRTY_READ flag was not specified when the underlying +
DB_READ_UNCOMMITTED
Read modified but not yet committed data. Silently ignored if the +DB_READ_UNCOMMITTED flag was not specified when the underlying database was opened.
DB_RMW
Acquire write locks instead of read locks when doing the retrieval. Setting this flag can eliminate deadlock during a read-modify-write @@ -108,6 +108,7 @@ may fail and return one of the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -126,6 +127,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_key_range.html b/db/docs/api_c/db_key_range.html index 8ac7852a4..5391d5dba 100644 --- a/db/docs/api_c/db_key_range.html +++ b/db/docs/api_c/db_key_range.html @@ -1,5 +1,5 @@ - + @@ -58,9 +58,15 @@ contains three elements of type double: less, equal, and field less is 0.05, 5% of the keys in the database are less than the key parameter. The value for equal will be zero if there is no matching key, and will be non-zero otherwise. -

txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. The DB->key_range method does not retain the locks it acquires for the +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected. The DB->key_range method does not retain the locks it acquires for the life of the transaction, so estimates may not be repeatable.
flags
The flags parameter is currently unused, and must be set to 0.
@@ -76,6 +82,7 @@ to grant a lock in the allowed time.
DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If the underlying database was not of type Btree; or if an @@ -90,6 +97,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_list.html b/db/docs/api_c/db_list.html index 2c34d17e5..6b651793d 100644 --- a/db/docs/api_c/db_list.html +++ b/db/docs/api_c/db_list.html @@ -1,5 +1,5 @@ - + @@ -10,20 +10,19 @@

Berkeley DB: Databases and Related Methods

- + - + + - - @@ -49,7 +48,6 @@ - @@ -66,6 +64,6 @@
Database OperationsDescription
db_createCreate a database handle
DB->associateAssociate a secondary index
DB->closeClose a database
DB->closeCreate a cursor
DB->compactCompact a database
DB->cursorCreate a cursor
DB->delDelete items from a database
DB->err, DB->errxError message
DB->fdReturn a file descriptor from a database
DB->get, DB->pgetGet items from a database
DB->get_byteswappedReturn if the underlying database is in host order
DB->get_envReturn database environment handle
DB->mpfReturn underlying DB_MPOOLFILE handle
DB->get_typeReturn the database type
DB->joinPerform a database join on cursors
DB->key_rangeReturn estimate of key location
DB->set_flagsGeneral database configuration
DB->set_lorderSet the database byte order
DB->set_pagesizeSet the underlying database page size
DB->set_paniccallSet panic callback
Btree/Recno Configuration
DB->set_append_recnoSet record append callback
DB->set_bt_compareSet a Btree comparison function
Queue Configuration
DB->set_q_extentsizeSet Queue database extent size
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_open.html b/db/docs/api_c/db_open.html index 230419b6d..de5dfca30 100644 --- a/db/docs/api_c/db_open.html +++ b/db/docs/api_c/db_open.html @@ -1,5 +1,5 @@ - - + + @@ -55,7 +55,7 @@ repeatedly opening and closing the database for each new query.

The DB->open method returns a non-zero error value on failure and 0 on success. -If DB->open fails, the DB->close method should be called to +If DB->open fails, the DB->close method must be called to discard the DB handle.

Parameters

@@ -70,40 +70,49 @@ in the same physical file, it is important to consider locking and memory cache issues; see Opening multiple databases in a single file for more information.

In-memory databases never intended to be preserved on disk may be -created by setting both the file and database parameters -to NULL. Note that in-memory databases can only ever be shared by -sharing the single database handle that created them, in circumstances -where doing so is safe.

+created by setting the file parameter to NULL. If the +database parameter is also NULL, the database is strictly +temporary and cannot be opened by any other thread of control, thus the +database can only be accessed by sharing the single database handle that +created it, in circumstances where doing so is safe. If the +database parameter is not set to NULL, the database can be opened +by other threads of control and will be replicated to client sites in +any replication group.

file
The file parameter is used as the name of an underlying file that -will be used to back the database. +will be used to back the database; see File naming for more information.

In-memory databases never intended to be preserved on disk may be -created by setting both the file and database parameters -to NULL. Note that in-memory databases can only ever be shared by -sharing the single database handle that created them, in circumstances -where doing so is safe.

-

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+created by setting the file parameter to NULL.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
DB_AUTO_COMMIT
Enclose the DB->open call within a transaction. If the call -succeeds, the open operation will be recoverable. If the call fails, -no database will have been created. +succeeds, the open operation will be recoverable and all subsequent +database modification operations based on this handle will be +transactionally protected. If the call fails, no database will have +been created.
DB_CREATE
Create the database. If the database does not already exist and the DB_CREATE flag is not specified, the DB->open will fail. -
DB_DIRTY_READ
Support dirty reads; that is, read operations on the database may -request the return of modified but not yet committed data. This flag -must be specified on all DB handles used to perform dirty reads -or database updates, otherwise requests for dirty reads may not be -honored and the read may block.
DB_EXCL
Return an error if the database already exists. The DB_EXCL flag is only meaningful when specified with the DB_CREATE flag. +
DB_MULTIVERSION
Open the database with support for multiversion concurrency control. This will cause updates to the +database to follow a copy-on-write protocol, which is required to +support snapshot isolation. The DB_MULTIVERSION flag requires +that the database be transactionally protected during its open and is +not supported by the queue format.
DB_NOMMAP
Do not map this database into process memory (see the DB_ENV->set_mp_mmapsize method for further information).
DB_RDONLY
Open the database for reading only. Any attempt to modify items in the database will fail, regardless of the actual permissions of any underlying files. +
DB_READ_UNCOMMITTED
Support read operations with degree 1 isolation. Read operations on the +database may request the return of modified but not yet committed data. +This flag must be specified on all DB handles used to perform +dirty reads or database updates, otherwise requests for dirty reads may +not be honored and the read may block.
DB_THREAD
Cause the DB handle returned by DB->open to be free-threaded; that is, concurrently usable by multiple threads in the address space. @@ -125,12 +134,18 @@ defaults, and is not further specified by Berkeley DB. System shared memory segments created by the database open are created with mode mode, unmodified by the process' umask value. If mode is 0, the database open will use a default mode of readable and writable by both owner and group.

-
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. Note that transactionally protected operations on a DB handle +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +DB_AUTO_COMMIT flag is specified, +the operation will be implicitly transaction protected. Note that transactionally protected operations on a DB handle requires the DB handle itself be transactionally protected -during its open. +during its open. Also note that the transaction must be committed before +the handle is closed; see Berkeley DB +handles for more information.
type
The type parameter is of type DBTYPE, and must be set to one of DB_BTREE, DB_HASH, DB_QUEUE, DB_RECNO, or DB_UNKNOWN. If type is @@ -188,6 +203,7 @@ invalid flag value or parameter was specified.
DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.

Description: DB->get_database

@@ -196,9 +212,9 @@ name.

Parameters

filenamep
The filenamep parameter references memory into which -a pointer to the current filename is copied. +a pointer to the current filename is copied.
dbnamep
The dbnamep parameter references memory into which -a pointer to the current database name is copied. +a pointer to the current database name is copied.

The DB->get_database method may be called at any time during the life of the application.

@@ -235,6 +251,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_put.html b/db/docs/api_c/db_put.html index 260c67e4a..58f46cb3c 100644 --- a/db/docs/api_c/db_put.html +++ b/db/docs/api_c/db_put.html @@ -1,5 +1,5 @@ - - + + @@ -71,20 +71,20 @@ supports duplicates. database.

-In addition, the following flag may be set by -bitwise inclusively OR'ing it into the flags parameter: -
-
DB_AUTO_COMMIT
Enclose the DB->put call within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. -
data
The data DBT operated on.
key
The key DBT operated on. -
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.
+ +

Errors

The DB->put method may fail and return one of the following non-zero errors:

@@ -100,6 +100,7 @@ to grant a lock in the allowed time.
DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If a record number of 0 was specified; @@ -121,6 +122,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_remove.html b/db/docs/api_c/db_remove.html index f2b386f13..eb033b406 100644 --- a/db/docs/api_c/db_remove.html +++ b/db/docs/api_c/db_remove.html @@ -1,6 +1,6 @@ - - + + @@ -57,8 +57,9 @@ and 0 on success.

database
The database parameter is the database to be removed.
file
The file parameter is the physical file which contains the database(s) to be removed. -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter is currently unused, and must be set to 0.

Environment Variables

@@ -87,6 +88,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_rename.html b/db/docs/api_c/db_rename.html index 40560583f..cfc89c30b 100644 --- a/db/docs/api_c/db_rename.html +++ b/db/docs/api_c/db_rename.html @@ -1,6 +1,6 @@ - - + + @@ -59,8 +59,9 @@ and 0 on success.

database
The database parameter is the database to be renamed.
file
The file parameter is the physical file which contains the database(s) to be renamed. -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter is currently unused, and must be set to 0.
newname
The newname parameter is the new name of the database or file.
@@ -90,6 +91,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_alloc.html b/db/docs/api_c/db_set_alloc.html index 536d3034e..dd2ec4d7e 100644 --- a/db/docs/api_c/db_set_alloc.html +++ b/db/docs/api_c/db_set_alloc.html @@ -1,6 +1,6 @@ - + @@ -83,6 +83,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_append_recno.html b/db/docs/api_c/db_set_append_recno.html index d2572b41a..f20531277 100644 --- a/db/docs/api_c/db_set_append_recno.html +++ b/db/docs/api_c/db_set_append_recno.html @@ -1,5 +1,5 @@ - - + + @@ -59,6 +59,10 @@ DB_DBT_APPMALLOC, which indicates that Berkeley DB should free the memory when it is done with it.

The callback function must return 0 on success and errno or a value outside of the Berkeley DB error name space on failure.

+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.

Errors

The DB->set_append_recno method @@ -76,6 +80,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_bt_compare.html b/db/docs/api_c/db_set_bt_compare.html index c39438b83..fb2cb6f70 100644 --- a/db/docs/api_c/db_set_bt_compare.html +++ b/db/docs/api_c/db_set_bt_compare.html @@ -1,5 +1,5 @@ - + @@ -86,6 +86,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_bt_minkey.html b/db/docs/api_c/db_set_bt_minkey.html index 460dcbb19..4ee6ce699 100644 --- a/db/docs/api_c/db_set_bt_minkey.html +++ b/db/docs/api_c/db_set_bt_minkey.html @@ -1,5 +1,5 @@ - + @@ -85,6 +85,6 @@ leaf page in bt_minkeyp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_bt_prefix.html b/db/docs/api_c/db_set_bt_prefix.html index 8546a7fc9..3f0bbecfe 100644 --- a/db/docs/api_c/db_set_bt_prefix.html +++ b/db/docs/api_c/db_set_bt_prefix.html @@ -1,5 +1,5 @@ - + @@ -89,6 +89,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_cachesize.html b/db/docs/api_c/db_set_cachesize.html index 4fe4eab15..91efa1707 100644 --- a/db/docs/api_c/db_set_cachesize.html +++ b/db/docs/api_c/db_set_cachesize.html @@ -1,6 +1,6 @@ - - + + @@ -41,17 +41,18 @@ pages accessed simultaneously, and is usually much larger.)

The default cache size is 256KB, and may not be specified as less than 20KB. Any cache size less than 500MB is automatically increased by 25% to account for buffer pool overhead; cache sizes larger than 500MB are -used as specified. The current maximum size of a single cache is 4GB. -(All sizes are in powers-of-two, that is, 256KB is 2^18 not 256,000.) -For information on tuning the Berkeley DB cache size, see -Selecting a cache size.

-

It is possible to specify caches to Berkeley DB larger than 4GB and/or large -enough they cannot be allocated contiguously on some architectures. For -example, some releases of Solaris limit the amount of memory that may -be allocated contiguously by a process. If ncache is 0 or 1, -the cache will be allocated contiguously in memory. If it is greater -than 1, the cache will be broken up into ncache equally sized, -separate pieces of memory.

+used as specified. The maximum size of a single cache is 4GB on 32-bit +systems and 10TB on 64-bit systems. (All sizes are in powers-of-two, +that is, 256KB is 2^18 not 256,000.) For information on tuning the Berkeley DB +cache size, see Selecting a +cache size.

+

It is possible to specify caches to Berkeley DB large enough they cannot be +allocated contiguously on some architectures. For example, some +releases of Solaris limit the amount of memory that may be allocated +contiguously by a process. If ncache is 0 or 1, the cache will +be allocated contiguously in memory. If it is greater than 1, the cache +will be broken up into ncache equally sized, separate pieces of +memory.

Because databases opened within Berkeley DB environments use the cache specified to the environment, it is an error to attempt to set a cache in a database created within an environment.

@@ -91,11 +92,11 @@ and 0 on success.

Parameters

bytesp
The bytesp parameter references memory into which - the additional bytes of memory in the cache is copied. + the additional bytes of memory in the cache is copied.
gbytesp
The gbytesp parameter references memory into which - the gigabytes of memory in the cache is copied. + the gigabytes of memory in the cache is copied.
ncachep
The ncachep parameter references memory into which - the number of caches is copied. + the number of caches is copied.

Class

@@ -106,6 +107,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_dup_compare.html b/db/docs/api_c/db_set_dup_compare.html index a0f6f5de8..cabcf2e99 100644 --- a/db/docs/api_c/db_set_dup_compare.html +++ b/db/docs/api_c/db_set_dup_compare.html @@ -1,5 +1,5 @@ - + @@ -84,6 +84,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_encrypt.html b/db/docs/api_c/db_set_encrypt.html index bc821687f..022dfbcee 100644 --- a/db/docs/api_c/db_set_encrypt.html +++ b/db/docs/api_c/db_set_encrypt.html @@ -1,6 +1,6 @@ - + @@ -89,6 +89,6 @@ encryption flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_errcall.html b/db/docs/api_c/db_set_errcall.html index 88feac654..8220992de 100644 --- a/db/docs/api_c/db_set_errcall.html +++ b/db/docs/api_c/db_set_errcall.html @@ -1,6 +1,6 @@ - - + + @@ -49,6 +49,9 @@ as during application debugging.

For DB handles opened inside of Berkeley DB environments, calling the DB->set_errcall method affects the entire environment and is equivalent to calling the DB_ENV->set_errcall method.

+

The DB->set_errcall method configures operations performed using the specified +DB handle, not all operations performed on the underlying +database.

The DB->set_errcall method may be called at any time during the life of the application.

Parameters

@@ -61,6 +64,10 @@ reporting function. The function takes three parameters: DB->set_errpfx or DB_ENV->set_errpfx).
msg
The msg parameter is the error message string. +

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -71,6 +78,6 @@ reporting function. The function takes three parameters:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_errfile.html b/db/docs/api_c/db_set_errfile.html index cc73d0557..6b9edd696 100644 --- a/db/docs/api_c/db_set_errfile.html +++ b/db/docs/api_c/db_set_errfile.html @@ -1,6 +1,6 @@ - - + + @@ -51,6 +51,9 @@ as during application debugging.

For DB handles opened inside of Berkeley DB environments, calling the DB->set_errfile method affects the entire environment and is equivalent to calling the DB_ENV->set_errfile method.

+

The DB->set_errfile method configures operations performed using the specified +DB handle, not all operations performed on the underlying +database.

The DB->set_errfile method may be called at any time during the life of the application.

Parameters

@@ -60,9 +63,18 @@ displaying additional Berkeley DB error information.

Description: DB->get_errfile

-

The DB->get_errfile method returns the .

+

The DB->get_errfile method returns the FILE *.

The DB->get_errfile method may be called at any time during the life of the application.

+

The DB->get_errfile method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
errfilep
The DB->get_errfile method returns the +FILE * in errfilep. +

Class

DB @@ -72,6 +84,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_errpfx.html b/db/docs/api_c/db_set_errpfx.html index 7d94a1c23..b7b9668ab 100644 --- a/db/docs/api_c/db_set_errpfx.html +++ b/db/docs/api_c/db_set_errpfx.html @@ -1,6 +1,6 @@ - - + + @@ -40,6 +40,9 @@ closed.

For DB handles opened inside of Berkeley DB environments, calling the DB->set_errpfx method affects the entire environment and is equivalent to calling the DB_ENV->set_errpfx method.

+

The DB->set_errpfx method configures operations performed using the specified +DB handle, not all operations performed on the underlying +database.

The DB->set_errpfx method may be called at any time during the life of the application.

Parameters

@@ -70,6 +73,6 @@ error prefix in errpfxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_feedback.html b/db/docs/api_c/db_set_feedback.html index 85543ef65..fad31a2ef 100644 --- a/db/docs/api_c/db_set_feedback.html +++ b/db/docs/api_c/db_set_feedback.html @@ -1,6 +1,6 @@ - - + + @@ -58,6 +58,10 @@ parameter may take on any of the following values:

percent
The percent parameter is the percent of the operation that has been completed, specified as an integer value between 0 and 100. +

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -68,6 +72,6 @@ been completed, specified as an integer value between 0 and 100.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_flags.html b/db/docs/api_c/db_set_flags.html index ac942b4e2..e686d824f 100644 --- a/db/docs/api_c/db_set_flags.html +++ b/db/docs/api_c/db_set_flags.html @@ -1,5 +1,5 @@ - + @@ -292,6 +292,6 @@ current flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_h_ffactor.html b/db/docs/api_c/db_set_h_ffactor.html index d7c37b2df..e3df5935d 100644 --- a/db/docs/api_c/db_set_h_ffactor.html +++ b/db/docs/api_c/db_set_h_ffactor.html @@ -1,5 +1,5 @@ - + @@ -84,6 +84,6 @@ hash table density in h_ffactorp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_h_hash.html b/db/docs/api_c/db_set_h_hash.html index 82798780f..870eb2a4a 100644 --- a/db/docs/api_c/db_set_h_hash.html +++ b/db/docs/api_c/db_set_h_hash.html @@ -1,5 +1,5 @@ - + @@ -70,6 +70,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_h_nelem.html b/db/docs/api_c/db_set_h_nelem.html index dd8f09644..84f4f8935 100644 --- a/db/docs/api_c/db_set_h_nelem.html +++ b/db/docs/api_c/db_set_h_nelem.html @@ -1,5 +1,5 @@ - + @@ -82,6 +82,6 @@ estimate of the final size of the hash table in h_nelemp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_lorder.html b/db/docs/api_c/db_set_lorder.html index 827a2098a..8bb2cda36 100644 --- a/db/docs/api_c/db_set_lorder.html +++ b/db/docs/api_c/db_set_lorder.html @@ -1,5 +1,5 @@ - + @@ -87,6 +87,6 @@ database byte order in lorderp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_msgcall.html b/db/docs/api_c/db_set_msgcall.html index 6144b213b..bcb76b949 100644 --- a/db/docs/api_c/db_set_msgcall.html +++ b/db/docs/api_c/db_set_msgcall.html @@ -1,6 +1,6 @@ - - + + @@ -44,6 +44,9 @@ manner.

For DB handles opened inside of Berkeley DB environments, calling the DB->set_msgcall method affects the entire environment and is equivalent to calling the DB_ENV->set_msgcall method.

+

The DB->set_msgcall method configures operations performed using the specified +DB handle, not all operations performed on the underlying +database.

The DB->set_msgcall method may be called at any time during the life of the application.

Parameters

@@ -54,6 +57,10 @@ reporting function. The function takes two parameters:
dbenv
The dbenv parameter is the enclosing database environment.
msg
The msg parameter is the message string. +

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -64,6 +71,6 @@ reporting function. The function takes two parameters:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_msgfile.html b/db/docs/api_c/db_set_msgfile.html index f45574812..096b0338b 100644 --- a/db/docs/api_c/db_set_msgfile.html +++ b/db/docs/api_c/db_set_msgfile.html @@ -1,6 +1,6 @@ - - + + @@ -46,6 +46,9 @@ in a way that does not use C library FILE *'s.

For DB handles opened inside of Berkeley DB environments, calling the DB->set_msgfile method affects the entire environment and is equivalent to calling the DB_ENV->set_msgfile method.

+

The DB->set_msgfile method configures operations performed using the specified +DB handle, not all operations performed on the underlying +database.

The DB->set_msgfile method may be called at any time during the life of the application.

Parameters

@@ -55,9 +58,18 @@ displaying messages.

Description: DB->get_msgfile

-

The DB->get_msgfile method returns the .

+

The DB->get_msgfile method returns the FILE *.

The DB->get_msgfile method may be called at any time during the life of the application.

+

The DB->get_msgfile method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
msgfilep
The DB->get_msgfile method returns the +FILE * in msgfilep. +

Class

DB @@ -67,6 +79,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_pagesize.html b/db/docs/api_c/db_set_pagesize.html index 3f7efbe36..86ed71290 100644 --- a/db/docs/api_c/db_set_pagesize.html +++ b/db/docs/api_c/db_set_pagesize.html @@ -1,5 +1,5 @@ - - + + @@ -45,9 +45,9 @@ If the database already exists when DB->open is called, the information specified to DB->set_pagesize will be ignored.

-If creating additional databases in a file, the page size specified must -be consistent with the existing databases in the file or an error will -be returned. +If creating additional databases in a single physical file, information +specified to DB->set_pagesize will be ignored and the page size +of the existing databases will be used.

The DB->set_pagesize method returns a non-zero error value on failure and 0 on success. @@ -86,6 +86,6 @@ page size in pagesizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_q_extentsize.html b/db/docs/api_c/db_set_q_extentsize.html index c4658e746..76cb6d4e5 100644 --- a/db/docs/api_c/db_set_q_extentsize.html +++ b/db/docs/api_c/db_set_q_extentsize.html @@ -1,5 +1,5 @@ - + @@ -82,6 +82,6 @@ number of pages in an extent in extentsizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_re_delim.html b/db/docs/api_c/db_set_re_delim.html index b4e48f213..1a29e54ae 100644 --- a/db/docs/api_c/db_set_re_delim.html +++ b/db/docs/api_c/db_set_re_delim.html @@ -1,5 +1,5 @@ - + @@ -82,6 +82,6 @@ delimiting byte in delimp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_re_len.html b/db/docs/api_c/db_set_re_len.html index eecbc9c58..e6b2b5e3d 100644 --- a/db/docs/api_c/db_set_re_len.html +++ b/db/docs/api_c/db_set_re_len.html @@ -1,5 +1,5 @@ - + @@ -89,6 +89,6 @@ record length in re_lenp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_re_pad.html b/db/docs/api_c/db_set_re_pad.html index 0c4206123..de79cd924 100644 --- a/db/docs/api_c/db_set_re_pad.html +++ b/db/docs/api_c/db_set_re_pad.html @@ -1,5 +1,5 @@ - + @@ -80,6 +80,6 @@ pad character in re_padp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_set_re_source.html b/db/docs/api_c/db_set_re_source.html index e50ce8f47..40e4ed195 100644 --- a/db/docs/api_c/db_set_re_source.html +++ b/db/docs/api_c/db_set_re_source.html @@ -1,5 +1,5 @@ - + @@ -88,8 +88,9 @@ and 0 on success.

Parameters

source
The backing flat text database file for a Recno database. -

On Windows, the source argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the source +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

Errors

The DB->set_re_source method @@ -112,6 +113,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_stat.html b/db/docs/api_c/db_stat.html index 5aaca3aa1..f8a6eb7be 100644 --- a/db/docs/api_c/db_stat.html +++ b/db/docs/api_c/db_stat.html @@ -1,5 +1,5 @@ - - + + @@ -39,21 +39,28 @@ copied into the memory location to which it refers.

flags
The flags parameter must be set to 0 or one of the following values:
-
DB_DEGREE_2
Database items read during this operation will have degree 2 isolation. -This ensures the stability of the data items read during the stat -operation but permits that data to be modified or deleted by other -transactions prior to the commit of the specified transaction. -
DB_DIRTY_READ
Database items read during this operation may include modified but not -yet committed data. Silently ignored if the DB_DIRTY_READ flag -was not specified when the underlying database was opened.
DB_FAST_STAT
Return only the values which do not require traversal of the database. Among other things, this flag makes it possible for applications to request key and record counts without incurring the performance penalty of traversing the entire database. +
DB_READ_COMMITTED
Database items read during this operation will have degree 2 isolation. +This ensures the stability of the data items read during the stat +operation but permits that data to be modified or deleted by other +transactions prior to the commit of the specified transaction. +
DB_READ_UNCOMMITTED
Database items read during this operation will have degree 1 isolation, +including modified but not yet committed data. Silently ignored if the +DB_READ_UNCOMMITTED flag was not specified when the underlying +database was opened.
-
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Statistical structures are stored in allocated memory. If application-specific allocation routines have been declared (see DB_ENV->set_alloc for more @@ -195,6 +202,7 @@ may fail and return one of the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
An @@ -202,7 +210,7 @@ invalid flag value or parameter was specified.

Description: DB->stat_print

-

The DB->stat_print method returns the +

The DB->stat_print method displays the database statistical information, as described for the DB->stat method. The information is printed to a specified output channel (see the DB_ENV->set_msgfile method for more information), or passed to an @@ -216,10 +224,15 @@ and 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
+
DB_FAST_STAT
Return only the values which do not require traversal of the database. +Among other things, this flag makes it possible for applications to +request key and record counts without incurring the performance penalty +of traversing the entire database.
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values.

@@ -231,6 +244,6 @@ the following value:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_sync.html b/db/docs/api_c/db_sync.html index be630ebe4..b64570e42 100644 --- a/db/docs/api_c/db_sync.html +++ b/db/docs/api_c/db_sync.html @@ -1,5 +1,5 @@ - + @@ -54,6 +54,7 @@ may fail and return one of the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
An @@ -68,6 +69,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_truncate.html b/db/docs/api_c/db_truncate.html index e06eeb517..04bf1e286 100644 --- a/db/docs/api_c/db_truncate.html +++ b/db/docs/api_c/db_truncate.html @@ -1,5 +1,5 @@ - - + + @@ -44,18 +44,17 @@ and 0 on success.

Parameters

countp
The countp parameter references memory into which - the number of records discarded from the database is copied. -
flags
The flags parameter must be set to 0 or -the following value: -
-
DB_AUTO_COMMIT
Enclose the DB->truncate call within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. -
-
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. + the number of records discarded from the database is copied. +
flags
The flags parameter is currently unused, and must be set to 0. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The DB->truncate method @@ -79,6 +78,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_upgrade.html b/db/docs/api_c/db_upgrade.html index c6a7e08c6..d51ef8c65 100644 --- a/db/docs/api_c/db_upgrade.html +++ b/db/docs/api_c/db_upgrade.html @@ -1,5 +1,5 @@ - + @@ -100,6 +100,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/db_verify.html b/db/docs/api_c/db_verify.html index 7e3a34181..c4c3244d2 100644 --- a/db/docs/api_c/db_verify.html +++ b/db/docs/api_c/db_verify.html @@ -1,5 +1,5 @@ - - + + @@ -66,9 +66,10 @@ to be verified are found. the following value:

DB_SALVAGE
Write the key/data pairs from all databases in the file to the file -stream named in the outfile parameter. The output format is the -same as that specified for the db_dump utility, and can be used -as input for the db_load utility. +stream named in the outfile parameter. Key values are written +for Btree, Hash and Queue databases, but not for Recno databases. +

The output format is the same as that specified for the db_dump +utility, and can be used as input for the db_load utility.

Because the key/data pairs are output in page order as opposed to the sort order used by db_dump, using DB->verify to dump key/data pairs normally produces less than optimal loads for Btree databases.

@@ -142,6 +143,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbc_class.html b/db/docs/api_c/dbc_class.html index 342e301a4..e1489da31 100644 --- a/db/docs/api_c/dbc_class.html +++ b/db/docs/api_c/dbc_class.html @@ -1,5 +1,5 @@ - + @@ -38,6 +38,6 @@ handle may not be accessed again, regardless of the method's return.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbc_close.html b/db/docs/api_c/dbc_close.html index 70e6e8ac2..016e23623 100644 --- a/db/docs/api_c/dbc_close.html +++ b/db/docs/api_c/dbc_close.html @@ -1,5 +1,5 @@ - - + + @@ -61,6 +61,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbc_count.html b/db/docs/api_c/dbc_count.html index 28164ea8d..42eac1b51 100644 --- a/db/docs/api_c/dbc_count.html +++ b/db/docs/api_c/dbc_count.html @@ -1,5 +1,5 @@ - + @@ -36,7 +36,7 @@ and 0 on success.

Parameters

countp
The countp parameter references memory into which - the count of the number of duplicate data items is copied. + the count of the number of duplicate data items is copied.
flags
The flags parameter is currently unused, and must be set to 0.

Errors

@@ -45,6 +45,7 @@ may fail and return one of the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If the cursor has not been initialized; or if an @@ -59,6 +60,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbc_del.html b/db/docs/api_c/dbc_del.html index 392a9f272..9a8b6de92 100644 --- a/db/docs/api_c/dbc_del.html +++ b/db/docs/api_c/dbc_del.html @@ -1,5 +1,5 @@ - - + + @@ -57,6 +57,7 @@ to grant a lock in the allowed time.

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -81,6 +82,6 @@ specified to DB_ENV->open.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbc_dup.html b/db/docs/api_c/dbc_dup.html index 84010fd78..0f670831a 100644 --- a/db/docs/api_c/dbc_dup.html +++ b/db/docs/api_c/dbc_dup.html @@ -1,5 +1,5 @@ - + @@ -54,6 +54,7 @@ may fail and return one of the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
An @@ -68,6 +69,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbc_get.html b/db/docs/api_c/dbc_get.html index 7ee271096..7fec70baa 100644 --- a/db/docs/api_c/dbc_get.html +++ b/db/docs/api_c/dbc_get.html @@ -1,5 +1,5 @@ - - + + @@ -190,8 +190,8 @@ flag.

In addition, the following flags may be set by bitwise inclusively OR'ing them into the flags parameter:
-
DB_DIRTY_READ
Read modified but not yet committed data. Silently ignored if the -DB_DIRTY_READ flag was not specified when the underlying +
DB_READ_UNCOMMITTED
Read modified but not yet committed data. Silently ignored if the +DB_READ_UNCOMMITTED flag was not specified when the underlying database was opened.
DB_MULTIPLE
Return multiple data items in the data parameter.

In the case of Btree or Hash databases, duplicate data items for the @@ -275,6 +275,9 @@ in its own read-modify-write cycle, will not result in deadlock.

The DBcursor->c_get method may fail and return one of the following non-zero errors:

+
DB_BUFFER_SMALL
The requested item could not be returned due to undersized buffer. +
+
DB_LOCK_DEADLOCK
A transactional database environment operation was selected to resolve a deadlock.
DB_LOCK_NOTGRANTED
A Berkeley DB Concurrent Data Store database environment configured for lock timeouts was unable @@ -283,6 +286,7 @@ to grant a lock in the allowed time.
DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -294,9 +298,6 @@ the DBcursor->c_pget method was called with a cursor that does not refer to a secondary index; or if an invalid flag value or parameter was specified.
-
-
DB_BUFFER_SMALL
The requested item could not be returned due to undersized buffer. -

Class

DBC @@ -306,6 +307,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbc_list.html b/db/docs/api_c/dbc_list.html index 1dd508a69..0f40200ae 100644 --- a/db/docs/api_c/dbc_list.html +++ b/db/docs/api_c/dbc_list.html @@ -1,5 +1,5 @@ - + @@ -10,10 +10,10 @@

Berkeley DB: Database Cursors and Related Methods

- + - + @@ -21,6 +21,6 @@
Database Cursors and Related MethodsDescription
DB->cursorCreate a cursor handle
DB->cursorCreate a cursor
DBcursor->c_closeClose a cursor
DBcursor->c_countReturn count of duplicates
DBcursor->c_delDelete by cursor
DBcursor->c_get, DBcursor->c_pgetRetrieve by cursor
DBcursor->c_putStore by cursor
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbc_put.html b/db/docs/api_c/dbc_put.html index 5f0bb5e07..d10555ed2 100644 --- a/db/docs/api_c/dbc_put.html +++ b/db/docs/api_c/dbc_put.html @@ -1,5 +1,5 @@ - - + + @@ -127,6 +127,7 @@ to grant a lock in the allowed time.

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If the DB_AFTER, DB_BEFORE or DB_CURRENT flags @@ -156,6 +157,6 @@ specified to DB_ENV->open.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbm.html b/db/docs/api_c/dbm.html index 310fb4db0..e4eb56fb8 100644 --- a/db/docs/api_c/dbm.html +++ b/db/docs/api_c/dbm.html @@ -1,5 +1,5 @@ - + @@ -217,6 +217,6 @@ specified for other Berkeley DB and C library or system functions.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbt_bulk.html b/db/docs/api_c/dbt_bulk.html index ebc4a5beb..2141977d1 100644 --- a/db/docs/api_c/dbt_bulk.html +++ b/db/docs/api_c/dbt_bulk.html @@ -1,5 +1,5 @@ - - + + @@ -22,16 +22,16 @@

If either of the DB_MULTIPLE or DB_MULTIPLE_KEY flags were specified to the DB->get or DBcursor->c_get methods, the data -DBT returned by those interfaces will refer to a buffer that -is filled with data. Access to that data is through the following +DBT returned by those interfaces will refer to a buffer that is +filled with data. Access to that data is through the following macros:

DB_MULTIPLE_INIT
DB_MULTIPLE_INIT(void *pointer, DBT *data);

Initialize the retrieval. The pointer parameter is a variable -to be initialized. The data parameter is a DBT structure -returned from a successful call to DB->get or DBcursor->c_get -for which one of the DB_MULTIPLE or DB_MULTIPLE_KEY -flags was specified.

+to be initialized. The data parameter is a DBT +structure returned from a successful call to DB->get or +DBcursor->c_get for which one of the DB_MULTIPLE or +DB_MULTIPLE_KEY flags was specified.

DB_MULTIPLE_NEXT
DB_MULTIPLE_NEXT(void *pointer, DBT *data, void *retdata, size_t retdlen);

The data parameter is a DBT structure returned from a successful call to DB->get or DBcursor->c_get for which the @@ -47,35 +47,35 @@ elements in the returned set.

DB_MULTIPLE_KEY_NEXT
DB_MULTIPLE_KEY_NEXT(void *pointer, DBT *data,
 	void *retkey, size_t retklen, void *retdata, size_t retdlen);

The data parameter is a DBT structure returned from a -successful call to DBcursor->c_get for which the DB_MULTIPLE_KEY -flag was specified. The pointer and data parameters must -have been previously initialized by a call to DB_MULTIPLE_INIT. -The retkey parameter is set to refer to the next key element in -the returned set, and the retklen parameter is set to the length, -in bytes, of that key element. The retdata parameter is set to -refer to the next data element in the returned set, and the -retdlen parameter is set to the length, in bytes, of that data -element. The pointer parameter is set to NULL if there are -no more key/data pairs in the returned set.

+successful call to DBcursor->c_get with the Btree or Hash access methods +for which the DB_MULTIPLE_KEY flag was specified. The +pointer and data parameters must have been previously +initialized by a call to DB_MULTIPLE_INIT. The retkey +parameter is set to refer to the next key element in the returned set, +and the retklen parameter is set to the length, in bytes, of +that key element. The retdata parameter is set to refer to the +next data element in the returned set, and the retdlen parameter +is set to the length, in bytes, of that data element. The +pointer parameter is set to NULL if there are no more key/data +pairs in the returned set.

DB_MULTIPLE_RECNO_NEXT
DB_MULTIPLE_RECNO_NEXT(void *pointer, DBT *data,
 	db_recno_t recno, void * retdata, size_t retdlen);

The data parameter is a DBT structure returned from a -successful call to DBcursor->c_get for which the DB_MULTIPLE_KEY -flag was specified. The pointer and data parameters must -have been previously initialized by a call to DB_MULTIPLE_INIT. -The recno parameter is set to the record number of the next -record in the returned set. The retdata parameter is set to -refer to the next data element in the returned set, and the -retdlen parameter is set to the length, in bytes, of that data -element. When used with the Queue and Recno access methods, -retdata will be set to NULL for deleted records. The -pointer parameter is set to NULL if there are no more key/data -pairs in the returned set.

+successful call to DBcursor->c_get with the Queue or Recno access +methods for which the DB_MULTIPLE_KEY flag was specified. The +pointer and data parameters must have been previously +initialized by a call to DB_MULTIPLE_INIT. The recno +parameter is set to the record number of the next record in the returned +set. The retdata parameter is set to refer to the next data +element in the returned set, and the retdlen parameter is set to +the length, in bytes, of that data element. Deleted records are not +included in the results. The pointer parameter is set to NULL +if there are no more key/data pairs in the returned set.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbt_class.html b/db/docs/api_c/dbt_class.html index ce0891632..75518917c 100644 --- a/db/docs/api_c/dbt_class.html +++ b/db/docs/api_c/dbt_class.html @@ -1,6 +1,6 @@ - + @@ -132,6 +132,6 @@ those specified by the put call.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/dbt_package.html b/db/docs/api_c/dbt_package.html index 788b8bc7d..031fb49bf 100644 --- a/db/docs/api_c/dbt_package.html +++ b/db/docs/api_c/dbt_package.html @@ -1,5 +1,5 @@ - + @@ -18,6 +18,6 @@

DB_MULTIPLE_KEY_NEXTNext bulk get retrieval
DB_MULTIPLE_RECNO_NEXTNext bulk get retrieval
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_cdsgroup_begin.html b/db/docs/api_c/env_cdsgroup_begin.html new file mode 100644 index 000000000..3e961b135 --- /dev/null +++ b/db/docs/api_c/env_cdsgroup_begin.html @@ -0,0 +1,60 @@ + + + + + + +Berkeley DB: DB_ENV->cdsgroup_begin + + + + + + + +
+

DB_ENV->cdsgroup_begin

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->cdsgroup_begin(DB_ENV *dbenv, DB_TXN **tid); +

+
+

Description: DB_ENV->cdsgroup_begin

+

The DB_ENV->cdsgroup_begin method allocates a locker ID in an +environment configured for Berkeley DB Concurrent Data Store applications. It copies a pointer to +a DB_TXN that uniquely identifies the locker ID into the memory +to which tid refers. Calling the DB_TXN->commit method will +discard the allocated locker ID.

+

See Berkeley DB Concurrent Data Store applications for more +information about when this is required.

+

The DB_ENV->cdsgroup_begin method may be called at any time during the life of the +application.

+

The DB_ENV->cdsgroup_begin method +returns a non-zero error value on failure +and 0 on success. +

+

Errors

+

The DB_ENV->cdsgroup_begin method +may fail and return one of the following non-zero errors:

+
+
ENOMEM
The maximum number of lockers has been reached. +
+
+

Class

+DB_ENV, DB_TXN +

See Also

+Transaction Subsystem and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_class.html b/db/docs/api_c/env_class.html index 718ea711f..91e112c9c 100644 --- a/db/docs/api_c/env_class.html +++ b/db/docs/api_c/env_class.html @@ -1,5 +1,5 @@ - - + + @@ -30,7 +30,7 @@ db_env_create(DB_ENV **dbenvp, u_int32_t flags);

The DB_ENV object is the handle for a Berkeley DB environment -- a collection including support for some or all of caching, locking, logging and transaction subsystems, as well as databases and log files. -Methods off the DB_ENV handle are used to configure the +Methods of the DB_ENV handle are used to configure the environment as well as to operate on subsystems and databases in the environment.

DB_ENV handles are free-threaded if the DB_THREAD flag @@ -40,11 +40,11 @@ remains open that is using it as a reference (for example, DB_TXN). Once either the DB_ENV->close or DB_ENV->remove methods are called, the handle may not be accessed again, regardless of the method's return.

-

The db_env_create method creates a DB_ENV structure that is the -handle for a Berkeley DB environment. A pointer to this structure is returned -in the memory to which dbenvp refers. Calling the -DB_ENV->close or DB_ENV->remove methods will discard the returned -handle.

+

The db_env_create function creates a DB_ENV structure that +is the handle for a Berkeley DB environment. This function allocates memory +for the structure, returning a pointer to the structure in the memory +to which dbenvp refers. To release the allocated memory and +discard the handle, call the DB_ENV->close or DB_ENV->remove methods.

The DB_ENV handle contains a special field, "app_private", which is declared as type "void *". This field is provided for the use of the application program. It is initialized to NULL and is not further @@ -74,6 +74,6 @@ DB_ENV

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_close.html b/db/docs/api_c/env_close.html index b79e8ca76..5fe2f2a9a 100644 --- a/db/docs/api_c/env_close.html +++ b/db/docs/api_c/env_close.html @@ -1,5 +1,5 @@ - + @@ -78,6 +78,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_dbremove.html b/db/docs/api_c/env_dbremove.html index 7b8312e32..1ac2676d0 100644 --- a/db/docs/api_c/env_dbremove.html +++ b/db/docs/api_c/env_dbremove.html @@ -1,5 +1,5 @@ - - + + @@ -47,8 +47,9 @@ and 0 on success.

database
The database parameter is the database to be removed.
file
The file parameter is the physical file which contains the database(s) to be removed. -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or the following value:
@@ -56,9 +57,14 @@ the following value: changes made by the operation will be recoverable. If the call fails, the operation will have made no changes.
-
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +DB_AUTO_COMMIT flag is specified, +the operation will be implicitly transaction protected.

Environment Variables

The @@ -92,6 +98,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_dbrename.html b/db/docs/api_c/env_dbrename.html index f441ea8d7..4c8177b10 100644 --- a/db/docs/api_c/env_dbrename.html +++ b/db/docs/api_c/env_dbrename.html @@ -1,5 +1,5 @@ - - + + @@ -49,8 +49,9 @@ and 0 on success.

database
The database parameter is the database to be renamed.
file
The file parameter is the physical file which contains the database(s) to be renamed. -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or the following value:
@@ -59,9 +60,14 @@ changes made by the operation will be recoverable. If the call fails, the operation will have made no changes.
newname
The newname parameter is the new name of the database or file. -
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +DB_AUTO_COMMIT flag is specified, +the operation will be implicitly transaction protected.

Environment Variables

The @@ -95,6 +101,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_err.html b/db/docs/api_c/env_err.html index e1a0f3ba7..463f61269 100644 --- a/db/docs/api_c/env_err.html +++ b/db/docs/api_c/env_err.html @@ -1,5 +1,5 @@ - - + + @@ -33,8 +33,8 @@ DB_ENV->errx(DB_ENV *dbenv, const char *fmt, ...);

The DB_ENV->err, DB_ENV->errx, DB->err and DB->errx methods provide error-messaging functionality for applications written using the Berkeley DB library.

-

The DB_ENV->err method constructs an error message consisting of the -following elements:

+

The DB->err and DB_ENV->err methods constructs an error message +consisting of the following elements:

An optional prefix string
If no error callback function has been set using the DB_ENV->set_errcall method, any prefix string specified using the @@ -48,6 +48,10 @@ are converted for output. error value, as returned by the db_strerror method.
+

The DB->errx and DB_ENV->errx methods are the same as the +DB->err and DB_ENV->err methods, except they do not append the +final separator characters and standard error string to the error +message.

This constructed error message is then handled as follows:

If an error callback function has been set (see DB->set_errcall and DB_ENV->set_errcall), that function is called with two @@ -65,17 +69,6 @@ DB_ENV->err and DB->err methods will string.

fmt
The fmt parameter is an optional printf-style message to display. -

The DB_ENV->errx and DB->errx methods perform identically to the -DB_ENV->err and DB->err methods, except that they do not append -the final separator characters and standard error string to the error -message.

-

Parameters

-
-
error
The error parameter is the error value for which the -DB_ENV->err and DB->err methods will display a explanatory -string. -
fmt
The fmt parameter is an optional printf-style message to display. -

Class

DB_ENV @@ -85,6 +78,6 @@ string.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_event_notify.html b/db/docs/api_c/env_event_notify.html new file mode 100644 index 000000000..c5471d823 --- /dev/null +++ b/db/docs/api_c/env_event_notify.html @@ -0,0 +1,93 @@ + + + + + + +Berkeley DB: DB_ENV->set_event_notify + + + + + + + +
+

DB_ENV->set_event_notify

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->set_event_notify(DB_ENV *dbenv, + void (*db_event_fcn)(DB_ENV *dbenv, u_int32_t event, void *event_info)); +

+
+

Description: DB_ENV->set_event_notify

+

The DB_ENV->set_event_notify method configures a callback function which +is called to notify the process of specific Berkeley DB events.

+

The DB_ENV->set_event_notify method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

+

The DB_ENV->set_event_notify method may be called at any time during the life of the +application.

+

The DB_ENV->set_event_notify method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
db_event_fcn
The db_event_fcn parameter is the application's event +notification function. The function takes three parameters: +
+
dbenv
The dbenv parameter is the enclosing database environment handle. +
event
The event parameter is one of the following values: +
+
DB_EVENT_PANIC
Errors can occur in the Berkeley DB library where the only solution is to shut +down the application and run recovery (for example, if Berkeley DB is unable +to allocate heap memory). In such cases, the Berkeley DB methods will +return DB_RUNRECOVERY. +It is often easier to simply exit the application when such errors occur +rather than gracefully return up the stack. +

When event is set to DB_EVENT_PANIC, the database +environment has failed. All threads of control in the database +environment should exit the environment, and recovery should be run.

+
DB_EVENT_REP_CLIENT
The local site is now a replication client. +
DB_EVENT_REP_MASTER
The local site is now the master site of its replication group. It is +the application's responsibility to begin acting as the master environment. +
DB_EVENT_REP_NEWMASTER
The replication group of which this site is a member has just established a +new master; the local site is not the new master. The +event_info parameter points to an integer containing the +environment ID of the new master. +

The DB_EVENT_REP_NEWMASTER event is provided only to applications using +the replication manager support.

+
DB_EVENT_REP_STARTUPDONE
The client has completed startup synchronization and is now processing +live log records received from the master. +
DB_EVENT_WRITE_FAILED
A Berkeley DB write to stable storage failed. +
+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.

+
event_info
The event_info parameter may reference memory which contains +additional information describing an event. By default, +event_info is NULL; specific events may pass non-NULL values, +in which case the event will also describe the memory's structure. +
+
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_failchk.html b/db/docs/api_c/env_failchk.html new file mode 100644 index 000000000..f1a8d8ba7 --- /dev/null +++ b/db/docs/api_c/env_failchk.html @@ -0,0 +1,92 @@ + + + + + + +Berkeley DB: DB_ENV->failchk + + + + + + + +
+

DB_ENV->failchk

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->dbenv_failchk(DB_ENV *dbenv, u_int32_t flags); +

+
+

Description: DB_ENV->failchk

+

The DB_ENV->failchk method checks for threads of control (either a true +thread or a process) that have exited while manipulating Berkeley DB library +data structures, while holding a logical database lock, or with an +unresolved transaction (that is, a transaction that was never aborted +or committed). For more information, see Architecting Data Store and Concurrent Data Store applications, and +Architecting Transactional Data Store +applications.

+

The DB_ENV->failchk method is based on the "thread_id" and "is_alive" +functions specified to the DB_ENV->set_thread_id method. Applications +calling the DB_ENV->failchk method must have already called the +DB_ENV->set_isalive method, on the same DB_ENV, and must have +configured their database environment using the +DB_ENV->set_thread_count method.

+

If DB_ENV->failchk determines a thread of control exited while +holding database read locks, it will release those locks. If +DB_ENV->failchk determines a thread of control exited with an +unresolved transaction, the transaction will be aborted. In either of +these cases, DB_ENV->failchk will return 0 and the application may +continue to use the database environment.

+

In either of these cases, the DB_ENV->failchk method will also report +the process and thread IDs associated with any released locks or +aborted transactions. The information is printed to a specified output +channel (see the DB_ENV->set_msgfile method for more information), or +passed to an application callback function (see the +DB_ENV->set_msgcall method for more information).

+

If DB_ENV->failchk determines a thread of control has exited such +that database environment recovery is required, it will return +DB_RUNRECOVERY. In this case, the application should not +continue to use the database environment. For a further description as +to the actions the application should take when this failure occurs, see +Handling failure in Data Store and +Concurrent Data Store applications, and +Handling failure in Transactional +Data Store applications.

+

The DB_ENV->failchk method may not be called before the DB_ENV->open method has +been called.

+

The DB_ENV->failchk method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
flags
The flags parameter is currently unused, and must be set to 0. +
+

Errors

+

The DB_ENV->failchk method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_fileid_reset.html b/db/docs/api_c/env_fileid_reset.html new file mode 100644 index 000000000..4d463aedd --- /dev/null +++ b/db/docs/api_c/env_fileid_reset.html @@ -0,0 +1,72 @@ + + + + + + +Berkeley DB: DB_ENV->fileid_reset + + + + + + + +
+

DB_ENV->fileid_reset

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->fileid_reset(DB_ENV *dbenv, const char *file, u_int32_t flags); +

+
+

Description: DB_ENV->fileid_reset

+

The DB_ENV->fileid_reset method allows database files to be copied, and +then the copy used in the same database environment as the original.

+

All databases contain an ID string used to identify the database in the +database environment cache. If a physical database file is copied, and +used in the same environment as another file with the same ID strings, +corruption can occur. The DB_ENV->fileid_reset method creates new ID +strings for all of the databases in the physical file.

+

The DB_ENV->fileid_reset method modifies the physical file, in-place. +Applications should not reset IDs in files that are currently in use.

+

The DB_ENV->fileid_reset method may be called at any time during the life of the +application.

+

The DB_ENV->fileid_reset method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
file
The name of the physical file in which new file IDs are to be created. +
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_ENCRYPT
The file contains encrypted databases. +
+
+

Errors

+

The DB_ENV->fileid_reset method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_list.html b/db/docs/api_c/env_list.html index 44d3996a5..e6ec0358c 100644 --- a/db/docs/api_c/env_list.html +++ b/db/docs/api_c/env_list.html @@ -1,5 +1,5 @@ - + @@ -10,16 +10,20 @@

Berkeley DB: Database Environments and Related Methods

- + + + + - + + @@ -35,16 +39,19 @@ + - + - + + +
Database Environment OperationsDescription
db_env_createCreate an environment handle
DB->get_envReturn DB's underlying DB_ENV handle
DB_ENV->closeClose an environment
DB_ENV->dbremoveRemove a database
DB_ENV->dbrenameRename a database
DB_ENV->err, DB_ENV->errxError message
DB_ENV->failchkCheck for thread failure
DB_ENV->fileid_resetReset database file IDs
DB_ENV->get_homeReturn environment's home directory
DB_ENV->get_open_flagsReturn the flags with which the environment was opened
DB_ENV->get_open_flagsReturn flags with which the environment was opened
DB_ENV->lsn_resetReset database file LSNs
DB_ENV->openOpen an environment
DB_ENV->removeRemove an environment
DB_ENV->stat_printEnvironment statistics
DB_ENV->set_errfile, DB_ENV->set_msgfileSet error and informational message FILE
DB_ENV->set_errpfxSet error message prefix
DB_ENV->set_event_notifySet event notification callback
DB_ENV->set_feedbackSet feedback callback
DB_ENV->set_flagsEnvironment configuration
DB_ENV->set_paniccallSet panic callback
DB_ENV->set_isaliveSet thread is-alive callback
DB_ENV->set_rpc_serverEstablish an RPC server connection
DB_ENV->set_shm_keySet system memory shared segment ID
DB_ENV->set_tas_spinsSet the number of test-and-set spins
DB_ENV->set_thread_idSet thread of control ID function
DB_ENV->set_thread_countSet approximate thread count
DB_ENV->set_thread_id_stringSet thread of control ID format function
DB_ENV->set_timeoutSet lock and transaction timeout
DB_ENV->set_tmp_dirSet the environment temporary file directory
DB_ENV->set_verboseSet verbose messages
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_lsn_reset.html b/db/docs/api_c/env_lsn_reset.html new file mode 100644 index 000000000..9ba115c25 --- /dev/null +++ b/db/docs/api_c/env_lsn_reset.html @@ -0,0 +1,78 @@ + + + + + + +Berkeley DB: DB_ENV->lsn_reset + + + + + + + +
+

DB_ENV->lsn_reset

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->lsn_reset(DB_ENV *dbenv, const char *file, u_int32_t flags); +

+
+

Description: DB_ENV->lsn_reset

+

The DB_ENV->lsn_reset method allows database files to be moved from one +transactional database environment to another.

+

Database pages in transactional database environments contain references +to the environment's log files (that is, log sequence numbers, or LSNs). +Copying or moving a database file from one database environment to +another, and then modifying it, can result in data corruption if the +LSNs are not first cleared.

+

Note that LSNs should be reset before moving or copying the database +file into a new database environment, rather than moving or copying the +database file and then resetting the LSNs. Berkeley DB has consistency checks +that may be triggered if an application calls DB_ENV->lsn_reset +on a database in a new environment when the database LSNs still reflect +the old environment.

+

The DB_ENV->lsn_reset method modifies the physical file, in-place. +Applications should not reset LSNs in files that are currently in use.

+

The DB_ENV->lsn_reset method may be called at any time during the life of the +application.

+

The DB_ENV->lsn_reset method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
file
The name of the physical file in which the LSNs are to be cleared. +
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_ENCRYPT
The file contains encrypted databases. +
+
+

Errors

+

The DB_ENV->lsn_reset method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_open.html b/db/docs/api_c/env_open.html index 3482118c1..9d09bd8ab 100644 --- a/db/docs/api_c/env_open.html +++ b/db/docs/api_c/env_open.html @@ -1,5 +1,5 @@ - - + + @@ -39,7 +39,7 @@ or more of the features of Berkeley DB.

The DB_ENV->open method returns a non-zero error value on failure and 0 on success. -If DB_ENV->open fails, the DB_ENV->close method should be called +If DB_ENV->open fails, the DB_ENV->close method must be called to discard the DB_ENV handle.

Parameters

@@ -50,8 +50,9 @@ resolution in general, see Berkeley DB File Naming. The environment variable DB_HOME may be used as the path of the database home, as described in Berkeley DB File Naming. -

On Windows, the db_home argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the db_home +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter specifies the subsystems that are initialized and how the application's environment affects Berkeley DB file naming, among other things. @@ -59,11 +60,20 @@ The flags parameter must be set to 0 or by bitwise inclusively OR' or more of the following values:

Because there are a large number of flags that can be specified, they have been grouped together by functionality. The first group of flags -indicates which of the Berkeley DB subsystems should be initialized:

+indicates which of the Berkeley DB subsystems should be initialized.

+

The choice of subsystems initialized for a Berkeley DB database environment +is specified by the thread of control initially creating the +environment. Any subsequent thread of control joining the environment +will automatically be configured to use the same subsystems as were +created in the environment (unless the thread of control requests a +subsystem not available in the environment, which will fail). +Applications joining an environment, able to adapt to whatever +subsystems have been configured in the environment, should open the +environment without specifying any subsystem flags. Applications +joining an environment, requiring specific subsystems from their +environments, should open the environment specifying those specific +subsystem flags.

-
DB_JOINENV
Join an existing environment. This option allows applications to -join an existing environment without knowing which Berkeley DB subsystems -the environment supports.
DB_INIT_CDB
Initialize locking for the Berkeley DB Concurrent Data Store product. In this mode, Berkeley DB provides multiple reader/single writer access. The only other subsystem that should be specified with the @@ -95,11 +105,14 @@ DB_INIT_TXN flag implies the DB_INIT_LOG flag. the environment is initialized:

DB_RECOVER
Run normal recovery on this environment before opening it for normal -use. If this flag is set, the DB_CREATE flag must also be set -because the regions will be removed and re-created. +use. If this flag is set, the DB_CREATE and DB_INIT_TXN +flags must also be set, because the regions will be removed and +re-created, and transactions are required for application recovery.
DB_RECOVER_FATAL
Run catastrophic recovery on this environment before opening it for -normal use. If this flag is set, the DB_CREATE flag must also -be set because the regions will be removed and re-created. +normal use. If this flag is set, the DB_CREATE and +DB_INIT_TXN flags must also be set, because the regions will be +removed and re-created, and transactions are required for application +recovery.

A standard part of the recovery process is to remove the existing Berkeley DB environment and create a new one in which to perform recovery. If the @@ -145,27 +158,45 @@ example, users with a user-ID of 0 on UNIX systems).

DB_CREATE
Cause Berkeley DB subsystems to create any underlying files, as necessary.
DB_LOCKDOWN
Lock shared Berkeley DB environment files and memory-mapped databases into memory. -
DB_PRIVATE
Specify that the environment will only be accessed by a single process -(although that process may be multithreaded). This flag has two effects -on the Berkeley DB environment. First, all underlying data structures are -allocated from per-process memory instead of from shared memory that is -potentially accessible to more than a single process. Second, mutexes -are only configured to work between threads. +
DB_PRIVATE
Allocate region memory from the heap instead of from memory backed by +the filesystem or system shared memory. +

This flag implies the environment will only be accessed by a single +process (although that process may be multithreaded). This flag has two +effects on the Berkeley DB environment. First, all underlying data structures +are allocated from per-process memory instead of from shared memory that +is accessible to more than a single process. Second, mutexes are only +configured to work between threads.

This flag should not be specified if more than a single process is accessing the environment because it is likely to cause database corruption and unpredictable behavior. For example, if both a server -application and the Berkeley DB utility db_stat are expected to access -the environment, the DB_PRIVATE flag should not be -specified.

-
DB_SYSTEM_MEM
Allocate memory from system shared memory instead of from memory backed -by the filesystem. See Shared Memory -Regions for more information. +application and Berkeley DB utilities (for example, db_archive, +db_checkpoint or db_stat) are expected to access the +environment, the DB_PRIVATE flag should not be specified.

+

See Shared Memory Regions for more +information.

+
DB_REGISTER
Check to see if recovery needs to be performed before opening the +database environment. (For this check to be accurate, all processes +using the environment must specify DB_REGISTER when opening the +environment.) If recovery needs to be performed for any reason +(including the initial use of the DB_REGISTER flag), and +DB_RECOVER is also specified, recovery will be performed and the +open will proceed normally. If recovery needs to be performed and +DB_RECOVER is not specified, DB_RUNRECOVERY will be +returned. If recovery does not need to be performed, the +DB_RECOVER flag will be ignored. See +Architecting Transactional Data Store +applications for more information. +
DB_SYSTEM_MEM
Allocate region memory from system shared memory instead of from heap +memory or memory backed by the filesystem. +

See Shared Memory Regions for more +information.

DB_THREAD
Cause the DB_ENV handle returned by DB_ENV->open to be free-threaded; that is, concurrently usable by multiple threads in the address space. The DB_THREAD flag should be specified -if the DB_ENV handle will be concurrently used by multiple -threads of control or if multiple DB handles, opened within the database -environment, will be used concurrently. +if the DB_ENV handle will be concurrently used by more than one +thread in the process, or if any DB handles opened in the scope +of the DB_ENV handle will be concurrently used by more than one +thread in the process.
mode
On Windows systems, the mode parameter is ignored.

On UNIX systems or in IEEE/ANSI Std 1003.1 (POSIX) environments, files created by Berkeley DB @@ -183,6 +214,10 @@ default mode of readable and writable by both owner and group.

The DB_ENV->open method may fail and return one of the following non-zero errors:

+
DB_RUNRECOVERY
The DB_REGISTER flag was specified, a failure has occurred, and no +recovery flag was specified. +
+
DB_VERSION_MISMATCH
The version of the Berkeley DB library doesn't match the version that created the database environment.
@@ -197,8 +232,12 @@ An incorrectly formatted NAME VALUE entry or line was found; or if an invalid flag value or parameter was specified.
-
ENOSPC
HP-UX only: a previously created Berkeley DB environment for this process still -exists. +
ENOSPC
HP-UX only: +Due to the constraints of the PA-RISC memory architecture, HP-UX does not +allow a process to map a file into its address space multiple times. +For this reason, each Berkeley DB environment may be opened only once by a +process on HP-UX; that is, calls to DB_ENV->open will fail if the +specified Berkeley DB environment has been opened and not subsequently closed.
ENOENT
The file or directory does not exist. @@ -231,6 +270,6 @@ open method flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_remove.html b/db/docs/api_c/env_remove.html index 82f79ca80..fbfcf3b27 100644 --- a/db/docs/api_c/env_remove.html +++ b/db/docs/api_c/env_remove.html @@ -1,5 +1,5 @@ - + @@ -73,8 +73,9 @@ and 0 on success.

Parameters

db_home
The db_home parameter names the database environment to be removed. -

On Windows, the db_home argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the db_home +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
@@ -115,6 +116,6 @@ may fail and return one of the following non-zero errors:


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_alloc.html b/db/docs/api_c/env_set_alloc.html index 99836916a..41d20f753 100644 --- a/db/docs/api_c/env_set_alloc.html +++ b/db/docs/api_c/env_set_alloc.html @@ -1,5 +1,5 @@ - + @@ -90,6 +90,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_app_dispatch.html b/db/docs/api_c/env_set_app_dispatch.html index a0fd8a3aa..1643eaac1 100644 --- a/db/docs/api_c/env_set_app_dispatch.html +++ b/db/docs/api_c/env_set_app_dispatch.html @@ -1,5 +1,5 @@ - + @@ -97,6 +97,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_cachesize.html b/db/docs/api_c/env_set_cachesize.html index 8d50a3188..60093c69a 100644 --- a/db/docs/api_c/env_set_cachesize.html +++ b/db/docs/api_c/env_set_cachesize.html @@ -1,5 +1,5 @@ - - + + @@ -40,21 +40,22 @@ pages accessed simultaneously, and is usually much larger.)

The default cache size is 256KB, and may not be specified as less than 20KB. Any cache size less than 500MB is automatically increased by 25% to account for buffer pool overhead; cache sizes larger than 500MB are -used as specified. The current maximum size of a single cache is 4GB. -(All sizes are in powers-of-two, that is, 256KB is 2^18 not 256,000.) -For information on tuning the Berkeley DB cache size, see -Selecting a cache size.

-

It is possible to specify caches to Berkeley DB larger than 4GB and/or large -enough they cannot be allocated contiguously on some architectures. For -example, some releases of Solaris limit the amount of memory that may -be allocated contiguously by a process. If ncache is 0 or 1, -the cache will be allocated contiguously in memory. If it is greater -than 1, the cache will be broken up into ncache equally sized, -separate pieces of memory.

-

The database environment's cache size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_cachesize", one or more whitespace characters, -and the cache size specified in three parts: the gigabytes of cache, the +used as specified. The maximum size of a single cache is 4GB on 32-bit +systems and 10TB on 64-bit systems. (All sizes are in powers-of-two, +that is, 256KB is 2^18 not 256,000.) For information on tuning the Berkeley DB +cache size, see Selecting a +cache size.

+

It is possible to specify caches to Berkeley DB large enough they cannot be +allocated contiguously on some architectures. For example, some +releases of Solaris limit the amount of memory that may be allocated +contiguously by a process. If ncache is 0 or 1, the cache will +be allocated contiguously in memory. If it is greater than 1, the cache +will be broken up into ncache equally sized, separate pieces of +memory.

+

The database environment's cache size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_cachesize", one or more whitespace +characters, and the cache size specified in three parts: the gigabytes of cache, the additional bytes of cache, and the number of caches, also separated by whitespace characters. For example, "set_cachesize 2 524288000 3" would create a 2.5GB logical cache, split between three physical caches. @@ -102,11 +103,11 @@ and 0 on success.

Parameters

bytesp
The bytesp parameter references memory into which - the additional bytes of memory in the cache is copied. + the additional bytes of memory in the cache is copied.
gbytesp
The gbytesp parameter references memory into which - the gigabytes of memory in the cache is copied. + the gigabytes of memory in the cache is copied.
ncachep
The ncachep parameter references memory into which - the number of caches is copied. + the number of caches is copied.

Class

@@ -117,6 +118,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_data_dir.html b/db/docs/api_c/env_set_data_dir.html index 8048f43c3..3de0dc2cd 100644 --- a/db/docs/api_c/env_set_data_dir.html +++ b/db/docs/api_c/env_set_data_dir.html @@ -1,5 +1,5 @@ - + @@ -41,10 +41,10 @@ path specified.

either by absolute paths or relative to the environment home directory. See Berkeley DB File Naming for more information.

-

The database environment's data directories may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_data_dir", one or more whitespace characters, -and the directory name. +

The database environment's data directories may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_data_dir", one or more whitespace +characters, and the directory name.

The DB_ENV->set_data_dir method configures operations performed using the specified DB_ENV handle, not all operations performed on the underlying @@ -63,8 +63,9 @@ and 0 on success.

dir
The dir parameter is a directory to be used as a location for database files. -

On Windows, the dir argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the dir +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

Errors

The DB_ENV->set_data_dir method @@ -96,6 +97,6 @@ NULL-terminated array of directories in dirpp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_encrypt.html b/db/docs/api_c/env_set_encrypt.html index 7f3f8ff31..ff7e63170 100644 --- a/db/docs/api_c/env_set_encrypt.html +++ b/db/docs/api_c/env_set_encrypt.html @@ -1,5 +1,5 @@ - + @@ -92,6 +92,6 @@ encryption flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_errcall.html b/db/docs/api_c/env_set_errcall.html index 7b6f57b48..776359f91 100644 --- a/db/docs/api_c/env_set_errcall.html +++ b/db/docs/api_c/env_set_errcall.html @@ -1,5 +1,5 @@ - - + + @@ -45,6 +45,9 @@ a C library FILE *.

This error-logging enhancement does not slow performance or significantly increase application size, and may be run during normal operation as well as during application debugging.

+

The DB_ENV->set_errcall method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

The DB_ENV->set_errcall method may be called at any time during the life of the application.

Parameters

@@ -57,6 +60,10 @@ reporting function. The function takes three parameters: DB->set_errpfx or DB_ENV->set_errpfx).
msg
The msg parameter is the error message string.
+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -67,6 +74,6 @@ reporting function. The function takes three parameters:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_errfile.html b/db/docs/api_c/env_set_errfile.html index cbcd57649..4336b62de 100644 --- a/db/docs/api_c/env_set_errfile.html +++ b/db/docs/api_c/env_set_errfile.html @@ -1,5 +1,5 @@ - - + + @@ -47,6 +47,9 @@ a trailing <newline> character.

This error logging enhancement does not slow performance or significantly increase application size, and may be run during normal operation as well as during application debugging.

+

The DB_ENV->set_errfile method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

The DB_ENV->set_errfile method may be called at any time during the life of the application.

Parameters

@@ -56,9 +59,18 @@ displaying additional Berkeley DB error information.

Description: DB_ENV->get_errfile

-

The DB_ENV->get_errfile method returns the .

+

The DB_ENV->get_errfile method returns the FILE *.

The DB_ENV->get_errfile method may be called at any time during the life of the application.

+

The DB_ENV->get_errfile method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
errfilep
The DB_ENV->get_errfile method returns the +FILE * in errfilep. +

Class

DB_ENV @@ -68,6 +80,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_errpfx.html b/db/docs/api_c/env_set_errpfx.html index 971b17a49..8da220984 100644 --- a/db/docs/api_c/env_set_errpfx.html +++ b/db/docs/api_c/env_set_errpfx.html @@ -1,5 +1,5 @@ - - + + @@ -37,6 +37,9 @@ maintain a reference to it. Although this allows applications to modify the error message prefix at any time (without repeatedly calling the interfaces), it means the memory must be maintained until the handle is closed.

+

The DB_ENV->set_errpfx method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

The DB_ENV->set_errpfx method may be called at any time during the life of the application.

Parameters

@@ -67,6 +70,6 @@ error prefix in errpfxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_feedback.html b/db/docs/api_c/env_set_feedback.html index 22d5094e1..5ae94d5c6 100644 --- a/db/docs/api_c/env_set_feedback.html +++ b/db/docs/api_c/env_set_feedback.html @@ -1,5 +1,5 @@ - - + + @@ -59,6 +59,10 @@ parameter may take on any of the following values:

percent
The percent parameter is the percent of the operation that has been completed, specified as an integer value between 0 and 100. +

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -69,6 +73,6 @@ been completed, specified as an integer value between 0 and 100.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_flags.html b/db/docs/api_c/env_set_flags.html index 2ec68ced4..c18435a1a 100644 --- a/db/docs/api_c/env_set_flags.html +++ b/db/docs/api_c/env_set_flags.html @@ -1,5 +1,5 @@ - + @@ -31,10 +31,10 @@ DB_ENV->get_flags(DB_ENV *dbenv, u_int32_t *flagsp);


Description: DB_ENV->set_flags

Configure a database environment.

-

The database environment's flag values may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_flags", one or more whitespace characters, -and the method flag parameter as a string; for example, "set_flags +

The database environment's flag values may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_flags", one or more whitespace +characters, and the method flag parameter as a string; for example, "set_flags DB_TXN_NOSYNC". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done @@ -48,11 +48,9 @@ and 0 on success.

flags
The flags parameter must be set by bitwise inclusively OR'ing together one or more of the following values:
-
DB_AUTO_COMMIT
If set, operations for which no explicit transaction handle was -specified, and which modify databases in the database environment, will -be automatically enclosed within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. +
DB_AUTO_COMMIT
If set, DB handle operations for which no explicit transaction +handle was specified, and which modify databases in the database +environment, will be automatically enclosed within a transaction.

Calling DB_ENV->set_flags with the DB_AUTO_COMMIT flag only affects the specified DB_ENV handle (and any other Berkeley DB handles opened within the scope of that handle). @@ -97,15 +95,37 @@ file.

The DB_DIRECT_LOG flag may be used to configure Berkeley DB at any time during the life of the application.

+
DB_DSYNC_DB
Configure Berkeley DB to flush database writes to the backing disk before +returning from the write system call, rather than flushing database +writes explicitly in a separate system call, as necessary. This is only +available on some systems (for example, systems supporting the +IEEE/ANSI Std 1003.1 (POSIX) standard O_DSYNC flag, or systems supporting the Windows +FILE_FLAG_WRITE_THROUGH flag). This flag may result in inaccurate file +modification times and other file-level information for Berkeley DB database +files. This flag will almost certainly result in a performance decrease +on most systems. This flag is only applicable to certain filesysystem +(for example, the Veritas VxFS filesystem), where the filesystem's +support for trickling writes back to stable storage behaves badly (or +more likely, has been misconfigured). +

Calling DB_ENV->set_flags with the DB_DSYNC_DB flag only affects +the specified DB_ENV handle (and any other Berkeley DB handles opened +within the scope of that handle). +For consistent behavior across the environment, all DB_ENV +handles opened in the environment must either set the DB_DSYNC_DB flag +or the flag should be specified in the DB_CONFIG configuration +file.

+

The DB_DSYNC_DB flag may be used to configure Berkeley DB at any time during +the life of the application.

+
DB_DSYNC_LOG
Configure Berkeley DB to flush log writes to the backing disk before returning from the write system call, rather than flushing log writes explicitly -in a separate system call. This is only available on some systems (for -example, systems supporting the IEEE/ANSI Std 1003.1 (POSIX) standard O_DSYNC flag, -or systems supporting the Win32 FILE_FLAG_WRITE_THROUGH flag). This -configuration may result in inaccurate file modification times and other -file-level information for Berkeley DB log files. This configuration may -offer a performance increase on some systems and a performance decrease -on others. +in a separate system call, as necessary. This is only available on some +systems (for example, systems supporting the IEEE/ANSI Std 1003.1 (POSIX) standard +O_DSYNC flag, or systems supporting the Windows FILE_FLAG_WRITE_THROUGH +flag). This flag may result in inaccurate file modification times and +other file-level information for Berkeley DB log files. This flag may offer +a performance increase on some systems and a performance decrease on +others.

Calling DB_ENV->set_flags with the DB_DSYNC_LOG flag only affects the specified DB_ENV handle (and any other Berkeley DB handles opened within the scope of that handle). @@ -115,7 +135,7 @@ or the flag should be specified in the DB_CONFIG configuration file.

The DB_DSYNC_LOG flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_LOG_AUTOREMOVE
If set, Berkeley DB will automatically remove log files that are no longer needed. Automatic log file removal is likely to make catastrophic recovery impossible. @@ -124,7 +144,7 @@ database environment, including all threads of control accessing the database environment.

The DB_LOG_AUTOREMOVE flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_LOG_INMEMORY
If set, maintain transaction logs in memory rather than on disk. This means that transactions exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database @@ -145,7 +165,7 @@ database environment, including all threads of control accessing the database environment.

The DB_LOG_INMEMORY flag may be used to configure Berkeley DB only before the DB_ENV->open method is called.

- +
DB_NOLOCKING
If set, Berkeley DB will grant all requested mutual exclusion mutexes and database locks without regard for their actual availability. This functionality should never be used for purposes other than debugging. @@ -155,7 +175,20 @@ within the scope of that handle).

The DB_NOLOCKING flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_MULTIVERSION
If set, all databases in the environment will be opened as if +DB_MULTIVERSION is passed to DB->open. This flag will +be ignored for queue databases for which DB_MULTIVERSION is not +supported. +

Calling DB_ENV->set_flags with the DB_MULTIVERSION flag only affects +the specified DB_ENV handle (and any other Berkeley DB handles opened +within the scope of that handle). +For consistent behavior across the environment, all DB_ENV +handles opened in the environment must either set the DB_MULTIVERSION flag +or the flag should be specified in the DB_CONFIG configuration +file.

+

The DB_MULTIVERSION flag may be used to configure Berkeley DB at any time during +the life of the application.

+
DB_NOMMAP
If set, Berkeley DB will copy read-only database files into the local cache instead of potentially mapping them into process memory (see the description of the DB_ENV->set_mp_mmapsize method for further @@ -169,7 +202,7 @@ or the flag should be specified in the DB_CONFIG configuration file.

The DB_NOMMAP flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_NOPANIC
If set, Berkeley DB will ignore any panic state in the database environment. (Database environments in a panic state normally refuse all attempts to call Berkeley DB functions, returning DB_RUNRECOVERY.) This @@ -192,7 +225,7 @@ within the scope of that handle).

The DB_OVERWRITE flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_PANIC_ENVIRONMENT
If set, Berkeley DB will set the panic state for the database environment. (Database environments in a panic state normally refuse all attempts to call Berkeley DB functions, returning DB_RUNRECOVERY.) This flag may @@ -204,7 +237,7 @@ database environment, including all threads of control accessing the database environment.

The DB_PANIC_ENVIRONMENT flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_REGION_INIT
In some applications, the expense of page-faulting the underlying shared memory regions can affect performance. (For example, if the page-fault occurs while holding a lock, other lock requests can convoy, and overall @@ -237,7 +270,7 @@ or the flag should be specified in the DB_CONFIG configuration file.

The DB_TIME_NOTGRANTED flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_TXN_NOSYNC
If set, Berkeley DB will not write or synchronously flush the log on transaction commit. This means that transactions exhibit the ACI (atomicity, consistency, @@ -256,7 +289,20 @@ handles opened in the environment must either set the DB_TXN_NOSYNC flag or the flag should be specified in the DB_CONFIG configuration file.

The DB_TXN_NOSYNC flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_TXN_SNAPSHOT
If set, all transactions in the environment will be started as if +DB_TXN_SNAPSHOT were passed to DB_ENV->txn_begin, and all +non-transactional cursors will be opened as if DB_TXN_SNAPSHOT +were passed to DB->cursor. +

Calling DB_ENV->set_flags with the DB_TXN_SNAPSHOT flag only affects +the specified DB_ENV handle (and any other Berkeley DB handles opened +within the scope of that handle). +For consistent behavior across the environment, all DB_ENV +handles opened in the environment must either set the DB_TXN_SNAPSHOT flag +or the flag should be specified in the DB_CONFIG configuration +file.

+

The DB_TXN_SNAPSHOT flag may be used to configure Berkeley DB at any time during +the life of the application.

+
DB_TXN_WRITE_NOSYNC
If set, Berkeley DB will write, but will not synchronously flush, the log on transaction commit. This means that transactions exhibit the ACI (atomicity, consistency, @@ -275,7 +321,7 @@ or the flag should be specified in the DB_CONFIG configuration file.

The DB_TXN_WRITE_NOSYNC flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_YIELDCPU
If set, Berkeley DB will yield the processor immediately after each page or mutex acquisition. This functionality should never be used for purposes other than stress testing. @@ -322,6 +368,6 @@ configuration flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_isalive.html b/db/docs/api_c/env_set_isalive.html new file mode 100644 index 000000000..72e5ea44a --- /dev/null +++ b/db/docs/api_c/env_set_isalive.html @@ -0,0 +1,83 @@ + + + + + + +Berkeley DB: DB_ENV->set_isalive + + + + + + + +
+

DB_ENV->set_isalive

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->set_isalive(DB_ENV *dbenv, + int (*is_alive)(DB_ENV *dbenv, pid_t pid, db_threadid_t tid, u_int32_t flags)); +

+
+

Description: DB_ENV->set_isalive

+

Declare a function that returns if a thread of control (either a true +thread or a process) is still running. The DB_ENV->set_isalive method +supports the DB_ENV->failchk method. For more information, see +Architecting Data Store and Concurrent +Data Store applications, and Architecting Transactional Data Store applications.

+

The DB_ENV->set_isalive method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

+

The DB_ENV->set_isalive method may be called at any time during the life of the +application.

+

The DB_ENV->set_isalive method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
is_alive
The is_alive parameter is a function which returns non-zero if +the thread of control, identified by the pid and tid +arguments, is still running. The function takes four arguments: +
+
dbenv
The dbenv parameter is the enclosing database environment +handle, allowing application access to the application-private fields +of that object. +
pid
The pid parameter is a process ID returned by the function +specified to the DB_ENV->set_thread_id method. +
tid
The tid parameter is a thread ID returned by the function +specified to the DB_ENV->set_thread_id method. +
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_MUTEX_PROCESS_ONLY
Return only if the process is alive, the thread ID should be ignored. +
+
+
+

Errors

+

The DB_ENV->set_isalive method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_set_lg_bsize.html b/db/docs/api_c/env_set_lg_bsize.html index 7d2f08b35..39d0d3bc6 100644 --- a/db/docs/api_c/env_set_lg_bsize.html +++ b/db/docs/api_c/env_set_lg_bsize.html @@ -1,5 +1,5 @@ - - + + @@ -32,11 +32,12 @@ DB_ENV->get_lg_bsize(DB_ENV *dbenv, u_int32_t *lg_bsizep);

Description: DB_ENV->set_lg_bsize

Set the size of the in-memory log buffer, in bytes.

When the logging subsystem is configured for on-disk logging, the -default size of the in-memory log buffer is 32KB. Log information is -stored in-memory until the storage space fills up or transaction commit -forces the information to be flushed to stable storage. In the presence -of long-running transactions or transactions producing large amounts of -data, larger buffer sizes can increase throughput.

+default size of the in-memory log buffer is approximately 32KB. Log +information is stored in-memory until the storage space fills up or +transaction commit forces the information to be flushed to stable +storage. In the presence of long-running transactions or transactions +producing large amounts of data, larger buffer sizes can increase +throughput.

When the logging subsystem is configured for in-memory logging, the default size of the in-memory log buffer is 1MB. Log information is stored in-memory until the storage space fills up or transaction abort @@ -49,10 +50,10 @@ should ensure the in-memory log buffer size is large enough that no transaction will ever span the entire buffer, and avoid a state where the in-memory buffer is full and no space can be freed because a transaction that started in the first log "file" is still active.

-

The database environment's log buffer size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lg_bsize", one or more whitespace characters, -and the size in bytes. +

The database environment's log buffer size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_bsize", one or more whitespace +characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -103,6 +104,6 @@ size of the log buffer, in bytes in lg_bsizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_lg_dir.html b/db/docs/api_c/env_set_lg_dir.html index 39f47e6b0..03113b545 100644 --- a/db/docs/api_c/env_set_lg_dir.html +++ b/db/docs/api_c/env_set_lg_dir.html @@ -1,5 +1,5 @@ - + @@ -38,10 +38,10 @@ environment home directory. See Berkeley DB F

For the greatest degree of recoverability from system or application failure, database files and log files should be located on separate physical devices.

-

The database environment's logging directory may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lg_dir", one or more whitespace characters, -and the directory name. +

The database environment's logging directory may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_dir", one or more whitespace +characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -61,8 +61,9 @@ and 0 on success.

Parameters

dir
The dir parameter is the directory used to store the logging files. -

On Windows, the dir argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the dir +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

Errors

The DB_ENV->set_lg_dir method @@ -94,6 +95,6 @@ log directory in dirp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_lg_max.html b/db/docs/api_c/env_set_lg_max.html index 7a40ed80c..aff55f831 100644 --- a/db/docs/api_c/env_set_lg_max.html +++ b/db/docs/api_c/env_set_lg_max.html @@ -1,5 +1,5 @@ - + @@ -49,10 +49,10 @@ the in-memory buffer is full and no space can be freed because a transaction that started in the first log "file" is still active.

See Log File Limits for more information.

-

The database environment's log file size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lg_max", one or more whitespace characters, -and the size in bytes. +

The database environment's log file size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_max", one or more whitespace +characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -104,6 +104,6 @@ maximum log file size in lg_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_lg_mode.html b/db/docs/api_c/env_set_lg_mode.html new file mode 100644 index 000000000..63b54011e --- /dev/null +++ b/db/docs/api_c/env_set_lg_mode.html @@ -0,0 +1,89 @@ + + + + + + +Berkeley DB: DB_ENV->set_lg_filemode + + + + + + + +
+

DB_ENV->set_lg_filemode

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->set_lg_filemode(DB_ENV *dbenv, int lg_mode); +

+int +DB_ENV->get_lg_filemode(DB_ENV *dbenv, int *lg_modep); +

+
+

Description: DB_ENV->set_lg_filemode

+

Set the absolute file mode for created log files. This method is +only useful for the rare Berkeley DB application that does not +control its umask value.

+

Normally, if Berkeley DB applications set their umask appropriately, all +processes in the application suite will have read permission on the log +files created by any process in the application suite. However, if the +Berkeley DB application is a library, a process using the library might set +its umask to a value preventing other processes in the application suite +from reading the log files it creates. In this rare case, the +DB_ENV->set_lg_filemode method can be used to set the mode of created +log files to an absolute value.

+

The database environment's log file mode may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_filemode", one or more whitespace +characters, and the absolute mode of created log files. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DB_ENV->set_lg_filemode method configures a database environment, not only operations +performed using the specified DB_ENV handle.

+

The DB_ENV->set_lg_filemode method may be called at any time during the life of the +application.

+

The DB_ENV->set_lg_filemode method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
lg_filemode
The lg_filemode parameter is the absolute mode of the created +log file. +
+
+

Description: DB_ENV->set_lg_filemode

+

The DB_ENV->set_lg_filemode method returns the log file mode.

+

The DB_ENV->set_lg_filemode method may be called at any time during the life of the +application.

+

The DB_ENV->set_lg_filemode method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
lg_modep
The DB_ENV->set_lg_filemode method returns the +log file mode in lg_modep. +
+
+

Class

+DB_ENV, DB_LOGC, DB_LSN +

See Also

+Logging Subsystem and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_set_lg_regionmax.html b/db/docs/api_c/env_set_lg_regionmax.html index 2be4c021a..be05ff5b0 100644 --- a/db/docs/api_c/env_set_lg_regionmax.html +++ b/db/docs/api_c/env_set_lg_regionmax.html @@ -1,5 +1,5 @@ - - + + @@ -32,13 +32,14 @@ DB_ENV->get_lg_regionmax(DB_ENV *dbenv, u_int32_t *lg_regionmaxp);

Description: DB_ENV->set_lg_regionmax

Set the size of the underlying logging area of the Berkeley DB environment, in bytes. By default, or if the value is set to 0, the default size is -60KB. The log region is used to store filenames, and so may need to be -increased in size if a large number of files will be opened and -registered with the specified Berkeley DB environment's log manager.

-

The database environment's log region size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lg_regionmax", one or more whitespace characters, -and the size in bytes. +approximately 60KB. The log region is used to store filenames, and so +may need to be increased in size if a large number of files will be +opened and registered with the specified Berkeley DB environment's log +manager.

+

The database environment's log region size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_regionmax", one or more whitespace +characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -89,6 +90,6 @@ size of the underlying logging subsystem region in lg_regionmaxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_lk_conflicts.html b/db/docs/api_c/env_set_lk_conflicts.html index 8cf77d30f..9bc2658ec 100644 --- a/db/docs/api_c/env_set_lk_conflicts.html +++ b/db/docs/api_c/env_set_lk_conflicts.html @@ -1,5 +1,5 @@ - + @@ -80,9 +80,9 @@ and 0 on success.

Parameters

lk_conflictsp
The lk_conflictsp parameter references memory into which -a pointer to the current conflicts array is copied. +a pointer to the current conflicts array is copied.
lk_modesp
The lk_modesp parameter references memory into which - the size of the current conflicts array is copied. + the size of the current conflicts array is copied.

Class

@@ -93,6 +93,6 @@ a pointer to the current conflicts array is copied.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_lk_detect.html b/db/docs/api_c/env_set_lk_detect.html index cf88ff2c4..4eb1375ca 100644 --- a/db/docs/api_c/env_set_lk_detect.html +++ b/db/docs/api_c/env_set_lk_detect.html @@ -1,5 +1,5 @@ - - + + @@ -35,19 +35,18 @@ occurs, and specify what lock request(s) should be rejected. As transactions acquire locks on behalf of a single locker ID, rejecting a lock request associated with a transaction normally requires the transaction be aborted.

-

The database environment's deadlock detector configuration may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lk_detect", one or more whitespace characters, -and the method detect parameter as a string; for example, +

The database environment's deadlock detector configuration may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lk_detect", one or more whitespace +characters, and the method detect parameter as a string; for example, "set_lk_detect DB_LOCK_OLDEST". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

The DB_ENV->set_lk_detect method configures a database environment, not only operations performed using the specified DB_ENV handle.

-

Although the DB_ENV->set_lk_detect method may be called at any time during the life of -the application, it should normally be called before making calls to the -db_env_create or db_create methods.

+

The DB_ENV->set_lk_detect method may be called at any time during the life of the +application.

The DB_ENV->set_lk_detect method returns a non-zero error value on failure and 0 on success. @@ -75,7 +74,7 @@ is performed.

The DB_ENV->set_lk_detect method may fail and return one of the following non-zero errors:

-
EINVAL
If the method was called after DB_ENV->open was called; or if an +
EINVAL
An invalid flag value or parameter was specified.

@@ -101,6 +100,6 @@ deadlock detector configuration in lk_detectp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_lk_max_lockers.html b/db/docs/api_c/env_set_lk_max_lockers.html index 4f16a8a4b..454faee43 100644 --- a/db/docs/api_c/env_set_lk_max_lockers.html +++ b/db/docs/api_c/env_set_lk_max_lockers.html @@ -1,5 +1,5 @@ - + @@ -35,10 +35,10 @@ environment. This value is used by DB_ENV-> much space to allocate for various lock-table data structures. The default value is 1000 lockers. For specific information on configuring the size of the lock subsystem, see Configuring locking: sizing the system.

-

The database environment's maximum number of lockers may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lk_max_lockers", one or more whitespace characters, -and the number of lockers. +

The database environment's maximum number of lockers may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lk_max_lockers", one or more whitespace +characters, and the number of lockers. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -89,6 +89,6 @@ maximum number of lockers in lk_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_lk_max_locks.html b/db/docs/api_c/env_set_lk_max_locks.html index cfc8fb63d..89278f8ad 100644 --- a/db/docs/api_c/env_set_lk_max_locks.html +++ b/db/docs/api_c/env_set_lk_max_locks.html @@ -1,5 +1,5 @@ - + @@ -36,10 +36,10 @@ allocate for various lock-table data structures. The default value is 1000 locks. For specific information on configuring the size of the lock subsystem, see Configuring locking: sizing the system.

-

The database environment's maximum number of locks may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lk_max_locks", one or more whitespace characters, -and the number of locks. +

The database environment's maximum number of locks may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lk_max_locks", one or more whitespace +characters, and the number of locks. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -90,6 +90,6 @@ maximum number of locks in lk_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_lk_max_objects.html b/db/docs/api_c/env_set_lk_max_objects.html index ffa1dc06a..81985ea97 100644 --- a/db/docs/api_c/env_set_lk_max_objects.html +++ b/db/docs/api_c/env_set_lk_max_objects.html @@ -1,5 +1,5 @@ - + @@ -35,10 +35,10 @@ environment. This value is used by DB_ENV-> much space to allocate for various lock-table data structures. The default value is 1000 objects. For specific information on configuring the size of the lock subsystem, see Configuring locking: sizing the system.

-

The database environment's maximum number of objects may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lk_max_objects", one or more whitespace characters, -and the number of objects. +

The database environment's maximum number of objects may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lk_max_objects", one or more whitespace +characters, and the number of objects. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -89,6 +89,6 @@ maximum number of locked objects in lk_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_mp_mmapsize.html b/db/docs/api_c/env_set_mp_mmapsize.html index 40e9d226d..754b9b1f6 100644 --- a/db/docs/api_c/env_set_mp_mmapsize.html +++ b/db/docs/api_c/env_set_mp_mmapsize.html @@ -1,5 +1,5 @@ - + @@ -41,10 +41,10 @@ in immense process sizes in the presence of large databases.

The DB_ENV->get_mp_mmapsize method sets the maximum file size, in bytes, for a file to be mapped into the process address space. If no value is specified, it defaults to 10MB.

-

The database environment's maximum mapped file size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_mp_mmapsize", one or more whitespace characters, -and the size in bytes. +

The database environment's maximum mapped file size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_mp_mmapsize", one or more whitespace +characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -91,6 +91,6 @@ maximum file map size in mp_mmapsizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_msgcall.html b/db/docs/api_c/env_set_msgcall.html index b18c34acc..0eaa2494b 100644 --- a/db/docs/api_c/env_set_msgcall.html +++ b/db/docs/api_c/env_set_msgcall.html @@ -1,5 +1,5 @@ - - + + @@ -40,6 +40,9 @@ manner.

Setting db_msgcall_fcn to NULL unconfigures the callback interface.

Alternatively, you can use the DB->set_msgfile or DB_ENV->set_msgfile methods to display the messages via a C library FILE *.

+

The DB_ENV->set_msgcall method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

The DB_ENV->set_msgcall method may be called at any time during the life of the application.

Parameters

@@ -50,6 +53,10 @@ reporting function. The function takes two parameters:
dbenv
The dbenv parameter is the enclosing database environment.
msg
The msg parameter is the message string.
+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -60,6 +67,6 @@ reporting function. The function takes two parameters:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_msgfile.html b/db/docs/api_c/env_set_msgfile.html index 7d1869444..27d6dcfdb 100644 --- a/db/docs/api_c/env_set_msgfile.html +++ b/db/docs/api_c/env_set_msgfile.html @@ -1,5 +1,5 @@ - - + + @@ -42,6 +42,9 @@ character.

Alternatively, you can use the DB_ENV->set_msgcall or DB->set_msgcall methods to capture the additional error information in a way that does not use C library FILE *'s.

+

The DB_ENV->set_msgfile method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

The DB_ENV->set_msgfile method may be called at any time during the life of the application.

Parameters

@@ -51,9 +54,18 @@ displaying messages.

Description: DB_ENV->get_msgfile

-

The DB_ENV->get_msgfile method returns the .

+

The DB_ENV->get_msgfile method returns the FILE *.

The DB_ENV->get_msgfile method may be called at any time during the life of the application.

+

The DB_ENV->get_msgfile method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
msgfilep
The DB_ENV->get_msgfile method returns the +FILE * in msgfilep. +

Class

DB_ENV @@ -63,6 +75,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_rpc_server.html b/db/docs/api_c/env_set_rpc_server.html index aef190ccb..4ad810599 100644 --- a/db/docs/api_c/env_set_rpc_server.html +++ b/db/docs/api_c/env_set_rpc_server.html @@ -1,5 +1,5 @@ - + @@ -82,6 +82,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_shm_key.html b/db/docs/api_c/env_set_shm_key.html index 63093c12e..cfb852b3a 100644 --- a/db/docs/api_c/env_set_shm_key.html +++ b/db/docs/api_c/env_set_shm_key.html @@ -1,5 +1,5 @@ - + @@ -52,10 +52,10 @@ the same segment IDs when creating different Berkeley DB environments. In addition, by using the same segment IDs each time the environment is created, previously created segments will be removed, and the set of segments on the system will not grow without bound.

-

The database environment's base segment ID may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_shm_key", one or more whitespace characters, -and the ID. +

The database environment's base segment ID may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_shm_key", one or more whitespace +characters, and the ID. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -107,6 +107,6 @@ base segment ID in shm_keyp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_thread_count.html b/db/docs/api_c/env_set_thread_count.html new file mode 100644 index 000000000..2f612f208 --- /dev/null +++ b/db/docs/api_c/env_set_thread_count.html @@ -0,0 +1,93 @@ + + + + + + +Berkeley DB: DB_ENV->set_thread_count + + + + + + + +
+

DB_ENV->set_thread_count

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->set_thread_count(DB_ENV *dbenv, u_int32_t count); +

+int +DB_ENV->get_thread_count(DB_ENV *dbenv, u_int32_t *countp); +

+
+

Description: DB_ENV->set_thread_count

+

Declare an approximate number of threads in the database environment. +The DB_ENV->set_thread_count method must be called prior to opening the +database environment if the DB_ENV->failchk method will be used. The +DB_ENV->set_thread_count method does not set the maximum number of +threads but is used to determine memory sizing and the thread control +block reclamation policy.

+

The database environment's thread count may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_thread_count", one or more whitespace +characters, and the thread count. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DB_ENV->set_thread_count method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

+

The DB_ENV->set_thread_count method may not be called after the DB_ENV->open method is +called. +

+

The DB_ENV->set_thread_count method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
count
The count parameter is an approximate thread count for the +database environment. +
+

Errors

+

The DB_ENV->set_thread_count method +may fail and return one of the following non-zero errors:

+
+
EINVAL
If the method was called after DB_ENV->open was called; or if an +invalid flag value or parameter was specified. +
+
+

Description: DB_ENV->get_thread_count

+

The DB_ENV->get_thread_count method returns the thread count.

+

The DB_ENV->get_thread_count method may be called at any time during the life of the +application.

+

The DB_ENV->get_thread_count method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
countp
The DB_ENV->get_thread_count method returns the +thread count in countp. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_set_thread_id.html b/db/docs/api_c/env_set_thread_id.html new file mode 100644 index 000000000..61f897353 --- /dev/null +++ b/db/docs/api_c/env_set_thread_id.html @@ -0,0 +1,123 @@ + + + + + + +Berkeley DB: DB_ENV->set_thread_id + + + + + + + +
+

DB_ENV->set_thread_id

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->set_thread_id(DB_ENV *dbenv, + void (*thread_id)(DB_ENV *dbenv, pid_t *pid, db_threadid_t *tid)); +

+
+

Description: DB_ENV->set_thread_id

+

Declare a function that returns a unique identifier pair for the current +thread of control. The DB_ENV->set_thread_id method supports the +DB_ENV->failchk method. For more information, see +Architecting Data Store and Concurrent +Data Store applications, and Architecting Transactional Data Store applications.

+

The DB_ENV->set_thread_id method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

+

The DB_ENV->set_thread_id method may be called at any time during the life of the +application.

+

The DB_ENV->set_thread_id method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
thread_id
The thread_id parameter is a function which returns a unique +identifier pair for a thread of control in a Berkeley DB application. The +function takes three arguments: +
+
dbenv
The dbenv parameter is the enclosing database environment +handle, allowing application access to the application-private fields +of that object. +
pid
The pid points to a memory location of type pid_t. The +process ID of the current thread of control may be returned in +this memory location. +
tid
The tid points to a memory location of type db_threadid_t. The +thread ID of the current thread of control may be returned in this +memory location. +
+
+

The standard system library calls to return process and thread IDs are +often sufficient for this purpose (for example, getpid() and +pthread_self() on POSIX systems or GetCurrentThreadID on Windows +systems). However, if the Berkeley DB application dynamically creates +processes or threads, some care may be necessary in assigning unique +IDs. In most threading systems, process and thread IDs are available +for re-use as soon as the process or thread exits. If a new process or +thread is created between the time of process or thread exit, and the +DB_ENV->failchk method is run, it may be possible for +DB_ENV->failchk to not detect that a thread of control exited +without properly releasing all Berkeley DB resources.

+

It may be possible to handle this problem by inhibiting process or +thread creation between thread of control exit and calling +DB_ENV->failchk. Alternatively, the thread_id function +must be constructed to not re-use pid/tid pairs. For +example, in a single process application, the returned process ID might +be used as an incremental counter, with the returned thread ID set to +the actual thread ID. Obviously, the is_alive function +specified to the DB_ENV->set_isalive method must be compatible with any +thread_id function specified to DB_ENV->set_thread_id.

+

The db_threadid_t type is configured to be the same type as a standard +thread identifier, in Berkeley DB configurations where this type is known (for +example, systems supporting pthread_t or thread_t, or DWORD on Windows). +If the Berkeley DB configuration process is unable to determine the type of a +standard thread identifier, the db_thread_t type is set to uintmax_t (or +the largest available unsigned integral type, on systems lacking the +uintmax_t type). Applications running on systems lacking a detectable +standard thread type, and which are also using thread APIs where a +thread identifier is not an integral value and so will not fit into the +configured db_threadid_t type, must either translate between the +db_threadid_t type and the thread identifier (mapping the thread +identifier to a unique identifier of the appropriate size), or modify +the Berkeley DB sources to use an appropriate db_threadid_t type. Note: we +do not currently know of any systems where this is necessary. If your +application has to solve this problem, please contact our support group +and let us know.

+

If no thread_id function is specified by the application, the +Berkeley DB library will identify threads of control by using the taskIdSelf() +call on VxWorks, the getpid() and GetCurrentThreadID() calls on Windows, +the getpid() and pthread_self() calls when the Berkeley DB library has been +configured for POSIX pthreads or Solaris LWP threads, the getpid() and +thr_self() calls when the Berkeley DB library has been configured for UI +threads, and otherwise getpid().

+

Errors

+

The DB_ENV->set_thread_id method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_set_thread_id_string.html b/db/docs/api_c/env_set_thread_id_string.html new file mode 100644 index 000000000..568b00e4f --- /dev/null +++ b/db/docs/api_c/env_set_thread_id_string.html @@ -0,0 +1,85 @@ + + + + + + +Berkeley DB: DB_ENV->set_thread_id_string + + + + + + + +
+

DB_ENV->set_thread_id_string

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->set_thread_id_string(DB_ENV *dbenv, + char *(*thread_id_string)(DB_ENV *dbenv, + pid_t pid, db_threadid_t tid, char *buf)); +

+
+

Description: DB_ENV->set_thread_id_string

+

Declare a function that formats a process ID and thread ID identifier +pair for display into a caller-supplied buffer. The function must +return a reference to the caller-specified buffer. The +DB_ENV->set_thread_id_string method supports the +DB_ENV->set_thread_id method.

+

The DB_ENV->set_thread_id_string method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

+

The DB_ENV->set_thread_id_string method may be called at any time during the life of the +application.

+

The DB_ENV->set_thread_id_string method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
thread_id_string
The thread_id_string parameter is a function which returns a +buffer in which is an identifier pair formatted for display. The +function takes four arguments: +
+
dbenv
The dbenv parameter is the enclosing database environment +handle, allowing application access to the application-private fields +of that object. +
pid
The pid argument is a process ID. +
tid
The tid argument is a thread ID. +
buf
+The buf argument is character array of at least +DB_THREADID_STRLEN bytes in length, into which the identifier +pair should be formatted. +
+
+

If no thread_id_string function is specified, the default +routine displays the identifier pair as "pid/tid", that is, the process +ID represented as an unsigned integer value, a slash ('/') character, +then the thread ID represented as an unsigned integer value.

+

Errors

+

The DB_ENV->set_thread_id_string method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/env_set_timeout.html b/db/docs/api_c/env_set_timeout.html index 5cd8aaad7..c3e12e905 100644 --- a/db/docs/api_c/env_set_timeout.html +++ b/db/docs/api_c/env_set_timeout.html @@ -1,5 +1,5 @@ - - + + @@ -32,8 +32,8 @@ DB_ENV->get_timeout(DB_ENV *dbenv, db_timeout_t *timeoutp, u_int32_t flag);

Description: DB_ENV->set_timeout

The DB_ENV->set_timeout method sets timeout values for locks or transactions in the database environment.

-

Timeouts are checked whenever a thread of control blocks on a lock or -when deadlock detection is performed. (In the case of +

All timeouts are checked whenever a thread of control blocks on a lock +or when deadlock detection is performed. (In the case of DB_SET_LOCK_TIMEOUT, the lock is one requested explicitly through the Lock subsystem interfaces. In the case of DB_SET_TXN_TIMEOUT, the lock is one requested on behalf of a @@ -58,18 +58,18 @@ and 0 on success.

flags
The flags parameter must be set to one of the following values:
DB_SET_LOCK_TIMEOUT
Set the timeout value for locks in this database environment. -

The database environment's lock timeout value may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lock_timeout", one or more whitespace characters, -and the lock timeout value. +

The database environment's lock timeout value may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lock_timeout", one or more whitespace +characters, and the lock timeout value. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

DB_SET_TXN_TIMEOUT
Set the timeout value for transactions in this database environment. -

The database environment's transaction timeout value may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_txn_timeout", one or more whitespace characters, -and the transaction timeout value. +

The database environment's transaction timeout value may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_txn_timeout", one or more whitespace +characters, and the transaction timeout value. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -102,7 +102,7 @@ and 0 on success.
DB_SET_TXN_TIMEOUT
Return the timeout value for transactions in this database environment.
timeoutp
The timeoutp parameter references memory into which - the timeout value of the specified flag parameter is copied. + the timeout value of the specified flag parameter is copied.

Class

@@ -113,6 +113,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_tmp_dir.html b/db/docs/api_c/env_set_tmp_dir.html index b852c81d4..967624864 100644 --- a/db/docs/api_c/env_set_tmp_dir.html +++ b/db/docs/api_c/env_set_tmp_dir.html @@ -1,5 +1,5 @@ - + @@ -55,10 +55,10 @@ all temporary files.

DB_USE_ENVIRON or DB_USE_ENVIRON_ROOT flags were specified.

Note: the GetTempPath interface is only checked on Win/32 platforms.

-

The database environment's temporary file directory may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_tmp_dir", one or more whitespace characters, -and the directory name. +

The database environment's temporary file directory may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_tmp_dir", one or more whitespace +characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -79,8 +79,9 @@ and 0 on success.
dir
The dir parameter is the directory to be used to store temporary files. -

On Windows, the dir argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the dir +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

Errors

The DB_ENV->set_tmp_dir method @@ -112,6 +113,6 @@ database environment temporary file directory in dirp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_tx_max.html b/db/docs/api_c/env_set_tx_max.html index 038821b58..fd39bbc44 100644 --- a/db/docs/api_c/env_set_tx_max.html +++ b/db/docs/api_c/env_set_tx_max.html @@ -1,5 +1,5 @@ - - + + @@ -34,15 +34,19 @@ DB_ENV->get_tx_max(DB_ENV *dbenv, u_int32_t *tx_maxp); active transactions. This value bounds the size of the memory allocated for transactions. Child transactions are counted as active until they either commit or abort.

+

Transactions that update multiversion databases are not freed until the +last page version that the transaction created is flushed from cache. +This means that applications using multi-version concurrency control may +need a transaction for each page in cache, in the extreme case.

When all of the memory available in the database environment for transactions is in use, calls to DB_ENV->txn_begin will fail (until some -active transactions complete). If this interface is never called, -the database environment is configured to support at least 20 active +active transactions complete). If this interface is never called, the +database environment is configured to support at least 100 active transactions.

-

The database environment's number of active transactions may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_tx_max", one or more whitespace characters, -and the number of transactions. +

The database environment's number of active transactions may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_tx_max", one or more whitespace +characters, and the number of transactions. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -94,6 +98,6 @@ number of active transactions in tx_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_tx_timestamp.html b/db/docs/api_c/env_set_tx_timestamp.html index 793b1d79a..837f955a6 100644 --- a/db/docs/api_c/env_set_tx_timestamp.html +++ b/db/docs/api_c/env_set_tx_timestamp.html @@ -1,5 +1,5 @@ - + @@ -84,6 +84,6 @@ recovery timestamp in timestampp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_set_verbose.html b/db/docs/api_c/env_set_verbose.html index 084f0f8f0..aa19c4685 100644 --- a/db/docs/api_c/env_set_verbose.html +++ b/db/docs/api_c/env_set_verbose.html @@ -1,5 +1,5 @@ - - + + @@ -34,11 +34,11 @@ DB_ENV->get_verbose(DB_ENV *dbenv, u_int32_t which, int *onoffp); and debugging messages in the Berkeley DB message output on and off. To see the additional messages, verbose messages must also be configured for the application. For more information on verbose messages, see the -DB->set_errfile method.

-

The database environment's messages may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_verbose", one or more whitespace characters, -and the method which parameter as a string; for example, +DB_ENV->set_msgfile method.

+

The database environment's messages may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_verbose", one or more whitespace +characters, and the method which parameter as a string; for example, "set_verbose DB_VERB_RECOVERY". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done @@ -60,8 +60,10 @@ messages are output.

DB_VERB_DEADLOCK
Display additional information when doing deadlock detection.
DB_VERB_RECOVERY
Display additional information when performing recovery. +
DB_VERB_REGISTER
Display additional information concerning support for the +DB_REGISTER flag to the DB_ENV->open method.
DB_VERB_REPLICATION
Display additional information when processing replication messages. -

Note, to get complete replication logging when debugging replication +

To get complete replication logging when debugging replication applications, you must also configure and build the Berkeley DB library with the --enable-diagnostic configuration option as well as call the DB_ENV->set_verbose method.

@@ -76,12 +78,12 @@ may fail and return one of the following non-zero errors:

invalid flag value or parameter was specified.

-

Description: dbenv_get_verbose

-

The DB_ENV->get_verbose method returns whether the specified which +

Description: DB_ENV->get_verbose

+

The DB_ENV->get_verbose method returns whether the specified which parameter is currently set or not.

-

The DB_ENV->get_verbose method may be called at any time during the life of the +

The DB_ENV->get_verbose method may be called at any time during the life of the application.

-

The DB_ENV->get_verbose method +

The DB_ENV->get_verbose method returns a non-zero error value on failure and 0 on success.

@@ -90,7 +92,8 @@ and 0 on success.
which
The which parameter is the message value for which configuration is being checked.
onoffp
The onoffp parameter references memory into which - the configuration of the specified which parameter is copied. + the configuration of the specified which parameter is copied. If the returned onoff value is zero, the parameter is off; +otherwise on.

Class

@@ -101,6 +104,6 @@ is being checked.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_stat.html b/db/docs/api_c/env_stat.html index f9593e921..2992517bc 100644 --- a/db/docs/api_c/env_stat.html +++ b/db/docs/api_c/env_stat.html @@ -1,5 +1,5 @@ - + @@ -27,7 +27,7 @@ DB_ENV->stat_print(DB_ENV *dbenv, u_int32_t flags);


Description: DB_ENV->stat_print

-

The DB_ENV->stat_print method returns the +

The DB_ENV->stat_print method displays the default statistical information. The information is printed to a specified output channel (see the DB_ENV->set_msgfile method for more information), or passed to an @@ -41,14 +41,11 @@ and 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_STAT_ALL
Display all available information. -
-In addition, the following flag may be set by -bitwise inclusively OR'ing it into the flags parameter: -
+
DB_STAT_CLEAR
Reset statistics after displaying their values.
DB_STAT_SUBSYSTEM
Display information for all configured subsystems.
@@ -61,6 +58,6 @@ bitwise inclusively OR'ing it into the flags parameter:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_strerror.html b/db/docs/api_c/env_strerror.html index 202569676..d2cf5f209 100644 --- a/db/docs/api_c/env_strerror.html +++ b/db/docs/api_c/env_strerror.html @@ -1,5 +1,5 @@ - + @@ -50,6 +50,6 @@ string is wanted.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/env_version.html b/db/docs/api_c/env_version.html index ad3683c92..8f75e50aa 100644 --- a/db/docs/api_c/env_version.html +++ b/db/docs/api_c/env_version.html @@ -1,5 +1,5 @@ - + @@ -47,6 +47,6 @@ is copied to the memory to which it refers.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/frame.html b/db/docs/api_c/frame.html index dd70c69b3..3f1a25891 100644 --- a/db/docs/api_c/frame.html +++ b/db/docs/api_c/frame.html @@ -1,8 +1,8 @@ - + -Berkeley DB API (Version: 4.3.27) +Berkeley DB API (Version: 4.5.20) @@ -12,7 +12,7 @@ Berkeley DB API (Version: 4.3.27) +"Berkeley DB API (Version: 4.5.20)"> <meta http-equiv="refresh" content="0;url=api_index.html"> diff --git a/db/docs/api_c/hsearch.html b/db/docs/api_c/hsearch.html index eb335b5ef..58a2d0c59 100644 --- a/db/docs/api_c/hsearch.html +++ b/db/docs/api_c/hsearch.html @@ -1,5 +1,5 @@ - + @@ -97,6 +97,6 @@ system functions.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lock_class.html b/db/docs/api_c/lock_class.html index 3a57d954f..d4bb8753c 100644 --- a/db/docs/api_c/lock_class.html +++ b/db/docs/api_c/lock_class.html @@ -1,5 +1,5 @@ - + @@ -38,6 +38,6 @@ for a single lock, and has no methods of its own.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lock_detect.html b/db/docs/api_c/lock_detect.html index f76a0cc4c..d19857f6c 100644 --- a/db/docs/api_c/lock_detect.html +++ b/db/docs/api_c/lock_detect.html @@ -1,5 +1,5 @@ - + @@ -77,6 +77,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lock_get.html b/db/docs/api_c/lock_get.html index d5bd7738c..45b2a12e3 100644 --- a/db/docs/api_c/lock_get.html +++ b/db/docs/api_c/lock_get.html @@ -1,5 +1,5 @@ - + @@ -94,6 +94,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lock_id.html b/db/docs/api_c/lock_id.html index 28f81db5a..721d4a384 100644 --- a/db/docs/api_c/lock_id.html +++ b/db/docs/api_c/lock_id.html @@ -1,5 +1,5 @@ - + @@ -39,7 +39,7 @@ and 0 on success.

Parameters

idp
The idp parameter references memory into which - the allocated locker ID is copied. + the allocated locker ID is copied.

Class

@@ -50,6 +50,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lock_id_free.html b/db/docs/api_c/lock_id_free.html index ec2e44127..5d66f5196 100644 --- a/db/docs/api_c/lock_id_free.html +++ b/db/docs/api_c/lock_id_free.html @@ -1,5 +1,5 @@ - + @@ -53,6 +53,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lock_list.html b/db/docs/api_c/lock_list.html index 8e9bdc042..fd6a3f08f 100644 --- a/db/docs/api_c/lock_list.html +++ b/db/docs/api_c/lock_list.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@

Berkeley DB: Locking Subsystem and Related Methods

- + @@ -21,6 +21,7 @@ + @@ -31,6 +32,6 @@
Locking Subsystem and Related MethodsDescription
DB_ENV->lock_putRelease a lock
DB_ENV->lock_statReturn lock subsystem statistics
DB_ENV->lock_vecAcquire/release locks
DB_ENV->cdsgroup_beginGet a locker ID in Berkeley DB Concurrent Data Store
Locking Subsystem Configuration
DB_ENV->set_lk_max_objectsSet maximum number of lock objects
DB_ENV->set_timeoutSet lock and transaction timeout
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lock_put.html b/db/docs/api_c/lock_put.html index 6168fc7fc..f7c699029 100644 --- a/db/docs/api_c/lock_put.html +++ b/db/docs/api_c/lock_put.html @@ -1,5 +1,5 @@ - + @@ -52,6 +52,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lock_stat.html b/db/docs/api_c/lock_stat.html index a1366a87a..c3cd8b55a 100644 --- a/db/docs/api_c/lock_stat.html +++ b/db/docs/api_c/lock_stat.html @@ -1,5 +1,5 @@ - - + + @@ -57,9 +57,12 @@ individually freed.

u_int32_t st_maxnobjects;
The maximum number of lock objects at any one time.
u_int32_t st_nrequests;
The total number of locks requested.
u_int32_t st_nreleases;
The total number of locks released. -
u_int32_t st_nnowaits;
The total number of lock requests failing because -DB_LOCK_NOWAIT was set. -
u_int32_t st_nconflicts;
The total number of locks not immediately available due to conflicts. +
u_int32_t st_nupgrade;
The total number of locks upgraded. +
u_int32_t st_ndowngrade;
The total number of locks downgraded. +
u_int32_t st_lock_wait;
The number of lock requests not immediately available due to conflicts, +for which the thread of control waited. +
u_int32_t st_lock_nowait;
The number of lock requests not immediately available due to conflicts, +for which the thread of control did not wait.
u_int32_t st_ndeadlocks;
The number of deadlocks.
u_int32_t st_locktimeout;
Lock timeout value.
u_int32_t st_nlocktimeouts;
The number of lock requests that have timed out. @@ -69,9 +72,9 @@ component of st_ndeadlocks, the total number of deadlocks detected.
roff_t st_regsize;
The size of the lock region, in bytes.
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before -obtaining the region lock. +obtaining the lock region mutex.
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain -the region lock without waiting. +the lock region mutex without waiting.

The DB_ENV->lock_stat method returns a non-zero error value on failure @@ -85,7 +88,7 @@ the following value:

DB_STAT_CLEAR
Reset statistics after returning their values.
statp
The statp parameter references memory into which -a pointer to the allocated statistics structure is copied. +a pointer to the allocated statistics structure is copied.

Errors

The DB_ENV->lock_stat method @@ -125,6 +128,6 @@ of the following values:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lock_vec.html b/db/docs/api_c/lock_vec.html index 8b506dac2..7265f4075 100644 --- a/db/docs/api_c/lock_vec.html +++ b/db/docs/api_c/lock_vec.html @@ -1,5 +1,5 @@ - + @@ -153,6 +153,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/log_archive.html b/db/docs/api_c/log_archive.html index 8d84f633e..f98246de1 100644 --- a/db/docs/api_c/log_archive.html +++ b/db/docs/api_c/log_archive.html @@ -1,5 +1,5 @@ - + @@ -109,6 +109,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/log_compare.html b/db/docs/api_c/log_compare.html index 4679c1c3c..7f870cfcc 100644 --- a/db/docs/api_c/log_compare.html +++ b/db/docs/api_c/log_compare.html @@ -1,5 +1,5 @@ - + @@ -49,6 +49,6 @@ to be compared.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/log_cursor.html b/db/docs/api_c/log_cursor.html index 9dd78ed0b..a80fa59ab 100644 --- a/db/docs/api_c/log_cursor.html +++ b/db/docs/api_c/log_cursor.html @@ -1,5 +1,5 @@ - + @@ -35,7 +35,7 @@ and 0 on success.

Parameters

cursorp
The cursorp parameter references memory into which -a pointer to the created log cursor is copied. +a pointer to the created log cursor is copied.
flags
The flags parameter is currently unused, and must be set to 0.

Errors

@@ -54,6 +54,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/log_file.html b/db/docs/api_c/log_file.html index 785f5750f..f2ca9743a 100644 --- a/db/docs/api_c/log_file.html +++ b/db/docs/api_c/log_file.html @@ -1,5 +1,5 @@ - + @@ -49,7 +49,7 @@ and 0 on success. DB_LSN structure for which a filename is wanted.

namep
The namep parameter references memory into which - the name of the file containing the record named by lsn is copied. + the name of the file containing the record named by lsn is copied.
len
The len parameter is the length of the namep buffer in bytes. If namep is too short to hold the filename, DB_ENV->log_file will fail. (Log filenames are normally quite short, @@ -71,6 +71,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/log_flush.html b/db/docs/api_c/log_flush.html index 909a6e9e5..6d93c820a 100644 --- a/db/docs/api_c/log_flush.html +++ b/db/docs/api_c/log_flush.html @@ -1,5 +1,5 @@ - + @@ -54,6 +54,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/log_list.html b/db/docs/api_c/log_list.html index e496a5772..1e4fdf309 100644 --- a/db/docs/api_c/log_list.html +++ b/db/docs/api_c/log_list.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@

Berkeley DB: Logging Subsystem and Related Methods

- + @@ -18,6 +18,7 @@ + @@ -28,9 +29,10 @@ +
Logging Subsystem and Related MethodsDescription
DB_LSNLog Sequence Numbers
DB_ENV->log_archiveList log and database files
DB_ENV->log_fileMap Log Sequence Numbers to log files
DB_ENV->log_flushFlush log records
DB_ENV->log_printfAppend informational message to the log
DB_ENV->log_putWrite a log record
DB_ENV->log_statReturn log subsystem statistics
Logging Subsystem Cursors
Logging Subsystem Configuration
DB_ENV->set_lg_bsizeSet log buffer size
DB_ENV->set_lg_dirSet the environment logging directory
DB_ENV->set_lg_filemodeSet log file mode
DB_ENV->set_lg_maxSet log file size
DB_ENV->set_lg_regionmaxSet logging region size
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/log_printf.html b/db/docs/api_c/log_printf.html new file mode 100644 index 000000000..c0264c6d0 --- /dev/null +++ b/db/docs/api_c/log_printf.html @@ -0,0 +1,69 @@ + + + + + + +Berkeley DB: DB_ENV->log_printf + + + + + + + +
+

DB_ENV->log_printf

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->log_printf(DB_ENV *env, DB_TXN *txnid, const char *fmt, ...); +

+
+

Description: DB_ENV->log_printf

+

The DB_ENV->log_printf method appends an informational message to the Berkeley DB +database environment log files.

+

The DB_ENV->log_printf method allows applications to include information in +the database environment log files, for later review using the +db_printlog utility. This method is intended for debugging and +performance tuning.

+

The DB_ENV->log_printf method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
txnid
If the logged message refers to an application-specified transaction, +the txnid parameter is a transaction handle returned from +DB_ENV->txn_begin; otherwise NULL. +
fmt
A format string that specifies how subsequent arguments (or arguments +accessed via the variable-length argument facilities of stdarg(3)) are +converted for output. The format string may contain any formatting +directives supported by the underlying C library vsnprintf(3) +function. +
+

Errors

+

The DB_ENV->log_printf method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV, DB_LOGC, DB_LSN +

See Also

+Logging Subsystem and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/log_put.html b/db/docs/api_c/log_put.html index fcbe7d4ec..91241c6e9 100644 --- a/db/docs/api_c/log_put.html +++ b/db/docs/api_c/log_put.html @@ -1,5 +1,5 @@ - + @@ -53,7 +53,7 @@ that all records with DB_LSN values less t one being "put" are on disk before DB_ENV->log_put returns.

lsn
The lsn parameter references memory into which - the DB_LSN of the put record is copied. + the DB_LSN of the put record is copied.

Errors

The DB_ENV->log_flush method @@ -71,6 +71,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/log_stat.html b/db/docs/api_c/log_stat.html index b4f97a18a..05a01cd17 100644 --- a/db/docs/api_c/log_stat.html +++ b/db/docs/api_c/log_stat.html @@ -1,5 +1,5 @@ - - + + @@ -47,7 +47,8 @@ individually freed.

u_int32_t st_version;
The version of the log file type.
int st_mode;
The mode of any created log files.
u_int32_t st_lg_bsize;
The in-memory log record cache size. -
u_int32_t st_lg_size;
The current log file size. +
u_int32_t st_lg_size;
The log file size. +
u_int32_t st_record;
The number of records written to this log.
u_int32_t st_w_mbytes;
The number of megabytes written to this log.
u_int32_t st_w_bytes;
The number of bytes over and above st_w_mbytes written to this log.
u_int32_t st_wc_mbytes;
The number of megabytes written to this log since the last checkpoint. @@ -56,6 +57,7 @@ since the last checkpoint.
u_int32_t st_wcount;
The number of times the log has been written to disk.
u_int32_t st_wcount_fill;
The number of times the log has been written to disk because the in-memory log record cache filled up. +
u_int32_t st_rcount;
The number of times the log has been read from disk.
u_int32_t st_scount;
The number of times the log has been flushed to disk.
u_int32_t st_cur_file;
The current log file number.
u_int32_t st_cur_offset;
The byte offset in the current log file. @@ -64,11 +66,11 @@ in-memory log record cache filled up.
u_int32_t st_maxcommitperflush;
The maximum number of commits contained in a single log flush.
u_int32_t st_mincommitperflush;
The minimum number of commits contained in a single log flush that contained a commit. -
roff_t st_regsize;
The size of the region, in bytes. +
roff_t st_regsize;
The size of the log region, in bytes.
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before -obtaining the region lock. +obtaining the log region mutex.
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain -the region lock without waiting. +the log region mutex without waiting.

The DB_ENV->log_stat method returns a non-zero error value on failure @@ -82,7 +84,7 @@ the following value:

DB_STAT_CLEAR
Reset statistics after returning their values.
statp
The statp parameter references memory into which -a pointer to the allocated statistics structure is copied. +a pointer to the allocated statistics structure is copied.

Errors

The DB_ENV->log_stat method @@ -93,7 +95,7 @@ invalid flag value or parameter was specified.


Description: DB_ENV->log_stat_print

-

The DB_ENV->log_stat_print method returns the +

The DB_ENV->log_stat_print method displays the logging subsystem statistical information, as described for the DB_ENV->log_stat method. The information is printed to a specified output channel (see the DB_ENV->set_msgfile method for more information), or passed to an @@ -107,10 +109,11 @@ and 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values.

@@ -122,6 +125,6 @@ the following value:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/logc_class.html b/db/docs/api_c/logc_class.html index c784685e0..67c981f9a 100644 --- a/db/docs/api_c/logc_class.html +++ b/db/docs/api_c/logc_class.html @@ -1,5 +1,5 @@ - + @@ -40,6 +40,6 @@ return.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/logc_close.html b/db/docs/api_c/logc_close.html index 34834140d..4484867bd 100644 --- a/db/docs/api_c/logc_close.html +++ b/db/docs/api_c/logc_close.html @@ -1,5 +1,5 @@ - + @@ -54,6 +54,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/logc_get.html b/db/docs/api_c/logc_get.html index 579bef8e9..887dba5c6 100644 --- a/db/docs/api_c/logc_get.html +++ b/db/docs/api_c/logc_get.html @@ -1,5 +1,5 @@ - + @@ -103,6 +103,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/lsn_class.html b/db/docs/api_c/lsn_class.html index 9683ee4ef..96c4e9106 100644 --- a/db/docs/api_c/lsn_class.html +++ b/db/docs/api_c/lsn_class.html @@ -1,5 +1,5 @@ - + @@ -39,6 +39,6 @@ the other specifies an offset in the log file.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_fclose.html b/db/docs/api_c/memp_fclose.html index fd9c28144..7be4e8279 100644 --- a/db/docs/api_c/memp_fclose.html +++ b/db/docs/api_c/memp_fclose.html @@ -1,5 +1,5 @@ - + @@ -52,6 +52,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_fcreate.html b/db/docs/api_c/memp_fcreate.html index 606c19e26..2d846db77 100644 --- a/db/docs/api_c/memp_fcreate.html +++ b/db/docs/api_c/memp_fcreate.html @@ -1,5 +1,5 @@ - + @@ -48,6 +48,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_fget.html b/db/docs/api_c/memp_fget.html index 39765ae51..fa8e931b6 100644 --- a/db/docs/api_c/memp_fget.html +++ b/db/docs/api_c/memp_fget.html @@ -1,5 +1,5 @@ - - + + @@ -24,7 +24,7 @@

int DB_MPOOLFILE->get(DB_MPOOLFILE *mpf, - db_pgno_t *pgnoaddr, u_int32_t flags, void **pagep); + db_pgno_t *pgnoaddr, DB_TXN * txnid, u_int32_t flags, void **pagep);


Description: DB_MPOOLFILE->get

@@ -52,6 +52,15 @@ or more of the following values:
DB_MPOOL_CREATE
If the specified page does not exist, create it. In this case, the pgin method, if specified, is called. +
DB_MPOOL_DIRTY
The page will be modified and must be written to the source file before +being evicted from the pool. For files open with the +DB_MULTIVERSION flag set, a new copy of the page will be made +if this is the first time the specified transaction is modifying it. +
DB_MPOOL_EDIT
The page will be modified and must be written to the source file before +being evicted from the pool. No copy of the page will be made, regardless +of the DB_MULTIVERSION setting. This flag is only intended for +use in situations where a transaction handle is not available, such as during +aborts or recovery.
DB_MPOOL_LAST
Return the last page of the source file, and copy its page number into the memory location to which pgnoaddr refers.
DB_MPOOL_NEW
Create a new page in the file, and copy its page number into the memory @@ -62,7 +71,7 @@ location to which pgnoaddr refers. In this case, the

The DB_MPOOL_CREATE, DB_MPOOL_LAST, and DB_MPOOL_NEW flags are mutually exclusive.

pagep
The pagep parameter references memory into which -a pointer to the returned page is copied. +a pointer to the returned page is copied.
pgnoaddr
If the flags parameter is set to DB_MPOOL_LAST or DB_MPOOL_NEW, the page number of the created page is copied into the memory location to which the pgnoaddr parameter @@ -70,11 +79,22 @@ refers. Otherwise, the pgnoaddr parameter is the page to create or retrieve.

Page numbers begin at 0; that is, the first page in the file is page number 0, not page number 1.

+
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; otherwise NULL. A transaction is +required if the file is open for multiversion concurrency control by +passing DB_MULTIVERSION to DB_MPOOLFILE->open and the +DB_MPOOL_DIRTY, DB_MPOOL_CREATE or +DB_MPOOL_NEW flags were specified. Otherwise it is ignored.

Errors

The DB_MPOOLFILE->get method may fail and return one of the following non-zero errors:

+
EACCES
The DB_MPOOL_DIRTY or DB_MPOOL_EDIT flag was set and +the source file was not opened for writing. +
+
EAGAIN
The page reference count has overflowed. (This should never happen unless there is a bug in the application.)
@@ -82,10 +102,14 @@ unless there is a bug in the application.)
EINVAL
If the DB_MPOOL_NEW flag was set, and the source file was not opened for writing; more than one of DB_MPOOL_CREATE, DB_MPOOL_LAST, and -DB_MPOOL_NEW was set; or if an +DB_MPOOL_NEW was set.; or if an invalid flag value or parameter was specified.
+
DB_LOCK_DEADLOCK
For transactions configured with DB_TXN_SNAPSHOT, the page has +been modified since the transaction began. +
+
ENOMEM
The cache is full, and no more pages will fit in the pool.

@@ -97,6 +121,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_fopen.html b/db/docs/api_c/memp_fopen.html index fcd569020..f4a8d8ff0 100644 --- a/db/docs/api_c/memp_fopen.html +++ b/db/docs/api_c/memp_fopen.html @@ -1,5 +1,5 @@ - - + + @@ -39,8 +39,9 @@ and 0 on success. file is NULL, a private temporary file is created that cannot be shared with any other process (although it may be shared with other threads of control in the same process). -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
@@ -50,6 +51,8 @@ fail.
DB_DIRECT
If set and supported by the system, turn off system buffering of the file to avoid double caching. +
DB_MULTIVERSION
Open the file with support for multiversion concurrency control. Calls to DB_MPOOLFILE->get which +dirty pages will cause copies to be made in the cache.
DB_NOMMAP
Always copy this file into the local cache instead of potentially mapping it into process memory (see the description of the DB_ENV->set_mp_mmapsize method for further information). @@ -98,6 +101,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_fput.html b/db/docs/api_c/memp_fput.html index e4f0512c4..f2ffc9bfe 100644 --- a/db/docs/api_c/memp_fput.html +++ b/db/docs/api_c/memp_fput.html @@ -1,5 +1,5 @@ - - + + @@ -40,27 +40,16 @@ address previously returned by DB_MPOOLFILE-&g

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_MPOOL_CLEAN
Clear any previously set modification information (that is, don't bother -writing the page back to the source file). -
DB_MPOOL_DIRTY
The page has been modified and must be written to the source file before -being evicted from the pool.
DB_MPOOL_DISCARD
The page is unlikely to be useful in the near future, and should be discarded before other pages in the pool.
-

The DB_MPOOL_CLEAN and DB_MPOOL_DIRTY flags are mutually exclusive.

Errors

The DB_MPOOLFILE->put method may fail and return one of the following non-zero errors:

-
EACCES
The DB_MPOOL_DIRTY flag was set and the source file was not -opened for writing. -
-
EINVAL
If the pgaddr parameter does not refer to a page returned by -DB_MPOOLFILE->get; -more than one of the DB_MPOOL_CLEAN and DB_MPOOL_DIRTY -flags was set; or if an +DB_MPOOLFILE->get; or if an invalid flag value or parameter was specified.

@@ -72,6 +61,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_fset.html b/db/docs/api_c/memp_fset.html index a41155ce6..651236d34 100644 --- a/db/docs/api_c/memp_fset.html +++ b/db/docs/api_c/memp_fset.html @@ -1,5 +1,5 @@ - + @@ -40,14 +40,9 @@ address previously returned by DB_MPOOLFILE-&g

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_MPOOL_CLEAN
Clear any previously set modification information (that is, don't bother -writing the page back to the source file). -
DB_MPOOL_DIRTY
The page has been modified and must be written to the source file before -being evicted from the pool.
DB_MPOOL_DISCARD
The page is unlikely to be useful in the near future, and should be discarded before other pages in the pool.
-

The DB_MPOOL_CLEAN and DB_MPOOL_DIRTY flags are mutually exclusive.

Errors

The DB_MPOOLFILE->set method @@ -65,6 +60,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_fsync.html b/db/docs/api_c/memp_fsync.html index 4cd997df5..a36f62551 100644 --- a/db/docs/api_c/memp_fsync.html +++ b/db/docs/api_c/memp_fsync.html @@ -1,5 +1,5 @@ - + @@ -45,6 +45,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_list.html b/db/docs/api_c/memp_list.html index c445ccfe4..3fd62b851 100644 --- a/db/docs/api_c/memp_list.html +++ b/db/docs/api_c/memp_list.html @@ -1,5 +1,5 @@ - + @@ -10,19 +10,19 @@

Berkeley DB: Memory Pools and Related Methods

- + - + - - + + @@ -43,6 +43,6 @@
Memory Pools and Related MethodsDescription
DB->mpfReturn the database's memory pool handle
DB->get_mpfReturn DB's underlying DB_MPOOLFILE handle
DB_ENV->memp_statReturn memory pool statistics
DB_ENV->memp_syncFlush pages from a memory pool
DB_ENV->memp_trickleTrickle flush pages from a memory pool
Memory Pool Configuration
DB_ENV->memp_registerRegister input/output functions for a file in a memory pool
DB_ENV->memp_set_max_openfdSet the maximum number of open file descriptors
DB_ENV->memp_set_max_writeSet the maximum number of sequential disk writes
DB_ENV->set_cachesizeSet the environment cache size
DB_ENV->set_mp_max_openfdSet the maximum number of open file descriptors
DB_ENV->set_mp_max_writeSet the maximum number of sequential disk writes
DB_ENV->set_mp_mmapsizeSet maximum mapped-in database file size
Memory Pool Files
DB_ENV->memp_fcreateCreate a memory pool file handle
DB_MPOOLFILE->set_pgcookieSet file cookie for pgin/pgout
DB_MPOOLFILE->set_prioritySet memory pool file priority
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_maxwrite.html b/db/docs/api_c/memp_maxwrite.html index 6cf7396f3..d074fe342 100644 --- a/db/docs/api_c/memp_maxwrite.html +++ b/db/docs/api_c/memp_maxwrite.html @@ -1,17 +1,17 @@ - - + + -Berkeley DB: DB_ENV->memp_set_max_write +Berkeley DB: DB_ENV->set_mp_max_write
-

DB_ENV->memp_set_max_write

+

DB_ENV->set_mp_max_write

API @@ -23,50 +23,51 @@ #include <db.h>

int -DB_ENV->memp_set_max_write(DB_ENV *env, int maxwrite, int maxwrite_sleep); +DB_ENV->set_mp_max_write(DB_ENV *env, int maxwrite, int maxwrite_sleep);

int -DB_ENV->memp_get_max_write(DB_ENV *env, int *maxwritep, int *maxwrite_sleepp); +DB_ENV->get_mp_max_write(DB_ENV *env, int *maxwritep, int *maxwrite_sleepp);


-

Description: DB_ENV->memp_set_max_write

-

The DB_ENV->memp_set_max_write method limits the number of sequential write +

Description: DB_ENV->set_mp_max_write

+

The DB_ENV->set_mp_max_write method limits the number of sequential write operations scheduled by the library when flushing dirty pages from the cache.

-

The DB_ENV->memp_set_max_write method +

The DB_ENV->set_mp_max_write method returns a non-zero error value on failure and 0 on success.

Parameters

maxwrite
The maximum number of sequential write operations scheduled by the -library when flushing dirty pages from the cache. +library when flushing dirty pages from the cache, or 0 if there is +no limitation on the number of sequential write operations.
maxwrite_sleep
The number of microseconds the thread of control should pause before scheduling further write operations.

Errors

-

The DB_ENV->memp_set_max_write method +

The DB_ENV->set_mp_max_write method may fail and return one of the following non-zero errors:

EINVAL
An invalid flag value or parameter was specified.

-

Description: DB_ENV->memp_get_max_write

-

The DB_ENV->memp_get_max_write method returns the current maximum number of +

Description: DB_ENV->get_mp_max_write

+

The DB_ENV->get_mp_max_write method returns the current maximum number of sequential write operations and microseconds to pause.

-

The DB_ENV->memp_get_max_write method may be called at any time during the life of the +

The DB_ENV->get_mp_max_write method may be called at any time during the life of the application.

-

The DB_ENV->memp_get_max_write method +

The DB_ENV->get_mp_max_write method returns a non-zero error value on failure and 0 on success.

Parameters

maxwritep
The maxwritep parameter references memory into which - the maximum number of sequential write operations is copied. + the maximum number of sequential write operations is copied.
maxwrite_sleepp
The maxwrite_sleepp parameter references memory into which - the microseconds to pause before scheduling further write operations is copied. + the microseconds to pause before scheduling further write operations is copied.

Class

@@ -77,6 +78,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_openfd.html b/db/docs/api_c/memp_openfd.html index 749085d9e..3f38d9239 100644 --- a/db/docs/api_c/memp_openfd.html +++ b/db/docs/api_c/memp_openfd.html @@ -1,17 +1,17 @@ - - + + -Berkeley DB: DB_ENV->memp_set_max_openfd +Berkeley DB: DB_ENV->set_mp_max_openfd
-

DB_ENV->memp_set_max_openfd

+

DB_ENV->set_mp_max_openfd

API @@ -23,17 +23,17 @@ #include <db.h>

int -DB_ENV->memp_set_max_openfd(DB_ENV *env, int maxopenfd); +DB_ENV->set_mp_max_openfd(DB_ENV *env, int maxopenfd);

int -DB_ENV->memp_get_max_openfd(DB_ENV *env, int *maxopenfdp); +DB_ENV->get_mp_max_openfd(DB_ENV *env, int *maxopenfdp);


-

Description: DB_ENV->memp_set_max_openfd

-

The DB_ENV->memp_set_max_openfd method limits the number of file descriptors +

Description: DB_ENV->set_mp_max_openfd

+

The DB_ENV->set_mp_max_openfd method limits the number of file descriptors the library will open concurrently when flushing dirty pages from the cache.

-

The DB_ENV->memp_set_max_openfd method +

The DB_ENV->set_mp_max_openfd method returns a non-zero error value on failure and 0 on success.

@@ -43,24 +43,24 @@ and 0 on success. by the library when flushing dirty pages from the cache.

Errors

-

The DB_ENV->memp_set_max_openfd method +

The DB_ENV->set_mp_max_openfd method may fail and return one of the following non-zero errors:

EINVAL
An invalid flag value or parameter was specified.

-

Description: DB_ENV->memp_get_max_openfd

-

The DB_ENV->memp_get_max_openfd method returns the maximum number of file descriptors open.

-

The DB_ENV->memp_get_max_openfd method may be called at any time during the life of the +

Description: DB_ENV->get_mp_max_openfd

+

The DB_ENV->get_mp_max_openfd method returns the maximum number of file descriptors open.

+

The DB_ENV->get_mp_max_openfd method may be called at any time during the life of the application.

-

The DB_ENV->memp_get_max_openfd method +

The DB_ENV->get_mp_max_openfd method returns a non-zero error value on failure and 0 on success.

Parameters

-
maxopenfdp
The DB_ENV->memp_get_max_openfd method returns the +
maxopenfdp
The DB_ENV->get_mp_max_openfd method returns the maximum number of file descriptors open in maxopenfdp.

@@ -72,6 +72,6 @@ maximum number of file descriptors open in maxopenfdp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_register.html b/db/docs/api_c/memp_register.html index e2ae5b2bb..661cb7079 100644 --- a/db/docs/api_c/memp_register.html +++ b/db/docs/api_c/memp_register.html @@ -1,5 +1,5 @@ - + @@ -76,6 +76,6 @@ the Berkeley DB library).


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_set_clear_len.html b/db/docs/api_c/memp_set_clear_len.html index 64024b0b0..9e377a0bd 100644 --- a/db/docs/api_c/memp_set_clear_len.html +++ b/db/docs/api_c/memp_set_clear_len.html @@ -1,5 +1,5 @@ - - + + @@ -33,8 +33,8 @@ DB_MPOOLFILE->get_clear_len(DB_MPOOLFILE *mpf, u_int32_t *lenp);

The DB_MPOOLFILE->set_clear_len method sets the number of initial bytes in a page that should be set to nul when the page is created as a result of the DB_MPOOL_CREATE or DB_MPOOL_NEW flags being -specified to DB_MPOOLFILE->get. If no value is specified, or len -is 0, the entire page is cleared.

+specified to DB_MPOOLFILE->get. If no clear length is specified, the +entire page is cleared when it is created.

The DB_MPOOLFILE->set_clear_len method configures a file in the memory pool, not only operations performed using the specified DB_MPOOLFILE handle.

The DB_MPOOLFILE->set_clear_len method may not be called after the DB_MPOOLFILE->open method is @@ -56,9 +56,18 @@ the entire page being set to nul bytes.


Description: DB_MPOOLFILE->get_clear_len

-

The DB_MPOOLFILE->get_clear_len method returns the .

+

The DB_MPOOLFILE->get_clear_len method returns the bytes to be cleared.

The DB_MPOOLFILE->get_clear_len method may be called at any time during the life of the application.

+

The DB_MPOOLFILE->get_clear_len method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
lenp
The DB_MPOOLFILE->get_clear_len method returns the +bytes to be cleared in lenp. +

Class

DB_ENV, DB_MPOOLFILE @@ -68,6 +77,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_set_fileid.html b/db/docs/api_c/memp_set_fileid.html index f0495ff58..eae255654 100644 --- a/db/docs/api_c/memp_set_fileid.html +++ b/db/docs/api_c/memp_set_fileid.html @@ -1,5 +1,5 @@ - - + + @@ -73,11 +73,11 @@ Unique file identifiers must be a DB_FILE_ID_LEN length array of bytes.

Description: DB_MPOOLFILE->get_fileid

The DB_MPOOLFILE->get_fileid method copies the file's identifier into the memory location referenced by fileid.

-

The DB_ENV->get_data_dirs method +

The DB_MPOOLFILE->get_fileid method returns a non-zero error value on failure and 0 on success.

-

The DB_ENV->get_data_dirs method may be called at any time during the life of the +

The DB_MPOOLFILE->get_fileid method may be called at any time during the life of the application.


Class

@@ -88,6 +88,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_set_flags.html b/db/docs/api_c/memp_set_flags.html index aed5c0bc7..5b2c1801a 100644 --- a/db/docs/api_c/memp_set_flags.html +++ b/db/docs/api_c/memp_set_flags.html @@ -1,5 +1,5 @@ - - + + @@ -46,9 +46,13 @@ of the following values:

DB_MPOOL_NOFILE
If set, no backing temporary file will be opened for in-memory databases, even if they expand to fill the entire cache. Attempts to create new file pages after the cache has been filled will fail. +

The DB_MPOOL_NOFILE flag configures a file in the memory pool, not only +operations performed using the specified DB_MPOOLFILE handle.

The DB_MPOOL_NOFILE flag may be used to configure Berkeley DB at any time during the life of the application.

DB_MPOOL_UNLINK
If set, remove the file when the last reference to it is closed. +

The DB_MPOOL_NOFILE flag configures a file in the memory pool, not only +operations performed using the specified DB_MPOOLFILE handle.

The DB_MPOOL_UNLINK flag may be used to configure Berkeley DB at any time during the life of the application.

@@ -79,6 +83,6 @@ flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_set_ftype.html b/db/docs/api_c/memp_set_ftype.html index d2e353330..8065afada 100644 --- a/db/docs/api_c/memp_set_ftype.html +++ b/db/docs/api_c/memp_set_ftype.html @@ -1,5 +1,5 @@ - - + + @@ -53,9 +53,18 @@ and output processing. The ftype must be the same as a


Description: DB_MPOOLFILE->get_ftype

-

The DB_MPOOLFILE->get_ftype method returns the .

+

The DB_MPOOLFILE->get_ftype method returns the file type.

The DB_MPOOLFILE->get_ftype method may be called at any time during the life of the application.

+

The DB_MPOOLFILE->get_ftype method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
ftypep
The DB_MPOOLFILE->get_ftype method returns the +file type in ftypep. +

Class

DB_ENV, DB_MPOOLFILE @@ -65,6 +74,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_set_lsn_offset.html b/db/docs/api_c/memp_set_lsn_offset.html index da77e6502..68fdc863b 100644 --- a/db/docs/api_c/memp_set_lsn_offset.html +++ b/db/docs/api_c/memp_set_lsn_offset.html @@ -1,5 +1,5 @@ - - + + @@ -54,9 +54,18 @@ log sequence number on the file's pages.


Description: DB_MPOOLFILE->get_lsn_offset

-

The DB_MPOOLFILE->get_lsn_offset method returns the .

+

The DB_MPOOLFILE->get_lsn_offset method returns the log sequence number byte offset.

The DB_MPOOLFILE->get_lsn_offset method may be called at any time during the life of the application.

+

The DB_MPOOLFILE->get_lsn_offset method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
lsn_offsetp
The DB_MPOOLFILE->get_lsn_offset method returns the +log sequence number byte offset in lsn_offsetp. +

Class

DB_ENV, DB_MPOOLFILE @@ -66,6 +75,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_set_maxsize.html b/db/docs/api_c/memp_set_maxsize.html index 66f9ddc41..2c87a30d6 100644 --- a/db/docs/api_c/memp_set_maxsize.html +++ b/db/docs/api_c/memp_set_maxsize.html @@ -1,5 +1,5 @@ - - + + @@ -39,6 +39,8 @@ limit has been reached will fail.

DB_MPOOLFILE->set_maxsize method using the DB_MPOOLFILE handle stored in the mpf field of the DB handle. Attempts to insert new items into the database after the limit has been reached may fail.

+

The DB_MPOOLFILE->set_maxsize method configures a file in the memory pool, not only +operations performed using the specified DB_MPOOLFILE handle.

The DB_MPOOLFILE->set_maxsize method may be called at any time during the life of the application.

The DB_MPOOLFILE->set_maxsize method @@ -63,9 +65,9 @@ application.

Parameters

bytesp
The bytesp parameter references memory into which - the additional bytes of memory in the maximum file size is copied. + the additional bytes of memory in the maximum file size is copied.
gbytesp
The gbytesp parameter references memory into which - the gigabytes of memory in the maximum file size is copied. + the gigabytes of memory in the maximum file size is copied.

Class

@@ -76,6 +78,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_set_pgcookie.html b/db/docs/api_c/memp_set_pgcookie.html index 6dca6fcea..78ac56582 100644 --- a/db/docs/api_c/memp_set_pgcookie.html +++ b/db/docs/api_c/memp_set_pgcookie.html @@ -1,5 +1,5 @@ - - + + @@ -54,9 +54,18 @@ pages.


Description: DB_MPOOLFILE->get_pgcookie

-

The DB_MPOOLFILE->get_pgcookie method returns the .

+

The DB_MPOOLFILE->get_pgcookie method returns the byte string.

The DB_MPOOLFILE->get_pgcookie method may be called at any time during the life of the application.

+

The DB_MPOOLFILE->get_pgcookie method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
dbt
The DB_MPOOLFILE->get_pgcookie method returns a reference to the +byte string in dbt. +

Class

DB_ENV, DB_MPOOLFILE @@ -66,6 +75,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_set_priority.html b/db/docs/api_c/memp_set_priority.html index 32a0211dc..99fc01d11 100644 --- a/db/docs/api_c/memp_set_priority.html +++ b/db/docs/api_c/memp_set_priority.html @@ -1,5 +1,5 @@ - - + + @@ -39,6 +39,8 @@ does not guarantee pages will be treated in a specific way.

To set the priority for the pages belonging to a particular database, call the DB_MPOOLFILE->set_priority method using the DB_MPOOLFILE handle stored in the mpf field of the DB handle.

+

The DB_MPOOLFILE->set_priority method configures a file in the memory pool, not only +operations performed using the specified DB_MPOOLFILE handle.

The DB_MPOOLFILE->set_priority method may be called at any time during the life of the application.

The DB_MPOOLFILE->set_priority method @@ -80,6 +82,6 @@ cache priority in priorityp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_stat.html b/db/docs/api_c/memp_stat.html index 0052105d2..776872db0 100644 --- a/db/docs/api_c/memp_stat.html +++ b/db/docs/api_c/memp_stat.html @@ -1,5 +1,5 @@ - - + + @@ -52,6 +52,10 @@ The following DB_MPOOL_STAT fields will be filled in:

size_t st_bytes;
Bytes of cache (total cache size is st_gbytes + st_bytes).
u_int32_t st_ncache;
Number of caches.
roff_t st_regsize;
Individual cache size, in bytes. +
size_t st_mmapsize;
Maximum memory-mapped file size. +
int st_maxopenfd;
Maximum open file descriptors. +
int st_maxwrite;
Maximum sequential buffer writes. +
int st_maxwrite_sleep;
Sleep after writing maximum sequential buffers.
u_int32_t st_map;
Requested pages mapped into the process' address space (there is no available information about whether or not this request caused disk I/O, although examining the application page fault rate may be helpful). @@ -68,27 +72,30 @@ although examining the application page fault rate may be helpful).
u_int32_t st_page_dirty;
Dirty pages currently in the cache.
u_int32_t st_hash_buckets;
Number of hash buckets in buffer hash table.
u_int32_t st_hash_searches;
Total number of buffer hash table lookups. -
u_int32_t st_hash_longest;
The longest chain ever encountered in buffer hash table lookups. +
u_int32_t st_hash_longest;
Longest chain ever encountered in buffer hash table lookups.
u_int32_t st_hash_examined;
Total number of hash elements traversed during hash table lookups. -
u_int32_t st_hash_nowait;
The number of times that a thread of control was able to obtain a hash +
u_int32_t st_hash_nowait;
Number of times that a thread of control was able to obtain a hash bucket lock without waiting. -
u_int32_t st_hash_wait;
The number of times that a thread of control was forced to wait before +
u_int32_t st_hash_wait;
Number of times that a thread of control was forced to wait before obtaining a hash bucket lock. -
u_int32_t st_hash_max_wait;
The maximum number of times any hash bucket lock was waited for by a +
u_int32_t st_hash_max_nowait;
The number of times a thread of control was able to obtain the hash +bucket lock without waiting on the bucket which had the maximum number +of times that a thread of control needed to wait. +
u_int32_t st_hash_max_wait;
Maximum number of times any hash bucket lock was waited for by a thread of control. -
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before -obtaining a region lock. -
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain a region -lock without waiting. +
u_int32_t st_region_wait;
Number of times that a thread of control was forced to wait before +obtaining a cache region mutex. +
u_int32_t st_region_nowait;
Number of times that a thread of control was able to obtain a cache +region mutex without waiting. +
u_int32_t st_mvcc_frozen;
Number of buffers frozen. +
u_int32_t st_mvcc_thawed;
Number of buffers thawed. +
u_int32_t st_mvcc_freed;
Number of frozen buffers freed.
u_int32_t st_alloc;
Number of page allocations.
u_int32_t st_alloc_buckets;
Number of hash buckets checked during allocation.
u_int32_t st_alloc_max_buckets;
Maximum number of hash buckets checked during an allocation.
u_int32_t st_alloc_pages;
Number of pages checked during allocation.
u_int32_t st_alloc_max_pages;
Maximum number of pages checked during an allocation. -
u_int32_t st_mmapsize;
Maximum memory-mapped file size. -
u_int32_t st_maxopenfd;
Maximum open file descriptors. -
u_int32_t st_maxwrite;
Maximum sequential buffer writes. -
u_int32_t st_maxwrite_sleep;
Sleep after writing maximum sequential buffers. +
u_int32_t st_io_wait;
Number of operations blocked waiting for I/O to complete. The flags parameter must be set to 0 or the following value: @@ -125,9 +132,9 @@ the following value:
DB_STAT_CLEAR
Reset statistics after returning their values.
fsp
The fsp parameter references memory into which -a pointer to the allocated per-file statistics structures is copied. +a pointer to the allocated per-file statistics structures is copied.
gsp
The gsp parameter references memory into which -a pointer to the allocated global statistics structure is copied. +a pointer to the allocated global statistics structure is copied.

Errors

The DB_ENV->memp_stat method @@ -164,6 +171,6 @@ of the following values:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_sync.html b/db/docs/api_c/memp_sync.html index 7fabce9f8..39cfe91a9 100644 --- a/db/docs/api_c/memp_sync.html +++ b/db/docs/api_c/memp_sync.html @@ -1,5 +1,5 @@ - - + + @@ -51,14 +51,6 @@ a certain time have been written to disk. than the lsn parameter are written to disk. If lsn is NULL, all modified pages in the pool are written to disk.

-

Errors

-

The DB_ENV->memp_sync method -may fail and return one of the following non-zero errors:

-
-
EINVAL
If the DB_ENV->memp_sync function was called without logging having been -initialized in the environment; or if an -invalid flag value or parameter was specified. -

Class

DB_ENV, DB_MPOOLFILE @@ -68,6 +60,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/memp_trickle.html b/db/docs/api_c/memp_trickle.html index 5bf0a79bb..e2c0bb5ea 100644 --- a/db/docs/api_c/memp_trickle.html +++ b/db/docs/api_c/memp_trickle.html @@ -1,5 +1,5 @@ - + @@ -41,7 +41,7 @@ and 0 on success.

nwrotep
The nwrotep parameter references memory into which the number of pages written to reach the specified -percentage is copied. +percentage is copied.
percent
The percent parameter is the percent of the pages in the cache that should be clean.
@@ -61,6 +61,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/mempfile_class.html b/db/docs/api_c/mempfile_class.html index 401f01b50..4361cb352 100644 --- a/db/docs/api_c/mempfile_class.html +++ b/db/docs/api_c/mempfile_class.html @@ -1,5 +1,5 @@ - + @@ -53,6 +53,6 @@ method's return.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/mutex_alloc.html b/db/docs/api_c/mutex_alloc.html new file mode 100644 index 000000000..344b85f23 --- /dev/null +++ b/db/docs/api_c/mutex_alloc.html @@ -0,0 +1,74 @@ + + + + + + +Berkeley DB: DB_ENV->mutex_alloc + + + + + + + +
+

DB_ENV->mutex_alloc

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->mutex_alloc(DB_ENV *dbenv, u_int32_t flags, db_mutex_t *mutexp); +

+
+

Description: DB_ENV->mutex_alloc

+

The DB_ENV->mutex_alloc method allocates a mutex and returns a reference to +it into the memory specified by mutexp.

+

The DB_ENV->mutex_alloc method may not be called before the DB_ENV->open method has +been called.

+

The DB_ENV->mutex_alloc method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_MUTEX_PROCESS_ONLY
The mutex is associated with a single process. The DB_ENV->failchk method +will release mutexes held by any process which has exited. +
DB_MUTEX_SELF_BLOCK
The mutex must be self-blocking. That is, if a thread of control locks +the mutex and then attempts to lock the mutex again, the thread of +control will block until another thread of control releases the original +lock on the mutex, allowing the original thread of control to lock the +mutex the second time. Attempting to re-acquire a mutex for which the +DB_MUTEX_SELF_BLOCK flag was not specified will result in +undefined behavior. +
+
mutexp
The mutexp parameter references memory into which + the mutex reference is copied. +
+

Errors

+

The DB_ENV->mutex_alloc method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/mutex_free.html b/db/docs/api_c/mutex_free.html new file mode 100644 index 000000000..6bcdcfb8d --- /dev/null +++ b/db/docs/api_c/mutex_free.html @@ -0,0 +1,60 @@ + + + + + + +Berkeley DB: DB_ENV->mutex_free + + + + + + + +
+

DB_ENV->mutex_free

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->mutex_free(DB_ENV *dbenv, db_mutex_t mutex); +

+
+

Description: DB_ENV->mutex_free

+

The DB_ENV->mutex_free method discards a mutex allocated by DB_ENV->mutex_alloc.

+

The DB_ENV->mutex_free method may not be called before the DB_ENV->open method has +been called.

+

The DB_ENV->mutex_free method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
mutex
The mutex parameter is a mutex previously allocated by +DB_ENV->mutex_alloc. +
+

Errors

+

The DB_ENV->mutex_free method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/mutex_list.html b/db/docs/api_c/mutex_list.html new file mode 100644 index 000000000..520925f4f --- /dev/null +++ b/db/docs/api_c/mutex_list.html @@ -0,0 +1,29 @@ + + + + + + +Berkeley DB: Berkeley DB: Mutexes and Related Methods + + + + +

Berkeley DB: Mutexes and Related Methods

+ + + + + + + + + + + + + +
Mutexes and Related MethodsDescription
DB_ENV->mutex_allocAllocate a mutex
DB_ENV->mutex_freeFree a mutex
DB_ENV->mutex_lockLock a mutex
DB_ENV->mutex_statMutex statistics
DB_ENV->mutex_unlockUnlock a mutex
Mutex Configuration
DB_ENV->mutex_set_alignConfigure mutex alignment
DB_ENV->mutex_set_incrementConfigure number of additional mutexes
DB_ENV->mutex_set_maxConfigure total number of mutexes
DB_ENV->mutex_set_tas_spinsConfigure test-and-set mutex spin count
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/mutex_lock.html b/db/docs/api_c/mutex_lock.html new file mode 100644 index 000000000..2f3481780 --- /dev/null +++ b/db/docs/api_c/mutex_lock.html @@ -0,0 +1,62 @@ + + + + + + +Berkeley DB: DB_ENV->mutex_lock + + + + + + + +
+

DB_ENV->mutex_lock

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->mutex_lock(DB_ENV *dbenv, db_mutex_t mutex); +

+
+

Description: DB_ENV->mutex_lock

+

The DB_ENV->mutex_lock method locks the mutex allocated by +DB_ENV->mutex_alloc. The thread of control calling DB_ENV->mutex_lock +will block until the lock is available.

+

The DB_ENV->mutex_lock method may not be called before the DB_ENV->open method has +been called.

+

The DB_ENV->mutex_lock method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
mutex
The mutex parameter is a mutex previously allocated by +DB_ENV->mutex_alloc. +
+

Errors

+

The DB_ENV->mutex_lock method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/mutex_set_align.html b/db/docs/api_c/mutex_set_align.html new file mode 100644 index 000000000..b258971dd --- /dev/null +++ b/db/docs/api_c/mutex_set_align.html @@ -0,0 +1,94 @@ + + + + + + +Berkeley DB: DB_ENV->mutex_set_align + + + + + + + +
+

DB_ENV->mutex_set_align

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->mutex_set_align(DB_ENV *dbenv, u_int32_t align); +

+int +DB_ENV->mutex_get_align(DB_ENV *dbenv, u_int32_t *alignp); +

+
+

Description: DB_ENV->mutex_set_align

+

Set the mutex alignment, in bytes.

+

It is sometimes advantageous to align mutexes on specific byte +boundaries in order to minimize cache line collisions. The +DB_ENV->mutex_set_align method specifies an alignment for mutexes allocated +by Berkeley DB.

+

The database environment's mutex alignment may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "mutex_set_align", one or more whitespace +characters, and the mutex alignment in bytes. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DB_ENV->mutex_set_align method configures a database environment, not only operations +performed using the specified DB_ENV handle.

+

The DB_ENV->mutex_set_align method may not be called after the DB_ENV->open method is +called. +If the database environment already exists when +DB_ENV->open is called, the information specified to DB_ENV->mutex_set_align +will be ignored. +

+

The DB_ENV->mutex_set_align method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
align
The align parameter is the mutex alignment, in bytes. The mutex +alignment must be a power-of-two. +
+

Errors

+

The DB_ENV->mutex_set_align method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DB_ENV->mutex_get_align

+

The DB_ENV->mutex_get_align method returns the mutex alignment, in bytes.

+

The DB_ENV->mutex_get_align method may be called at any time during the life of the +application.

+

The DB_ENV->mutex_get_align method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
alignp
The DB_ENV->mutex_get_align method returns the +mutex alignment, in bytes in alignp. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/mutex_set_max.html b/db/docs/api_c/mutex_set_max.html new file mode 100644 index 000000000..dc5d3dd24 --- /dev/null +++ b/db/docs/api_c/mutex_set_max.html @@ -0,0 +1,158 @@ + + + + + + +Berkeley DB: DB_ENV->mutex_set_max + + + + + + + +
+

DB_ENV->mutex_set_max

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->mutex_set_increment(DB_ENV *dbenv, u_int32_t increment); +

+int +DB_ENV->mutex_get_increment(DB_ENV *dbenv, u_int32_t *incrementp); +

+int +DB_ENV->mutex_set_max(DB_ENV *dbenv, u_int32_t max); +

+int +DB_ENV->mutex_get_max(DB_ENV *dbenv, u_int32_t *maxp); +

+
+

Description: DB_ENV->mutex_set_max

+

Configure the total number of mutexes to allocate.

+

Berkeley DB allocates a default number of mutexes based on the initial +configuration of the database environment. That default calculation may +be too small if the application has an unusual need for mutexes (for +example, if the application opens an unexpectedly large number of +databases) or too large (if the application is trying to minimize its +memory footprint). The DB_ENV->mutex_set_max method is used to specify an +absolute number of mutexes to allocate.

+

Calling the DB_ENV->mutex_set_max method discards any value previously +set using the DB_ENV->mutex_set_increment method.

+

The database environment's total number of mutexes may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "mutex_set_max", one or more whitespace +characters, and the total number of mutexes. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DB_ENV->mutex_set_max method configures a database environment, not only operations +performed using the specified DB_ENV handle.

+

The DB_ENV->mutex_set_max method may not be called after the DB_ENV->open method is +called. +If the database environment already exists when +DB_ENV->open is called, the information specified to DB_ENV->mutex_set_max +will be ignored. +

+

The DB_ENV->mutex_set_max method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
max
The max parameter is the absolute number of mutexes to +allocate. +
+

Errors

+

The DB_ENV->mutex_set_max method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DB_ENV->mutex_get_max

+

The DB_ENV->mutex_get_max method returns the total number of mutexes allocated.

+

The DB_ENV->mutex_get_max method may be called at any time during the life of the +application.

+

The DB_ENV->mutex_get_max method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
maxp
The DB_ENV->mutex_get_max method returns the +total number of mutexes allocated in maxp. +
+
+

Description: DB_ENV->mutex_set_increment

+

Configure the number of additional mutexes to allocate.

+

Additionally, an application may want to allocate mutexes for its own +use. The DB_ENV->mutex_set_increment method is used to add a number of +mutexes to the default allocation.

+

Calling the DB_ENV->mutex_set_increment method discards any value previously +set using the DB_ENV->mutex_set_max method.

+

The database environment's number of additional mutexes may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "mutex_set_increment", one or more whitespace +characters, and the number of additional mutexes. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DB_ENV->mutex_set_increment method configures a database environment, not only operations +performed using the specified DB_ENV handle.

+

The DB_ENV->mutex_set_increment method may not be called after the DB_ENV->open method is +called. +If the database environment already exists when +DB_ENV->open is called, the information specified to DB_ENV->mutex_set_increment +will be ignored. +

+

The DB_ENV->mutex_set_increment method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
increment
The increment parameter is the number of additional mutexes to +allocate. +
+

Errors

+

The DB_ENV->mutex_set_increment method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DB_ENV->mutex_get_increment

+

The DB_ENV->mutex_get_increment method returns the number of additional mutexes to allocate.

+

The DB_ENV->mutex_get_increment method may be called at any time during the life of the +application.

+

The DB_ENV->mutex_get_increment method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
incrementp
The DB_ENV->mutex_get_increment method returns the +number of additional mutexes to allocate in incrementp. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/mutex_set_tas_spins.html b/db/docs/api_c/mutex_set_tas_spins.html new file mode 100644 index 000000000..5df720c79 --- /dev/null +++ b/db/docs/api_c/mutex_set_tas_spins.html @@ -0,0 +1,89 @@ + + + + + + +Berkeley DB: DB_ENV->mutex_set_tas_spins + + + + + + + +
+

DB_ENV->mutex_set_tas_spins

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->mutex_set_tas_spins(DB_ENV *dbenv, u_int32_t tas_spins); +

+int +DB_ENV->mutex_get_tas_spins(DB_ENV *dbenv, u_int32_t *tas_spinsp); +

+
+

Description: DB_ENV->mutex_set_tas_spins

+

Specify that test-and-set mutexes should spin tas_spins times +without blocking. The value defaults to 1 on uniprocessor systems and +to 50 times the number of processors on multiprocessor systems.

+

The database environment's test-and-set spin count may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_tas_spins", one or more whitespace +characters, and the number of spins. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DB_ENV->mutex_set_tas_spins method configures operations performed using the specified +DB_ENV handle, not all operations performed on the underlying +database environment.

+

The DB_ENV->mutex_set_tas_spins method may be called at any time during the life of the +application.

+

The DB_ENV->mutex_set_tas_spins method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
tas_spins
The tas_spins parameter is the number of spins test-and-set +mutexes should execute before blocking. +
+

Errors

+

The DB_ENV->mutex_set_tas_spins method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DB_ENV->mutex_get_tas_spins

+

The DB_ENV->mutex_get_tas_spins method returns the test-and-set spin count.

+

The DB_ENV->mutex_get_tas_spins method may be called at any time during the life of the +application.

+

The DB_ENV->mutex_get_tas_spins method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
tas_spinsp
The DB_ENV->mutex_get_tas_spins method returns the +test-and-set spin count in tas_spinsp. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/mutex_stat.html b/db/docs/api_c/mutex_stat.html new file mode 100644 index 000000000..a60fcdce6 --- /dev/null +++ b/db/docs/api_c/mutex_stat.html @@ -0,0 +1,113 @@ + + + + + + +Berkeley DB: DB_ENV->mutex_stat + + + + + + + +
+

DB_ENV->mutex_stat

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->mutex_stat(DB_ENV *env, DB_MUTEX_STAT **statp, u_int32_t flags); +

+int +DB_ENV->mutex_stat_print(DB_ENV *env, u_int32_t flags); +

+
+

Description: DB_ENV->mutex_stat

+

The DB_ENV->mutex_stat method returns the mutex subsystem statistics.

+

The DB_ENV->mutex_stat method creates a statistical structure of type +DB_MUTEX_STAT and copies a pointer to it into a user-specified memory +location.

+

Statistical structures are stored in allocated memory. If application-specific allocation +routines have been declared (see DB_ENV->set_alloc for more +information), they are used to allocate the memory; otherwise, the +standard C library malloc(3) is used. The caller is +responsible for deallocating the memory. To deallocate the memory, free +the memory reference; references inside the returned memory need not be +individually freed.

+

The following DB_MUTEX_STAT fields will be filled in:

+
+
u_int32_t st_mutex_align;
The mutex alignment, in bytes. +
u_int32_t st_mutex_tas_spins;
The number of times test-and-set mutexes will spin without blocking. +
int st_mutex_cnt;
The total number of mutexes configured. +
u_int32_t st_mutex_free;
The number of mutexes currently available. +
u_int32_t st_mutex_inuse;
The number of mutexes currently in use. +
u_int32_t st_mutex_inuse_max;
The maximum number of mutexes ever in use. +
roff_t st_regsize;
The size of the mutex region, in bytes. +
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before +obtaining the mutex region mutex. +
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain +the mutex region mutex without waiting. +
+

The DB_ENV->mutex_stat method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_STAT_CLEAR
Reset statistics after returning their values. +
+
statp
The statp parameter references memory into which +a pointer to the allocated statistics structure is copied. +
+

Errors

+

The DB_ENV->mutex_stat method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DB_ENV->mutex_stat_print

+

The DB_ENV->mutex_stat_print method displays the +mutex subsystem statistical information, as described for the DB_ENV->mutex_stat method. +The information is printed to a specified output channel (see the +DB_ENV->set_msgfile method for more information), or passed to an +application callback function (see the DB_ENV->set_msgcall method for +more information).

+

The DB_ENV->mutex_stat_print method may not be called before the DB_ENV->open method has +been called.

+

The DB_ENV->mutex_stat_print method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values: +
+
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values. +
+
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/mutex_unlock.html b/db/docs/api_c/mutex_unlock.html new file mode 100644 index 000000000..5b3f85179 --- /dev/null +++ b/db/docs/api_c/mutex_unlock.html @@ -0,0 +1,61 @@ + + + + + + +Berkeley DB: DB_ENV->mutex_unlock + + + + + + + +
+

DB_ENV->mutex_unlock

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->mutex_unlock(DB_ENV *dbenv, db_mutex_t mutex); +

+
+

Description: DB_ENV->mutex_unlock

+

The DB_ENV->mutex_unlock method unlocks the mutex locked by +DB_ENV->mutex_lock.

+

The DB_ENV->mutex_unlock method may not be called before the DB_ENV->open method has +been called.

+

The DB_ENV->mutex_unlock method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
mutex
The mutex parameter is a mutex previously locked by +DB_ENV->mutex_lock. +
+

Errors

+

The DB_ENV->mutex_unlock method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_ENV +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/object.html b/db/docs/api_c/object.html index c0ca280d7..1aff307b0 100644 --- a/db/docs/api_c/object.html +++ b/db/docs/api_c/object.html @@ -1,4 +1,4 @@ - + Berkeley DB API @@ -23,6 +23,7 @@ href="../api_c/c_pindex.html" Locking
Logging
Memory Pool
+Mutexes
Replication
Sequences
Transactions
diff --git a/db/docs/api_c/rep_config.html b/db/docs/api_c/rep_config.html new file mode 100644 index 000000000..d6cd0aca5 --- /dev/null +++ b/db/docs/api_c/rep_config.html @@ -0,0 +1,106 @@ + + + + + + +Berkeley DB: DB_ENV->rep_set_config + + + + + + + +
+

DB_ENV->rep_set_config

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->rep_set_config(DB_ENV *env, u_int32_t which, int onoff); +

+int +DB_ENV->rep_get_config(DB_ENV *dbenv, u_int32_t which, int *onoffp); +

+
+

Description: DB_ENV->rep_set_config

+

The DB_ENV->rep_set_config method method configures the Berkeley DB replication +subsystem.

+

The database environment's replication subsystem may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "rep_set_config", one or more whitespace +characters, and the method which parameter as a string; for example, +"rep_set_config REP_CONF_NOWAIT". +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DB_ENV->rep_set_config method configures a database environment, not only operations +performed using the specified DB_ENV handle.

+

The DB_ENV->rep_set_config method may be called at any time during the life of the +application.

+

The DB_ENV->rep_set_config method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
onoff
If the onoff parameter is zero, the configuration flag is turned +off. Otherwise, it is turned on. +
which
The which parameter must be set to one of the following values: +
+
DB_REP_CONF_BULK
The replication master sends groups of records to the clients in a +single network transfer (defaults to off). +
DB_REP_CONF_DELAYCLIENT
The client should delay synchronizing to a newly declared master +(defaults to off). Clients configured in this way will remain +unsynchronized until the application calls the DB_ENV->rep_sync method. +
DB_REP_CONF_NOAUTOINIT
The replication master will not automatically re-initialize outdated +clients (defaults to off). +

The DB_REP_CONF_NOAUTOINIT flag is not supported by Replication +Manager.

+
DB_REP_CONF_NOWAIT
Berkeley DB method calls that would normally block while clients are in +recovery will return errors immediately (defaults to off). +
+
+

Errors

+

The DB_ENV->rep_set_config method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DB_ENV->rep_get_config

+

The DB_ENV->rep_get_config method returns whether the specified which +parameter is currently set or not.

+

The DB_ENV->rep_get_config method may be called at any time during the life of the +application.

+

The DB_ENV->rep_get_config method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
which
The which parameter is the message value for which configuration +is being checked. +
onoffp
The onoffp parameter references memory into which + the configuration of the specified which parameter is copied. If the returned onoff value is zero, the parameter is off; +otherwise on. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/rep_elect.html b/db/docs/api_c/rep_elect.html index f765b4dea..d8dcf255a 100644 --- a/db/docs/api_c/rep_elect.html +++ b/db/docs/api_c/rep_elect.html @@ -1,5 +1,5 @@ - - + + @@ -23,57 +23,89 @@ #include <db.h>

int -DB_ENV->rep_elect(DB_ENV *env, int nsites, int nvotes, - int priority, u_int32_t timeout, int *envid, u_int32_t flags); +DB_ENV->rep_elect(DB_ENV *env, + int nsites, int nvotes, int *envid, u_int32_t flags);


Description: DB_ENV->rep_elect

The DB_ENV->rep_elect method holds an election for the master of a replication group.

+

The DB_ENV->rep_elect method is not called by most replication +applications. It should only be called by applications implementing +their own network transport layer, explicitly holding replication group +elections and handling replication messages outside of the replication +manager framework.

If the election is successful, the new master's ID may be the ID of the -previous master, or the ID of the current environment. The application -is responsible for adjusting its usage of the other environments in the -replication group, including directing all database updates to the newly -selected master, in accordance with the results of this election.

+previous master, or the ID of the current replication site. The +application is responsible for adjusting its relationship to the other +database environments in the replication group, including directing all +database updates to the newly selected master, in accordance with the +results of this election.

The thread of control that calls the DB_ENV->rep_elect method must not be the thread of control that processes incoming messages; processing the incoming messages is necessary to successfully complete an election.

Parameters

envid
The envid parameter references memory into which - the newly elected master's ID is copied. -
nsites
The nsites parameter indicates the number of environments that -the application believes are in the replication group. This number is -used by Berkeley DB to avoid having two masters active simultaneously, even -in the case of a network partition. During an election, a new master -cannot be elected unless more than half of nsites agree on the -new master. Thus, in the face of a network partition, the side of the -partition with more than half the environments will elect a new master -and continue, while the environments communicating with fewer than half -the other environments will fail to find a new master. -
nvotes
The nvotes parameter indicates the number of votes required by -the application to successfully elect a new master. It must be a -positive integer, no greater than nsites, or 0 if the election -should use a simple majority of the nsites value as the -requirement. A warning is given if half or fewer votes are required to -win an election as that can potentially lead to multiple masters in the -face of a network partition. -
priority
The priority parameter is the priority of this environment. It -must be a positive integer, or 0 if this environment is not permitted -to become a master (see Replication -environment priorities for more information). -
timeout
The timeout parameter specifies a timeout period for an election. -If the election has not completed after timeout microseconds, the -election will fail. + the newly elected master's ID is copied. +
nsites
The nsites parameter specifies the number of replication sites +expected to participate in the election. Once the current site has +election information from that many sites, it will short-circuit the +election and immediately cast its vote for a new master. The +nsites parameter must be a positive integer, no less than +nvotes, or 0 if the election should use the value previously set +using the DB_ENV->rep_set_nsites method. +
nvotes
The nvotes parameter specifies the minimum number of replication +sites from which the current site must have election information, before +the current site will cast a vote for a new master. The nvotes +parameter must be a positive integer and no greater than nsites, +or 0 if the election should use the value ((nsites / 2) + 1) as +the nvotes argument.
flags
The flags parameter is currently unused, and must be set to 0.
+

Elections are done in two parts: first, replication sites collect +information from the other replication sites they know about, and +second, replication sites cast their votes for a new master. The second +phase is triggered by one of two things: either the replication site +gets election information from nsites sites, or the election +timeout expires. Once the second phase is triggered, the +replication site will cast a vote for the new master of its choice if, +and only if, the site has election information from at least +nvotes sites. If a site receives nvotes votes for it +to become the new master, then it will become the new master.

+

We recommend nvotes be set to at least:

+
(sites participating in the election / 2) + 1
+

to ensure there are never more than two masters active at the same time +even in the case of a network partition. When a network partitions, the +side of the partition with more than half the environments will elect a +new master and continue, while the environments communicating with fewer +than half of the environments will fail to find a new master, as no site +can get nvotes votes.

+

We recommend nsites be set to:

+
number of sites in the replication group - 1
+

when choosing a new master after a current master fails. This allows +the group to reach a consensus without having to wait for the timeout +to expire.

+

When choosing a master from among a group of client +sites all restarting at the same time, it makes more sense to set +nsites to the total number of sites in the group, since there is no +known missing site. Furthermore, in order to ensure the best choice +from among sites that may take longer to boot than the local site, +setting nvotes also to this same total number of sites will +guarantee that every site in the group is considered. (See the +Elections +section in the Berkeley DB Reference Guide for more information.)

+

Setting nsites to lower values can increase the speed of an +election, but can also result in election failure, and is usually not +recommended.

Errors

The DB_ENV->rep_elect method may fail and return one of the following non-zero errors:

DB_REP_UNAVAIL
The replication group was unable to elect a master, or was unable to -complete the election in the specified timeout period. +complete the election in the election timeout period (see +DB_ENV->rep_set_timeout method for more information).

Class

@@ -84,6 +116,6 @@ complete the election in the specified timeout period.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/rep_limit.html b/db/docs/api_c/rep_limit.html index 67b592219..68d01cb67 100644 --- a/db/docs/api_c/rep_limit.html +++ b/db/docs/api_c/rep_limit.html @@ -1,17 +1,17 @@ - - + + -Berkeley DB: DB_ENV->set_rep_limit +Berkeley DB: DB_ENV->rep_set_limit + @@ -26,6 +27,7 @@ + @@ -34,8 +36,6 @@ - - @@ -53,15 +53,16 @@ + - + - + @@ -69,16 +70,16 @@ - + - + @@ -87,7 +88,7 @@ - + @@ -96,18 +97,10 @@ - - - - - - - - @@ -132,21 +125,11 @@ - - - - - - - - - - - + @@ -155,6 +138,12 @@ + + + + + + @@ -164,6 +153,8 @@ + + @@ -171,6 +162,7 @@ + @@ -178,7 +170,6 @@ - @@ -189,6 +180,7 @@ + @@ -226,13 +218,11 @@ - - - - + + @@ -240,6 +230,12 @@ + + + + + + @@ -256,6 +252,7 @@ + @@ -281,24 +278,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + @@ -325,11 +360,15 @@ + + + + @@ -357,6 +396,9 @@ + + + @@ -368,6 +410,7 @@ + @@ -380,14 +423,15 @@ - + + - + - + @@ -396,12 +440,12 @@ - + - + @@ -415,10 +459,10 @@ - + @@ -430,7 +474,8 @@ - + + @@ -443,7 +488,7 @@ - + @@ -456,19 +501,22 @@ - + - + - + + + + @@ -480,24 +528,24 @@ - + - + - + - + - + @@ -519,17 +567,17 @@ - + - + - + @@ -548,8 +596,8 @@ - + @@ -569,11 +617,10 @@ - - + @@ -584,6 +631,8 @@ + + @@ -596,6 +645,6 @@
-

DB_ENV->set_rep_limit

+

DB_ENV->rep_set_limit

API @@ -23,20 +23,22 @@ #include <db.h>

int -DB_ENV->set_rep_limit(DB_ENV *env, u_int32_t gbytes, u_int32_t bytes); +DB_ENV->rep_set_limit(DB_ENV *env, u_int32_t gbytes, u_int32_t bytes);

int -DB_ENV->get_rep_limit(DB_ENV *dbenv, u_int32_t *gbytesp, u_int32_t *bytesp); +DB_ENV->rep_get_limit(DB_ENV *dbenv, u_int32_t *gbytesp, u_int32_t *bytesp);


-

Description: DB_ENV->set_rep_limit

-

The DB_ENV->set_rep_limit method imposes a byte-count limit on the amount of data -that will be transmitted from a site in a single call to DB_ENV->rep_process_message method.

-

The DB_ENV->set_rep_limit method configures a database environment, not only operations +

Description: DB_ENV->rep_set_limit

+

The DB_ENV->rep_set_limit method sets a byte-count limit on the amount of data +that will be transmitted from a site in response to a single message +processed by the DB_ENV->rep_process_message method. The limit is not a hard limit, +and the record that exceeds the limit is the last record to be sent.

+

The DB_ENV->rep_set_limit method configures a database environment, not only operations performed using the specified DB_ENV handle.

-

The DB_ENV->set_rep_limit method may not be called before the DB_ENV->open method has -been called.

-

The DB_ENV->set_rep_limit method +

The DB_ENV->rep_set_limit method may be called at any time during the life of the +application.

+

The DB_ENV->rep_set_limit method returns a non-zero error value on failure and 0 on success.

@@ -48,19 +50,19 @@ number of bytes that will be sent in a single call to DB_ENV->rep_process_message method.
-

Description: dbenv_get_rep_limit

-

The DB_ENV->get_rep_limit method may be called at any time during the life of the +

Description: rep_get_limit

+

The DB_ENV->rep_get_limit method may be called at any time during the life of the application.

-

The DB_ENV->get_rep_limit method +

The DB_ENV->rep_get_limit method returns a non-zero error value on failure and 0 on success.

Parameters

bytesp
The bytesp parameter references memory into which - the additional bytes of memory in the current transmit limit is copied. + the additional bytes of memory in the current transmit limit is copied.
gbytesp
The gbytesp parameter references memory into which - the gigabytes of memory in the in the current transmit limit is copied. + the gigabytes of memory in the in the current transmit limit is copied.

Class

@@ -71,6 +73,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/rep_list.html b/db/docs/api_c/rep_list.html index 275110849..95c4f8bff 100644 --- a/db/docs/api_c/rep_list.html +++ b/db/docs/api_c/rep_list.html @@ -1,5 +1,5 @@ - + @@ -10,17 +10,29 @@

Berkeley DB: Replication and Related Methods

- + - + + + + + + + + + + - - - + + + + + +
Replication and Related MethodsDescription
Replication Manager MethodsDescription
DB_ENV->repmgr_add_remote_siteSpecify the replication manager's remote sites
DB_ENV->repmgr_set_ack_policySpecify the replication manager's client acknowledgement policy
DB_ENV->repmgr_set_local_siteSpecify the replication manager's local site
DB_ENV->repmgr_site_listList the sites and their status
DB_ENV->repmgr_startStart the replication manager
Base Replication API
DB_ENV->rep_electHold a replication election
DB_ENV->rep_process_messageProcess a replication message
DB_ENV->rep_startConfigure an environment for replication
Additional Replication Methods
DB_ENV->rep_statReplication statistics
DB_ENV->rep_syncReplication synchronization
Replication Configuration
DB_ENV->rep_startConfigure an environment for replication
DB_ENV->set_rep_limitLimit data sent in response to a single message
DB_ENV->set_rep_transportConfigure replication transport
DB_ENV->rep_set_configConfigure the replication subsystem
DB_ENV->rep_set_limitLimit data sent in response to a single message
DB_ENV->rep_set_nsitesConfigure replication group site count
DB_ENV->rep_set_priorityConfigure replication site priority
DB_ENV->rep_set_timeoutConfigure replication timeouts
DB_ENV->rep_set_transportConfigure replication transport callback
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/rep_message.html b/db/docs/api_c/rep_message.html index c13301089..66f7c15dc 100644 --- a/db/docs/api_c/rep_message.html +++ b/db/docs/api_c/rep_message.html @@ -1,5 +1,5 @@ - - + + @@ -30,6 +30,11 @@ DB_ENV->rep_process_message(DB_ENV *env,

Description: DB_ENV->rep_process_message

The DB_ENV->rep_process_message method processes an incoming replication message sent by a member of the replication group to the local database environment.

+

The DB_ENV->rep_process_message method is not called by most replication +applications. It should only be called by applications implementing +their own network transport layer, explicitly holding replication group +elections and handling replication messages outside of the replication +manager framework.

For implementation reasons, all incoming replication messages must be processed using the same DB_ENV handle. It is not required that a single thread of control process all messages, only that all threads @@ -48,13 +53,25 @@ The application should reconfigure itself as a client by calling the will return DB_REP_HOLDELECTION if an election is needed. The application should call for an election by calling DB_ENV->rep_elect.

+
DB_REP_IGNORE
+

The DB_ENV->rep_process_message method will return DB_REP_IGNORE if this message cannot be processed. +This is an indication that this message is irrelevant to the current +replication state (for example, an old message +from a previous generation arrives and is processed late). +

DB_REP_ISPERM

The DB_ENV->rep_process_message method will return DB_REP_ISPERM if processing this message results in the processing of records that are permanent. The maximum LSN of the permanent records stored is returned.

+
DB_REP_JOIN_FAILURE
+

The DB_ENV->rep_process_message method will return DB_REP_JOIN_FAILURE if a new master has been chosen but the client is unable to synchronize +with the new master (possibly because the client has been configured +with the DB_REP_CONF_NOAUTOINIT flag to turn-off automatic +internal initialization). +

DB_REP_NEWMASTER
-

The DB_ENV->rep_process_message method will return DB_REP_NEWMASTER if a new master has been elected. +

The DB_ENV->rep_process_message method will return DB_REP_NEWMASTER if a new master has been chosen. The envid parameter contains the environment ID of the new master. If the recipient of this error return has been made master, it is the application's responsibility to begin acting as the master @@ -70,14 +87,9 @@ channel with this new environment.

DB_REP_NOTPERM

The DB_ENV->rep_process_message method will return DB_REP_NOTPERM if a message carrying a DB_REP_PERMANENT flag was processed successfully, but was not written to disk. -The LSN of this record is returned. -The application should take whatever action is deemed necessary to -retain its recoverability characteristics. -

-
DB_REP_STARTUPDONE
-

The DB_ENV->rep_process_message method will return DB_REP_STARTUPDONE if the system detects that a client completed startup synchronization. -The client application knows that this client is now processing -live log records received from the master. +The LSN of this record is returned. The application should take +whatever action is deemed necessary to retain its recoverability +characteristics.

Unless otherwise specified, the DB_ENV->rep_process_message method @@ -95,7 +107,7 @@ corresponds to the environment that sent the message to be processed information).

rec
The rec parameter should reference a copy of the rec parameter specified by Berkeley DB on the sending environment. -
ret_lsn
If DB_ENV->rep_process_message method returns DB_REP_NOTPERM then the ret_lsnp +
ret_lsnp
If DB_ENV->rep_process_message method returns DB_REP_NOTPERM then the ret_lsnp parameter will contain the log sequence number of this permanent log message that could not be written to disk. If DB_ENV->rep_process_message method returns DB_REP_ISPERM then the ret_lsnp parameter will contain @@ -112,6 +124,6 @@ cases the value of ret_lsnp is undefined.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/rep_nsites.html b/db/docs/api_c/rep_nsites.html new file mode 100644 index 000000000..f6845b926 --- /dev/null +++ b/db/docs/api_c/rep_nsites.html @@ -0,0 +1,77 @@ + + + + + + +Berkeley DB: DB_ENV->rep_set_nsites + + + + + + + +
+

DB_ENV->rep_set_nsites

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->rep_set_nsites(DB_ENV *env, int nsites); +

+int +DB_ENV->rep_get_nsites(DB_ENV *env, int *nsitesp); +

+
+

Description: DB_ENV->rep_set_nsites

+

The DB_ENV->rep_set_nsites method specifies the total number of sites +in a replication group.

+

The DB_ENV->rep_set_nsites method is typically called by applications which +use the Berkeley DB library "replication manager" support. (However, see +also the DB_ENV->rep_elect man page, the description of the nsites +parameter.)

+

The DB_ENV->rep_set_nsites method configures a database environment, not only operations +performed using the specified DB_ENV handle.

+

The DB_ENV->rep_set_nsites method may be called at any time during the life of the +application.

+

The DB_ENV->rep_set_nsites method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
nsites
A positive integer specifying the total number of sites in the replication +group. +
+
+

Description: DB_ENV->rep_get_nsites

+

The DB_ENV->rep_get_nsites method returns the total number of sites in the replication group.

+

The DB_ENV->rep_get_nsites method may be called at any time during the life of the +application.

+

The DB_ENV->rep_get_nsites method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
nsitesp
The DB_ENV->rep_get_nsites method returns the +total number of sites in the replication group in nsitesp. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/rep_priority.html b/db/docs/api_c/rep_priority.html new file mode 100644 index 000000000..aa87e9125 --- /dev/null +++ b/db/docs/api_c/rep_priority.html @@ -0,0 +1,75 @@ + + + + + + +Berkeley DB: DB_ENV->rep_set_priority + + + + + + + +
+

DB_ENV->rep_set_priority

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->rep_set_priority(DB_ENV *env, int priority); +int +DB_ENV->rep_get_priority(DB_ENV *env, int *priorityp); +

+
+

Description: DB_ENV->rep_set_priority

+

The DB_ENV->rep_set_priority method specifies the database environment's +priority in replication group elections. The priority must be a +positive integer, or 0 if this environment cannot be a replication +group master.

+

The DB_ENV->rep_set_priority method configures a database environment, not only operations +performed using the specified DB_ENV handle.

+

The DB_ENV->rep_set_priority method may be called at any time during the life of the +application.

+

The DB_ENV->rep_set_priority method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
priority
The priority of this database environment in the replication group. The +priority must be a positive integer, or 0 if this environment cannot be +a replication group master. (See Replication environment priorities for more information). +
+
+

Description: DB_ENV->rep_get_priority

+

The DB_ENV->rep_get_priority method returns the database environment priority.

+

The DB_ENV->rep_get_priority method may be called at any time during the life of the +application.

+

The DB_ENV->rep_get_priority method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
priorityp
The DB_ENV->rep_get_priority method returns the +database environment priority in priorityp. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/rep_start.html b/db/docs/api_c/rep_start.html index 8d425dfd9..b13ac31c7 100644 --- a/db/docs/api_c/rep_start.html +++ b/db/docs/api_c/rep_start.html @@ -1,5 +1,5 @@ - - + + @@ -28,26 +28,31 @@ DB_ENV->rep_start(DB_ENV *env, DBT *cdata, u_int32_t flags);


Description: DB_ENV->rep_start

The DB_ENV->rep_start method configures the database environment as a client -or master in a group of replicated database environments. Replication -master environments are the only database environments where replicated -databases may be modified. Replication client environments are -read-only as long as they are clients. Replication client environments -may be upgraded to be replication master environments in the case that -the current master fails or there is no master present.

+or master in a group of replicated database environments.

+

The DB_ENV->rep_start method is not called by most replication +applications. It should only be called by applications implementing +their own network transport layer, explicitly holding replication group +elections and handling replication messages outside of the replication +manager framework.

+

Replication master environments are the only database environments where +replicated databases may be modified. Replication client environments +are read-only as long as they are clients. Replication client +environments may be upgraded to be replication master environments in +the case that the current master fails or there is no master present.

The enclosing database environment must already have been opened by calling the DB_ENV->open method and must already have been configured -to send replication messages by calling the DB_ENV->set_rep_transport method.

+to send replication messages by calling the DB_ENV->rep_set_transport method.

The DB_ENV->rep_start method returns a non-zero error value on failure and 0 on success.

Parameters

-
cdata
The cdata parameter is an opaque data item that is sent over -the communication infrastructure when the client or master comes online -(see Connecting to a new site for -more information). If no such information is useful, cdata -should be NULL. +
cdata
The cdata parameter is an opaque data item that is sent over the +communication infrastructure when the client comes online (see +Connecting to a new site for more +information). If no such information is useful, cdata should +be NULL.
flags
The flags parameter must be set to one of the following values:
DB_REP_CLIENT
Configure the environment as a replication client. @@ -59,7 +64,7 @@ should be NULL. may fail and return one of the following non-zero errors:

EINVAL
If the database environment was not already configured to communicate with -a replication group by a call to DB_ENV->set_rep_transport; +a replication group by a call to DB_ENV->rep_set_transport; the database environment was not already opened; or if an invalid flag value or parameter was specified.
@@ -72,6 +77,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/rep_stat.html b/db/docs/api_c/rep_stat.html index 627fdab2c..5c38ed2ae 100644 --- a/db/docs/api_c/rep_stat.html +++ b/db/docs/api_c/rep_stat.html @@ -1,5 +1,5 @@ - - + + @@ -43,19 +43,45 @@ the memory reference; references inside the returned memory need not be individually freed.

The following DB_REP_STAT fields will be filled in:

-
u_int32_t st_status;
The current replication mode. Set to DB_REP_MASTER if the -environment is a replication master, DB_REP_CLIENT if the -environment is a replication client, or 0 if replication is not -configured. -
DB_LSN st_next_lsn;
In replication environments configured as masters, the next LSN expected. -In replication environments configured as clients, the next LSN to be used. -
DB_LSN st_waiting_lsn;
The LSN of the first log record we have after missing log records -being waited for, or 0 if no log records are currently missing. +
u_int32_t st_bulk_fills;
The number of times the bulk buffer filled up, forcing the buffer content +to be sent. +
u_int32_t st_bulk_overflows;
The number of times a record was bigger than the entire bulk buffer, +and therefore had to be sent as a singleton. +
u_int32_t st_bulk_records;
The number of records added to a bulk buffer. +
u_int32_t st_bulk_transfers;
The number of bulk buffers transferred (via a call to the +application's send function). +
u_int32_t st_client_rerequests;
The number of times this client site received a "re-request" message, +indicating that a request it previously sent to another client could +not be serviced by that client. (Compare to +st_client_svc_miss.) +
u_int32_t st_client_svc_miss;
The number of "request" type messages received by this client that +could not be processed, forcing the originating requester to try sending +the request to the master (or another client). +
u_int32_t st_client_svc_req;
The number of "request" type messages received by this client. +("Request" messages are usually sent from a client to the master, but a +message marked with the DB_REP_ANYWHERE flag in the invocation +of the application's send function may be sent to another client +instead.)
u_int32_t st_dupmasters;
The number of duplicate master conditions detected. +
u_int32_t st_egen;
The current election generation number. +
u_int32_t st_election_cur_winner;
The election winner. +
u_int32_t st_election_gen;
The election generation number. +
DB_LSN st_election_lsn;
The maximum LSN of election winner. +
u_int32_t st_election_nsites;
The number sites responding to this site during the last election. +
u_int32_t st_election_nvotes;
The number of votes required in the last election. +
u_int32_t st_election_priority;
The election priority. +
u_int32_t st_election_sec;
The number of seconds the last election took (the total election time +is st_election_sec plus st_election_usec). +
u_int32_t st_election_status;
The current election phase (0 if no election is in progress). +
u_int32_t st_election_tiebreaker;
The election tiebreaker value. +
u_int32_t st_election_usec;
The number of microseconds the last election took (the total election +time is st_election_sec plus st_election_usec). +
u_int32_t st_election_votes;
The number of votes received in the last election. +
u_int32_t st_elections;
The number of elections held. +
u_int32_t st_elections_won;
The number of elections won.
u_int32_t st_env_id;
The current environment ID.
u_int32_t st_env_priority;
The current environment priority.
u_int32_t st_gen;
The current generation number. -
u_int32_t st_egen;
The current election generation number.
u_int32_t st_log_duplicated;
The number of duplicate log records received.
u_int32_t st_log_queued;
The number of log records currently queued.
u_int32_t st_log_queued_max;
The maximum number of log records ever queued at once. @@ -70,31 +96,28 @@ being waited for, or 0 if no log records are currently missing.
u_int32_t st_msgs_send_failures;
The number of failed message sends.
u_int32_t st_msgs_sent;
The number of messages sent.
u_int32_t st_newsites;
The number of new site messages received. -
int st_nsites;
The number of sites believed to be in the replication group. -
u_int32_t st_outdated;
The number of outdated conditions detected. +
DB_LSN st_next_lsn;
In replication environments configured as masters, the next LSN expected. +In replication environments configured as clients, the next LSN to be used.
u_int32_t st_next_pg;
The next page number we expect to receive. -
u_int32_t st_waiting_pg;
The page number of the first page we have after missing pages -being waited for, or 0 if no pages are currently missing. +
int st_nsites;
The number of sites used in the last election. +
u_int32_t st_nthrottles;
Transmission limited. This indicates the number of times that data +transmission was stopped to limit the amount of data sent in response +to a single call to DB_ENV->rep_process_message. +
u_int32_t st_outdated;
The number of outdated conditions detected.
u_int32_t st_pg_duplicated;
The number of duplicate pages received.
u_int32_t st_pg_records;
The number of pages received and stored.
u_int32_t st_pg_requested;
The number of pages missed and requested from the master.
u_int32_t st_startup_complete;
The client site has completed its startup procedures and is now handling live records from the master. +
u_int32_t st_status;
The current replication mode. Set to DB_REP_MASTER if the +environment is a replication master, DB_REP_CLIENT if the +environment is a replication client, or 0 if replication is not +configured.
u_int32_t st_txns_applied;
The number of transactions applied. -
u_int32_t st_elections;
The number of elections held. -
u_int32_t st_elections_won;
The number of elections won. -
u_int32_t st_election_status;
The current election phase (0 if no election is in progress). -
u_int32_t st_election_cur_winner;
The election winner. -
u_int32_t st_election_gen;
The election generation number. -
DB_LSN st_election_lsn;
The maximum LSN of election winner. -
u_int32_t st_election_nsites;
The number sites expected to participate in elections. -
u_int32_t st_election_nvotes;
The number of votes required to complete the election. -
u_int32_t st_nthrottles;
Transmission limited. This indicates the number of times that data -transmission was stopped to limit the amount of data sent in response -to a single call to DB_ENV->rep_process_message. -
u_int32_t st_election_priority;
The election priority. -
u_int32_t st_election_tiebreaker;
The election tiebreaker value. -
u_int32_t st_election_votes;
The votes received this election round. +
DB_LSN st_waiting_lsn;
The LSN of the first log record we have after missing log records +being waited for, or 0 if no log records are currently missing. +
u_int32_t st_waiting_pg;
The page number of the first page we have after missing pages +being waited for, or 0 if no pages are currently missing.

The DB_ENV->rep_stat method returns a non-zero error value on failure @@ -108,7 +131,7 @@ the following value:

DB_STAT_CLEAR
Reset statistics after returning their values.
statp
The statp parameter references memory into which -a pointer to the allocated statistics structure is copied. +a pointer to the allocated statistics structure is copied.

Errors

The DB_ENV->rep_stat method @@ -119,7 +142,7 @@ invalid flag value or parameter was specified.


Description: DB_ENV->rep_stat_print

-

The DB_ENV->rep_stat_print method returns the +

The DB_ENV->rep_stat_print method displays the replication subsystem statistical information, as described for the DB_ENV->rep_stat method. The information is printed to a specified output channel (see the DB_ENV->set_msgfile method for more information), or passed to an @@ -133,10 +156,11 @@ and 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values.

@@ -148,6 +172,6 @@ the following value:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/rep_sync.html b/db/docs/api_c/rep_sync.html new file mode 100644 index 000000000..e0d55abf5 --- /dev/null +++ b/db/docs/api_c/rep_sync.html @@ -0,0 +1,62 @@ + + + + + + +Berkeley DB: DB_ENV->rep_sync + + + + + + + +
+

DB_ENV->rep_sync

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->rep_sync(DB_ENV *env, u_int32_t flags); +

+
+

Description: DB_ENV->rep_sync

+

The DB_ENV->rep_sync method forces master synchronization to begin for this +client. This method is the other half of setting the +DB_REP_CONF_DELAYCLIENT flag via the DB_ENV->rep_set_config method.

+

If an application has configured delayed master synchronization, the +application must synchronize explicitly (otherwise the client will +remain out-of-date and will ignore all database changes forwarded from +the replication group master). The DB_ENV->rep_sync method may be called any +time after the client application learns that the new master has been +established, either by receiving a DB_EVENT_REP_NEWMASTER event +notification, or from a DB_REP_NEWMASTER return code from +DB_ENV->rep_process_message.

+

The DB_ENV->rep_sync method may not be called before the DB_ENV->open method has +been called.

+

The DB_ENV->rep_sync method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
flags
The flags parameter is currently unused, and must be set to 0. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/rep_timeout.html b/db/docs/api_c/rep_timeout.html new file mode 100644 index 000000000..c535cbff6 --- /dev/null +++ b/db/docs/api_c/rep_timeout.html @@ -0,0 +1,97 @@ + + + + + + +Berkeley DB: DB_ENV->rep_set_timeout + + + + + + + +
+

DB_ENV->rep_set_timeout

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->rep_set_timeout(DB_ENV *env, int which, u_int32_t timeout); +

+int +DB_ENV->rep_get_timeout(DB_ENV *env, int which, u_int32_t *timeoutp); +

+
+

Description: DB_ENV->rep_set_timeout

+

The DB_ENV->rep_set_timeout method specifies a variety of replication timeout +values.

+

The DB_ENV->rep_set_timeout method configures a database environment, not only operations +performed using the specified DB_ENV handle.

+

The DB_ENV->rep_set_timeout method may be called at any time during the life of the +application.

+

The DB_ENV->rep_set_timeout method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
which
The which parameter must be set to one of the following values: +
+
DB_REP_ACK_TIMEOUT
Configure the amount of time the replication manager's transport +function waits to collect enough acknowledgments from replication group +clients, before giving up and returning a failure indication. The +default wait time is 1 second. +
DB_REP_ELECTION_TIMEOUT
The timeout period for an election. The default timeout is 2 seconds. +
DB_REP_ELECTION_RETRY
Configure the amount of time the replication manager will wait before +retrying a failed election. The default wait time is 10 seconds. +
DB_REP_CONNECTION_RETRY
Configure the amount of time the replication manager will wait before +trying to re-establish a connection to another site after a communication +failure. The default wait time is 30 seconds. +
+
timeout
The timeout parameter is the timeout value. It must be specified +as an unsigned 32-bit number of microseconds, limiting the maximum timeout +to roughly 71 minutes. +
+

Errors

+

The DB_ENV->rep_set_timeout method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DB_ENV->rep_get_timeout

+

The DB_ENV->rep_get_timeout method returns the timeout value for the specified +which parameter.

+

The DB_ENV->rep_get_timeout method may be called at any time during the life of the +application.

+

The DB_ENV->rep_get_timeout method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
which
The which parameter is the timeout value for which the value +is being returned. +
timeoutp
The timeoutp parameter references memory into which + the timeout value of the specified which parameter is copied. The returned timeout value is in microseconds. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/rep_transport.html b/db/docs/api_c/rep_transport.html index f4ee7ae9a..f6addcbd8 100644 --- a/db/docs/api_c/rep_transport.html +++ b/db/docs/api_c/rep_transport.html @@ -1,17 +1,17 @@ - - + + -Berkeley DB: DB_ENV->set_rep_transport +Berkeley DB: DB_ENV->rep_set_transport
-

DB_ENV->set_rep_transport

+

DB_ENV->rep_set_transport

API @@ -23,28 +23,33 @@ #include <db.h>

int -DB_ENV->set_rep_transport(DB_ENV *env, int envid, +DB_ENV->rep_set_transport(DB_ENV *env, int envid, int (*send)(DB_ENV *dbenv, const DBT *control, const DBT *rec, const DB_LSN *lsnp, int envid, u_int32_t flags));


-

Description: DB_ENV->set_rep_transport

-

The DB_ENV->set_rep_transport method initializes the communication infrastructure +

Description: DB_ENV->rep_set_transport

+

The DB_ENV->rep_set_transport method initializes the communication infrastructure for a database environment participating in a replicated application.

-

The DB_ENV->set_rep_transport method configures operations performed using the specified +

The DB_ENV->rep_set_transport method is not called by most replication +applications. It should only be called by applications implementing +their own network transport layer, explicitly holding replication group +elections and handling replication messages outside of the replication +manager framework.

+

The DB_ENV->rep_set_transport method configures operations performed using the specified DB_ENV handle, not all operations performed on the underlying database environment.

-

The DB_ENV->set_rep_transport method may be called at any time during the life of the +

The DB_ENV->rep_set_transport method may be called at any time during the life of the application.

-

The DB_ENV->set_rep_transport method +

The DB_ENV->rep_set_transport method returns a non-zero error value on failure and 0 on success.

Parameters

envid
The envid parameter is the local environment's ID. It must be -a positive integer and uniquely identify this Berkeley DB database environment +a non-negative integer and uniquely identify this Berkeley DB database environment (see Replication environment IDs for more information).
send
The send callback function is used to transmit data using the @@ -73,6 +78,8 @@ cases, the sending site should not be asked to process the message.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
+
DB_REP_ANYWHERE
The message is a client request that can be satisfied by another client +as well as by the master.
DB_REP_NOBUFFER
The record being sent should be transmitted immediately and not buffered or delayed.
DB_REP_PERMANENT
The record being sent is critical for maintaining database integrity @@ -80,20 +87,25 @@ or delayed. application should take appropriate action to enforce the reliability guarantees it has chosen, such as waiting for acknowledgement from one or more clients. +
DB_REP_REREQUEST
The message is a client request that has already been made and to which +no response was received.

It may sometimes be useful to pass application-specific data to the send function; see Environment FAQ for a discussion on how to do this.

-The send function should not call back down into Berkeley DB. The -send function must return 0 on success and non-zero on failure. -If the send function fails, the message being sent is necessary -to maintain database integrity, and the local log is not configured for -synchronous flushing, the local log will be flushed; otherwise, any -error from the send function will be ignored. +

The send function must return 0 on success and non-zero on +failure. If the send function fails, the message being sent is +necessary to maintain database integrity, and the local log is not +configured for synchronous flushing, the local log will be flushed; +otherwise, any error from the send function will be ignored.

+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.

Errors

-

The DB_ENV->set_rep_transport method +

The DB_ENV->rep_set_transport method may fail and return one of the following non-zero errors:

EINVAL
An @@ -108,6 +120,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/repmgr_ack_policy.html b/db/docs/api_c/repmgr_ack_policy.html new file mode 100644 index 000000000..b5688f6e8 --- /dev/null +++ b/db/docs/api_c/repmgr_ack_policy.html @@ -0,0 +1,100 @@ + + + + + + +Berkeley DB: DB_ENV->repmgr_set_ack_policy + + + + + + + +
+

DB_ENV->repmgr_set_ack_policy

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->repmgr_set_ack_policy(DB_ENV *env, int ack_policy); +

+int +DB_ENV->repmgr_get_ack_policy(DB_ENV *env, int *ack_policyp); +

+
+

Description: DB_ENV->repmgr_set_ack_policy

+

The DB_ENV->repmgr_set_ack_policy method specifies how master and client sites +will handle acknowledgment of replication messages which are necessary +for "permanent" records. The current implementation requires all +sites in a replication group configure the same acknowledgement +policy.

+

The DB_ENV->repmgr_set_ack_policy method configures a database environment, not only operations +performed using the specified DB_ENV handle.

+

The DB_ENV->repmgr_set_ack_policy method may be called at any time during the life of the +application.

+

The DB_ENV->repmgr_set_ack_policy method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
ack_policy
The ack_policy parameter must be set to one of the following +values: +
+
DB_REPMGR_ACKS_ALL
The master should wait until all replication clients have acknowledged +each permanent replication message. +
DB_REPMGR_ACKS_ALL_PEERS
The master should wait until all electable peers have acknowledged each +permanent replication message (where "electable peer" means a client +capable of being subsequently elected master of the replication +group). +
DB_REPMGR_ACKS_NONE
The master should not wait for any client replication message +acknowledgments. +
DB_REPMGR_ACKS_ONE
The master should wait until at least one client site has acknowledged +each permanent replication message. +
DB_REPMGR_ACKS_ONE_PEER
The master should wait until at least one electable peer has +acknowledged each permanent replication message (where "electable peer" +means a client capable of being subsequently elected master of the +replication group). +
DB_REPMGR_ACKS_QUORUM
The master should wait until it has received acknowledgements from the +minimum number of electable peers sufficient to ensure that the effect +of the permanent record remains durable if an election is held (where +"electable peer" means a client capable of being subsequently elected +master of the replication group). This is the default acknowledgement +policy. +
+

Waiting for client acknowledgements is always limited by the +DB_REP_ACK_TIMEOUT specified by DB_ENV->rep_set_timeout.

+
+
+

Description: DB_ENV->repmgr_get_ack_policy

+

The DB_ENV->repmgr_get_ack_policy method returns the replication manager's client acknowledgment policy.

+

The DB_ENV->repmgr_get_ack_policy method may be called at any time during the life of the +application.

+

The DB_ENV->repmgr_get_ack_policy method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
ack_policyp
The DB_ENV->repmgr_get_ack_policy method returns the +replication manager's client acknowledgment policy in ack_policyp. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/repmgr_local_site.html b/db/docs/api_c/repmgr_local_site.html new file mode 100644 index 000000000..86ddf2f31 --- /dev/null +++ b/db/docs/api_c/repmgr_local_site.html @@ -0,0 +1,56 @@ + + + + + + +Berkeley DB: DB_ENV->repmgr_set_local_site + + + + + + + +
+

DB_ENV->repmgr_set_local_site

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->repmgr_set_local_site(DB_ENV *env, + const char *host, u_int port, u_int32_t flags); +

+
+

Description: DB_ENV->repmgr_set_local_site

+

The DB_ENV->repmgr_set_local_site method specifies the host identification +string and port number for the local system.

+

The DB_ENV->repmgr_set_local_site method must be called before the DB_ENV->repmgr_start method has been +called.

+

The DB_ENV->repmgr_set_local_site method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
flags
The flags parameter is currently unused, and must be set to 0. +
host
The site's host identification string, generally a TCP/IP host name. +
port
The port number on which the local site is listening. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/repmgr_remote_site.html b/db/docs/api_c/repmgr_remote_site.html new file mode 100644 index 000000000..7562086a2 --- /dev/null +++ b/db/docs/api_c/repmgr_remote_site.html @@ -0,0 +1,68 @@ + + + + + + +Berkeley DB: DB_ENV->repmgr_add_remote_site + + + + + + + +
+

DB_ENV->repmgr_add_remote_site

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->repmgr_add_remote_site(DB_ENV *env, + const char *host, u_int port, int *eidp, u_int32_t flags); +

+
+

Description: DB_ENV->repmgr_add_remote_site

+

The DB_ENV->repmgr_add_remote_site method adds a new replication site to the +replication manager's list of known sites. It is not necessary for +all sites in a replication group to know about all other sites in the +group.

+

The DB_ENV->repmgr_add_remote_site method may be called at any time during the life of the +application.

+

The DB_ENV->repmgr_add_remote_site method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
eidp
If eidp is non-NULL, the +environment ID assigned to the remote site is +returned in the memory location referenced by eidp. +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values: +
+
DB_REPMGR_PEER
Specifying the DB_REPMGR_PEER flag configures client-to-client +synchronization with the specified remote site. +

Currently, the replication manager framework only supports a single client +peer, and the last specified peer is used.

+
+
host
The site's host identification string, generally a TCP/IP host name. +
port
The port number on which the remote site is receiving. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/repmgr_site_list.html b/db/docs/api_c/repmgr_site_list.html new file mode 100644 index 000000000..654e798f6 --- /dev/null +++ b/db/docs/api_c/repmgr_site_list.html @@ -0,0 +1,77 @@ + + + + + + +Berkeley DB: DB_ENV->repmgr_site_list + + + + + + + +
+

DB_ENV->repmgr_site_list

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->repmgr_site_list(DB_ENV *env, + u_int *countp, DB_REPMGR_SITE **listp); +

+
+

Description: DB_ENV->repmgr_site_list

+

The DB_ENV->repmgr_site_list method returns the status of the sites currently +known by the replication manager.

+

The DB_ENV->repmgr_site_list method creates a statistical structure of type +DB_REPMGR_SITE and copies a pointer to it into a user-specified memory +location.

+

Statistical structures are stored in allocated memory. If application-specific allocation +routines have been declared (see DB_ENV->set_alloc for more +information), they are used to allocate the memory; otherwise, the +standard C library malloc(3) is used. The caller is +responsible for deallocating the memory. To deallocate the memory, free +the memory reference; references inside the returned memory need not be +individually freed.

+

The following DB_REPMGR_SITE fields will be filled in:

+
+
int eid;
Environment ID assigned by the replication manager. +This is the same value that is passed to the application's +event notification function for the DB_EVENT_REP_NEWMASTER event. +
char host[];
Nul-terminated host name. +
u_int port;
TCP/IP port number. +
u_int32_t status;
One of the following list of constants: DB_REPMGR_CONNECTED, +DB_REPMGR_DISCONNECTED. +
+

The DB_ENV->repmgr_site_list method may be called at any time during the life of the +application.

+

The DB_ENV->repmgr_site_list method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
countp
A count of the returned structures will be stored into the memory +referenced by countp. +
listp
A reference to an array of structures will be stored into the memory +referenced by listp. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/repmgr_start.html b/db/docs/api_c/repmgr_start.html new file mode 100644 index 000000000..f9dc53205 --- /dev/null +++ b/db/docs/api_c/repmgr_start.html @@ -0,0 +1,96 @@ + + + + + + +Berkeley DB: DB_ENV->repmgr_start + + + + + + + +
+

DB_ENV->repmgr_start

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_ENV->repmgr_start(DB_ENV *env, int nthreads, u_int32_t flags); +

+
+

Description: DB_ENV->repmgr_start

+

The DB_ENV->repmgr_start method starts the replication manager.

+

There are two ways to build Berkeley DB replication applications: the most +common approach is to use the Berkeley DB library "replication manager" +support, where the Berkeley DB library manages the replication group, +including network transport, all replication message processing and +acknowledgment, and group elections. Applications using the replication +manager support generally make the following calls:

+
    +

  1. Call DB_ENV->repmgr_set_local_site to configure the local site in the +replication group. +

  2. Call DB_ENV->repmgr_add_remote_site to configure the remote site(s) in +the replication group. +

  3. Call DB_ENV->repmgr_set_ack_policy to configure the message +acknowledgment policy which provides the replication group's +transactional needs. +

  4. Call DB_ENV->rep_set_priority to configure the local site's election +priority. +

  5. Call DB_ENV->repmgr_start to start the replication application. +
+

For more information on building replication manager applications, +please see the "Replication Manager Getting Started Guide" included in +the Berkeley DB documentation.

+

Applications with special needs (for example, applications using network +protocols not supported by the Berkeley DB replication manager), must perform +additional configuration and call other Berkeley DB replication methods. For +more information on building advanced replication applications, please +see the "Advanced Replication Applications Guide" included in the Berkeley DB +documentation.

+

The DB_ENV->repmgr_start method may not be called before the DB_ENV->open method has +been called.

+

The DB_ENV->repmgr_start method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
flags
The flags parameter must be set to one of the following values: +
+
DB_REP_MASTER
Start as a master site, and do not call for an election. Note there +must never be more than a single master in any replication group, and +only one site at a time should ever be started with the +DB_REP_MASTER flag specified. +
DB_REP_CLIENT
Start as a client site, and do not call for an election. +
DB_REP_ELECTION
Start as a client, and call for an election if no master is found. +
DB_REP_FULL_ELECTION
Start as a client, and call for an election if no master is found. +

The DB_REP_FULL_ELECTION flag configures a single special +election on startup, where a master will only be confirmed if all +members of the replication group vote. Subsequent elections will revert +to only requiring a simple majority to elect a new master.

+
+
nthreads
Specify the number of threads of control created and dedicated to processing +replication messages. In addition to these message processing threads, +the replication manager creates and manages a few of its own threads of +control. +
+
+

Class

+DB_ENV +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/seq_class.html b/db/docs/api_c/seq_class.html index 706278617..bdc006c49 100644 --- a/db/docs/api_c/seq_class.html +++ b/db/docs/api_c/seq_class.html @@ -1,5 +1,5 @@ - + @@ -73,6 +73,6 @@ DB_SEQUENCE

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/seq_close.html b/db/docs/api_c/seq_close.html index 7b17eebb1..160b1c437 100644 --- a/db/docs/api_c/seq_close.html +++ b/db/docs/api_c/seq_close.html @@ -1,5 +1,5 @@ - + @@ -55,6 +55,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/seq_get.html b/db/docs/api_c/seq_get.html index 3be578ea6..01e63be09 100644 --- a/db/docs/api_c/seq_get.html +++ b/db/docs/api_c/seq_get.html @@ -1,5 +1,5 @@ - - + + @@ -35,15 +35,15 @@ values in the sequence handle then they will be returned. Otherwise the next value will be fetched from the database and incremented (decremented) by enough to cover the delta and the next batch of cached values.

-

If the underlying database handle was opened in a transaction then -either the txnid parameter must be a valid transaction handle or -DB_AUTO_COMMIT must be specified. The txnid handle must be NULL -if the sequence handle was opened with a non-zero cache size.

For maximum concurrency a non-zero cache size should be specified prior -to opening the sequence handle and DB_AUTO_COMMIT | DB_TXN_NOSYNC should -be specified each DB_SEQUENCE->get method call.

-

The DB_SEQUENCE->get method will return EINVAL if the record in the database is not a valid sequence record, -or the sequences have overflowed is range. +to opening the sequence handle and DB_TXN_NOSYNC should be +specified for each DB_SEQUENCE->get method call.

+

By default, sequence ranges do not wrap; to cause the sequence to wrap +around the beginning or end of its range, specify the DB_SEQ_WRAP +flag to the DB_SEQUENCE->set_flags method.

+

The DB_SEQUENCE->get method will return EINVAL if the record in the database is not a valid sequence +record, or the sequence has reached the beginning or end of its range +and is not configured to wrap.

Parameters

@@ -51,17 +51,32 @@ or the sequences have overflowed is range.
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_AUTO_COMMIT
If the database -must be updated the update will be enclosed in a transaction -and will be recoverable. -
DB_TXN_NOSYNC
If a DB_AUTO_COMMIT -triggers a transaction, do not synchronously flush the log. +
DB_TXN_NOSYNC
If the operation is implicitly transaction protected (the txnid +argument is NULL but the operation occurs to a transactional database), +do not synchronously flush the log when the transaction commits.
retp
retp points to the memory to hold the return value from the sequence. -
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected. No txnid handle may be specified if the sequence handle was +opened with a non-zero cache size. +

If the underlying database handle was opened in a transaction, calling +DB_SEQUENCE->get may result in changes to the sequence object; these +changes will be automatically committed in a transaction internal to the +Berkeley DB library. If the thread of control calling DB_SEQUENCE->get has +an active transaction, which holds locks on the same database as the +one in which the sequence object is stored, it is possible for a thread +of control calling DB_SEQUENCE->get to self-deadlock because the active +transaction's locks conflict with the internal transaction's locks. +For this reason, it is often preferable for sequence objects to be +stored in their own database.


Class

@@ -72,6 +87,6 @@ the txnid parameter is a transaction handle returned from

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/seq_initial_value.html b/db/docs/api_c/seq_initial_value.html new file mode 100644 index 000000000..f5a8f89f0 --- /dev/null +++ b/db/docs/api_c/seq_initial_value.html @@ -0,0 +1,60 @@ + + + + + + +Berkeley DB: DB_SEQUENCE->initial_value + + + + + + + +
+

DB_SEQUENCE->initial_value

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_SEQUENCE->initial_value(DB_SEQUENCE *seq, db_seq_t value); +

+
+

Description: DB_SEQUENCE->initial_value

+

Set the initial value for a sequence. This call is only effective when +the sequence is being created.

+

The DB_SEQUENCE->initial_value method may not be called after the +DB_SEQUENCE->open method is called.

+

The DB_SEQUENCE->initial_value method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
value
The initial value to set. +
+

Errors

+

The DB_SEQUENCE->initial_value method +may fail and return one of the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DB_SEQUENCE +

See Also

+Sequences and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/seq_list.html b/db/docs/api_c/seq_list.html index 54407bbc0..881d578cc 100644 --- a/db/docs/api_c/seq_list.html +++ b/db/docs/api_c/seq_list.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@

Berkeley DB: Sequences and Related Methods

- + @@ -18,7 +18,7 @@ - + @@ -27,6 +27,6 @@
Sequences and Related MethodsDescription
db_sequence_createCreate a sequence handle
DB_SEQUENCE->getGet the next sequence element(s)
DB_SEQUENCE->get_dbpReturn a handle for the underlying sequence database
DB_SEQUENCE->get_keyReturn the key for a sequence
DB_SEQUENCE->init_valueSet the initial value of a sequence
DB_SEQUENCE->initial_valueSet the initial value of a sequence
DB_SEQUENCE->openOpen a sequence
DB_SEQUENCE->removeRemove a sequence
DB_SEQUENCE->statReturn sequence statistics
DB_SEQUENCE->set_flagsSet the flags for a sequence
DB_SEQUENCE->set_rangeSet the range for a sequence
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/seq_open.html b/db/docs/api_c/seq_open.html index 2a3b56b47..72acbfa9b 100644 --- a/db/docs/api_c/seq_open.html +++ b/db/docs/api_c/seq_open.html @@ -1,5 +1,5 @@ - - + + @@ -45,10 +45,6 @@ the persistent sequence data.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_AUTO_COMMIT
Enclose the DB_SEQUENCE->open call within a transaction. If the call -succeeds, the open operation will be recoverable. If the -DB_CREATE flag is specified and the call fails, no sequence will -have been created.
DB_CREATE
Create the sequence. If the sequence does not already exist and the DB_CREATE flag is not specified, the DB_SEQUENCE->open will fail.
DB_EXCL
Return an error if the sequence already exists. The DB_EXCL @@ -56,13 +52,20 @@ flag is only meaningful when specified with the DB_THREAD
Cause the DB_SEQUENCE handle returned by DB_SEQUENCE->open to be free-threaded; that is, usable by multiple threads within a -single address space. +single address space. Note that if multiple threads create multiple +sequences using the same database handle that handle must have been +opened specifying DB_THREAD.
-
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. Note that transactionally protected operations on a DB_SEQUENCE -handle require the DB_SEQUENCE handle itself be transactionally +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected. Transactionally protected operations on a DB_SEQUENCE handle +require the DB_SEQUENCE handle itself be transactionally protected during its open if the open creates the sequence.

@@ -71,7 +74,7 @@ protected during its open if the open creates the sequence.

Parameters

dbp
The dbp parameter references memory into which -a pointer to the database handle is copied. +a pointer to the database handle is copied.

The DB_SEQUENCE->get_dbp method may be called at any time during the life of the application.

@@ -85,7 +88,7 @@ and 0 on success.

Parameters

key
The key parameter references memory into which -a pointer to the key data is copied. +a pointer to the key data is copied.

The DB_SEQUENCE->get_key method may be called at any time during the life of the application.

@@ -102,6 +105,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/seq_remove.html b/db/docs/api_c/seq_remove.html index 015fe8268..91c36093d 100644 --- a/db/docs/api_c/seq_remove.html +++ b/db/docs/api_c/seq_remove.html @@ -1,5 +1,5 @@ - - + + @@ -41,14 +41,19 @@ and 0 on success.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_AUTO_COMMIT
The remove -will be enclosed in a transaction and will be recoverable. -
DB_TXN_NOSYNC
If a DB_AUTO_COMMIT -triggers a transaction, do not synchronously flush the log. +
DB_TXN_NOSYNC
If the operation is implicitly transaction protected (the txnid +argument is NULL but the operation occurs to a transactional database), +do not synchronously flush the log when the transaction commits.
-
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DB_ENV->txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DB_ENV->txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DB_ENV->cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The DB_SEQUENCE->remove method @@ -66,6 +71,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/seq_set_cachesize.html b/db/docs/api_c/seq_set_cachesize.html index 81f1b8430..020f65088 100644 --- a/db/docs/api_c/seq_set_cachesize.html +++ b/db/docs/api_c/seq_set_cachesize.html @@ -1,5 +1,5 @@ - + @@ -71,6 +71,6 @@ current cache size in sizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/seq_set_flags.html b/db/docs/api_c/seq_set_flags.html index 184faad18..8384d7242 100644 --- a/db/docs/api_c/seq_set_flags.html +++ b/db/docs/api_c/seq_set_flags.html @@ -1,5 +1,5 @@ - + @@ -84,6 +84,6 @@ current flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/seq_set_range.html b/db/docs/api_c/seq_set_range.html index fd6a4feb2..af814e2d5 100644 --- a/db/docs/api_c/seq_set_range.html +++ b/db/docs/api_c/seq_set_range.html @@ -1,5 +1,5 @@ - + @@ -74,6 +74,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/seq_stat.html b/db/docs/api_c/seq_stat.html index 897348901..907b15a8f 100644 --- a/db/docs/api_c/seq_stat.html +++ b/db/docs/api_c/seq_stat.html @@ -1,5 +1,5 @@ - + @@ -94,6 +94,6 @@ of the following values:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_close.html b/db/docs/api_c/set_func_close.html index 3cbf08343..41151bd0f 100644 --- a/db/docs/api_c/set_func_close.html +++ b/db/docs/api_c/set_func_close.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_dirfree.html b/db/docs/api_c/set_func_dirfree.html index 1df305627..8bcc7af23 100644 --- a/db/docs/api_c/set_func_dirfree.html +++ b/db/docs/api_c/set_func_dirfree.html @@ -1,5 +1,5 @@ - + @@ -54,6 +54,6 @@ function.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_dirlist.html b/db/docs/api_c/set_func_dirlist.html index f78f085cd..96e939272 100644 --- a/db/docs/api_c/set_func_dirlist.html +++ b/db/docs/api_c/set_func_dirlist.html @@ -1,5 +1,5 @@ - + @@ -23,8 +23,7 @@ #include <db.h>

int -db_env_set_func_dirlist( - int (*func_dirlist)(const char *dir, char ***namesp, int *cntp)); +db_env_set_func_dirlist(int (*func_dirlist)(const char *dir, char ***namesp, int *cntp));


Description: db_env_set_func_dirlist

@@ -59,6 +58,6 @@ failure and 0 on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_exists.html b/db/docs/api_c/set_func_exists.html index 285a660ec..3712b85f7 100644 --- a/db/docs/api_c/set_func_exists.html +++ b/db/docs/api_c/set_func_exists.html @@ -1,5 +1,5 @@ - + @@ -56,6 +56,6 @@ failure and 0 on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_free.html b/db/docs/api_c/set_func_free.html index e9ad98c58..ec8a6923c 100644 --- a/db/docs/api_c/set_func_free.html +++ b/db/docs/api_c/set_func_free.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_fsync.html b/db/docs/api_c/set_func_fsync.html index 116cd322a..bfed92e75 100644 --- a/db/docs/api_c/set_func_fsync.html +++ b/db/docs/api_c/set_func_fsync.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_ftruncate.html b/db/docs/api_c/set_func_ftruncate.html index 1d781d3a0..491cabef0 100644 --- a/db/docs/api_c/set_func_ftruncate.html +++ b/db/docs/api_c/set_func_ftruncate.html @@ -1,5 +1,5 @@ - + @@ -53,6 +53,6 @@ failure and 0 on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_ioinfo.html b/db/docs/api_c/set_func_ioinfo.html index e8035c1c0..cadf0ee3e 100644 --- a/db/docs/api_c/set_func_ioinfo.html +++ b/db/docs/api_c/set_func_ioinfo.html @@ -1,5 +1,5 @@ - + @@ -64,6 +64,6 @@ failure and 0 on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_malloc.html b/db/docs/api_c/set_func_malloc.html index 5db5269f2..ac150fb79 100644 --- a/db/docs/api_c/set_func_malloc.html +++ b/db/docs/api_c/set_func_malloc.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_map.html b/db/docs/api_c/set_func_map.html index 98adb57d1..6f264d66d 100644 --- a/db/docs/api_c/set_func_map.html +++ b/db/docs/api_c/set_func_map.html @@ -1,5 +1,5 @@ - + @@ -68,6 +68,6 @@ failure and 0 on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_open.html b/db/docs/api_c/set_func_open.html index 2884f1fd6..d669b5dde 100644 --- a/db/docs/api_c/set_func_open.html +++ b/db/docs/api_c/set_func_open.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_pread.html b/db/docs/api_c/set_func_pread.html index cbca35cf9..903c54f00 100644 --- a/db/docs/api_c/set_func_pread.html +++ b/db/docs/api_c/set_func_pread.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_pwrite.html b/db/docs/api_c/set_func_pwrite.html index c5b85f705..d62fdcf83 100644 --- a/db/docs/api_c/set_func_pwrite.html +++ b/db/docs/api_c/set_func_pwrite.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_read.html b/db/docs/api_c/set_func_read.html index 24cec6802..336a98fc8 100644 --- a/db/docs/api_c/set_func_read.html +++ b/db/docs/api_c/set_func_read.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_realloc.html b/db/docs/api_c/set_func_realloc.html index ec9ca76f8..8bac96017 100644 --- a/db/docs/api_c/set_func_realloc.html +++ b/db/docs/api_c/set_func_realloc.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_rename.html b/db/docs/api_c/set_func_rename.html index 29c8701ee..c417ccfc0 100644 --- a/db/docs/api_c/set_func_rename.html +++ b/db/docs/api_c/set_func_rename.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_seek.html b/db/docs/api_c/set_func_seek.html index f00154ff0..d2be1904d 100644 --- a/db/docs/api_c/set_func_seek.html +++ b/db/docs/api_c/set_func_seek.html @@ -1,5 +1,5 @@ - + @@ -59,6 +59,6 @@ failure and 0 on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_sleep.html b/db/docs/api_c/set_func_sleep.html index ce7bbe6ad..ece4db13a 100644 --- a/db/docs/api_c/set_func_sleep.html +++ b/db/docs/api_c/set_func_sleep.html @@ -1,5 +1,5 @@ - + @@ -58,6 +58,6 @@ failure and 0 on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_unlink.html b/db/docs/api_c/set_func_unlink.html index aab4d9487..5b67ed106 100644 --- a/db/docs/api_c/set_func_unlink.html +++ b/db/docs/api_c/set_func_unlink.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_unmap.html b/db/docs/api_c/set_func_unmap.html index d3499a0d4..dd2ec61a8 100644 --- a/db/docs/api_c/set_func_unmap.html +++ b/db/docs/api_c/set_func_unmap.html @@ -1,5 +1,5 @@ - + @@ -57,6 +57,6 @@ failure and 0 on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_write.html b/db/docs/api_c/set_func_write.html index 58791e407..78d876db1 100644 --- a/db/docs/api_c/set_func_write.html +++ b/db/docs/api_c/set_func_write.html @@ -1,5 +1,5 @@ - + @@ -23,8 +23,7 @@ #include <db.h>

int -db_env_set_func_write( - ssize_t (*func_write)(int fd, const void *buffer, size_t nbytes)); +db_env_set_func_write(ssize_t (*func_write)(int fd, const void *buffer, size_t nbytes));


Description: db_env_set_func_write

@@ -52,6 +51,6 @@ to the standard interface specification.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/set_func_yield.html b/db/docs/api_c/set_func_yield.html index 0c5e32566..3ac4f40ff 100644 --- a/db/docs/api_c/set_func_yield.html +++ b/db/docs/api_c/set_func_yield.html @@ -1,5 +1,5 @@ - + @@ -65,6 +65,6 @@ failure and 0 on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_abort.html b/db/docs/api_c/txn_abort.html index 2b6bfeab5..9000506bf 100644 --- a/db/docs/api_c/txn_abort.html +++ b/db/docs/api_c/txn_abort.html @@ -1,5 +1,5 @@ - + @@ -51,6 +51,6 @@ and 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_begin.html b/db/docs/api_c/txn_begin.html index 982fc81a4..b910a55f4 100644 --- a/db/docs/api_c/txn_begin.html +++ b/db/docs/api_c/txn_begin.html @@ -1,5 +1,5 @@ - - + + @@ -36,7 +36,7 @@ handle.

Note: Transactions may only span threads if they do so serially; that is, each transaction must be active in only a single thread of control at a time. This restriction holds for parents of nested -transactions as well; not two children may be concurrently active in +transactions as well; no two children may be concurrently active in more than one thread of control at any one time.

Note: Cursors may not span transactions; that is, each cursor must be opened and closed within a single transaction.

@@ -53,13 +53,14 @@ and 0 on success.
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_DEGREE_2
This transaction will have degree 2 isolation. This provides for cursor +
DB_READ_COMMITTED
This transaction will have degree 2 isolation. This provides for cursor stability but not repeatable reads. Data items which have been previously read by this transaction may be deleted or modified by other transactions before this transaction completes. -
DB_DIRTY_READ
All read operations performed by the transaction may read modified but -not yet committed data. Silently ignored if the DB_DIRTY_READ -flag was not specified when the underlying database was opened. +
DB_READ_UNCOMMITTED
This transaction will have degree 1 isolation. Read operations +performed by the transaction may read modified but not yet committed +data. Silently ignored if the DB_READ_UNCOMMITTED flag was not +specified when the underlying database was opened.
DB_TXN_NOSYNC
Do not synchronously flush the log when this transaction commits or prepares. This means the transaction will exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, @@ -72,6 +73,14 @@ overrides that setting.

of this transaction, cause the operation to return DB_LOCK_DEADLOCK immediately instead of blocking on the lock. +
DB_TXN_SNAPSHOT
This transaction will execute with snapshot isolation. For databases with the DB_MULTIVERSION +flag set, data values will be read as they are when the transaction +begins, without taking read locks. Silently ignored for operations on +databases with DB_MULTIVERSION not set on the underlying +database (read locks are acquired). +

The error DB_LOCK_DEADLOCK will be returned from update +operations if a snapshot transaction attempts to update data +which was modified after the snapshot transaction read it.

DB_TXN_SYNC
Synchronously flush the log when this transaction commits or prepares. This means the transaction will exhibit all of the ACID (atomicity, consistency, isolation, and durability) properties. @@ -102,6 +111,6 @@ may fail and return one of the following non-zero errors:


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_checkpoint.html b/db/docs/api_c/txn_checkpoint.html index 318018834..eadfb307e 100644 --- a/db/docs/api_c/txn_checkpoint.html +++ b/db/docs/api_c/txn_checkpoint.html @@ -1,5 +1,5 @@ - - + + @@ -28,8 +28,10 @@ DB_ENV->txn_checkpoint(const DB_ENV *env,


Description: DB_ENV->txn_checkpoint

-

The DB_ENV->txn_checkpoint method flushes the underlying memory pool, writes -a checkpoint record to the log, and then flushes the log.

+

If there has been any logging activity in the database environment since +the last checkpoint, the DB_ENV->txn_checkpoint method flushes the underlying +memory pool, writes a checkpoint record to the log, and then flushes the +log.

The DB_ENV->txn_checkpoint method returns a non-zero error value on failure and 0 on success. @@ -67,6 +69,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_class.html b/db/docs/api_c/txn_class.html index 2aed01a4f..4604b6e8f 100644 --- a/db/docs/api_c/txn_class.html +++ b/db/docs/api_c/txn_class.html @@ -1,5 +1,5 @@ - - + + @@ -26,7 +26,7 @@ typedef struct __db_txn DB_TXN;


Description: DB_TXN

-

The DB_TXN object is the handle for a transaction. Methods off +

The DB_TXN object is the handle for a transaction. Methods of the DB_TXN handle are used to configure, abort and commit the transaction. DB_TXN handles are provided to DB methods in order to transactionally protect those database operations.

@@ -48,6 +48,6 @@ and DB_TXN->commit.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_commit.html b/db/docs/api_c/txn_commit.html index 40ab12feb..61d429f48 100644 --- a/db/docs/api_c/txn_commit.html +++ b/db/docs/api_c/txn_commit.html @@ -1,5 +1,5 @@ - + @@ -79,6 +79,6 @@ method overrides both of those settings.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_discard.html b/db/docs/api_c/txn_discard.html index 138bef8d7..3ce7e3da3 100644 --- a/db/docs/api_c/txn_discard.html +++ b/db/docs/api_c/txn_discard.html @@ -1,5 +1,5 @@ - + @@ -62,6 +62,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_id.html b/db/docs/api_c/txn_id.html index 6cedcdd6a..a27712446 100644 --- a/db/docs/api_c/txn_id.html +++ b/db/docs/api_c/txn_id.html @@ -1,5 +1,5 @@ - + @@ -40,6 +40,6 @@ to the DB_ENV->lock_get or


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_list.html b/db/docs/api_c/txn_list.html index 321064511..61eeae746 100644 --- a/db/docs/api_c/txn_list.html +++ b/db/docs/api_c/txn_list.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@

Berkeley DB: Transaction Subsystem and Related Methods

- + @@ -28,8 +28,9 @@ +
Transaction Subsystem and Related MethodsDescription
DB_ENV->txn_checkpointCheckpoint the transaction subsystem
DB_TXN->discardDiscard a prepared but not resolved transaction handle
DB_TXN->idReturn a transaction's ID
DB_TXN->preparePrepare a transaction for commit
DB_TXN->set_nameAssociate a string with a transaction
DB_TXN->set_timeoutSet transaction timeout
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_prepare.html b/db/docs/api_c/txn_prepare.html index 5f7e6a9a5..cb2dea5aa 100644 --- a/db/docs/api_c/txn_prepare.html +++ b/db/docs/api_c/txn_prepare.html @@ -1,5 +1,5 @@ - + @@ -61,6 +61,6 @@ transactions must be resolved.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_recover.html b/db/docs/api_c/txn_recover.html index 5b1e54b44..976905306 100644 --- a/db/docs/api_c/txn_recover.html +++ b/db/docs/api_c/txn_recover.html @@ -1,5 +1,5 @@ - + @@ -68,7 +68,7 @@ array. starting where the last call to DB_ENV->txn_recover left off.

preplist
The preplist parameter references memory into which - the list of transactions to be resolved by the application is copied. + the list of transactions to be resolved by the application is copied.

Class

@@ -79,6 +79,6 @@ starting where the last call to DB_ENV->txn_recover left off.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_set_name.html b/db/docs/api_c/txn_set_name.html new file mode 100644 index 000000000..df0e91376 --- /dev/null +++ b/db/docs/api_c/txn_set_name.html @@ -0,0 +1,76 @@ + + + + + + +Berkeley DB: DB_TXN->set_name + + + + + + + +
+

DB_TXN->set_name

+
+API +Ref
+


+ +

+#include <db.h>
+

+int +DB_TXN->set_name(DB_TXN *txn, const char *name); +

+int +DB_TXN->get_name(DB_TXN *txn, const char **namep); +

+
+

Description: DB_TXN->set_name

+

The DB_TXN->set_name method associates the specified string with the +transaction. The string is returned by DB_ENV->txn_stat and displayed +by DB_ENV->txn_stat_print.

+

If the database environment has been configured for logging and the +Berkeley DB library was configured with +--enable-diagnostic, a debugging log record is written including the +transaction ID and the name.

+

The DB_TXN->set_name method may be called at any time during the life of the +application.

+

The DB_TXN->set_name method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
name
The name parameter is the string to associate with the +transaction. +
+
+

Description: DB_TXN->get_name

+

The DB_TXN->get_name method returns the string associated with the transaction.

+

The DB_TXN->get_name method may be called at any time during the life of the +application.

+

The DB_TXN->get_name method +returns a non-zero error value on failure +and 0 on success. +

+

Parameters

+
+
namep
The DB_TXN->get_name method returns a reference to the +string associated with the transaction in namep. +
+
+

Class

+DB_ENV, DB_TXN +

See Also

+Transaction Subsystem and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_c/txn_set_timeout.html b/db/docs/api_c/txn_set_timeout.html index 84dfe9b37..45a21dc19 100644 --- a/db/docs/api_c/txn_set_timeout.html +++ b/db/docs/api_c/txn_set_timeout.html @@ -1,5 +1,5 @@ - - + + @@ -29,8 +29,8 @@ DB_TXN->set_timeout(DB_TXN *tid, db_timeout_t timeout, u_int32_t flags);

Description: DB_TXN->set_timeout

The DB_TXN->set_timeout method sets timeout values for locks or transactions for the specified transaction.

-

Timeouts are checked whenever a thread of control blocks on a lock or -when deadlock detection is performed. In the case of +

All Timeouts are checked whenever a thread of control blocks on a lock +or when deadlock detection is performed. In the case of DB_SET_LOCK_TIMEOUT, the timeout is for any single lock request. In the case of DB_SET_TXN_TIMEOUT, the timeout is for the life of the transaction. As timeouts are only checked when the lock request @@ -74,6 +74,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_c/txn_stat.html b/db/docs/api_c/txn_stat.html index a27febdb8..3dc82f1ea 100644 --- a/db/docs/api_c/txn_stat.html +++ b/db/docs/api_c/txn_stat.html @@ -1,5 +1,5 @@ - - + + @@ -49,26 +49,45 @@ since the Epoch, returned by the IEEE/ANSI Std 1003.1 (POSIX) time functi

u_int32_t st_last_txnid;
The last transaction ID allocated.
u_int32_t st_maxtxns;
The maximum number of active transactions configured.
u_int32_t st_nactive;
The number of transactions that are currently active. +
u_int32_t st_nsnapshot;
The number of transactions on the snapshot list. These are transactions +which modified a database opened with DB_MULTIVERSION, +and which have committed or aborted, but the copies of pages they +created are still in the cache.
u_int32_t st_maxnactive;
The maximum number of active transactions at any one time. +
u_int32_t st_maxnsnapshot;
The maximum number of transactions on the snapshot list at any one time.
u_int32_t st_nbegins;
The number of transactions that have begun.
u_int32_t st_naborts;
The number of transactions that have aborted.
u_int32_t st_ncommits;
The number of transactions that have committed.
u_int32_t st_nrestores;
The number of transactions that have been restored. -
roff_t st_regsize;
The size of the region, in bytes. +
roff_t st_regsize;
The size of the transaction region, in bytes.
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before -obtaining the region lock. +obtaining the transaction region mutex.
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain -the region lock without waiting. +the transaction region mutex without waiting.
DB_TXN_ACTIVE *st_txnarray;
A pointer to an array of st_nactive DB_TXN_ACTIVE structures, describing the currently active transactions. The following fields of the DB_TXN_ACTIVE structure will be filled in:
u_int32_t txnid;
The transaction ID of the transaction.
u_int32_t parentid;
The transaction ID of the parent transaction (or 0, if no parent). +
pid_t pid;
The process ID of the originator of the transaction. +
uintmax_t tid;
The thread of control ID of the originator of the transaction.
DbLsn lsn;
The current log sequence number when the transaction was begun. -
u_int32_t xa_status;
If the transaction is an XA transaction, the status of the transaction, -otherwise 0. -
u_int8_t xid[DB_XIDDATASIZE];
If the transaction is an XA transaction, the transaction's XA ID. +
DbLsn read_lsn;
The log sequence number of reads for snapshot transactions. +
u_int32_t mvcc_ref;
The number of buffer copies created by this transaction that remain in cache. +
u_int32_t status;
One of the following list of constants: TXN_ABORTED, TXN_COMMITTED, +TXN_PREPARED, TXN_RUNNING. +
u_int32_t xa_status;
If the transaction is an XA transaction, the xa_status of the +transaction will be one of the following list of constants: +TXN_XA_ABORTED, TXN_XA_DEADLOCKED, TXN_XA_ENDED, TXN_XA_PREPARED, +TXN_XA_STARTED, or TXN_XA_SUSPENDED. Otherwise, the xa_status +will be 0. +
u_int8_t xid[DB_XIDDATASIZE];
If the transaction is an XA transaction, the transaction's XA ID. If +the transaction was prepared separately from the XA interfaces, the +transaction's Global ID. Otherwise, the xid contents are +undefined. +
char name[];
If a name was specified for the transaction, up to the first 50 bytes +of that name, followed by a nul termination byte.

The DB_ENV->txn_stat method @@ -83,7 +102,7 @@ the following value:

DB_STAT_CLEAR
Reset statistics after returning their values.
statp
The statp parameter references memory into which -a pointer to the allocated statistics structure is copied. +a pointer to the allocated statistics structure is copied.

Errors

The DB_ENV->txn_stat method @@ -94,7 +113,7 @@ invalid flag value or parameter was specified.


Description: DB_ENV->txn_stat_print

-

The DB_ENV->txn_stat_print method returns the +

The DB_ENV->txn_stat_print method displays the transaction subsystem statistical information, as described for the DB_ENV->txn_stat method. The information is printed to a specified output channel (see the DB_ENV->set_msgfile method for more information), or passed to an @@ -108,10 +127,11 @@ and 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values.

@@ -123,6 +143,6 @@ the following value:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/api_core.html b/db/docs/api_cxx/api_core.html index a5240ecd8..93eea10ff 100644 --- a/db/docs/api_cxx/api_core.html +++ b/db/docs/api_cxx/api_core.html @@ -1,33 +1,32 @@ - + -Berkeley DB: Berkeley DB: C++ Handle Methods (version 4.3.27) +Berkeley DB: Berkeley DB: C++ Handle Methods (version 4.5.20) -

Berkeley DB: C++ Handle Methods (version 4.3.27)

+

Berkeley DB: C++ Handle Methods (version 4.5.20)

- - + + - - + - + @@ -51,7 +50,6 @@ - @@ -70,12 +68,15 @@ + + + - + @@ -86,35 +87,58 @@ + + - - + + + + + + + + + + + + + + + + + + + + + - + + + @@ -122,15 +146,14 @@ + + - - - - - - + + + @@ -169,7 +192,7 @@ - + @@ -182,11 +205,12 @@ +
C++ Handle MethodsDescription
DbCreate a database handle
Db::associateAssociate a secondary index
Db::closeClose a database
Db::closeCreate a cursor
Db::cursorCreate a cursor handle
Db::compactCompact a database
Db::cursorCreate a cursor
Db::delDelete items from a database
Db::err, Db::errxError message
Db::fdReturn a file descriptor from a database
Db::get, Db::pgetGet items from a database
Db::get_byteswappedReturn if the underlying database is in host order
Db::getenvReturn database environment handle
Db::get_mpfReturn underlying DbMpoolFile handle
Db::getenvReturn Db's underlying DbEnv handle
Db::get_typeReturn the database type
Db::joinPerform a database join on cursors
Db::key_rangeReturn estimate of key location
Db::get_mpfReturn the database's memory pool handle
Db::get_mpfReturn Db's underlying DbMpoolFile handle
Db::openOpen a database
Db::putStore items into a database
Db::removeRemove a database
Db::set_h_nelemSet the Hash table size
Db::set_lorderSet the database byte order
Db::set_pagesizeSet the underlying database page size
Db::set_paniccallSet panic callback
Db::set_q_extentsizeSet Queue database extent size
Db::set_re_delimSet the variable-length record delimiter
Db::set_re_lenSet the fixed-length record length
Dbc::putStore by cursor
DbDeadlockExceptionDeadlock exception
DbEnvCreate an environment handle
DbEnv::cdsgroup_beginGet a locker ID in Berkeley DB Concurrent Data Store
DbEnv::closeClose an environment
DbEnv::dbremoveRemove a database
DbEnv::dbrenameRename a database
DbEnv::err, DbEnv::errxError message
DbEnv::failchkCheck for thread failure
DbEnv::fileid_resetReset database file IDs
DbEnv::get_homeReturn environment's home directory
DbEnv::get_open_flagsReturn the flags with which the environment was opened
DbEnv::get_open_flagsReturn flags with which the environment was opened
DbEnv::lock_detectPerform deadlock detection
DbEnv::lock_getAcquire a lock
DbEnv::lock_idAcquire a locker ID
DbEnv::log_archiveList log and database files
DbEnv::log_fileMap Log Sequence Numbers to log files
DbEnv::log_flushFlush log records
DbEnv::log_printfAppend informational message to the log
DbEnv::log_putWrite a log record
DbEnv::log_statReturn log subsystem statistics
DbEnv::lsn_resetReset database file LSNs
DbEnv::memp_fcreateCreate a memory pool file handle
DbEnv::memp_registerRegister input/output functions for a file in a memory pool
DbEnv::set_max_openfdSet the maximum number of open file descriptors
DbEnv::set_max_writeSet the maximum number of sequential disk writes
DbEnv::memp_statReturn memory pool statistics
DbEnv::memp_syncFlush pages from a memory pool
DbEnv::memp_trickleTrickle flush pages from a memory pool
DbEnv::mutex_allocAllocate a mutex
DbEnv::mutex_freeFree a mutex
DbEnv::mutex_lockLock a mutex
DbEnv::mutex_set_alignConfigure mutex alignment
DbEnv::mutex_set_incrementConfigure number of additional mutexes
DbEnv::mutex_set_maxConfigure total number of mutexes
DbEnv::mutex_set_tas_spinsConfigure test-and-set mutex spin count
DbEnv::mutex_statMutex statistics
DbEnv::mutex_unlockUnlock a mutex
DbEnv::openOpen an environment
DbEnv::removeRemove an environment
DbEnv::rep_electHold a replication election
DbEnv::rep_process_messageProcess a replication message
DbEnv::rep_set_configConfigure the replication subsystem
DbEnv::rep_set_limitLimit data sent in response to a single message
DbEnv::rep_set_nsitesConfigure replication group site count
DbEnv::rep_set_priorityConfigure replication site priority
DbEnv::rep_set_timeoutConfigure replication timeouts
DbEnv::rep_set_transportConfigure replication transport callback
DbEnv::rep_startConfigure an environment for replication
DbEnv::rep_statReplication statistics
DbEnv::rep_syncReplication synchronization
DbEnv::repmgr_add_remote_siteSpecify the replication manager's remote sites
DbEnv::repmgr_set_ack_policySpecify the replication manager's client acknowledgement policy
DbEnv::repmgr_set_local_siteSpecify the replication manager's local site
DbEnv::repmgr_site_listList the sites and their status
DbEnv::repmgr_startStart the replication manager
DbEnv::set_allocSet local space allocation functions
DbEnv::set_app_dispatchConfigure application recovery
DbEnv::set_cachesizeSet the environment cache size
DbEnv::set_cachesizeSet the environment cache size
DbEnv::set_data_dirSet the environment data directory
DbEnv::set_encryptSet the environment cryptographic key
DbEnv::set_errcall, DbEnv::set_msgcallSet error and informational message callbacks
DbEnv::set_errfile, DbEnv::set_msgfileSet error and informational message FILE
DbEnv::set_error_stream, DbEnv::set_message_streamSet error and informational message output stream
DbEnv::set_errpfxSet error message prefix
DbEnv::set_event_notifySet event notification callback
DbEnv::set_feedbackSet feedback callback
DbEnv::set_flagsEnvironment configuration
DbEnv::set_isaliveSet thread is-alive callback
DbEnv::set_lg_bsizeSet log buffer size
DbEnv::set_lg_dirSet the environment logging directory
DbEnv::set_lg_filemodeSet log file mode
DbEnv::set_lg_maxSet log file size
DbEnv::set_lg_regionmaxSet logging region size
DbEnv::set_lk_conflictsSet lock conflicts matrix
DbEnv::set_lk_max_lockersSet maximum number of lockers
DbEnv::set_lk_max_locksSet maximum number of locks
DbEnv::set_lk_max_objectsSet maximum number of lock objects
DbEnv::set_mp_max_openfdSet the maximum number of open file descriptors
DbEnv::set_mp_max_writeSet the maximum number of sequential disk writes
DbEnv::set_mp_mmapsizeSet maximum mapped-in database file size
DbEnv::set_paniccallSet panic callback
DbEnv::set_rep_limitLimit data sent in response to a single message
DbEnv::set_rep_transportConfigure replication transport
DbEnv::set_rpc_serverEstablish an RPC server connection
DbEnv::set_shm_keySet system memory shared segment ID
DbEnv::set_tas_spinsSet the number of test-and-set spins
DbEnv::set_timeoutSet lock and transaction timeout
DbEnv::set_timeoutSet lock and transaction timeout
DbEnv::set_thread_countSet approximate thread count
DbEnv::set_thread_idSet thread of control ID function
DbEnv::set_thread_id_stringSet thread of control ID format function
DbEnv::set_timeoutSet lock and transaction timeout
DbEnv::set_tmp_dirSet the environment temporary file directory
DbEnv::set_tx_maxSet maximum number of transactions
DbSequence::getGet the next sequence element(s)
DbSequence::get_dbpReturn a handle for the underlying sequence database
DbSequence::get_keyReturn the key for a sequence
DbSequence::init_valueSet the initial value of a sequence
DbSequence::initial_valueSet the initial value of a sequence
DbSequence::openOpen a sequence
DbSequence::removeRemove a sequence
DbSequence::set_cachesizeSet the cache size of a sequence
DbTxn::discardDiscard a prepared but not resolved transaction handle
DbTxn::idReturn a transaction's ID
DbTxn::preparePrepare a transaction for commit
DbTxn::set_nameAssociate a string with a transaction
DbTxn::set_timeoutSet transaction timeout
DbEnv::strerrorError strings
DbEnv::versionReturn version information
DbEnv::log_compareCompare two Log Sequence Numbers
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/cxx_pindex.html b/db/docs/api_cxx/cxx_pindex.html index d98ef63da..7bb989153 100644 --- a/db/docs/api_cxx/cxx_pindex.html +++ b/db/docs/api_cxx/cxx_pindex.html @@ -14,6 +14,7 @@

Building a small memory footprint library  --disable-queue
Building a small memory footprint library  --disable-replication
Configuring Berkeley DB  --disable-shared
QNX  --disable-shared
Configuring Berkeley DB  --disable-static
Building a small memory footprint library  --disable-statistics
Building a small memory footprint library  --disable-verify
Configuring Berkeley DB  --enable-dump185
Configuring Berkeley DB  --enable-java
Configuring Berkeley DB  --enable-posixmutexes
Configuring Berkeley DB  --enable-pthread_api
Configuring Berkeley DB  --enable-rpc
Configuring Berkeley DB  --enable-smallbuild
Building a small memory footprint library  --enable-smallbuild
Configuring Berkeley DB  --enable-uimutexes
Configuring Berkeley DB  --enable-umrw
Configuring Berkeley DB  --with-mutex=MUTEX
Configuring Berkeley DB  --with-mutexalign=ALIGNMENT
Configuring Berkeley DB  --with-rpm=ARCHIVE
Configuring Berkeley DB  --with-tcl=DIR
Configuring Berkeley DB  --with-uniquename=NAME
 /etc/magic
introduction to the  buffer pool subsystem
turn off system  buffering
turn off system  buffering for database files
turn off system  buffering for database files
turn off system  buffering for log files
turn off system  buffering for log files
turn off system  buffering for log files
 building for QNX
 building for UNIX
 building for UNIX FAQ
 building for VxWorks
 building for VxWorks AE
 building for VxWorks FAQ
 building for Win32
 building for Windows
 building for Windows FAQ
selecting a  byte order
configuring the  C++ API
selecting a  cache size
introduction to the memory  cache subsystem
 catastrophic recovery
Patches, Updates and  Change logs
Patches, Updates and  Change logs
database page  checksum
 closing a cursor
 closing a database
database  compaction
specifying a Btree  comparison function
changing  compile or load options
 Concurrent Data Store
database environment  configuration
 configuring Berkeley DB for UNIX systems
 copying databases
salvaging  corrupted databases
 counting data items for a key
closing a  cursor
retrieving records with a  cursor
storing records with a  cursor
 cursor stability
 cursor stability
 cursor stability
database  cursors
Dbc::put  DB_AFTER
Db::verify  DB_AGGRESSIVE
DbEnv::log_archive  DB_ARCH_DATA
DbEnv::log_archive  DB_ARCH_LOG
DbEnv::log_archive  DB_ARCH_REMOVE
Db::associate  DB_AUTO_COMMIT
Db::del  DB_AUTO_COMMIT
Db::get  DB_AUTO_COMMIT
Db::open  DB_AUTO_COMMIT
Db::put  DB_AUTO_COMMIT
Db::truncate  DB_AUTO_COMMIT
DbEnv::dbremove  DB_AUTO_COMMIT
DbEnv::dbrename  DB_AUTO_COMMIT
DbEnv::set_flags  DB_AUTO_COMMIT
DbSequence::get  DB_AUTO_COMMIT
DbSequence::open  DB_AUTO_COMMIT
DbSequence::remove  DB_AUTO_COMMIT
Dbc::put  DB_BEFORE
Db::open  DB_BTREE
 DB_BUFFER_SMALL
Dbt  DB_DBT_PARTIAL
Dbt  DB_DBT_REALLOC
Dbt  DB_DBT_USERMEM
Db::cursor  DB_DEGREE_2
Db::get  DB_DEGREE_2
Db::stat  DB_DEGREE_2
DbEnv::txn_begin  DB_DEGREE_2
DbMpoolFile::open  DB_DIRECT
DbEnv::set_flags  DB_DIRECT_DB
DbEnv::set_flags  DB_DIRECT_LOG
Db::cursor  DB_DIRTY_READ
Db::get  DB_DIRTY_READ
Db::join  DB_DIRTY_READ
Db::open  DB_DIRTY_READ
Db::stat  DB_DIRTY_READ
Dbc::get  DB_DIRTY_READ
DbEnv::txn_begin  DB_DIRTY_READ
 DB_DONOTINDEX
DbEnv::set_flags  DB_DSYNC_DB
DbEnv::set_flags  DB_DSYNC_LOG
Db::set_flags  DB_DUP
Db::set_flags  DB_DUPSORT
Db::set_flags  DB_ENCRYPT
Db::set_encrypt  DB_ENCRYPT_AES
DbEnv::set_encrypt  DB_ENCRYPT_AES
DbEnv::set_event_notify  DB_EVENT_PANIC
DbEnv::set_event_notify  DB_EVENT_REP_CLIENT
DbEnv::set_event_notify  DB_EVENT_REP_MASTER
DbEnv::set_event_notify  DB_EVENT_REP_NEWMASTER
DbEnv::set_event_notify  DB_EVENT_REP_STARTUPDONE
DbEnv::set_event_notify  DB_EVENT_WRITE_FAILED
Db::open  DB_EXCL
DbSequence::open  DB_EXCL
Db::stat  DB_FAST_STAT
DbEnv::log_put  DB_FLUSH
DbEnv::remove  DB_FORCE
DbEnv::txn_checkpoint  DB_FORCE
Db::compact  DB_FREELIST_ONLY
Db::compact  DB_FREE_SPACE
Db::get  DB_GET_BOTH
Dbc::get  DB_GET_BOTH
Dbc::get  DB_GET_BOTH_RANGE
Db::open  DB_HASH
File naming  DB_HOME
File naming  db_home
Db::associate  DB_IMMUTABLE_KEY
DbEnv::open  DB_INIT_CDB
DbEnv::open  DB_INIT_LOCK
DbEnv::open  DB_INIT_LOG
DbEnv::open  DB_INIT_REP
DbEnv::open  DB_INIT_TXN
Db::set_flags  DB_INORDER
DbEnv::open  DB_JOINENV
Db::join  DB_JOIN_ITEM
Dbc::get  DB_JOIN_ITEM
Db::join  DB_JOIN_NOSORT
Dbc::get  DB_LAST
DbLogc::get  DB_LAST
DbEnv::open  DB_LOCKDOWN
DbEnv::txn_begin  DB_LOCK_DEADLOCK
 DB_LOCK_DEADLOCK
Error returns to applications  DB_LOCK_DEADLOCK
DbEnv::set_lk_detect  DB_LOCK_DEFAULT
DbEnv::set_flags  DB_LOG_AUTOREMOVE
DbEnv::set_flags  DB_LOG_BUFFER_FULL
DbEnv::set_flags  DB_LOG_INMEMORY
DbMpoolFile::put  DB_MPOOL_CLEAN
DbMpoolFile::set  DB_MPOOL_CLEAN
DbMpoolFile::get  DB_MPOOL_CREATE
DbMpoolFile::put  DB_MPOOL_DIRTY
DbMpoolFile::set  DB_MPOOL_DIRTY
DbMpoolFile::get  DB_MPOOL_DIRTY
DbMpoolFile::put  DB_MPOOL_DISCARD
DbMpoolFile::set  DB_MPOOL_DISCARD
DbMpoolFile::get  DB_MPOOL_EDIT
DbMpoolFile::get  DB_MPOOL_LAST
DbMpoolFile::get  DB_MPOOL_NEW
DbMpoolFile::set_flags  DB_MPOOL_NOFILE
Db::get  DB_MULTIPLE
Dbc::get  DB_MULTIPLE
Dbc::get  DB_MULTIPLE_KEY
Db::open  DB_MULTIVERSION
DbEnv::set_flags  DB_MULTIVERSION
DbMpoolFile::open  DB_MULTIVERSION
DbEnv::set_isalive  DB_MUTEX_PROCESS_ONLY
DbEnv::mutex_alloc  DB_MUTEX_PROCESS_ONLY
DbEnv::mutex_alloc  DB_MUTEX_SELF_BLOCK
Dbc::get  DB_NEXT
DbLogc::get  DB_NEXT
DbEnv::txn_recover  DB_NEXT
DbEnv::set_flags  DB_NOPANIC
 DB_NOSERVER
DbEnv::set_rpc_server  DB_NOSERVER
 DB_NOSERVER
DbEnv::set_rpc_server  DB_NOSERVER_HOME
 DB_NOSERVER_ID
DbEnv::set_rpc_server  DB_NOSERVER_ID
Db::open  DB_QUEUE
Db::open  DB_RDONLY
DbMpoolFile::open  DB_RDONLY
Db::cursor  DB_READ_COMMITTED
Db::get  DB_READ_COMMITTED
Db::stat  DB_READ_COMMITTED
DbEnv::txn_begin  DB_READ_COMMITTED
Db::cursor  DB_READ_UNCOMMITTED
Db::get  DB_READ_UNCOMMITTED
Db::join  DB_READ_UNCOMMITTED
Db::open  DB_READ_UNCOMMITTED
Db::stat  DB_READ_UNCOMMITTED
Dbc::get  DB_READ_UNCOMMITTED
DbEnv::txn_begin  DB_READ_UNCOMMITTED
Db::open  DB_RECNO
Db::set_flags  DB_RECNUM
DbEnv::open  DB_RECOVER
DbEnv::set_feedback  DB_RECOVER
DbEnv::open  DB_RECOVER_FATAL
DbEnv::set_flags  DB_REGION_INIT
DbEnv::open  DB_REGISTER
Db::set_flags  DB_RENUMBER
DbEnv::repmgr_set_ack_policy  DB_REPMGR_ACKS_ALL
DbEnv::repmgr_set_ack_policy  DB_REPMGR_ACKS_ALL_PEERS
DbEnv::repmgr_set_ack_policy  DB_REPMGR_ACKS_NONE
DbEnv::repmgr_set_ack_policy  DB_REPMGR_ACKS_ONE
DbEnv::repmgr_set_ack_policy  DB_REPMGR_ACKS_ONE_PEER
DbEnv::repmgr_set_ack_policy  DB_REPMGR_ACKS_QUORUM
DbEnv::repmgr_site_list  DB_REPMGR_CONNECTED
DbEnv::repmgr_site_list  DB_REPMGR_DISCONNECTED
DbEnv::repmgr_add_remote_site  DB_REPMGR_PEER
DbEnv::rep_set_timeout  DB_REP_ACK_TIMEOUT
DbEnv::rep_set_transport  DB_REP_ANYWHERE
DbEnv::rep_start  DB_REP_CLIENT
DbEnv::repmgr_start  DB_REP_CLIENT
DbEnv::rep_set_config  DB_REP_CONF_BULK
DbEnv::rep_set_config  DB_REP_CONF_DELAYCLIENT
DbEnv::rep_set_config  DB_REP_CONF_NOAUTOINIT
DbEnv::rep_set_config  DB_REP_CONF_NOWAIT
DbEnv::rep_set_timeout  DB_REP_CONNECTION_RETRY
DbEnv::rep_process_message  DB_REP_DUPMASTER
DbEnv::repmgr_start  DB_REP_ELECTION
DbEnv::rep_set_timeout  DB_REP_ELECTION_RETRY
DbEnv::rep_set_timeout  DB_REP_ELECTION_TIMEOUT
DbEnv::repmgr_start  DB_REP_FULL_ELECTION
 DB_REP_HANDLE_DEAD
DbEnv::rep_process_message  DB_REP_HOLDELECTION
DbEnv::rep_process_message  DB_REP_IGNORE
DbEnv::rep_process_message  DB_REP_ISPERM
DbEnv::rep_process_message  DB_REP_JOIN_FAILURE
 DB_REP_LOCKOUT
DbEnv::rep_start  DB_REP_MASTER
DbEnv::repmgr_start  DB_REP_MASTER
DbEnv::rep_process_message  DB_REP_NEWMASTER
DbEnv::rep_process_message  DB_REP_NEWSITE
DbEnv::set_rep_transport  DB_REP_NOBUFFER
DbEnv::rep_set_transport  DB_REP_NOBUFFER
DbEnv::rep_process_message  DB_REP_NOTPERM
DbEnv::set_rep_transport  DB_REP_PERMANENT
DbEnv::rep_process_message  DB_REP_STARTUPDONE
DbEnv::rep_set_transport  DB_REP_PERMANENT
DbEnv::rep_set_transport  DB_REP_REREQUEST
 DB_REP_UNAVAIL
Db::set_flags  DB_REVSPLITOFF
Db::get  DB_RMW
DbEnv::lock_stat  DB_STAT_ALL
DbEnv::log_stat  DB_STAT_ALL
DbEnv::memp_stat  DB_STAT_ALL
DbEnv::mutex_stat  DB_STAT_ALL
DbEnv::rep_stat  DB_STAT_ALL
DbEnv::txn_stat  DB_STAT_ALL
Db::stat  DB_STAT_CLEAR
DbEnv::stat_print  DB_STAT_CLEAR
DbEnv::lock_stat  DB_STAT_CLEAR
DbEnv::log_stat  DB_STAT_CLEAR
DbEnv::memp_stat  DB_STAT_CLEAR
DbEnv::mutex_stat  DB_STAT_CLEAR
DbEnv::rep_stat  DB_STAT_CLEAR
DbSequence::stat  DB_STAT_CLEAR
DbEnv::txn_stat  DB_STAT_CLEAR
Db::set_flags  DB_TXN_NOT_DURABLE
DbEnv::txn_begin  DB_TXN_NOWAIT
DbEnv::set_app_dispatch  DB_TXN_PRINT
Db::cursor  DB_TXN_SNAPSHOT
DbEnv::set_flags  DB_TXN_SNAPSHOT
DbEnv::txn_begin  DB_TXN_SNAPSHOT
DbEnv::txn_begin  DB_TXN_SYNC
DbTxn::commit  DB_TXN_SYNC
DbEnv::set_flags  DB_TXN_WRITE_NOSYNC
DbEnv::remove  DB_USE_ENVIRON_ROOT
DbEnv::set_verbose  DB_VERB_DEADLOCK
DbEnv::set_verbose  DB_VERB_RECOVERY
DbEnv::set_verbose  DB_VERB_REGISTER
DbEnv::set_verbose  DB_VERB_REPLICATION
DbEnv::set_verbose  DB_VERB_WAITSFOR
Db::set_feedback  DB_VERIFY
 deadlocks
introduction to  debugging
 debugging applications
 degree 2 isolation
 degree 1 isolation
 degree 2 isolation
 degrees of isolation
 deleting records
 deleting records with a cursor
 dirty reads
 dirty reads
 disk space requirements
 Distributed Transactions
 double buffering
 double buffering
 duplicate data items
sorted  duplicate data items
 duplicate data items
 emptying a database
database  encryption
 encryption
turn off access to a database  environment
turn off access to a database  environment
database  environment
use  environment constants in naming
use  environment constants in naming
database  environment FAQ
fault database  environment in during open
fault database  environment in during open
 environment variables
introduction to database  environments
 equality join
XA  FAQ
configuring without large  file support
 file utility
returning pages to the  filesystem
recovery and  filesystem operations
remote  filesystems
page  fill factor
 Flash memory configurations
configuring a small memory  footprint library
Berkeley DB  free-threaded handles
 FreeBSD
 interface compatibility
 IRIX
degrees of  isolation
degree 2  isolation
degree 2  isolation
degree 1  isolation
configuring the  Java API
 Java compatibility
 Java configuration
changing compile or  load options
DbEnv::lock_vec  lock
standard  lock modes
ignore  locking
ignore  locking
page-level  locking
two-phase  locking
 locking and non-Berkeley DB applications
sizing the  locking subsystem
 locking without transactions
 log file limits
automatic  log file removal
automatic  log file removal
 log file removal
 logging configuration
introduction to the  logging subsystem
retrieving Btree records by  logical record @number
in memory  logs
in memory  logs
 Mac OS X
turn off database file  memory mapping
turn off database file  memory mapping
 memory pool configuration
introduction to the  memory pool subsystem
configuring for  MinGW
 mod
DbEnv::lock_vec  mode
 moving databases
 multiversion concurrency control
 MVCC
Berkeley DB library  name spaces
file  naming
 natural join
 ordered retrieval of records from Queue databases
 OSF/1
selecting a  page size
ignore database environment  panic
ignore database environment  panic
 partial record storage and retrieval
 Patches, Updates and Change logs
 Patches, Updates and Change logs
 Perl
retrieved key/data  permanence
 PHP
task/thread  priority
Sleepycat Software's Berkeley DB  products
Berkeley DB  products
building for  QNX
 QNX
dirty  reads
dirty  reads
accessing Btree records by  record number
logical  record numbers
managing  record-based databases
logically renumbering  records
Berkeley DB  recoverability
 renumbering records in Recno databases
 repeatable read
 repeatable reads
introduction to  replication
 Resource Manager
XA  Resource Manager
disabling  shared libraries
 shared libraries
 signal handling
 Sleepycat Software
 snapshot isolation
 Solaris
 source code layout
turn off reverse  splits in Btree databases
cursor  stability
cursor  stability
cursor  stability
disabling  static libraries
database  statistics
 storing records
 storing records with a cursor
configure for  stress testing
configure for  stress testing
 SunOS
loading Berkeley DB with  Tcl
using Berkeley DB with  Tcl
building  threaded applications
lock  timeouts
transaction  timeouts
turn off synchronous  transaction commit
turn off synchronous  transaction commit
turn off synchronous  transaction commit
 transaction configuration
 transaction FAQ
 transaction limits
transaction  tuning
configuring Berkeley DB with the  Tuxedo System
 Ultrix
 Unicode
building for  UNIX
building for  UNIX FAQ
configuring Berkeley DB for  UNIX systems
Patches,  Updates and Change logs
Patches,  Updates and Change logs
 upgrading databases
 Upgrading to release 2.0
 Upgrading to release 3.0
 Upgrading to release 4.1
 Upgrading to release 4.2
 Upgrading to release 4.3
 Upgrading to release 4.4
 Upgrading to release 4.5
 utilities
database  verification
building for  VxWorks FAQ
 __db.001
-

Copyright Sleepycat Software +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_associate.html b/db/docs/api_cxx/db_associate.html index 512889d59..967c68e5d 100644 --- a/db/docs/api_cxx/db_associate.html +++ b/db/docs/api_cxx/db_associate.html @@ -1,5 +1,5 @@ - - + + @@ -24,8 +24,8 @@

int Db::associate(DbTxn *txnid, Db *secondary, - int (*callback)(Db *, const Dbt *, const Dbt *, Dbt *), - u_int32_t flags); + int (*callback)(Db *secondary, + const Dbt *key, const Dbt *data, Dbt *result), u_int32_t flags);


Description: Db::associate

@@ -79,8 +79,12 @@ iterations and range queries will reflect only the corresponding subset of the database. If this is not desirable, the application should ensure that the callback function is well-defined for all possible values and never returns DB_DONOTINDEX.

-
flags
The flags parameter must be set to 0 or -the following value: +

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.

+
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_CREATE
If the secondary database is empty, walk through the primary and create an index to it in the empty secondary. This operation is potentially @@ -97,15 +101,19 @@ another thread of control, until the Db::associate call has returned successfully in the first thread. If transactions are being used, Berkeley DB will perform appropriate locking and the application need not do any special operation ordering.

+
DB_IMMUTABLE_KEY
Specifies the secondary key is immutable. +

This flag can be used to optimize updates when the secondary key in a +primary record will never be changed after the primary record is +inserted. For immutable secondary keys, a best effort is made to avoid +calling the secondary callback function when primary records are +updated. This optimization may reduce the overhead of update operations +significantly if the callback function is expensive.

+

Be sure to specify this flag only if the secondary key in the primary +record is never changed. If this rule is violated, the secondary index +will become corrupted, that is, it will become out of sync with the +primary.

-In addition, the following flag may be set by -bitwise inclusively OR'ing it into the flags parameter: -
-
DB_AUTO_COMMIT
Enclose the Db::associate call within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. -
-
primary
The associate method called should be a method off a database handle for +
primary
The associate method called should be a method of a database handle for the primary database that is to be indexed.
secondary
The secondary parameter should be an open database handle of either a newly created and empty database that is to be used to store @@ -117,10 +125,15 @@ with the DB_THREAD flag it is s of control after the Db::associate method has returned. Note also that either secondary keys must be unique or the secondary database must be configured with support for duplicate data items. -
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The Db::associate method @@ -131,6 +144,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If the secondary database handle has already been associated with this or @@ -147,6 +161,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_class.html b/db/docs/api_cxx/db_class.html index 01dae8395..61b611659 100644 --- a/db/docs/api_cxx/db_class.html +++ b/db/docs/api_cxx/db_class.html @@ -1,5 +1,5 @@ - - + + @@ -45,9 +45,9 @@ The handle should not be closed while any other handle that refers to the database is in use; for example, database handles must not be closed while cursor handles into the database remain open, or transactions that include operations on the database have not yet been committed or -aborted. Once the Db::close, Db::remove, or -Db::rename methods are called, the handle may not be accessed again, -regardless of the method's return.

+aborted. Once the Db::close, Db::remove, +Db::rename, or Db::verify methods are called, the handle may +not be accessed again, regardless of the method's return.

The constructor creates a Db object that is the handle for a Berkeley DB database. The constructor allocates memory internally; calling the Db::close, Db::remove or Db::rename methods will @@ -105,6 +105,6 @@ Db

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_close.html b/db/docs/api_cxx/db_close.html index 0a870b481..90529a2d7 100644 --- a/db/docs/api_cxx/db_close.html +++ b/db/docs/api_cxx/db_close.html @@ -1,5 +1,5 @@ - + @@ -92,6 +92,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_compact.html b/db/docs/api_cxx/db_compact.html new file mode 100644 index 000000000..a3985945e --- /dev/null +++ b/db/docs/api_cxx/db_compact.html @@ -0,0 +1,146 @@ + + + + + + +Berkeley DB: Db::compact + + + + + + + +
+

Db::compact

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +Db::compact(DbTxn *txnid, + Dbt *start, Dbt *stop, DB_COMPACT *c_data, u_int32_t flags, Dbt *end); +

+
+

Description: Db::compact

+

The Db::compact method compacts Btree and Recno access method +databases, and optionally returns unused Btree, Hash or Recno database +pages to the underlying filesystem.

+

The Db::compact method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +DbEnv::txn_begin; otherwise NULL. If no transaction handle is +specified, but the operation occurs in a transactional database, the +operation will be implicitly transaction protected using multiple +transactions. These transactions will be periodically committed to +avoid locking large sections of the tree. Any deadlocks encountered +cause the compaction operation to retried from the point of the last +transaction commit. +
start
If non-NULL, the start parameter is the starting point for +compaction in a Btree or Recno database. Compaction will start at the +smallest key greater than or equal to the specified key. If NULL, +compaction will start at the beginning of the database. +
stop
If non-NULL, the stop parameter is the stopping point for +compaction in a Btree or Recno database. Compaction will stop at the +page with the smallest key greater than the specified key. If NULL, +compaction will stop at the end of the database. +
c_data

If non-NULL, the c_data parameter contains additional compaction +configuration parameters, and returns compaction operation statistics, +in a structure of type DB_COMPACT.

+

The following input configuration fields are available from the +DB_COMPACT structure:

+
+
int compact_fillpercent;
If non-zero, the goal for filling pages, specified as a percentage +between 1 and 100. Any page in a Btree or Recno databases not at or +above this percentage full will be considered for compaction. The +default behavior is to consider every page for compaction, regardless +of its page fill percentage. +
int compact_pages;
If non-zero, the call will return after that number of pages have been +freed. +
db_timeout_t compact_timeout;
If non-zero, and no txnid parameter was specified, the lock +timeout set for implicit transactions, in microseconds. +
+

The following output statistics fields are available from the +DB_COMPACT structure:

+
+
u_int32_t compact_deadlock;
An output statistics parameter: if no txnid parameter was +specified, the number of deadlocks which occurred. +
u_int32_t compact_pages_examine;
An output statistics parameter: the number of database pages reviewed +during the compaction phase. +
u_int32_t compact_pages_free;
An output statistics parameter: the number of database pages freed during +the compaction phase. +
u_int32_t compact_levels;
An output statistics parameter: the number of levels removed from the +Btree or Recno database during the compaction phase. +
u_int32_t compact_pages_truncated;
An output statistics parameter: the number of database pages returned +to the filesystem. +
+
flags
The flags parameter must be set to 0 or +one of the following values: +
+
DB_FREELIST_ONLY
Do no page compaction, only returning pages to the filesystem that are +already free and at the end of the file. This flag must be set if the +database is a Hash access method database. +
DB_FREE_SPACE
Return pages to the filesystem when possible. +If this flag is not specified, pages emptied as a result of compaction +will be placed on the free list for re-use, but never returned to the +filesystem. +

Note that only pages at the end of a file can be returned to the +filesystem. Because of the one-pass nature of the compaction algorithm, +any unemptied page near the end of the file inhibits returning pages to +the file system. A repeated call to the Db::compact method with a low +compact_fillpercent may be used to return pages in this case.

+
+
end
If non-NULL, the end parameter will be filled in with the +database key marking the end of the compaction operation in a Btree or +Recno database. This is generally the first key of the page where the +operation stopped. +
+

Errors

+

The Db::compact method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election +unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization. +
+
+
EACCES
An attempt was made to modify a read-only database. +
+
+
EINVAL
An +invalid flag value or parameter was specified. +
+

If a transactional database environment operation was selected to +resolve a deadlock, the Db::compact method will fail and +either return DB_LOCK_DEADLOCK or +throw a DbDeadlockException exception.

+

If a Berkeley DB Concurrent Data Store database environment configured for lock timeouts was unable +to grant a lock in the allowed time, the Db::compact method will fail and +either return DB_LOCK_NOTGRANTED or +throw a DbLockNotGrantedException exception.

+
+

Class

+Db +

See Also

+Databases and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/db_cursor.html b/db/docs/api_cxx/db_cursor.html index 019a82906..77709be8a 100644 --- a/db/docs/api_cxx/db_cursor.html +++ b/db/docs/api_cxx/db_cursor.html @@ -1,5 +1,5 @@ - - + + @@ -27,7 +27,9 @@ Db::cursor(DbTxn *txnid, Dbc **cursorp, u_int32_t flags);


Description: Db::cursor

-The Db::cursor method returns a created database cursor. +

The Db::cursor method returns a created database cursor.

+

Cursors may span threads, but only serially, that is, the application +must serialize access to the cursor handle.

The Db::cursor method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on @@ -36,27 +38,38 @@ failure, and returns 0 on success.

Parameters

cursorp
The cursorp parameter references memory into which -a pointer to the allocated cursor is copied. +a pointer to the allocated cursor is copied.
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_DEGREE_2
This cursor will have degree 2 isolation. This ensures the stability -of the current data item read by this cursor but permits data read -by this cursor to be modified or deleted prior to the commit of -the transaction for this cursor. -
DB_DIRTY_READ
All read operations performed by the cursor may return modified but not -yet committed data. Silently ignored if the DB_DIRTY_READ flag -was not specified when the underlying database was opened. +
DB_READ_COMMITTED
This cursor will have degree 2 isolation. This ensures the stability +of the current data item read by this cursor but permits data read by +this cursor to be modified or deleted prior to the commit of the +transaction for this cursor. +
DB_READ_UNCOMMITTED
This cursor will have degree 1 isolation. Read operations performed by +the cursor may return modified but not yet committed data. Silently +ignored if the DB_READ_UNCOMMITTED flag was not specified when +the underlying database was opened.
DB_WRITECURSOR
Specify that the cursor will be used to update the database. The underlying database environment must have been opened using the DB_INIT_CDB flag. +
DB_TXN_SNAPSHOT
Specify that the cursor operate with read-only +snapshot isolation. For databases +with the DB_MULTIVERSION flag set, data values will be read as +they are when the cursor is opened, without taking read locks. This +flag implicitly begins a transaction that is committed when the cursor +is closed. Silently ignored if DB_MULTIVERSION not set on the +underlying database or if a transaction is supplied in the txnid +parameter.
-
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. To transaction-protect cursor operations, cursors must be opened and -closed within the context of a transaction, and the txnid -parameter specifies the transaction context in which the cursor may be -used. +
txnid
Cursor operations are not automatically transaction-protected, even if +the DB_AUTO_COMMIT flag is specified to the +DbEnv::set_flags or Db::open methods. If cursor operations are +to be transaction-protected, the txnid parameter must be a +transaction handle returned from DbEnv::txn_begin; otherwise, NULL. To +transaction-protect cursor operations, cursors must be opened and closed +within the context of a transaction, and the txnid parameter +specifies the transaction context in which the cursor may be used.

Errors

The Db::cursor method @@ -67,6 +80,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
An @@ -81,6 +95,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_del.html b/db/docs/api_cxx/db_del.html index 1951faa0b..a9b0edacd 100644 --- a/db/docs/api_cxx/db_del.html +++ b/db/docs/api_cxx/db_del.html @@ -1,5 +1,5 @@ - - + + @@ -45,18 +45,17 @@ failure, and returns 0 on success.

Parameters

+
flags
The flags parameter is currently unused, and must be set to 0.
key
The key Dbt operated on. -
flags
The flags parameter must be set to 0 or -the following value: -
-
DB_AUTO_COMMIT
Enclose the Db::del call within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. -
-
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The Db::del method @@ -67,6 +66,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -95,6 +95,6 @@ throw a DbLockNotGrantedException exc

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_err.html b/db/docs/api_cxx/db_err.html index a9ea77f1c..1b083aab4 100644 --- a/db/docs/api_cxx/db_err.html +++ b/db/docs/api_cxx/db_err.html @@ -1,6 +1,6 @@ - - + + @@ -32,8 +32,8 @@ Db::errx(const char *fmt, ...);

The DbEnv::err, DbEnv::errx, Db::err and Db::errx methods provide error-messaging functionality for applications written using the Berkeley DB library.

-

The DbEnv::err method constructs an error message consisting of the -following elements:

+

The Db::err and DbEnv::err methods constructs an error message +consisting of the following elements:

An optional prefix string
If no error callback function has been set using the DbEnv::set_errcall method, any prefix string specified using the @@ -47,6 +47,10 @@ are converted for output. error value, as returned by the DbEnv::strerror method.
+

The Db::errx and DbEnv::errx methods are the same as the +Db::err and DbEnv::err methods, except they do not append the +final separator characters and standard error string to the error +message.

This constructed error message is then handled as follows:

If an error callback function has been set (see Db::set_errcall and DbEnv::set_errcall), that function is called with two @@ -67,17 +71,6 @@ is written to stderr, the standard error output stream.

string.
fmt
The fmt parameter is an optional printf-style message to display.
-

The DbEnv::errx and Db::errx methods perform identically to the -DbEnv::err and Db::err methods, except that they do not append -the final separator characters and standard error string to the error -message.

-

Parameters

-
-
error
The error parameter is the error value for which the -DbEnv::err and Db::err methods will display a explanatory -string. -
fmt
The fmt parameter is an optional printf-style message to display. -

Class

Db @@ -87,6 +80,6 @@ string.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_fd.html b/db/docs/api_cxx/db_fd.html index 15437bebc..b0440c39b 100644 --- a/db/docs/api_cxx/db_fd.html +++ b/db/docs/api_cxx/db_fd.html @@ -1,5 +1,5 @@ - - + + @@ -32,9 +32,7 @@ of the underlying database. A file descriptor referring to the same file will be returned to all processes that call Db::open with the same file parameter.

This file descriptor may be safely used as a parameter to the -fcntl(2) and flock(2) locking functions. The file -descriptor is not necessarily associated with any of the underlying -files actually used by the access method.

+fcntl(2) and flock(2) locking functions.

The Db::fd method only supports a coarse-grained form of locking. Applications should instead use the Berkeley DB lock manager where possible.

The Db::fd method @@ -45,7 +43,7 @@ failure, and returns 0 on success.

Parameters

fdp
The fdp parameter references memory into which - the current file descriptor is copied. + the current file descriptor is copied.

Class

@@ -56,6 +54,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_get.html b/db/docs/api_cxx/db_get.html index 7ac771a78..304b9e645 100644 --- a/db/docs/api_cxx/db_get.html +++ b/db/docs/api_cxx/db_get.html @@ -1,5 +1,5 @@ - - + + @@ -96,16 +96,6 @@ of type Btree, and it must have been created with the DB_RECNUM flag.

In addition, the following flags may be set by bitwise inclusively OR'ing them into the flags parameter:
-
DB_AUTO_COMMIT
Enclose the Db::get call within a transaction. If the call -succeeds, changes made by the operation will be recoverable. If the -call fails, the operation will have made no changes. This flag may only -be specified with the DB_CONSUME and DB_CONSUME_WAIT -flags. -
DB_DEGREE_2
Perform the get operation with degree 2 isolation. -The read is not repeatable. -
DB_DIRTY_READ
Read modified but not yet committed data. Silently ignored if the -DB_DIRTY_READ flag was not specified when the underlying -database was opened.
DB_MULTIPLE
Return multiple data items in the buffer to which the data parameter refers.

In the case of Btree or Hash databases, all of the data items associated @@ -131,6 +121,12 @@ into secondary indices using the Db::asso

See DbMultipleDataIterator for more information.

+
DB_READ_COMMITTED
Perform the get operation with degree 2 isolation. The read is not +repeatable. +
DB_READ_UNCOMMITTED
Perform the get operation with degree 1 isolation, reading modified but +not yet committed data. Silently ignored if the +DB_READ_UNCOMMITTED flag was not specified when the underlying +database was opened.
DB_RMW
Acquire write locks instead of read locks when doing the retrieval. Setting this flag can eliminate deadlock during a read-modify-write cycle by acquiring the write lock during the read part of the cycle so @@ -143,9 +139,15 @@ transactions.

key
The key Dbt operated on.
pkey
The pkey parameter is the return key from the primary database. -
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The Db::get method @@ -156,6 +158,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -169,6 +172,9 @@ the Db::pget method was called with a Db refer to a secondary index; or if an invalid flag value or parameter was specified.
+

If the requested item could not be returned due to undersized buffer, the Db::get method will fail and +either return DB_BUFFER_SMALL or +throw a DbMemoryException exception.

If a transactional database environment operation was selected to resolve a deadlock, the Db::get method will fail and either return DB_LOCK_DEADLOCK or @@ -182,9 +188,6 @@ timers were configured and the lock could not be granted before the wait-time ex the Db::get method will fail and either return DB_LOCK_NOTGRANTED or throw a DbLockNotGrantedException exception.

-

If the requested item could not be returned due to undersized buffer, the Db::get method will fail and -either return DB_BUFFER_SMALL or -throw a DbMemoryException exception.


Class

Db @@ -194,6 +197,6 @@ throw a DbMemoryException exception.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_get_byteswapped.html b/db/docs/api_cxx/db_get_byteswapped.html index 93f7a04d9..50169a3d8 100644 --- a/db/docs/api_cxx/db_get_byteswapped.html +++ b/db/docs/api_cxx/db_get_byteswapped.html @@ -1,5 +1,5 @@ - + @@ -67,6 +67,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_get_mpf.html b/db/docs/api_cxx/db_get_mpf.html index c7105270f..b92c1074f 100644 --- a/db/docs/api_cxx/db_get_mpf.html +++ b/db/docs/api_cxx/db_get_mpf.html @@ -1,5 +1,5 @@ - - + + @@ -27,11 +27,9 @@ Db::get_mpf();


Description: Db::get_mpf

-

The Db::get_mpf method returns the Db.get_mpf.

+

The Db::get_mpf method returns the handle for the cache file underlying the database.

The Db::get_mpf method may be called at any time during the life of the application.

-

Db::get_mpf gives access to the DbMpoolFile associated -with a Db object.


Class

Db @@ -41,6 +39,6 @@ with a Db object.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_get_type.html b/db/docs/api_cxx/db_get_type.html index f0a91157f..a519b8fb4 100644 --- a/db/docs/api_cxx/db_get_type.html +++ b/db/docs/api_cxx/db_get_type.html @@ -1,5 +1,5 @@ - + @@ -42,7 +42,7 @@ failure, and returns 0 on success.

Parameters

type
The type parameter references memory into which - the type of the underlying access method is copied. + the type of the underlying access method is copied.

Errors

The Db::get_type method @@ -63,6 +63,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_getenv.html b/db/docs/api_cxx/db_getenv.html index 868b5e8e6..2c501c008 100644 --- a/db/docs/api_cxx/db_getenv.html +++ b/db/docs/api_cxx/db_getenv.html @@ -1,5 +1,5 @@ - - + + @@ -27,7 +27,7 @@ Db::get_env();


Description: Db::getenv

-

The Db::getenv method returns the Db.getDbEnv.

+

The Db::getenv method returns the handle for the database environment underlying the database.

The Db::getenv method may be called at any time during the life of the application.


@@ -39,6 +39,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_join.html b/db/docs/api_cxx/db_join.html index f35f25665..08ca7c37f 100644 --- a/db/docs/api_cxx/db_join.html +++ b/db/docs/api_cxx/db_join.html @@ -1,5 +1,5 @@ - - + + @@ -51,8 +51,8 @@ The data parameter is left unchanged. In addition, the following flag may be set by bitwise inclusively OR'ing it into the flags parameter:

-
DB_DIRTY_READ
Read modified but not yet committed data. Silently ignored if the -DB_DIRTY_READ flag was not specified when the underlying +
DB_READ_UNCOMMITTED
Read modified but not yet committed data. Silently ignored if the +DB_READ_UNCOMMITTED flag was not specified when the underlying database was opened.
DB_RMW
Acquire write locks instead of read locks when doing the retrieval. Setting this flag can eliminate deadlock during a read-modify-write @@ -111,6 +111,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -129,6 +130,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_key_range.html b/db/docs/api_cxx/db_key_range.html index 55f492548..7db750f40 100644 --- a/db/docs/api_cxx/db_key_range.html +++ b/db/docs/api_cxx/db_key_range.html @@ -1,5 +1,5 @@ - + @@ -59,9 +59,15 @@ contains three elements of type double: less, equal, and field less is 0.05, 5% of the keys in the database are less than the key parameter. The value for equal will be zero if there is no matching key, and will be non-zero otherwise. -

txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. The Db::key_range method does not retain the locks it acquires for the +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected. The Db::key_range method does not retain the locks it acquires for the life of the transaction, so estimates may not be repeatable.
flags
The flags parameter is currently unused, and must be set to 0.
@@ -74,6 +80,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If the underlying database was not of type Btree; or if an @@ -96,6 +103,6 @@ throw a DbLockNotGrantedException exc

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_list.html b/db/docs/api_cxx/db_list.html index 656e55685..f3d3c5fa4 100644 --- a/db/docs/api_cxx/db_list.html +++ b/db/docs/api_cxx/db_list.html @@ -1,5 +1,5 @@ - + @@ -10,20 +10,19 @@

Berkeley DB: Databases and Related Methods

- + - + + - - @@ -49,7 +48,6 @@ - @@ -66,6 +64,6 @@
Database OperationsDescription
DbCreate a database handle
Db::associateAssociate a secondary index
Db::closeClose a database
Db::closeCreate a cursor
Db::compactCompact a database
Db::cursorCreate a cursor
Db::delDelete items from a database
Db::err, Db::errxError message
Db::fdReturn a file descriptor from a database
Db::get, Db::pgetGet items from a database
Db::get_byteswappedReturn if the underlying database is in host order
Db::getenvReturn database environment handle
Db::get_mpfReturn underlying DbMpoolFile handle
Db::get_typeReturn the database type
Db::joinPerform a database join on cursors
Db::key_rangeReturn estimate of key location
Db::set_flagsGeneral database configuration
Db::set_lorderSet the database byte order
Db::set_pagesizeSet the underlying database page size
Db::set_paniccallSet panic callback
Btree/Recno Configuration
Db::set_append_recnoSet record append callback
Db::set_bt_compareSet a Btree comparison function
Queue Configuration
Db::set_q_extentsizeSet Queue database extent size
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_open.html b/db/docs/api_cxx/db_open.html index 9894c4e03..314095537 100644 --- a/db/docs/api_cxx/db_open.html +++ b/db/docs/api_cxx/db_open.html @@ -1,5 +1,5 @@ - - + + @@ -56,7 +56,7 @@ repeatedly opening and closing the database for each new query.

either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. -If Db::open fails, the Db::close method should be called to +If Db::open fails, the Db::close method must be called to discard the Db handle.

Parameters

@@ -71,40 +71,49 @@ in the same physical file, it is important to consider locking and memory cache issues; see Opening multiple databases in a single file for more information.

In-memory databases never intended to be preserved on disk may be -created by setting both the file and database parameters -to NULL. Note that in-memory databases can only ever be shared by -sharing the single database handle that created them, in circumstances -where doing so is safe.

+created by setting the file parameter to NULL. If the +database parameter is also NULL, the database is strictly +temporary and cannot be opened by any other thread of control, thus the +database can only be accessed by sharing the single database handle that +created it, in circumstances where doing so is safe. If the +database parameter is not set to NULL, the database can be opened +by other threads of control and will be replicated to client sites in +any replication group.

file
The file parameter is used as the name of an underlying file that -will be used to back the database. +will be used to back the database; see File naming for more information.

In-memory databases never intended to be preserved on disk may be -created by setting both the file and database parameters -to NULL. Note that in-memory databases can only ever be shared by -sharing the single database handle that created them, in circumstances -where doing so is safe.

-

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+created by setting the file parameter to NULL.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
DB_AUTO_COMMIT
Enclose the Db::open call within a transaction. If the call -succeeds, the open operation will be recoverable. If the call fails, -no database will have been created. +succeeds, the open operation will be recoverable and all subsequent +database modification operations based on this handle will be +transactionally protected. If the call fails, no database will have +been created.
DB_CREATE
Create the database. If the database does not already exist and the DB_CREATE flag is not specified, the Db::open will fail. -
DB_DIRTY_READ
Support dirty reads; that is, read operations on the database may -request the return of modified but not yet committed data. This flag -must be specified on all Db handles used to perform dirty reads -or database updates, otherwise requests for dirty reads may not be -honored and the read may block.
DB_EXCL
Return an error if the database already exists. The DB_EXCL flag is only meaningful when specified with the DB_CREATE flag. +
DB_MULTIVERSION
Open the database with support for multiversion concurrency control. This will cause updates to the +database to follow a copy-on-write protocol, which is required to +support snapshot isolation. The DB_MULTIVERSION flag requires +that the database be transactionally protected during its open and is +not supported by the queue format.
DB_NOMMAP
Do not map this database into process memory (see the DbEnv::set_mp_mmapsize method for further information).
DB_RDONLY
Open the database for reading only. Any attempt to modify items in the database will fail, regardless of the actual permissions of any underlying files. +
DB_READ_UNCOMMITTED
Support read operations with degree 1 isolation. Read operations on the +database may request the return of modified but not yet committed data. +This flag must be specified on all Db handles used to perform +dirty reads or database updates, otherwise requests for dirty reads may +not be honored and the read may block.
DB_THREAD
Cause the Db handle returned by Db::open to be free-threaded; that is, concurrently usable by multiple threads in the address space. @@ -126,12 +135,18 @@ defaults, and is not further specified by Berkeley DB. System shared memory segments created by the database open are created with mode mode, unmodified by the process' umask value. If mode is 0, the database open will use a default mode of readable and writable by both owner and group.

-
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. Note that transactionally protected operations on a Db handle +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +DB_AUTO_COMMIT flag is specified, +the operation will be implicitly transaction protected. Note that transactionally protected operations on a Db handle requires the Db handle itself be transactionally protected -during its open. +during its open. Also note that the transaction must be committed before +the handle is closed; see Berkeley DB +handles for more information.
type
The type parameter is of type DBTYPE, and must be set to one of DB_BTREE, DB_HASH, DB_QUEUE, DB_RECNO, or DB_UNKNOWN. If type is @@ -186,6 +201,7 @@ invalid flag value or parameter was specified.
DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.

If a transactional database environment operation was selected to resolve a deadlock, the Db::open method will fail and @@ -202,9 +218,9 @@ name.

Parameters

filenamep
The filenamep parameter references memory into which -a pointer to the current filename is copied. +a pointer to the current filename is copied.
dbnamep
The dbnamep parameter references memory into which -a pointer to the current database name is copied. +a pointer to the current database name is copied.

The Db::get_database method may be called at any time during the life of the application.

@@ -243,6 +259,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_put.html b/db/docs/api_cxx/db_put.html index e73fce9b0..aa948d33e 100644 --- a/db/docs/api_cxx/db_put.html +++ b/db/docs/api_cxx/db_put.html @@ -1,5 +1,5 @@ - - + + @@ -71,20 +71,20 @@ supports duplicates. database.

-In addition, the following flag may be set by -bitwise inclusively OR'ing it into the flags parameter: -
-
DB_AUTO_COMMIT
Enclose the Db::put call within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. -
data
The data Dbt operated on.
key
The key Dbt operated on. -
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.
+ +

Errors

The Db::put method may fail and throw @@ -97,6 +97,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If a record number of 0 was specified; @@ -126,6 +127,6 @@ throw a DbLockNotGrantedException exc

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_remove.html b/db/docs/api_cxx/db_remove.html index 16ebb9aa7..37c96adb9 100644 --- a/db/docs/api_cxx/db_remove.html +++ b/db/docs/api_cxx/db_remove.html @@ -1,6 +1,6 @@ - - + + @@ -57,8 +57,9 @@ failure, and returns 0 on success.

database
The database parameter is the database to be removed.
file
The file parameter is the physical file which contains the database(s) to be removed. -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter is currently unused, and must be set to 0.

Environment Variables

@@ -90,6 +91,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_rename.html b/db/docs/api_cxx/db_rename.html index 19c04d5d4..e46e6253f 100644 --- a/db/docs/api_cxx/db_rename.html +++ b/db/docs/api_cxx/db_rename.html @@ -1,6 +1,6 @@ - - + + @@ -60,8 +60,9 @@ failure, and returns 0 on success.

database
The database parameter is the database to be renamed.
file
The file parameter is the physical file which contains the database(s) to be renamed. -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter is currently unused, and must be set to 0.
newname
The newname parameter is the new name of the database or file.
@@ -94,6 +95,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_alloc.html b/db/docs/api_cxx/db_set_alloc.html index d9da6c738..6f8197a29 100644 --- a/db/docs/api_cxx/db_set_alloc.html +++ b/db/docs/api_cxx/db_set_alloc.html @@ -1,6 +1,6 @@ - + @@ -92,6 +92,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_append_recno.html b/db/docs/api_cxx/db_set_append_recno.html index 09875438d..814c1cee0 100644 --- a/db/docs/api_cxx/db_set_append_recno.html +++ b/db/docs/api_cxx/db_set_append_recno.html @@ -1,5 +1,5 @@ - - + + @@ -23,8 +23,7 @@ #include <db_cxx.h>

int -Db::set_append_recno( - int (*db_append_recno_fcn)(DB *dbp, Dbt *data, db_recno_t recno)); +Db::set_append_recno(int (*db_append_recno_fcn)(DB *dbp, Dbt *data, db_recno_t recno));


Description: Db::set_append_recno

@@ -60,6 +59,10 @@ DB_DBT_APPMALLOC, which indicates that Berkeley DB should free the memory when it is done with it.

The callback function must return 0 on success and errno or a value outside of the Berkeley DB error name space on failure.

+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.

Errors

The Db::set_append_recno method @@ -80,6 +83,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_bt_compare.html b/db/docs/api_cxx/db_set_bt_compare.html index bc2a30f8e..fd65aaf14 100644 --- a/db/docs/api_cxx/db_set_bt_compare.html +++ b/db/docs/api_cxx/db_set_bt_compare.html @@ -1,5 +1,5 @@ - + @@ -92,6 +92,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_bt_minkey.html b/db/docs/api_cxx/db_set_bt_minkey.html index 14ca06749..7eb5a136a 100644 --- a/db/docs/api_cxx/db_set_bt_minkey.html +++ b/db/docs/api_cxx/db_set_bt_minkey.html @@ -1,5 +1,5 @@ - + @@ -90,6 +90,6 @@ leaf page in bt_minkeyp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_bt_prefix.html b/db/docs/api_cxx/db_set_bt_prefix.html index e151bdc2a..eec5af02f 100644 --- a/db/docs/api_cxx/db_set_bt_prefix.html +++ b/db/docs/api_cxx/db_set_bt_prefix.html @@ -1,5 +1,5 @@ - + @@ -95,6 +95,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_cachesize.html b/db/docs/api_cxx/db_set_cachesize.html index 72200125d..4321c99e7 100644 --- a/db/docs/api_cxx/db_set_cachesize.html +++ b/db/docs/api_cxx/db_set_cachesize.html @@ -1,6 +1,6 @@ - - + + @@ -38,17 +38,18 @@ pages accessed simultaneously, and is usually much larger.)

The default cache size is 256KB, and may not be specified as less than 20KB. Any cache size less than 500MB is automatically increased by 25% to account for buffer pool overhead; cache sizes larger than 500MB are -used as specified. The current maximum size of a single cache is 4GB. -(All sizes are in powers-of-two, that is, 256KB is 2^18 not 256,000.) -For information on tuning the Berkeley DB cache size, see -Selecting a cache size.

-

It is possible to specify caches to Berkeley DB larger than 4GB and/or large -enough they cannot be allocated contiguously on some architectures. For -example, some releases of Solaris limit the amount of memory that may -be allocated contiguously by a process. If ncache is 0 or 1, -the cache will be allocated contiguously in memory. If it is greater -than 1, the cache will be broken up into ncache equally sized, -separate pieces of memory.

+used as specified. The maximum size of a single cache is 4GB on 32-bit +systems and 10TB on 64-bit systems. (All sizes are in powers-of-two, +that is, 256KB is 2^18 not 256,000.) For information on tuning the Berkeley DB +cache size, see Selecting a +cache size.

+

It is possible to specify caches to Berkeley DB large enough they cannot be +allocated contiguously on some architectures. For example, some +releases of Solaris limit the amount of memory that may be allocated +contiguously by a process. If ncache is 0 or 1, the cache will +be allocated contiguously in memory. If it is greater than 1, the cache +will be broken up into ncache equally sized, separate pieces of +memory.

Because databases opened within Berkeley DB environments use the cache specified to the environment, it is an error to attempt to set a cache in a database created within an environment.

@@ -93,11 +94,11 @@ failure, and returns 0 on success.

Parameters

bytesp
The bytesp parameter references memory into which - the additional bytes of memory in the cache is copied. + the additional bytes of memory in the cache is copied.
gbytesp
The gbytesp parameter references memory into which - the gigabytes of memory in the cache is copied. + the gigabytes of memory in the cache is copied.
ncachep
The ncachep parameter references memory into which - the number of caches is copied. + the number of caches is copied.

Class

@@ -108,6 +109,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_dup_compare.html b/db/docs/api_cxx/db_set_dup_compare.html index 4ff9166e1..6a5e30a0d 100644 --- a/db/docs/api_cxx/db_set_dup_compare.html +++ b/db/docs/api_cxx/db_set_dup_compare.html @@ -1,5 +1,5 @@ - + @@ -90,6 +90,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_encrypt.html b/db/docs/api_cxx/db_set_encrypt.html index 99cb5cc63..75597da1d 100644 --- a/db/docs/api_cxx/db_set_encrypt.html +++ b/db/docs/api_cxx/db_set_encrypt.html @@ -1,6 +1,6 @@ - + @@ -94,6 +94,6 @@ encryption flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_errcall.html b/db/docs/api_cxx/db_set_errcall.html index 6a435d6c4..770975cf8 100644 --- a/db/docs/api_cxx/db_set_errcall.html +++ b/db/docs/api_cxx/db_set_errcall.html @@ -1,6 +1,6 @@ - - + + @@ -51,6 +51,9 @@ as during application debugging.

For Db handles opened inside of Berkeley DB environments, calling the Db::set_errcall method affects the entire environment and is equivalent to calling the DbEnv::set_errcall method.

+

The Db::set_errcall method configures operations performed using the specified +Db handle, not all operations performed on the underlying +database.

The Db::set_errcall method may be called at any time during the life of the application.

Parameters

@@ -63,6 +66,10 @@ reporting function. The function takes three parameters: Db::set_errpfx or DbEnv::set_errpfx).
msg
The msg parameter is the error message string. +

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -73,6 +80,6 @@ reporting function. The function takes three parameters:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_errfile.html b/db/docs/api_cxx/db_set_errfile.html index beb630c2d..47f457961 100644 --- a/db/docs/api_cxx/db_set_errfile.html +++ b/db/docs/api_cxx/db_set_errfile.html @@ -1,6 +1,6 @@ - - + + @@ -55,6 +55,9 @@ as during application debugging.

For Db handles opened inside of Berkeley DB environments, calling the Db::set_errfile method affects the entire environment and is equivalent to calling the DbEnv::set_errfile method.

+

The Db::set_errfile method configures operations performed using the specified +Db handle, not all operations performed on the underlying +database.

The Db::set_errfile method may be called at any time during the life of the application.

Parameters

@@ -64,9 +67,19 @@ displaying additional Berkeley DB error information.

Description: Db::get_errfile

-

The Db::get_errfile method returns the .

+

The Db::get_errfile method returns the FILE *.

The Db::get_errfile method may be called at any time during the life of the application.

+

The Db::get_errfile method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
errfilep
The Db::get_errfile method returns the +FILE * in errfilep. +

Class

Db @@ -76,6 +89,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_error_stream.html b/db/docs/api_cxx/db_set_error_stream.html index 76f6abf96..c4bb79d52 100644 --- a/db/docs/api_cxx/db_set_error_stream.html +++ b/db/docs/api_cxx/db_set_error_stream.html @@ -1,6 +1,6 @@ - - + + @@ -54,6 +54,11 @@ as during application debugging.

For Db handles opened inside of Berkeley DB environments, calling the Db::set_error_stream method affects the entire environment and is equivalent to calling the DbEnv::set_error_stream method.

+

The Db::set_error_stream method configures operations performed using the specified +Db handle, not all operations performed on the underlying +database.

+

The Db::set_error_stream method may be called at any time during the life of the +application.

Parameters

stream
The stream parameter is the application-specified output stream to @@ -68,6 +73,6 @@ be used for additional error information.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_errpfx.html b/db/docs/api_cxx/db_set_errpfx.html index fafde76e8..ef8101b2b 100644 --- a/db/docs/api_cxx/db_set_errpfx.html +++ b/db/docs/api_cxx/db_set_errpfx.html @@ -1,6 +1,6 @@ - - + + @@ -39,6 +39,9 @@ closed.

For Db handles opened inside of Berkeley DB environments, calling the Db::set_errpfx method affects the entire environment and is equivalent to calling the DbEnv::set_errpfx method.

+

The Db::set_errpfx method configures operations performed using the specified +Db handle, not all operations performed on the underlying +database.

The Db::set_errpfx method may be called at any time during the life of the application.

Parameters

@@ -70,6 +73,6 @@ error prefix in errpfxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_feedback.html b/db/docs/api_cxx/db_set_feedback.html index c436c22c5..5f37e396b 100644 --- a/db/docs/api_cxx/db_set_feedback.html +++ b/db/docs/api_cxx/db_set_feedback.html @@ -1,6 +1,6 @@ - - + + @@ -24,8 +24,7 @@ #include <db_cxx.h>

int -Db::set_feedback( - void (*db_feedback_fcn)(DB *dbp, int opcode, int percent)); +Db::set_feedback(void (*db_feedback_fcn)(DB *dbp, int opcode, int percent));


Description: Db::set_feedback

@@ -59,6 +58,10 @@ parameter may take on any of the following values:
percent
The percent parameter is the percent of the operation that has been completed, specified as an integer value between 0 and 100.
+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -69,6 +72,6 @@ been completed, specified as an integer value between 0 and 100.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_flags.html b/db/docs/api_cxx/db_set_flags.html index dbac4c7bc..5067b3462 100644 --- a/db/docs/api_cxx/db_set_flags.html +++ b/db/docs/api_cxx/db_set_flags.html @@ -1,5 +1,5 @@ - + @@ -296,6 +296,6 @@ current flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_h_ffactor.html b/db/docs/api_cxx/db_set_h_ffactor.html index 948b8c306..0475e217d 100644 --- a/db/docs/api_cxx/db_set_h_ffactor.html +++ b/db/docs/api_cxx/db_set_h_ffactor.html @@ -1,5 +1,5 @@ - + @@ -88,6 +88,6 @@ hash table density in h_ffactorp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_h_hash.html b/db/docs/api_cxx/db_set_h_hash.html index 3e2df3574..98537b5c1 100644 --- a/db/docs/api_cxx/db_set_h_hash.html +++ b/db/docs/api_cxx/db_set_h_hash.html @@ -1,5 +1,5 @@ - + @@ -77,6 +77,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_h_nelem.html b/db/docs/api_cxx/db_set_h_nelem.html index 30073a927..d4da2c4f6 100644 --- a/db/docs/api_cxx/db_set_h_nelem.html +++ b/db/docs/api_cxx/db_set_h_nelem.html @@ -1,5 +1,5 @@ - + @@ -87,6 +87,6 @@ estimate of the final size of the hash table in h_nelemp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_lorder.html b/db/docs/api_cxx/db_set_lorder.html index 2e4355370..add3c5d17 100644 --- a/db/docs/api_cxx/db_set_lorder.html +++ b/db/docs/api_cxx/db_set_lorder.html @@ -1,5 +1,5 @@ - + @@ -92,6 +92,6 @@ database byte order in lorderp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_msg_stream.html b/db/docs/api_cxx/db_set_msg_stream.html index 3131a2a42..6f75880d9 100644 --- a/db/docs/api_cxx/db_set_msg_stream.html +++ b/db/docs/api_cxx/db_set_msg_stream.html @@ -1,6 +1,6 @@ - - + + @@ -45,6 +45,11 @@ approaches.

For Db handles opened inside of Berkeley DB environments, calling the Db::set_message_stream method affects the entire environment and is equivalent to calling the DbEnv::set_message_stream method.

+

The Db::set_message_stream method configures operations performed using the specified +Db handle, not all operations performed on the underlying +database.

+

The Db::set_message_stream method may be called at any time during the life of the +application.

Parameters

stream
The stream parameter is the application-specified output stream to @@ -59,6 +64,6 @@ be used for additional message information.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_msgcall.html b/db/docs/api_cxx/db_set_msgcall.html index 878ae80ea..73d5acc7c 100644 --- a/db/docs/api_cxx/db_set_msgcall.html +++ b/db/docs/api_cxx/db_set_msgcall.html @@ -1,6 +1,6 @@ - - + + @@ -23,8 +23,7 @@

 #include <db_cxx.h>
 

-void Db::set_msgcall( - void (*db_msgcall_fcn)(const DbEnv *dbenv, char *msg)); +void Db::set_msgcall(void (*db_msgcall_fcn)(const DbEnv *dbenv, char *msg));


Description: Db::set_msgcall

@@ -45,6 +44,9 @@ to display the messages via a C library FILE *.

For Db handles opened inside of Berkeley DB environments, calling the Db::set_msgcall method affects the entire environment and is equivalent to calling the DbEnv::set_msgcall method.

+

The Db::set_msgcall method configures operations performed using the specified +Db handle, not all operations performed on the underlying +database.

The Db::set_msgcall method may be called at any time during the life of the application.

Parameters

@@ -55,6 +57,10 @@ reporting function. The function takes two parameters:
dbenv
The dbenv parameter is the enclosing database environment.
msg
The msg parameter is the message string.
+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -65,6 +71,6 @@ reporting function. The function takes two parameters:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_msgfile.html b/db/docs/api_cxx/db_set_msgfile.html index b0e2b62fb..787ce7e65 100644 --- a/db/docs/api_cxx/db_set_msgfile.html +++ b/db/docs/api_cxx/db_set_msgfile.html @@ -1,6 +1,6 @@ - - + + @@ -46,6 +46,9 @@ approaches.

For Db handles opened inside of Berkeley DB environments, calling the Db::set_msgfile method affects the entire environment and is equivalent to calling the DbEnv::set_msgfile method.

+

The Db::set_msgfile method configures operations performed using the specified +Db handle, not all operations performed on the underlying +database.

The Db::set_msgfile method may be called at any time during the life of the application.

Parameters

@@ -55,9 +58,19 @@ displaying messages.

Description: Db::get_msgfile

-

The Db::get_msgfile method returns the .

+

The Db::get_msgfile method returns the FILE *.

The Db::get_msgfile method may be called at any time during the life of the application.

+

The Db::get_msgfile method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
msgfilep
The Db::get_msgfile method returns the +FILE * in msgfilep. +

Class

Db @@ -67,6 +80,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_pagesize.html b/db/docs/api_cxx/db_set_pagesize.html index e8c29ef3c..de4c2f96f 100644 --- a/db/docs/api_cxx/db_set_pagesize.html +++ b/db/docs/api_cxx/db_set_pagesize.html @@ -1,5 +1,5 @@ - - + + @@ -45,9 +45,9 @@ If the database already exists when Db::open is called, the information specified to Db::set_pagesize will be ignored.

-If creating additional databases in a file, the page size specified must -be consistent with the existing databases in the file or an error will -be returned. +If creating additional databases in a single physical file, information +specified to Db::set_pagesize will be ignored and the page size +of the existing databases will be used.

The Db::set_pagesize method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on @@ -91,6 +91,6 @@ page size in pagesizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_q_extentsize.html b/db/docs/api_cxx/db_set_q_extentsize.html index 0944ad04f..63f24adda 100644 --- a/db/docs/api_cxx/db_set_q_extentsize.html +++ b/db/docs/api_cxx/db_set_q_extentsize.html @@ -1,5 +1,5 @@ - + @@ -87,6 +87,6 @@ number of pages in an extent in extentsizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_re_delim.html b/db/docs/api_cxx/db_set_re_delim.html index 0efa76b06..85d7173ed 100644 --- a/db/docs/api_cxx/db_set_re_delim.html +++ b/db/docs/api_cxx/db_set_re_delim.html @@ -1,5 +1,5 @@ - + @@ -87,6 +87,6 @@ delimiting byte in delimp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_re_len.html b/db/docs/api_cxx/db_set_re_len.html index c67ca5363..61fca4731 100644 --- a/db/docs/api_cxx/db_set_re_len.html +++ b/db/docs/api_cxx/db_set_re_len.html @@ -1,5 +1,5 @@ - + @@ -94,6 +94,6 @@ record length in re_lenp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_re_pad.html b/db/docs/api_cxx/db_set_re_pad.html index 713196441..c099776d7 100644 --- a/db/docs/api_cxx/db_set_re_pad.html +++ b/db/docs/api_cxx/db_set_re_pad.html @@ -1,5 +1,5 @@ - + @@ -85,6 +85,6 @@ pad character in re_padp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_set_re_source.html b/db/docs/api_cxx/db_set_re_source.html index 4e3f8d179..a6234502a 100644 --- a/db/docs/api_cxx/db_set_re_source.html +++ b/db/docs/api_cxx/db_set_re_source.html @@ -1,5 +1,5 @@ - + @@ -89,8 +89,9 @@ failure, and returns 0 on success.

Parameters

source
The backing flat text database file for a Recno database. -

On Windows, the source argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the source +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

Errors

The Db::set_re_source method @@ -116,6 +117,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_stat.html b/db/docs/api_cxx/db_stat.html index e26b1f013..8a3f19326 100644 --- a/db/docs/api_cxx/db_stat.html +++ b/db/docs/api_cxx/db_stat.html @@ -1,5 +1,5 @@ - - + + @@ -39,21 +39,28 @@ copied into the memory location to which it refers.

flags
The flags parameter must be set to 0 or one of the following values:
-
DB_DEGREE_2
Database items read during this operation will have degree 2 isolation. -This ensures the stability of the data items read during the stat -operation but permits that data to be modified or deleted by other -transactions prior to the commit of the specified transaction. -
DB_DIRTY_READ
Database items read during this operation may include modified but not -yet committed data. Silently ignored if the DB_DIRTY_READ flag -was not specified when the underlying database was opened.
DB_FAST_STAT
Return only the values which do not require traversal of the database. Among other things, this flag makes it possible for applications to request key and record counts without incurring the performance penalty of traversing the entire database. +
DB_READ_COMMITTED
Database items read during this operation will have degree 2 isolation. +This ensures the stability of the data items read during the stat +operation but permits that data to be modified or deleted by other +transactions prior to the commit of the specified transaction. +
DB_READ_UNCOMMITTED
Database items read during this operation will have degree 1 isolation, +including modified but not yet committed data. Silently ignored if the +DB_READ_UNCOMMITTED flag was not specified when the underlying +database was opened.
-
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Statistical structures are stored in allocated memory. If application-specific allocation routines have been declared (see DbEnv::set_alloc for more @@ -199,6 +206,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
An @@ -206,7 +214,7 @@ invalid flag value or parameter was specified.

Description: Db::stat_print

-

The Db::stat_print method returns the +

The Db::stat_print method displays the database statistical information, as described for the Db::stat method. The information is printed to a specified output channel (see the DbEnv::set_msgfile method for more information), or passed to an @@ -221,10 +229,15 @@ failure, and returns 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
+
DB_FAST_STAT
Return only the values which do not require traversal of the database. +Among other things, this flag makes it possible for applications to +request key and record counts without incurring the performance penalty +of traversing the entire database.
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values.

@@ -236,6 +249,6 @@ the following value:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_sync.html b/db/docs/api_cxx/db_sync.html index 5fc73a3c9..7d1e41679 100644 --- a/db/docs/api_cxx/db_sync.html +++ b/db/docs/api_cxx/db_sync.html @@ -1,5 +1,5 @@ - + @@ -58,6 +58,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
An @@ -72,6 +73,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_truncate.html b/db/docs/api_cxx/db_truncate.html index f2a5bfcd2..0a182abe5 100644 --- a/db/docs/api_cxx/db_truncate.html +++ b/db/docs/api_cxx/db_truncate.html @@ -1,5 +1,5 @@ - - + + @@ -44,18 +44,17 @@ failure, and returns 0 on success.

Parameters

countp
The countp parameter references memory into which - the number of records discarded from the database is copied. -
flags
The flags parameter must be set to 0 or -the following value: -
-
DB_AUTO_COMMIT
Enclose the Db::truncate call within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. -
-
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. + the number of records discarded from the database is copied. +
flags
The flags parameter is currently unused, and must be set to 0. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The Db::truncate method @@ -84,6 +83,6 @@ throw a DbLockNotGrantedException exc

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_upgrade.html b/db/docs/api_cxx/db_upgrade.html index c106f9037..7e3243101 100644 --- a/db/docs/api_cxx/db_upgrade.html +++ b/db/docs/api_cxx/db_upgrade.html @@ -1,5 +1,5 @@ - + @@ -101,6 +101,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/db_verify.html b/db/docs/api_cxx/db_verify.html index 223d2e8ae..621cc6309 100644 --- a/db/docs/api_cxx/db_verify.html +++ b/db/docs/api_cxx/db_verify.html @@ -1,5 +1,5 @@ - - + + @@ -64,9 +64,10 @@ to be verified are found. the following value:

DB_SALVAGE
Write the key/data pairs from all databases in the file to the file -stream named in the outfile parameter. The output format is the -same as that specified for the db_dump utility, and can be used -as input for the db_load utility. +stream named in the outfile parameter. Key values are written +for Btree, Hash and Queue databases, but not for Recno databases. +

The output format is the same as that specified for the db_dump +utility, and can be used as input for the db_load utility.

Because the key/data pairs are output in page order as opposed to the sort order used by db_dump, using Db::verify to dump key/data pairs normally produces less than optimal loads for Btree databases.

@@ -143,6 +144,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbc_class.html b/db/docs/api_cxx/dbc_class.html index 1c63f983d..fc4cbb09a 100644 --- a/db/docs/api_cxx/dbc_class.html +++ b/db/docs/api_cxx/dbc_class.html @@ -1,5 +1,5 @@ - + @@ -38,6 +38,6 @@ handle may not be accessed again, regardless of the method's return.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbc_close.html b/db/docs/api_cxx/dbc_close.html index d69c812ea..2664ca9b5 100644 --- a/db/docs/api_cxx/dbc_close.html +++ b/db/docs/api_cxx/dbc_close.html @@ -1,5 +1,5 @@ - - + + @@ -67,6 +67,6 @@ throw a DbLockNotGrantedException exc

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbc_count.html b/db/docs/api_cxx/dbc_count.html index f6a5b4079..f9f717496 100644 --- a/db/docs/api_cxx/dbc_count.html +++ b/db/docs/api_cxx/dbc_count.html @@ -1,5 +1,5 @@ - + @@ -37,7 +37,7 @@ failure, and returns 0 on success.

Parameters

countp
The countp parameter references memory into which - the count of the number of duplicate data items is copied. + the count of the number of duplicate data items is copied.
flags
The flags parameter is currently unused, and must be set to 0.

Errors

@@ -49,6 +49,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If the cursor has not been initialized; or if an @@ -63,6 +64,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbc_del.html b/db/docs/api_cxx/dbc_del.html index c64ff0548..bd735bf7a 100644 --- a/db/docs/api_cxx/dbc_del.html +++ b/db/docs/api_cxx/dbc_del.html @@ -1,5 +1,5 @@ - - + + @@ -55,6 +55,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -87,6 +88,6 @@ throw a DbLockNotGrantedException exc

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbc_dup.html b/db/docs/api_cxx/dbc_dup.html index 7ba5f9628..9c4eb6de2 100644 --- a/db/docs/api_cxx/dbc_dup.html +++ b/db/docs/api_cxx/dbc_dup.html @@ -1,5 +1,5 @@ - + @@ -58,6 +58,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
An @@ -72,6 +73,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbc_get.html b/db/docs/api_cxx/dbc_get.html index c647bf6a7..68bed52f6 100644 --- a/db/docs/api_cxx/dbc_get.html +++ b/db/docs/api_cxx/dbc_get.html @@ -1,5 +1,5 @@ - - + + @@ -189,8 +189,8 @@ flag.

In addition, the following flags may be set by bitwise inclusively OR'ing them into the flags parameter:
-
DB_DIRTY_READ
Read modified but not yet committed data. Silently ignored if the -DB_DIRTY_READ flag was not specified when the underlying +
DB_READ_UNCOMMITTED
Read modified but not yet committed data. Silently ignored if the +DB_READ_UNCOMMITTED flag was not specified when the underlying database was opened.
DB_MULTIPLE
Return multiple data items in the data parameter.

In the case of Btree or Hash databases, duplicate data items for the @@ -279,6 +279,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
DB_SECONDARY_BAD
A secondary index references a nonexistent primary key. @@ -290,6 +291,9 @@ the Dbc::pget method was called with a cursor that does not refer to a secondary index; or if an invalid flag value or parameter was specified.
+

If the requested item could not be returned due to undersized buffer, the Dbc::get method will fail and +either return DB_BUFFER_SMALL or +throw a DbMemoryException exception.

If a transactional database environment operation was selected to resolve a deadlock, the Dbc::get method will fail and either return DB_LOCK_DEADLOCK or @@ -298,9 +302,6 @@ throw a DbDeadlockException excepti to grant a lock in the allowed time, the Dbc::get method will fail and either return DB_LOCK_NOTGRANTED or throw a DbLockNotGrantedException exception.

-

If the requested item could not be returned due to undersized buffer, the Dbc::get method will fail and -either return DB_BUFFER_SMALL or -throw a DbMemoryException exception.


Class

Dbc @@ -310,6 +311,6 @@ throw a DbMemoryException exception.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbc_list.html b/db/docs/api_cxx/dbc_list.html index 49b2904b1..e3772cc00 100644 --- a/db/docs/api_cxx/dbc_list.html +++ b/db/docs/api_cxx/dbc_list.html @@ -1,5 +1,5 @@ - + @@ -10,10 +10,10 @@

Berkeley DB: Database Cursors and Related Methods

- + - + @@ -21,6 +21,6 @@
Database Cursors and Related MethodsDescription
Db::cursorCreate a cursor handle
Db::cursorCreate a cursor
Dbc::closeClose a cursor
Dbc::countReturn count of duplicates
Dbc::delDelete by cursor
Dbc::get, Dbc::pgetRetrieve by cursor
Dbc::putStore by cursor
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbc_put.html b/db/docs/api_cxx/dbc_put.html index f364db07f..b9a952dc2 100644 --- a/db/docs/api_cxx/dbc_put.html +++ b/db/docs/api_cxx/dbc_put.html @@ -1,5 +1,5 @@ - - + + @@ -125,6 +125,7 @@ the following non-zero errors:

DB_REP_HANDLE_DEAD
The database handle has been invalidated because a replication election unrolled a committed transaction. +
DB_REP_LOCKOUT
The operation was blocked by client/master synchronization.
EINVAL
If the DB_AFTER, DB_BEFORE or DB_CURRENT flags @@ -162,6 +163,6 @@ throw a DbLockNotGrantedException exc

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbt_bulk_class.html b/db/docs/api_cxx/dbt_bulk_class.html index 307745185..9acd12223 100644 --- a/db/docs/api_cxx/dbt_bulk_class.html +++ b/db/docs/api_cxx/dbt_bulk_class.html @@ -1,5 +1,5 @@ - + @@ -158,6 +158,6 @@ original bulk retrieval buffer.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbt_class.html b/db/docs/api_cxx/dbt_class.html index feb978c9e..b0638fa78 100644 --- a/db/docs/api_cxx/dbt_class.html +++ b/db/docs/api_cxx/dbt_class.html @@ -1,6 +1,6 @@ - - + + @@ -189,7 +189,7 @@ information.

Description: Dbt::get_doff

Return the offset of the partial record, in bytes.


-

Description: Dbt::set_object

+

Description: Dbt::set_flags

Set the object flag value.

Parameters

@@ -220,8 +220,9 @@ DB_DBT_REALLOC, and DB_DBT_USERMEM.

that is at least ulen bytes in length. If the length of the requested item is less than or equal to that number of bytes, the item is copied into the memory referred to by the data field. -Otherwise, the size field is set to the length needed for the -requested item, and the error DB_BUFFER_SMALL is returned. +Otherwise, the size fields of both the key and data Dbt +objects are set to the length needed for the requested item, and the +error DB_BUFFER_SMALL is returned.

It is an error to specify more than one of DB_DBT_MALLOC, DB_DBT_REALLOC, and DB_DBT_USERMEM.

@@ -271,12 +272,12 @@ bytes would be those specified by the put call.


-

Description: Dbt::set_object

+

Description: Dbt::get_flags

Return the object flag value.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/dbt_package.html b/db/docs/api_cxx/dbt_package.html index 07ca6bc02..88bcfb497 100644 --- a/db/docs/api_cxx/dbt_package.html +++ b/db/docs/api_cxx/dbt_package.html @@ -1,5 +1,5 @@ - + @@ -17,6 +17,6 @@ DbMultipleKeyDataIteratorNext bulk get retrieval DbMultipleRecnoDataIteratorNext bulk get retrieval -

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/deadlock_class.html b/db/docs/api_cxx/deadlock_class.html index 236b7c77a..b55697a1f 100644 --- a/db/docs/api_cxx/deadlock_class.html +++ b/db/docs/api_cxx/deadlock_class.html @@ -1,5 +1,5 @@ - + @@ -38,6 +38,6 @@ termination, and a DbDeadlockException is thrown to that thread.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_cdsgroup_begin.html b/db/docs/api_cxx/env_cdsgroup_begin.html new file mode 100644 index 000000000..1cc8af4cd --- /dev/null +++ b/db/docs/api_cxx/env_cdsgroup_begin.html @@ -0,0 +1,59 @@ + + + + + + +Berkeley DB: DbEnv::cdsgroup_begin + + + + + + + +
+

DbEnv::cdsgroup_begin

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::cdsgroup_begin(DbTxn **tid); +

+
+

Description: DbEnv::cdsgroup_begin

+

The DbEnv::cdsgroup_begin method allocates a locker ID in an +environment configured for Berkeley DB Concurrent Data Store applications. It copies a pointer to +a DbTxn that uniquely identifies the locker ID into the memory +to which tid refers. Calling the DbTxn::commit method will +discard the allocated locker ID.

+

See Berkeley DB Concurrent Data Store applications for more +information about when this is required.

+

The DbEnv::cdsgroup_begin method may be called at any time during the life of the +application.

+

The DbEnv::cdsgroup_begin method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Errors

+

If the maximum number of lockers has been reached, the DbEnv::cdsgroup_begin method will fail and +either return ENOMEM or +throw a DbMemoryException.

+
+

Class

+DbEnv, DbTxn +

See Also

+Transaction Subsystem and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_class.html b/db/docs/api_cxx/env_class.html index 8e9b90287..d4c6a47d4 100644 --- a/db/docs/api_cxx/env_class.html +++ b/db/docs/api_cxx/env_class.html @@ -1,5 +1,5 @@ - - + + @@ -39,7 +39,7 @@ public:

The DbEnv object is the handle for a Berkeley DB environment -- a collection including support for some or all of caching, locking, logging and transaction subsystems, as well as databases and log files. -Methods off the DbEnv handle are used to configure the +Methods of the DbEnv handle are used to configure the environment as well as to operate on subsystems and databases in the environment.

DbEnv handles are free-threaded if the DB_THREAD flag @@ -93,6 +93,6 @@ DbEnv

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_close.html b/db/docs/api_cxx/env_close.html index 303846928..ceb0e6d62 100644 --- a/db/docs/api_cxx/env_close.html +++ b/db/docs/api_cxx/env_close.html @@ -1,5 +1,5 @@ - + @@ -78,6 +78,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_dbremove.html b/db/docs/api_cxx/env_dbremove.html index b4186551f..14219f092 100644 --- a/db/docs/api_cxx/env_dbremove.html +++ b/db/docs/api_cxx/env_dbremove.html @@ -1,5 +1,5 @@ - - + + @@ -48,8 +48,9 @@ failure, and returns 0 on success.

database
The database parameter is the database to be removed.
file
The file parameter is the physical file which contains the database(s) to be removed. -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or the following value:
@@ -57,9 +58,14 @@ the following value: changes made by the operation will be recoverable. If the call fails, the operation will have made no changes.
-
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +DB_AUTO_COMMIT flag is specified, +the operation will be implicitly transaction protected.

Environment Variables

The @@ -98,6 +104,6 @@ throw a DbLockNotGrantedException exc

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_dbrename.html b/db/docs/api_cxx/env_dbrename.html index 50ee81bae..4ecdd706c 100644 --- a/db/docs/api_cxx/env_dbrename.html +++ b/db/docs/api_cxx/env_dbrename.html @@ -1,5 +1,5 @@ - - + + @@ -50,8 +50,9 @@ failure, and returns 0 on success.

database
The database parameter is the database to be renamed.
file
The file parameter is the physical file which contains the database(s) to be renamed. -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or the following value:
@@ -60,9 +61,14 @@ changes made by the operation will be recoverable. If the call fails, the operation will have made no changes.
newname
The newname parameter is the new name of the database or file. -
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +DB_AUTO_COMMIT flag is specified, +the operation will be implicitly transaction protected.

Environment Variables

The @@ -101,6 +107,6 @@ throw a DbLockNotGrantedException exc

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_err.html b/db/docs/api_cxx/env_err.html index cbf4836dd..638d6e0e6 100644 --- a/db/docs/api_cxx/env_err.html +++ b/db/docs/api_cxx/env_err.html @@ -1,5 +1,5 @@ - - + + @@ -31,8 +31,8 @@ DbEnv::errx(const char *fmt, ...);

The DbEnv::err, DbEnv::errx, Db::err and Db::errx methods provide error-messaging functionality for applications written using the Berkeley DB library.

-

The DbEnv::err method constructs an error message consisting of the -following elements:

+

The Db::err and DbEnv::err methods constructs an error message +consisting of the following elements:

An optional prefix string
If no error callback function has been set using the DbEnv::set_errcall method, any prefix string specified using the @@ -46,6 +46,10 @@ are converted for output. error value, as returned by the DbEnv::strerror method.
+

The Db::errx and DbEnv::errx methods are the same as the +Db::err and DbEnv::err methods, except they do not append the +final separator characters and standard error string to the error +message.

This constructed error message is then handled as follows:

If an error callback function has been set (see Db::set_errcall and DbEnv::set_errcall), that function is called with two @@ -66,17 +70,6 @@ DbEnv::err and Db::err methods will displ string.

fmt
The fmt parameter is an optional printf-style message to display. -

The DbEnv::errx and Db::errx methods perform identically to the -DbEnv::err and Db::err methods, except that they do not append -the final separator characters and standard error string to the error -message.

-

Parameters

-
-
error
The error parameter is the error value for which the -DbEnv::err and Db::err methods will display a explanatory -string. -
fmt
The fmt parameter is an optional printf-style message to display. -

Class

DbEnv @@ -86,6 +79,6 @@ string.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_event_notify.html b/db/docs/api_cxx/env_event_notify.html new file mode 100644 index 000000000..e0b28313e --- /dev/null +++ b/db/docs/api_cxx/env_event_notify.html @@ -0,0 +1,94 @@ + + + + + + +Berkeley DB: DbEnv::set_event_notify + + + + + + + +
+

DbEnv::set_event_notify

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::set_event_notify(void (*db_event_fcn)(DB_ENV *dbenv, u_int32_t event, void *event_info)); +

+
+

Description: DbEnv::set_event_notify

+

The DbEnv::set_event_notify method configures a callback function which +is called to notify the process of specific Berkeley DB events.

+

The DbEnv::set_event_notify method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

+

The DbEnv::set_event_notify method may be called at any time during the life of the +application.

+

The DbEnv::set_event_notify method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
db_event_fcn
The db_event_fcn parameter is the application's event +notification function. The function takes three parameters: +
+
dbenv
The dbenv parameter is the enclosing database environment handle. +
event
The event parameter is one of the following values: +
+
DB_EVENT_PANIC
Errors can occur in the Berkeley DB library where the only solution is to shut +down the application and run recovery (for example, if Berkeley DB is unable +to allocate heap memory). In such cases, the Berkeley DB methods will +either return DB_RUNRECOVERY or throw a DbRunRecoveryException, +depending on the API configuration. +It is often easier to simply exit the application when such errors occur +rather than gracefully return up the stack. +

When event is set to DB_EVENT_PANIC, the database +environment has failed. All threads of control in the database +environment should exit the environment, and recovery should be run.

+
DB_EVENT_REP_CLIENT
The local site is now a replication client. +
DB_EVENT_REP_MASTER
The local site is now the master site of its replication group. It is +the application's responsibility to begin acting as the master environment. +
DB_EVENT_REP_NEWMASTER
The replication group of which this site is a member has just established a +new master; the local site is not the new master. The +event_info parameter points to an integer containing the +environment ID of the new master. +

The DB_EVENT_REP_NEWMASTER event is provided only to applications using +the replication manager support.

+
DB_EVENT_REP_STARTUPDONE
The client has completed startup synchronization and is now processing +live log records received from the master. +
DB_EVENT_WRITE_FAILED
A Berkeley DB write to stable storage failed. +
+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.

+
event_info
The event_info parameter may reference memory which contains +additional information describing an event. By default, +event_info is NULL; specific events may pass non-NULL values, +in which case the event will also describe the memory's structure. +
+
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_failchk.html b/db/docs/api_cxx/env_failchk.html new file mode 100644 index 000000000..83acfd93a --- /dev/null +++ b/db/docs/api_cxx/env_failchk.html @@ -0,0 +1,96 @@ + + + + + + +Berkeley DB: DbEnv::failchk + + + + + + + +
+

DbEnv::failchk

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::dbenv_failchk(u_int32_t flags); +

+
+

Description: DbEnv::failchk

+

The DbEnv::failchk method checks for threads of control (either a true +thread or a process) that have exited while manipulating Berkeley DB library +data structures, while holding a logical database lock, or with an +unresolved transaction (that is, a transaction that was never aborted +or committed). For more information, see Architecting Data Store and Concurrent Data Store applications, and +Architecting Transactional Data Store +applications.

+

The DbEnv::failchk method is based on the "thread_id" and "is_alive" +functions specified to the DbEnv::set_thread_id method. Applications +calling the DbEnv::failchk method must have already called the +DbEnv::set_isalive method, on the same DbEnv, and must have +configured their database environment using the +DbEnv::set_thread_count method.

+

If DbEnv::failchk determines a thread of control exited while +holding database read locks, it will release those locks. If +DbEnv::failchk determines a thread of control exited with an +unresolved transaction, the transaction will be aborted. In either of +these cases, DbEnv::failchk will return 0 and the application may +continue to use the database environment.

+

In either of these cases, the DbEnv::failchk method will also report +the process and thread IDs associated with any released locks or +aborted transactions. The information is printed to a specified output +channel (see the DbEnv::set_msgfile method for more information), or +passed to an application callback function (see the +DbEnv::set_msgcall method for more information).

+

If DbEnv::failchk determines a thread of control has exited such +that database environment recovery is required, it will return +DB_RUNRECOVERY. In this case, the application should not +continue to use the database environment. For a further description as +to the actions the application should take when this failure occurs, see +Handling failure in Data Store and +Concurrent Data Store applications, and +Handling failure in Transactional +Data Store applications.

+

The DbEnv::failchk method may not be called before the DbEnv::open method has +been called.

+

The DbEnv::failchk method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
flags
The flags parameter is currently unused, and must be set to 0. +
+

Errors

+

The DbEnv::failchk method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_fileid_reset.html b/db/docs/api_cxx/env_fileid_reset.html new file mode 100644 index 000000000..b366b68cf --- /dev/null +++ b/db/docs/api_cxx/env_fileid_reset.html @@ -0,0 +1,76 @@ + + + + + + +Berkeley DB: DbEnv::fileid_reset + + + + + + + +
+

DbEnv::fileid_reset

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::fileid_reset(const char *file, u_int32_t flags); +

+
+

Description: DbEnv::fileid_reset

+

The DbEnv::fileid_reset method allows database files to be copied, and +then the copy used in the same database environment as the original.

+

All databases contain an ID string used to identify the database in the +database environment cache. If a physical database file is copied, and +used in the same environment as another file with the same ID strings, +corruption can occur. The DbEnv::fileid_reset method creates new ID +strings for all of the databases in the physical file.

+

The DbEnv::fileid_reset method modifies the physical file, in-place. +Applications should not reset IDs in files that are currently in use.

+

The DbEnv::fileid_reset method may be called at any time during the life of the +application.

+

The DbEnv::fileid_reset method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
file
The name of the physical file in which new file IDs are to be created. +
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_ENCRYPT
The file contains encrypted databases. +
+
+

Errors

+

The DbEnv::fileid_reset method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_list.html b/db/docs/api_cxx/env_list.html index 798bd29a5..58486c7d0 100644 --- a/db/docs/api_cxx/env_list.html +++ b/db/docs/api_cxx/env_list.html @@ -1,5 +1,5 @@ - + @@ -10,16 +10,20 @@

Berkeley DB: Database Environments and Related Methods

- + + + + - + + @@ -35,16 +39,19 @@ + - + - + + +
Database Environment OperationsDescription
DbEnvCreate an environment handle
Db::getenvReturn Db's underlying DbEnv handle
DbEnv::closeClose an environment
DbEnv::dbremoveRemove a database
DbEnv::dbrenameRename a database
DbEnv::err, DbEnv::errxError message
DbEnv::failchkCheck for thread failure
DbEnv::fileid_resetReset database file IDs
DbEnv::get_homeReturn environment's home directory
DbEnv::get_open_flagsReturn the flags with which the environment was opened
DbEnv::get_open_flagsReturn flags with which the environment was opened
DbEnv::lsn_resetReset database file LSNs
DbEnv::openOpen an environment
DbEnv::removeRemove an environment
DbEnv::stat_printEnvironment statistics
DbEnv::set_errfile, DbEnv::set_msgfileSet error and informational message FILE
DbEnv::set_error_stream, DbEnv::set_message_streamSet error and informational message output stream
DbEnv::set_errpfxSet error message prefix
DbEnv::set_event_notifySet event notification callback
DbEnv::set_feedbackSet feedback callback
DbEnv::set_flagsEnvironment configuration
DbEnv::set_paniccallSet panic callback
DbEnv::set_isaliveSet thread is-alive callback
DbEnv::set_rpc_serverEstablish an RPC server connection
DbEnv::set_shm_keySet system memory shared segment ID
DbEnv::set_tas_spinsSet the number of test-and-set spins
DbEnv::set_thread_idSet thread of control ID function
DbEnv::set_thread_countSet approximate thread count
DbEnv::set_thread_id_stringSet thread of control ID format function
DbEnv::set_timeoutSet lock and transaction timeout
DbEnv::set_tmp_dirSet the environment temporary file directory
DbEnv::set_verboseSet verbose messages
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_lsn_reset.html b/db/docs/api_cxx/env_lsn_reset.html new file mode 100644 index 000000000..edbfe38ca --- /dev/null +++ b/db/docs/api_cxx/env_lsn_reset.html @@ -0,0 +1,82 @@ + + + + + + +Berkeley DB: DbEnv::lsn_reset + + + + + + + +
+

DbEnv::lsn_reset

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::lsn_reset(const char *file, u_int32_t flags); +

+
+

Description: DbEnv::lsn_reset

+

The DbEnv::lsn_reset method allows database files to be moved from one +transactional database environment to another.

+

Database pages in transactional database environments contain references +to the environment's log files (that is, log sequence numbers, or LSNs). +Copying or moving a database file from one database environment to +another, and then modifying it, can result in data corruption if the +LSNs are not first cleared.

+

Note that LSNs should be reset before moving or copying the database +file into a new database environment, rather than moving or copying the +database file and then resetting the LSNs. Berkeley DB has consistency checks +that may be triggered if an application calls DbEnv::lsn_reset +on a database in a new environment when the database LSNs still reflect +the old environment.

+

The DbEnv::lsn_reset method modifies the physical file, in-place. +Applications should not reset LSNs in files that are currently in use.

+

The DbEnv::lsn_reset method may be called at any time during the life of the +application.

+

The DbEnv::lsn_reset method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
file
The name of the physical file in which the LSNs are to be cleared. +
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_ENCRYPT
The file contains encrypted databases. +
+
+

Errors

+

The DbEnv::lsn_reset method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_open.html b/db/docs/api_cxx/env_open.html index e63f2ce13..4958414b7 100644 --- a/db/docs/api_cxx/env_open.html +++ b/db/docs/api_cxx/env_open.html @@ -1,5 +1,5 @@ - - + + @@ -40,7 +40,7 @@ or more of the features of Berkeley DB.

either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. -If DbEnv::open fails, the DbEnv::close method should be called +If DbEnv::open fails, the DbEnv::close method must be called to discard the DbEnv handle.

Parameters

@@ -51,8 +51,9 @@ resolution in general, see Berkeley DB File Naming. The environment variable DB_HOME may be used as the path of the database home, as described in Berkeley DB File Naming. -

On Windows, the db_home argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the db_home +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter specifies the subsystems that are initialized and how the application's environment affects Berkeley DB file naming, among other things. @@ -60,11 +61,20 @@ The flags parameter must be set to 0 or by bitwise inclusively OR' or more of the following values:

Because there are a large number of flags that can be specified, they have been grouped together by functionality. The first group of flags -indicates which of the Berkeley DB subsystems should be initialized:

+indicates which of the Berkeley DB subsystems should be initialized.

+

The choice of subsystems initialized for a Berkeley DB database environment +is specified by the thread of control initially creating the +environment. Any subsequent thread of control joining the environment +will automatically be configured to use the same subsystems as were +created in the environment (unless the thread of control requests a +subsystem not available in the environment, which will fail). +Applications joining an environment, able to adapt to whatever +subsystems have been configured in the environment, should open the +environment without specifying any subsystem flags. Applications +joining an environment, requiring specific subsystems from their +environments, should open the environment specifying those specific +subsystem flags.

-
DB_JOINENV
Join an existing environment. This option allows applications to -join an existing environment without knowing which Berkeley DB subsystems -the environment supports.
DB_INIT_CDB
Initialize locking for the Berkeley DB Concurrent Data Store product. In this mode, Berkeley DB provides multiple reader/single writer access. The only other subsystem that should be specified with the @@ -96,11 +106,14 @@ DB_INIT_TXN flag implies the DB_INIT_LOG flag. the environment is initialized:

DB_RECOVER
Run normal recovery on this environment before opening it for normal -use. If this flag is set, the DB_CREATE flag must also be set -because the regions will be removed and re-created. +use. If this flag is set, the DB_CREATE and DB_INIT_TXN +flags must also be set, because the regions will be removed and +re-created, and transactions are required for application recovery.
DB_RECOVER_FATAL
Run catastrophic recovery on this environment before opening it for -normal use. If this flag is set, the DB_CREATE flag must also -be set because the regions will be removed and re-created. +normal use. If this flag is set, the DB_CREATE and +DB_INIT_TXN flags must also be set, because the regions will be +removed and re-created, and transactions are required for application +recovery.

A standard part of the recovery process is to remove the existing Berkeley DB environment and create a new one in which to perform recovery. If the @@ -146,27 +159,45 @@ example, users with a user-ID of 0 on UNIX systems).

DB_CREATE
Cause Berkeley DB subsystems to create any underlying files, as necessary.
DB_LOCKDOWN
Lock shared Berkeley DB environment files and memory-mapped databases into memory. -
DB_PRIVATE
Specify that the environment will only be accessed by a single process -(although that process may be multithreaded). This flag has two effects -on the Berkeley DB environment. First, all underlying data structures are -allocated from per-process memory instead of from shared memory that is -potentially accessible to more than a single process. Second, mutexes -are only configured to work between threads. +
DB_PRIVATE
Allocate region memory from the heap instead of from memory backed by +the filesystem or system shared memory. +

This flag implies the environment will only be accessed by a single +process (although that process may be multithreaded). This flag has two +effects on the Berkeley DB environment. First, all underlying data structures +are allocated from per-process memory instead of from shared memory that +is accessible to more than a single process. Second, mutexes are only +configured to work between threads.

This flag should not be specified if more than a single process is accessing the environment because it is likely to cause database corruption and unpredictable behavior. For example, if both a server -application and the Berkeley DB utility db_stat are expected to access -the environment, the DB_PRIVATE flag should not be -specified.

-
DB_SYSTEM_MEM
Allocate memory from system shared memory instead of from memory backed -by the filesystem. See Shared Memory -Regions for more information. +application and Berkeley DB utilities (for example, db_archive, +db_checkpoint or db_stat) are expected to access the +environment, the DB_PRIVATE flag should not be specified.

+

See Shared Memory Regions for more +information.

+
DB_REGISTER
Check to see if recovery needs to be performed before opening the +database environment. (For this check to be accurate, all processes +using the environment must specify DB_REGISTER when opening the +environment.) If recovery needs to be performed for any reason +(including the initial use of the DB_REGISTER flag), and +DB_RECOVER is also specified, recovery will be performed and the +open will proceed normally. If recovery needs to be performed and +DB_RECOVER is not specified, DB_RUNRECOVERY will be +returned. If recovery does not need to be performed, the +DB_RECOVER flag will be ignored. See +Architecting Transactional Data Store +applications for more information. +
DB_SYSTEM_MEM
Allocate region memory from system shared memory instead of from heap +memory or memory backed by the filesystem. +

See Shared Memory Regions for more +information.

DB_THREAD
Cause the DbEnv handle returned by DbEnv::open to be free-threaded; that is, concurrently usable by multiple threads in the address space. The DB_THREAD flag should be specified -if the DbEnv handle will be concurrently used by multiple -threads of control or if multiple DB handles, opened within the database -environment, will be used concurrently. +if the DbEnv handle will be concurrently used by more than one +thread in the process, or if any Db handles opened in the scope +of the DbEnv handle will be concurrently used by more than one +thread in the process.
mode
On Windows systems, the mode parameter is ignored.

On UNIX systems or in IEEE/ANSI Std 1003.1 (POSIX) environments, files created by Berkeley DB @@ -187,6 +218,10 @@ may fail and throw encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

+
DB_RUNRECOVERY
The DB_REGISTER flag was specified, a failure has occurred, and no +recovery flag was specified. +
+
DB_VERSION_MISMATCH
The version of the Berkeley DB library doesn't match the version that created the database environment.
@@ -201,8 +236,12 @@ An incorrectly formatted NAME VALUE entry or line was found; or if an invalid flag value or parameter was specified.
-
ENOSPC
HP-UX only: a previously created Berkeley DB environment for this process still -exists. +
ENOSPC
HP-UX only: +Due to the constraints of the PA-RISC memory architecture, HP-UX does not +allow a process to map a file into its address space multiple times. +For this reason, each Berkeley DB environment may be opened only once by a +process on HP-UX; that is, calls to DbEnv::open will fail if the +specified Berkeley DB environment has been opened and not subsequently closed.
ENOENT
The file or directory does not exist. @@ -236,6 +275,6 @@ open method flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_remove.html b/db/docs/api_cxx/env_remove.html index 7bd166158..ea4474377 100644 --- a/db/docs/api_cxx/env_remove.html +++ b/db/docs/api_cxx/env_remove.html @@ -1,5 +1,5 @@ - + @@ -74,8 +74,9 @@ failure, and returns 0 on success.

Parameters

db_home
The db_home parameter names the database environment to be removed. -

On Windows, the db_home argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the db_home +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
@@ -119,6 +120,6 @@ the following non-zero errors:


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_alloc.html b/db/docs/api_cxx/env_set_alloc.html index 7a288892c..0fc20ffcc 100644 --- a/db/docs/api_cxx/env_set_alloc.html +++ b/db/docs/api_cxx/env_set_alloc.html @@ -1,5 +1,5 @@ - + @@ -99,6 +99,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_app_dispatch.html b/db/docs/api_cxx/env_set_app_dispatch.html index 8e5cfc1d9..6d643330e 100644 --- a/db/docs/api_cxx/env_set_app_dispatch.html +++ b/db/docs/api_cxx/env_set_app_dispatch.html @@ -1,5 +1,5 @@ - + @@ -100,6 +100,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_cachesize.html b/db/docs/api_cxx/env_set_cachesize.html index 07f2881cd..74692e0a6 100644 --- a/db/docs/api_cxx/env_set_cachesize.html +++ b/db/docs/api_cxx/env_set_cachesize.html @@ -1,5 +1,5 @@ - - + + @@ -38,21 +38,22 @@ pages accessed simultaneously, and is usually much larger.)

The default cache size is 256KB, and may not be specified as less than 20KB. Any cache size less than 500MB is automatically increased by 25% to account for buffer pool overhead; cache sizes larger than 500MB are -used as specified. The current maximum size of a single cache is 4GB. -(All sizes are in powers-of-two, that is, 256KB is 2^18 not 256,000.) -For information on tuning the Berkeley DB cache size, see -Selecting a cache size.

-

It is possible to specify caches to Berkeley DB larger than 4GB and/or large -enough they cannot be allocated contiguously on some architectures. For -example, some releases of Solaris limit the amount of memory that may -be allocated contiguously by a process. If ncache is 0 or 1, -the cache will be allocated contiguously in memory. If it is greater -than 1, the cache will be broken up into ncache equally sized, -separate pieces of memory.

-

The database environment's cache size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_cachesize", one or more whitespace characters, -and the cache size specified in three parts: the gigabytes of cache, the +used as specified. The maximum size of a single cache is 4GB on 32-bit +systems and 10TB on 64-bit systems. (All sizes are in powers-of-two, +that is, 256KB is 2^18 not 256,000.) For information on tuning the Berkeley DB +cache size, see Selecting a +cache size.

+

It is possible to specify caches to Berkeley DB large enough they cannot be +allocated contiguously on some architectures. For example, some +releases of Solaris limit the amount of memory that may be allocated +contiguously by a process. If ncache is 0 or 1, the cache will +be allocated contiguously in memory. If it is greater than 1, the cache +will be broken up into ncache equally sized, separate pieces of +memory.

+

The database environment's cache size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_cachesize", one or more whitespace +characters, and the cache size specified in three parts: the gigabytes of cache, the additional bytes of cache, and the number of caches, also separated by whitespace characters. For example, "set_cachesize 2 524288000 3" would create a 2.5GB logical cache, split between three physical caches. @@ -105,11 +106,11 @@ failure, and returns 0 on success.

Parameters

bytesp
The bytesp parameter references memory into which - the additional bytes of memory in the cache is copied. + the additional bytes of memory in the cache is copied.
gbytesp
The gbytesp parameter references memory into which - the gigabytes of memory in the cache is copied. + the gigabytes of memory in the cache is copied.
ncachep
The ncachep parameter references memory into which - the number of caches is copied. + the number of caches is copied.

Class

@@ -120,6 +121,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_data_dir.html b/db/docs/api_cxx/env_set_data_dir.html index adb0d7434..11823c1dc 100644 --- a/db/docs/api_cxx/env_set_data_dir.html +++ b/db/docs/api_cxx/env_set_data_dir.html @@ -1,5 +1,5 @@ - + @@ -41,10 +41,10 @@ path specified.

either by absolute paths or relative to the environment home directory. See Berkeley DB File Naming for more information.

-

The database environment's data directories may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_data_dir", one or more whitespace characters, -and the directory name. +

The database environment's data directories may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_data_dir", one or more whitespace +characters, and the directory name.

The DbEnv::set_data_dir method configures operations performed using the specified DbEnv handle, not all operations performed on the underlying @@ -64,8 +64,9 @@ failure, and returns 0 on success.

dir
The dir parameter is a directory to be used as a location for database files. -

On Windows, the dir argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the dir +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

Errors

The DbEnv::set_data_dir method @@ -101,6 +102,6 @@ NULL-terminated array of directories in dirpp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_encrypt.html b/db/docs/api_cxx/env_set_encrypt.html index 34d0d0581..05f5be827 100644 --- a/db/docs/api_cxx/env_set_encrypt.html +++ b/db/docs/api_cxx/env_set_encrypt.html @@ -1,5 +1,5 @@ - + @@ -97,6 +97,6 @@ encryption flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_errcall.html b/db/docs/api_cxx/env_set_errcall.html index 2d415529c..a1bf2730a 100644 --- a/db/docs/api_cxx/env_set_errcall.html +++ b/db/docs/api_cxx/env_set_errcall.html @@ -1,5 +1,5 @@ - - + + @@ -47,6 +47,9 @@ library FILE *. You should not mix these approaches.

This error-logging enhancement does not slow performance or significantly increase application size, and may be run during normal operation as well as during application debugging.

+

The DbEnv::set_errcall method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

The DbEnv::set_errcall method may be called at any time during the life of the application.

Parameters

@@ -59,6 +62,10 @@ reporting function. The function takes three parameters: Db::set_errpfx or DbEnv::set_errpfx).
msg
The msg parameter is the error message string.
+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -69,6 +76,6 @@ reporting function. The function takes three parameters:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_errfile.html b/db/docs/api_cxx/env_set_errfile.html index bfbd66706..46370d6d3 100644 --- a/db/docs/api_cxx/env_set_errfile.html +++ b/db/docs/api_cxx/env_set_errfile.html @@ -1,5 +1,5 @@ - - + + @@ -53,6 +53,9 @@ a trailing <newline> character.

This error logging enhancement does not slow performance or significantly increase application size, and may be run during normal operation as well as during application debugging.

+

The DbEnv::set_errfile method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

The DbEnv::set_errfile method may be called at any time during the life of the application.

Parameters

@@ -62,9 +65,19 @@ displaying additional Berkeley DB error information.

Description: DbEnv::get_errfile

-

The DbEnv::get_errfile method returns the .

+

The DbEnv::get_errfile method returns the FILE *.

The DbEnv::get_errfile method may be called at any time during the life of the application.

+

The DbEnv::get_errfile method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
errfilep
The DbEnv::get_errfile method returns the +FILE * in errfilep. +

Class

DbEnv @@ -74,6 +87,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_error_stream.html b/db/docs/api_cxx/env_set_error_stream.html index 55c7785b1..85f0b1733 100644 --- a/db/docs/api_cxx/env_set_error_stream.html +++ b/db/docs/api_cxx/env_set_error_stream.html @@ -1,5 +1,5 @@ - - + + @@ -50,6 +50,11 @@ You should not mix these approaches.

This error-logging enhancement does not slow performance or significantly increase application size, and may be run during normal operation as well as during application debugging.

+

The DbEnv::set_error_stream method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

+

The DbEnv::set_error_stream method may be called at any time during the life of the +application.

Parameters

stream
The stream parameter is the application-specified output stream to @@ -64,6 +69,6 @@ be used for additional error information.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_errpfx.html b/db/docs/api_cxx/env_set_errpfx.html index 19e9f7254..952f72a9c 100644 --- a/db/docs/api_cxx/env_set_errpfx.html +++ b/db/docs/api_cxx/env_set_errpfx.html @@ -1,5 +1,5 @@ - - + + @@ -37,6 +37,9 @@ maintain a reference to it. Although this allows applications to modify the error message prefix at any time (without repeatedly calling the interfaces), it means the memory must be maintained until the handle is closed.

+

The DbEnv::set_errpfx method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

The DbEnv::set_errpfx method may be called at any time during the life of the application.

Parameters

@@ -68,6 +71,6 @@ error prefix in errpfxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_feedback.html b/db/docs/api_cxx/env_set_feedback.html index fa611afd8..02f0f6d0d 100644 --- a/db/docs/api_cxx/env_set_feedback.html +++ b/db/docs/api_cxx/env_set_feedback.html @@ -1,5 +1,5 @@ - - + + @@ -23,8 +23,7 @@ #include <db_cxx.h>

int -DbEnv::set_feedback( - void (*db_feedback_fcn)(DbEnv *dbenv, int opcode, int percent)); +DbEnv::set_feedback(void (*db_feedback_fcn)(DbEnv *dbenv, int opcode, int percent));


Description: DbEnv::set_feedback

@@ -60,6 +59,10 @@ parameter may take on any of the following values:
percent
The percent parameter is the percent of the operation that has been completed, specified as an integer value between 0 and 100.
+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -70,6 +73,6 @@ been completed, specified as an integer value between 0 and 100.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_flags.html b/db/docs/api_cxx/env_set_flags.html index 5e18829bf..ffe93f00a 100644 --- a/db/docs/api_cxx/env_set_flags.html +++ b/db/docs/api_cxx/env_set_flags.html @@ -1,5 +1,5 @@ - + @@ -31,10 +31,10 @@ DbEnv::get_flags(u_int32_t *flagsp)


Description: DbEnv::set_flags

Configure a database environment.

-

The database environment's flag values may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_flags", one or more whitespace characters, -and the method flag parameter as a string; for example, "set_flags +

The database environment's flag values may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_flags", one or more whitespace +characters, and the method flag parameter as a string; for example, "set_flags DB_TXN_NOSYNC". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done @@ -49,11 +49,9 @@ failure, and returns 0 on success.

flags
The flags parameter must be set by bitwise inclusively OR'ing together one or more of the following values:
-
DB_AUTO_COMMIT
If set, operations for which no explicit transaction handle was -specified, and which modify databases in the database environment, will -be automatically enclosed within a transaction. If the call succeeds, -changes made by the operation will be recoverable. If the call fails, -the operation will have made no changes. +
DB_AUTO_COMMIT
If set, Db handle operations for which no explicit transaction +handle was specified, and which modify databases in the database +environment, will be automatically enclosed within a transaction.

Calling DbEnv::set_flags with the DB_AUTO_COMMIT flag only affects the specified DbEnv handle (and any other Berkeley DB handles opened within the scope of that handle). @@ -98,15 +96,37 @@ file.

The DB_DIRECT_LOG flag may be used to configure Berkeley DB at any time during the life of the application.

+
DB_DSYNC_DB
Configure Berkeley DB to flush database writes to the backing disk before +returning from the write system call, rather than flushing database +writes explicitly in a separate system call, as necessary. This is only +available on some systems (for example, systems supporting the +IEEE/ANSI Std 1003.1 (POSIX) standard O_DSYNC flag, or systems supporting the Windows +FILE_FLAG_WRITE_THROUGH flag). This flag may result in inaccurate file +modification times and other file-level information for Berkeley DB database +files. This flag will almost certainly result in a performance decrease +on most systems. This flag is only applicable to certain filesysystem +(for example, the Veritas VxFS filesystem), where the filesystem's +support for trickling writes back to stable storage behaves badly (or +more likely, has been misconfigured). +

Calling DbEnv::set_flags with the DB_DSYNC_DB flag only affects +the specified DbEnv handle (and any other Berkeley DB handles opened +within the scope of that handle). +For consistent behavior across the environment, all DbEnv +handles opened in the environment must either set the DB_DSYNC_DB flag +or the flag should be specified in the DB_CONFIG configuration +file.

+

The DB_DSYNC_DB flag may be used to configure Berkeley DB at any time during +the life of the application.

+
DB_DSYNC_LOG
Configure Berkeley DB to flush log writes to the backing disk before returning from the write system call, rather than flushing log writes explicitly -in a separate system call. This is only available on some systems (for -example, systems supporting the IEEE/ANSI Std 1003.1 (POSIX) standard O_DSYNC flag, -or systems supporting the Win32 FILE_FLAG_WRITE_THROUGH flag). This -configuration may result in inaccurate file modification times and other -file-level information for Berkeley DB log files. This configuration may -offer a performance increase on some systems and a performance decrease -on others. +in a separate system call, as necessary. This is only available on some +systems (for example, systems supporting the IEEE/ANSI Std 1003.1 (POSIX) standard +O_DSYNC flag, or systems supporting the Windows FILE_FLAG_WRITE_THROUGH +flag). This flag may result in inaccurate file modification times and +other file-level information for Berkeley DB log files. This flag may offer +a performance increase on some systems and a performance decrease on +others.

Calling DbEnv::set_flags with the DB_DSYNC_LOG flag only affects the specified DbEnv handle (and any other Berkeley DB handles opened within the scope of that handle). @@ -116,7 +136,7 @@ or the flag should be specified in the DB_CONFIG configuration file.

The DB_DSYNC_LOG flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_LOG_AUTOREMOVE
If set, Berkeley DB will automatically remove log files that are no longer needed. Automatic log file removal is likely to make catastrophic recovery impossible. @@ -125,7 +145,7 @@ database environment, including all threads of control accessing the database environment.

The DB_LOG_AUTOREMOVE flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_LOG_INMEMORY
If set, maintain transaction logs in memory rather than on disk. This means that transactions exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database @@ -146,7 +166,7 @@ database environment, including all threads of control accessing the database environment.

The DB_LOG_INMEMORY flag may be used to configure Berkeley DB only before the DbEnv::open method is called.

- +
DB_NOLOCKING
If set, Berkeley DB will grant all requested mutual exclusion mutexes and database locks without regard for their actual availability. This functionality should never be used for purposes other than debugging. @@ -156,7 +176,20 @@ within the scope of that handle).

The DB_NOLOCKING flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_MULTIVERSION
If set, all databases in the environment will be opened as if +DB_MULTIVERSION is passed to Db::open. This flag will +be ignored for queue databases for which DB_MULTIVERSION is not +supported. +

Calling DbEnv::set_flags with the DB_MULTIVERSION flag only affects +the specified DbEnv handle (and any other Berkeley DB handles opened +within the scope of that handle). +For consistent behavior across the environment, all DbEnv +handles opened in the environment must either set the DB_MULTIVERSION flag +or the flag should be specified in the DB_CONFIG configuration +file.

+

The DB_MULTIVERSION flag may be used to configure Berkeley DB at any time during +the life of the application.

+
DB_NOMMAP
If set, Berkeley DB will copy read-only database files into the local cache instead of potentially mapping them into process memory (see the description of the DbEnv::set_mp_mmapsize method for further @@ -170,7 +203,7 @@ or the flag should be specified in the DB_CONFIG configuration file.

The DB_NOMMAP flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_NOPANIC
If set, Berkeley DB will ignore any panic state in the database environment. (Database environments in a panic state normally refuse all attempts to call Berkeley DB functions, returning DB_RUNRECOVERY.) This @@ -193,7 +226,7 @@ within the scope of that handle).

The DB_OVERWRITE flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_PANIC_ENVIRONMENT
If set, Berkeley DB will set the panic state for the database environment. (Database environments in a panic state normally refuse all attempts to call Berkeley DB functions, returning DB_RUNRECOVERY.) This flag may @@ -205,7 +238,7 @@ database environment, including all threads of control accessing the database environment.

The DB_PANIC_ENVIRONMENT flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_REGION_INIT
In some applications, the expense of page-faulting the underlying shared memory regions can affect performance. (For example, if the page-fault occurs while holding a lock, other lock requests can convoy, and overall @@ -239,7 +272,7 @@ or the flag should be specified in the DB_CONFIG configuration file.

The DB_TIME_NOTGRANTED flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_TXN_NOSYNC
If set, Berkeley DB will not write or synchronously flush the log on transaction commit. This means that transactions exhibit the ACI (atomicity, consistency, @@ -258,7 +291,20 @@ handles opened in the environment must either set the DB_TXN_NOSYNC flag or the flag should be specified in the DB_CONFIG configuration file.

The DB_TXN_NOSYNC flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_TXN_SNAPSHOT
If set, all transactions in the environment will be started as if +DB_TXN_SNAPSHOT were passed to DbEnv::txn_begin, and all +non-transactional cursors will be opened as if DB_TXN_SNAPSHOT +were passed to Db::cursor. +

Calling DbEnv::set_flags with the DB_TXN_SNAPSHOT flag only affects +the specified DbEnv handle (and any other Berkeley DB handles opened +within the scope of that handle). +For consistent behavior across the environment, all DbEnv +handles opened in the environment must either set the DB_TXN_SNAPSHOT flag +or the flag should be specified in the DB_CONFIG configuration +file.

+

The DB_TXN_SNAPSHOT flag may be used to configure Berkeley DB at any time during +the life of the application.

+
DB_TXN_WRITE_NOSYNC
If set, Berkeley DB will write, but will not synchronously flush, the log on transaction commit. This means that transactions exhibit the ACI (atomicity, consistency, @@ -277,7 +323,7 @@ or the flag should be specified in the DB_CONFIG configuration file.

The DB_TXN_WRITE_NOSYNC flag may be used to configure Berkeley DB at any time during the life of the application.

- +
DB_YIELDCPU
If set, Berkeley DB will yield the processor immediately after each page or mutex acquisition. This functionality should never be used for purposes other than stress testing. @@ -328,6 +374,6 @@ configuration flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_isalive.html b/db/docs/api_cxx/env_set_isalive.html new file mode 100644 index 000000000..b92e780c3 --- /dev/null +++ b/db/docs/api_cxx/env_set_isalive.html @@ -0,0 +1,86 @@ + + + + + + +Berkeley DB: DbEnv::set_isalive + + + + + + + +
+

DbEnv::set_isalive

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::set_isalive(int (*is_alive)(DbEnv *dbenv, pid_t pid, db_threadid_t tid, u_int32_t flags)); +

+
+

Description: DbEnv::set_isalive

+

Declare a function that returns if a thread of control (either a true +thread or a process) is still running. The DbEnv::set_isalive method +supports the DbEnv::failchk method. For more information, see +Architecting Data Store and Concurrent +Data Store applications, and Architecting Transactional Data Store applications.

+

The DbEnv::set_isalive method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

+

The DbEnv::set_isalive method may be called at any time during the life of the +application.

+

The DbEnv::set_isalive method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
is_alive
The is_alive parameter is a function which returns non-zero if +the thread of control, identified by the pid and tid +arguments, is still running. The function takes four arguments: +
+
dbenv
The dbenv parameter is the enclosing database environment +handle, allowing application access to the application-private fields +of that object. +
pid
The pid parameter is a process ID returned by the function +specified to the DbEnv::set_thread_id method. +
tid
The tid parameter is a thread ID returned by the function +specified to the DbEnv::set_thread_id method. +
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_MUTEX_PROCESS_ONLY
Return only if the process is alive, the thread ID should be ignored. +
+
+
+

Errors

+

The DbEnv::set_isalive method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_set_lg_bsize.html b/db/docs/api_cxx/env_set_lg_bsize.html index 35a62a0ac..4354a787e 100644 --- a/db/docs/api_cxx/env_set_lg_bsize.html +++ b/db/docs/api_cxx/env_set_lg_bsize.html @@ -1,5 +1,5 @@ - - + + @@ -32,11 +32,12 @@ DbEnv::get_lg_bsize(u_int32_t *lg_bsizep);

Description: DbEnv::set_lg_bsize

Set the size of the in-memory log buffer, in bytes.

When the logging subsystem is configured for on-disk logging, the -default size of the in-memory log buffer is 32KB. Log information is -stored in-memory until the storage space fills up or transaction commit -forces the information to be flushed to stable storage. In the presence -of long-running transactions or transactions producing large amounts of -data, larger buffer sizes can increase throughput.

+default size of the in-memory log buffer is approximately 32KB. Log +information is stored in-memory until the storage space fills up or +transaction commit forces the information to be flushed to stable +storage. In the presence of long-running transactions or transactions +producing large amounts of data, larger buffer sizes can increase +throughput.

When the logging subsystem is configured for in-memory logging, the default size of the in-memory log buffer is 1MB. Log information is stored in-memory until the storage space fills up or transaction abort @@ -49,10 +50,10 @@ should ensure the in-memory log buffer size is large enough that no transaction will ever span the entire buffer, and avoid a state where the in-memory buffer is full and no space can be freed because a transaction that started in the first log "file" is still active.

-

The database environment's log buffer size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lg_bsize", one or more whitespace characters, -and the size in bytes. +

The database environment's log buffer size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_bsize", one or more whitespace +characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -108,6 +109,6 @@ size of the log buffer, in bytes in lg_bsizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_lg_dir.html b/db/docs/api_cxx/env_set_lg_dir.html index d3cb50830..d695f3192 100644 --- a/db/docs/api_cxx/env_set_lg_dir.html +++ b/db/docs/api_cxx/env_set_lg_dir.html @@ -1,5 +1,5 @@ - + @@ -38,10 +38,10 @@ environment home directory. See Berkeley DB F

For the greatest degree of recoverability from system or application failure, database files and log files should be located on separate physical devices.

-

The database environment's logging directory may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lg_dir", one or more whitespace characters, -and the directory name. +

The database environment's logging directory may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_dir", one or more whitespace +characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -62,8 +62,9 @@ failure, and returns 0 on success.

Parameters

dir
The dir parameter is the directory used to store the logging files. -

On Windows, the dir argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the dir +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

Errors

The DbEnv::set_lg_dir method @@ -99,6 +100,6 @@ log directory in dirp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_lg_max.html b/db/docs/api_cxx/env_set_lg_max.html index b172b10dc..0025b4aaa 100644 --- a/db/docs/api_cxx/env_set_lg_max.html +++ b/db/docs/api_cxx/env_set_lg_max.html @@ -1,5 +1,5 @@ - + @@ -49,10 +49,10 @@ the in-memory buffer is full and no space can be freed because a transaction that started in the first log "file" is still active.

See Log File Limits for more information.

-

The database environment's log file size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lg_max", one or more whitespace characters, -and the size in bytes. +

The database environment's log file size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_max", one or more whitespace +characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -109,6 +109,6 @@ maximum log file size in lg_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_lg_mode.html b/db/docs/api_cxx/env_set_lg_mode.html new file mode 100644 index 000000000..6f8eec36b --- /dev/null +++ b/db/docs/api_cxx/env_set_lg_mode.html @@ -0,0 +1,91 @@ + + + + + + +Berkeley DB: DbEnv::set_lg_filemode + + + + + + + +
+

DbEnv::set_lg_filemode

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::set_lg_filemode(int lg_mode); +

+int +DbEnv::get_lg_filemode(int *); +

+
+

Description: DbEnv::set_lg_filemode

+

Set the absolute file mode for created log files. This method is +only useful for the rare Berkeley DB application that does not +control its umask value.

+

Normally, if Berkeley DB applications set their umask appropriately, all +processes in the application suite will have read permission on the log +files created by any process in the application suite. However, if the +Berkeley DB application is a library, a process using the library might set +its umask to a value preventing other processes in the application suite +from reading the log files it creates. In this rare case, the +DbEnv::set_lg_filemode method can be used to set the mode of created +log files to an absolute value.

+

The database environment's log file mode may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_filemode", one or more whitespace +characters, and the absolute mode of created log files. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DbEnv::set_lg_filemode method configures a database environment, not only operations +performed using the specified DbEnv handle.

+

The DbEnv::set_lg_filemode method may be called at any time during the life of the +application.

+

The DbEnv::set_lg_filemode method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
lg_filemode
The lg_filemode parameter is the absolute mode of the created +log file. +
+
+

Description: DbEnv::set_lg_filemode

+

The DbEnv::set_lg_filemode method returns the log file mode.

+

The DbEnv::set_lg_filemode method may be called at any time during the life of the +application.

+

The DbEnv::set_lg_filemode method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
lg_modep
The DbEnv::set_lg_filemode method returns the +log file mode in lg_modep. +
+
+

Class

+DbEnv, DbLogc, DbLsn +

See Also

+Logging Subsystem and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_set_lg_regionmax.html b/db/docs/api_cxx/env_set_lg_regionmax.html index eeb8d958d..3643ec74e 100644 --- a/db/docs/api_cxx/env_set_lg_regionmax.html +++ b/db/docs/api_cxx/env_set_lg_regionmax.html @@ -1,5 +1,5 @@ - - + + @@ -32,13 +32,14 @@ DbEnv::get_lg_regionmax(u_int32_t *lg_regionmaxp);

Description: DbEnv::set_lg_regionmax

Set the size of the underlying logging area of the Berkeley DB environment, in bytes. By default, or if the value is set to 0, the default size is -60KB. The log region is used to store filenames, and so may need to be -increased in size if a large number of files will be opened and -registered with the specified Berkeley DB environment's log manager.

-

The database environment's log region size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lg_regionmax", one or more whitespace characters, -and the size in bytes. +approximately 60KB. The log region is used to store filenames, and so +may need to be increased in size if a large number of files will be +opened and registered with the specified Berkeley DB environment's log +manager.

+

The database environment's log region size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lg_regionmax", one or more whitespace +characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -94,6 +95,6 @@ size of the underlying logging subsystem region in lg_regionmaxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_lk_conflicts.html b/db/docs/api_cxx/env_set_lk_conflicts.html index 3ce8babf1..35570cc96 100644 --- a/db/docs/api_cxx/env_set_lk_conflicts.html +++ b/db/docs/api_cxx/env_set_lk_conflicts.html @@ -1,5 +1,5 @@ - + @@ -83,9 +83,9 @@ failure, and returns 0 on success.

Parameters

lk_conflictsp
The lk_conflictsp parameter references memory into which -a pointer to the current conflicts array is copied. +a pointer to the current conflicts array is copied.
lk_modesp
The lk_modesp parameter references memory into which - the size of the current conflicts array is copied. + the size of the current conflicts array is copied.

Class

@@ -96,6 +96,6 @@ a pointer to the current conflicts array is copied.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_lk_detect.html b/db/docs/api_cxx/env_set_lk_detect.html index c8b896d95..fbde86a08 100644 --- a/db/docs/api_cxx/env_set_lk_detect.html +++ b/db/docs/api_cxx/env_set_lk_detect.html @@ -1,5 +1,5 @@ - - + + @@ -35,19 +35,18 @@ occurs, and specify what lock request(s) should be rejected. As transactions acquire locks on behalf of a single locker ID, rejecting a lock request associated with a transaction normally requires the transaction be aborted.

-

The database environment's deadlock detector configuration may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lk_detect", one or more whitespace characters, -and the method detect parameter as a string; for example, +

The database environment's deadlock detector configuration may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lk_detect", one or more whitespace +characters, and the method detect parameter as a string; for example, "set_lk_detect DB_LOCK_OLDEST". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

The DbEnv::set_lk_detect method configures a database environment, not only operations performed using the specified DbEnv handle.

-

Although the DbEnv::set_lk_detect method may be called at any time during the life of -the application, it should normally be called before making calls to the -db_env_create or db_create methods.

+

The DbEnv::set_lk_detect method may be called at any time during the life of the +application.

The DbEnv::set_lk_detect method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on @@ -79,7 +78,7 @@ may fail and throw encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

-
EINVAL
If the method was called after DbEnv::open was called; or if an +
EINVAL
An invalid flag value or parameter was specified.

@@ -106,6 +105,6 @@ deadlock detector configuration in lk_detectp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_lk_max_lockers.html b/db/docs/api_cxx/env_set_lk_max_lockers.html index 91ad31dc4..f4a06a486 100644 --- a/db/docs/api_cxx/env_set_lk_max_lockers.html +++ b/db/docs/api_cxx/env_set_lk_max_lockers.html @@ -1,5 +1,5 @@ - + @@ -35,10 +35,10 @@ environment. This value is used by DbEnv::op much space to allocate for various lock-table data structures. The default value is 1000 lockers. For specific information on configuring the size of the lock subsystem, see Configuring locking: sizing the system.

-

The database environment's maximum number of lockers may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lk_max_lockers", one or more whitespace characters, -and the number of lockers. +

The database environment's maximum number of lockers may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lk_max_lockers", one or more whitespace +characters, and the number of lockers. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -94,6 +94,6 @@ maximum number of lockers in lk_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_lk_max_locks.html b/db/docs/api_cxx/env_set_lk_max_locks.html index 8383ac004..e72170586 100644 --- a/db/docs/api_cxx/env_set_lk_max_locks.html +++ b/db/docs/api_cxx/env_set_lk_max_locks.html @@ -1,5 +1,5 @@ - + @@ -36,10 +36,10 @@ allocate for various lock-table data structures. The default value is 1000 locks. For specific information on configuring the size of the lock subsystem, see Configuring locking: sizing the system.

-

The database environment's maximum number of locks may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lk_max_locks", one or more whitespace characters, -and the number of locks. +

The database environment's maximum number of locks may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lk_max_locks", one or more whitespace +characters, and the number of locks. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -95,6 +95,6 @@ maximum number of locks in lk_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_lk_max_objects.html b/db/docs/api_cxx/env_set_lk_max_objects.html index 770aba038..17069d8df 100644 --- a/db/docs/api_cxx/env_set_lk_max_objects.html +++ b/db/docs/api_cxx/env_set_lk_max_objects.html @@ -1,5 +1,5 @@ - + @@ -35,10 +35,10 @@ environment. This value is used by DbEnv::op much space to allocate for various lock-table data structures. The default value is 1000 objects. For specific information on configuring the size of the lock subsystem, see Configuring locking: sizing the system.

-

The database environment's maximum number of objects may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lk_max_objects", one or more whitespace characters, -and the number of objects. +

The database environment's maximum number of objects may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lk_max_objects", one or more whitespace +characters, and the number of objects. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -94,6 +94,6 @@ maximum number of locked objects in lk_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_mp_mmapsize.html b/db/docs/api_cxx/env_set_mp_mmapsize.html index cf23f7ef9..ac2577d2d 100644 --- a/db/docs/api_cxx/env_set_mp_mmapsize.html +++ b/db/docs/api_cxx/env_set_mp_mmapsize.html @@ -1,5 +1,5 @@ - + @@ -41,10 +41,10 @@ in immense process sizes in the presence of large databases.

The DbEnv::get_mp_mmapsize method sets the maximum file size, in bytes, for a file to be mapped into the process address space. If no value is specified, it defaults to 10MB.

-

The database environment's maximum mapped file size may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_mp_mmapsize", one or more whitespace characters, -and the size in bytes. +

The database environment's maximum mapped file size may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_mp_mmapsize", one or more whitespace +characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -96,6 +96,6 @@ maximum file map size in mp_mmapsizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_msg_stream.html b/db/docs/api_cxx/env_set_msg_stream.html index d9a193c27..cd5815394 100644 --- a/db/docs/api_cxx/env_set_msg_stream.html +++ b/db/docs/api_cxx/env_set_msg_stream.html @@ -1,5 +1,5 @@ - - + + @@ -41,6 +41,11 @@ or the DbEnv::set_msgcall and +

The DbEnv::set_message_stream method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

+

The DbEnv::set_message_stream method may be called at any time during the life of the +application.

Parameters

stream
The stream parameter is the application-specified output stream to @@ -55,6 +60,6 @@ be used for additional message information.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_msgcall.html b/db/docs/api_cxx/env_set_msgcall.html index 3c8bdf26c..4da39490b 100644 --- a/db/docs/api_cxx/env_set_msgcall.html +++ b/db/docs/api_cxx/env_set_msgcall.html @@ -1,5 +1,5 @@ - - + + @@ -22,8 +22,7 @@

 #include <db_cxx.h>
 

-void DbEnv::set_msgcall( - void (*db_msgcall_fcn)(const DbEnv *dbenv, const char *msg)); +void DbEnv::set_msgcall(void (*db_msgcall_fcn)(const DbEnv *dbenv, const char *msg));


Description: DbEnv::set_msgcall

@@ -41,6 +40,9 @@ manner.

Db::set_message_stream methods to display the messages via an output stream, or the Db::set_msgfile or DbEnv::set_msgfile methods to display the messages via a C library FILE *.

+

The DbEnv::set_msgcall method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

The DbEnv::set_msgcall method may be called at any time during the life of the application.

Parameters

@@ -51,6 +53,10 @@ reporting function. The function takes two parameters:
dbenv
The dbenv parameter is the enclosing database environment.
msg
The msg parameter is the message string.
+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.


Class

@@ -61,6 +67,6 @@ reporting function. The function takes two parameters:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_msgfile.html b/db/docs/api_cxx/env_set_msgfile.html index 42cf5b20b..fdcc4a8a5 100644 --- a/db/docs/api_cxx/env_set_msgfile.html +++ b/db/docs/api_cxx/env_set_msgfile.html @@ -1,5 +1,5 @@ - - + + @@ -44,6 +44,9 @@ stream, or the DbEnv::set_msgcall to capture the additional error information in a way that does not use either output streams or C library FILE *'s. You should not mix these approaches.

+

The DbEnv::set_msgfile method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

The DbEnv::set_msgfile method may be called at any time during the life of the application.

Parameters

@@ -53,9 +56,19 @@ displaying messages.

Description: DbEnv::get_msgfile

-

The DbEnv::get_msgfile method returns the .

+

The DbEnv::get_msgfile method returns the FILE *.

The DbEnv::get_msgfile method may be called at any time during the life of the application.

+

The DbEnv::get_msgfile method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
msgfilep
The DbEnv::get_msgfile method returns the +FILE * in msgfilep. +

Class

DbEnv @@ -65,6 +78,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_rpc_server.html b/db/docs/api_cxx/env_set_rpc_server.html index 64e812c3e..da69cd9bd 100644 --- a/db/docs/api_cxx/env_set_rpc_server.html +++ b/db/docs/api_cxx/env_set_rpc_server.html @@ -1,5 +1,5 @@ - + @@ -86,6 +86,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_shm_key.html b/db/docs/api_cxx/env_set_shm_key.html index 6cdb186f2..3245f6fd8 100644 --- a/db/docs/api_cxx/env_set_shm_key.html +++ b/db/docs/api_cxx/env_set_shm_key.html @@ -1,5 +1,5 @@ - + @@ -52,10 +52,10 @@ the same segment IDs when creating different Berkeley DB environments. In addition, by using the same segment IDs each time the environment is created, previously created segments will be removed, and the set of segments on the system will not grow without bound.

-

The database environment's base segment ID may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_shm_key", one or more whitespace characters, -and the ID. +

The database environment's base segment ID may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_shm_key", one or more whitespace +characters, and the ID. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -112,6 +112,6 @@ base segment ID in shm_keyp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_thread_count.html b/db/docs/api_cxx/env_set_thread_count.html new file mode 100644 index 000000000..39bd833e6 --- /dev/null +++ b/db/docs/api_cxx/env_set_thread_count.html @@ -0,0 +1,98 @@ + + + + + + +Berkeley DB: DbEnv::set_thread_count + + + + + + + +
+

DbEnv::set_thread_count

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::set_thread_count(u_int32_t count); +

+int +DbEnv::get_thread_count(u_int32_t *countp); +

+
+

Description: DbEnv::set_thread_count

+

Declare an approximate number of threads in the database environment. +The DbEnv::set_thread_count method must be called prior to opening the +database environment if the DbEnv::failchk method will be used. The +DbEnv::set_thread_count method does not set the maximum number of +threads but is used to determine memory sizing and the thread control +block reclamation policy.

+

The database environment's thread count may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_thread_count", one or more whitespace +characters, and the thread count. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DbEnv::set_thread_count method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

+

The DbEnv::set_thread_count method may not be called after the DbEnv::open method is +called. +

+

The DbEnv::set_thread_count method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
count
The count parameter is an approximate thread count for the +database environment. +
+

Errors

+

The DbEnv::set_thread_count method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
If the method was called after DbEnv::open was called; or if an +invalid flag value or parameter was specified. +
+
+

Description: DbEnv::get_thread_count

+

The DbEnv::get_thread_count method returns the thread count.

+

The DbEnv::get_thread_count method may be called at any time during the life of the +application.

+

The DbEnv::get_thread_count method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
countp
The DbEnv::get_thread_count method returns the +thread count in countp. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_set_thread_id.html b/db/docs/api_cxx/env_set_thread_id.html new file mode 100644 index 000000000..54a0feb64 --- /dev/null +++ b/db/docs/api_cxx/env_set_thread_id.html @@ -0,0 +1,126 @@ + + + + + + +Berkeley DB: DbEnv::set_thread_id + + + + + + + +
+

DbEnv::set_thread_id

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::set_thread_id(void (*thread_id)(DbEnv *dbenv, pid_t *pid, db_threadid_t *tid)); +

+
+

Description: DbEnv::set_thread_id

+

Declare a function that returns a unique identifier pair for the current +thread of control. The DbEnv::set_thread_id method supports the +DbEnv::failchk method. For more information, see +Architecting Data Store and Concurrent +Data Store applications, and Architecting Transactional Data Store applications.

+

The DbEnv::set_thread_id method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

+

The DbEnv::set_thread_id method may be called at any time during the life of the +application.

+

The DbEnv::set_thread_id method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
thread_id
The thread_id parameter is a function which returns a unique +identifier pair for a thread of control in a Berkeley DB application. The +function takes three arguments: +
+
dbenv
The dbenv parameter is the enclosing database environment +handle, allowing application access to the application-private fields +of that object. +
pid
The pid points to a memory location of type pid_t. The +process ID of the current thread of control may be returned in +this memory location. +
tid
The tid points to a memory location of type db_threadid_t. The +thread ID of the current thread of control may be returned in this +memory location. +
+
+

The standard system library calls to return process and thread IDs are +often sufficient for this purpose (for example, getpid() and +pthread_self() on POSIX systems or GetCurrentThreadID on Windows +systems). However, if the Berkeley DB application dynamically creates +processes or threads, some care may be necessary in assigning unique +IDs. In most threading systems, process and thread IDs are available +for re-use as soon as the process or thread exits. If a new process or +thread is created between the time of process or thread exit, and the +DbEnv::failchk method is run, it may be possible for +DbEnv::failchk to not detect that a thread of control exited +without properly releasing all Berkeley DB resources.

+

It may be possible to handle this problem by inhibiting process or +thread creation between thread of control exit and calling +DbEnv::failchk. Alternatively, the thread_id function +must be constructed to not re-use pid/tid pairs. For +example, in a single process application, the returned process ID might +be used as an incremental counter, with the returned thread ID set to +the actual thread ID. Obviously, the is_alive function +specified to the DbEnv::set_isalive method must be compatible with any +thread_id function specified to DbEnv::set_thread_id.

+

The db_threadid_t type is configured to be the same type as a standard +thread identifier, in Berkeley DB configurations where this type is known (for +example, systems supporting pthread_t or thread_t, or DWORD on Windows). +If the Berkeley DB configuration process is unable to determine the type of a +standard thread identifier, the db_thread_t type is set to uintmax_t (or +the largest available unsigned integral type, on systems lacking the +uintmax_t type). Applications running on systems lacking a detectable +standard thread type, and which are also using thread APIs where a +thread identifier is not an integral value and so will not fit into the +configured db_threadid_t type, must either translate between the +db_threadid_t type and the thread identifier (mapping the thread +identifier to a unique identifier of the appropriate size), or modify +the Berkeley DB sources to use an appropriate db_threadid_t type. Note: we +do not currently know of any systems where this is necessary. If your +application has to solve this problem, please contact our support group +and let us know.

+

If no thread_id function is specified by the application, the +Berkeley DB library will identify threads of control by using the taskIdSelf() +call on VxWorks, the getpid() and GetCurrentThreadID() calls on Windows, +the getpid() and pthread_self() calls when the Berkeley DB library has been +configured for POSIX pthreads or Solaris LWP threads, the getpid() and +thr_self() calls when the Berkeley DB library has been configured for UI +threads, and otherwise getpid().

+

Errors

+

The DbEnv::set_thread_id method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_set_thread_id_string.html b/db/docs/api_cxx/env_set_thread_id_string.html new file mode 100644 index 000000000..87eb34c57 --- /dev/null +++ b/db/docs/api_cxx/env_set_thread_id_string.html @@ -0,0 +1,88 @@ + + + + + + +Berkeley DB: DbEnv::set_thread_id_string + + + + + + + +
+

DbEnv::set_thread_id_string

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::set_thread_id(char *(*thread_id_string)(DbEnv *dbenv, + pid_t pid, db_threadid_t tid, char *buf)); +

+
+

Description: DbEnv::set_thread_id_string

+

Declare a function that formats a process ID and thread ID identifier +pair for display into a caller-supplied buffer. The function must +return a reference to the caller-specified buffer. The +DbEnv::set_thread_id_string method supports the +DbEnv::set_thread_id method.

+

The DbEnv::set_thread_id_string method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

+

The DbEnv::set_thread_id_string method may be called at any time during the life of the +application.

+

The DbEnv::set_thread_id_string method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
thread_id_string
The thread_id_string parameter is a function which returns a +buffer in which is an identifier pair formatted for display. The +function takes four arguments: +
+
dbenv
The dbenv parameter is the enclosing database environment +handle, allowing application access to the application-private fields +of that object. +
pid
The pid argument is a process ID. +
tid
The tid argument is a thread ID. +
buf
+The buf argument is character array of at least +DB_THREADID_STRLEN bytes in length, into which the identifier +pair should be formatted. +
+
+

If no thread_id_string function is specified, the default +routine displays the identifier pair as "pid/tid", that is, the process +ID represented as an unsigned integer value, a slash ('/') character, +then the thread ID represented as an unsigned integer value.

+

Errors

+

The DbEnv::set_thread_id_string method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/env_set_timeout.html b/db/docs/api_cxx/env_set_timeout.html index 096a6781f..7f42abccb 100644 --- a/db/docs/api_cxx/env_set_timeout.html +++ b/db/docs/api_cxx/env_set_timeout.html @@ -1,5 +1,5 @@ - - + + @@ -32,8 +32,8 @@ DbEnv::get_timeout(db_timeout_t *timeoutp, u_int32_t flag);

Description: DbEnv::set_timeout

The DbEnv::set_timeout method sets timeout values for locks or transactions in the database environment.

-

Timeouts are checked whenever a thread of control blocks on a lock or -when deadlock detection is performed. (In the case of +

All timeouts are checked whenever a thread of control blocks on a lock +or when deadlock detection is performed. (In the case of DB_SET_LOCK_TIMEOUT, the lock is one requested explicitly through the Lock subsystem interfaces. In the case of DB_SET_TXN_TIMEOUT, the lock is one requested on behalf of a @@ -59,18 +59,18 @@ failure, and returns 0 on success.

flags
The flags parameter must be set to one of the following values:
DB_SET_LOCK_TIMEOUT
Set the timeout value for locks in this database environment. -

The database environment's lock timeout value may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_lock_timeout", one or more whitespace characters, -and the lock timeout value. +

The database environment's lock timeout value may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_lock_timeout", one or more whitespace +characters, and the lock timeout value. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

DB_SET_TXN_TIMEOUT
Set the timeout value for transactions in this database environment. -

The database environment's transaction timeout value may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_txn_timeout", one or more whitespace characters, -and the transaction timeout value. +

The database environment's transaction timeout value may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_txn_timeout", one or more whitespace +characters, and the transaction timeout value. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -107,7 +107,7 @@ failure, and returns 0 on success.
DB_SET_TXN_TIMEOUT
Return the timeout value for transactions in this database environment.
timeoutp
The timeoutp parameter references memory into which - the timeout value of the specified flag parameter is copied. + the timeout value of the specified flag parameter is copied.

Class

@@ -118,6 +118,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_tmp_dir.html b/db/docs/api_cxx/env_set_tmp_dir.html index cacb15f7a..c6678fcba 100644 --- a/db/docs/api_cxx/env_set_tmp_dir.html +++ b/db/docs/api_cxx/env_set_tmp_dir.html @@ -1,5 +1,5 @@ - + @@ -55,10 +55,10 @@ all temporary files.

DB_USE_ENVIRON or DB_USE_ENVIRON_ROOT flags were specified.

Note: the GetTempPath interface is only checked on Win/32 platforms.

-

The database environment's temporary file directory may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_tmp_dir", one or more whitespace characters, -and the directory name. +

The database environment's temporary file directory may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_tmp_dir", one or more whitespace +characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -80,8 +80,9 @@ failure, and returns 0 on success.
dir
The dir parameter is the directory to be used to store temporary files. -

On Windows, the dir argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the dir +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

Errors

The DbEnv::set_tmp_dir method @@ -117,6 +118,6 @@ database environment temporary file directory in dirp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_tx_max.html b/db/docs/api_cxx/env_set_tx_max.html index 5448e8328..08c310f50 100644 --- a/db/docs/api_cxx/env_set_tx_max.html +++ b/db/docs/api_cxx/env_set_tx_max.html @@ -1,5 +1,5 @@ - - + + @@ -34,15 +34,19 @@ DbEnv::get_tx_max(u_int32_t *tx_maxp); active transactions. This value bounds the size of the memory allocated for transactions. Child transactions are counted as active until they either commit or abort.

+

Transactions that update multiversion databases are not freed until the +last page version that the transaction created is flushed from cache. +This means that applications using multi-version concurrency control may +need a transaction for each page in cache, in the extreme case.

When all of the memory available in the database environment for transactions is in use, calls to DbEnv::txn_begin will fail (until some -active transactions complete). If this interface is never called, -the database environment is configured to support at least 20 active +active transactions complete). If this interface is never called, the +database environment is configured to support at least 100 active transactions.

-

The database environment's number of active transactions may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_tx_max", one or more whitespace characters, -and the number of transactions. +

The database environment's number of active transactions may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_tx_max", one or more whitespace +characters, and the number of transactions. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

@@ -99,6 +103,6 @@ number of active transactions in tx_maxp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_tx_timestamp.html b/db/docs/api_cxx/env_set_tx_timestamp.html index fd5ea85fd..790ab5c6c 100644 --- a/db/docs/api_cxx/env_set_tx_timestamp.html +++ b/db/docs/api_cxx/env_set_tx_timestamp.html @@ -1,5 +1,5 @@ - + @@ -89,6 +89,6 @@ recovery timestamp in timestampp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_set_verbose.html b/db/docs/api_cxx/env_set_verbose.html index e4f2c48ad..54f303b35 100644 --- a/db/docs/api_cxx/env_set_verbose.html +++ b/db/docs/api_cxx/env_set_verbose.html @@ -1,5 +1,5 @@ - - + + @@ -34,11 +34,11 @@ DbEnv::get_verbose(u_int32_t which, int *onoffp); and debugging messages in the Berkeley DB message output on and off. To see the additional messages, verbose messages must also be configured for the application. For more information on verbose messages, see the -Db::set_errfile method.

-

The database environment's messages may also be set using the environment's -DB_CONFIG file. The syntax of the entry in that file is a -single line with the string "set_verbose", one or more whitespace characters, -and the method which parameter as a string; for example, +DbEnv::set_msgfile method.

+

The database environment's messages may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_verbose", one or more whitespace +characters, and the method which parameter as a string; for example, "set_verbose DB_VERB_RECOVERY". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done @@ -61,8 +61,10 @@ messages are output.

DB_VERB_DEADLOCK
Display additional information when doing deadlock detection.
DB_VERB_RECOVERY
Display additional information when performing recovery. +
DB_VERB_REGISTER
Display additional information concerning support for the +DB_REGISTER flag to the DbEnv::open method.
DB_VERB_REPLICATION
Display additional information when processing replication messages. -

Note, to get complete replication logging when debugging replication +

To get complete replication logging when debugging replication applications, you must also configure and build the Berkeley DB library with the --enable-diagnostic configuration option as well as call the DbEnv::set_verbose method.

@@ -80,12 +82,12 @@ the following non-zero errors:

invalid flag value or parameter was specified.

-

Description: dbenv_get_verbose

-

The DbEnv::get_verbose method returns whether the specified which +

Description: DbEnv::get_verbose

+

The DbEnv::get_verbose method returns whether the specified which parameter is currently set or not.

-

The DbEnv::get_verbose method may be called at any time during the life of the +

The DbEnv::get_verbose method may be called at any time during the life of the application.

-

The DbEnv::get_verbose method +

The DbEnv::get_verbose method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. @@ -95,7 +97,8 @@ failure, and returns 0 on success.

which
The which parameter is the message value for which configuration is being checked.
onoffp
The onoffp parameter references memory into which - the configuration of the specified which parameter is copied. + the configuration of the specified which parameter is copied. If the returned onoff value is zero, the parameter is off; +otherwise on.

Class

@@ -106,6 +109,6 @@ is being checked.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_stat.html b/db/docs/api_cxx/env_stat.html index a56f98d74..34583a0ad 100644 --- a/db/docs/api_cxx/env_stat.html +++ b/db/docs/api_cxx/env_stat.html @@ -1,5 +1,5 @@ - + @@ -27,7 +27,7 @@ DbEnv::stat_print(u_int32_t flags);


Description: DbEnv::stat_print

-

The DbEnv::stat_print method returns the +

The DbEnv::stat_print method displays the default statistical information. The information is printed to a specified output channel (see the DbEnv::set_msgfile method for more information), or passed to an @@ -42,14 +42,11 @@ failure, and returns 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_STAT_ALL
Display all available information. -
-In addition, the following flag may be set by -bitwise inclusively OR'ing it into the flags parameter: -
+
DB_STAT_CLEAR
Reset statistics after displaying their values.
DB_STAT_SUBSYSTEM
Display information for all configured subsystems.
@@ -62,6 +59,6 @@ bitwise inclusively OR'ing it into the flags parameter:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_strerror.html b/db/docs/api_cxx/env_strerror.html index 7bd6bae1d..eb9cfea1d 100644 --- a/db/docs/api_cxx/env_strerror.html +++ b/db/docs/api_cxx/env_strerror.html @@ -1,5 +1,5 @@ - + @@ -50,6 +50,6 @@ string is wanted.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/env_version.html b/db/docs/api_cxx/env_version.html index f69707718..8e867a5d5 100644 --- a/db/docs/api_cxx/env_version.html +++ b/db/docs/api_cxx/env_version.html @@ -1,5 +1,5 @@ - + @@ -47,6 +47,6 @@ is copied to the memory to which it refers.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/exc_package.html b/db/docs/api_cxx/exc_package.html index 2ff788b56..4861a717c 100644 --- a/db/docs/api_cxx/exc_package.html +++ b/db/docs/api_cxx/exc_package.html @@ -1,5 +1,5 @@ - + @@ -18,6 +18,6 @@ DbMemoryExceptionException Class for insufficient memory DbRunRecoveryExceptionException Class for failures requiring recovery -

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/except_class.html b/db/docs/api_cxx/except_class.html index b11a931dd..756595b57 100644 --- a/db/docs/api_cxx/except_class.html +++ b/db/docs/api_cxx/except_class.html @@ -1,5 +1,5 @@ - + @@ -60,6 +60,6 @@ not appear in the database.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/frame.html b/db/docs/api_cxx/frame.html index dd70c69b3..3f1a25891 100644 --- a/db/docs/api_cxx/frame.html +++ b/db/docs/api_cxx/frame.html @@ -1,8 +1,8 @@ - + -Berkeley DB API (Version: 4.3.27) +Berkeley DB API (Version: 4.5.20) @@ -12,7 +12,7 @@ Berkeley DB API (Version: 4.3.27) +"Berkeley DB API (Version: 4.5.20)"> <meta http-equiv="refresh" content="0;url=api_index.html"> diff --git a/db/docs/api_cxx/lock_class.html b/db/docs/api_cxx/lock_class.html index 821c89965..37abbbbde 100644 --- a/db/docs/api_cxx/lock_class.html +++ b/db/docs/api_cxx/lock_class.html @@ -1,5 +1,5 @@ - + @@ -44,6 +44,6 @@ for a single lock, and has no methods of its own.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lock_detect.html b/db/docs/api_cxx/lock_detect.html index a40a7b2d2..b1b945d97 100644 --- a/db/docs/api_cxx/lock_detect.html +++ b/db/docs/api_cxx/lock_detect.html @@ -1,5 +1,5 @@ - + @@ -77,6 +77,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lock_get.html b/db/docs/api_cxx/lock_get.html index 12885c5cc..ff6c2f16f 100644 --- a/db/docs/api_cxx/lock_get.html +++ b/db/docs/api_cxx/lock_get.html @@ -1,5 +1,5 @@ - + @@ -101,6 +101,6 @@ throw a DbMemoryException.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lock_id.html b/db/docs/api_cxx/lock_id.html index 2353ed97c..67510468e 100644 --- a/db/docs/api_cxx/lock_id.html +++ b/db/docs/api_cxx/lock_id.html @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@ failure, and returns 0 on success.

Parameters

idp
The idp parameter references memory into which - the allocated locker ID is copied. + the allocated locker ID is copied.

Class

@@ -51,6 +51,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lock_id_free.html b/db/docs/api_cxx/lock_id_free.html index 149da764f..2910fc160 100644 --- a/db/docs/api_cxx/lock_id_free.html +++ b/db/docs/api_cxx/lock_id_free.html @@ -1,5 +1,5 @@ - + @@ -57,6 +57,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lock_list.html b/db/docs/api_cxx/lock_list.html index ff01d8a69..a0720601f 100644 --- a/db/docs/api_cxx/lock_list.html +++ b/db/docs/api_cxx/lock_list.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@

Berkeley DB: Locking Subsystem and Related Methods

- + @@ -21,6 +21,7 @@ + @@ -31,6 +32,6 @@
Locking Subsystem and Related MethodsDescription
DbDeadlockExceptionDeadlock exception
DbEnv::lock_putRelease a lock
DbEnv::lock_statReturn lock subsystem statistics
DbEnv::lock_vecAcquire/release locks
DbEnv::cdsgroup_beginGet a locker ID in Berkeley DB Concurrent Data Store
DbLockNotGrantedExceptionLock-not-granted exception
DbLockLock object
Locking Subsystem Configuration
DbEnv::set_lk_max_objectsSet maximum number of lock objects
DbEnv::set_timeoutSet lock and transaction timeout
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lock_put.html b/db/docs/api_cxx/lock_put.html index 37e714b49..9a6412019 100644 --- a/db/docs/api_cxx/lock_put.html +++ b/db/docs/api_cxx/lock_put.html @@ -1,5 +1,5 @@ - + @@ -56,6 +56,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lock_stat.html b/db/docs/api_cxx/lock_stat.html index 920011aa5..de730af45 100644 --- a/db/docs/api_cxx/lock_stat.html +++ b/db/docs/api_cxx/lock_stat.html @@ -1,5 +1,5 @@ - - + + @@ -57,9 +57,12 @@ individually freed.

u_int32_t st_maxnobjects;
The maximum number of lock objects at any one time.
u_int32_t st_nrequests;
The total number of locks requested.
u_int32_t st_nreleases;
The total number of locks released. -
u_int32_t st_nnowaits;
The total number of lock requests failing because -DB_LOCK_NOWAIT was set. -
u_int32_t st_nconflicts;
The total number of locks not immediately available due to conflicts. +
u_int32_t st_nupgrade;
The total number of locks upgraded. +
u_int32_t st_ndowngrade;
The total number of locks downgraded. +
u_int32_t st_lock_wait;
The number of lock requests not immediately available due to conflicts, +for which the thread of control waited. +
u_int32_t st_lock_nowait;
The number of lock requests not immediately available due to conflicts, +for which the thread of control did not wait.
u_int32_t st_ndeadlocks;
The number of deadlocks.
u_int32_t st_locktimeout;
Lock timeout value.
u_int32_t st_nlocktimeouts;
The number of lock requests that have timed out. @@ -69,9 +72,9 @@ component of st_ndeadlocks, the total number of deadlocks detected.
roff_t st_regsize;
The size of the lock region, in bytes.
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before -obtaining the region lock. +obtaining the lock region mutex.
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain -the region lock without waiting. +the lock region mutex without waiting.

The DbEnv::lock_stat method either returns a non-zero error value @@ -86,7 +89,7 @@ the following value:

DB_STAT_CLEAR
Reset statistics after returning their values.
statp
The statp parameter references memory into which -a pointer to the allocated statistics structure is copied. +a pointer to the allocated statistics structure is copied.

Errors

The DbEnv::lock_stat method @@ -130,6 +133,6 @@ of the following values:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lock_vec.html b/db/docs/api_cxx/lock_vec.html index d90a144c5..746587ff5 100644 --- a/db/docs/api_cxx/lock_vec.html +++ b/db/docs/api_cxx/lock_vec.html @@ -1,5 +1,5 @@ - + @@ -163,6 +163,6 @@ throw a DbMemoryException.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lockng_class.html b/db/docs/api_cxx/lockng_class.html index 603f5ed6f..8fc73e26f 100644 --- a/db/docs/api_cxx/lockng_class.html +++ b/db/docs/api_cxx/lockng_class.html @@ -1,5 +1,5 @@ - + @@ -70,6 +70,6 @@ called, and returns the index of the failed DB_LOCKREQ when

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/log_archive.html b/db/docs/api_cxx/log_archive.html index 5b229b551..8ce3120b3 100644 --- a/db/docs/api_cxx/log_archive.html +++ b/db/docs/api_cxx/log_archive.html @@ -1,5 +1,5 @@ - + @@ -110,6 +110,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/log_compare.html b/db/docs/api_cxx/log_compare.html index 216f1909d..5b0ef3ab5 100644 --- a/db/docs/api_cxx/log_compare.html +++ b/db/docs/api_cxx/log_compare.html @@ -1,5 +1,5 @@ - + @@ -49,6 +49,6 @@ to be compared.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/log_cursor.html b/db/docs/api_cxx/log_cursor.html index e18d90c9b..205e81a0b 100644 --- a/db/docs/api_cxx/log_cursor.html +++ b/db/docs/api_cxx/log_cursor.html @@ -1,5 +1,5 @@ - + @@ -36,7 +36,7 @@ failure, and returns 0 on success.

Parameters

cursorp
The cursorp parameter references memory into which -a pointer to the created log cursor is copied. +a pointer to the created log cursor is copied.
flags
The flags parameter is currently unused, and must be set to 0.

Errors

@@ -58,6 +58,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/log_file.html b/db/docs/api_cxx/log_file.html index 557c9f6e1..ab48e1c80 100644 --- a/db/docs/api_cxx/log_file.html +++ b/db/docs/api_cxx/log_file.html @@ -1,5 +1,5 @@ - + @@ -49,7 +49,7 @@ failure, and returns 0 on success. DbLsn object for which a filename is wanted.

namep
The namep parameter references memory into which - the name of the file containing the record named by lsn is copied. + the name of the file containing the record named by lsn is copied.
len
The len parameter is the length of the namep buffer in bytes. If namep is too short to hold the filename, DbEnv::log_file will fail. (Log filenames are normally quite short, @@ -74,6 +74,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/log_flush.html b/db/docs/api_cxx/log_flush.html index 6df36b365..9e3717f37 100644 --- a/db/docs/api_cxx/log_flush.html +++ b/db/docs/api_cxx/log_flush.html @@ -1,5 +1,5 @@ - + @@ -58,6 +58,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/log_list.html b/db/docs/api_cxx/log_list.html index 20c54ad5d..1804953c1 100644 --- a/db/docs/api_cxx/log_list.html +++ b/db/docs/api_cxx/log_list.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@

Berkeley DB: Logging Subsystem and Related Methods

- + @@ -18,6 +18,7 @@ + @@ -28,9 +29,10 @@ +
Logging Subsystem and Related MethodsDescription
DbLsnLog Sequence Numbers
DbEnv::log_archiveList log and database files
DbEnv::log_fileMap Log Sequence Numbers to log files
DbEnv::log_flushFlush log records
DbEnv::log_printfAppend informational message to the log
DbEnv::log_putWrite a log record
DbEnv::log_statReturn log subsystem statistics
Logging Subsystem Cursors
Logging Subsystem Configuration
DbEnv::set_lg_bsizeSet log buffer size
DbEnv::set_lg_dirSet the environment logging directory
DbEnv::set_lg_filemodeSet log file mode
DbEnv::set_lg_maxSet log file size
DbEnv::set_lg_regionmaxSet logging region size
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/log_printf.html b/db/docs/api_cxx/log_printf.html new file mode 100644 index 000000000..f9333cd6b --- /dev/null +++ b/db/docs/api_cxx/log_printf.html @@ -0,0 +1,73 @@ + + + + + + +Berkeley DB: DbEnv::log_printf + + + + + + + +
+

DbEnv::log_printf

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::log_printf(DB_TXN *txnid, const char *fmt, ...); +

+
+

Description: DbEnv::log_printf

+

The DbEnv::log_printf method appends an informational message to the Berkeley DB +database environment log files.

+

The DbEnv::log_printf method allows applications to include information in +the database environment log files, for later review using the +db_printlog utility. This method is intended for debugging and +performance tuning.

+

The DbEnv::log_printf method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
txnid
If the logged message refers to an application-specified transaction, +the txnid parameter is a transaction handle returned from +DbEnv::txn_begin; otherwise NULL. +
fmt
A format string that specifies how subsequent arguments (or arguments +accessed via the variable-length argument facilities of stdarg(3)) are +converted for output. The format string may contain any formatting +directives supported by the underlying C library vsnprintf(3) +function. +
+

Errors

+

The DbEnv::log_printf method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv, DbLogc, DbLsn +

See Also

+Logging Subsystem and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/log_put.html b/db/docs/api_cxx/log_put.html index bf26c120d..737e2e6fb 100644 --- a/db/docs/api_cxx/log_put.html +++ b/db/docs/api_cxx/log_put.html @@ -1,5 +1,5 @@ - + @@ -53,7 +53,7 @@ that all records with DbLsn values less one being "put" are on disk before DbEnv::log_put returns.

lsn
The lsn parameter references memory into which - the DbLsn of the put record is copied. + the DbLsn of the put record is copied.

Errors

The DbEnv::log_flush method @@ -74,6 +74,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/log_stat.html b/db/docs/api_cxx/log_stat.html index 027dd2622..32d0cdab6 100644 --- a/db/docs/api_cxx/log_stat.html +++ b/db/docs/api_cxx/log_stat.html @@ -1,5 +1,5 @@ - - + + @@ -47,7 +47,8 @@ individually freed.

u_int32_t st_version;
The version of the log file type.
int st_mode;
The mode of any created log files.
u_int32_t st_lg_bsize;
The in-memory log record cache size. -
u_int32_t st_lg_size;
The current log file size. +
u_int32_t st_lg_size;
The log file size. +
u_int32_t st_record;
The number of records written to this log.
u_int32_t st_w_mbytes;
The number of megabytes written to this log.
u_int32_t st_w_bytes;
The number of bytes over and above st_w_mbytes written to this log.
u_int32_t st_wc_mbytes;
The number of megabytes written to this log since the last checkpoint. @@ -56,6 +57,7 @@ since the last checkpoint.
u_int32_t st_wcount;
The number of times the log has been written to disk.
u_int32_t st_wcount_fill;
The number of times the log has been written to disk because the in-memory log record cache filled up. +
u_int32_t st_rcount;
The number of times the log has been read from disk.
u_int32_t st_scount;
The number of times the log has been flushed to disk.
u_int32_t st_cur_file;
The current log file number.
u_int32_t st_cur_offset;
The byte offset in the current log file. @@ -64,11 +66,11 @@ in-memory log record cache filled up.
u_int32_t st_maxcommitperflush;
The maximum number of commits contained in a single log flush.
u_int32_t st_mincommitperflush;
The minimum number of commits contained in a single log flush that contained a commit. -
roff_t st_regsize;
The size of the region, in bytes. +
roff_t st_regsize;
The size of the log region, in bytes.
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before -obtaining the region lock. +obtaining the log region mutex.
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain -the region lock without waiting. +the log region mutex without waiting.

The DbEnv::log_stat method either returns a non-zero error value @@ -83,7 +85,7 @@ the following value:

DB_STAT_CLEAR
Reset statistics after returning their values.
statp
The statp parameter references memory into which -a pointer to the allocated statistics structure is copied. +a pointer to the allocated statistics structure is copied.

Errors

The DbEnv::log_stat method @@ -97,7 +99,7 @@ invalid flag value or parameter was specified.


Description: DbEnv::log_stat_print

-

The DbEnv::log_stat_print method returns the +

The DbEnv::log_stat_print method displays the logging subsystem statistical information, as described for the DbEnv::log_stat method. The information is printed to a specified output channel (see the DbEnv::set_msgfile method for more information), or passed to an @@ -112,10 +114,11 @@ failure, and returns 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values.

@@ -127,6 +130,6 @@ the following value:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/logc_class.html b/db/docs/api_cxx/logc_class.html index bc6e7725f..e118ce2df 100644 --- a/db/docs/api_cxx/logc_class.html +++ b/db/docs/api_cxx/logc_class.html @@ -1,5 +1,5 @@ - + @@ -40,6 +40,6 @@ return.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/logc_close.html b/db/docs/api_cxx/logc_close.html index 478bb47d9..51e871000 100644 --- a/db/docs/api_cxx/logc_close.html +++ b/db/docs/api_cxx/logc_close.html @@ -1,5 +1,5 @@ - + @@ -58,6 +58,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/logc_get.html b/db/docs/api_cxx/logc_get.html index cebb31795..ae4d6d836 100644 --- a/db/docs/api_cxx/logc_get.html +++ b/db/docs/api_cxx/logc_get.html @@ -1,5 +1,5 @@ - + @@ -107,6 +107,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/lsn_class.html b/db/docs/api_cxx/lsn_class.html index c0e378615..93a0a00c3 100644 --- a/db/docs/api_cxx/lsn_class.html +++ b/db/docs/api_cxx/lsn_class.html @@ -1,5 +1,5 @@ - + @@ -39,6 +39,6 @@ the other specifies an offset in the log file.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_class.html b/db/docs/api_cxx/memp_class.html index cac910732..24183716a 100644 --- a/db/docs/api_cxx/memp_class.html +++ b/db/docs/api_cxx/memp_class.html @@ -1,5 +1,5 @@ - + @@ -48,6 +48,6 @@ is still in scope and has not been deleted.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_fclose.html b/db/docs/api_cxx/memp_fclose.html index 9062b6ef9..bd79adc89 100644 --- a/db/docs/api_cxx/memp_fclose.html +++ b/db/docs/api_cxx/memp_fclose.html @@ -1,5 +1,5 @@ - + @@ -53,6 +53,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_fcreate.html b/db/docs/api_cxx/memp_fcreate.html index 9a6972648..0e0e34907 100644 --- a/db/docs/api_cxx/memp_fcreate.html +++ b/db/docs/api_cxx/memp_fcreate.html @@ -1,5 +1,5 @@ - + @@ -49,6 +49,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_fget.html b/db/docs/api_cxx/memp_fget.html index 6ee003a54..7d3e33458 100644 --- a/db/docs/api_cxx/memp_fget.html +++ b/db/docs/api_cxx/memp_fget.html @@ -1,5 +1,5 @@ - - + + @@ -23,7 +23,8 @@ #include <db_cxx.h>

int -DbMpoolFile::get(db_pgno_t *pgnoaddr, u_int32_t flags, void **pagep); +DbMpoolFile::get(db_pgno_t *pgnoaddr, + DbTxn *txnid, u_int32_t flags, void **pagep);


Description: DbMpoolFile::get

@@ -53,6 +54,15 @@ or more of the following values:
DB_MPOOL_CREATE
If the specified page does not exist, create it. In this case, the pgin method, if specified, is called. +
DB_MPOOL_DIRTY
The page will be modified and must be written to the source file before +being evicted from the pool. For files open with the +DB_MULTIVERSION flag set, a new copy of the page will be made +if this is the first time the specified transaction is modifying it. +
DB_MPOOL_EDIT
The page will be modified and must be written to the source file before +being evicted from the pool. No copy of the page will be made, regardless +of the DB_MULTIVERSION setting. This flag is only intended for +use in situations where a transaction handle is not available, such as during +aborts or recovery.
DB_MPOOL_LAST
Return the last page of the source file, and copy its page number into the memory location to which pgnoaddr refers.
DB_MPOOL_NEW
Create a new page in the file, and copy its page number into the memory @@ -63,7 +73,7 @@ location to which pgnoaddr refers. In this case, the

The DB_MPOOL_CREATE, DB_MPOOL_LAST, and DB_MPOOL_NEW flags are mutually exclusive.

pagep
The pagep parameter references memory into which -a pointer to the returned page is copied. +a pointer to the returned page is copied.
pgnoaddr
If the flags parameter is set to DB_MPOOL_LAST or DB_MPOOL_NEW, the page number of the created page is copied into the memory location to which the pgnoaddr parameter @@ -71,6 +81,13 @@ refers. Otherwise, the pgnoaddr parameter is the page to create or retrieve.

Page numbers begin at 0; that is, the first page in the file is page number 0, not page number 1.

+
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; otherwise NULL. A transaction is +required if the file is open for multiversion concurrency control by +passing DB_MULTIVERSION to DbMpoolFile::open and the +DB_MPOOL_DIRTY, DB_MPOOL_CREATE or +DB_MPOOL_NEW flags were specified. Otherwise it is ignored.

Errors

The DbMpoolFile::get method @@ -79,6 +96,10 @@ may fail and throw encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

+
EACCES
The DB_MPOOL_DIRTY or DB_MPOOL_EDIT flag was set and +the source file was not opened for writing. +
+
EAGAIN
The page reference count has overflowed. (This should never happen unless there is a bug in the application.)
@@ -86,9 +107,13 @@ unless there is a bug in the application.)
EINVAL
If the DB_MPOOL_NEW flag was set, and the source file was not opened for writing; more than one of DB_MPOOL_CREATE, DB_MPOOL_LAST, and -DB_MPOOL_NEW was set; or if an +DB_MPOOL_NEW was set.; or if an invalid flag value or parameter was specified. +
+
DB_LOCK_DEADLOCK
For transactions configured with DB_TXN_SNAPSHOT, the page has +been modified since the transaction began. +

If the cache is full, and no more pages will fit in the pool, the DbMpoolFile::get method will fail and either return ENOMEM or throw a DbMemoryException.

@@ -101,6 +126,6 @@ throw a DbMemoryException.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_fopen.html b/db/docs/api_cxx/memp_fopen.html index 07cc22511..b10470969 100644 --- a/db/docs/api_cxx/memp_fopen.html +++ b/db/docs/api_cxx/memp_fopen.html @@ -1,5 +1,5 @@ - - + + @@ -39,8 +39,9 @@ failure, and returns 0 on success. file is NULL, a private temporary file is created that cannot be shared with any other process (although it may be shared with other threads of control in the same process). -

On Windows, the file argument will be interpreted as a UTF-8 -string, which is equivalent to ASCII for Latin characters.

+

When using a Unicode build on Windows (the default), the file +argument will be interpreted as a UTF-8 string, which is equivalent to +ASCII for Latin characters.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
@@ -50,6 +51,8 @@ fail.
DB_DIRECT
If set and supported by the system, turn off system buffering of the file to avoid double caching. +
DB_MULTIVERSION
Open the file with support for multiversion concurrency control. Calls to DbMpoolFile::get which +dirty pages will cause copies to be made in the cache.
DB_NOMMAP
Always copy this file into the local cache instead of potentially mapping it into process memory (see the description of the DbEnv::set_mp_mmapsize method for further information). @@ -101,6 +104,6 @@ throw a DbMemoryException.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_fput.html b/db/docs/api_cxx/memp_fput.html index e4051e506..4c3f9ae9f 100644 --- a/db/docs/api_cxx/memp_fput.html +++ b/db/docs/api_cxx/memp_fput.html @@ -1,5 +1,5 @@ - - + + @@ -41,14 +41,9 @@ address previously returned by DbMpoolFile::

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_MPOOL_CLEAN
Clear any previously set modification information (that is, don't bother -writing the page back to the source file). -
DB_MPOOL_DIRTY
The page has been modified and must be written to the source file before -being evicted from the pool.
DB_MPOOL_DISCARD
The page is unlikely to be useful in the near future, and should be discarded before other pages in the pool.
-

The DB_MPOOL_CLEAN and DB_MPOOL_DIRTY flags are mutually exclusive.

Errors

The DbMpoolFile::put method @@ -57,14 +52,8 @@ may fail and throw encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

-
EACCES
The DB_MPOOL_DIRTY flag was set and the source file was not -opened for writing. -
-
EINVAL
If the pgaddr parameter does not refer to a page returned by -DbMpoolFile::get; -more than one of the DB_MPOOL_CLEAN and DB_MPOOL_DIRTY -flags was set; or if an +DbMpoolFile::get; or if an invalid flag value or parameter was specified.

@@ -76,6 +65,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_fset.html b/db/docs/api_cxx/memp_fset.html index 18b780d9f..4c1bc1033 100644 --- a/db/docs/api_cxx/memp_fset.html +++ b/db/docs/api_cxx/memp_fset.html @@ -1,5 +1,5 @@ - + @@ -41,14 +41,9 @@ address previously returned by DbMpoolFile::

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_MPOOL_CLEAN
Clear any previously set modification information (that is, don't bother -writing the page back to the source file). -
DB_MPOOL_DIRTY
The page has been modified and must be written to the source file before -being evicted from the pool.
DB_MPOOL_DISCARD
The page is unlikely to be useful in the near future, and should be discarded before other pages in the pool.
-

The DB_MPOOL_CLEAN and DB_MPOOL_DIRTY flags are mutually exclusive.

Errors

The DbMpoolFile::set method @@ -69,6 +64,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_fsync.html b/db/docs/api_cxx/memp_fsync.html index 4685e2fea..c33dc840c 100644 --- a/db/docs/api_cxx/memp_fsync.html +++ b/db/docs/api_cxx/memp_fsync.html @@ -1,5 +1,5 @@ - + @@ -46,6 +46,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_list.html b/db/docs/api_cxx/memp_list.html index 211eec229..d300fad59 100644 --- a/db/docs/api_cxx/memp_list.html +++ b/db/docs/api_cxx/memp_list.html @@ -1,5 +1,5 @@ - + @@ -10,19 +10,19 @@

Berkeley DB: Memory Pools and Related Methods

- + - + - - + + @@ -43,6 +43,6 @@
Memory Pools and Related MethodsDescription
Db::get_mpfReturn the database's memory pool handle
Db::get_mpfReturn Db's underlying DbMpoolFile handle
DbEnv::memp_statReturn memory pool statistics
DbEnv::memp_syncFlush pages from a memory pool
DbEnv::memp_trickleTrickle flush pages from a memory pool
DbMemoryExceptionInsufficient memory exception
Memory Pool Configuration
DbEnv::memp_registerRegister input/output functions for a file in a memory pool
DbEnv::set_max_openfdSet the maximum number of open file descriptors
DbEnv::set_max_writeSet the maximum number of sequential disk writes
DbEnv::set_cachesizeSet the environment cache size
DbEnv::set_mp_max_openfdSet the maximum number of open file descriptors
DbEnv::set_mp_max_writeSet the maximum number of sequential disk writes
DbEnv::set_mp_mmapsizeSet maximum mapped-in database file size
Memory Pool Files
DbEnv::memp_fcreateCreate a memory pool file handle
DbMpoolFile::set_pgcookieSet file cookie for pgin/pgout
DbMpoolFile::set_prioritySet memory pool file priority
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_maxwrite.html b/db/docs/api_cxx/memp_maxwrite.html index 60364aa6d..0c54e094a 100644 --- a/db/docs/api_cxx/memp_maxwrite.html +++ b/db/docs/api_cxx/memp_maxwrite.html @@ -1,17 +1,17 @@ - - + + -Berkeley DB: DbEnv::set_max_write +Berkeley DB: DbEnv::set_mp_max_write - - - + + + - + - - - - - - - - + + +
-

DbEnv::set_max_write

+

DbEnv::set_mp_max_write

API @@ -23,17 +23,17 @@ #include <db_cxx.h>

int -DbEnv::memp_set_max_write(int maxwrite, int maxwrite_sleep); +DbEnv::set_mp_max_write(int maxwrite, int maxwrite_sleep);

int -DbEnv::memp_get_max_write(int *maxwritep, int *maxwrite_sleepp); +DbEnv::get_mp_max_write(int *maxwritep, int *maxwrite_sleepp);


-

Description: DbEnv::set_max_write

-

The DbEnv::set_max_write method limits the number of sequential write +

Description: DbEnv::set_mp_max_write

+

The DbEnv::set_mp_max_write method limits the number of sequential write operations scheduled by the library when flushing dirty pages from the cache.

-

The DbEnv::set_max_write method +

The DbEnv::set_mp_max_write method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. @@ -41,12 +41,13 @@ failure, and returns 0 on success.

Parameters

maxwrite
The maximum number of sequential write operations scheduled by the -library when flushing dirty pages from the cache. +library when flushing dirty pages from the cache, or 0 if there is +no limitation on the number of sequential write operations.
maxwrite_sleep
The number of microseconds the thread of control should pause before scheduling further write operations.

Errors

-

The DbEnv::set_max_write method +

The DbEnv::set_mp_max_write method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of @@ -56,12 +57,12 @@ the following non-zero errors:

invalid flag value or parameter was specified.
-

Description: DbEnv::get_max_write

-

The DbEnv::get_max_write method returns the current maximum number of +

Description: DbEnv::get_mp_max_write

+

The DbEnv::get_mp_max_write method returns the current maximum number of sequential write operations and microseconds to pause.

-

The DbEnv::get_max_write method may be called at any time during the life of the +

The DbEnv::get_mp_max_write method may be called at any time during the life of the application.

-

The DbEnv::get_max_write method +

The DbEnv::get_mp_max_write method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. @@ -69,9 +70,9 @@ failure, and returns 0 on success.

Parameters

maxwritep
The maxwritep parameter references memory into which - the maximum number of sequential write operations is copied. + the maximum number of sequential write operations is copied.
maxwrite_sleepp
The maxwrite_sleepp parameter references memory into which - the microseconds to pause before scheduling further write operations is copied. + the microseconds to pause before scheduling further write operations is copied.

Class

@@ -82,6 +83,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_openfd.html b/db/docs/api_cxx/memp_openfd.html index 9d81dc760..bc45eeb99 100644 --- a/db/docs/api_cxx/memp_openfd.html +++ b/db/docs/api_cxx/memp_openfd.html @@ -1,17 +1,17 @@ - - + + -Berkeley DB: DbEnv::set_max_openfd +Berkeley DB: DbEnv::set_mp_max_openfd - + - +
-

DbEnv::set_max_openfd

+

DbEnv::set_mp_max_openfd

API @@ -23,17 +23,17 @@ #include <db_cxx.h>

int -DbEnv::memp_set_max_openfd(int maxopenfd); +DbEnv::set_mp_max_openfd(int maxopenfd);

int -DbEnv::memp_get_max_openfd(int *maxopenfdp); +DbEnv::get_mp_max_openfd(int *maxopenfdp);


-

Description: DbEnv::set_max_openfd

-

The DbEnv::set_max_openfd method limits the number of file descriptors +

Description: DbEnv::set_mp_max_openfd

+

The DbEnv::set_mp_max_openfd method limits the number of file descriptors the library will open concurrently when flushing dirty pages from the cache.

-

The DbEnv::set_max_openfd method +

The DbEnv::set_mp_max_openfd method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. @@ -44,7 +44,7 @@ failure, and returns 0 on success. by the library when flushing dirty pages from the cache.

Errors

-

The DbEnv::set_max_openfd method +

The DbEnv::set_mp_max_openfd method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of @@ -54,18 +54,18 @@ the following non-zero errors:

invalid flag value or parameter was specified.
-

Description: DbEnv::get_max_openfd

-

The DbEnv::get_max_openfd method returns the maximum number of file descriptors open.

-

The DbEnv::get_max_openfd method may be called at any time during the life of the +

Description: DbEnv::get_mp_max_openfd

+

The DbEnv::get_mp_max_openfd method returns the maximum number of file descriptors open.

+

The DbEnv::get_mp_max_openfd method may be called at any time during the life of the application.

-

The DbEnv::get_max_openfd method +

The DbEnv::get_mp_max_openfd method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters

-
maxopenfdp
The DbEnv::get_max_openfd method returns the +
maxopenfdp
The DbEnv::get_mp_max_openfd method returns the maximum number of file descriptors open in maxopenfdp.

@@ -77,6 +77,6 @@ maximum number of file descriptors open in maxopenfdp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_register.html b/db/docs/api_cxx/memp_register.html index b1385445e..1feaf0bdf 100644 --- a/db/docs/api_cxx/memp_register.html +++ b/db/docs/api_cxx/memp_register.html @@ -1,5 +1,5 @@ - + @@ -82,6 +82,6 @@ the Berkeley DB library).


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_set_clear_len.html b/db/docs/api_cxx/memp_set_clear_len.html index 828892a8e..e970073e2 100644 --- a/db/docs/api_cxx/memp_set_clear_len.html +++ b/db/docs/api_cxx/memp_set_clear_len.html @@ -1,5 +1,5 @@ - - + + @@ -33,8 +33,8 @@ DbMpoolFile::get_clear_len(u_int32_t *lenp);

The DbMpoolFile::set_clear_len method sets the number of initial bytes in a page that should be set to nul when the page is created as a result of the DB_MPOOL_CREATE or DB_MPOOL_NEW flags being -specified to DbMpoolFile::get. If no value is specified, or len -is 0, the entire page is cleared.

+specified to DbMpoolFile::get. If no clear length is specified, the +entire page is cleared when it is created.

The DbMpoolFile::set_clear_len method configures a file in the memory pool, not only operations performed using the specified DbMpoolFile handle.

The DbMpoolFile::set_clear_len method may not be called after the DbMpoolFile::open method is @@ -57,9 +57,19 @@ the entire page being set to nul bytes.


Description: DbMpoolFile::get_clear_len

-

The DbMpoolFile::get_clear_len method returns the .

+

The DbMpoolFile::get_clear_len method returns the bytes to be cleared.

The DbMpoolFile::get_clear_len method may be called at any time during the life of the application.

+

The DbMpoolFile::get_clear_len method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
lenp
The DbMpoolFile::get_clear_len method returns the +bytes to be cleared in lenp. +

Class

DbEnv, DbMpoolFile @@ -69,6 +79,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_set_fileid.html b/db/docs/api_cxx/memp_set_fileid.html index 53711e951..3bab6f092 100644 --- a/db/docs/api_cxx/memp_set_fileid.html +++ b/db/docs/api_cxx/memp_set_fileid.html @@ -1,5 +1,5 @@ - - + + @@ -73,12 +73,12 @@ Unique file identifiers must be a DB_FILE_ID_LEN length array of bytes.

Description: DbMpoolFile::get_fileid

The DbMpoolFile::get_fileid method copies the file's identifier into the memory location referenced by fileid.

-

The DbEnv::get_data_dirs method +

The DbMpoolFile::get_fileid method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

-

The DbEnv::get_data_dirs method may be called at any time during the life of the +

The DbMpoolFile::get_fileid method may be called at any time during the life of the application.


Class

@@ -89,6 +89,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_set_flags.html b/db/docs/api_cxx/memp_set_flags.html index 757bc2f88..0742e8f1a 100644 --- a/db/docs/api_cxx/memp_set_flags.html +++ b/db/docs/api_cxx/memp_set_flags.html @@ -1,5 +1,5 @@ - - + + @@ -47,9 +47,13 @@ of the following values:

DB_MPOOL_NOFILE
If set, no backing temporary file will be opened for in-memory databases, even if they expand to fill the entire cache. Attempts to create new file pages after the cache has been filled will fail. +

The DB_MPOOL_NOFILE flag configures a file in the memory pool, not only +operations performed using the specified DbMpoolFile handle.

The DB_MPOOL_NOFILE flag may be used to configure Berkeley DB at any time during the life of the application.

DB_MPOOL_UNLINK
If set, remove the file when the last reference to it is closed. +

The DB_MPOOL_NOFILE flag configures a file in the memory pool, not only +operations performed using the specified DbMpoolFile handle.

The DB_MPOOL_UNLINK flag may be used to configure Berkeley DB at any time during the life of the application.

@@ -81,6 +85,6 @@ flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_set_ftype.html b/db/docs/api_cxx/memp_set_ftype.html index fa978e582..464f67dbf 100644 --- a/db/docs/api_cxx/memp_set_ftype.html +++ b/db/docs/api_cxx/memp_set_ftype.html @@ -1,5 +1,5 @@ - - + + @@ -54,9 +54,19 @@ and output processing. The ftype must be the same as a


Description: DbMpoolFile::get_ftype

-

The DbMpoolFile::get_ftype method returns the .

+

The DbMpoolFile::get_ftype method returns the file type.

The DbMpoolFile::get_ftype method may be called at any time during the life of the application.

+

The DbMpoolFile::get_ftype method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
ftypep
The DbMpoolFile::get_ftype method returns the +file type in ftypep. +

Class

DbEnv, DbMpoolFile @@ -66,6 +76,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_set_lsn_offset.html b/db/docs/api_cxx/memp_set_lsn_offset.html index 2244072fc..09f42311c 100644 --- a/db/docs/api_cxx/memp_set_lsn_offset.html +++ b/db/docs/api_cxx/memp_set_lsn_offset.html @@ -1,5 +1,5 @@ - - + + @@ -55,9 +55,19 @@ log sequence number on the file's pages.


Description: DbMpoolFile::get_lsn_offset

-

The DbMpoolFile::get_lsn_offset method returns the .

+

The DbMpoolFile::get_lsn_offset method returns the log sequence number byte offset.

The DbMpoolFile::get_lsn_offset method may be called at any time during the life of the application.

+

The DbMpoolFile::get_lsn_offset method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
lsn_offsetp
The DbMpoolFile::get_lsn_offset method returns the +log sequence number byte offset in lsn_offsetp. +

Class

DbEnv, DbMpoolFile @@ -67,6 +77,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_set_maxsize.html b/db/docs/api_cxx/memp_set_maxsize.html index 488e0f40e..102053a6f 100644 --- a/db/docs/api_cxx/memp_set_maxsize.html +++ b/db/docs/api_cxx/memp_set_maxsize.html @@ -1,5 +1,5 @@ - - + + @@ -37,6 +37,8 @@ limit has been reached will fail.

DbMpoolFile::set_maxsize method using the DbMpoolFile handle stored in the mpf field of the Db handle. Attempts to insert new items into the database after the limit has been reached may fail.

+

The DbMpoolFile::set_maxsize method configures a file in the memory pool, not only +operations performed using the specified DbMpoolFile handle.

The DbMpoolFile::set_maxsize method may be called at any time during the life of the application.

The DbMpoolFile::set_maxsize method @@ -63,9 +65,9 @@ application.

Parameters

bytesp
The bytesp parameter references memory into which - the additional bytes of memory in the maximum file size is copied. + the additional bytes of memory in the maximum file size is copied.
gbytesp
The gbytesp parameter references memory into which - the gigabytes of memory in the maximum file size is copied. + the gigabytes of memory in the maximum file size is copied.

Class

@@ -76,6 +78,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_set_pgcookie.html b/db/docs/api_cxx/memp_set_pgcookie.html index ae9ff48fc..8d8b7ab4d 100644 --- a/db/docs/api_cxx/memp_set_pgcookie.html +++ b/db/docs/api_cxx/memp_set_pgcookie.html @@ -1,5 +1,5 @@ - - + + @@ -55,9 +55,19 @@ pages.


Description: DbMpoolFile::get_pgcookie

-

The DbMpoolFile::get_pgcookie method returns the .

+

The DbMpoolFile::get_pgcookie method returns the byte string.

The DbMpoolFile::get_pgcookie method may be called at any time during the life of the application.

+

The DbMpoolFile::get_pgcookie method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
dbt
The DbMpoolFile::get_pgcookie method returns a reference to the +byte string in dbt. +

Class

DbEnv, DbMpoolFile @@ -67,6 +77,6 @@ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_set_priority.html b/db/docs/api_cxx/memp_set_priority.html index 263223e4b..cde1c365b 100644 --- a/db/docs/api_cxx/memp_set_priority.html +++ b/db/docs/api_cxx/memp_set_priority.html @@ -1,5 +1,5 @@ - - + + @@ -39,6 +39,8 @@ does not guarantee pages will be treated in a specific way.

To set the priority for the pages belonging to a particular database, call the DbMpoolFile::set_priority method using the DbMpoolFile handle returned by calling the Db::get_mpf method.

+

The DbMpoolFile::set_priority method configures a file in the memory pool, not only +operations performed using the specified DbMpoolFile handle.

The DbMpoolFile::set_priority method may be called at any time during the life of the application.

The DbMpoolFile::set_priority method @@ -82,6 +84,6 @@ cache priority in priorityp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_stat.html b/db/docs/api_cxx/memp_stat.html index 093f7cbda..0d0651621 100644 --- a/db/docs/api_cxx/memp_stat.html +++ b/db/docs/api_cxx/memp_stat.html @@ -1,5 +1,5 @@ - - + + @@ -52,6 +52,10 @@ The following DB_MPOOL_STAT fields will be filled in:

size_t st_bytes;
Bytes of cache (total cache size is st_gbytes + st_bytes).
u_int32_t st_ncache;
Number of caches.
roff_t st_regsize;
Individual cache size, in bytes. +
size_t st_mmapsize;
Maximum memory-mapped file size. +
int st_maxopenfd;
Maximum open file descriptors. +
int st_maxwrite;
Maximum sequential buffer writes. +
int st_maxwrite_sleep;
Sleep after writing maximum sequential buffers.
u_int32_t st_map;
Requested pages mapped into the process' address space (there is no available information about whether or not this request caused disk I/O, although examining the application page fault rate may be helpful). @@ -68,27 +72,30 @@ although examining the application page fault rate may be helpful).
u_int32_t st_page_dirty;
Dirty pages currently in the cache.
u_int32_t st_hash_buckets;
Number of hash buckets in buffer hash table.
u_int32_t st_hash_searches;
Total number of buffer hash table lookups. -
u_int32_t st_hash_longest;
The longest chain ever encountered in buffer hash table lookups. +
u_int32_t st_hash_longest;
Longest chain ever encountered in buffer hash table lookups.
u_int32_t st_hash_examined;
Total number of hash elements traversed during hash table lookups. -
u_int32_t st_hash_nowait;
The number of times that a thread of control was able to obtain a hash +
u_int32_t st_hash_nowait;
Number of times that a thread of control was able to obtain a hash bucket lock without waiting. -
u_int32_t st_hash_wait;
The number of times that a thread of control was forced to wait before +
u_int32_t st_hash_wait;
Number of times that a thread of control was forced to wait before obtaining a hash bucket lock. -
u_int32_t st_hash_max_wait;
The maximum number of times any hash bucket lock was waited for by a +
u_int32_t st_hash_max_nowait;
The number of times a thread of control was able to obtain the hash +bucket lock without waiting on the bucket which had the maximum number +of times that a thread of control needed to wait. +
u_int32_t st_hash_max_wait;
Maximum number of times any hash bucket lock was waited for by a thread of control. -
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before -obtaining a region lock. -
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain a region -lock without waiting. +
u_int32_t st_region_wait;
Number of times that a thread of control was forced to wait before +obtaining a cache region mutex. +
u_int32_t st_region_nowait;
Number of times that a thread of control was able to obtain a cache +region mutex without waiting. +
u_int32_t st_mvcc_frozen;
Number of buffers frozen. +
u_int32_t st_mvcc_thawed;
Number of buffers thawed. +
u_int32_t st_mvcc_freed;
Number of frozen buffers freed.
u_int32_t st_alloc;
Number of page allocations.
u_int32_t st_alloc_buckets;
Number of hash buckets checked during allocation.
u_int32_t st_alloc_max_buckets;
Maximum number of hash buckets checked during an allocation.
u_int32_t st_alloc_pages;
Number of pages checked during allocation.
u_int32_t st_alloc_max_pages;
Maximum number of pages checked during an allocation. -
u_int32_t st_mmapsize;
Maximum memory-mapped file size. -
u_int32_t st_maxopenfd;
Maximum open file descriptors. -
u_int32_t st_maxwrite;
Maximum sequential buffer writes. -
u_int32_t st_maxwrite_sleep;
Sleep after writing maximum sequential buffers. +
u_int32_t st_io_wait;
Number of operations blocked waiting for I/O to complete. The flags parameter must be set to 0 or the following value: @@ -126,9 +133,9 @@ the following value:
DB_STAT_CLEAR
Reset statistics after returning their values.
fsp
The fsp parameter references memory into which -a pointer to the allocated per-file statistics structures is copied. +a pointer to the allocated per-file statistics structures is copied.
gsp
The gsp parameter references memory into which -a pointer to the allocated global statistics structure is copied. +a pointer to the allocated global statistics structure is copied.

Errors

The DbEnv::memp_stat method @@ -169,6 +176,6 @@ of the following values:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_sync.html b/db/docs/api_cxx/memp_sync.html index d66302c6d..f2d7c8065 100644 --- a/db/docs/api_cxx/memp_sync.html +++ b/db/docs/api_cxx/memp_sync.html @@ -1,5 +1,5 @@ - - + + @@ -52,17 +52,6 @@ a certain time have been written to disk. than the lsn parameter are written to disk. If lsn is NULL, all modified pages in the pool are written to disk.

-

Errors

-

The DbEnv::memp_sync method -may fail and throw -DbException, -encapsulating one of the following non-zero errors, or return one of -the following non-zero errors:

-
-
EINVAL
If the DbEnv::memp_sync function was called without logging having been -initialized in the environment; or if an -invalid flag value or parameter was specified. -

Class

DbEnv, DbMpoolFile @@ -72,6 +61,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/memp_trickle.html b/db/docs/api_cxx/memp_trickle.html index d809b6d6e..45378320e 100644 --- a/db/docs/api_cxx/memp_trickle.html +++ b/db/docs/api_cxx/memp_trickle.html @@ -1,5 +1,5 @@ - + @@ -42,7 +42,7 @@ failure, and returns 0 on success.

nwrotep
The nwrotep parameter references memory into which the number of pages written to reach the specified -percentage is copied. +percentage is copied.
percent
The percent parameter is the percent of the pages in the cache that should be clean.
@@ -65,6 +65,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/mempfile_class.html b/db/docs/api_cxx/mempfile_class.html index 388cee9c8..70c412804 100644 --- a/db/docs/api_cxx/mempfile_class.html +++ b/db/docs/api_cxx/mempfile_class.html @@ -1,5 +1,5 @@ - + @@ -67,6 +67,6 @@ calls in a purely C++ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/mutex_alloc.html b/db/docs/api_cxx/mutex_alloc.html new file mode 100644 index 000000000..b42d72cf6 --- /dev/null +++ b/db/docs/api_cxx/mutex_alloc.html @@ -0,0 +1,78 @@ + + + + + + +Berkeley DB: DbEnv::mutex_alloc + + + + + + + +
+

DbEnv::mutex_alloc

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::mutex_alloc(u_int32_t flags, db_mutex_t *mutexp); +

+
+

Description: DbEnv::mutex_alloc

+

The DbEnv::mutex_alloc method allocates a mutex and returns a reference to +it into the memory specified by mutexp.

+

The DbEnv::mutex_alloc method may not be called before the DbEnv::open method has +been called.

+

The DbEnv::mutex_alloc method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_MUTEX_PROCESS_ONLY
The mutex is associated with a single process. The DbEnv::failchk method +will release mutexes held by any process which has exited. +
DB_MUTEX_SELF_BLOCK
The mutex must be self-blocking. That is, if a thread of control locks +the mutex and then attempts to lock the mutex again, the thread of +control will block until another thread of control releases the original +lock on the mutex, allowing the original thread of control to lock the +mutex the second time. Attempting to re-acquire a mutex for which the +DB_MUTEX_SELF_BLOCK flag was not specified will result in +undefined behavior. +
+
mutexp
The mutexp parameter references memory into which + the mutex reference is copied. +
+

Errors

+

The DbEnv::mutex_alloc method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/mutex_free.html b/db/docs/api_cxx/mutex_free.html new file mode 100644 index 000000000..b6c8bfd05 --- /dev/null +++ b/db/docs/api_cxx/mutex_free.html @@ -0,0 +1,64 @@ + + + + + + +Berkeley DB: DbEnv::mutex_free + + + + + + + +
+

DbEnv::mutex_free

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::mutex_free(db_mutex_t mutex); +

+
+

Description: DbEnv::mutex_free

+

The DbEnv::mutex_free method discards a mutex allocated by DbEnv::mutex_alloc.

+

The DbEnv::mutex_free method may not be called before the DbEnv::open method has +been called.

+

The DbEnv::mutex_free method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
mutex
The mutex parameter is a mutex previously allocated by +DbEnv::mutex_alloc. +
+

Errors

+

The DbEnv::mutex_free method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/mutex_list.html b/db/docs/api_cxx/mutex_list.html new file mode 100644 index 000000000..0b09b1b06 --- /dev/null +++ b/db/docs/api_cxx/mutex_list.html @@ -0,0 +1,29 @@ + + + + + + +Berkeley DB: Berkeley DB: Mutexes and Related Methods + + + + +

Berkeley DB: Mutexes and Related Methods

+ + + + + + + + + + + + + +
Mutexes and Related MethodsDescription
DbEnv::mutex_allocAllocate a mutex
DbEnv::mutex_freeFree a mutex
DbEnv::mutex_lockLock a mutex
DbEnv::mutex_statMutex statistics
DbEnv::mutex_unlockUnlock a mutex
Mutex Configuration
DbEnv::mutex_set_alignConfigure mutex alignment
DbEnv::mutex_set_incrementConfigure number of additional mutexes
DbEnv::mutex_set_maxConfigure total number of mutexes
DbEnv::mutex_set_tas_spinsConfigure test-and-set mutex spin count
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/mutex_lock.html b/db/docs/api_cxx/mutex_lock.html new file mode 100644 index 000000000..b1b70816a --- /dev/null +++ b/db/docs/api_cxx/mutex_lock.html @@ -0,0 +1,66 @@ + + + + + + +Berkeley DB: DbEnv::mutex_lock + + + + + + + +
+

DbEnv::mutex_lock

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::mutex_lock(db_mutex_t mutex); +

+
+

Description: DbEnv::mutex_lock

+

The DbEnv::mutex_lock method locks the mutex allocated by +DbEnv::mutex_alloc. The thread of control calling DbEnv::mutex_lock +will block until the lock is available.

+

The DbEnv::mutex_lock method may not be called before the DbEnv::open method has +been called.

+

The DbEnv::mutex_lock method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
mutex
The mutex parameter is a mutex previously allocated by +DbEnv::mutex_alloc. +
+

Errors

+

The DbEnv::mutex_lock method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/mutex_set_align.html b/db/docs/api_cxx/mutex_set_align.html new file mode 100644 index 000000000..a8f659d4c --- /dev/null +++ b/db/docs/api_cxx/mutex_set_align.html @@ -0,0 +1,99 @@ + + + + + + +Berkeley DB: DbEnv::mutex_set_align + + + + + + + +
+

DbEnv::mutex_set_align

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::mutex_set_align(u_int32_t align); +

+int +DbEnv::mutex_get_align(u_int32_t *alignp); +

+
+

Description: DbEnv::mutex_set_align

+

Set the mutex alignment, in bytes.

+

It is sometimes advantageous to align mutexes on specific byte +boundaries in order to minimize cache line collisions. The +DbEnv::mutex_set_align method specifies an alignment for mutexes allocated +by Berkeley DB.

+

The database environment's mutex alignment may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "mutex_set_align", one or more whitespace +characters, and the mutex alignment in bytes. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DbEnv::mutex_set_align method configures a database environment, not only operations +performed using the specified DbEnv handle.

+

The DbEnv::mutex_set_align method may not be called after the DbEnv::open method is +called. +If the database environment already exists when +DbEnv::open is called, the information specified to DbEnv::mutex_set_align +will be ignored. +

+

The DbEnv::mutex_set_align method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
align
The align parameter is the mutex alignment, in bytes. The mutex +alignment must be a power-of-two. +
+

Errors

+

The DbEnv::mutex_set_align method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DbEnv::mutex_get_align

+

The DbEnv::mutex_get_align method returns the mutex alignment, in bytes.

+

The DbEnv::mutex_get_align method may be called at any time during the life of the +application.

+

The DbEnv::mutex_get_align method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
alignp
The DbEnv::mutex_get_align method returns the +mutex alignment, in bytes in alignp. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/mutex_set_max.html b/db/docs/api_cxx/mutex_set_max.html new file mode 100644 index 000000000..c65040152 --- /dev/null +++ b/db/docs/api_cxx/mutex_set_max.html @@ -0,0 +1,167 @@ + + + + + + +Berkeley DB: DbEnv::mutex_set_max + + + + + + + +
+

DbEnv::mutex_set_max

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::mutex_set_increment(u_int32_t increment); +

+int +DbEnv::mutex_get_increment(u_int32_t *incrementp); +int +DbEnv::mutex_set_max(u_int32_t max); +

+int +DbEnv::mutex_get_max(u_int32_t *maxp); +

+
+

Description: DbEnv::mutex_set_max

+

Configure the total number of mutexes to allocate.

+

Berkeley DB allocates a default number of mutexes based on the initial +configuration of the database environment. That default calculation may +be too small if the application has an unusual need for mutexes (for +example, if the application opens an unexpectedly large number of +databases) or too large (if the application is trying to minimize its +memory footprint). The DbEnv::mutex_set_max method is used to specify an +absolute number of mutexes to allocate.

+

Calling the DbEnv::mutex_set_max method discards any value previously +set using the DbEnv::mutex_set_increment method.

+

The database environment's total number of mutexes may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "mutex_set_max", one or more whitespace +characters, and the total number of mutexes. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DbEnv::mutex_set_max method configures a database environment, not only operations +performed using the specified DbEnv handle.

+

The DbEnv::mutex_set_max method may not be called after the DbEnv::open method is +called. +If the database environment already exists when +DbEnv::open is called, the information specified to DbEnv::mutex_set_max +will be ignored. +

+

The DbEnv::mutex_set_max method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
max
The max parameter is the absolute number of mutexes to +allocate. +
+

Errors

+

The DbEnv::mutex_set_max method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DbEnv::mutex_get_max

+

The DbEnv::mutex_get_max method returns the total number of mutexes allocated.

+

The DbEnv::mutex_get_max method may be called at any time during the life of the +application.

+

The DbEnv::mutex_get_max method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
maxp
The DbEnv::mutex_get_max method returns the +total number of mutexes allocated in maxp. +
+
+

Description: DbEnv::mutex_set_increment

+

Configure the number of additional mutexes to allocate.

+

Additionally, an application may want to allocate mutexes for its own +use. The DbEnv::mutex_set_increment method is used to add a number of +mutexes to the default allocation.

+

Calling the DbEnv::mutex_set_increment method discards any value previously +set using the DbEnv::mutex_set_max method.

+

The database environment's number of additional mutexes may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "mutex_set_increment", one or more whitespace +characters, and the number of additional mutexes. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DbEnv::mutex_set_increment method configures a database environment, not only operations +performed using the specified DbEnv handle.

+

The DbEnv::mutex_set_increment method may not be called after the DbEnv::open method is +called. +If the database environment already exists when +DbEnv::open is called, the information specified to DbEnv::mutex_set_increment +will be ignored. +

+

The DbEnv::mutex_set_increment method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
increment
The increment parameter is the number of additional mutexes to +allocate. +
+

Errors

+

The DbEnv::mutex_set_increment method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DbEnv::mutex_get_increment

+

The DbEnv::mutex_get_increment method returns the number of additional mutexes to allocate.

+

The DbEnv::mutex_get_increment method may be called at any time during the life of the +application.

+

The DbEnv::mutex_get_increment method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
incrementp
The DbEnv::mutex_get_increment method returns the +number of additional mutexes to allocate in incrementp. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/mutex_set_tas_spins.html b/db/docs/api_cxx/mutex_set_tas_spins.html new file mode 100644 index 000000000..b8f688d87 --- /dev/null +++ b/db/docs/api_cxx/mutex_set_tas_spins.html @@ -0,0 +1,94 @@ + + + + + + +Berkeley DB: DbEnv::mutex_set_tas_spins + + + + + + + +
+

DbEnv::mutex_set_tas_spins

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::mutex_set_tas_spins(u_int32_t tas_spins); +

+int +DbEnv::mutex_get_tas_spins(u_int32_t *, tas_spinsp); +

+
+

Description: DbEnv::mutex_set_tas_spins

+

Specify that test-and-set mutexes should spin tas_spins times +without blocking. The value defaults to 1 on uniprocessor systems and +to 50 times the number of processors on multiprocessor systems.

+

The database environment's test-and-set spin count may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "set_tas_spins", one or more whitespace +characters, and the number of spins. +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DbEnv::mutex_set_tas_spins method configures operations performed using the specified +DbEnv handle, not all operations performed on the underlying +database environment.

+

The DbEnv::mutex_set_tas_spins method may be called at any time during the life of the +application.

+

The DbEnv::mutex_set_tas_spins method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
tas_spins
The tas_spins parameter is the number of spins test-and-set +mutexes should execute before blocking. +
+

Errors

+

The DbEnv::mutex_set_tas_spins method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DbEnv::mutex_get_tas_spins

+

The DbEnv::mutex_get_tas_spins method returns the test-and-set spin count.

+

The DbEnv::mutex_get_tas_spins method may be called at any time during the life of the +application.

+

The DbEnv::mutex_get_tas_spins method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
tas_spinsp
The DbEnv::mutex_get_tas_spins method returns the +test-and-set spin count in tas_spinsp. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/mutex_stat.html b/db/docs/api_cxx/mutex_stat.html new file mode 100644 index 000000000..ca82a24f0 --- /dev/null +++ b/db/docs/api_cxx/mutex_stat.html @@ -0,0 +1,118 @@ + + + + + + +Berkeley DB: DbEnv::mutex_stat + + + + + + + +
+

DbEnv::mutex_stat

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::mutex_stat(DB_MUTEX_STAT **statp, u_int32_t flags); +

+int +DbEnv::mutex_stat_print(u_int32_t flags); +

+
+

Description: DbEnv::mutex_stat

+

The DbEnv::mutex_stat method returns the mutex subsystem statistics.

+

The DbEnv::mutex_stat method creates a statistical structure of type +DB_MUTEX_STAT and copies a pointer to it into a user-specified memory +location.

+

Statistical structures are stored in allocated memory. If application-specific allocation +routines have been declared (see DbEnv::set_alloc for more +information), they are used to allocate the memory; otherwise, the +standard C library malloc(3) is used. The caller is +responsible for deallocating the memory. To deallocate the memory, free +the memory reference; references inside the returned memory need not be +individually freed.

+

The following DB_MUTEX_STAT fields will be filled in:

+
+
u_int32_t st_mutex_align;
The mutex alignment, in bytes. +
u_int32_t st_mutex_tas_spins;
The number of times test-and-set mutexes will spin without blocking. +
int st_mutex_cnt;
The total number of mutexes configured. +
u_int32_t st_mutex_free;
The number of mutexes currently available. +
u_int32_t st_mutex_inuse;
The number of mutexes currently in use. +
u_int32_t st_mutex_inuse_max;
The maximum number of mutexes ever in use. +
roff_t st_regsize;
The size of the mutex region, in bytes. +
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before +obtaining the mutex region mutex. +
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain +the mutex region mutex without waiting. +
+

The DbEnv::mutex_stat method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
flags
The flags parameter must be set to 0 or +the following value: +
+
DB_STAT_CLEAR
Reset statistics after returning their values. +
+
statp
The statp parameter references memory into which +a pointer to the allocated statistics structure is copied. +
+

Errors

+

The DbEnv::mutex_stat method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DbEnv::mutex_stat_print

+

The DbEnv::mutex_stat_print method displays the +mutex subsystem statistical information, as described for the DbEnv::mutex_stat method. +The information is printed to a specified output channel (see the +DbEnv::set_msgfile method for more information), or passed to an +application callback function (see the DbEnv::set_msgcall method for +more information).

+

The DbEnv::mutex_stat_print method may not be called before the DbEnv::open method has +been called.

+

The DbEnv::mutex_stat_print method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values: +
+
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values. +
+
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/mutex_unlock.html b/db/docs/api_cxx/mutex_unlock.html new file mode 100644 index 000000000..8c2244199 --- /dev/null +++ b/db/docs/api_cxx/mutex_unlock.html @@ -0,0 +1,65 @@ + + + + + + +Berkeley DB: DbEnv::mutex_unlock + + + + + + + +
+

DbEnv::mutex_unlock

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::mutex_unlock(db_mutex_t mutex); +

+
+

Description: DbEnv::mutex_unlock

+

The DbEnv::mutex_unlock method unlocks the mutex locked by +DbEnv::mutex_lock.

+

The DbEnv::mutex_unlock method may not be called before the DbEnv::open method has +been called.

+

The DbEnv::mutex_unlock method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
mutex
The mutex parameter is a mutex previously locked by +DbEnv::mutex_lock. +
+

Errors

+

The DbEnv::mutex_unlock method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbEnv +

See Also

+Database Environments and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/object.html b/db/docs/api_cxx/object.html index 998189610..e1b081b0d 100644 --- a/db/docs/api_cxx/object.html +++ b/db/docs/api_cxx/object.html @@ -1,4 +1,4 @@ - + Berkeley DB API @@ -24,6 +24,7 @@ href="../api_cxx/cxx_pindex.html" Locking
Logging
Memory Pool
+Mutexes
Replication
Sequences
Transactions
diff --git a/db/docs/api_cxx/pindex.src b/db/docs/api_cxx/pindex.src index ceb1c9f0a..1f012c39e 100644 --- a/db/docs/api_cxx/pindex.src +++ b/db/docs/api_cxx/pindex.src @@ -1,33 +1,35 @@ __APIREL__/api_cxx/db_associate.html__OCT__2 @DB_DBT_APPMALLOC __APIREL__/api_cxx/db_associate.html__OCT__3 @DB_DONOTINDEX __APIREL__/api_cxx/db_associate.html__OCT__DB_CREATE Db::associate@DB_CREATE -__APIREL__/api_cxx/db_associate.html__OCT__DB_AUTO_COMMIT Db::associate@DB_AUTO_COMMIT +__APIREL__/api_cxx/db_associate.html__OCT__DB_IMMUTABLE_KEY Db::associate@DB_IMMUTABLE_KEY __APIREL__/api_cxx/db_class.html__OCT__DB_CXX_NO_EXCEPTIONS Db@DB_CXX_NO_EXCEPTIONS __APIREL__/api_cxx/db_class.html__OCT__DB_XA_CREATE Db@DB_XA_CREATE __APIREL__/api_cxx/db_close.html__OCT__DB_NOSYNC Db::close@DB_NOSYNC -__APIREL__/api_cxx/db_cursor.html__OCT__DB_DEGREE_2 Db::cursor@DB_DEGREE_2 -__APIREL__/api_cxx/db_cursor.html__OCT__DB_DIRTY_READ Db::cursor@DB_DIRTY_READ +__APIREL__/api_cxx/db_compact.html__OCT__DB_FREELIST_ONLY Db::compact@DB_FREELIST_ONLY +__APIREL__/api_cxx/db_compact.html__OCT__DB_FREE_SPACE Db::compact@DB_FREE_SPACE +__APIREL__/api_cxx/db_cursor.html__OCT__DB_READ_COMMITTED Db::cursor@DB_READ_COMMITTED +__APIREL__/api_cxx/db_cursor.html__OCT__DB_READ_UNCOMMITTED Db::cursor@DB_READ_UNCOMMITTED __APIREL__/api_cxx/db_cursor.html__OCT__DB_WRITECURSOR Db::cursor@DB_WRITECURSOR -__APIREL__/api_cxx/db_del.html__OCT__DB_AUTO_COMMIT Db::del@DB_AUTO_COMMIT +__APIREL__/api_cxx/db_cursor.html__OCT__DB_TXN_SNAPSHOT Db::cursor@DB_TXN_SNAPSHOT __APIREL__/api_cxx/db_get.html__OCT__DB_CONSUME Db::get@DB_CONSUME __APIREL__/api_cxx/db_get.html__OCT__DB_CONSUME_WAIT Db::get@DB_CONSUME_WAIT __APIREL__/api_cxx/db_get.html__OCT__DB_GET_BOTH Db::get@DB_GET_BOTH __APIREL__/api_cxx/db_get.html__OCT__DB_SET_RECNO Db::get@DB_SET_RECNO -__APIREL__/api_cxx/db_get.html__OCT__DB_AUTO_COMMIT Db::get@DB_AUTO_COMMIT -__APIREL__/api_cxx/db_get.html__OCT__DB_DEGREE_2 Db::get@DB_DEGREE_2 -__APIREL__/api_cxx/db_get.html__OCT__DB_DIRTY_READ Db::get@DB_DIRTY_READ __APIREL__/api_cxx/db_get.html__OCT__DB_MULTIPLE Db::get@DB_MULTIPLE +__APIREL__/api_cxx/db_get.html__OCT__DB_READ_COMMITTED Db::get@DB_READ_COMMITTED +__APIREL__/api_cxx/db_get.html__OCT__DB_READ_UNCOMMITTED Db::get@DB_READ_UNCOMMITTED __APIREL__/api_cxx/db_get.html__OCT__DB_RMW Db::get@DB_RMW __APIREL__/api_cxx/db_join.html__OCT__DB_JOIN_ITEM Db::join@DB_JOIN_ITEM -__APIREL__/api_cxx/db_join.html__OCT__DB_DIRTY_READ Db::join@DB_DIRTY_READ +__APIREL__/api_cxx/db_join.html__OCT__DB_READ_UNCOMMITTED Db::join@DB_READ_UNCOMMITTED __APIREL__/api_cxx/db_join.html__OCT__DB_RMW Db::join@DB_RMW __APIREL__/api_cxx/db_join.html__OCT__DB_JOIN_NOSORT Db::join@DB_JOIN_NOSORT __APIREL__/api_cxx/db_open.html__OCT__DB_AUTO_COMMIT Db::open@DB_AUTO_COMMIT __APIREL__/api_cxx/db_open.html__OCT__DB_CREATE Db::open@DB_CREATE -__APIREL__/api_cxx/db_open.html__OCT__DB_DIRTY_READ Db::open@DB_DIRTY_READ __APIREL__/api_cxx/db_open.html__OCT__DB_EXCL Db::open@DB_EXCL +__APIREL__/api_cxx/db_open.html__OCT__DB_MULTIVERSION Db::open@DB_MULTIVERSION __APIREL__/api_cxx/db_open.html__OCT__DB_NOMMAP Db::open@DB_NOMMAP __APIREL__/api_cxx/db_open.html__OCT__DB_RDONLY Db::open@DB_RDONLY +__APIREL__/api_cxx/db_open.html__OCT__DB_READ_UNCOMMITTED Db::open@DB_READ_UNCOMMITTED __APIREL__/api_cxx/db_open.html__OCT__DB_THREAD Db::open@DB_THREAD __APIREL__/api_cxx/db_open.html__OCT__DB_TRUNCATE Db::open@DB_TRUNCATE __APIREL__/api_cxx/db_open.html__OCT__DB_BTREE Db::open@DB_BTREE @@ -38,7 +40,8 @@ __APIREL__/api_cxx/db_open.html__OCT__DB_UNKNOWN Db::open@DB_UNKNOWN __APIREL__/api_cxx/db_put.html__OCT__DB_APPEND Db::put@DB_APPEND __APIREL__/api_cxx/db_put.html__OCT__DB_NODUPDATA Db::put@DB_NODUPDATA __APIREL__/api_cxx/db_put.html__OCT__DB_NOOVERWRITE Db::put@DB_NOOVERWRITE -__APIREL__/api_cxx/db_put.html__OCT__DB_AUTO_COMMIT Db::put@DB_AUTO_COMMIT +__APIREL__/api_cxx/db_put.html__OCT__2 @DB_REP_HANDLE_DEAD +__APIREL__/api_cxx/db_put.html__OCT__3 @DB_REP_LOCKOUT __APIREL__/api_cxx/db_set_encrypt.html__OCT__DB_ENCRYPT_AES Db::set_encrypt@DB_ENCRYPT_AES __APIREL__/api_cxx/db_set_feedback.html__OCT__DB_UPGRADE Db::set_feedback@DB_UPGRADE __APIREL__/api_cxx/db_set_feedback.html__OCT__DB_VERIFY Db::set_feedback@DB_VERIFY @@ -65,11 +68,12 @@ __APIREL__/api_cxx/db_set_flags.html__OCT__11 @renumbering records in Recno data __APIREL__/api_cxx/db_set_flags.html__OCT__DB_RENUMBER Db::set_flags@DB_RENUMBER __APIREL__/api_cxx/db_set_flags.html__OCT__12 pre-loading @text files into Recno databases __APIREL__/api_cxx/db_set_flags.html__OCT__DB_SNAPSHOT Db::set_flags@DB_SNAPSHOT -__APIREL__/api_cxx/db_stat.html__OCT__DB_DEGREE_2 Db::stat@DB_DEGREE_2 -__APIREL__/api_cxx/db_stat.html__OCT__DB_DIRTY_READ Db::stat@DB_DIRTY_READ +__APIREL__/api_cxx/db_stat.html__OCT__DB_FAST_STAT Db::stat@DB_FAST_STAT +__APIREL__/api_cxx/db_stat.html__OCT__DB_READ_COMMITTED Db::stat@DB_READ_COMMITTED +__APIREL__/api_cxx/db_stat.html__OCT__DB_READ_UNCOMMITTED Db::stat@DB_READ_UNCOMMITTED __APIREL__/api_cxx/db_stat.html__OCT__DB_FAST_STAT Db::stat@DB_FAST_STAT __APIREL__/api_cxx/db_stat.html__OCT__DB_STAT_ALL Db::stat@DB_STAT_ALL -__APIREL__/api_cxx/db_truncate.html__OCT__DB_AUTO_COMMIT Db::truncate@DB_AUTO_COMMIT +__APIREL__/api_cxx/db_stat.html__OCT__DB_STAT_CLEAR Db::stat@DB_STAT_CLEAR __APIREL__/api_cxx/db_upgrade.html__OCT__DB_DUPSORT Db::upgrade@DB_DUPSORT __APIREL__/api_cxx/db_upgrade.html__OCT__DB_OLD_VERSION Db::upgrade@DB_OLD_VERSION __APIREL__/api_cxx/db_verify.html__OCT__2 @DB_VERIFY_BAD @@ -100,7 +104,7 @@ __APIREL__/api_cxx/dbc_get.html__OCT__DB_PREV_NODUP Dbc::get@DB_PREV_NODUP __APIREL__/api_cxx/dbc_get.html__OCT__DB_SET Dbc::get@DB_SET __APIREL__/api_cxx/dbc_get.html__OCT__DB_SET_RANGE Dbc::get@DB_SET_RANGE __APIREL__/api_cxx/dbc_get.html__OCT__DB_SET_RECNO Dbc::get@DB_SET_RECNO -__APIREL__/api_cxx/dbc_get.html__OCT__DB_DIRTY_READ Dbc::get@DB_DIRTY_READ +__APIREL__/api_cxx/dbc_get.html__OCT__DB_READ_UNCOMMITTED Dbc::get@DB_READ_UNCOMMITTED __APIREL__/api_cxx/dbc_get.html__OCT__DB_MULTIPLE Dbc::get@DB_MULTIPLE __APIREL__/api_cxx/dbc_get.html__OCT__DB_MULTIPLE_KEY Dbc::get@DB_MULTIPLE_KEY __APIREL__/api_cxx/dbc_get.html__OCT__DB_RMW Dbc::get@DB_RMW @@ -114,7 +118,12 @@ __APIREL__/api_cxx/env_class.html__OCT__DB_CXX_NO_EXCEPTIONS DbEnv@DB_CXX_NO_EXC __APIREL__/api_cxx/env_class.html__OCT__DB_RPCCLIENT DbEnv@DB_RPCCLIENT __APIREL__/api_cxx/env_dbremove.html__OCT__DB_AUTO_COMMIT DbEnv::dbremove@DB_AUTO_COMMIT __APIREL__/api_cxx/env_dbrename.html__OCT__DB_AUTO_COMMIT DbEnv::dbrename@DB_AUTO_COMMIT -__APIREL__/api_cxx/env_open.html__OCT__DB_JOINENV DbEnv::open@DB_JOINENV +__APIREL__/api_cxx/env_event_notify.html__OCT__DB_EVENT_PANIC DbEnv::set_event_notify@DB_EVENT_PANIC +__APIREL__/api_cxx/env_event_notify.html__OCT__DB_EVENT_REP_CLIENT DbEnv::set_event_notify@DB_EVENT_REP_CLIENT +__APIREL__/api_cxx/env_event_notify.html__OCT__DB_EVENT_REP_MASTER DbEnv::set_event_notify@DB_EVENT_REP_MASTER +__APIREL__/api_cxx/env_event_notify.html__OCT__DB_EVENT_REP_NEWMASTER DbEnv::set_event_notify@DB_EVENT_REP_NEWMASTER +__APIREL__/api_cxx/env_event_notify.html__OCT__DB_EVENT_REP_STARTUPDONE DbEnv::set_event_notify@DB_EVENT_REP_STARTUPDONE +__APIREL__/api_cxx/env_event_notify.html__OCT__DB_EVENT_WRITE_FAILED DbEnv::set_event_notify@DB_EVENT_WRITE_FAILED __APIREL__/api_cxx/env_open.html__OCT__DB_INIT_CDB DbEnv::open@DB_INIT_CDB __APIREL__/api_cxx/env_open.html__OCT__DB_INIT_LOCK DbEnv::open@DB_INIT_LOCK __APIREL__/api_cxx/env_open.html__OCT__DB_INIT_LOG DbEnv::open@DB_INIT_LOG @@ -129,6 +138,7 @@ __APIREL__/api_cxx/env_open.html__OCT__DB_USE_ENVIRON_ROOT DbEnv::open@DB_USE_EN __APIREL__/api_cxx/env_open.html__OCT__DB_CREATE DbEnv::open@DB_CREATE __APIREL__/api_cxx/env_open.html__OCT__DB_LOCKDOWN DbEnv::open@DB_LOCKDOWN __APIREL__/api_cxx/env_open.html__OCT__DB_PRIVATE DbEnv::open@DB_PRIVATE +__APIREL__/api_cxx/env_open.html__OCT__DB_REGISTER DbEnv::open@DB_REGISTER __APIREL__/api_cxx/env_open.html__OCT__DB_SYSTEM_MEM DbEnv::open@DB_SYSTEM_MEM __APIREL__/api_cxx/env_open.html__OCT__DB_THREAD DbEnv::open@DB_THREAD __APIREL__/api_cxx/env_open.html__OCT__3 @DB_VERSION_MISMATCH @@ -150,36 +160,42 @@ __APIREL__/api_cxx/env_set_flags.html__OCT__3 turn off system @buffering for dat __APIREL__/api_cxx/env_set_flags.html__OCT__DB_DIRECT_DB DbEnv::set_flags@DB_DIRECT_DB __APIREL__/api_cxx/env_set_flags.html__OCT__4 turn off system @buffering for log files __APIREL__/api_cxx/env_set_flags.html__OCT__DB_DIRECT_LOG DbEnv::set_flags@DB_DIRECT_LOG -__APIREL__/api_cxx/env_set_flags.html__OCT__5 turn off system @buffering for log files +__APIREL__/api_cxx/env_set_flags.html__OCT__5 turn off system @buffering for database files +__APIREL__/api_cxx/env_set_flags.html__OCT__DB_DSYNC_DB DbEnv::set_flags@DB_DSYNC_DB +__APIREL__/api_cxx/env_set_flags.html__OCT__6 turn off system @buffering for log files __APIREL__/api_cxx/env_set_flags.html__OCT__DB_DSYNC_LOG DbEnv::set_flags@DB_DSYNC_LOG -__APIREL__/api_cxx/env_set_flags.html__OCT__6 automatic @log file removal +__APIREL__/api_cxx/env_set_flags.html__OCT__7 automatic @log file removal __APIREL__/api_cxx/env_set_flags.html__OCT__DB_LOG_AUTOREMOVE DbEnv::set_flags@DB_LOG_AUTOREMOVE -__APIREL__/api_cxx/env_set_flags.html__OCT__7 in memory @logs +__APIREL__/api_cxx/env_set_flags.html__OCT__8 in memory @logs __APIREL__/api_cxx/env_set_flags.html__OCT__DB_LOG_INMEMORY DbEnv::set_flags@DB_LOG_INMEMORY __APIREL__/api_cxx/env_set_flags.html__OCT__DB_LOG_BUFFER_FULL DbEnv::set_flags@DB_LOG_BUFFER_FULL -__APIREL__/api_cxx/env_set_flags.html__OCT__8 ignore @locking +__APIREL__/api_cxx/env_set_flags.html__OCT__9 ignore @locking __APIREL__/api_cxx/env_set_flags.html__OCT__DB_NOLOCKING DbEnv::set_flags@DB_NOLOCKING -__APIREL__/api_cxx/env_set_flags.html__OCT__9 turn off database file @memory mapping +__APIREL__/api_cxx/env_set_flags.html__OCT__DB_MULTIVERSION DbEnv::set_flags@DB_MULTIVERSION +__APIREL__/api_cxx/env_set_flags.html__OCT__10 turn off database file @memory mapping __APIREL__/api_cxx/env_set_flags.html__OCT__DB_NOMMAP DbEnv::set_flags@DB_NOMMAP -__APIREL__/api_cxx/env_set_flags.html__OCT__10 ignore database environment @panic +__APIREL__/api_cxx/env_set_flags.html__OCT__11 ignore database environment @panic __APIREL__/api_cxx/env_set_flags.html__OCT__DB_NOPANIC DbEnv::set_flags@DB_NOPANIC __APIREL__/api_cxx/env_set_flags.html__OCT__DB_OVERWRITE DbEnv::set_flags@DB_OVERWRITE -__APIREL__/api_cxx/env_set_flags.html__OCT__11 turn off access to a database @environment +__APIREL__/api_cxx/env_set_flags.html__OCT__12 turn off access to a database @environment __APIREL__/api_cxx/env_set_flags.html__OCT__DB_PANIC_ENVIRONMENT DbEnv::set_flags@DB_PANIC_ENVIRONMENT -__APIREL__/api_cxx/env_set_flags.html__OCT__12 fault database @environment in during open +__APIREL__/api_cxx/env_set_flags.html__OCT__13 fault database @environment in during open __APIREL__/api_cxx/env_set_flags.html__OCT__DB_REGION_INIT DbEnv::set_flags@DB_REGION_INIT __APIREL__/api_cxx/env_set_flags.html__OCT__DB_TIME_NOTGRANTED DbEnv::set_flags@DB_TIME_NOTGRANTED -__APIREL__/api_cxx/env_set_flags.html__OCT__13 turn off synchronous @transaction commit -__APIREL__/api_cxx/env_set_flags.html__OCT__DB_TXN_NOSYNC DbEnv::set_flags@DB_TXN_NOSYNC __APIREL__/api_cxx/env_set_flags.html__OCT__14 turn off synchronous @transaction commit +__APIREL__/api_cxx/env_set_flags.html__OCT__DB_TXN_NOSYNC DbEnv::set_flags@DB_TXN_NOSYNC +__APIREL__/api_cxx/env_set_flags.html__OCT__DB_TXN_SNAPSHOT DbEnv::set_flags@DB_TXN_SNAPSHOT +__APIREL__/api_cxx/env_set_flags.html__OCT__15 turn off synchronous @transaction commit __APIREL__/api_cxx/env_set_flags.html__OCT__DB_TXN_WRITE_NOSYNC DbEnv::set_flags@DB_TXN_WRITE_NOSYNC -__APIREL__/api_cxx/env_set_flags.html__OCT__15 configure for @stress testing +__APIREL__/api_cxx/env_set_flags.html__OCT__16 configure for @stress testing __APIREL__/api_cxx/env_set_flags.html__OCT__DB_YIELDCPU DbEnv::set_flags@DB_YIELDCPU +__APIREL__/api_cxx/env_set_isalive.html__OCT__DB_MUTEX_PROCESS_ONLY DbEnv::set_isalive@DB_MUTEX_PROCESS_ONLY __APIREL__/api_cxx/env_set_rpc_server.html__OCT__DB_NOSERVER DbEnv::set_rpc_server@DB_NOSERVER __APIREL__/api_cxx/env_set_rpc_server.html__OCT__DB_NOSERVER_ID DbEnv::set_rpc_server@DB_NOSERVER_ID __APIREL__/api_cxx/env_set_rpc_server.html__OCT__DB_NOSERVER_HOME DbEnv::set_rpc_server@DB_NOSERVER_HOME __APIREL__/api_cxx/env_set_rpc_server.html__OCT__2 @DB_NOSERVER __APIREL__/api_cxx/env_set_rpc_server.html__OCT__3 @DB_NOSERVER_ID +__APIREL__/api_cxx/env_set_thread_id_string.html__OCT__2 @DB_NOSERVER __APIREL__/api_cxx/env_set_timeout.html__OCT__DB_SET_LOCK_TIMEOUT DbEnv::set_timeout@DB_SET_LOCK_TIMEOUT __APIREL__/api_cxx/env_set_timeout.html__OCT__DB_SET_TXN_TIMEOUT DbEnv::set_timeout@DB_SET_TXN_TIMEOUT __APIREL__/api_cxx/env_set_timeout.html__OCT__DB_SET_LOCK_TIMEOUT DbEnv::set_timeout@DB_SET_LOCK_TIMEOUT @@ -187,9 +203,11 @@ __APIREL__/api_cxx/env_set_timeout.html__OCT__DB_SET_TXN_TIMEOUT DbEnv::set_time __APIREL__/api_cxx/env_set_tmp_dir.html__OCT__2 @temporary files __APIREL__/api_cxx/env_set_verbose.html__OCT__DB_VERB_DEADLOCK DbEnv::set_verbose@DB_VERB_DEADLOCK __APIREL__/api_cxx/env_set_verbose.html__OCT__DB_VERB_RECOVERY DbEnv::set_verbose@DB_VERB_RECOVERY +__APIREL__/api_cxx/env_set_verbose.html__OCT__DB_VERB_REGISTER DbEnv::set_verbose@DB_VERB_REGISTER __APIREL__/api_cxx/env_set_verbose.html__OCT__DB_VERB_REPLICATION DbEnv::set_verbose@DB_VERB_REPLICATION __APIREL__/api_cxx/env_set_verbose.html__OCT__DB_VERB_WAITSFOR DbEnv::set_verbose@DB_VERB_WAITSFOR __APIREL__/api_cxx/env_stat.html__OCT__DB_STAT_ALL DbEnv::stat_print@DB_STAT_ALL +__APIREL__/api_cxx/env_stat.html__OCT__DB_STAT_CLEAR DbEnv::stat_print@DB_STAT_CLEAR __APIREL__/api_cxx/env_stat.html__OCT__DB_STAT_SUBSYSTEM DbEnv::stat_print@DB_STAT_SUBSYSTEM __APIREL__/api_cxx/env_set_lk_detect.html__OCT__DB_LOCK_DEFAULT DbEnv::set_lk_detect@DB_LOCK_DEFAULT __APIREL__/api_cxx/env_set_lk_detect.html__OCT__DB_LOCK_EXPIRE DbEnv::set_lk_detect@DB_LOCK_EXPIRE @@ -239,6 +257,7 @@ __APIREL__/api_cxx/log_archive.html__OCT__DB_ARCH_REMOVE DbEnv::log_archive@DB_A __APIREL__/api_cxx/log_put.html__OCT__DB_FLUSH DbEnv::log_put@DB_FLUSH __APIREL__/api_cxx/log_stat.html__OCT__DB_STAT_CLEAR DbEnv::log_stat@DB_STAT_CLEAR __APIREL__/api_cxx/log_stat.html__OCT__DB_STAT_ALL DbEnv::log_stat@DB_STAT_ALL +__APIREL__/api_cxx/log_stat.html__OCT__DB_STAT_CLEAR DbEnv::log_stat@DB_STAT_CLEAR __APIREL__/api_cxx/logc_get.html__OCT__DB_CURRENT DbLogc::get@DB_CURRENT __APIREL__/api_cxx/logc_get.html__OCT__DB_FIRST DbLogc::get@DB_FIRST __APIREL__/api_cxx/logc_get.html__OCT__DB_LAST DbLogc::get@DB_LAST @@ -247,19 +266,18 @@ __APIREL__/api_cxx/logc_get.html__OCT__DB_PREV DbLogc::get@DB_PREV __APIREL__/api_cxx/logc_get.html__OCT__DB_SET DbLogc::get@DB_SET __APIREL__/api_cxx/memp_fget.html__OCT__2 @DB_PAGE_NOTFOUND __APIREL__/api_cxx/memp_fget.html__OCT__DB_MPOOL_CREATE DbMpoolFile::get@DB_MPOOL_CREATE +__APIREL__/api_cxx/memp_fget.html__OCT__DB_MPOOL_DIRTY DbMpoolFile::get@DB_MPOOL_DIRTY +__APIREL__/api_cxx/memp_fget.html__OCT__DB_MPOOL_EDIT DbMpoolFile::get@DB_MPOOL_EDIT __APIREL__/api_cxx/memp_fget.html__OCT__DB_MPOOL_LAST DbMpoolFile::get@DB_MPOOL_LAST __APIREL__/api_cxx/memp_fget.html__OCT__DB_MPOOL_NEW DbMpoolFile::get@DB_MPOOL_NEW __APIREL__/api_cxx/memp_fopen.html__OCT__DB_CREATE DbMpoolFile::open@DB_CREATE __APIREL__/api_cxx/memp_fopen.html__OCT__2 turn off system @buffering __APIREL__/api_cxx/memp_fopen.html__OCT__DB_DIRECT DbMpoolFile::open@DB_DIRECT +__APIREL__/api_cxx/memp_fopen.html__OCT__DB_MULTIVERSION DbMpoolFile::open@DB_MULTIVERSION __APIREL__/api_cxx/memp_fopen.html__OCT__DB_NOMMAP DbMpoolFile::open@DB_NOMMAP __APIREL__/api_cxx/memp_fopen.html__OCT__DB_ODDFILESIZE DbMpoolFile::open@DB_ODDFILESIZE __APIREL__/api_cxx/memp_fopen.html__OCT__DB_RDONLY DbMpoolFile::open@DB_RDONLY -__APIREL__/api_cxx/memp_fput.html__OCT__DB_MPOOL_CLEAN DbMpoolFile::put@DB_MPOOL_CLEAN -__APIREL__/api_cxx/memp_fput.html__OCT__DB_MPOOL_DIRTY DbMpoolFile::put@DB_MPOOL_DIRTY __APIREL__/api_cxx/memp_fput.html__OCT__DB_MPOOL_DISCARD DbMpoolFile::put@DB_MPOOL_DISCARD -__APIREL__/api_cxx/memp_fset.html__OCT__DB_MPOOL_CLEAN DbMpoolFile::set@DB_MPOOL_CLEAN -__APIREL__/api_cxx/memp_fset.html__OCT__DB_MPOOL_DIRTY DbMpoolFile::set@DB_MPOOL_DIRTY __APIREL__/api_cxx/memp_fset.html__OCT__DB_MPOOL_DISCARD DbMpoolFile::set@DB_MPOOL_DISCARD __APIREL__/api_cxx/memp_set_flags.html__OCT__DB_MPOOL_NOFILE DbMpoolFile::set_flags@DB_MPOOL_NOFILE __APIREL__/api_cxx/memp_set_flags.html__OCT__DB_MPOOL_UNLINK DbMpoolFile::set_flags@DB_MPOOL_UNLINK @@ -273,38 +291,68 @@ __APIREL__/api_cxx/memp_stat.html__OCT__DB_STAT_CLEAR DbEnv::memp_stat@DB_STAT_C __APIREL__/api_cxx/memp_stat.html__OCT__DB_STAT_ALL DbEnv::memp_stat@DB_STAT_ALL __APIREL__/api_cxx/memp_stat.html__OCT__DB_STAT_MEMP_HASH DbEnv::memp_stat@DB_STAT_MEMP_HASH __APIREL__/api_cxx/memp_class.html__OCT__DB_BUFFER_SMALL DbMemoryException@DB_BUFFER_SMALL +__APIREL__/api_cxx/mutex_alloc.html__OCT__DB_MUTEX_PROCESS_ONLY DbEnv::mutex_alloc@DB_MUTEX_PROCESS_ONLY +__APIREL__/api_cxx/mutex_alloc.html__OCT__DB_MUTEX_SELF_BLOCK DbEnv::mutex_alloc@DB_MUTEX_SELF_BLOCK +__APIREL__/api_cxx/mutex_stat.html__OCT__DB_STAT_CLEAR DbEnv::mutex_stat@DB_STAT_CLEAR +__APIREL__/api_cxx/mutex_stat.html__OCT__DB_STAT_ALL DbEnv::mutex_stat@DB_STAT_ALL +__APIREL__/api_cxx/mutex_stat.html__OCT__DB_STAT_CLEAR DbEnv::mutex_stat@DB_STAT_CLEAR +__APIREL__/api_cxx/rep_config.html__OCT__DB_REP_CONF_BULK DbEnv::rep_set_config@DB_REP_CONF_BULK +__APIREL__/api_cxx/rep_config.html__OCT__DB_REP_CONF_DELAYCLIENT DbEnv::rep_set_config@DB_REP_CONF_DELAYCLIENT +__APIREL__/api_cxx/rep_config.html__OCT__DB_REP_CONF_NOAUTOINIT DbEnv::rep_set_config@DB_REP_CONF_NOAUTOINIT +__APIREL__/api_cxx/rep_config.html__OCT__DB_REP_CONF_NOWAIT DbEnv::rep_set_config@DB_REP_CONF_NOWAIT __APIREL__/api_cxx/rep_elect.html__OCT__2 @DB_REP_UNAVAIL __APIREL__/api_cxx/rep_message.html__OCT__DB_REP_DUPMASTER DbEnv::rep_process_message@DB_REP_DUPMASTER __APIREL__/api_cxx/rep_message.html__OCT__DB_REP_HOLDELECTION DbEnv::rep_process_message@DB_REP_HOLDELECTION +__APIREL__/api_cxx/rep_message.html__OCT__DB_REP_IGNORE DbEnv::rep_process_message@DB_REP_IGNORE __APIREL__/api_cxx/rep_message.html__OCT__DB_REP_ISPERM DbEnv::rep_process_message@DB_REP_ISPERM +__APIREL__/api_cxx/rep_message.html__OCT__DB_REP_JOIN_FAILURE DbEnv::rep_process_message@DB_REP_JOIN_FAILURE __APIREL__/api_cxx/rep_message.html__OCT__DB_REP_NEWMASTER DbEnv::rep_process_message@DB_REP_NEWMASTER __APIREL__/api_cxx/rep_message.html__OCT__DB_REP_NEWSITE DbEnv::rep_process_message@DB_REP_NEWSITE __APIREL__/api_cxx/rep_message.html__OCT__DB_REP_NOTPERM DbEnv::rep_process_message@DB_REP_NOTPERM -__APIREL__/api_cxx/rep_message.html__OCT__DB_REP_STARTUPDONE DbEnv::rep_process_message@DB_REP_STARTUPDONE __APIREL__/api_cxx/rep_start.html__OCT__DB_REP_CLIENT DbEnv::rep_start@DB_REP_CLIENT __APIREL__/api_cxx/rep_start.html__OCT__DB_REP_MASTER DbEnv::rep_start@DB_REP_MASTER __APIREL__/api_cxx/rep_stat.html__OCT__DB_STAT_CLEAR DbEnv::rep_stat@DB_STAT_CLEAR __APIREL__/api_cxx/rep_stat.html__OCT__DB_STAT_ALL DbEnv::rep_stat@DB_STAT_ALL +__APIREL__/api_cxx/rep_stat.html__OCT__DB_STAT_CLEAR DbEnv::rep_stat@DB_STAT_CLEAR +__APIREL__/api_cxx/rep_timeout.html__OCT__DB_REP_ACK_TIMEOUT DbEnv::rep_set_timeout@DB_REP_ACK_TIMEOUT +__APIREL__/api_cxx/rep_timeout.html__OCT__DB_REP_ELECTION_TIMEOUT DbEnv::rep_set_timeout@DB_REP_ELECTION_TIMEOUT +__APIREL__/api_cxx/rep_timeout.html__OCT__DB_REP_ELECTION_RETRY DbEnv::rep_set_timeout@DB_REP_ELECTION_RETRY +__APIREL__/api_cxx/rep_timeout.html__OCT__DB_REP_CONNECTION_RETRY DbEnv::rep_set_timeout@DB_REP_CONNECTION_RETRY __APIREL__/api_cxx/rep_transport.html__OCT__2 @DB_EID_BROADCAST -__APIREL__/api_cxx/rep_transport.html__OCT__DB_REP_NOBUFFER DbEnv::set_rep_transport@DB_REP_NOBUFFER -__APIREL__/api_cxx/rep_transport.html__OCT__DB_REP_PERMANENT DbEnv::set_rep_transport@DB_REP_PERMANENT -__APIREL__/api_cxx/seq_get.html__OCT__DB_AUTO_COMMIT DbSequence::get@DB_AUTO_COMMIT +__APIREL__/api_cxx/rep_transport.html__OCT__DB_REP_ANYWHERE DbEnv::rep_set_transport@DB_REP_ANYWHERE +__APIREL__/api_cxx/rep_transport.html__OCT__DB_REP_NOBUFFER DbEnv::rep_set_transport@DB_REP_NOBUFFER +__APIREL__/api_cxx/rep_transport.html__OCT__DB_REP_PERMANENT DbEnv::rep_set_transport@DB_REP_PERMANENT +__APIREL__/api_cxx/rep_transport.html__OCT__DB_REP_REREQUEST DbEnv::rep_set_transport@DB_REP_REREQUEST +__APIREL__/api_cxx/repmgr_ack_policy.html__OCT__DB_REPMGR_ACKS_ALL DbEnv::repmgr_set_ack_policy@DB_REPMGR_ACKS_ALL +__APIREL__/api_cxx/repmgr_ack_policy.html__OCT__DB_REPMGR_ACKS_ALL_PEERS DbEnv::repmgr_set_ack_policy@DB_REPMGR_ACKS_ALL_PEERS +__APIREL__/api_cxx/repmgr_ack_policy.html__OCT__DB_REPMGR_ACKS_NONE DbEnv::repmgr_set_ack_policy@DB_REPMGR_ACKS_NONE +__APIREL__/api_cxx/repmgr_ack_policy.html__OCT__DB_REPMGR_ACKS_ONE DbEnv::repmgr_set_ack_policy@DB_REPMGR_ACKS_ONE +__APIREL__/api_cxx/repmgr_ack_policy.html__OCT__DB_REPMGR_ACKS_ONE_PEER DbEnv::repmgr_set_ack_policy@DB_REPMGR_ACKS_ONE_PEER +__APIREL__/api_cxx/repmgr_ack_policy.html__OCT__DB_REPMGR_ACKS_QUORUM DbEnv::repmgr_set_ack_policy@DB_REPMGR_ACKS_QUORUM +__APIREL__/api_cxx/repmgr_remote_site.html__OCT__DB_REPMGR_PEER DbEnv::repmgr_add_remote_site@DB_REPMGR_PEER +__APIREL__/api_cxx/repmgr_site_list.html__OCT__DB_REPMGR_CONNECTED DbEnv::repmgr_site_list@DB_REPMGR_CONNECTED +__APIREL__/api_cxx/repmgr_site_list.html__OCT__DB_REPMGR_DISCONNECTED DbEnv::repmgr_site_list@DB_REPMGR_DISCONNECTED +__APIREL__/api_cxx/repmgr_start.html__OCT__DB_REP_MASTER DbEnv::repmgr_start@DB_REP_MASTER +__APIREL__/api_cxx/repmgr_start.html__OCT__DB_REP_CLIENT DbEnv::repmgr_start@DB_REP_CLIENT +__APIREL__/api_cxx/repmgr_start.html__OCT__DB_REP_ELECTION DbEnv::repmgr_start@DB_REP_ELECTION +__APIREL__/api_cxx/repmgr_start.html__OCT__DB_REP_FULL_ELECTION DbEnv::repmgr_start@DB_REP_FULL_ELECTION __APIREL__/api_cxx/seq_get.html__OCT__DB_TXN_NOSYNC DbSequence::get@DB_TXN_NOSYNC -__APIREL__/api_cxx/seq_open.html__OCT__DB_AUTO_COMMIT DbSequence::open@DB_AUTO_COMMIT __APIREL__/api_cxx/seq_open.html__OCT__DB_CREATE DbSequence::open@DB_CREATE __APIREL__/api_cxx/seq_open.html__OCT__DB_EXCL DbSequence::open@DB_EXCL __APIREL__/api_cxx/seq_open.html__OCT__DB_THREAD DbSequence::open@DB_THREAD +__APIREL__/api_cxx/seq_open.html__OCT__DB_THREAD DbSequence::open@DB_THREAD +__APIREL__/api_cxx/seq_remove.html__OCT__DB_TXN_NOSYNC DbSequence::remove@DB_TXN_NOSYNC __APIREL__/api_cxx/seq_set_flags.html__OCT__DB_SEQ_DEC DbSequence::set_flags@DB_SEQ_DEC __APIREL__/api_cxx/seq_set_flags.html__OCT__DB_SEQ_INC DbSequence::set_flags@DB_SEQ_INC __APIREL__/api_cxx/seq_set_flags.html__OCT__DB_SEQ_WRAP DbSequence::set_flags@DB_SEQ_WRAP __APIREL__/api_cxx/seq_stat.html__OCT__DB_STAT_CLEAR DbSequence::stat@DB_STAT_CLEAR __APIREL__/api_cxx/seq_stat.html__OCT__DB_STAT_CLEAR DbSequence::stat@DB_STAT_CLEAR -__APIREL__/api_cxx/seq_remove.html__OCT__DB_AUTO_COMMIT DbSequence::remove@DB_AUTO_COMMIT -__APIREL__/api_cxx/seq_remove.html__OCT__DB_TXN_NOSYNC DbSequence::remove@DB_TXN_NOSYNC -__APIREL__/api_cxx/txn_begin.html__OCT__DB_DEGREE_2 DbEnv::txn_begin@DB_DEGREE_2 -__APIREL__/api_cxx/txn_begin.html__OCT__DB_DIRTY_READ DbEnv::txn_begin@DB_DIRTY_READ +__APIREL__/api_cxx/txn_begin.html__OCT__DB_READ_COMMITTED DbEnv::txn_begin@DB_READ_COMMITTED +__APIREL__/api_cxx/txn_begin.html__OCT__DB_READ_UNCOMMITTED DbEnv::txn_begin@DB_READ_UNCOMMITTED __APIREL__/api_cxx/txn_begin.html__OCT__DB_TXN_NOSYNC DbEnv::txn_begin@DB_TXN_NOSYNC __APIREL__/api_cxx/txn_begin.html__OCT__DB_TXN_NOWAIT DbEnv::txn_begin@DB_TXN_NOWAIT +__APIREL__/api_cxx/txn_begin.html__OCT__DB_TXN_SNAPSHOT DbEnv::txn_begin@DB_TXN_SNAPSHOT +__APIREL__/api_cxx/txn_begin.html__OCT__DB_LOCK_DEADLOCK DbEnv::txn_begin@DB_LOCK_DEADLOCK __APIREL__/api_cxx/txn_begin.html__OCT__DB_TXN_SYNC DbEnv::txn_begin@DB_TXN_SYNC __APIREL__/api_cxx/txn_checkpoint.html__OCT__DB_FORCE DbEnv::txn_checkpoint@DB_FORCE __APIREL__/api_cxx/txn_commit.html__OCT__DB_TXN_NOSYNC DbTxn::commit@DB_TXN_NOSYNC @@ -316,3 +364,4 @@ __APIREL__/api_cxx/txn_set_timeout.html__OCT__DB_SET_LOCK_TIMEOUT DbTxn::set_tim __APIREL__/api_cxx/txn_set_timeout.html__OCT__DB_SET_TXN_TIMEOUT DbTxn::set_timeout@DB_SET_TXN_TIMEOUT __APIREL__/api_cxx/txn_stat.html__OCT__DB_STAT_CLEAR DbEnv::txn_stat@DB_STAT_CLEAR __APIREL__/api_cxx/txn_stat.html__OCT__DB_STAT_ALL DbEnv::txn_stat@DB_STAT_ALL +__APIREL__/api_cxx/txn_stat.html__OCT__DB_STAT_CLEAR DbEnv::txn_stat@DB_STAT_CLEAR diff --git a/db/docs/api_cxx/rep_config.html b/db/docs/api_cxx/rep_config.html new file mode 100644 index 000000000..ceaeb0d77 --- /dev/null +++ b/db/docs/api_cxx/rep_config.html @@ -0,0 +1,111 @@ + + + + + + +Berkeley DB: DbEnv::rep_set_config + + + + + + + +
+

DbEnv::rep_set_config

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::rep_set_config(u_int32_t which, int onoff); +

+int +DbEnv::rep_get_config(u_int32_t which, int *onoffp); +

+
+

Description: DbEnv::rep_set_config

+

The DbEnv::rep_set_config method method configures the Berkeley DB replication +subsystem.

+

The database environment's replication subsystem may also be configured using the +environment's DB_CONFIG file. The syntax of the entry in that +file is a single line with the string "rep_set_config", one or more whitespace +characters, and the method which parameter as a string; for example, +"rep_set_config REP_CONF_NOWAIT". +Because the DB_CONFIG file is read when the database +environment is opened, it will silently overrule configuration done +before that time.

+

The DbEnv::rep_set_config method configures a database environment, not only operations +performed using the specified DbEnv handle.

+

The DbEnv::rep_set_config method may be called at any time during the life of the +application.

+

The DbEnv::rep_set_config method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
onoff
If the onoff parameter is zero, the configuration flag is turned +off. Otherwise, it is turned on. +
which
The which parameter must be set to one of the following values: +
+
DB_REP_CONF_BULK
The replication master sends groups of records to the clients in a +single network transfer (defaults to off). +
DB_REP_CONF_DELAYCLIENT
The client should delay synchronizing to a newly declared master +(defaults to off). Clients configured in this way will remain +unsynchronized until the application calls the DbEnv::rep_sync method. +
DB_REP_CONF_NOAUTOINIT
The replication master will not automatically re-initialize outdated +clients (defaults to off). +

The DB_REP_CONF_NOAUTOINIT flag is not supported by Replication +Manager.

+
DB_REP_CONF_NOWAIT
Berkeley DB method calls that would normally block while clients are in +recovery will return errors immediately (defaults to off). +
+
+

Errors

+

The DbEnv::rep_set_config method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DbEnv::rep_get_config

+

The DbEnv::rep_get_config method returns whether the specified which +parameter is currently set or not.

+

The DbEnv::rep_get_config method may be called at any time during the life of the +application.

+

The DbEnv::rep_get_config method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
which
The which parameter is the message value for which configuration +is being checked. +
onoffp
The onoffp parameter references memory into which + the configuration of the specified which parameter is copied. If the returned onoff value is zero, the parameter is off; +otherwise on. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/rep_elect.html b/db/docs/api_cxx/rep_elect.html index 39748891c..673c62bce 100644 --- a/db/docs/api_cxx/rep_elect.html +++ b/db/docs/api_cxx/rep_elect.html @@ -1,5 +1,5 @@ - - + + @@ -23,50 +23,80 @@ #include <db_cxx.h>

int -DbEnv::rep_elect(int nsites, int nvotes, - int priority, u_int32_t timeout, int *envid, u_int32_t flags); +DbEnv::rep_elect(int nsites, int nvotes, int *envid, u_int32_t flags);


Description: DbEnv::rep_elect

The DbEnv::rep_elect method holds an election for the master of a replication group.

+

The DbEnv::rep_elect method is not called by most replication +applications. It should only be called by applications implementing +their own network transport layer, explicitly holding replication group +elections and handling replication messages outside of the replication +manager framework.

If the election is successful, the new master's ID may be the ID of the -previous master, or the ID of the current environment. The application -is responsible for adjusting its usage of the other environments in the -replication group, including directing all database updates to the newly -selected master, in accordance with the results of this election.

+previous master, or the ID of the current replication site. The +application is responsible for adjusting its relationship to the other +database environments in the replication group, including directing all +database updates to the newly selected master, in accordance with the +results of this election.

The thread of control that calls the DbEnv::rep_elect method must not be the thread of control that processes incoming messages; processing the incoming messages is necessary to successfully complete an election.

Parameters

envid
The envid parameter references memory into which - the newly elected master's ID is copied. -
nsites
The nsites parameter indicates the number of environments that -the application believes are in the replication group. This number is -used by Berkeley DB to avoid having two masters active simultaneously, even -in the case of a network partition. During an election, a new master -cannot be elected unless more than half of nsites agree on the -new master. Thus, in the face of a network partition, the side of the -partition with more than half the environments will elect a new master -and continue, while the environments communicating with fewer than half -the other environments will fail to find a new master. -
nvotes
The nvotes parameter indicates the number of votes required by -the application to successfully elect a new master. It must be a -positive integer, no greater than nsites, or 0 if the election -should use a simple majority of the nsites value as the -requirement. A warning is given if half or fewer votes are required to -win an election as that can potentially lead to multiple masters in the -face of a network partition. -
priority
The priority parameter is the priority of this environment. It -must be a positive integer, or 0 if this environment is not permitted -to become a master (see Replication -environment priorities for more information). -
timeout
The timeout parameter specifies a timeout period for an election. -If the election has not completed after timeout microseconds, the -election will fail. + the newly elected master's ID is copied. +
nsites
The nsites parameter specifies the number of replication sites +expected to participate in the election. Once the current site has +election information from that many sites, it will short-circuit the +election and immediately cast its vote for a new master. The +nsites parameter must be a positive integer, no less than +nvotes, or 0 if the election should use the value previously set +using the DbEnv::rep_set_nsites method. +
nvotes
The nvotes parameter specifies the minimum number of replication +sites from which the current site must have election information, before +the current site will cast a vote for a new master. The nvotes +parameter must be a positive integer and no greater than nsites, +or 0 if the election should use the value ((nsites / 2) + 1) as +the nvotes argument.
flags
The flags parameter is currently unused, and must be set to 0.
+

Elections are done in two parts: first, replication sites collect +information from the other replication sites they know about, and +second, replication sites cast their votes for a new master. The second +phase is triggered by one of two things: either the replication site +gets election information from nsites sites, or the election +timeout expires. Once the second phase is triggered, the +replication site will cast a vote for the new master of its choice if, +and only if, the site has election information from at least +nvotes sites. If a site receives nvotes votes for it +to become the new master, then it will become the new master.

+

We recommend nvotes be set to at least:

+
(sites participating in the election / 2) + 1
+

to ensure there are never more than two masters active at the same time +even in the case of a network partition. When a network partitions, the +side of the partition with more than half the environments will elect a +new master and continue, while the environments communicating with fewer +than half of the environments will fail to find a new master, as no site +can get nvotes votes.

+

We recommend nsites be set to:

+
number of sites in the replication group - 1
+

when choosing a new master after a current master fails. This allows +the group to reach a consensus without having to wait for the timeout +to expire.

+

When choosing a master from among a group of client +sites all restarting at the same time, it makes more sense to set +nsites to the total number of sites in the group, since there is no +known missing site. Furthermore, in order to ensure the best choice +from among sites that may take longer to boot than the local site, +setting nvotes also to this same total number of sites will +guarantee that every site in the group is considered. (See the +Elections +section in the Berkeley DB Reference Guide for more information.)

+

Setting nsites to lower values can increase the speed of an +election, but can also result in election failure, and is usually not +recommended.

Errors

The DbEnv::rep_elect method @@ -76,7 +106,8 @@ encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

DB_REP_UNAVAIL
The replication group was unable to elect a master, or was unable to -complete the election in the specified timeout period. +complete the election in the election timeout period (see +DbEnv::rep_set_timeout method for more information).

Class

@@ -87,6 +118,6 @@ complete the election in the specified timeout period.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/rep_limit.html b/db/docs/api_cxx/rep_limit.html index bb52806f7..de5b162f8 100644 --- a/db/docs/api_cxx/rep_limit.html +++ b/db/docs/api_cxx/rep_limit.html @@ -1,17 +1,17 @@ - - + + -Berkeley DB: DbEnv::set_rep_limit +Berkeley DB: DbEnv::rep_set_limit - +
-

DbEnv::set_rep_limit

+

DbEnv::rep_set_limit

API @@ -23,20 +23,22 @@ #include <db_cxx.h>

int -DbEnv::set_rep_limit(u_int32_t gbytes, u_int32_t bytes); +DbEnv::rep_set_limit(u_int32_t gbytes, u_int32_t bytes);

int -DbEnv::get_rep_limit(u_int32_t *gbytesp, u_int32_t *bytesp); +DbEnv::rep_get_limit(u_int32_t *gbytesp, u_int32_t *bytesp);


-

Description: DbEnv::set_rep_limit

-

The DbEnv::set_rep_limit method imposes a byte-count limit on the amount of data -that will be transmitted from a site in a single call to DbEnv::rep_process_message method.

-

The DbEnv::set_rep_limit method configures a database environment, not only operations +

Description: DbEnv::rep_set_limit

+

The DbEnv::rep_set_limit method sets a byte-count limit on the amount of data +that will be transmitted from a site in response to a single message +processed by the DbEnv::rep_process_message method. The limit is not a hard limit, +and the record that exceeds the limit is the last record to be sent.

+

The DbEnv::rep_set_limit method configures a database environment, not only operations performed using the specified DbEnv handle.

-

The DbEnv::set_rep_limit method may not be called before the DbEnv::open method has -been called.

-

The DbEnv::set_rep_limit method +

The DbEnv::rep_set_limit method may be called at any time during the life of the +application.

+

The DbEnv::rep_set_limit method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. @@ -49,10 +51,10 @@ number of bytes that will be sent in a single call to DbEnv::rep_process_message method.


-

Description: dbenv_get_rep_limit

-

The DbEnv::get_rep_limit method may be called at any time during the life of the +

Description: rep_get_limit

+

The DbEnv::rep_get_limit method may be called at any time during the life of the application.

-

The DbEnv::get_rep_limit method +

The DbEnv::rep_get_limit method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. @@ -60,9 +62,9 @@ failure, and returns 0 on success.

Parameters

bytesp
The bytesp parameter references memory into which - the additional bytes of memory in the current transmit limit is copied. + the additional bytes of memory in the current transmit limit is copied.
gbytesp
The gbytesp parameter references memory into which - the gigabytes of memory in the in the current transmit limit is copied. + the gigabytes of memory in the in the current transmit limit is copied.

Class

@@ -73,6 +75,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/rep_list.html b/db/docs/api_cxx/rep_list.html index 251fefd29..f9cc9ebe5 100644 --- a/db/docs/api_cxx/rep_list.html +++ b/db/docs/api_cxx/rep_list.html @@ -1,5 +1,5 @@ - + @@ -10,17 +10,29 @@

Berkeley DB: Replication and Related Methods

- + - + + + + + + + + + + - - - + + + + + +
Replication and Related MethodsDescription
Replication Manager MethodsDescription
DbEnv::repmgr_add_remote_siteSpecify the replication manager's remote sites
DbEnv::repmgr_set_ack_policySpecify the replication manager's client acknowledgement policy
DbEnv::repmgr_set_local_siteSpecify the replication manager's local site
DbEnv::repmgr_site_listList the sites and their status
DbEnv::repmgr_startStart the replication manager
Base Replication API
DbEnv::rep_electHold a replication election
DbEnv::rep_process_messageProcess a replication message
DbEnv::rep_startConfigure an environment for replication
Additional Replication Methods
DbEnv::rep_statReplication statistics
DbEnv::rep_syncReplication synchronization
Replication Configuration
DbEnv::rep_startConfigure an environment for replication
DbEnv::set_rep_limitLimit data sent in response to a single message
DbEnv::set_rep_transportConfigure replication transport
DbEnv::rep_set_configConfigure the replication subsystem
DbEnv::rep_set_limitLimit data sent in response to a single message
DbEnv::rep_set_nsitesConfigure replication group site count
DbEnv::rep_set_priorityConfigure replication site priority
DbEnv::rep_set_timeoutConfigure replication timeouts
DbEnv::rep_set_transportConfigure replication transport callback
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/rep_message.html b/db/docs/api_cxx/rep_message.html index aa4d39ef5..d05a31b3a 100644 --- a/db/docs/api_cxx/rep_message.html +++ b/db/docs/api_cxx/rep_message.html @@ -1,5 +1,5 @@ - - + + @@ -29,6 +29,11 @@ DbEnv::rep_process_message(Dbt *control, Dbt *rec, int *envid, DbLsn *ret_lsnp)

Description: DbEnv::rep_process_message

The DbEnv::rep_process_message method processes an incoming replication message sent by a member of the replication group to the local database environment.

+

The DbEnv::rep_process_message method is not called by most replication +applications. It should only be called by applications implementing +their own network transport layer, explicitly holding replication group +elections and handling replication messages outside of the replication +manager framework.

For implementation reasons, all incoming replication messages must be processed using the same DbEnv handle. It is not required that a single thread of control process all messages, only that all threads @@ -49,13 +54,25 @@ will either return DB_REP_HOLDELECTION or throw an exception that encapsulates DB_REP_HOLDELECTION if an election is needed. The application should call for an election by calling DbEnv::rep_elect.

+
DB_REP_IGNORE
+

The DbEnv::rep_process_message method will return DB_REP_IGNORE if this message cannot be processed. +This is an indication that this message is irrelevant to the current +replication state (for example, an old message +from a previous generation arrives and is processed late). +

DB_REP_ISPERM

The DbEnv::rep_process_message method will return DB_REP_ISPERM if processing this message results in the processing of records that are permanent. The maximum LSN of the permanent records stored is returned.

+
DB_REP_JOIN_FAILURE
+

The DbEnv::rep_process_message method will return DB_REP_JOIN_FAILURE if a new master has been chosen but the client is unable to synchronize +with the new master (possibly because the client has been configured +with the DB_REP_CONF_NOAUTOINIT flag to turn-off automatic +internal initialization). +

DB_REP_NEWMASTER
-

The DbEnv::rep_process_message method will return DB_REP_NEWMASTER if a new master has been elected. +

The DbEnv::rep_process_message method will return DB_REP_NEWMASTER if a new master has been chosen. The envid parameter contains the environment ID of the new master. If the recipient of this error return has been made master, it is the application's responsibility to begin acting as the master @@ -71,14 +88,9 @@ channel with this new environment.

DB_REP_NOTPERM

The DbEnv::rep_process_message method will return DB_REP_NOTPERM if a message carrying a DB_REP_PERMANENT flag was processed successfully, but was not written to disk. -The LSN of this record is returned. -The application should take whatever action is deemed necessary to -retain its recoverability characteristics. -

-
DB_REP_STARTUPDONE
-

The DbEnv::rep_process_message method will return DB_REP_STARTUPDONE if the system detects that a client completed startup synchronization. -The client application knows that this client is now processing -live log records received from the master. +The LSN of this record is returned. The application should take +whatever action is deemed necessary to retain its recoverability +characteristics.

Unless otherwise specified, the DbEnv::rep_process_message method @@ -97,7 +109,7 @@ corresponds to the environment that sent the message to be processed information).

rec
The rec parameter should reference a copy of the rec parameter specified by Berkeley DB on the sending environment. -
ret_lsn
If DbEnv::rep_process_message method returns DB_REP_NOTPERM then the ret_lsnp +
ret_lsnp
If DbEnv::rep_process_message method returns DB_REP_NOTPERM then the ret_lsnp parameter will contain the log sequence number of this permanent log message that could not be written to disk. If DbEnv::rep_process_message method returns DB_REP_ISPERM then the ret_lsnp parameter will contain @@ -114,6 +126,6 @@ cases the value of ret_lsnp is undefined.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/rep_nsites.html b/db/docs/api_cxx/rep_nsites.html new file mode 100644 index 000000000..bfdc3c35e --- /dev/null +++ b/db/docs/api_cxx/rep_nsites.html @@ -0,0 +1,79 @@ + + + + + + +Berkeley DB: DbEnv::rep_set_nsites + + + + + + + +
+

DbEnv::rep_set_nsites

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::rep_set_nsites(int nsites); +

+int +DbEnv::rep_get_nsites(int *nsitesp); +

+
+

Description: DbEnv::rep_set_nsites

+

The DbEnv::rep_set_nsites method specifies the total number of sites +in a replication group.

+

The DbEnv::rep_set_nsites method is typically called by applications which +use the Berkeley DB library "replication manager" support. (However, see +also the DbEnv::rep_elect man page, the description of the nsites +parameter.)

+

The DbEnv::rep_set_nsites method configures a database environment, not only operations +performed using the specified DbEnv handle.

+

The DbEnv::rep_set_nsites method may be called at any time during the life of the +application.

+

The DbEnv::rep_set_nsites method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
nsites
A positive integer specifying the total number of sites in the replication +group. +
+
+

Description: DbEnv::rep_get_nsites

+

The DbEnv::rep_get_nsites method returns the total number of sites in the replication group.

+

The DbEnv::rep_get_nsites method may be called at any time during the life of the +application.

+

The DbEnv::rep_get_nsites method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
nsitesp
The DbEnv::rep_get_nsites method returns the +total number of sites in the replication group in nsitesp. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/rep_priority.html b/db/docs/api_cxx/rep_priority.html new file mode 100644 index 000000000..98e464bbf --- /dev/null +++ b/db/docs/api_cxx/rep_priority.html @@ -0,0 +1,77 @@ + + + + + + +Berkeley DB: DbEnv::rep_set_priority + + + + + + + +
+

DbEnv::rep_set_priority

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::rep_set_priority(int priority); +int +DbEnv::rep_get_priority(int *priorityp); +

+
+

Description: DbEnv::rep_set_priority

+

The DbEnv::rep_set_priority method specifies the database environment's +priority in replication group elections. The priority must be a +positive integer, or 0 if this environment cannot be a replication +group master.

+

The DbEnv::rep_set_priority method configures a database environment, not only operations +performed using the specified DbEnv handle.

+

The DbEnv::rep_set_priority method may be called at any time during the life of the +application.

+

The DbEnv::rep_set_priority method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
priority
The priority of this database environment in the replication group. The +priority must be a positive integer, or 0 if this environment cannot be +a replication group master. (See Replication environment priorities for more information). +
+
+

Description: DbEnv::rep_get_priority

+

The DbEnv::rep_get_priority method returns the database environment priority.

+

The DbEnv::rep_get_priority method may be called at any time during the life of the +application.

+

The DbEnv::rep_get_priority method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
priorityp
The DbEnv::rep_get_priority method returns the +database environment priority in priorityp. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/rep_start.html b/db/docs/api_cxx/rep_start.html index 1dd14500d..c9dc432f0 100644 --- a/db/docs/api_cxx/rep_start.html +++ b/db/docs/api_cxx/rep_start.html @@ -1,5 +1,5 @@ - - + + @@ -28,15 +28,20 @@ DbEnv::rep_start(Dbt *cdata, u_int32_t flags);


Description: DbEnv::rep_start

The DbEnv::rep_start method configures the database environment as a client -or master in a group of replicated database environments. Replication -master environments are the only database environments where replicated -databases may be modified. Replication client environments are -read-only as long as they are clients. Replication client environments -may be upgraded to be replication master environments in the case that -the current master fails or there is no master present.

+or master in a group of replicated database environments.

+

The DbEnv::rep_start method is not called by most replication +applications. It should only be called by applications implementing +their own network transport layer, explicitly holding replication group +elections and handling replication messages outside of the replication +manager framework.

+

Replication master environments are the only database environments where +replicated databases may be modified. Replication client environments +are read-only as long as they are clients. Replication client +environments may be upgraded to be replication master environments in +the case that the current master fails or there is no master present.

The enclosing database environment must already have been opened by calling the DbEnv::open method and must already have been configured -to send replication messages by calling the DbEnv::set_rep_transport method.

+to send replication messages by calling the DbEnv::rep_set_transport method.

The DbEnv::rep_start method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on @@ -44,11 +49,11 @@ failure, and returns 0 on success.

Parameters

-
cdata
The cdata parameter is an opaque data item that is sent over -the communication infrastructure when the client or master comes online -(see Connecting to a new site for -more information). If no such information is useful, cdata -should be NULL. +
cdata
The cdata parameter is an opaque data item that is sent over the +communication infrastructure when the client comes online (see +Connecting to a new site for more +information). If no such information is useful, cdata should +be NULL.
flags
The flags parameter must be set to one of the following values:
DB_REP_CLIENT
Configure the environment as a replication client. @@ -63,7 +68,7 @@ encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

EINVAL
If the database environment was not already configured to communicate with -a replication group by a call to DbEnv::set_rep_transport; +a replication group by a call to DbEnv::rep_set_transport; the database environment was not already opened; or if an invalid flag value or parameter was specified.
@@ -76,6 +81,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/rep_stat.html b/db/docs/api_cxx/rep_stat.html index 3fcc60930..0844a45de 100644 --- a/db/docs/api_cxx/rep_stat.html +++ b/db/docs/api_cxx/rep_stat.html @@ -1,5 +1,5 @@ - - + + @@ -43,19 +43,45 @@ the memory reference; references inside the returned memory need not be individually freed.

The following DB_REP_STAT fields will be filled in:

-
u_int32_t st_status;
The current replication mode. Set to DB_REP_MASTER if the -environment is a replication master, DB_REP_CLIENT if the -environment is a replication client, or 0 if replication is not -configured. -
DB_LSN st_next_lsn;
In replication environments configured as masters, the next LSN expected. -In replication environments configured as clients, the next LSN to be used. -
DB_LSN st_waiting_lsn;
The LSN of the first log record we have after missing log records -being waited for, or 0 if no log records are currently missing. +
u_int32_t st_bulk_fills;
The number of times the bulk buffer filled up, forcing the buffer content +to be sent. +
u_int32_t st_bulk_overflows;
The number of times a record was bigger than the entire bulk buffer, +and therefore had to be sent as a singleton. +
u_int32_t st_bulk_records;
The number of records added to a bulk buffer. +
u_int32_t st_bulk_transfers;
The number of bulk buffers transferred (via a call to the +application's send function). +
u_int32_t st_client_rerequests;
The number of times this client site received a "re-request" message, +indicating that a request it previously sent to another client could +not be serviced by that client. (Compare to +st_client_svc_miss.) +
u_int32_t st_client_svc_miss;
The number of "request" type messages received by this client that +could not be processed, forcing the originating requester to try sending +the request to the master (or another client). +
u_int32_t st_client_svc_req;
The number of "request" type messages received by this client. +("Request" messages are usually sent from a client to the master, but a +message marked with the DB_REP_ANYWHERE flag in the invocation +of the application's send function may be sent to another client +instead.)
u_int32_t st_dupmasters;
The number of duplicate master conditions detected. +
u_int32_t st_egen;
The current election generation number. +
u_int32_t st_election_cur_winner;
The election winner. +
u_int32_t st_election_gen;
The election generation number. +
DB_LSN st_election_lsn;
The maximum LSN of election winner. +
u_int32_t st_election_nsites;
The number sites responding to this site during the last election. +
u_int32_t st_election_nvotes;
The number of votes required in the last election. +
u_int32_t st_election_priority;
The election priority. +
u_int32_t st_election_sec;
The number of seconds the last election took (the total election time +is st_election_sec plus st_election_usec). +
u_int32_t st_election_status;
The current election phase (0 if no election is in progress). +
u_int32_t st_election_tiebreaker;
The election tiebreaker value. +
u_int32_t st_election_usec;
The number of microseconds the last election took (the total election +time is st_election_sec plus st_election_usec). +
u_int32_t st_election_votes;
The number of votes received in the last election. +
u_int32_t st_elections;
The number of elections held. +
u_int32_t st_elections_won;
The number of elections won.
u_int32_t st_env_id;
The current environment ID.
u_int32_t st_env_priority;
The current environment priority.
u_int32_t st_gen;
The current generation number. -
u_int32_t st_egen;
The current election generation number.
u_int32_t st_log_duplicated;
The number of duplicate log records received.
u_int32_t st_log_queued;
The number of log records currently queued.
u_int32_t st_log_queued_max;
The maximum number of log records ever queued at once. @@ -70,31 +96,28 @@ being waited for, or 0 if no log records are currently missing.
u_int32_t st_msgs_send_failures;
The number of failed message sends.
u_int32_t st_msgs_sent;
The number of messages sent.
u_int32_t st_newsites;
The number of new site messages received. -
int st_nsites;
The number of sites believed to be in the replication group. -
u_int32_t st_outdated;
The number of outdated conditions detected. +
DB_LSN st_next_lsn;
In replication environments configured as masters, the next LSN expected. +In replication environments configured as clients, the next LSN to be used.
u_int32_t st_next_pg;
The next page number we expect to receive. -
u_int32_t st_waiting_pg;
The page number of the first page we have after missing pages -being waited for, or 0 if no pages are currently missing. +
int st_nsites;
The number of sites used in the last election. +
u_int32_t st_nthrottles;
Transmission limited. This indicates the number of times that data +transmission was stopped to limit the amount of data sent in response +to a single call to DbEnv::rep_process_message. +
u_int32_t st_outdated;
The number of outdated conditions detected.
u_int32_t st_pg_duplicated;
The number of duplicate pages received.
u_int32_t st_pg_records;
The number of pages received and stored.
u_int32_t st_pg_requested;
The number of pages missed and requested from the master.
u_int32_t st_startup_complete;
The client site has completed its startup procedures and is now handling live records from the master. +
u_int32_t st_status;
The current replication mode. Set to DB_REP_MASTER if the +environment is a replication master, DB_REP_CLIENT if the +environment is a replication client, or 0 if replication is not +configured.
u_int32_t st_txns_applied;
The number of transactions applied. -
u_int32_t st_elections;
The number of elections held. -
u_int32_t st_elections_won;
The number of elections won. -
u_int32_t st_election_status;
The current election phase (0 if no election is in progress). -
u_int32_t st_election_cur_winner;
The election winner. -
u_int32_t st_election_gen;
The election generation number. -
DB_LSN st_election_lsn;
The maximum LSN of election winner. -
u_int32_t st_election_nsites;
The number sites expected to participate in elections. -
u_int32_t st_election_nvotes;
The number of votes required to complete the election. -
u_int32_t st_nthrottles;
Transmission limited. This indicates the number of times that data -transmission was stopped to limit the amount of data sent in response -to a single call to DbEnv::rep_process_message. -
u_int32_t st_election_priority;
The election priority. -
u_int32_t st_election_tiebreaker;
The election tiebreaker value. -
u_int32_t st_election_votes;
The votes received this election round. +
DB_LSN st_waiting_lsn;
The LSN of the first log record we have after missing log records +being waited for, or 0 if no log records are currently missing. +
u_int32_t st_waiting_pg;
The page number of the first page we have after missing pages +being waited for, or 0 if no pages are currently missing.

The DbEnv::rep_stat method either returns a non-zero error value @@ -109,7 +132,7 @@ the following value:

DB_STAT_CLEAR
Reset statistics after returning their values.
statp
The statp parameter references memory into which -a pointer to the allocated statistics structure is copied. +a pointer to the allocated statistics structure is copied.

Errors

The DbEnv::rep_stat method @@ -123,7 +146,7 @@ invalid flag value or parameter was specified.


Description: DbEnv::rep_stat_print

-

The DbEnv::rep_stat_print method returns the +

The DbEnv::rep_stat_print method displays the replication subsystem statistical information, as described for the DbEnv::rep_stat method. The information is printed to a specified output channel (see the DbEnv::set_msgfile method for more information), or passed to an @@ -138,10 +161,11 @@ failure, and returns 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values.

@@ -153,6 +177,6 @@ the following value:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/rep_sync.html b/db/docs/api_cxx/rep_sync.html new file mode 100644 index 000000000..23bc82f79 --- /dev/null +++ b/db/docs/api_cxx/rep_sync.html @@ -0,0 +1,63 @@ + + + + + + +Berkeley DB: DbEnv::rep_sync + + + + + + + +
+

DbEnv::rep_sync

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::rep_sync(u_int32_t flags); +

+
+

Description: DbEnv::rep_sync

+

The DbEnv::rep_sync method forces master synchronization to begin for this +client. This method is the other half of setting the +DB_REP_CONF_DELAYCLIENT flag via the DbEnv::rep_set_config method.

+

If an application has configured delayed master synchronization, the +application must synchronize explicitly (otherwise the client will +remain out-of-date and will ignore all database changes forwarded from +the replication group master). The DbEnv::rep_sync method may be called any +time after the client application learns that the new master has been +established, either by receiving a DB_EVENT_REP_NEWMASTER event +notification, or from a DB_REP_NEWMASTER return code from +DbEnv::rep_process_message.

+

The DbEnv::rep_sync method may not be called before the DbEnv::open method has +been called.

+

The DbEnv::rep_sync method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
flags
The flags parameter is currently unused, and must be set to 0. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/rep_timeout.html b/db/docs/api_cxx/rep_timeout.html new file mode 100644 index 000000000..ebe203f09 --- /dev/null +++ b/db/docs/api_cxx/rep_timeout.html @@ -0,0 +1,102 @@ + + + + + + +Berkeley DB: DbEnv::rep_set_timeout + + + + + + + +
+

DbEnv::rep_set_timeout

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::rep_set_timeout(int which, u_int32_t timeout); +

+int +DbEnv::rep_get_timeout(int which, u_int32_t *timeoutp); +

+
+

Description: DbEnv::rep_set_timeout

+

The DbEnv::rep_set_timeout method specifies a variety of replication timeout +values.

+

The DbEnv::rep_set_timeout method configures a database environment, not only operations +performed using the specified DbEnv handle.

+

The DbEnv::rep_set_timeout method may be called at any time during the life of the +application.

+

The DbEnv::rep_set_timeout method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
which
The which parameter must be set to one of the following values: +
+
DB_REP_ACK_TIMEOUT
Configure the amount of time the replication manager's transport +function waits to collect enough acknowledgments from replication group +clients, before giving up and returning a failure indication. The +default wait time is 1 second. +
DB_REP_ELECTION_TIMEOUT
The timeout period for an election. The default timeout is 2 seconds. +
DB_REP_ELECTION_RETRY
Configure the amount of time the replication manager will wait before +retrying a failed election. The default wait time is 10 seconds. +
DB_REP_CONNECTION_RETRY
Configure the amount of time the replication manager will wait before +trying to re-establish a connection to another site after a communication +failure. The default wait time is 30 seconds. +
+
timeout
The timeout parameter is the timeout value. It must be specified +as an unsigned 32-bit number of microseconds, limiting the maximum timeout +to roughly 71 minutes. +
+

Errors

+

The DbEnv::rep_set_timeout method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Description: DbEnv::rep_get_timeout

+

The DbEnv::rep_get_timeout method returns the timeout value for the specified +which parameter.

+

The DbEnv::rep_get_timeout method may be called at any time during the life of the +application.

+

The DbEnv::rep_get_timeout method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
which
The which parameter is the timeout value for which the value +is being returned. +
timeoutp
The timeoutp parameter references memory into which + the timeout value of the specified which parameter is copied. The returned timeout value is in microseconds. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/rep_transport.html b/db/docs/api_cxx/rep_transport.html index 2d6d28773..8b6928618 100644 --- a/db/docs/api_cxx/rep_transport.html +++ b/db/docs/api_cxx/rep_transport.html @@ -1,17 +1,17 @@ - - + + -Berkeley DB: DbEnv::set_rep_transport +Berkeley DB: DbEnv::rep_set_transport
-

DbEnv::set_rep_transport

+

DbEnv::rep_set_transport

API @@ -23,21 +23,26 @@ #include <db_cxx.h>

int -DbEnv::set_rep_transport(int envid, +DbEnv::rep_set_transport(int envid, int (*send)(DB_ENV *dbenv, const Dbt *control, const Dbt *rec, const DbLsn *lsnp, int envid, u_int32_t flags));


-

Description: DbEnv::set_rep_transport

-

The DbEnv::set_rep_transport method initializes the communication infrastructure +

Description: DbEnv::rep_set_transport

+

The DbEnv::rep_set_transport method initializes the communication infrastructure for a database environment participating in a replicated application.

-

The DbEnv::set_rep_transport method configures operations performed using the specified +

The DbEnv::rep_set_transport method is not called by most replication +applications. It should only be called by applications implementing +their own network transport layer, explicitly holding replication group +elections and handling replication messages outside of the replication +manager framework.

+

The DbEnv::rep_set_transport method configures operations performed using the specified DbEnv handle, not all operations performed on the underlying database environment.

-

The DbEnv::set_rep_transport method may be called at any time during the life of the +

The DbEnv::rep_set_transport method may be called at any time during the life of the application.

-

The DbEnv::set_rep_transport method +

The DbEnv::rep_set_transport method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. @@ -45,7 +50,7 @@ failure, and returns 0 on success.

Parameters

envid
The envid parameter is the local environment's ID. It must be -a positive integer and uniquely identify this Berkeley DB database environment +a non-negative integer and uniquely identify this Berkeley DB database environment (see Replication environment IDs for more information).
send
The send callback function is used to transmit data using the @@ -74,6 +79,8 @@ cases, the sending site should not be asked to process the message.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
+
DB_REP_ANYWHERE
The message is a client request that can be satisfied by another client +as well as by the master.
DB_REP_NOBUFFER
The record being sent should be transmitted immediately and not buffered or delayed.
DB_REP_PERMANENT
The record being sent is critical for maintaining database integrity @@ -81,20 +88,25 @@ or delayed. application should take appropriate action to enforce the reliability guarantees it has chosen, such as waiting for acknowledgement from one or more clients. +
DB_REP_REREQUEST
The message is a client request that has already been made and to which +no response was received.

It may sometimes be useful to pass application-specific data to the send function; see Environment FAQ for a discussion on how to do this.

-The send function should not call back down into Berkeley DB. The -send function must return 0 on success and non-zero on failure. -If the send function fails, the message being sent is necessary -to maintain database integrity, and the local log is not configured for -synchronous flushing, the local log will be flushed; otherwise, any -error from the send function will be ignored. +

The send function must return 0 on success and non-zero on +failure. If the send function fails, the message being sent is +necessary to maintain database integrity, and the local log is not +configured for synchronous flushing, the local log will be flushed; +otherwise, any error from the send function will be ignored.

+

Berkeley DB is not re-entrant. Callback functions should not attempt to make +library calls (for example, to release locks or close open handles). +Re-entering Berkeley DB is not guaranteed to work correctly, and the results +are undefined.

Errors

-

The DbEnv::set_rep_transport method +

The DbEnv::rep_set_transport method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of @@ -112,6 +124,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/repmgr_ack_policy.html b/db/docs/api_cxx/repmgr_ack_policy.html new file mode 100644 index 000000000..25dda52a5 --- /dev/null +++ b/db/docs/api_cxx/repmgr_ack_policy.html @@ -0,0 +1,102 @@ + + + + + + +Berkeley DB: DbEnv::repmgr_set_ack_policy + + + + + + + +
+

DbEnv::repmgr_set_ack_policy

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::repmgr_set_ack_policy(int ack_policy); +

+int +DbEnv::repmgr_get_ack_policy(int *ack_policyp); +

+
+

Description: DbEnv::repmgr_set_ack_policy

+

The DbEnv::repmgr_set_ack_policy method specifies how master and client sites +will handle acknowledgment of replication messages which are necessary +for "permanent" records. The current implementation requires all +sites in a replication group configure the same acknowledgement +policy.

+

The DbEnv::repmgr_set_ack_policy method configures a database environment, not only operations +performed using the specified DbEnv handle.

+

The DbEnv::repmgr_set_ack_policy method may be called at any time during the life of the +application.

+

The DbEnv::repmgr_set_ack_policy method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
ack_policy
The ack_policy parameter must be set to one of the following +values: +
+
DB_REPMGR_ACKS_ALL
The master should wait until all replication clients have acknowledged +each permanent replication message. +
DB_REPMGR_ACKS_ALL_PEERS
The master should wait until all electable peers have acknowledged each +permanent replication message (where "electable peer" means a client +capable of being subsequently elected master of the replication +group). +
DB_REPMGR_ACKS_NONE
The master should not wait for any client replication message +acknowledgments. +
DB_REPMGR_ACKS_ONE
The master should wait until at least one client site has acknowledged +each permanent replication message. +
DB_REPMGR_ACKS_ONE_PEER
The master should wait until at least one electable peer has +acknowledged each permanent replication message (where "electable peer" +means a client capable of being subsequently elected master of the +replication group). +
DB_REPMGR_ACKS_QUORUM
The master should wait until it has received acknowledgements from the +minimum number of electable peers sufficient to ensure that the effect +of the permanent record remains durable if an election is held (where +"electable peer" means a client capable of being subsequently elected +master of the replication group). This is the default acknowledgement +policy. +
+

Waiting for client acknowledgements is always limited by the +DB_REP_ACK_TIMEOUT specified by DbEnv::rep_set_timeout.

+
+
+

Description: DbEnv::repmgr_get_ack_policy

+

The DbEnv::repmgr_get_ack_policy method returns the replication manager's client acknowledgment policy.

+

The DbEnv::repmgr_get_ack_policy method may be called at any time during the life of the +application.

+

The DbEnv::repmgr_get_ack_policy method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
ack_policyp
The DbEnv::repmgr_get_ack_policy method returns the +replication manager's client acknowledgment policy in ack_policyp. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/repmgr_local_site.html b/db/docs/api_cxx/repmgr_local_site.html new file mode 100644 index 000000000..98059f90d --- /dev/null +++ b/db/docs/api_cxx/repmgr_local_site.html @@ -0,0 +1,56 @@ + + + + + + +Berkeley DB: DbEnv::repmgr_set_local_site + + + + + + + +
+

DbEnv::repmgr_set_local_site

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::repmgr_set_add_site(const char *host, u_int port, u_int32_t flags); +

+
+

Description: DbEnv::repmgr_set_local_site

+

The DbEnv::repmgr_set_local_site method specifies the host identification +string and port number for the local system.

+

The DbEnv::repmgr_set_local_site method must be called before the DbEnv::repmgr_start method has been +called.

+

The DbEnv::repmgr_set_local_site method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
flags
The flags parameter is currently unused, and must be set to 0. +
host
The site's host identification string, generally a TCP/IP host name. +
port
The port number on which the local site is listening. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/repmgr_remote_site.html b/db/docs/api_cxx/repmgr_remote_site.html new file mode 100644 index 000000000..7bf3e0782 --- /dev/null +++ b/db/docs/api_cxx/repmgr_remote_site.html @@ -0,0 +1,68 @@ + + + + + + +Berkeley DB: DbEnv::repmgr_add_remote_site + + + + + + + +
+

DbEnv::repmgr_add_remote_site

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::repmgr_add_remote_site(const char *host, u_int port, int *eidp, u_int32_t flags); +

+
+

Description: DbEnv::repmgr_add_remote_site

+

The DbEnv::repmgr_add_remote_site method adds a new replication site to the +replication manager's list of known sites. It is not necessary for +all sites in a replication group to know about all other sites in the +group.

+

The DbEnv::repmgr_add_remote_site method may be called at any time during the life of the +application.

+

The DbEnv::repmgr_add_remote_site method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
eidp
If eidp is non-NULL, the +environment ID assigned to the remote site is +returned in the memory location referenced by eidp. +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values: +
+
DB_REPMGR_PEER
Specifying the DB_REPMGR_PEER flag configures client-to-client +synchronization with the specified remote site. +

Currently, the replication manager framework only supports a single client +peer, and the last specified peer is used.

+
+
host
The site's host identification string, generally a TCP/IP host name. +
port
The port number on which the remote site is receiving. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/repmgr_site_list.html b/db/docs/api_cxx/repmgr_site_list.html new file mode 100644 index 000000000..1217cb903 --- /dev/null +++ b/db/docs/api_cxx/repmgr_site_list.html @@ -0,0 +1,77 @@ + + + + + + +Berkeley DB: DbEnv::repmgr_site_list + + + + + + + +
+

DbEnv::repmgr_site_list

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::repmgr_site_list(u_int *countp, DB_REPMGR_SITE **listp); +

+
+

Description: DbEnv::repmgr_site_list

+

The DbEnv::repmgr_site_list method returns the status of the sites currently +known by the replication manager.

+

The DbEnv::repmgr_site_list method creates a statistical structure of type +DB_REPMGR_SITE and copies a pointer to it into a user-specified memory +location.

+

Statistical structures are stored in allocated memory. If application-specific allocation +routines have been declared (see DbEnv::set_alloc for more +information), they are used to allocate the memory; otherwise, the +standard C library malloc(3) is used. The caller is +responsible for deallocating the memory. To deallocate the memory, free +the memory reference; references inside the returned memory need not be +individually freed.

+

The following DB_REPMGR_SITE fields will be filled in:

+
+
int eid;
Environment ID assigned by the replication manager. +This is the same value that is passed to the application's +event notification function for the DB_EVENT_REP_NEWMASTER event. +
char host[];
Nul-terminated host name. +
u_int port;
TCP/IP port number. +
u_int32_t status;
One of the following list of constants: DB_REPMGR_CONNECTED, +DB_REPMGR_DISCONNECTED. +
+

The DbEnv::repmgr_site_list method may be called at any time during the life of the +application.

+

The DbEnv::repmgr_site_list method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
countp
A count of the returned structures will be stored into the memory +referenced by countp. +
listp
A reference to an array of structures will be stored into the memory +referenced by listp. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/repmgr_start.html b/db/docs/api_cxx/repmgr_start.html new file mode 100644 index 000000000..9d34984a9 --- /dev/null +++ b/db/docs/api_cxx/repmgr_start.html @@ -0,0 +1,97 @@ + + + + + + +Berkeley DB: DbEnv::repmgr_start + + + + + + + +
+

DbEnv::repmgr_start

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbEnv::repmgr_start(int nthreads, u_int32_t flags); +

+
+

Description: DbEnv::repmgr_start

+

The DbEnv::repmgr_start method starts the replication manager.

+

There are two ways to build Berkeley DB replication applications: the most +common approach is to use the Berkeley DB library "replication manager" +support, where the Berkeley DB library manages the replication group, +including network transport, all replication message processing and +acknowledgment, and group elections. Applications using the replication +manager support generally make the following calls:

+
    +

  1. Call DbEnv::repmgr_set_local_site to configure the local site in the +replication group. +

  2. Call DbEnv::repmgr_add_remote_site to configure the remote site(s) in +the replication group. +

  3. Call DbEnv::repmgr_set_ack_policy to configure the message +acknowledgment policy which provides the replication group's +transactional needs. +

  4. Call DbEnv::rep_set_priority to configure the local site's election +priority. +

  5. Call DbEnv::repmgr_start to start the replication application. +
+

For more information on building replication manager applications, +please see the "Replication Manager Getting Started Guide" included in +the Berkeley DB documentation.

+

Applications with special needs (for example, applications using network +protocols not supported by the Berkeley DB replication manager), must perform +additional configuration and call other Berkeley DB replication methods. For +more information on building advanced replication applications, please +see the "Advanced Replication Applications Guide" included in the Berkeley DB +documentation.

+

The DbEnv::repmgr_start method may not be called before the DbEnv::open method has +been called.

+

The DbEnv::repmgr_start method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
flags
The flags parameter must be set to one of the following values: +
+
DB_REP_MASTER
Start as a master site, and do not call for an election. Note there +must never be more than a single master in any replication group, and +only one site at a time should ever be started with the +DB_REP_MASTER flag specified. +
DB_REP_CLIENT
Start as a client site, and do not call for an election. +
DB_REP_ELECTION
Start as a client, and call for an election if no master is found. +
DB_REP_FULL_ELECTION
Start as a client, and call for an election if no master is found. +

The DB_REP_FULL_ELECTION flag configures a single special +election on startup, where a master will only be confirmed if all +members of the replication group vote. Subsequent elections will revert +to only requiring a simple majority to elect a new master.

+
+
nthreads
Specify the number of threads of control created and dedicated to processing +replication messages. In addition to these message processing threads, +the replication manager creates and manages a few of its own threads of +control. +
+
+

Class

+DbEnv +

See Also

+Replication and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/runrec_class.html b/db/docs/api_cxx/runrec_class.html index a3f4a46a9..b10d2a956 100644 --- a/db/docs/api_cxx/runrec_class.html +++ b/db/docs/api_cxx/runrec_class.html @@ -1,5 +1,5 @@ - + @@ -39,6 +39,6 @@ occurs, recovery should be performed.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_class.html b/db/docs/api_cxx/seq_class.html index 2241514a5..8cfbfca06 100644 --- a/db/docs/api_cxx/seq_class.html +++ b/db/docs/api_cxx/seq_class.html @@ -1,5 +1,5 @@ - + @@ -67,6 +67,6 @@ DbSequence

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_close.html b/db/docs/api_cxx/seq_close.html index fca3d7c35..42f64fc64 100644 --- a/db/docs/api_cxx/seq_close.html +++ b/db/docs/api_cxx/seq_close.html @@ -1,5 +1,5 @@ - + @@ -59,6 +59,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_get.html b/db/docs/api_cxx/seq_get.html index dd5934093..bc8efc2da 100644 --- a/db/docs/api_cxx/seq_get.html +++ b/db/docs/api_cxx/seq_get.html @@ -1,5 +1,5 @@ - - + + @@ -34,15 +34,15 @@ values in the sequence handle then they will be returned. Otherwise the next value will be fetched from the database and incremented (decremented) by enough to cover the delta and the next batch of cached values.

-

If the underlying database handle was opened in a transaction then -either the txnid parameter must be a valid transaction handle or -DB_AUTO_COMMIT must be specified. The txnid handle must be NULL -if the sequence handle was opened with a non-zero cache size.

For maximum concurrency a non-zero cache size should be specified prior -to opening the sequence handle and DB_AUTO_COMMIT | DB_TXN_NOSYNC should -be specified each DbSequence::get method call.

-

The DbSequence::get method will return EINVAL if the record in the database is not a valid sequence record, -or the sequences have overflowed is range. +to opening the sequence handle and DB_TXN_NOSYNC should be +specified for each DbSequence::get method call.

+

By default, sequence ranges do not wrap; to cause the sequence to wrap +around the beginning or end of its range, specify the DB_SEQ_WRAP +flag to the DbSequence::set_flags method.

+

The DbSequence::get method will return EINVAL if the record in the database is not a valid sequence +record, or the sequence has reached the beginning or end of its range +and is not configured to wrap.

Parameters

@@ -50,17 +50,32 @@ or the sequences have overflowed is range.
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_AUTO_COMMIT
If the database -must be updated the update will be enclosed in a transaction -and will be recoverable. -
DB_TXN_NOSYNC
If a DB_AUTO_COMMIT -triggers a transaction, do not synchronously flush the log. +
DB_TXN_NOSYNC
If the operation is implicitly transaction protected (the txnid +argument is NULL but the operation occurs to a transactional database), +do not synchronously flush the log when the transaction commits.
retp
retp points to the memory to hold the return value from the sequence. -
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected. No txnid handle may be specified if the sequence handle was +opened with a non-zero cache size. +

If the underlying database handle was opened in a transaction, calling +DbSequence::get may result in changes to the sequence object; these +changes will be automatically committed in a transaction internal to the +Berkeley DB library. If the thread of control calling DbSequence::get has +an active transaction, which holds locks on the same database as the +one in which the sequence object is stored, it is possible for a thread +of control calling DbSequence::get to self-deadlock because the active +transaction's locks conflict with the internal transaction's locks. +For this reason, it is often preferable for sequence objects to be +stored in their own database.


Class

@@ -71,6 +86,6 @@ the txnid parameter is a transaction handle returned from

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_initial_value.html b/db/docs/api_cxx/seq_initial_value.html new file mode 100644 index 000000000..95af3518e --- /dev/null +++ b/db/docs/api_cxx/seq_initial_value.html @@ -0,0 +1,64 @@ + + + + + + +Berkeley DB: DbSequence::initial_value + + + + + + + +
+

DbSequence::initial_value

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbSequence::initial_value(db_seq_t value); +

+
+

Description: DbSequence::initial_value

+

Set the initial value for a sequence. This call is only effective when +the sequence is being created.

+

The DbSequence::initial_value method may not be called after the +DbSequence::open method is called.

+

The DbSequence::initial_value method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
value
The initial value to set. +
+

Errors

+

The DbSequence::initial_value method +may fail and throw +DbException, +encapsulating one of the following non-zero errors, or return one of +the following non-zero errors:

+
+
EINVAL
An +invalid flag value or parameter was specified. +
+
+

Class

+DbSequence +

See Also

+Sequences and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/seq_list.html b/db/docs/api_cxx/seq_list.html index fd7372e18..72430a117 100644 --- a/db/docs/api_cxx/seq_list.html +++ b/db/docs/api_cxx/seq_list.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@

Berkeley DB: Sequences and Related Methods

- + @@ -18,7 +18,7 @@ - + @@ -27,6 +27,6 @@
Sequences and Related MethodsDescription
DbSequenceCreate a sequence handle
DbSequence::getGet the next sequence element(s)
DbSequence::get_dbpReturn a handle for the underlying sequence database
DbSequence::get_keyReturn the key for a sequence
DbSequence::init_valueSet the initial value of a sequence
DbSequence::initial_valueSet the initial value of a sequence
DbSequence::openOpen a sequence
DbSequence::removeRemove a sequence
DbSequence::statReturn sequence statistics
DbSequence::set_flagsSet the flags for a sequence
DbSequence::set_rangeSet the range for a sequence
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_open.html b/db/docs/api_cxx/seq_open.html index f7f04f159..bfee02ecc 100644 --- a/db/docs/api_cxx/seq_open.html +++ b/db/docs/api_cxx/seq_open.html @@ -1,5 +1,5 @@ - - + + @@ -44,10 +44,6 @@ the persistent sequence data.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_AUTO_COMMIT
Enclose the DbSequence::open call within a transaction. If the call -succeeds, the open operation will be recoverable. If the -DB_CREATE flag is specified and the call fails, no sequence will -have been created.
DB_CREATE
Create the sequence. If the sequence does not already exist and the DB_CREATE flag is not specified, the DbSequence::open will fail.
DB_EXCL
Return an error if the sequence already exists. The DB_EXCL @@ -55,13 +51,20 @@ flag is only meaningful when specified with the DB_THREAD
Cause the DbSequence handle returned by DbSequence::open to be free-threaded; that is, usable by multiple threads within a -single address space. +single address space. Note that if multiple threads create multiple +sequences using the same database handle that handle must have been +opened specifying DB_THREAD.
-
txnid
If the operation is to be transaction-protected, -(other than by specifying the DB_AUTO_COMMIT flag), -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. Note that transactionally protected operations on a DbSequence -handle require the DbSequence handle itself be transactionally +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected. Transactionally protected operations on a DbSequence handle +require the DbSequence handle itself be transactionally protected during its open if the open creates the sequence.
@@ -70,7 +73,7 @@ protected during its open if the open creates the sequence.

Parameters

dbp
The dbp parameter references memory into which -a pointer to the database handle is copied. +a pointer to the database handle is copied.

The DbSequence::get_dbp method may be called at any time during the life of the application.

@@ -85,7 +88,7 @@ failure, and returns 0 on success.

Parameters

key
The key parameter references memory into which -a pointer to the key data is copied. +a pointer to the key data is copied.

The DbSequence::get_key method may be called at any time during the life of the application.

@@ -103,6 +106,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_remove.html b/db/docs/api_cxx/seq_remove.html index d915c7777..3c79239de 100644 --- a/db/docs/api_cxx/seq_remove.html +++ b/db/docs/api_cxx/seq_remove.html @@ -1,5 +1,5 @@ - - + + @@ -42,14 +42,19 @@ failure, and returns 0 on success.

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_AUTO_COMMIT
The remove -will be enclosed in a transaction and will be recoverable. -
DB_TXN_NOSYNC
If a DB_AUTO_COMMIT -triggers a transaction, do not synchronously flush the log. +
DB_TXN_NOSYNC
If the operation is implicitly transaction protected (the txnid +argument is NULL but the operation occurs to a transactional database), +do not synchronously flush the log when the transaction commits.
-
txnid
If the operation is to be transaction-protected, -the txnid parameter is a transaction handle returned from -DbEnv::txn_begin; otherwise, NULL. +
txnid
If the operation is part of an application-specified +transaction, the txnid parameter is a transaction handle +returned from DbEnv::txn_begin; if the operation is part of a Berkeley DB Concurrent Data Store +group, the txnid parameter is a handle returned from +DbEnv::cdsgroup_begin; otherwise NULL. If no transaction handle is +specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

Errors

The DbSequence::remove method @@ -70,6 +75,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_set_cachesize.html b/db/docs/api_cxx/seq_set_cachesize.html index 1f737b6c8..effe7d110 100644 --- a/db/docs/api_cxx/seq_set_cachesize.html +++ b/db/docs/api_cxx/seq_set_cachesize.html @@ -1,5 +1,5 @@ - + @@ -75,6 +75,6 @@ current cache size in sizep.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_set_flags.html b/db/docs/api_cxx/seq_set_flags.html index 6f18d3fc3..67070d33f 100644 --- a/db/docs/api_cxx/seq_set_flags.html +++ b/db/docs/api_cxx/seq_set_flags.html @@ -1,5 +1,5 @@ - + @@ -88,6 +88,6 @@ current flags in flagsp.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_set_range.html b/db/docs/api_cxx/seq_set_range.html index 9b1bb0270..1f38d71ed 100644 --- a/db/docs/api_cxx/seq_set_range.html +++ b/db/docs/api_cxx/seq_set_range.html @@ -1,5 +1,5 @@ - + @@ -78,6 +78,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/seq_stat.html b/db/docs/api_cxx/seq_stat.html index 2cfef1099..7e385c2eb 100644 --- a/db/docs/api_cxx/seq_stat.html +++ b/db/docs/api_cxx/seq_stat.html @@ -1,5 +1,5 @@ - + @@ -95,6 +95,6 @@ of the following values:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_abort.html b/db/docs/api_cxx/txn_abort.html index 607a07912..f768d09ee 100644 --- a/db/docs/api_cxx/txn_abort.html +++ b/db/docs/api_cxx/txn_abort.html @@ -1,5 +1,5 @@ - + @@ -52,6 +52,6 @@ failure, and returns 0 on success.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_begin.html b/db/docs/api_cxx/txn_begin.html index 2cfc96707..08c49fbfe 100644 --- a/db/docs/api_cxx/txn_begin.html +++ b/db/docs/api_cxx/txn_begin.html @@ -1,5 +1,5 @@ - - + + @@ -35,7 +35,7 @@ handle.

Note: Transactions may only span threads if they do so serially; that is, each transaction must be active in only a single thread of control at a time. This restriction holds for parents of nested -transactions as well; not two children may be concurrently active in +transactions as well; no two children may be concurrently active in more than one thread of control at any one time.

Note: Cursors may not span transactions; that is, each cursor must be opened and closed within a single transaction.

@@ -53,13 +53,14 @@ failure, and returns 0 on success.
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
-
DB_DEGREE_2
This transaction will have degree 2 isolation. This provides for cursor +
DB_READ_COMMITTED
This transaction will have degree 2 isolation. This provides for cursor stability but not repeatable reads. Data items which have been previously read by this transaction may be deleted or modified by other transactions before this transaction completes. -
DB_DIRTY_READ
All read operations performed by the transaction may read modified but -not yet committed data. Silently ignored if the DB_DIRTY_READ -flag was not specified when the underlying database was opened. +
DB_READ_UNCOMMITTED
This transaction will have degree 1 isolation. Read operations +performed by the transaction may read modified but not yet committed +data. Silently ignored if the DB_READ_UNCOMMITTED flag was not +specified when the underlying database was opened.
DB_TXN_NOSYNC
Do not synchronously flush the log when this transaction commits or prepares. This means the transaction will exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, @@ -72,6 +73,14 @@ overrides that setting.

of this transaction, cause the operation to return DB_LOCK_DEADLOCK or throw a DbDeadlockException immediately instead of blocking on the lock. +
DB_TXN_SNAPSHOT
This transaction will execute with snapshot isolation. For databases with the DB_MULTIVERSION +flag set, data values will be read as they are when the transaction +begins, without taking read locks. Silently ignored for operations on +databases with DB_MULTIVERSION not set on the underlying +database (read locks are acquired). +

The error DB_LOCK_DEADLOCK will be returned from update +operations if a snapshot transaction attempts to update data +which was modified after the snapshot transaction read it.

DB_TXN_SYNC
Synchronously flush the log when this transaction commits or prepares. This means the transaction will exhibit all of the ACID (atomicity, consistency, isolation, and durability) properties. @@ -100,6 +109,6 @@ throw a DbMemoryException.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_checkpoint.html b/db/docs/api_cxx/txn_checkpoint.html index 2668fc211..d5038f0c2 100644 --- a/db/docs/api_cxx/txn_checkpoint.html +++ b/db/docs/api_cxx/txn_checkpoint.html @@ -1,5 +1,5 @@ - - + + @@ -27,8 +27,10 @@ DbEnv::txn_checkpoint(u_int32_t kbyte, u_int32_t min, u_int32_t flags) const;


Description: DbEnv::txn_checkpoint

-

The DbEnv::txn_checkpoint method flushes the underlying memory pool, writes -a checkpoint record to the log, and then flushes the log.

+

If there has been any logging activity in the database environment since +the last checkpoint, the DbEnv::txn_checkpoint method flushes the underlying +memory pool, writes a checkpoint record to the log, and then flushes the +log.

The DbEnv::txn_checkpoint method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on @@ -67,6 +69,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_class.html b/db/docs/api_cxx/txn_class.html index ffc57889d..73311cb46 100644 --- a/db/docs/api_cxx/txn_class.html +++ b/db/docs/api_cxx/txn_class.html @@ -1,5 +1,5 @@ - - + + @@ -33,7 +33,7 @@ public:


Description: DbTxn

-

The DbTxn object is the handle for a transaction. Methods off +

The DbTxn object is the handle for a transaction. Methods of the DbTxn handle are used to configure, abort and commit the transaction. DbTxn handles are provided to Db methods in order to transactionally protect those database operations.

@@ -70,6 +70,6 @@ calls in a purely C++ application.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_commit.html b/db/docs/api_cxx/txn_commit.html index 11c7be811..be53f7096 100644 --- a/db/docs/api_cxx/txn_commit.html +++ b/db/docs/api_cxx/txn_commit.html @@ -1,5 +1,5 @@ - + @@ -80,6 +80,6 @@ method overrides both of those settings.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_discard.html b/db/docs/api_cxx/txn_discard.html index 9393f96b8..c3f743bec 100644 --- a/db/docs/api_cxx/txn_discard.html +++ b/db/docs/api_cxx/txn_discard.html @@ -1,5 +1,5 @@ - + @@ -66,6 +66,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_id.html b/db/docs/api_cxx/txn_id.html index cbd797fbf..9f2da7876 100644 --- a/db/docs/api_cxx/txn_id.html +++ b/db/docs/api_cxx/txn_id.html @@ -1,5 +1,5 @@ - + @@ -40,6 +40,6 @@ to the DbEnv::lock_get or


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_list.html b/db/docs/api_cxx/txn_list.html index 99da21d0c..f25365c96 100644 --- a/db/docs/api_cxx/txn_list.html +++ b/db/docs/api_cxx/txn_list.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@

Berkeley DB: Transaction Subsystem and Related Methods

- + @@ -28,8 +28,9 @@ +
Transaction Subsystem and Related MethodsDescription
DbEnv::txn_checkpointCheckpoint the transaction subsystem
DbTxn::discardDiscard a prepared but not resolved transaction handle
DbTxn::idReturn a transaction's ID
DbTxn::preparePrepare a transaction for commit
DbTxn::set_nameAssociate a string with a transaction
DbTxn::set_timeoutSet transaction timeout
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_prepare.html b/db/docs/api_cxx/txn_prepare.html index 01448a95c..0fba00631 100644 --- a/db/docs/api_cxx/txn_prepare.html +++ b/db/docs/api_cxx/txn_prepare.html @@ -1,5 +1,5 @@ - + @@ -62,6 +62,6 @@ transactions must be resolved.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_recover.html b/db/docs/api_cxx/txn_recover.html index 4d30ae730..9fa7649f9 100644 --- a/db/docs/api_cxx/txn_recover.html +++ b/db/docs/api_cxx/txn_recover.html @@ -1,5 +1,5 @@ - + @@ -69,7 +69,7 @@ array. starting where the last call to DbEnv::txn_recover left off.

preplist
The preplist parameter references memory into which - the list of transactions to be resolved by the application is copied. + the list of transactions to be resolved by the application is copied.

Class

@@ -80,6 +80,6 @@ starting where the last call to DbEnv::txn_recover left off.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_set_name.html b/db/docs/api_cxx/txn_set_name.html new file mode 100644 index 000000000..ab365560a --- /dev/null +++ b/db/docs/api_cxx/txn_set_name.html @@ -0,0 +1,78 @@ + + + + + + +Berkeley DB: DbTxn::set_name + + + + + + + +
+

DbTxn::set_name

+
+API +Ref
+


+ +

+#include <db_cxx.h>
+

+int +DbTxn::set_name(const char *name); +

+int +DbTxn::get_name(const char **namep); +

+
+

Description: DbTxn::set_name

+

The DbTxn::set_name method associates the specified string with the +transaction. The string is returned by DbEnv::txn_stat and displayed +by DbEnv::txn_stat_print.

+

If the database environment has been configured for logging and the +Berkeley DB library was configured with +--enable-diagnostic, a debugging log record is written including the +transaction ID and the name.

+

The DbTxn::set_name method may be called at any time during the life of the +application.

+

The DbTxn::set_name method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
name
The name parameter is the string to associate with the +transaction. +
+
+

Description: DbTxn::get_name

+

The DbTxn::get_name method returns the string associated with the transaction.

+

The DbTxn::get_name method may be called at any time during the life of the +application.

+

The DbTxn::get_name method +either returns a non-zero error value +or throws an exception that encapsulates a non-zero error value on +failure, and returns 0 on success. +

+

Parameters

+
+
namep
The DbTxn::get_name method returns a reference to the +string associated with the transaction in namep. +
+
+

Class

+DbEnv, DbTxn +

See Also

+Transaction Subsystem and Related Methods +
+

+APIRef +
+

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. + + diff --git a/db/docs/api_cxx/txn_set_timeout.html b/db/docs/api_cxx/txn_set_timeout.html index f61034af2..3e1efa18e 100644 --- a/db/docs/api_cxx/txn_set_timeout.html +++ b/db/docs/api_cxx/txn_set_timeout.html @@ -1,5 +1,5 @@ - - + + @@ -29,8 +29,8 @@ DbTxn::set_timeout(db_timeout_t timeout, u_int32_t flags);

Description: DbTxn::set_timeout

The DbTxn::set_timeout method sets timeout values for locks or transactions for the specified transaction.

-

Timeouts are checked whenever a thread of control blocks on a lock or -when deadlock detection is performed. In the case of +

All Timeouts are checked whenever a thread of control blocks on a lock +or when deadlock detection is performed. In the case of DB_SET_LOCK_TIMEOUT, the timeout is for any single lock request. In the case of DB_SET_TXN_TIMEOUT, the timeout is for the life of the transaction. As timeouts are only checked when the lock request @@ -78,6 +78,6 @@ invalid flag value or parameter was specified.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_cxx/txn_stat.html b/db/docs/api_cxx/txn_stat.html index f615203f3..d2da587ed 100644 --- a/db/docs/api_cxx/txn_stat.html +++ b/db/docs/api_cxx/txn_stat.html @@ -1,5 +1,5 @@ - - + + @@ -49,26 +49,45 @@ since the Epoch, returned by the IEEE/ANSI Std 1003.1 (POSIX) time functi

u_int32_t st_last_txnid;
The last transaction ID allocated.
u_int32_t st_maxtxns;
The maximum number of active transactions configured.
u_int32_t st_nactive;
The number of transactions that are currently active. +
u_int32_t st_nsnapshot;
The number of transactions on the snapshot list. These are transactions +which modified a database opened with DB_MULTIVERSION, +and which have committed or aborted, but the copies of pages they +created are still in the cache.
u_int32_t st_maxnactive;
The maximum number of active transactions at any one time. +
u_int32_t st_maxnsnapshot;
The maximum number of transactions on the snapshot list at any one time.
u_int32_t st_nbegins;
The number of transactions that have begun.
u_int32_t st_naborts;
The number of transactions that have aborted.
u_int32_t st_ncommits;
The number of transactions that have committed.
u_int32_t st_nrestores;
The number of transactions that have been restored. -
roff_t st_regsize;
The size of the region, in bytes. +
roff_t st_regsize;
The size of the transaction region, in bytes.
u_int32_t st_region_wait;
The number of times that a thread of control was forced to wait before -obtaining the region lock. +obtaining the transaction region mutex.
u_int32_t st_region_nowait;
The number of times that a thread of control was able to obtain -the region lock without waiting. +the transaction region mutex without waiting.
DB_TXN_ACTIVE *st_txnarray;
A pointer to an array of st_nactive DB_TXN_ACTIVE structures, describing the currently active transactions. The following fields of the DB_TXN_ACTIVE structure will be filled in:
u_int32_t txnid;
The transaction ID of the transaction.
u_int32_t parentid;
The transaction ID of the parent transaction (or 0, if no parent). +
pid_t pid;
The process ID of the originator of the transaction. +
uintmax_t tid;
The thread of control ID of the originator of the transaction.
DbLsn lsn;
The current log sequence number when the transaction was begun. -
u_int32_t xa_status;
If the transaction is an XA transaction, the status of the transaction, -otherwise 0. -
u_int8_t xid[DB_XIDDATASIZE];
If the transaction is an XA transaction, the transaction's XA ID. +
DbLsn read_lsn;
The log sequence number of reads for snapshot transactions. +
u_int32_t mvcc_ref;
The number of buffer copies created by this transaction that remain in cache. +
u_int32_t status;
One of the following list of constants: TXN_ABORTED, TXN_COMMITTED, +TXN_PREPARED, TXN_RUNNING. +
u_int32_t xa_status;
If the transaction is an XA transaction, the xa_status of the +transaction will be one of the following list of constants: +TXN_XA_ABORTED, TXN_XA_DEADLOCKED, TXN_XA_ENDED, TXN_XA_PREPARED, +TXN_XA_STARTED, or TXN_XA_SUSPENDED. Otherwise, the xa_status +will be 0. +
u_int8_t xid[DB_XIDDATASIZE];
If the transaction is an XA transaction, the transaction's XA ID. If +the transaction was prepared separately from the XA interfaces, the +transaction's Global ID. Otherwise, the xid contents are +undefined. +
char name[];
If a name was specified for the transaction, up to the first 50 bytes +of that name, followed by a nul termination byte.

The DbEnv::txn_stat method @@ -84,7 +103,7 @@ the following value:

DB_STAT_CLEAR
Reset statistics after returning their values.
statp
The statp parameter references memory into which -a pointer to the allocated statistics structure is copied. +a pointer to the allocated statistics structure is copied.

Errors

The DbEnv::txn_stat method @@ -98,7 +117,7 @@ invalid flag value or parameter was specified.


Description: DbEnv::txn_stat_print

-

The DbEnv::txn_stat_print method returns the +

The DbEnv::txn_stat_print method displays the transaction subsystem statistical information, as described for the DbEnv::txn_stat method. The information is printed to a specified output channel (see the DbEnv::set_msgfile method for more information), or passed to an @@ -113,10 +132,11 @@ failure, and returns 0 on success.

Parameters

-
flags
The flags parameter must be set to 0 or -the following value: +
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one +or more of the following values:
DB_STAT_ALL
Display all available information. +
DB_STAT_CLEAR
Reset statistics after displaying their values.

@@ -128,6 +148,6 @@ the following value:

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/api_tcl.html b/db/docs/api_tcl/api_tcl.html index 686809792..bc7caf3b4 100644 --- a/db/docs/api_tcl/api_tcl.html +++ b/db/docs/api_tcl/api_tcl.html @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@

Tcl API

- + @@ -49,6 +49,6 @@
Tcl CommandDescription
berkdb envCreate an environment handle


berkdb versionReturn version information
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_close.html b/db/docs/api_tcl/db_close.html index 3ec6cbe62..a6b0abd40 100644 --- a/db/docs/api_tcl/db_close.html +++ b/db/docs/api_tcl/db_close.html @@ -1,6 +1,6 @@ - - + + @@ -55,6 +55,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_count.html b/db/docs/api_tcl/db_count.html index 79af69465..4f3a06000 100644 --- a/db/docs/api_tcl/db_count.html +++ b/db/docs/api_tcl/db_count.html @@ -1,6 +1,6 @@ - - + + @@ -33,6 +33,6 @@ Tcl error is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_cursor.html b/db/docs/api_tcl/db_cursor.html index 7aed97220..f164eaf31 100644 --- a/db/docs/api_tcl/db_cursor.html +++ b/db/docs/api_tcl/db_cursor.html @@ -1,6 +1,6 @@ - - + + @@ -31,16 +31,18 @@ It is through this Tcl command that the script accesses the cursor methods.

The options are as follows:

-
-txn txnid
If the operation is to be -transaction-protected, -the txnid parameter is a transaction handle returned from -env txn. +
-txn txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +env txn. If no transaction handle is specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

In the case of error, a Tcl error is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_del.html b/db/docs/api_tcl/db_del.html index 5179e8f15..c464070d4 100644 --- a/db/docs/api_tcl/db_del.html +++ b/db/docs/api_tcl/db_del.html @@ -1,6 +1,6 @@ - - - + + + @@ -21,7 +21,6 @@


db del
-	[-auto_commit]
 	[-glob]
 	[-txn txnid]
 	key
@@ -32,17 +31,16 @@
 designated key will be discarded.

The options are as follows:

-
-auto_commit
Enclose the call within a transaction. If the call succeeds, changes -made by the operation will be recoverable. If the call fails, the -operation will have made no changes.
-glob
The specified key is a wildcard pattern, and all keys matching that pattern are discarded from the database. The pattern is a simple wildcard, any characters after the wildcard character are ignored. This option only works on databases using the Btree access method. -
-txn txnid
If the operation is to be -transaction-protected (other than by specifying the -auto_commit flag), -the txnid parameter is a transaction handle returned from -env txn. +
-txn txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +env txn. If no transaction handle is specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

The db del command returns 0 on success, and in the case of error, a Tcl error is thrown.

@@ -50,6 +48,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_get.html b/db/docs/api_tcl/db_get.html index 935349de4..ddaddd147 100644 --- a/db/docs/api_tcl/db_get.html +++ b/db/docs/api_tcl/db_get.html @@ -1,6 +1,6 @@ - - - + + + @@ -21,7 +21,6 @@


db get
-	[-auto_commit]
 	[-consume]
 	[-consume_wait]
 	[-glob]
@@ -44,10 +43,6 @@ duplicate items.  Duplicates are sorted by insert order except where this
 order has been overridden by cursor operations.

The options are as follows:

-
-auto_commit
Enclose the call within a transaction. If the call succeeds, changes -made by the operation will be recoverable. If the call fails, the -operation will have made no changes. This option may only be specified -with the -consume or -consume_wait flags.
-consume
Return the record number and data from the available record closest to the head of the queue, and delete the record. The cursor will be positioned on the deleted record. A record is available if it is not @@ -86,10 +81,12 @@ result in deadlock. interface calls in nontransactional environments, the -rmw argument to the db get call is only meaningful in the presence of transactions.

-
-txn txnid
If the operation is to be -transaction-protected, -the txnid parameter is a transaction handle returned from -env txn. +
-txn txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +env txn. If no transaction handle is specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

If the underlying database is a Queue or Recno database, the given key will be interpreted by Tcl as an integer. For all other database types, @@ -102,6 +99,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_get_join.html b/db/docs/api_tcl/db_get_join.html index 28eaa49e8..43ebe9d8e 100644 --- a/db/docs/api_tcl/db_get_join.html +++ b/db/docs/api_tcl/db_get_join.html @@ -1,6 +1,6 @@ - - + + @@ -33,16 +33,18 @@ See Equality join for more information on the underlying requirements for joining.

The options are as follows:

-
-txn txnid
If the operation is to be -transaction-protected, -the txnid parameter is a transaction handle returned from -env txn. +
-txn txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +env txn. If no transaction handle is specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

In the case of error, a Tcl error is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_get_type.html b/db/docs/api_tcl/db_get_type.html index 7f1b8b3cf..166a32c4b 100644 --- a/db/docs/api_tcl/db_get_type.html +++ b/db/docs/api_tcl/db_get_type.html @@ -1,6 +1,6 @@ - - + + @@ -30,6 +30,6 @@ returning one of "btree", "hash", "queue" or "recno".


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_is_byteswapped.html b/db/docs/api_tcl/db_is_byteswapped.html index 53c4e7295..d94cbbe2b 100644 --- a/db/docs/api_tcl/db_is_byteswapped.html +++ b/db/docs/api_tcl/db_is_byteswapped.html @@ -1,6 +1,6 @@ - - + + @@ -34,6 +34,6 @@ or not.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_join.html b/db/docs/api_tcl/db_join.html index a4d1e9fa8..821700c25 100644 --- a/db/docs/api_tcl/db_join.html +++ b/db/docs/api_tcl/db_join.html @@ -1,6 +1,6 @@ - - + + @@ -44,6 +44,6 @@ been created within the same transaction.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_open.html b/db/docs/api_tcl/db_open.html index ade263b34..a713cf275 100644 --- a/db/docs/api_tcl/db_open.html +++ b/db/docs/api_tcl/db_open.html @@ -1,6 +1,6 @@ - - - + + + @@ -59,9 +59,10 @@ db1). It is through this Tcl command that the script accesses the database methods.

The options are as follows:

-
-auto_commit
Enclose the call within a transaction. If the call succeeds, changes -made by the operation will be recoverable. If the call fails, the -operation will have made no changes. +
-auto_commit
Enclose the call within a transaction. If the call succeeds, the open +operation will be recoverable and all subsequent database modification +operations based on this handle will be transactionally protected. If +the call fails, no database will have been created.
-btree
Open/create a database of type Btree. The Btree format is a representation of a sorted, balanced tree structure.
-hash
Open/create a database of type Hash. The Hash format is @@ -284,10 +285,11 @@ implement this flag. For this reason, it is only applicable to the physical file and cannot be used to discard databases within a file.

The -truncate argument cannot be transaction-protected, and it is an error to specify it in a transaction-protected environment.

-
-txn txnid
If the operation is to be -transaction-protected (other than by specifying the -auto_commit flag), -the txnid parameter is a transaction handle returned from -env txn. +
-txn txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +env txn. If no transaction handle is specified, but the +-auto_commit flag is specified, +the operation will be implicitly transaction protected.
--
Mark the end of the command arguments.
file
The name of a single physical file on disk that will be used to back the database. @@ -308,6 +310,6 @@ file for more information.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_put.html b/db/docs/api_tcl/db_put.html index 8a5d79f92..04ec31ee2 100644 --- a/db/docs/api_tcl/db_put.html +++ b/db/docs/api_tcl/db_put.html @@ -1,6 +1,6 @@ - - - + + + @@ -22,12 +22,10 @@

db put
 	-append
-	[-auto_commit]
 	[-partial {doff dlen}]
 	[-txn txnid]
 	data
 db put
-	[-auto_commit]
 	[-nooverwrite]
 	[-partial {doff dlen}]
 	[-txn txnid]
@@ -38,9 +36,6 @@ db put
 database.

The options are as follows:

-
-auto_commit
Enclose the call within a transaction. If the call succeeds, changes -made by the operation will be recoverable. If the call fails, the -operation will have made no changes.
-append
Append the data item to the end of the database. For the -append option to be specified, the underlying database must be a Queue or Recno database. The record number allocated to the record is returned on @@ -60,10 +55,12 @@ duplicate records must be done using a dbc put command.

It is an error to attempt a partial put with differing dlen and supplied data length values in Queue or Recno databases with fixed-length records.

-
-txn txnid
If the operation is to be -transaction-protected (other than by specifying the -auto_commit flag), -the txnid parameter is a transaction handle returned from -env txn. +
-txn txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +env txn. If no transaction handle is specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

The db put command returns either 0 or a record number for success (the record number is returned if the -append option was specified). @@ -76,6 +73,6 @@ types, the key is interpreted by Tcl as a byte array.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_remove.html b/db/docs/api_tcl/db_remove.html index ef7bf5f66..d513426c8 100644 --- a/db/docs/api_tcl/db_remove.html +++ b/db/docs/api_tcl/db_remove.html @@ -1,6 +1,6 @@ - - + + @@ -56,6 +56,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_rename.html b/db/docs/api_tcl/db_rename.html index 25468c882..e293672e5 100644 --- a/db/docs/api_tcl/db_rename.html +++ b/db/docs/api_tcl/db_rename.html @@ -1,6 +1,6 @@ - - + + @@ -57,6 +57,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_stat.html b/db/docs/api_tcl/db_stat.html index 45a885372..d2a0f5edb 100644 --- a/db/docs/api_tcl/db_stat.html +++ b/db/docs/api_tcl/db_stat.html @@ -1,6 +1,6 @@ - - + + @@ -36,6 +36,6 @@ of the database.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_sync.html b/db/docs/api_tcl/db_sync.html index a8a7756d9..68f6d70ef 100644 --- a/db/docs/api_tcl/db_sync.html +++ b/db/docs/api_tcl/db_sync.html @@ -1,6 +1,6 @@ - - - + + + @@ -25,13 +25,13 @@

Description(db sync)

The db sync command function flushes any database cached information to disk.

-

See db close for a discussion of Berkeley DB and cached data.

+

See db close for a discussion of Berkeley DB and cached data.

The db sync command returns 0 on success, and in the case of error, a Tcl error is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/db_truncate.html b/db/docs/api_tcl/db_truncate.html index 27f3ef6f0..edd721ddb 100644 --- a/db/docs/api_tcl/db_truncate.html +++ b/db/docs/api_tcl/db_truncate.html @@ -1,6 +1,6 @@ - - - + + + @@ -21,20 +21,18 @@


db truncate
-	[-auto_commit]
 	[-txn txnid]
 

Description(db truncate)

Empties the database, discarding all records it contains.

The options are as follows:

-
-auto_commit
Enclose the call within a transaction. If the call succeeds, changes -made by the operation will be recoverable. If the call fails, the -operation will have made no changes. -
-txn txnid
If the operation is to be -transaction-protected (other than by specifying the -auto_commit flag), -the txnid parameter is a transaction handle returned from -env txn. +
-txn txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +env txn. If no transaction handle is specified, but the +operation occurs in a transactional +database, +the operation will be implicitly transaction protected.

The db truncate command returns the number of records discarded from the database on success.

@@ -43,6 +41,6 @@ from the database on success.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/dbc_close.html b/db/docs/api_tcl/dbc_close.html index a3eadde77..dd42aa71e 100644 --- a/db/docs/api_tcl/dbc_close.html +++ b/db/docs/api_tcl/dbc_close.html @@ -1,6 +1,6 @@ - - - + + + @@ -23,7 +23,7 @@

dbc close
 

Description(db close)

-

The dbc close command discards the cursor.

+

The dbc close command discards the cursor.

After dbc close has been called, regardless of its return, the cursor handle may not be used again.

The dbc close command returns 0 on success, and in the case of error, a Tcl error @@ -32,6 +32,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/dbc_del.html b/db/docs/api_tcl/dbc_del.html index a0543c12d..f4c2c1fd5 100644 --- a/db/docs/api_tcl/dbc_del.html +++ b/db/docs/api_tcl/dbc_del.html @@ -1,6 +1,6 @@ - - + + @@ -34,6 +34,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/dbc_dup.html b/db/docs/api_tcl/dbc_dup.html index 2a20f01b3..172a50e6c 100644 --- a/db/docs/api_tcl/dbc_dup.html +++ b/db/docs/api_tcl/dbc_dup.html @@ -1,6 +1,6 @@ - - + + @@ -42,6 +42,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/dbc_get.html b/db/docs/api_tcl/dbc_get.html index 809345451..1542f106a 100644 --- a/db/docs/api_tcl/dbc_get.html +++ b/db/docs/api_tcl/dbc_get.html @@ -1,6 +1,6 @@ - - - + + + @@ -75,7 +75,7 @@ explicitly created by the application, or were created and later deleted.

identical to -first.

Otherwise, the cursor is moved to the next key/data pair of the database, and that pair is returned. In the presence of duplicate key values, the -value of the key may not change.

+value of the key may not change.

If the database is a Queue or Recno database, dbc get using the -next option will skip any keys that exist but were never explicitly created by the application, or were created and later deleted.

@@ -110,7 +110,7 @@ position in the database, dbc get will return an empty list.

-set
Move the cursor to the specified key/data pair of the database, and return the datum associated with the given key.

In the presence of duplicate key values, dbc get will return the -first data item for the given key.

+first data item for the given key.

If the database is a Queue or Recno database and the requested key exists, but was never explicitly created by the application or was later deleted, dbc get will return an empty list.

@@ -163,6 +163,6 @@ exist an empty list is returned.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/dbc_put.html b/db/docs/api_tcl/dbc_put.html index 13534f4e4..a77e36fd4 100644 --- a/db/docs/api_tcl/dbc_put.html +++ b/db/docs/api_tcl/dbc_put.html @@ -1,6 +1,6 @@ - - - + + + @@ -68,7 +68,7 @@ automatically renumbered, and the key of the new record is returned in the structure to which the key argument refers. The initial value of the key parameter is ignored. See berkdb open for more information.

In the case of the Queue access method, it is always an error to specify --before.

+-before.

If the current cursor record has already been deleted and the underlying access method is Hash, dbc put will throw a Tcl error. If the underlying access method is Btree or Recno, the operation will succeed.

@@ -129,6 +129,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/env_close.html b/db/docs/api_tcl/env_close.html index 8f8a91105..12026e042 100644 --- a/db/docs/api_tcl/env_close.html +++ b/db/docs/api_tcl/env_close.html @@ -1,6 +1,6 @@ - - + + @@ -38,6 +38,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/env_dbremove.html b/db/docs/api_tcl/env_dbremove.html index a61d7d02d..d79915022 100644 --- a/db/docs/api_tcl/env_dbremove.html +++ b/db/docs/api_tcl/env_dbremove.html @@ -1,6 +1,6 @@ - - - + + + @@ -33,10 +33,11 @@

-auto_commit
Enclose the call within a transaction. If the call succeeds, changes made by the operation will be recoverable. If the call fails, the operation will have made no changes. -
-txn txnid
If the operation is to be -transaction-protected (other than by specifying the -auto_commit flag), -the txnid parameter is a transaction handle returned from -env txn. +
-txn txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +env txn. If no transaction handle is specified, but the +-auto_commit flag is specified, +the operation will be implicitly transaction protected.

The env dbremove command returns 0 on success, and in the case of error, a Tcl error is thrown.

@@ -44,6 +45,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/env_dbrename.html b/db/docs/api_tcl/env_dbrename.html index 79f324739..b8d519ee3 100644 --- a/db/docs/api_tcl/env_dbrename.html +++ b/db/docs/api_tcl/env_dbrename.html @@ -1,6 +1,6 @@ - - - + + + @@ -34,10 +34,11 @@

-auto_commit
Enclose the call within a transaction. If the call succeeds, changes made by the operation will be recoverable. If the call fails, the operation will have made no changes. -
-txn txnid
If the operation is to be -transaction-protected (other than by specifying the -auto_commit flag), -the txnid parameter is a transaction handle returned from -env txn. +
-txn txnid
If the operation is part of an application-specified transaction, the +txnid parameter is a transaction handle returned from +env txn. If no transaction handle is specified, but the +-auto_commit flag is specified, +the operation will be implicitly transaction protected.

The env dbrename command returns 0 on success, and in the case of error, a Tcl error is thrown.

@@ -45,6 +46,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/env_open.html b/db/docs/api_tcl/env_open.html index 3cc69bb4c..98ad6ac3f 100644 --- a/db/docs/api_tcl/env_open.html +++ b/db/docs/api_tcl/env_open.html @@ -1,6 +1,6 @@ - - + + @@ -170,6 +170,6 @@ systems).

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/env_remove.html b/db/docs/api_tcl/env_remove.html index 782c90ae9..f7b3abe7e 100644 --- a/db/docs/api_tcl/env_remove.html +++ b/db/docs/api_tcl/env_remove.html @@ -1,6 +1,6 @@ - - + + @@ -68,6 +68,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/txn.html b/db/docs/api_tcl/txn.html index 63ccf311c..65e5ffc01 100644 --- a/db/docs/api_tcl/txn.html +++ b/db/docs/api_tcl/txn.html @@ -1,6 +1,6 @@ - - + + @@ -59,6 +59,6 @@ consistency, isolation, and durability) properties.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/txn_abort.html b/db/docs/api_tcl/txn_abort.html index 9d4693bb4..7e91f12ed 100644 --- a/db/docs/api_tcl/txn_abort.html +++ b/db/docs/api_tcl/txn_abort.html @@ -1,6 +1,6 @@ - - + + @@ -41,6 +41,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/txn_checkpoint.html b/db/docs/api_tcl/txn_checkpoint.html index 0c3e616af..8634fc2c4 100644 --- a/db/docs/api_tcl/txn_checkpoint.html +++ b/db/docs/api_tcl/txn_checkpoint.html @@ -1,6 +1,6 @@ - - + + @@ -40,6 +40,6 @@ of minutes has passed since the last checkpoint.

APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/txn_commit.html b/db/docs/api_tcl/txn_commit.html index d7a62929f..833ff9b19 100644 --- a/db/docs/api_tcl/txn_commit.html +++ b/db/docs/api_tcl/txn_commit.html @@ -1,6 +1,6 @@ - - - + + + @@ -25,7 +25,7 @@ [-sync]

Description(txn commit)

-

The txn commit command ends the transaction.

+

The txn commit command ends the transaction.

In the case of nested transactions, if the transaction is a parent transaction with unresolved (neither committed or aborted) child transactions, the child transactions are aborted and the commit of the @@ -65,6 +65,6 @@ is thrown.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/api_tcl/version.html b/db/docs/api_tcl/version.html index 99e54b057..d5478226f 100644 --- a/db/docs/api_tcl/version.html +++ b/db/docs/api_tcl/version.html @@ -1,6 +1,6 @@ - - + + @@ -35,6 +35,6 @@ patch levels of the underlying Berkeley DB release.


APIRef
-

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved. +

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved. diff --git a/db/docs/collections/tutorial/BasicProgram.html b/db/docs/collections/tutorial/BasicProgram.html index 470128711..b1e276e8b 100644 --- a/db/docs/collections/tutorial/BasicProgram.html +++ b/db/docs/collections/tutorial/BasicProgram.html @@ -207,7 +207,7 @@ public class PartKey implements Serializable } public String toString() { - return "[PartKey: number=" + number + ']'; + return "[PartKey: number=" + number + ']'; } }

@@ -254,10 +254,10 @@ public class PartData implements Serializable public String toString() { - return "[PartData: name=" + name + - " color=" + color + - " weight=" + weight + - " city=" + city + ']'; + return "[PartData: name=" + name + + " color=" + color + + " weight=" + weight + + " city=" + city + ']'; } }

@@ -271,8 +271,8 @@ public class PartData implements Serializable public class Weight implements Serializable { - public final static String GRAMS = "grams"; - public final static String OUNCES = "ounces"; + public final static String GRAMS = "grams"; + public final static String OUNCES = "ounces"; private double amount; private String units; @@ -295,7 +295,7 @@ public class Weight implements Serializable public String toString() { - return "[" + amount + ' ' + units + ']'; + return "[" + amount + ' ' + units + ']'; } }

@@ -321,7 +321,7 @@ public class SupplierKey implements Serializable public String toString() { - return "[SupplierKey: number=" + number + ']'; + return "[SupplierKey: number=" + number + ']'; } }

@@ -361,9 +361,9 @@ public class SupplierData implements Serializable public String toString() { - return "[SupplierData: name=" + name + - " status=" + status + - " city=" + city + ']'; + return "[SupplierData: name=" + name + + " status=" + status + + " city=" + city + ']'; } } @@ -397,8 +397,8 @@ public class ShipmentKey implements Serializable public String toString() { - return "[ShipmentKey: supplier=" + supplierNumber + - " part=" + partNumber + ']'; + return "[ShipmentKey: supplier=" + supplierNumber + + " part=" + partNumber + ']'; } }

@@ -427,7 +427,7 @@ public class ShipmentData implements Serializable public String toString() { - return "[ShipmentData: quantity=" + quantity + ']'; + return "[ShipmentData: quantity=" + quantity + ']'; } } diff --git a/db/docs/collections/tutorial/BerkeleyDB-Java-Collections.pdf b/db/docs/collections/tutorial/BerkeleyDB-Java-Collections.pdf index 9435e5470..1858c36f0 100644 Binary files a/db/docs/collections/tutorial/BerkeleyDB-Java-Collections.pdf and b/db/docs/collections/tutorial/BerkeleyDB-Java-Collections.pdf differ diff --git a/db/docs/collections/tutorial/Entity.html b/db/docs/collections/tutorial/Entity.html index 7937d8c22..57ec58187 100644 --- a/db/docs/collections/tutorial/Entity.html +++ b/db/docs/collections/tutorial/Entity.html @@ -136,7 +136,7 @@ bindings, but the SampleDatabase class was not changed at all. In fact, the Entity program and the Index program can be used interchangeably to access the same physical database files. This - demonstrates that bindings are only a "view" onto the physical + demonstrates that bindings are only a "view" onto the physical stored data.

@@ -243,11 +243,11 @@ public String toString() { - return "Part: number=" + number + - " name=" + name + - " color=" + color + - " weight=" + weight + - " city=" + city + '.'; + return "Part: number=" + number + + " name=" + name + + " color=" + color + + " weight=" + weight + + " city=" + city + '.'; } } @@ -288,10 +288,10 @@ public String toString() { - return "Supplier: number=" + number + - " name=" + name + - " status=" + status + - " city=" + city + '.'; + return "Supplier: number=" + number + + " name=" + name + + " status=" + status + + " city=" + city + '.'; } } @@ -325,9 +325,9 @@ public String toString() { - return "Shipment: part=" + partNumber + - " supplier=" + supplierNumber + - " quantity=" + quantity + '.'; + return "Shipment: part=" + partNumber + + " supplier=" + supplierNumber + + " quantity=" + quantity + '.'; } } diff --git a/db/docs/collections/tutorial/SerializableEntity.html b/db/docs/collections/tutorial/SerializableEntity.html index 9f63bab4e..a9221e202 100644 --- a/db/docs/collections/tutorial/SerializableEntity.html +++ b/db/docs/collections/tutorial/SerializableEntity.html @@ -220,11 +220,11 @@ public class Part implements Serializable public String toString() { - return "Part: number=" + number + - " name=" + name + - " color=" + color + - " weight=" + weight + - " city=" + city + '.'; + return "Part: number=" + number + + " name=" + name + + " color=" + color + + " weight=" + weight + + " city=" + city + '.'; } } ... @@ -270,10 +270,10 @@ public class Supplier implements Serializable public String toString() { - return "Supplier: number=" + number + - " name=" + name + - " status=" + status + - " city=" + city + '.'; + return "Supplier: number=" + number + + " name=" + name + + " status=" + status + + " city=" + city + '.'; } } ... @@ -313,9 +313,9 @@ public class Shipment implements Serializable public String toString() { - return "Shipment: part=" + partNumber + - " supplier=" + supplierNumber + - " quantity=" + quantity + '.'; + return "Shipment: part=" + partNumber + + " supplier=" + supplierNumber + + " quantity=" + quantity + '.'; } } diff --git a/db/docs/collections/tutorial/Summary.html b/db/docs/collections/tutorial/Summary.html index efa436a60..529e0fef4 100644 --- a/db/docs/collections/tutorial/Summary.html +++ b/db/docs/collections/tutorial/Summary.html @@ -41,9 +41,9 @@

- In summary, the Sleepycat Java Collections API tutorial has + In summary, the Java Collections API tutorial has demonstrated how to create different types of bindings, as well as - how to use the basic facilities of the Sleepycat Java Collections API: + how to use the basic facilities of the Java Collections API: the environment, databases, secondary indices, collections, and transactions. The final approach illustrated by the last example program, Serializable Entity, uses tuple keys and serial entity @@ -142,7 +142,7 @@

Internal bindings are called marshalled bindings in the - Sleepycat Java Collections API, and in this model each data class + Java Collections API, and in this model each data class implements a marshalling interface. A single external binding class that understands the marshalling interface is used to call the internal bindings of each data object, and therefore the overall @@ -154,7 +154,7 @@ marshal and factory examples that came with your DB distribution (you can find them in - <INSTALL_DIR>examples_java/src/com/sleepycat/examples/collections/ship + <INSTALL_DIR>/examples_java/src/com/sleepycat/examples/collections/ship where <INSTALL_DIR> is the location where you unpacked your DB distribution). diff --git a/db/docs/collections/tutorial/Tuple.html b/db/docs/collections/tutorial/Tuple.html index 956358b8d..d5965430b 100644 --- a/db/docs/collections/tutorial/Tuple.html +++ b/db/docs/collections/tutorial/Tuple.html @@ -83,7 +83,7 @@ Creating Tuple-Serial Entity Bindings

- Sleepycat Java Collections API tuples are sequences of + Java Collections API tuples are sequences of primitive Java data types, for example, integers and strings. The tuple format is a binary format for tuples that can be used to store keys and/or values. @@ -141,7 +141,7 @@ Creating Tuple-Serial Entity Bindings Tuples are sequences of primitive Java values that can be written to, and read from, the raw data bytes of a stored record. The primitive values are written or read one at a time in sequence, - using the Sleepycat Java Collections API + using the Java Collections API TupleInput and diff --git a/db/docs/collections/tutorial/UsingCollectionsAPI.html b/db/docs/collections/tutorial/UsingCollectionsAPI.html index a37c3de5c..34236b7bd 100644 --- a/db/docs/collections/tutorial/UsingCollectionsAPI.html +++ b/db/docs/collections/tutorial/UsingCollectionsAPI.html @@ -4,7 +4,7 @@ - Using the Sleepycat Java Collections API + Using the Java Collections API @@ -18,7 +18,7 @@ @@ -36,7 +36,7 @@

- Using the Sleepycat Java Collections API + Using the Java Collections API

@@ -86,7 +86,7 @@ more stored collections, you are ready to access (read and write) stored data. For a transactional environment, a transaction must be started before accessing data, and must be committed or aborted - after access is complete. The Sleepycat Java Collections API provides several + after access is complete. The Java Collections API provides several ways of managing transactions.

@@ -175,7 +175,7 @@ environment.

- The Sleepycat Java Collections API supports nested transactions. If + The Java Collections API supports nested transactions. If TransactionRunner.run(com.sleepycat.collections.TransactionWorker) or @@ -197,12 +197,12 @@ is active.

- The Sleepycat Java Collections API supports transaction auto-commit. + The Java Collections API supports transaction auto-commit. If no transaction is active and a write operation is requested for a transactional database, auto-commit is used automatically.

- The Sleepycat Java Collections API also supports transaction + The Java Collections API also supports transaction dirty-read via the StoredCollections @@ -230,9 +230,9 @@

When a transaction is aborted (or rolled back) the application is responsible for discarding references to any data objects that - were modified during the transaction. Since the Sleepycat Java Collections - API treats data by value, not by reference, neither the data - objects nor the Sleepycat Java Collections API objects contain status + were modified during the transaction. Since the Java Collections API + treats data by value, not by reference, neither the data + objects nor the Java Collections API objects contain status information indicating whether the data objects are 1- in sync with the database, 2- dirty (contain changes that have not been written to the database), 3- stale (were read previously but have become @@ -520,7 +520,7 @@

Please see Available Access Methods in - the Berkeley DB Programmer's Reference Guide + the Berkeley DB Programmer's Reference Guide for more information on access method configuration.

@@ -569,8 +569,7 @@
  • For secondary indices with duplicates, the duplicates must be - sorted. This restriction is imposed by the Sleepycat Java - Collections API. + sorted. This restriction is imposed by the Java Collections API.

  • @@ -593,7 +592,7 @@
  • - If reocrd number keys are renumbered, then standard List + If record number keys are renumbered, then standard List add/remove behavior is supported but concurrency/performance is reduced.

    diff --git a/db/docs/collections/tutorial/UsingSecondaries.html b/db/docs/collections/tutorial/UsingSecondaries.html index c6c147c72..35fb50ef7 100644 --- a/db/docs/collections/tutorial/UsingSecondaries.html +++ b/db/docs/collections/tutorial/UsingSecondaries.html @@ -201,7 +201,7 @@ import com.sleepycat.db.SecondaryDatabase; public class SampleDatabase { ... - private static final String SUPPLIER_CITY_INDEX = "supplier_city_index"; + private static final String SUPPLIER_CITY_INDEX = "supplier_city_index"; ... private SecondaryDatabase supplierByCityDb; ... diff --git a/db/docs/collections/tutorial/UsingStoredCollections.html b/db/docs/collections/tutorial/UsingStoredCollections.html index 415974b09..37fdc6096 100644 --- a/db/docs/collections/tutorial/UsingStoredCollections.html +++ b/db/docs/collections/tutorial/UsingStoredCollections.html @@ -10,7 +10,7 @@ - + @@ -789,7 +789,7 @@
  • - Using the Sleepycat Java Collections API + Using the Java Collections API
    - Using the Sleepycat Java Collections API + Using the Java Collections API   Home diff --git a/db/docs/collections/tutorial/addingdatabaseitems.html b/db/docs/collections/tutorial/addingdatabaseitems.html index 4e1ff66d5..53b3b8e84 100644 --- a/db/docs/collections/tutorial/addingdatabaseitems.html +++ b/db/docs/collections/tutorial/addingdatabaseitems.html @@ -49,8 +49,7 @@ Map.put method is used to add objects. All standard Java methods for - modifying a collection may be used with the Sleepycat Java Collections - API. + modifying a collection may be used with the Java Collections API.

    The PopulateDatabase.doWork() method calls private methods @@ -107,17 +106,17 @@ public class Sample Map suppliers = views.getSupplierMap(); if (suppliers.isEmpty()) { - System.out.println("Adding Suppliers"); - suppliers.put(new SupplierKey("S1"), - new SupplierData("Smith", 20, "London")); - suppliers.put(new SupplierKey("S2"), - new SupplierData("Jones", 10, "Paris")); - suppliers.put(new SupplierKey("S3"), - new SupplierData("Blake", 30, "Paris")); - suppliers.put(new SupplierKey("S4"), - new SupplierData("Clark", 20, "London")); - suppliers.put(new SupplierKey("S5"), - new SupplierData("Adams", 30, "Athens")); + System.out.println("Adding Suppliers"); + suppliers.put(new SupplierKey("S1"), + new SupplierData("Smith", 20, "London")); + suppliers.put(new SupplierKey("S2"), + new SupplierData("Jones", 10, "Paris")); + suppliers.put(new SupplierKey("S3"), + new SupplierData("Blake", 30, "Paris")); + suppliers.put(new SupplierKey("S4"), + new SupplierData("Clark", 20, "London")); + suppliers.put(new SupplierKey("S5"), + new SupplierData("Adams", 30, "Athens")); } } @@ -126,31 +125,31 @@ public class Sample Map parts = views.getPartMap(); if (parts.isEmpty()) { - System.out.println("Adding Parts"); - parts.put(new PartKey("P1"), - new PartData("Nut", "Red", + System.out.println("Adding Parts"); + parts.put(new PartKey("P1"), + new PartData("Nut", "Red", new Weight(12.0, Weight.GRAMS), - "London")); - parts.put(new PartKey("P2"), - new PartData("Bolt", "Green", + "London")); + parts.put(new PartKey("P2"), + new PartData("Bolt", "Green", new Weight(17.0, Weight.GRAMS), - "Paris")); - parts.put(new PartKey("P3"), - new PartData("Screw", "Blue", + "Paris")); + parts.put(new PartKey("P3"), + new PartData("Screw", "Blue", new Weight(17.0, Weight.GRAMS), - "Rome")); - parts.put(new PartKey("P4"), - new PartData("Screw", "Red", + "Rome")); + parts.put(new PartKey("P4"), + new PartData("Screw", "Red", new Weight(14.0, Weight.GRAMS), - "London")); - parts.put(new PartKey("P5"), - new PartData("Cam", "Blue", + "London")); + parts.put(new PartKey("P5"), + new PartData("Cam", "Blue", new Weight(12.0, Weight.GRAMS), - "Paris")); - parts.put(new PartKey("P6"), - new PartData("Cog", "Red", + "Paris")); + parts.put(new PartKey("P6"), + new PartData("Cog", "Red", new Weight(19.0, Weight.GRAMS), - "London")); + "London")); } } @@ -159,30 +158,30 @@ public class Sample Map shipments = views.getShipmentMap(); if (shipments.isEmpty()) { - System.out.println("Adding Shipments"); - shipments.put(new ShipmentKey("P1", "S1"), + System.out.println("Adding Shipments"); + shipments.put(new ShipmentKey("P1", "S1"), new ShipmentData(300)); - shipments.put(new ShipmentKey("P2", "S1"), + shipments.put(new ShipmentKey("P2", "S1"), new ShipmentData(200)); - shipments.put(new ShipmentKey("P3", "S1"), + shipments.put(new ShipmentKey("P3", "S1"), new ShipmentData(400)); - shipments.put(new ShipmentKey("P4", "S1"), + shipments.put(new ShipmentKey("P4", "S1"), new ShipmentData(200)); - shipments.put(new ShipmentKey("P5", "S1"), + shipments.put(new ShipmentKey("P5", "S1"), new ShipmentData(100)); - shipments.put(new ShipmentKey("P6", "S1"), + shipments.put(new ShipmentKey("P6", "S1"), new ShipmentData(100)); - shipments.put(new ShipmentKey("P1", "S2"), + shipments.put(new ShipmentKey("P1", "S2"), new ShipmentData(300)); - shipments.put(new ShipmentKey("P2", "S2"), + shipments.put(new ShipmentKey("P2", "S2"), new ShipmentData(400)); - shipments.put(new ShipmentKey("P2", "S3"), + shipments.put(new ShipmentKey("P2", "S3"), new ShipmentData(200)); - shipments.put(new ShipmentKey("P2", "S4"), + shipments.put(new ShipmentKey("P2", "S4"), new ShipmentData(200)); - shipments.put(new ShipmentKey("P4", "S4"), + shipments.put(new ShipmentKey("P4", "S4"), new ShipmentData(300)); - shipments.put(new ShipmentKey("P5", "S4"), + shipments.put(new ShipmentKey("P5", "S4"), new ShipmentData(400)); } } diff --git a/db/docs/collections/tutorial/collectionOverview.html b/db/docs/collections/tutorial/collectionOverview.html index c01feb18d..02ac86e91 100644 --- a/db/docs/collections/tutorial/collectionOverview.html +++ b/db/docs/collections/tutorial/collectionOverview.html @@ -11,7 +11,7 @@ - +

      - Using the Sleepycat Java Collections API + Using the Java Collections API
    diff --git a/db/docs/collections/tutorial/createbindingscollections.html b/db/docs/collections/tutorial/createbindingscollections.html index aa68637dd..aa0c46253 100644 --- a/db/docs/collections/tutorial/createbindingscollections.html +++ b/db/docs/collections/tutorial/createbindingscollections.html @@ -251,7 +251,7 @@ public class SampleViews follows.

    -
        SampleDatabase sd = new SampleDatabase(new String("/home"));
    +      
        SampleDatabase sd = new SampleDatabase(new String("/home"));
         SampleViews views = new SampleViews(sd);
         Map partMap = views.getPartMap();
         Set supplierEntries = views.getSupplierEntrySet(); 
    diff --git a/db/docs/collections/tutorial/developing.html b/db/docs/collections/tutorial/developing.html index 0f13dfe00..f8787ef3c 100644 --- a/db/docs/collections/tutorial/developing.html +++ b/db/docs/collections/tutorial/developing.html @@ -3,7 +3,7 @@ - Developing a Sleepycat Collections Application + Developing a DB Collections Application @@ -15,7 +15,7 @@ diff --git a/db/docs/collections/tutorial/moreinfo.html b/db/docs/collections/tutorial/moreinfo.html new file mode 100644 index 000000000..9a98b5bbc --- /dev/null +++ b/db/docs/collections/tutorial/moreinfo.html @@ -0,0 +1,108 @@ + + + + + + For More Information + + + + + + + + + +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + DB application: +

    + +
    + + + diff --git a/db/docs/collections/tutorial/openclasscatalog.html b/db/docs/collections/tutorial/openclasscatalog.html index fac34445b..b68f6abdf 100644 --- a/db/docs/collections/tutorial/openclasscatalog.html +++ b/db/docs/collections/tutorial/openclasscatalog.html @@ -72,7 +72,7 @@ import java.io.FileNotFoundException; public class SampleDatabase { private Environment env; - private static final String CLASS_CATALOG = "java_class_catalog"; + private static final String CLASS_CATALOG = "java_class_catalog"; ... private StoredClassCatalog javaCatalog; ... @@ -80,7 +80,7 @@ public class SampleDatabase

    While the class catalog is itself a database, it contains metadata for other databases and is therefore treated specially by - the Sleepycat Java Collections API. The + the Java Collections API. The StoredClassCatalog class encapsulates the catalog store and implements this special @@ -89,7 +89,7 @@ public class SampleDatabase

    The following statements open the class catalog by creating a Database and a StoredClassCatalog object. The catalog - database is created if it doesn't already exist. + database is created if it does not already exist.

        public SampleDatabase(String homeDirectory)
    @@ -124,7 +124,7 @@ public class SampleDatabase
     

    setAllowCreate() is set to true to specify - that the database will be created if it doesn't already exist. If + that the database will be created if it does not already exist. If this parameter is not specified, an exception will be thrown if the database does not already exist.

    @@ -142,7 +142,7 @@ public class SampleDatabase

    The second and third parameters of openDatabase() - specify the filename and database (sub-file) name o fthe database. The + specify the filename and database (sub-file) name of the database. The database name is optional and is null in this example.

    diff --git a/db/docs/collections/tutorial/opendatabases.html b/db/docs/collections/tutorial/opendatabases.html index 3a4913dea..811b8f54f 100644 --- a/db/docs/collections/tutorial/opendatabases.html +++ b/db/docs/collections/tutorial/opendatabases.html @@ -60,9 +60,9 @@

    public class SampleDatabase
     {
         ...
    -    private static final String SUPPLIER_STORE = "supplier_store";
    -    private static final String PART_STORE = "part_store";
    -    private static final String SHIPMENT_STORE = "shipment_store";
    +    private static final String SUPPLIER_STORE = "supplier_store";
    +    private static final String PART_STORE = "part_store";
    +    private static final String SHIPMENT_STORE = "shipment_store";
         ...
         private Database supplierDb;
         private Database partDb;
    @@ -91,8 +91,7 @@
             supplierDb = env.openDatabase(null, SUPPLIER_STORE, null, dbConfig);
             shipmentDb = env.openDatabase(null, SHIPMENT_STORE, null, dbConfig);
             ...
    -    }
    -	
    + }

    The database configuration object that was used previously for opening the catalog database is reused for opening the three @@ -112,8 +111,7 @@ shipmentDb.close(); javaCatalog.close(); env.close(); - } -

    + }

    All databases, including the catalog database, must be closed before closing the environment. diff --git a/db/docs/collections/tutorial/opendbenvironment.html b/db/docs/collections/tutorial/opendbenvironment.html index e0db5d3ea..28edafb2b 100644 --- a/db/docs/collections/tutorial/opendbenvironment.html +++ b/db/docs/collections/tutorial/opendbenvironment.html @@ -94,7 +94,7 @@ public class SampleDatabase com.sleepycat.db package. Both packages are needed to create a complete application - based on the Sleepycat Java Collections API. + based on the Java Collections API.

    The following statements create an @@ -107,7 +107,7 @@ public class SampleDatabase

    public SampleDatabase(String homeDirectory)
             throws DatabaseException, FileNotFoundException
         {
    -        System.out.println("Opening environment in: " + homeDirectory);
    +        System.out.println("Opening environment in: " + homeDirectory);
     
             EnvironmentConfig envConfig = new EnvironmentConfig();
             envConfig.setTransactional(true);
    diff --git a/db/docs/collections/tutorial/openingforeignkeys.html b/db/docs/collections/tutorial/openingforeignkeys.html
    index 217236eac..0e274a98a 100644
    --- a/db/docs/collections/tutorial/openingforeignkeys.html
    +++ b/db/docs/collections/tutorial/openingforeignkeys.html
    @@ -63,9 +63,9 @@ import com.sleepycat.db.SecondaryDatabase;
     public class SampleDatabase
     {
         ...
    -    private static final String SHIPMENT_PART_INDEX = "shipment_part_index";
    +    private static final String SHIPMENT_PART_INDEX = "shipment_part_index";
         private static final String SHIPMENT_SUPPLIER_INDEX = 
    -        "shipment_supplier_index";
    +        "shipment_supplier_index";
         ...
         private SecondaryDatabase shipmentByPartDb;
         private SecondaryDatabase shipmentBySupplierDb;
    diff --git a/db/docs/collections/tutorial/preface.html b/db/docs/collections/tutorial/preface.html
    index f501252cd..4a2f8a93d 100644
    --- a/db/docs/collections/tutorial/preface.html
    +++ b/db/docs/collections/tutorial/preface.html
    @@ -9,7 +9,7 @@
         
         
         
    -    
    +    
       
       
         

    Prev    Next Next


    @@ -44,6 +44,11 @@ Conventions Used in this Book +
    + + For More Information + +

    @@ -53,7 +58,7 @@ with which you can quickly become efficient with this API. As such, this document is intended for Java developers and senior software architects who are looking for transactionally-protected backing of their Java collections. - No prior experience with Sleepycat technologies is expected or required. + No prior experience with DB technologies is expected or required.

    @@ -69,12 +74,12 @@

    Class names are represented in monospaced font, as are method - names. For example: "The Environment.openDatabase() method - returns a Database class object." + names. For example: "The Environment.openDatabase() method + returns a Database class object."

    - Variable or non-literal text is presented in italics. For example: "Go to your - DB_INSTALLATION_HOME directory." + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALLATION_HOME directory."

    Program examples are displayed in a monospaced font on a shaded background. For example: @@ -101,7 +106,7 @@ import java.io.File; Environment myDbEnv; EnvironmentConfig envConfig = new EnvironmentConfig(); envConfig.setAllowCreate(true); -myDbEnv = new Environment(new File("/export/dbEnv"), envConfig); +myDbEnv = new Environment(new File("/export/dbEnv"), envConfig);

    Up  Next Next
    Berkeley DB Collections Tutorial  Home  Chapter 1.  - Introduction -  For More Information
    diff --git a/db/docs/collections/tutorial/retrievingbyindexkey.html b/db/docs/collections/tutorial/retrievingbyindexkey.html index b4f731587..96731060e 100644 --- a/db/docs/collections/tutorial/retrievingbyindexkey.html +++ b/db/docs/collections/tutorial/retrievingbyindexkey.html @@ -97,28 +97,28 @@ public class Sample public void doWork() throws Exception { - printEntries("Parts", + printEntries("Parts", views.getPartEntrySet().iterator()); - printEntries("Suppliers", + printEntries("Suppliers", views.getSupplierEntrySet().iterator()); - printValues("Suppliers for City Paris", + printValues("Suppliers for City Paris", views.getSupplierByCityMap().duplicates( - "Paris").iterator()); - printEntries("Shipments", + "Paris").iterator()); + printEntries("Shipments", views.getShipmentEntrySet().iterator()); - printValues("Shipments for Part P1", + printValues("Shipments for Part P1", views.getShipmentByPartMap().duplicates( - new PartKey("P1")).iterator()); - printValues("Shipments for Supplier S1", + new PartKey("P1")).iterator()); + printValues("Shipments for Supplier S1", views.getShipmentBySupplierMap().duplicates( new - SupplierKey("S1")).iterator()); + SupplierKey("S1")).iterator()); } } private void printValues(String label, Iterator iterator) { - System.out.println("\n--- " + label + " ---"); + System.out.println("\n--- " + label + " ---"); try { while (iterator.hasNext()) diff --git a/db/docs/collections/tutorial/retrievingdatabaseitems.html b/db/docs/collections/tutorial/retrievingdatabaseitems.html index 4b07a0f8c..d73e93b72 100644 --- a/db/docs/collections/tutorial/retrievingdatabaseitems.html +++ b/db/docs/collections/tutorial/retrievingdatabaseitems.html @@ -51,8 +51,7 @@ Map.Entry objects for each store. All standard Java methods for retrieving - objects from a collection may be used with the Sleepycat Java Collections - API. + objects from a collection may be used with the Java Collections API.

    The PrintDatabase.doWork() method calls @@ -77,11 +76,11 @@ public class Sample public void doWork() throws Exception { - printEntries("Parts", + printEntries("Parts", views.getPartEntrySet().iterator()); - printEntries("Suppliers", + printEntries("Suppliers", views.getSupplierEntrySet().iterator()); - printEntries("Shipments", + printEntries("Shipments", views.getShipmentEntrySet().iterator()); } } @@ -116,7 +115,7 @@ public class Sample

        private void printEntries(String label, Iterator iterator)
         {
    -        System.out.println("\n--- " + label + " ---");
    +        System.out.println("\n--- " + label + " ---");
             try
             {
                 while (iterator.hasNext())
    diff --git a/db/docs/collections/tutorial/tutorialintroduction.html b/db/docs/collections/tutorial/tutorialintroduction.html
    index 6709e3961..39c1c349a 100644
    --- a/db/docs/collections/tutorial/tutorialintroduction.html
    +++ b/db/docs/collections/tutorial/tutorialintroduction.html
    @@ -8,7 +8,7 @@
         
         
         
    -    
    +    
         
       
       
    @@ -37,14 +37,13 @@
             

    - Most of the remainder of this document illustrates the use of the Sleepycat Java - Collections API by presenting a tutorial that describes usage of the API. + Most of the remainder of this document illustrates the use of the + Java Collections API by presenting a tutorial that describes usage of the API. This tutorial builds a shipment database, a familiar example from classic database texts.

    - The examples illustrate the following concepts of the Sleepycat Java - Collections API: + The examples illustrate the following concepts of the Java Collections API:

      @@ -178,7 +177,7 @@ be defined in the first example program.

      - In general the Sleepycat Java Collections API uses bindings to + In general the Java Collections API uses bindings to describe how Java objects are stored. A binding defines the stored data syntax and the mapping between a Java object and the stored data. The example programs show how to create different types of @@ -187,7 +186,9 @@

      The following tables show the record values that are used in all the example programs in the tutorial. + +

      @@ -393,7 +394,7 @@ - + diff --git a/db/docs/collections/tutorial/usingtransactions.html b/db/docs/collections/tutorial/usingtransactions.html index 311189c69..36c7a3594 100644 --- a/db/docs/collections/tutorial/usingtransactions.html +++ b/db/docs/collections/tutorial/usingtransactions.html @@ -46,7 +46,7 @@ DB transactional applications have standard transactional characteristics: recoverability, atomicity and integrity (this is sometimes also referred to generically as ACID - properties). The Sleepycat Java Collections API provides these + properties). The Java Collections API provides these transactional capabilities using a transaction-per-thread model. Once a transaction is begun, it is implicitly associated with the current thread until it is committed or aborted. This @@ -71,7 +71,7 @@

      - The Sleepycat Java Collections API provides two transaction APIs. The + The Java Collections API provides two transaction APIs. The lower-level API is the CurrentTransaction diff --git a/db/docs/gsg/C/BerkeleyDB-Core-C-GSG.pdf b/db/docs/gsg/C/BerkeleyDB-Core-C-GSG.pdf index 7bb4ed0f4..c6abf15f1 100644 Binary files a/db/docs/gsg/C/BerkeleyDB-Core-C-GSG.pdf and b/db/docs/gsg/C/BerkeleyDB-Core-C-GSG.pdf differ diff --git a/db/docs/gsg/C/CoreCursorUsage.html b/db/docs/gsg/C/CoreCursorUsage.html index 009f0ab58..e7263ef2e 100644 --- a/db/docs/gsg/C/CoreCursorUsage.html +++ b/db/docs/gsg/C/CoreCursorUsage.html @@ -46,9 +46,7 @@ can provide the item and show the vendor's contact information.

      - Specifically, the - example_database_read - + Specifically, the example_database_read application does the following:

      @@ -56,9 +54,7 @@
    • Opens the the inventory and vendor databases - that were created by our - example_database_load - + that were created by our example_database_load application. See example_database_load @@ -113,7 +109,7 @@

      /* File: example_database_read.c */
       /* gettingstarted_common.h includes db.h for us */
      -#include "gettingstarted_common.h"
      +#include "gettingstarted_common.h"
       
       /* Forward declarations */
       char * show_inventory_item(void *);
      @@ -153,9 +149,9 @@ main(int argc, char *argv[])
           set_db_filenames(&my_stock);
                                                                                                                                       
           /* Open all databases */
      -    ret = databases_setup(&my_stock, "example_database_read", stderr);
      +    ret = databases_setup(&my_stock, "example_database_read", stderr);
           if (ret != 0) {
      -        fprintf(stderr, "Error opening databases\n");
      +        fprintf(stderr, "Error opening databases\n");
               databases_close(&my_stock);
               return (ret);
           }
      @@ -262,12 +258,12 @@ show_inventory_item(void *vBuf)
           vendor_name = buf + buf_pos;
                                                                                                                                         
           /* Display all this information */
      -    printf("name: %s\n", name);
      -    printf("\tSKU: %s\n", sku);
      -    printf("\tCategory: %s\n", category);
      -    printf("\tPrice: %.2f\n", price);
      -    printf("\tQuantity: %i\n", quantity);
      -    printf("\tVendor:\n");
      +    printf("name: %s\n", name);
      +    printf("\tSKU: %s\n", sku);
      +    printf("\tCategory: %s\n", category);
      +    printf("\tPrice: %.2f\n", price);
      +    printf("\tQuantity: %i\n", quantity);
      +    printf("\tVendor:\n");
                                                                                                                                         
           /* Return the vendor's name */
           return(vendor_name);
      @@ -315,24 +311,24 @@ show_vendor_record(char *vendor_name, DB *vendor_dbp)
           /* Get the record */
           ret = vendor_dbp->get(vendor_dbp, 0, &key, &data, 0);
           if (ret != 0) {
      -        vendor_dbp->err(vendor_dbp, ret, "Error searching for vendor: '%s'",
      +        vendor_dbp->err(vendor_dbp, ret, "Error searching for vendor: '%s'",
                 vendor_name);
               return(ret);
           } else {
      -        printf("\t\t%s\n", my_vendor.name);
      -        printf("\t\t%s\n", my_vendor.street);
      -        printf("\t\t%s, %s\n", my_vendor.city, my_vendor.state);
      -        printf("\t\t%s\n\n", my_vendor.zipcode);
      -        printf("\t\t%s\n\n", my_vendor.phone_number);
      -        printf("\t\tContact: %s\n", my_vendor.sales_rep);
      -        printf("\t\t%s\n", my_vendor.sales_rep_phone);
      +        printf("\t\t%s\n", my_vendor.name);
      +        printf("\t\t%s\n", my_vendor.street);
      +        printf("\t\t%s, %s\n", my_vendor.city, my_vendor.state);
      +        printf("\t\t%s\n\n", my_vendor.zipcode);
      +        printf("\t\t%s\n\n", my_vendor.phone_number);
      +        printf("\t\tContact: %s\n", my_vendor.sales_rep);
      +        printf("\t\t%s\n", my_vendor.sales_rep_phone);
           }
           return(0);
       } 
    • That completes the implementation of - excxx_example_database_read(). In the next chapter, we + example_database_read(). In the next chapter, we will extend this application to make use of a secondary database so that we can query the inventory database for a specific inventory item.

      diff --git a/db/docs/gsg/C/CoreDBAdmin.html b/db/docs/gsg/C/CoreDBAdmin.html index bf34be035..65f102a61 100644 --- a/db/docs/gsg/C/CoreDBAdmin.html +++ b/db/docs/gsg/C/CoreDBAdmin.html @@ -85,7 +85,7 @@ DB *dbp; /* Database open and subsequent operations omitted for clarity */ dbp->remove(dbp, /* Database pointer */ - "mydb.db", /* Database file to remove */ + "mydb.db", /* Database file to remove */ NULL, /* Database to remove. This is * NULL so the entire file is * removed. */ @@ -113,11 +113,11 @@ DB *dbp; /* Database open and subsequent operations omitted for clarity */ dbp->rename(dbp, /* Database pointer */ - "mydb.db", /* Database file to rename */ + "mydb.db", /* Database file to rename */ NULL, /* Database to rename. This is * NULL so the entire file is * renamed. */ - "newdb.db", /* New database file name */ + "newdb.db", /* New database file name */ 0); /* Flags. None used. */ diff --git a/db/docs/gsg/C/CoreDbUsage.html b/db/docs/gsg/C/CoreDbUsage.html index 754fd02d9..729090baa 100644 --- a/db/docs/gsg/C/CoreDbUsage.html +++ b/db/docs/gsg/C/CoreDbUsage.html @@ -101,7 +101,7 @@ void set_db_filenames(STOCK_DBS *my_stock);

      /* File: gettingstarted_common.c */
      -#include "gettingstarted_common.h"
      +#include "gettingstarted_common.h"
       
       /* Initializes the STOCK_DBS struct.*/
       void
      @@ -124,13 +124,13 @@ set_db_filenames(STOCK_DBS *my_stock)
           /* Create the Inventory DB file name */
           size = strlen(my_stock->db_home_dir) + strlen(INVENTORYDB) + 1;
           my_stock->inventory_db_name = malloc(size);
      -    snprintf(my_stock->inventory_db_name, size, "%s%s",
      +    snprintf(my_stock->inventory_db_name, size, "%s%s",
             my_stock->db_home_dir, INVENTORYDB);
       
           /* Create the Vendor DB file name */
           size = strlen(my_stock->db_home_dir) + strlen(VENDORDB) + 1;
           my_stock->vendor_db_name = malloc(size);
      -    snprintf(my_stock->vendor_db_name, size, "%s%s",
      +    snprintf(my_stock->vendor_db_name, size, "%s%s",
             my_stock->db_home_dir, VENDORDB);
       } 
      @@ -163,7 +163,7 @@ open_database(DB **dbpp, /* The DB handle that we are opening */ /* Initialize the DB handle */ ret = db_create(&dbp, NULL, 0); if (ret != 0) { - fprintf(error_file_pointer, "%s: %s\n", program_name, + fprintf(error_file_pointer, "%s: %s\n", program_name, db_strerror(ret)); return(ret); } @@ -187,7 +187,7 @@ open_database(DB **dbpp, /* The DB handle that we are opening */ open_flags, /* Open flags */ 0); /* File mode. Using defaults */ if (ret != 0) { - dbp->err(dbp, ret, "Database '%s' open failed.", file_name); + dbp->err(dbp, ret, "Database '%s' open failed.", file_name); return(ret); } @@ -234,7 +234,7 @@ databases_setup(STOCK_DBS *my_stock, const char *program_name, */ return (ret); - printf("databases opened successfully\n"); + printf("databases opened successfully\n"); return (0); } @@ -260,18 +260,18 @@ databases_close(STOCK_DBS *my_stock) if (my_stock->inventory_dbp != NULL) { ret = my_stock->inventory_dbp->close(my_stock->inventory_dbp, 0); if (ret != 0) - fprintf(stderr, "Inventory database close failed: %s\n", + fprintf(stderr, "Inventory database close failed: %s\n", db_strerror(ret)); } if (my_stock->vendor_dbp != NULL) { ret = my_stock->vendor_dbp->close(my_stock->vendor_dbp, 0); if (ret != 0) - fprintf(stderr, "Vendor database close failed: %s\n", + fprintf(stderr, "Vendor database close failed: %s\n", db_strerror(ret)); } - printf("databases closed.\n"); + printf("databases closed.\n"); return (0); } diff --git a/db/docs/gsg/C/CoreEnvUsage.html b/db/docs/gsg/C/CoreEnvUsage.html index 20a1ae32b..07a411400 100644 --- a/db/docs/gsg/C/CoreEnvUsage.html +++ b/db/docs/gsg/C/CoreEnvUsage.html @@ -49,6 +49,9 @@ which it resides. This directory must exist prior to the open attempt. You can also identify open properties, such as whether the environment can be created if it does not already exist. +

      +

      + You will also need to initialize the in-memory cache when you open your environment.

      For example, to @@ -70,20 +73,21 @@ int ret; /* function return value */ */ ret = db_env_create(&myEnv, 0); if (ret != 0) { - fprintf(stderr, "Error creating env handle: %s\n", db_strerror(ret)); + fprintf(stderr, "Error creating env handle: %s\n", db_strerror(ret)); return -1; } /* Open the environment. */ -env_flags = DB_CREATE; /* If the environment does not exist, - * create it. */ +env_flags = DB_CREATE | /* If the environment does not exist, + * create it. */ + DB_INIT_MPOOL; /* Initialize the in-memory cache. */ ret = myEnv->open(myEnv, /* DB_ENV ptr */ - "/export1/testEnv", /* env home directory */ + "/export1/testEnv", /* env home directory */ env_flags, /* Open flags */ 0); /* File mode (default) */ if (ret != 0) { - fprintf(stderr, "Environment open failed: %s", db_strerror(ret)); + fprintf(stderr, "Environment open failed: %s", db_strerror(ret)); return -1; }

      @@ -108,7 +112,7 @@ db_flags = DB_CREATE; /* If the database does not exist, /* open the database */ ret = dbp->open(dbp, /* DB structure pointer */ NULL, /* Transaction pointer */ - "my_db.db", /* On-disk file that holds the database. */ + "my_db.db", /* On-disk file that holds the database. */ NULL, /* Optional logical database name */ DB_BTREE, /* Database access method */ db_flags, /* Open flags */ diff --git a/db/docs/gsg/C/DB.html b/db/docs/gsg/C/DB.html index 4c56004b5..08b5724a0 100644 --- a/db/docs/gsg/C/DB.html +++ b/db/docs/gsg/C/DB.html @@ -77,8 +77,7 @@

      In Berkeley DB, a database is a collection of records. Records, - in turn, consist of two parts: key and data. That is, records consist of - key/data pairings. + in turn, consist of key/data pairings.

      Conceptually, you can think of a @@ -159,7 +158,7 @@ flags = DB_CREATE; /* If the database does not exist, /* open the database */ ret = dbp->open(dbp, /* DB structure pointer */ NULL, /* Transaction pointer */ - "my_db.db", /* On-disk file that holds the database. */ + "my_db.db", /* On-disk file that holds the database. */ NULL, /* Optional logical database name */ DB_BTREE, /* Database access method */ flags, /* Open flags */ diff --git a/db/docs/gsg/C/DBEntry.html b/db/docs/gsg/C/DBEntry.html index 3adf78171..321148040 100644 --- a/db/docs/gsg/C/DBEntry.html +++ b/db/docs/gsg/C/DBEntry.html @@ -153,7 +153,7 @@ DBT key, data; float money = 122.45; -char *description = "Grocery bill."; +char *description = "Grocery bill."; /* Zero out the DBTs before using them. */ memset(&key, 0, sizeof(DBT)); @@ -174,9 +174,7 @@ data.size = strlen(description) + 1; Note that in the following example we do not allow DB to assign the memory for the retrieval of the money value. The reason why is that some systems may require float values to have a specific alignment, and the - memory as returned by - DB - + memory as returned by DB may not be properly aligned (the same problem may exist for structures on some systems). We tell DB to use our memory instead of its own by specifying the DB_DBT_USERMEM flag. Be aware that diff --git a/db/docs/gsg/C/DBOpenFlags.html b/db/docs/gsg/C/DBOpenFlags.html index 20d6ee251..fccbb1831 100644 --- a/db/docs/gsg/C/DBOpenFlags.html +++ b/db/docs/gsg/C/DBOpenFlags.html @@ -39,7 +39,7 @@ Note that this list is not exhaustive — it includes only those flags likely to be of interest for introductory, single-threaded database applications. For a complete list of the flags available to you, see the - Berkeley DB C API Reference Guide. + Berkeley DB C API guide.

      diff --git a/db/docs/gsg/C/DbUsage.html b/db/docs/gsg/C/DbUsage.html index b2e81244c..a1d35b612 100644 --- a/db/docs/gsg/C/DbUsage.html +++ b/db/docs/gsg/C/DbUsage.html @@ -73,7 +73,7 @@

      Note that for the inventory data, we will store the data by - marshalling it into a buffer, described below. + marshaling it into a buffer, described below.

      /* File: gettingstarted_common.h */
      @@ -113,7 +113,7 @@
           

      /* example_database_load.c */
      -#include "gettingstarted_common.h"
      +#include "gettingstarted_common.h"
                                                                                                                                       
                                                                                                                                       
       /* Forward declarations */
      @@ -145,7 +145,7 @@ main(int argc, char *argv[])
           * identify the location of the flat-text data
           * input files.
           */
      -    basename = "./";
      +    basename = "./";
       
           /* 
            * Parse the command line arguments here and determine 
      @@ -164,29 +164,29 @@ main(int argc, char *argv[])
           /* Find our input files */
           size = strlen(basename) + strlen(INVENTORY_FILE) + 1;
           inventory_file = malloc(size);
      -    snprintf(inventory_file, size, "%s%s", basename, INVENTORY_FILE);
      +    snprintf(inventory_file, size, "%s%s", basename, INVENTORY_FILE);
                                                                                                                                       
           size = strlen(basename) + strlen(VENDORS_FILE) + 1;
           vendor_file = malloc(size);
      -    snprintf(vendor_file, size, "%s%s", basename, VENDORS_FILE);
      +    snprintf(vendor_file, size, "%s%s", basename, VENDORS_FILE);
                                                                                                                                       
           /* Open all databases */
      -    ret = databases_setup(&my_stock, "example_database_load", stderr);
      +    ret = databases_setup(&my_stock, "example_database_load", stderr);
           if (ret != 0) {
      -            fprintf(stderr, "Error opening databases\n");
      +            fprintf(stderr, "Error opening databases\n");
                   databases_close(&my_stock);
                   return (ret);
           }
                                                                                                                                       
           ret = load_vendors_database(my_stock, vendor_file);
           if (!ret) {
      -        fprintf(stderr, "Error loading vendors database.\n");
      +        fprintf(stderr, "Error loading vendors database.\n");
               databases_close(&my_stock);
               return (ret);
           }
           ret = load_inventory_database(my_stock, inventory_file);
           if (!ret) {
      -        fprintf(stderr, "Error loading inventory database.\n");
      +        fprintf(stderr, "Error loading inventory database.\n");
               databases_close(&my_stock);
               return (ret);
           }
      @@ -194,7 +194,7 @@ main(int argc, char *argv[])
           /* close our environment and databases */
           databases_close(&my_stock);
                                                                                                                                       
      -    printf("Done loading databases.\n");
      +    printf("Done loading databases.\n");
           return (0);
       }

      @@ -233,9 +233,9 @@ load_vendors_database(STOCK_DBS my_stock, char *vendor_file) char buf[MAXLINE]; /* Open the vendor file for read access */ - ifp = fopen(vendor_file, "r"); + ifp = fopen(vendor_file, "r"); if (ifp == NULL) { - fprintf(stderr, "Error opening file '%s'\n", vendor_file); + fprintf(stderr, "Error opening file '%s'\n", vendor_file); return(-1); } @@ -254,7 +254,7 @@ load_vendors_database(STOCK_DBS my_stock, char *vendor_file) * defensive code here. */ sscanf(buf, - "%20[^#]#%20[^#]#%20[^#]#%3[^#]#%6[^#]#%13[^#]#%20[^#]#%20[^\n]", + "%20[^#]#%20[^#]#%20[^#]#%3[^#]#%6[^#]#%13[^#]#%20[^#]#%20[^\n]", my_vendor.name, my_vendor.street, my_vendor.city, my_vendor.state, my_vendor.zipcode, my_vendor.phone_number, @@ -362,9 +362,9 @@ load_inventory_database(STOCK_DBS my_stock, char *inventory_file) char vendor[MAXFIELD], sku[MAXFIELD]; /* Load the inventory database */ - ifp = fopen(inventory_file, "r"); + ifp = fopen(inventory_file, "r"); if (ifp == NULL) { - fprintf(stderr, "Error opening file '%s'\n", inventory_file); + fprintf(stderr, "Error opening file '%s'\n", inventory_file); return(-1); } @@ -382,7 +382,7 @@ load_inventory_database(STOCK_DBS my_stock, char *inventory_file) * program, there would be a lot more defensive code here. */ sscanf(buf, - "%20[^#]#%20[^#]#%f#%i#%20[^#]#%20[^\n]", + "%20[^#]#%20[^#]#%f#%i#%20[^#]#%20[^\n]", name, sku, &price, &quantity, category, vendor); /* diff --git a/db/docs/gsg/C/DeleteEntryWCursor.html b/db/docs/gsg/C/DeleteEntryWCursor.html index 9e58c5c79..c3e8a68cb 100644 --- a/db/docs/gsg/C/DeleteEntryWCursor.html +++ b/db/docs/gsg/C/DeleteEntryWCursor.html @@ -57,7 +57,7 @@ DB *dbp; DBC *cursorp; DBT key, data; -char *key1str = "My first string"; +char *key1str = "My first string"; int ret; /* Set up our DBTs */ diff --git a/db/docs/gsg/C/Positioning.html b/db/docs/gsg/C/Positioning.html index d97eb32f7..f0d88fb44 100644 --- a/db/docs/gsg/C/Positioning.html +++ b/db/docs/gsg/C/Positioning.html @@ -203,7 +203,9 @@ if (my_database != NULL) that you provide for the database. If no comparison function - is provided, then the default lexicographical sorting is used. + is provided, then the default + + lexicographical sorting is used.

      For example, suppose you have database records that use the @@ -240,8 +242,9 @@ Arizona

      DB_GET_BOTH_RANGE

      - Moves the cursor to the first record in the database whose key is - greater than or equal to the specified key. If the database supports + Moves the cursor to the first record in the database whose key matches the specified + key and whose data is + greater than or equal to the specified data. If the database supports duplicate records, then on matching the key, the cursor is moved to the duplicate record with the smallest data that is greater than or equal to the specified data. @@ -276,24 +279,19 @@ Arizona/Florence

      - - - + + + - + - - - - - - - - + + +
       Next
      Developing a Sleepycat Collections Application Developing a DB Collections Application  Home
      AlFlAlabama/FlorenceAlaskaFaAlaska/Fairbanks
      ArArizona Fl Arizona/Florence
      AlFaAlaska/Fairbanks
      AlAAlabama/AthensAlaskaAnAlaska/Anchorage
      @@ -320,8 +318,8 @@ DBC *cursorp; DBT key, data; DB *dbp; int ret; -char *search_data = "Fa"; -char *search_key = "Al"; +char *search_data = "Fa"; +char *search_key = "Alaska"; /* database open omitted for clarity */ @@ -336,7 +334,8 @@ data.size = strlen(search_data) + 1; /* * Position the cursor to the first record in the database whose - * key and data begin with the correct strings. + * key matches the search key and whose data begins with the + * search data. */ ret = cursorp->c_get(cursorp, &key, &data, DB_GET_BOTH_RANGE); if (!ret) { @@ -521,7 +520,7 @@ DB *dbp; DBC *cursorp; DBT key, data; int ret; -char *search_key = "Al"; +char *search_key = "Al"; /* database open omitted for clarity */ @@ -538,7 +537,7 @@ key.size = strlen(search_key) + 1; */ ret = cursorp->c_get(cursorp, &key, &data, DB_SET); while (ret != DB_NOTFOUND) { - printf("key: %s, data: %s\n", (char *)key.data, (char *)data.data); + printf("key: %s, data: %s\n", (char *)key.data, (char *)data.data); ret = cursorp->c_get(cursorp, &key, &data, DB_NEXT_DUP); } diff --git a/db/docs/gsg/C/PutEntryWCursor.html b/db/docs/gsg/C/PutEntryWCursor.html index 367b58b15..c3c12e812 100644 --- a/db/docs/gsg/C/PutEntryWCursor.html +++ b/db/docs/gsg/C/PutEntryWCursor.html @@ -42,10 +42,7 @@

      Note that when putting records to the database using a cursor, the - cursor is positioned at the record you inserted. Also, you can not - transactionally protect a put that is performed using a cursor; - if you want to transactionall protect your database writes, - put recrods using the database handle directly. + cursor is positioned at the record you inserted.

      You use @@ -143,11 +140,11 @@ DB *dbp; DBC *cursorp; DBT data1, data2, data3; DBT key1, key2; -char *key1str = "My first string"; -char *data1str = "My first data"; -char *key2str = "A second string"; -char *data2str = "My second data"; -char *data3str = "My third data"; +char *key1str = "My first string"; +char *data1str = "My first data"; +char *key2str = "A second string"; +char *data2str = "My second data"; +char *data3str = "My third data"; int ret; /* Set up our DBTs */ @@ -170,14 +167,14 @@ dbp->cursor(dbp, NULL, &cursorp, 0); /* * Assuming an empty database, this first put places - * "My first string"/"My first data" in the first + * "My first string"/"My first data" in the first * position in the database */ ret = cursorp->c_put(cursorp, &key1, &data1, DB_KEYFIRST); /* - * This put places "A second string"/"My second data" in the + * This put places "A second string"/"My second data" in the * the database according to its key sorts against the key * used for the currently existing database record. Most likely * this record would appear first in the database. @@ -187,12 +184,12 @@ ret = cursorp->c_put(cursorp, &key2, /* * If duplicates are not allowed, the currently existing record that - * uses "key2" is overwritten with the data provided on this put. - * That is, the record "A second string"/"My second data" becomes - * "A second string"/"My third data" + * uses "key2" is overwritten with the data provided on this put. + * That is, the record "A second string"/"My second data" becomes + * "A second string"/"My third data" * - * If duplicates are allowed, then "My third data" is placed in the - * duplicates list according to how it sorts against "My second data". + * If duplicates are allowed, then "My third data" is placed in the + * duplicates list according to how it sorts against "My second data". */ ret = cursorp->c_put(cursorp, &key2, &data3, DB_KEYFIRST); /* If duplicates are not allowed, record diff --git a/db/docs/gsg/C/ReplacingEntryWCursor.html b/db/docs/gsg/C/ReplacingEntryWCursor.html index a1b89224f..52a1c2984 100644 --- a/db/docs/gsg/C/ReplacingEntryWCursor.html +++ b/db/docs/gsg/C/ReplacingEntryWCursor.html @@ -56,10 +56,14 @@ DB *dbp; DBC *cursorp; DBT key, data; -char *key1str = "My first string"; -char *replacement_data = "replace me"; +char *key1str = "My first string"; +char *replacement_data = "replace me"; int ret; +/* Initialize our DBTs. */ +memset(&key, 0, sizeof(DBT)); +memset(&data, 0, sizeof(DBT)); + /* Set up our DBTs */ key.data = key1str; key.size = strlen(key1str) + 1; @@ -69,10 +73,6 @@ key.size = strlen(key1str) + 1; /* Get the cursor */ dbp->cursor(dbp, NULL, &cursorp, 0); -/* Initialize our DBTs. */ -memset(&key, 0, sizeof(DBT)); -memset(&data, 0, sizeof(DBT)); - /* Position the cursor */ ret = cursorp->c_get(cursorp, &key, &data, DB_SET); if (ret == 0) { diff --git a/db/docs/gsg/C/accessmethods.html b/db/docs/gsg/C/accessmethods.html index 02469bb95..dcbd74844 100644 --- a/db/docs/gsg/C/accessmethods.html +++ b/db/docs/gsg/C/accessmethods.html @@ -141,7 +141,7 @@

      Once you have made this decision, you must choose between either - BTree or Queue, or Hash or Recno. This decision is described next. + BTree or Hash, or Queue or Recno. This decision is described next.

      diff --git a/db/docs/gsg/C/btree.html b/db/docs/gsg/C/btree.html index eabed1e6c..27de59365 100644 --- a/db/docs/gsg/C/btree.html +++ b/db/docs/gsg/C/btree.html @@ -329,15 +329,15 @@ DB *dbp; FILE *error_file_pointer; int ret; -char *program_name = "my_prog"; -char *file_name = "mydb.db"; +char *program_name = "my_prog"; +char *file_name = "mydb.db"; /* Variable assignments omitted for brevity */ /* Initialize the DB handle */ ret = db_create(&dbp, NULL, 0); if (ret != 0) { - fprintf(error_file_pointer, "%s: %s\n", program_name, + fprintf(error_file_pointer, "%s: %s\n", program_name, db_strerror(ret)); return(ret); } @@ -351,7 +351,7 @@ dbp->set_errpfx(dbp, program_name); */ ret = dbp->set_flags(dbp, DB_DUPSORT); if (ret != 0) { - dbp->err(dbp, ret, "Attempt to set DUPSORT flag failed."); + dbp->err(dbp, ret, "Attempt to set DUPSORT flag failed."); dbp->close(dbp, 0); return(ret); } @@ -365,7 +365,7 @@ ret = dbp->open(dbp, /* Pointer to the database */ DB_CREATE, /* Open flags */ 0); /* File mode. Using defaults */ if (ret != 0) { - dbp->err(dbp, ret, "Database '%s' open failed.", file_name); + dbp->err(dbp, ret, "Database '%s' open failed.", file_name); dbp->close(dbp, 0); return(ret); }
    @@ -414,7 +414,7 @@ if (ret != 0) { do not sort well when viewed as byte strings. There are several solutions to this problem, one being to provide a custom comparison function. See - http://www.sleepycat.com/docs/ref/am_misc/faq.html + http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_misc/faq.html for more information.

    @@ -537,7 +537,7 @@ int ret; /* Create a database */ ret = db_create(&dbp, NULL, 0); if (ret != 0) { - fprintf(stderr, "%s: %s\n", "my_program", + fprintf(stderr, "%s: %s\n", "my_program", db_strerror(ret)); return(-1); } diff --git a/db/docs/gsg/C/concepts.html b/db/docs/gsg/C/concepts.html index 8404051db..161e6a25b 100644 --- a/db/docs/gsg/C/concepts.html +++ b/db/docs/gsg/C/concepts.html @@ -42,7 +42,7 @@ Conceptually, DB databases contain records. Logically each record represents a single entry in the database. Each such record contains two pieces of information: a key and a data. - This manual will on occaison describe a a record's + This manual will on occasion describe a a record's key or a record's data when it is necessary to speak to one or the other portion of a database record. diff --git a/db/docs/gsg/C/coreindexusage.html b/db/docs/gsg/C/coreindexusage.html index ae95233a2..fd59043e2 100644 --- a/db/docs/gsg/C/coreindexusage.html +++ b/db/docs/gsg/C/coreindexusage.html @@ -47,10 +47,7 @@ Database Usage Example we built an application that can open and load data into several databases. - In Secondary Databases with - example_database_load - - we will extend + In Secondary Databases with example_database_load we will extend that application to also open a secondary database for the purpose of indexing inventory item names.

    @@ -60,14 +57,10 @@ In Cursor Example we built an application to display our inventory database (and related vendor information). In - Secondary Databases with - example_database_read - - + Secondary Databases with example_database_read we will extend that application to show inventory records based on the index we cause to be loaded using - example_database_load. - + example_database_load.

    @@ -76,22 +69,15 @@
    -

    Secondary Databases with - example_database_load - -

    +

    Secondary Databases with example_database_load

    - example_database_load - - uses several utility + example_database_load uses several utility functions to open and close its databases. In order to cause - example_database_load - - to maintain an index of + example_database_load to maintain an index of inventory item names, all we really need to do is update the utility functions to:

    @@ -121,9 +107,7 @@

    Because DB maintains secondary databases for us; once this work - is done we need not make any other changes to - example_database_load. - + is done we need not make any other changes to example_database_load. Therefore, we can limit all our work to the code found in gettingstarted_common.h @@ -191,7 +175,7 @@ void set_db_filenames(STOCK_DBS *my_stock);

    /* file: gettingstarted_common.c */
    -#include "gettingstarted_common.h"
    +#include "gettingstarted_common.h"
                                                                                                                                       
     /*
      * Used to extract an inventory item's name from an
    @@ -262,19 +246,19 @@ set_db_filenames(STOCK_DBS *my_stock)
         /* Create the Inventory DB file name */
         size = strlen(my_stock->db_home_dir) + strlen(INVENTORYDB) + 1;
         my_stock->inventory_db_name = malloc(size);
    -    snprintf(my_stock->inventory_db_name, size, "%s%s",
    +    snprintf(my_stock->inventory_db_name, size, "%s%s",
           my_stock->db_home_dir, INVENTORYDB);
         
         /* Create the Vendor DB file name */
         size = strlen(my_stock->db_home_dir) + strlen(VENDORDB) + 1;
         my_stock->vendor_db_name = malloc(size);
    -    snprintf(my_stock->vendor_db_name, size, "%s%s",
    +    snprintf(my_stock->vendor_db_name, size, "%s%s",
           my_stock->db_home_dir, VENDORDB);
     
         /* Create the itemname DB file name */
         size = strlen(my_stock->db_home_dir) + strlen(ITEMNAMEDB) + 1;
         my_stock->itemname_db_name = malloc(size);
    -    snprintf(my_stock->itemname_db_name, size, "%s%s",
    +    snprintf(my_stock->itemname_db_name, size, "%s%s",
           my_stock->db_home_dir, ITEMNAMEDB);
     } 

    @@ -314,7 +298,7 @@ open_database(DB **dbpp, /* The DB handle that we are opening */ /* Initialize the DB handle */ ret = db_create(&dbp, NULL, 0); if (ret != 0) { - fprintf(error_file_pointer, "%s: %s\n", program_name, + fprintf(error_file_pointer, "%s: %s\n", program_name, db_strerror(ret)); return (ret); } @@ -333,7 +317,7 @@ open_database(DB **dbpp, /* The DB handle that we are opening */ if (is_secondary) { ret = dbp->set_flags(dbp, DB_DUPSORT); if (ret != 0) { - dbp->err(dbp, ret, "Attempt to set DUPSORT flag failed.", + dbp->err(dbp, ret, "Attempt to set DUPSORT flag failed.", file_name); return (ret); } @@ -351,7 +335,7 @@ open_database(DB **dbpp, /* The DB handle that we are opening */ open_flags, /* Open flags */ 0); /* File mode. Using defaults */ if (ret != 0) { - dbp->err(dbp, ret, "Database '%s' open failed.", file_name); + dbp->err(dbp, ret, "Database '%s' open failed.", file_name); return (ret); } @@ -432,7 +416,7 @@ databases_setup(STOCK_DBS *my_stock, const char *program_name, 0); /* Flags */ - printf("databases opened successfully\n"); + printf("databases opened successfully\n"); return (0); }

    @@ -457,25 +441,25 @@ databases_close(STOCK_DBS *my_stock) if (my_stock->itemname_sdbp != NULL) { ret = my_stock->itemname_sdbp->close(my_stock->itemname_sdbp, 0); if (ret != 0) - fprintf(stderr, "Itemname database close failed: %s\n", + fprintf(stderr, "Itemname database close failed: %s\n", db_strerror(ret)); } if (my_stock->inventory_dbp != NULL) { ret = my_stock->inventory_dbp->close(my_stock->inventory_dbp, 0); if (ret != 0) - fprintf(stderr, "Inventory database close failed: %s\n", + fprintf(stderr, "Inventory database close failed: %s\n", db_strerror(ret)); } if (my_stock->vendor_dbp != NULL) { ret = my_stock->vendor_dbp->close(my_stock->vendor_dbp, 0); if (ret != 0) - fprintf(stderr, "Vendor database close failed: %s\n", + fprintf(stderr, "Vendor database close failed: %s\n", db_strerror(ret)); } - printf("databases closed.\n"); + printf("databases closed.\n"); return (0); }

    @@ -484,9 +468,7 @@ databases_close(STOCK_DBS *my_stock) code actually changes:

    - That completes our update to - example_database_load. - + That completes our update to example_database_load. Now when this program is called, it will automatically index inventory items based on their names. We can then query for those items using the new index. We show how to do that in the next section. @@ -496,10 +478,7 @@ databases_close(STOCK_DBS *my_stock)

    -

    Secondary Databases with - example_database_read - -

    +

    Secondary Databases with example_database_read

    @@ -510,18 +489,15 @@ databases_close(STOCK_DBS *my_stock) Inventory database. In this section, we will update that example to allow us to search for and display an inventory item given a specific name. To do this, we will make use of the secondary - database that - example_database_load - - now creates. + database that example_database_load now + creates.

    Because we manage all our database open and close activities in databases_setup() and databases_close(), - the update to - example_database_read - is relatively modest. We need only add a command line parameter on + the update to example_database_read is + relatively modest. We need only add a command line parameter on which we can specify the item name, and we will need a new function in which we will perform the query and display the results.

    @@ -532,7 +508,7 @@ databases_close(STOCK_DBS *my_stock)
    /* File: example_database_read.c */
     /* gettingstarted_common.h includes db.h for us */
    -#include "gettingstarted_common.h"
    +#include "gettingstarted_common.h"
                                                                                                                                       
     /* Forward declarations */
     char * show_inventory_item(void *);
    @@ -581,9 +557,9 @@ main(int argc, char *argv[])
         set_db_filenames(&my_stock);
                                                                                                                                              
         /* Open all databases */
    -    ret = databases_setup(&my_stock, "example_database_read", stderr);
    +    ret = databases_setup(&my_stock, "example_database_read", stderr);
         if (ret != 0) {
    -        fprintf(stderr, "Error opening databases\n");
    +        fprintf(stderr, "Error opening databases\n");
             databases_close(&my_stock);
             return (ret);
         }
    @@ -685,7 +661,7 @@ show_records(STOCK_DBS *my_stock, char *itemname) } while(itemname_cursorp->c_get(itemname_cursorp, &key, &data, DB_NEXT_DUP) == 0); } else { - printf("No records found for '%s'\n", itemname); + printf("No records found for '%s'\n", itemname); } /* Close the cursor */ @@ -695,14 +671,11 @@ show_records(STOCK_DBS *my_stock, char *itemname) }

    This completes our update to - example_database_read. - - - Using this update, you + example_inventory_read. Using this update, you can now search for and show all inventory items that match a particular name. For example:

    -
        example_database_read -i "Zulu Nut"
    +
        example_inventory_read -i "Zulu Nut"
    diff --git a/db/docs/gsg/C/environments.html b/db/docs/gsg/C/environments.html index 7223b5047..4fc6267d8 100644 --- a/db/docs/gsg/C/environments.html +++ b/db/docs/gsg/C/environments.html @@ -45,7 +45,7 @@

    While environments are frequently not used by applications running in embedded environments where every byte counts, they will be used by - virutally any other DB application requiring anything other than + virtually any other DB application requiring anything other than the bare minimum functionality. An environment is essentially an encapsulation of one or more databases. Essentially, you open an environment and then you open databases in that environment. @@ -64,7 +64,7 @@

    It is possible in DB to contain multiple databases in a - single physical file on disk. This is desireable for those + single physical file on disk. This is desirable for those application that open more than a few handful of databases. However, in order to have more than one database contained in a single physical file, your application @@ -116,15 +116,16 @@ obtain a high-degree of recoverability in the face of an application or system crash. Once enabled, the logging subsystem allows the application to perform two kinds of recovery - ("normal" and "catastrophic") through the use of the information + ("normal" and "catastrophic") through the use of the information contained in the log files.

    - All of these topics are described in the Berkeley DB - Programmer's Reference Guide. + For more information on these topics, see the + Berkeley DB Getting Started with Transaction Processing guide and the + Berkeley DB Getting Started with Replicated Applications guide.

    - You can obtain DB by visiting the Sleepycat download page: - http://www.sleepycat.com/download/index.shtml. + You can obtain DB by visiting the Berkeley DB download page: + http://www.oracle.com/technology/software/products/berkeley-db/db/index.html.

    To install DB, untar or unzip the distribution to the directory of @@ -49,9 +49,9 @@

    That page also contains links to more documentation for DB. In - particular, you will find links for the Berkeley DB - Programmer's Tutorial and Reference Guide as - well as the API reference documentation. + particular, you will find links for the + Berkeley DB Programmer's Reference Guide + as well as the API reference documentation.

    If you have two or more secondary databases associated with a primary - database, then you can retrieve primary records based on the union of + database, then you can retrieve primary records based on the intersection of multiple secondary entries. You do this using a join cursor. @@ -56,7 +56,7 @@ is fairly simple with a limited number of data members, few of which would be interesting from a query perspective. But suppose, instead, that we were storing - information on something with many more queryable characteristics, such + information on something with many more characteristics that can be queried, such as an automobile. In that case, you may be storing information such as color, number of doors, fuel mileage, automobile type, number of passengers, make, model, and year, to name just a few. @@ -141,7 +141,8 @@

  • Create an array of cursors, and place in it each - of the cursors that are participating in your join query. + of the cursors that are participating in your join query. Note that this array must be null + terminated.

  • @@ -191,13 +192,13 @@ DB *automotiveColorDB; DB *automotiveMakeDB; DB *automotiveTypeDB; DBC *color_curs, *make_curs, *type_curs, *join_curs; -DBC *carray[3]; +DBC *carray[4]; DBT key, data; int ret; -char *the_color = "red"; -char *the_type = "minivan"; -char *the_make = "Toyota"; +char *the_color = "red"; +char *the_type = "minivan"; +char *the_make = "Toyota"; /* Database and secondary database opens omitted for brevity. * Assume a primary database handle: @@ -256,6 +257,7 @@ if ((ret = type_curs->c_get(type_curs, &key, &data, DB_SET)) != 0) carray[0] = color_curs; carray[1] = make_curs; carray[2] = type_curs; +carray[3] = NULL; /* Create the join */ if ((ret = automotiveDB->join(automotiveDB, carray, &join_curs, 0)) != 0) diff --git a/db/docs/gsg/C/preface.html b/db/docs/gsg/C/preface.html index d83f0f9a1..1b74e4636 100644 --- a/db/docs/gsg/C/preface.html +++ b/db/docs/gsg/C/preface.html @@ -44,20 +44,29 @@ Conventions Used in this Book +
    +
    +
    + + For More Information + +
    +
    +

    Welcome to Berkeley DB (DB). This document introduces - DB, version 4.3. + DB, version 4.5. It is intended to provide a rapid introduction to the DB API set and related concepts. The goal of this document is to provide you with an efficient mechanism with which you can evaluate DB against your project's technical requirements. As such, this document is intended for C developers and senior software architects who are - looking for an in-process data management solution. No prior experience with Sleepycat technologies is - expected or required. + looking for an in-process data management solution. No prior + experience with Berkeley DB is expected or required.

    @@ -73,12 +82,12 @@

    Structure names are represented in monospaced font, as are method - names. For example: "DB->open() is a method - on a DB handle." + names. For example: "DB->open() is a method + on a DB handle."

    - Variable or non-literal text is presented in italics. For example: "Go to your - DB_INSTALL directory." + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALL directory."

    Program examples are displayed in a monospaced font on a shaded background. @@ -113,6 +122,61 @@ typedef struct stock_dbs { as this.

    +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + DB application: +

    + +
    @@ -206,7 +206,7 @@ if (ret == DB_KEYEXIST) { DBT key, data; DB *my_database; float money; -char *description; +char *description[DESCRIPTION_SIZE + 1]; /* Database open omitted for clarity */ @@ -216,20 +216,17 @@ money = 122.45; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); -/* - * Use our own memory to retrieve the float. - * For data alignment purposes. - */ key.data = &money; key.ulen = sizeof(float); -key.flags = DB_DBT_USERMEM; +data.set_data(&description); +data.set_ulen(DESCRIPTION_SIZE + 1); +data.set_flags(DB_DBT_USERMEM); my_database->get(my_database, NULL, &key, &data, 0); /* - * Money is set into the memory that we supplied. - */ -description = data.data; + * Description is set into the memory that we supplied. + */

    Note that in this example, the data.size @@ -296,7 +293,7 @@ my_database->del(my_database, NULL, &key, 0);

    When you perform a database modification, your modification is made in the in-memory cache. This means that your data modifications - are not necessarily written to disk, and so your data may not appear + are not necessarily flushed to disk, and so your data may not appear in the database after an application restart.

    @@ -308,17 +305,19 @@ my_database->del(my_database, NULL, &key, 0); experience database corruption.

    - Therefore, if you care about whether your data persists across - application runs, and to guard against the rare possibility of + Therefore, if you care if your data is durable across system + failures, and to guard against the rare possibility of database corruption, you should use transactions to protect your database modifications. Every time you commit a transaction, DB ensures that the data will not be lost due to application or - system failure. - - - For information on transactions, see the Berkeley DB - Programmer's Tutorial and Reference Guide. - + system failure. Transaction usage is described in the + + + + + + Berkeley DB Getting Started with Transaction Processing guide. +

    If you do not want to use transactions, then the assumption is that @@ -334,7 +333,8 @@ my_database->del(my_database, NULL, &key, 0); call DB->sync(). - Syncs cause the entire contents of your in-memory cache to be written to disk. As + Syncs cause any dirty entries in the in-memory cache and the + operating system's file cache to be written to disk. As such, they are quite expensive and you should use them sparingly.

    diff --git a/db/docs/gsg/CXX/BerkeleyDB-Core-Cxx-GSG.pdf b/db/docs/gsg/CXX/BerkeleyDB-Core-Cxx-GSG.pdf index c01f86255..4c140dd09 100644 Binary files a/db/docs/gsg/CXX/BerkeleyDB-Core-Cxx-GSG.pdf and b/db/docs/gsg/CXX/BerkeleyDB-Core-Cxx-GSG.pdf differ diff --git a/db/docs/gsg/CXX/CoreCursorUsage.html b/db/docs/gsg/CXX/CoreCursorUsage.html index fa406ab07..4795904e1 100644 --- a/db/docs/gsg/CXX/CoreCursorUsage.html +++ b/db/docs/gsg/CXX/CoreCursorUsage.html @@ -46,9 +46,7 @@ can provide the item and show the vendor's contact information.

    - Specifically, the - - excxx_example_database_read + Specifically, the example_database_read application does the following:

    @@ -56,12 +54,10 @@
  • Opens the the inventory and vendor databases - that were created by our - - excxx_example_database_load + that were created by our example_database_load application. See - excxx_example_database_load + example_database_load for information on how that application creates the databases and writes data to them.

    @@ -104,7 +100,7 @@

    - Example 4.1 excxx_example_database_read + Example 4.1 example_database_read

    To begin, we include the necessary header files and perform our @@ -112,13 +108,13 @@ function.

    -
    // File: excxx_example_database_read.cpp
    +        
    // File: example_database_read.cpp
     #include <iostream>
     #include <fstream>
     #include <cstdlib>
                                                                                                                                         
    -#include "MyDb.hpp"
    -#include "gettingStartedCommon.hpp"
    +#include "MyDb.hpp"
    +#include "gettingStartedCommon.hpp"
     
     // Forward declarations
     int show_all_records(MyDb &inventoryDB, MyDb &vendorDB);
    @@ -134,11 +130,11 @@ int
     main (int argc, char *argv[])
     {
         // Initialize the path to the database files
    -    std::string databaseHome("./");
    +    std::string databaseHome("./");
     
         // Database names
    -    std::string vDbName("vendordb.db");
    -    std::string iDbName("inventorydb.db");
    +    std::string vDbName("vendordb.db");
    +    std::string iDbName("inventorydb.db");
     
         // Parse the command line arguments
         // Omitted for brevity
    @@ -151,11 +147,11 @@ main (int argc, char *argv[])
     
             show_all_records(inventoryDB, vendorDB);
         } catch(DbException &e) {
    -        std::cerr << "Error reading databases. " << std::endl;
    +        std::cerr << "Error reading databases. " << std::endl;
             std::cerr << e.what() << std::endl;
             return(e.get_errno());
         } catch(std::exception &e) {
    -        std::cerr << "Error reading databases. " << std::endl;
    +        std::cerr << "Error reading databases. " << std::endl;
             std::cerr << e.what() << std::endl;
             return(-1);
         }
    @@ -193,7 +189,7 @@ show_all_records(MyDb &inventoryDB, MyDb &vendorDB)
                 show_vendor(vendorDB, inventoryItem.getVendor().c_str());
             }
         } catch(DbException &e) {
    -        inventoryDB.getDb().err(e.get_errno(), "Error in show_all_records");
    +        inventoryDB.getDb().err(e.get_errno(), "Error in show_all_records");
             cursorp->close();
             throw e;
         } catch(std::exception &e) {
    @@ -220,7 +216,7 @@ show_all_records(MyDb &inventoryDB, MyDb &vendorDB)
             
             
    // Shows a vendor record. Each vendor record is an instance of
     // a vendor structure. See loadVendorDB() in
    -// excxx_example_database_load for how this structure was originally
    +// example_database_load for how this structure was originally
     // put into the database.
     int
     show_vendor(MyDb &vendorDB, const char *vendor)
    @@ -245,17 +241,17 @@ show_vendor(MyDb &vendorDB, const char *vendor)
     
             // Get the record
             vendorDB.getDb().get(NULL, &key, &data, 0);
    -        std::cout << "        " << my_vendor.street << "\n"
    -                  << "        " << my_vendor.city << ", "
    -                  << my_vendor.state << "\n"
    -                  << "        " << my_vendor.zipcode << "\n"
    -                  << "        " << my_vendor.phone_number << "\n"
    -                  << "        Contact: " << my_vendor.sales_rep << "\n"
    -                  << "                 " << my_vendor.sales_rep_phone
    +        std::cout << "        " << my_vendor.street << "\n"
    +                  << "        " << my_vendor.city << ", "
    +                  << my_vendor.state << "\n"
    +                  << "        " << my_vendor.zipcode << "\n"
    +                  << "        " << my_vendor.phone_number << "\n"
    +                  << "        Contact: " << my_vendor.sales_rep << "\n"
    +                  << "                 " << my_vendor.sales_rep_phone
                       << std::endl;
     
         } catch(DbException &e) {
    -        vendorDB.getDb().err(e.get_errno(), "Error in show_vendor");
    +        vendorDB.getDb().err(e.get_errno(), "Error in show_vendor");
             throw e;
         } catch(std::exception &e) {
             throw e;
    @@ -265,7 +261,7 @@ show_vendor(MyDb &vendorDB, const char *vendor)
           

    That completes the implementation of - excxx_example_database_read(). In the next chapter, we + example_database_read(). In the next chapter, we will extend this application to make use of a secondary database so that we can query the inventory database for a specific inventory item.

    diff --git a/db/docs/gsg/CXX/CoreDBAdmin.html b/db/docs/gsg/CXX/CoreDBAdmin.html index c7cd1f8cf..1bec126a7 100644 --- a/db/docs/gsg/CXX/CoreDBAdmin.html +++ b/db/docs/gsg/CXX/CoreDBAdmin.html @@ -84,7 +84,7 @@ Db db(NULL, 0); // Database open and subsequent operations omitted for clarity -db.remove("mydb.db", // Database file to remove +db.remove("mydb.db", // Database file to remove NULL, // Database to remove. This is // NULL so the entire file is // removed. @@ -111,11 +111,11 @@ Db db(NULL, 0); // Database open and subsequent operations omitted for clarity -db.rename("mydb.db", // Database file to rename +db.rename("mydb.db", // Database file to rename NULL, // Database to rename. This is // NULL so the entire file is // renamed. - "newdb.db", // New database file name + "newdb.db", // New database file name 0); // Flags. None used.
  • diff --git a/db/docs/gsg/CXX/CoreDbCXXUsage.html b/db/docs/gsg/CXX/CoreDbCXXUsage.html index c21905040..a40416c0e 100644 --- a/db/docs/gsg/CXX/CoreDbCXXUsage.html +++ b/db/docs/gsg/CXX/CoreDbCXXUsage.html @@ -62,7 +62,7 @@

    To manage our database open and close activities, we encapsulate them in the MyDb class. There are several good reasons - to do this, the mort important being that we can ensure our databases are + to do this, the most important being that we can ensure our databases are closed by putting that activity in the MyDb class destructor.

    @@ -106,7 +106,7 @@ private:

    // File: MyDb.cpp
    -#include "MyDb.hpp"
    +#include "MyDb.hpp"
     
     // Class constructor. Requires a path to the location
     // where the database is located, and a database name
    @@ -128,12 +128,12 @@ MyDb::MyDb(std::string &path, std::string &dbName)
         // need to catch them both.
         catch(DbException &e)
         {
    -        std::cerr << "Error opening database: " << dbFileName_ << "\n";
    +        std::cerr << "Error opening database: " << dbFileName_ << "\n";
             std::cerr << e.what() << std::endl;
         }
         catch(std::exception &e)
         {
    -        std::cerr << "Error opening database: " << dbFileName_ << "\n";
    +        std::cerr << "Error opening database: " << dbFileName_ << "\n";
             std::cerr << e.what() << std::endl;
         }
     }
    @@ -152,17 +152,17 @@ MyDb::close() try { db_.close(0); - std::cout << "Database " << dbFileName_ - << " is closed." << std::endl; + std::cout << "Database " << dbFileName_ + << " is closed." << std::endl; } catch(DbException &e) { - std::cerr << "Error closing database: " << dbFileName_ << "\n"; + std::cerr << "Error closing database: " << dbFileName_ << "\n"; std::cerr << e.what() << std::endl; } catch(std::exception &e) { - std::cerr << "Error closing database: " << dbFileName_ << "\n"; + std::cerr << "Error closing database: " << dbFileName_ << "\n"; std::cerr << e.what() << std::endl; } } diff --git a/db/docs/gsg/CXX/CoreEnvUsage.html b/db/docs/gsg/CXX/CoreEnvUsage.html index 8d1268545..cc8196954 100644 --- a/db/docs/gsg/CXX/CoreEnvUsage.html +++ b/db/docs/gsg/CXX/CoreEnvUsage.html @@ -47,6 +47,9 @@ which it resides. This directory must exist prior to the open attempt. You can also identify open properties, such as whether the environment can be created if it does not already exist. +

    +

    + You will also need to initialize the in-memory cache when you open your environment.

    For example, to @@ -56,20 +59,22 @@

    #include <db_cxx.h>
     ...
    -u_int32_t env_flags = DB_CREATE;  // If the environment does not
    -                                  // exist, create it.
    -std::string envHome("/export1/testEnv");
    +u_int32_t env_flags = DB_CREATE |     // If the environment does not
    +                                      // exist, create it.
    +                      DB_INIT_MPOOL; // Initialize the in-memory cache.
    +
    +std::string envHome("/export1/testEnv");
     DbEnv myEnv(0);
     
     try {
         myEnv.open(envHome.c_str(), env_flags, 0);
     } catch(DbException &e) {
    -    std::cerr << "Error opening database environment: "
    +    std::cerr << "Error opening database environment: "
                   << envHome << std::endl;
         std::cerr << e.what() << std::endl;
         exit( -1 );
     } catch(std::exception &e) {
    -    std::cerr << "Error opening database environment: "
    +    std::cerr << "Error opening database environment: "
                   << envHome << std::endl;
         std::cerr << e.what() << std::endl;
         exit( -1 );
    @@ -86,8 +91,8 @@ u_int32_t env_flags = DB_CREATE;  // If the environment does not
                                       // exist, create it.
     u_int32_t db_flags = DB_CREATE;   // If the database does not
                                       // exist, create it.
    -std::string envHome("/export1/testEnv");
    -std::string dbName("mydb.db");
    +std::string envHome("/export1/testEnv");
    +std::string dbName("mydb.db");
     DbEnv myEnv(0);
     Db *myDb;
     
    @@ -101,16 +106,16 @@ try {
                    db_flags,
                    0);
     } catch(DbException &e) {
    -    std::cerr << "Error opening database environment: "
    +    std::cerr << "Error opening database environment: "
                   << envHome 
    -              << " and database "
    +              << " and database "
                   << dbName << std::endl;
         std::cerr << e.what() << std::endl;
         exit( -1 );
     } catch(std::exception &e) {
    -    std::cerr << "Error opening database environment: "
    +    std::cerr << "Error opening database environment: "
                   << envHome 
    -              << " and database "
    +              << " and database "
                   << dbName << std::endl;
         std::cerr << e.what() << std::endl;
         exit( -1 );
    @@ -127,16 +132,16 @@ try {
         myEnv.close(0);
         
     } catch(DbException &e) {
    -    std::cerr << "Error closing database environment: "
    +    std::cerr << "Error closing database environment: "
                   << envHome 
    -              << " or database "
    +              << " or database "
                   << dbName << std::endl;
         std::cerr << e.what() << std::endl;
         exit( -1 );
     } catch(std::exception &e) {
    -    std::cerr << "Error closing database environment: "
    +    std::cerr << "Error closing database environment: "
                   << envHome 
    -              << " or database "
    +              << " or database "
                   << dbName << std::endl;
         std::cerr << e.what() << std::endl;
         exit( -1 );
    diff --git a/db/docs/gsg/CXX/DB.html b/db/docs/gsg/CXX/DB.html
    index ec569c8ba..73718a1e5 100644
    --- a/db/docs/gsg/CXX/DB.html
    +++ b/db/docs/gsg/CXX/DB.html
    @@ -77,8 +77,7 @@
             
           
           

    In Berkeley DB, a database is a collection of records. Records, - in turn, consist of two parts: key and data. That is, records consist of - key/data pairings. + in turn, consist of key/data pairings.

    Conceptually, you can think of a @@ -145,7 +144,7 @@ u_int32_t oFlags = DB_CREATE; // Open flags; try { // Open the database db.open(NULL, // Transaction pointer - "my_db.db", // Database file name + "my_db.db", // Database file name NULL, // Optional logical database name DB_BTREE, // Database access method oFlags, // Open flags diff --git a/db/docs/gsg/CXX/DBEntry.html b/db/docs/gsg/CXX/DBEntry.html index 08fee38fe..07dc492d3 100644 --- a/db/docs/gsg/CXX/DBEntry.html +++ b/db/docs/gsg/CXX/DBEntry.html @@ -131,7 +131,7 @@ ... float money = 122.45; -char *description = "Grocery bill."; +char *description = "Grocery bill."; Dbt key(&money, sizeof(float)); Dbt data(description, strlen(description)+1);

    @@ -139,9 +139,7 @@ Dbt data(description, strlen(description)+1); Note that in the following example we do not allow DB to assign the memory for the retrieval of the money value. The reason why is that some systems may require float values to have a specific alignment, and the - memory as returned by - - Db + memory as returned by DB may not be properly aligned (the same problem may exist for structures on some systems). We tell DB to use our memory instead of its own by specifying the DB_DBT_USERMEM flag. Be aware that diff --git a/db/docs/gsg/CXX/DBOpenFlags.html b/db/docs/gsg/CXX/DBOpenFlags.html index b091635a6..5cc47eefb 100644 --- a/db/docs/gsg/CXX/DBOpenFlags.html +++ b/db/docs/gsg/CXX/DBOpenFlags.html @@ -40,7 +40,7 @@ to be of interest for introductory, single-threaded database applications. For a complete list of the flags available to you, see the - Berkeley DB C++ API Reference Guide. + Berkeley DB C++ API guide.

    Note

    diff --git a/db/docs/gsg/CXX/DbCXXUsage.html b/db/docs/gsg/CXX/DbCXXUsage.html index 894a34089..34ca01e17 100644 --- a/db/docs/gsg/CXX/DbCXXUsage.html +++ b/db/docs/gsg/CXX/DbCXXUsage.html @@ -94,7 +94,7 @@ typedef struct vendor { In order to manage our actual inventory data, we create a class that encapsulates the data that we want to store for each inventory record. Beyond simple data encapsulation, this class is also capable - of marshalling the inventory data into a single contiguous buffer + of marshaling the inventory data into a single contiguous buffer for the purposes of storing in that data in a DB database.

    @@ -226,12 +226,12 @@ public:

         // Utility function used to show the contents of this class
         void
         show() {
    -        std::cout << "\nName:         " << name_ << std::endl;
    -        std::cout << "    SKU:        " << sku_ << std::endl;
    -        std::cout << "    Price:      " << price_ << std::endl;
    -        std::cout << "    Quantity:   " << quantity_ << std::endl;
    -        std::cout << "    Category:   " << category_ << std::endl;
    -        std::cout << "    Vendor:     " << vendor_ << std::endl;
    +        std::cout << "\nName:         " << name_ << std::endl;
    +        std::cout << "    SKU:        " << sku_ << std::endl;
    +        std::cout << "    Price:      " << price_ << std::endl;
    +        std::cout << "    Quantity:   " << quantity_ << std::endl;
    +        std::cout << "    Category:   " << category_ << std::endl;
    +        std::cout << "    Vendor:     " << vendor_ << std::endl;
         } 

    Finally, we provide a private method that is used to help us pack data @@ -261,7 +261,7 @@ public:

    - Example 3.3 excxx_example_database_load + Example 3.3 example_database_load

    Our initial sample application loads database information from @@ -278,13 +278,13 @@ public: We begin with the normal include directives and forward declarations:

    -
    // File: excxx_example_database_load.cpp
    +        
    // File: example_database_load.cpp
     #include <iostream>
     #include <fstream>
     #include <cstdlib>
                                                                                                                                         
    -#include "MyDb.hpp"
    -#include "gettingStartedCommon.hpp" 
    +#include "MyDb.hpp"
    +#include "gettingStartedCommon.hpp" 
     
     // Forward declarations
     void loadVendorDB(MyDb&, std::string&);
    @@ -302,12 +302,12 @@ int
     main(int argc, char *argv[])
     {
         // Initialize the path to the database files
    -    std::string basename("./");
    -    std::string databaseHome("./");
    +    std::string basename("./");
    +    std::string databaseHome("./");
                                                                                                                                         
         // Database names
    -    std::string vDbName("vendordb.db");
    -    std::string iDbName("inventorydb.db");
    +    std::string vDbName("vendordb.db");
    +    std::string iDbName("inventorydb.db");
     
         // Parse the command line arguments here and determine 
         // the location of the flat text files containing the 
    @@ -315,8 +315,8 @@ main(int argc, char *argv[])
     
         //  Identify the full name for our input files, which should
         //  also include some path information.
    -    std::string inventoryFile = basename + "inventory.txt";
    -    std::string vendorFile = basename + "vendors.txt";
    +    std::string inventoryFile = basename + "inventory.txt";
    +    std::string vendorFile = basename + "vendors.txt";
                                                                                                                                         
         try
         {
    @@ -330,11 +330,11 @@ main(int argc, char *argv[])
             // Load the inventory database
             loadInventoryDB(inventoryDB, inventoryFile);
         } catch(DbException &e) {
    -        std::cerr << "Error loading databases. " << std::endl;
    +        std::cerr << "Error loading databases. " << std::endl;
             std::cerr << e.what() << std::endl;
             return(e.get_errno());
         } catch(std::exception &e) {
    -        std::cerr << "Error loading databases. " << std::endl;
    +        std::cerr << "Error loading databases. " << std::endl;
             std::cerr << e.what() << std::endl;
             return(-1);
         }
    @@ -374,8 +374,8 @@ loadVendorDB(MyDb &vendorDB, std::string &vendorFile)
         std::ifstream inFile(vendorFile.c_str(), std::ios::in);
         if ( !inFile )
         {
    -        std::cerr << "Could not open file '" << vendorFile
    -                  << "'. Giving up." << std::endl;
    +        std::cerr << "Could not open file '" << vendorFile
    +                  << "'. Giving up." << std::endl;
             throw std::exception();
         }
                                                                                                                                         
    @@ -391,7 +391,7 @@ loadVendorDB(MyDb &vendorDB, std::string &vendorFile)
             // In a real program, there would be a lot more
             // defensive code here.
             sscanf(stringBuf.c_str(),
    -          "%20[^#]#%20[^#]#%20[^#]#%3[^#]#%6[^#]#%13[^#]#%20[^#]#%20[^\n]",
    +          "%20[^#]#%20[^#]#%20[^#]#%3[^#]#%6[^#]#%13[^#]#%20[^#]#%20[^\n]",
               my_vendor.name, my_vendor.street,
               my_vendor.city, my_vendor.state,
               my_vendor.zipcode, my_vendor.phone_number,
    @@ -438,7 +438,7 @@ loadVendorDB(MyDb &vendorDB, std::string &vendorFile)
     int
     getNextPound(std::string &theString, std::string &substring)
     {
    -    int pos = theString.find("#");
    +    int pos = theString.find("#");
         substring.assign(theString, 0, pos);
         theString.assign(theString, pos + 1, theString.size());
         return (pos);
    @@ -456,8 +456,8 @@ loadInventoryDB(MyDb &inventoryDB, std::string &inventoryFile)
         std::ifstream inFile(inventoryFile.c_str(), std::ios::in);
         if (!inFile)
         {
    -        std::cerr << "Could not open file '" << inventoryFile
    -                  << "'. Giving up." << std::endl;
    +        std::cerr << "Could not open file '" << inventoryFile
    +                  << "'. Giving up." << std::endl;
             throw std::exception();
         }
                                                                                                                                         
    diff --git a/db/docs/gsg/CXX/DeleteEntryWCursor.html b/db/docs/gsg/CXX/DeleteEntryWCursor.html
    index 3a07d1326..482f1dfa0 100644
    --- a/db/docs/gsg/CXX/DeleteEntryWCursor.html
    +++ b/db/docs/gsg/CXX/DeleteEntryWCursor.html
    @@ -54,7 +54,7 @@
     
     ...
     
    -char *key1str = "My first string";
    +char *key1str = "My first string";
     Db my_database(NULL, 0);
     Dbc *cursorp;
     
    @@ -76,9 +76,9 @@ try {
         }
     
     } catch(DbException &e) {
    -    my_database.err(e.get_errno(), "Error!");
    +    my_database.err(e.get_errno(), "Error!");
     } catch(std::exception &e) {
    -    my_database.errx("Error! %s", e.what());
    +    my_database.errx("Error! %s", e.what());
     }
     
     // Cursors must be closed
    diff --git a/db/docs/gsg/CXX/Positioning.html b/db/docs/gsg/CXX/Positioning.html
    index fe14c6eb0..6c0001657 100644
    --- a/db/docs/gsg/CXX/Positioning.html
    +++ b/db/docs/gsg/CXX/Positioning.html
    @@ -73,9 +73,9 @@ try {
             // can never be reached. 
         }
     } catch(DbException &e) {
    -        my_database.err(e.get_errno(), "Error!");
    +        my_database.err(e.get_errno(), "Error!");
     } catch(std::exception &e) {
    -        my_database.errx("Error! %s", e.what());
    +        my_database.errx("Error! %s", e.what());
     }
     
     // Cursors must be closed
    @@ -114,9 +114,9 @@ try {
             // can never be reached. 
         }
     } catch(DbException &e) {
    -        my_database.err(e.get_errno(), "Error!");
    +        my_database.err(e.get_errno(), "Error!");
     } catch(std::exception &e) {
    -        my_database.errx("Error! %s", e.what());
    +        my_database.errx("Error! %s", e.what());
     }
     
     // Cursors must be closed
    @@ -209,7 +209,9 @@ my_database.close(0);
    that you provide for the database. If no comparison function - is provided, then the default lexicographical sorting is used. + is provided, then the default + + lexicographical sorting is used.

    For example, suppose you have database records that use the @@ -246,8 +248,9 @@ Arizona

    DB_GET_BOTH_RANGE

    - Moves the cursor to the first record in the database whose key is - greater than or equal to the specified key. If the database supports + Moves the cursor to the first record in the database whose key matches the specified + key and whose data is + greater than or equal to the specified data. If the database supports duplicate records, then on matching the key, the cursor is moved to the duplicate record with the smallest data that is greater than or equal to the specified data. @@ -282,24 +285,19 @@ Arizona/Florence

    AlFlAlabama/FlorenceAlaskaFaAlaska/Fairbanks
    ArArizona Fl Arizona/Florence
    AlFaAlaska/Fairbanks
    AlAAlabama/AthensAlaskaAnAlaska/Anchorage
    @@ -332,23 +330,24 @@ try { my_database.cursor(NULL, &cursorp, 0); // Search criteria - char *search_key = "Al"; - char *search_data = "Fa"; + char *search_key = "Alaska"; + char *search_data = "Fa"; // Set up our DBTs Dbt key(search_key, strlen(search_key) + 1); Dbt data(search_data, strlen(search_data) + 1); // Position the cursor to the first record in the database whose - // key and data begin with the correct strings. + // key matches the search key and whose data begins with the search + // data. int ret = cursorp->get(&key, &data, DB_GET_BOTH_RANGE); if (!ret) { // Do something with the data } } catch(DbException &e) { - my_database.err(e.get_errno(), "Error!"); + my_database.err(e.get_errno(), "Error!"); } catch(std::exception &e) { - my_database.errx("Error! %s", e.what()); + my_database.errx("Error! %s", e.what()); } // Close the cursor @@ -522,7 +521,7 @@ Arizona/Florence ... -char *search_key = "Al"; +char *search_key = "Al"; Db my_database(NULL, 0); Dbc *cursorp; @@ -541,14 +540,14 @@ try { // key and data begin with the correct strings. int ret = cursorp->get(&key, &data, DB_SET); while (ret != DB_NOTFOUND) { - std::cout << "key: " << (char *)key.get_data() - << "data: " << (char *)data.get_data()<< std::endl; + std::cout << "key: " << (char *)key.get_data() + << "data: " << (char *)data.get_data()<< std::endl; ret = cursorp->get(&key, &data, DB_NEXT_DUP); } } catch(DbException &e) { - my_database.err(e.get_errno(), "Error!"); + my_database.err(e.get_errno(), "Error!"); } catch(std::exception &e) { - my_database.errx("Error! %s", e.what()); + my_database.errx("Error! %s", e.what()); } // Close the cursor diff --git a/db/docs/gsg/CXX/PutEntryWCursor.html b/db/docs/gsg/CXX/PutEntryWCursor.html index 4a4ff126f..1374295e9 100644 --- a/db/docs/gsg/CXX/PutEntryWCursor.html +++ b/db/docs/gsg/CXX/PutEntryWCursor.html @@ -42,10 +42,7 @@

    Note that when putting records to the database using a cursor, the - cursor is positioned at the record you inserted. Also, you can not - transactionally protect a put that is performed using a cursor; - if you want to transactionall protect your database writes, - put recrods using the database handle directly. + cursor is positioned at the record you inserted.

    You use @@ -139,11 +136,11 @@ ... -char *key1str = "My first string"; -char *data1str = "My first data"; -char *key2str = "A second string"; -char *data2str = "My second data"; -char *data3str = "My third data"; +char *key1str = "My first string"; +char *data1str = "My first data"; +char *key2str = "A second string"; +char *data2str = "My second data"; +char *data3str = "My third data"; Db my_database(NULL, 0); @@ -164,11 +161,11 @@ try { my_database.cursor(NULL, &cursorp, 0); // Assuming an empty database, this first put places - // "My first string"/"My first data" in the first + // "My first string"/"My first data" in the first // position in the database int ret = cursorp->put(&key1, &data1, DB_KEYFIRST); - // This put places "A second string"/"My second data" in the + // This put places "A second string"/"My second data" in the // the database according to its key sorts against the key // used for the currently existing database record. Most likely // this record would appear first in the database. @@ -176,21 +173,21 @@ try { DB_KEYFIRST); /* Added according to sort order */ // If duplicates are not allowed, the currently existing record that - // uses "key2" is overwritten with the data provided on this put. - // That is, the record "A second string"/"My second data" becomes - // "A second string"/"My third data" + // uses "key2" is overwritten with the data provided on this put. + // That is, the record "A second string"/"My second data" becomes + // "A second string"/"My third data" // - // If duplicates are allowed, then "My third data" is placed in the - // duplicates list according to how it sorts against "My second data". + // If duplicates are allowed, then "My third data" is placed in the + // duplicates list according to how it sorts against "My second data". ret = cursorp->put(&key2, &data3, DB_KEYFIRST); // If duplicates are not allowed, record // is overwritten with new data. Otherwise, // the record is added to the beginning of // the duplicates list. } catch(DbException &e) { - my_database.err(e.get_errno(), "Error!"); + my_database.err(e.get_errno(), "Error!"); } catch(std::exception &e) { - my_database.errx("Error! %s", e.what()); + my_database.errx("Error! %s", e.what()); } // Cursors must be closed diff --git a/db/docs/gsg/CXX/ReplacingEntryWCursor.html b/db/docs/gsg/CXX/ReplacingEntryWCursor.html index 6bbd080d5..5d6bd4dd7 100644 --- a/db/docs/gsg/CXX/ReplacingEntryWCursor.html +++ b/db/docs/gsg/CXX/ReplacingEntryWCursor.html @@ -57,8 +57,8 @@ Db my_database(NULL, 0); Dbc *cursorp; int ret; -char *key1str = "My first string"; -char *replacement_data = "replace me"; +char *key1str = "My first string"; +char *replacement_data = "replace me"; try { // Database open omitted @@ -78,9 +78,9 @@ try { cursorp->put(&key, &data, DB_CURRENT); } } catch(DbException &e) { - my_database.err(e.get_errno(), "Error!"); + my_database.err(e.get_errno(), "Error!"); } catch(std::exception &e) { - my_database.errx("Error! %s", e.what()); + my_database.errx("Error! %s", e.what()); } // Cursors must be closed diff --git a/db/docs/gsg/CXX/accessmethods.html b/db/docs/gsg/CXX/accessmethods.html index 02469bb95..dcbd74844 100644 --- a/db/docs/gsg/CXX/accessmethods.html +++ b/db/docs/gsg/CXX/accessmethods.html @@ -141,7 +141,7 @@

    Once you have made this decision, you must choose between either - BTree or Queue, or Hash or Recno. This decision is described next. + BTree or Hash, or Queue or Recno. This decision is described next.

    diff --git a/db/docs/gsg/CXX/btree.html b/db/docs/gsg/CXX/btree.html index d90e38e07..6e34d7bbc 100644 --- a/db/docs/gsg/CXX/btree.html +++ b/db/docs/gsg/CXX/btree.html @@ -327,7 +327,7 @@ ... Db db(NULL, 0); -const char *file_name = "myd.db"; +const char *file_name = "myd.db"; try { // Configure the database for sorted duplicates @@ -341,9 +341,9 @@ try { DB_CREATE, // Open flags 0); // File mode. Using defaults } catch(DbException &e) { - db.err(e.get_errno(), "Database '%s' open failed.", file_name); + db.err(e.get_errno(), "Database '%s' open failed.", file_name); } catch(std::exception &e) { - db.errx("Error opening database: %s : %s\n", file_name, e.what()); + db.errx("Error opening database: %s : %s\n", file_name, e.what()); } ... @@ -351,9 +351,9 @@ try { try { db.close(0); } catch(DbException &e) { - db.err(e.get_errno(), "Database '%s' close failed.", file_name); + db.err(e.get_errno(), "Database '%s' close failed.", file_name); } catch(std::exception &e) { - db.errx("Error closing database: %s : %s\n", file_name, e.what()); + db.errx("Error closing database: %s : %s\n", file_name, e.what()); } @@ -402,7 +402,7 @@ try { do not sort well when viewed as byte strings. There are several solutions to this problem, one being to provide a custom comparison function. See - http://www.sleepycat.com/docs/ref/am_misc/faq.html + http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_misc/faq.html for more information.

    diff --git a/db/docs/gsg/CXX/concepts.html b/db/docs/gsg/CXX/concepts.html index 8404051db..161e6a25b 100644 --- a/db/docs/gsg/CXX/concepts.html +++ b/db/docs/gsg/CXX/concepts.html @@ -42,7 +42,7 @@ Conceptually, DB databases contain records. Logically each record represents a single entry in the database. Each such record contains two pieces of information: a key and a data. - This manual will on occaison describe a a record's + This manual will on occasion describe a a record's key or a record's data when it is necessary to speak to one or the other portion of a database record. diff --git a/db/docs/gsg/CXX/coreExceptions.html b/db/docs/gsg/CXX/coreExceptions.html index 4b0644d87..eec772f92 100644 --- a/db/docs/gsg/CXX/coreExceptions.html +++ b/db/docs/gsg/CXX/coreExceptions.html @@ -90,9 +90,7 @@ catch(std::exception &e) environment handles. In this event, you must manage your DB error conditions using the integer value returned by all DB methods. Be aware that this manual assumes that you want to manage your error - conditions using DbException objects. For - information on managing error conditions using the integer return - values, see Getting Started with Berkeley DB for C. + conditions using DbException objects.

    diff --git a/db/docs/gsg/CXX/environments.html b/db/docs/gsg/CXX/environments.html index fa1493eb4..95107b29c 100644 --- a/db/docs/gsg/CXX/environments.html +++ b/db/docs/gsg/CXX/environments.html @@ -45,7 +45,7 @@

    While environments are frequently not used by applications running in embedded environments where every byte counts, they will be used by - virutally any other DB application requiring anything other than + virtually any other DB application requiring anything other than the bare minimum functionality. An environment is essentially an encapsulation of one or more databases. Essentially, you open an environment and then you open databases in that environment. @@ -64,7 +64,7 @@

    It is possible in DB to contain multiple databases in a - single physical file on disk. This is desireable for those + single physical file on disk. This is desirable for those application that open more than a few handful of databases. However, in order to have more than one database contained in a single physical file, your application @@ -116,15 +116,16 @@ obtain a high-degree of recoverability in the face of an application or system crash. Once enabled, the logging subsystem allows the application to perform two kinds of recovery - ("normal" and "catastrophic") through the use of the information + ("normal" and "catastrophic") through the use of the information contained in the log files.

    - All of these topics are described in the Berkeley DB - Programmer's Reference Guide. + For more information on these topics, see the + Berkeley DB Getting Started with Transaction Processing guide and the + Berkeley DB Getting Started with Replicated Applications guide.

    - You can obtain DB by visiting the Sleepycat download page: - http://www.sleepycat.com/download/index.shtml. + You can obtain DB by visiting the Berkeley DB download page: + http://www.oracle.com/technology/software/products/berkeley-db/db/index.html.

    To install DB, untar or unzip the distribution to the directory of @@ -49,9 +49,9 @@

    That page also contains links to more documentation for DB. In - particular, you will find links for the Berkeley DB - Programmer's Tutorial and Reference Guide as - well as the API reference documentation. + particular, you will find links for the + Berkeley DB Programmer's Reference Guide + as well as the API reference documentation.

    +
    +
    + + For More Information + +
    +
    +
    @@ -351,18 +369,12 @@
    - Secondary Databases with - - excxx_example_database_load - + Secondary Databases with example_database_load
    - Secondary Databases with - - excxx_example_database_read - + Secondary Databases with example_database_read
    @@ -441,8 +453,8 @@
    2.1. MyDb Class
    3.1. VENDOR Structure
    3.2. InventoryData Class
    -
    3.3. excxx_example_database_load
    -
    4.1. excxx_example_database_read
    +
    3.3. example_database_load
    +
    4.1. example_database_read
    diff --git a/db/docs/gsg/CXX/indexes.html b/db/docs/gsg/CXX/indexes.html index 947ee63f3..8e7c0a1e6 100644 --- a/db/docs/gsg/CXX/indexes.html +++ b/db/docs/gsg/CXX/indexes.html @@ -93,18 +93,12 @@
    - Secondary Databases with - - excxx_example_database_load - + Secondary Databases with example_database_load
    - Secondary Databases with - - excxx_example_database_read - + Secondary Databases with example_database_read
    @@ -259,25 +253,25 @@
    #include <db_cxx.h>
     
     ...
    -                                                                                                                                     
    +
     Db my_database(NULL, 0); // Primary
     Db my_index(NULL, 0);    // Secondary
     
     // Open the primary
     my_database.open(NULL,       // Transaction pointer
    -                 "my_db.db", // On-disk file that holds the database.
    +                 "my_db.db", // On-disk file that holds the database.
                     NULL,        // Optional logical database name
                     DB_BTREE,    // Database access method
                     DB_CREATE,   // Open flags
                     0);          // File mode (using defaults)
     
     // Setup the secondary to use sorted duplicates.
    -// This is often desireable for secondary databases.
    +// This is often desirable for secondary databases.
     my_index.set_flags(DB_DUPSORT);
     
     // Open the secondary
     my_index.open(NULL,              // Transaction pointer
    -              "my_secondary.db", // On-disk file that holds the database.
    +              "my_secondary.db", // On-disk file that holds the database.
                   NULL,              // Optional logical database name
                   DB_BTREE,          // Database access method
                   DB_CREATE,         // Open flags.
    diff --git a/db/docs/gsg/CXX/introduction.html b/db/docs/gsg/CXX/introduction.html
    index 1ea18433f..2a6941eaf 100644
    --- a/db/docs/gsg/CXX/introduction.html
    +++ b/db/docs/gsg/CXX/introduction.html
    @@ -101,7 +101,7 @@
             
           
           

    - Welcome to Sleepycat's Berkeley DB (DB). DB is a general-purpose embedded + Welcome to Berkeley DB (DB). DB is a general-purpose embedded database engine that is capable of providing a wealth of data management services. It is designed from the ground up for high-throughput applications requiring in-process, bullet-proof management of mission-critical data. DB can @@ -137,7 +137,7 @@ as to ensure that data is never left in an inconsistent state for any reason (such as software bugs or hardware failures). For those applications, a transaction subsystem can be enabled and used to - transactionally protect database writes. + transactional-protect database writes.

    The list of operating systems on which DB is available is too long to @@ -145,8 +145,8 @@ operating systems, as well as on many embedded platforms.

    - Finally, DB is available in a wealth of programming languages. Sleepycat - officially supports DB in C, C++, and Java, but the library is also + Finally, DB is available in a wealth of programming languages. + DB is officially supported in C, C++, and Java, but the library is also available in many other languages, especially scripting languages such as Perl and Python.

    diff --git a/db/docs/gsg/CXX/joins.html b/db/docs/gsg/CXX/joins.html index a8cba860c..8a96e7b40 100644 --- a/db/docs/gsg/CXX/joins.html +++ b/db/docs/gsg/CXX/joins.html @@ -36,7 +36,7 @@

    If you have two or more secondary databases associated with a primary - database, then you can retrieve primary records based on the union of + database, then you can retrieve primary records based on the intersection of multiple secondary entries. You do this using a join cursor. @@ -56,7 +56,7 @@ is fairly simple with a limited number of data members, few of which would be interesting from a query perspective. But suppose, instead, that we were storing - information on something with many more queryable characteristics, such + information on something with many more characteristics that can be queried, such as an automobile. In that case, you may be storing information such as color, number of doors, fuel mileage, automobile type, number of passengers, make, model, and year, to name just a few. @@ -139,7 +139,8 @@

  • Create an array of cursors, and place in it each - of the cursors that are participating in your join query. + of the cursors that are participating in your join query. Note that this array must be null + terminated.

  • @@ -206,7 +207,7 @@ Db automotiveTypeDB(NULL, 0); // Position the cursors Dbc *color_curs; automotiveColorDB.cursor(NULL, &color_curs, 0); -char *the_color = "red"; +char *the_color = "red"; Dbt key(the_color, strlen(the_color) + 1); Dbt data; if ((ret = color_curs->get(&key, &data, DB_SET)) != 0) { @@ -215,7 +216,7 @@ if ((ret = color_curs->get(&key, &data, DB_SET)) != 0) { Dbc *make_curs; automotiveMakeDB.cursor(NULL, &make_curs, 0); -char *the_make = "Toyota"; +char *the_make = "Toyota"; key.set_data(the_make); key.set_size(strlen(the_make) + 1); if ((ret = make_curs->get(&key, &data, DB_SET)) != 0) { @@ -224,7 +225,7 @@ if ((ret = make_curs->get(&key, &data, DB_SET)) != 0) { Dbc *type_curs; automotiveTypeDB.cursor(NULL, &type_curs, 0); -char *the_type = "minivan"; +char *the_type = "minivan"; key.set_data(the_type); key.set_size(strlen(the_type) + 1); if ((ret = type_curs->get(&key, &data, DB_SET)) != 0) { @@ -232,10 +233,11 @@ if ((ret = type_curs->get(&key, &data, DB_SET)) != 0) { } // Set up the cursor array -Dbc *carray[3]; +Dbc *carray[4]; carray[0] = color_curs; carray[1] = make_curs; carray[2] = type_curs; +carray[3] = NULL; // Create the join Dbc *join_curs; diff --git a/db/docs/gsg/CXX/preface.html b/db/docs/gsg/CXX/preface.html index 6f88298ab..83219a76e 100644 --- a/db/docs/gsg/CXX/preface.html +++ b/db/docs/gsg/CXX/preface.html @@ -44,20 +44,29 @@ Conventions Used in this Book +
    +
    +
    + + For More Information + +
    +
    +

    Welcome to Berkeley DB (DB). This document introduces - DB, version 4.3. + DB, version 4.5. It is intended to provide a rapid introduction to the DB API set and related concepts. The goal of this document is to provide you with an efficient mechanism with which you can evaluate DB against your project's technical requirements. As such, this document is intended for C++ developers and senior software architects who are - looking for an in-process data management solution. No prior experience with Sleepycat technologies is - expected or required. + looking for an in-process data management solution. No prior + experience with Berkeley DB is expected or required.

    @@ -79,12 +88,12 @@ - "Db::open() is a - Db class method." + "Db::open() is a + Db class method."

    - Variable or non-literal text is presented in italics. For example: "Go to your - DB_INSTALL directory." + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALL directory."

    Program examples are displayed in a monospaced font on a shaded background. @@ -119,6 +128,61 @@ as this.

    +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + DB application: +

    + +
    @@ -192,7 +192,7 @@ if (ret == DB_KEYEXIST) { ... float money; -char *description; +char *description[DESCRIPTION_SIZE + 1]; Db my_database(NULL, 0); // Database open omitted for clarity @@ -200,16 +200,17 @@ Db my_database(NULL, 0); money = 122.45; Dbt key, data; -// Use our own memory to retrieve the float. -// For data alignment purposes. + key.set_data(&money); key.set_ulen(sizeof(float)); -key.set_flags(DB_DBT_USERMEM); + +data.set_data(&description); +data.set_ulen(DESCRIPTION_SIZE + 1); +data.set_flags(DB_DBT_USERMEM); my_database.get(NULL, &key, &data, 0); -// Money is set into the memory that we supplied. -description = (char *)data.get_data();
  • +// Description is set into the memory that we supplied.

    Note that in this example, the data.size @@ -269,7 +270,7 @@ my_database.del(NULL, &key, 0);

    When you perform a database modification, your modification is made in the in-memory cache. This means that your data modifications - are not necessarily written to disk, and so your data may not appear + are not necessarily flushed to disk, and so your data may not appear in the database after an application restart.

    @@ -281,17 +282,19 @@ my_database.del(NULL, &key, 0); experience database corruption.

    - Therefore, if you care about whether your data persists across - application runs, and to guard against the rare possibility of + Therefore, if you care if your data is durable across system + failures, and to guard against the rare possibility of database corruption, you should use transactions to protect your database modifications. Every time you commit a transaction, DB ensures that the data will not be lost due to application or - system failure. - - - For information on transactions, see the Berkeley DB - Programmer's Tutorial and Reference Guide. - + system failure. Transaction usage is described in the + + + + + + Berkeley DB Getting Started with Transaction Processing guide. +

    If you do not want to use transactions, then the assumption is that @@ -307,7 +310,8 @@ my_database.del(NULL, &key, 0); call Db::sync(). - Syncs cause the entire contents of your in-memory cache to be written to disk. As + Syncs cause any dirty entries in the in-memory cache and the + operating system's file cache to be written to disk. As such, they are quite expensive and you should use them sparingly.

    diff --git a/db/docs/gsg/JAVA/BerkeleyDB-Core-JAVA-GSG.pdf b/db/docs/gsg/JAVA/BerkeleyDB-Core-JAVA-GSG.pdf index f6fabaa34..af17d1e46 100644 Binary files a/db/docs/gsg/JAVA/BerkeleyDB-Core-JAVA-GSG.pdf and b/db/docs/gsg/JAVA/BerkeleyDB-Core-JAVA-GSG.pdf differ diff --git a/db/docs/gsg/JAVA/CoreEnvUsage.html b/db/docs/gsg/JAVA/CoreEnvUsage.html index 4759e5523..abe675a6a 100644 --- a/db/docs/gsg/JAVA/CoreEnvUsage.html +++ b/db/docs/gsg/JAVA/CoreEnvUsage.html @@ -47,6 +47,9 @@ which it resides. This directory must exist prior to the open attempt. You can also identify open properties, such as whether the environment can be created if it does not already exist. +

    +

    + You will also need to initialize the in-memory cache when you open your environment.

    For example, to @@ -54,7 +57,7 @@ open an environment:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
     
     import com.sleepycat.db.DatabaseException;
     import com.sleepycat.db.Environment;
    @@ -66,10 +69,13 @@ import java.io.FileNotFoundException;
     ...
     
     Environment myEnv = null;
    -File envHome = new File("/export1/testEnv");
    +File envHome = new File("/export1/testEnv");
     try {
         EnvironmentConfig envConf = new EnvironmentConfig();
    -    envConf.setAllowCreate(true);
    +    envConf.setAllowCreate(true);         // If the environment does not
    +                                          // exist, create it.
    +    envConf.setInitializeCache(true);     // Initialize the in-memory
    +                                          // cache.
     
         myEnv = new Environment(envHome, envConf);
     } catch (DatabaseException de) {
    @@ -83,7 +89,7 @@ try {
             provide any sort of a path in the database's file name:
         

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
     
     import com.sleepycat.db.Database;
     import com.sleepycat.db.DatabaseConfig;
    @@ -99,8 +105,8 @@ import java.io.FileNotFoundException;
     
     Environment myEnv = null;
     Database myDb = null;
    -File envHome = new File("/export1/testEnv");
    -String dbFileName = new String("mydb.db");
    +File envHome = new File("/export1/testEnv");
    +String dbFileName = new String("mydb.db", "UTF-8");
     
     try {
         EnvironmentConfig envConf = new EnvironmentConfig();
    diff --git a/db/docs/gsg/JAVA/CoreJavaUsage.html b/db/docs/gsg/JAVA/CoreJavaUsage.html
    index 84a24586b..36c50f694 100644
    --- a/db/docs/gsg/JAVA/CoreJavaUsage.html
    +++ b/db/docs/gsg/JAVA/CoreJavaUsage.html
    @@ -49,7 +49,7 @@
             Note that you can find the complete implementation of these functions
             in:
         

    -
    DB_INSTALL/examples_java/src/com/sleepycat/examples/db/GettingStarted
    +
    DB_INSTALL/examples_java/db/GettingStarted

    where DB_INSTALL is the location where you placed your DB distribution. @@ -62,7 +62,7 @@

    To manage our database open and close activities, we encapsulate them in the MyDbs class. There are several good reasons - to do this, the mort important being that we can ensure our databases are + to do this, the most important being that we can ensure our databases are closed by putting that activity in the MyDbs class destructor.

    @@ -71,7 +71,7 @@

    // File: MyDbs.java
    -package com.sleepycat.examples.db.GettingStarted;
    +package db.GettingStarted;
     
     import com.sleepycat.db.Database;
     import com.sleepycat.db.DatabaseConfig;
    @@ -89,8 +89,8 @@ import java.io.FileNotFoundException; 
    private Database vendorDb = null; private Database inventoryDb = null; - private String vendordb = "VendorDB.db"; - private String inventorydb = "InventoryDB.db"; + private String vendordb = "VendorDB.db"; + private String inventorydb = "InventoryDB.db"; // Our constructor does nothing public MyDbs() {}
    @@ -107,24 +107,24 @@ import java.io.FileNotFoundException;
    DatabaseConfig myDbConfig = new DatabaseConfig(); myDbConfig.setErrorStream(System.err); - myDbConfig.setErrorPrefix("MyDbs"); + myDbConfig.setErrorPrefix("MyDbs"); myDbConfig.setType(DatabaseType.BTREE); myDbConfig.setAllowCreate(true); // Now open, or create and open, our databases // Open the vendors and inventory databases try { - vendordb = databasesHome + "/" + vendordb; + vendordb = databasesHome + "/" + vendordb; vendorDb = new Database(vendordb, null, myDbConfig); - inventorydb = databasesHome + "/" + inventorydb; + inventorydb = databasesHome + "/" + inventorydb; inventoryDb = new Database(inventorydb, null, myDbConfig); } catch(FileNotFoundException fnfe) { - System.err.println("MyDbs: " + fnfe.toString()); + System.err.println("MyDbs: " + fnfe.toString()); System.exit(-1); } }
    @@ -152,7 +152,7 @@ import java.io.FileNotFoundException;
    inventoryDb.close(); } } catch(DatabaseException dbe) { - System.err.println("Error closing MyDbs: " + + System.err.println("Error closing MyDbs: " + dbe.toString()); System.exit(-1); } diff --git a/db/docs/gsg/JAVA/Cursors.html b/db/docs/gsg/JAVA/Cursors.html index 1b8079556..6359918ac 100644 --- a/db/docs/gsg/JAVA/Cursors.html +++ b/db/docs/gsg/JAVA/Cursors.html @@ -117,7 +117,7 @@

    For example:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
         
     import com.sleepycat.db.Cursor;
     import com.sleepycat.db.CursorConfig;
    @@ -131,7 +131,7 @@ Database myDatabase = null;
     Cursor myCursor = null;
     
     try {
    -    myDatabase = new Database("myDB", null, null);
    +    myDatabase = new Database("myDB", null, null);
     
         myCursor = myDatabase.openCursor(null, null);
     } catch (FileNotFoundException fnfe) {
    @@ -142,12 +142,13 @@ try {
             

    To close the cursor, call the Cursor.close() method. Note that if you close a database that has cursors open in it, - then it will complain and close any open cursors for you. For best results, close your cursors from within a + then it will throw an exception and close any open cursors for you. + For best results, close your cursors from within a finally block.

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
         
     import com.sleepycat.db.Cursor;
     import com.sleepycat.db.Database;
    @@ -166,7 +167,7 @@ try {
                 myDatabase.close();
             }
         } catch(DatabaseException dbe) {
    -        System.err.println("Error in close: " + dbe.toString());
    +        System.err.println("Error in close: " + dbe.toString());
         }
     } 
    diff --git a/db/docs/gsg/JAVA/DB.html b/db/docs/gsg/JAVA/DB.html index b3d8837bb..c7b87085c 100644 --- a/db/docs/gsg/JAVA/DB.html +++ b/db/docs/gsg/JAVA/DB.html @@ -51,7 +51,7 @@
    - Database Properties + Database Properties
    @@ -77,8 +77,7 @@

    In Berkeley DB, a database is a collection of records. Records, - in turn, consist of two parts: key and data. That is, records consist of - key/data pairings. + in turn, consist of key/data pairings.

    Conceptually, you can think of a @@ -125,14 +124,14 @@

    Note that by default, DB does not create databases if they do not already exist. - To override this behavior, set the creation property to true. + To override this behavior, set the creation property to true.

    The following code fragment illustrates a database open:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.db.DatabaseException;
     import com.sleepycat.db.Database;
    @@ -149,7 +148,7 @@ try {
         // Open the database. Create it if it does not already exist.
         DatabaseConfig dbConfig = new DatabaseConfig();
         dbConfig.setAllowCreate(true);
    -    myDatabase = new Database ("sampleDatabase.db",
    +    myDatabase = new Database ("sampleDatabase.db",
                                    null, 
                                    dbConfig); 
     } catch (DatabaseException dbe) {
    diff --git a/db/docs/gsg/JAVA/DBAdmin.html b/db/docs/gsg/JAVA/DBAdmin.html
    index c0b03b9b9..e5b5aba01 100644
    --- a/db/docs/gsg/JAVA/DBAdmin.html
    +++ b/db/docs/gsg/JAVA/DBAdmin.html
    @@ -8,7 +8,7 @@
         
         
         
    -    
    +    
         
       
       
    @@ -18,7 +18,7 @@
               Administrative Methods
             
             
    -          Prev 
    +          Prev 
               Chapter 2. Databases
                Next
             
    @@ -35,7 +35,8 @@
             

    - The Database class provides methods that are useful + Both the Environment and + Database classes provide methods that are useful for manipulating databases. These methods are:

    @@ -48,24 +49,6 @@
    String dbName = myDatabase.getDatabaseName();
    -
  • -

    - Database.truncate() -

    -

    - Deletes every record in the database and optionally returns the - number of records that were deleted. Note that it is much less - expensive to truncate a database without counting the number of - records deleted than it is to truncate and count. -

    - -
    int numDiscarded = 
    -    myDatabase.truncate(null,
    -                        true); // If true, then the number of
    -                               // records deleted are counted.
    -System.out.println("Discarded " + numDiscarded +
    -                " records from database " + myDatabase.getDatabaseName()); 
    -
  • Database.rename() @@ -84,16 +67,37 @@ System.out.println("Discarded " + numDiscarded + ... myDatabase.close(); try { - myDatabase.rename("mydb.db", // Database file to rename + myDatabase.rename("mydb.db", // Database file to rename null, // Database to rename. Not used so // the entire file is renamed. - "newdb.db", // New name to use. + "newdb.db", // New name to use. null); // DatabaseConfig object. // None provided. } catch (FileNotFoundException fnfe) { // Exception handling goes here }

  • +
  • +

    + Environment.truncateDatabase() +

    +

    + Deletes every record in the database and optionally returns the + number of records that were deleted. Note that it is much less + expensive to truncate a database without counting the number of + records deleted than it is to truncate and count. +

    + +
    int numDiscarded = 
    +    myEnv.truncate(null,                          // txn handle
    +                   myDatabase.getDatabaseName(),  // database name
    +                   true);                         // If true, then the 
    +                                                  // number of records 
    +                                                  // deleted are counted.
    +System.out.println("Discarded " + numDiscarded +
    +                   " records from database " + 
    +                   myDatabase.getDatabaseName()); 
    +
  • @@ -101,7 +105,7 @@ try {
    - + diff --git a/db/docs/gsg/JAVA/DBEntry.html b/db/docs/gsg/JAVA/DBEntry.html index 46237dfa9..9986b8494 100644 --- a/db/docs/gsg/JAVA/DBEntry.html +++ b/db/docs/gsg/JAVA/DBEntry.html @@ -87,7 +87,7 @@
    - Serializeable Complex Objects + Serializable Complex Objects
    @@ -121,7 +121,10 @@ Java primitive types to complex Java objects so long as that data can be represented as a Java byte array. Note that due to performance considerations, you should not use Java serialization to convert - a Java object to a byte array. + a Java object to a byte array. Instead, use the Bind APIs + to perform this conversion (see + Using the BIND APIs for more + information).

    This chapter describes how you can convert both Java primitives and Java @@ -146,9 +149,12 @@ — one for the key and another for the data. - The key and data information is stored in + The key and data information are passed to- + and returned from DB using DatabaseEntry objects as byte - arrays. Therefore, using DatabaseEntry instances + arrays. Using DatabaseEntrys allows DB to + change the underlying byte array as well as return multiple values (that + is, key and data). Therefore, using DatabaseEntry instances is mostly an exercise in efficiently moving your keys and your data in and out of byte arrays.

    @@ -158,18 +164,18 @@ pair of DatabaseEntry objects:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.db.DatabaseEntry;
     
     ...
     
    -String aKey = "key";
    -String aData = "data";
    +String aKey = "key";
    +String aData = "data";
     
     try {
    -    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
    -    DatabaseEntry theData = new DatabaseEntry(aData.getBytes("UTF-8"));
    +    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
    +    DatabaseEntry theData = new DatabaseEntry(aData.getBytes("UTF-8"));
     } catch (Exception e) {
         // Exception handling goes here
     }
    @@ -193,7 +199,7 @@ try {
             DatabaseEntry as follows:
         

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.db.DatabaseEntry;
     
    @@ -210,8 +216,8 @@ import com.sleepycat.db.DatabaseEntry;
     byte[] myKey = theKey.getData();
     byte[] myData = theData.getData();
     
    -String key = new String(myKey);
    -String data = new String(myData); 
    +String key = new String(myKey, "UTF-8"); +String data = new String(myData, "UTF-8");

    There are a large number of mechanisms that you can use to move data in and out of byte arrays. To help you with this diff --git a/db/docs/gsg/JAVA/DeleteEntryWCursor.html b/db/docs/gsg/JAVA/DeleteEntryWCursor.html index 78630680e..28348f7df 100644 --- a/db/docs/gsg/JAVA/DeleteEntryWCursor.html +++ b/db/docs/gsg/JAVA/DeleteEntryWCursor.html @@ -45,7 +45,7 @@

    For example:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
         
     import com.sleepycat.db.Cursor;
     import com.sleepycat.db.Database;
    @@ -63,7 +63,7 @@ try {
         ...
         // Create DatabaseEntry objects
         // searchKey is some String.
    -    DatabaseEntry theKey = new DatabaseEntry(searchKey.getBytes("UTF-8"));
    +    DatabaseEntry theKey = new DatabaseEntry(searchKey.getBytes("UTF-8"));
         DatabaseEntry theData = new DatabaseEntry();
     
         // Open a cursor using a database handle
    @@ -76,9 +76,10 @@ try {
         // Count the number of records using the given key. If there is only
         // one, delete that record.
         if (cursor.count() == 1) {
    -            System.out.println("Deleting " + 
    -                               new String(theKey.getData()) + "|" +
    -                               new String(theData.getData()));
    +            System.out.println("Deleting " + 
    +                               new String(theKey.getData(), "UTF-8") + 
    +                               "|" + 
    +                               new String(theData.getData(), "UTF-8"));
                 cursor.delete();
         }
     } catch (Exception e) {
    diff --git a/db/docs/gsg/JAVA/Positioning.html b/db/docs/gsg/JAVA/Positioning.html
    index a42ac98f9..124446528 100644
    --- a/db/docs/gsg/JAVA/Positioning.html
    +++ b/db/docs/gsg/JAVA/Positioning.html
    @@ -45,7 +45,7 @@
             For example:
          

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
     
     import com.sleepycat.db.Database;
     import com.sleepycat.db.DatabaseEntry;
    @@ -81,13 +81,13 @@ try {
             // DatabaseEntry held a byte array representation of some other data
             // type (such as a complex object) then this operation would look 
             // considerably different.
    -        String keyString = new String(foundKey.getData());
    -        String dataString = new String(foundData.getData());
    -        System.out.println("Key | Data : " + keyString + " | " + 
    -                       dataString + "");
    +        String keyString = new String(foundKey.getData(), "UTF-8");
    +        String dataString = new String(foundData.getData(), "UTF-8");
    +        System.out.println("Key | Data : " + keyString + " | " + 
    +                       dataString + "");
         }
     } catch (DatabaseException de) {
    -    System.err.println("Error accessing database." + de);
    +    System.err.println("Error accessing database." + de);
     } finally {
         // Cursors must be closed.
         cursor.close();
    @@ -99,7 +99,7 @@ try {
         the database. For example:
         

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
         
     import com.sleepycat.db.Cursor;
     import com.sleepycat.db.Database;
    @@ -128,12 +128,12 @@ try {
         while (cursor.getPrev(foundKey, foundData, LockMode.DEFAULT) == 
             OperationStatus.SUCCESS) {
     
    -        String theKey = new String(foundKey.getData());
    -        String theData = new String(foundData.getData());
    -        System.out.println("Key | Data : " +  theKey + " | " + theData + "");
    +        String theKey = new String(foundKey.getData(), "UTF-8");
    +        String theData = new String(foundData.getData(), "UTF-8");
    +        System.out.println("Key | Data : " +  theKey + " | " + theData + "");
         }
     } catch (DatabaseException de) {
    -    System.err.println("Error accessing database." + de);
    +    System.err.println("Error accessing database." + de);
     } finally {
         // Cursors must be closed.
         cursor.close();
    @@ -201,7 +201,9 @@ try {
                 that you provide for the database. If no 
                     comparator 
                      
    -            is provided, then the default lexicographical sorting is used.
    +                is provided, then the default 
    +                
    +                lexicographical sorting is used.
               

    For example, suppose you have database records that use the @@ -238,8 +240,9 @@ Arizona

    - Moves the cursor to the first record in the database whose key is - greater than or equal to the specified key. If the database supports + Moves the cursor to the first record in the database whose key matches the specified + key and whose data is + greater than or equal to the specified data. If the database supports duplicate records, then on matching the key, the cursor is moved to the duplicate record with the smallest data that is greater than or equal to the specified data. @@ -274,24 +277,19 @@ Arizona/Florence

    - - - + + + - + - - - - - - - - + + +
    Prev Prev  Up
    AlFlAlabama/FlorenceAlaskaFaAlaska/Fairbanks
    ArArizona Fl Arizona/Florence
    AlFaAlaska/Fairbanks
    AlAAlabama/AthensAlaskaAnAlaska/Anchorage
    @@ -309,7 +307,7 @@ Arizona/Florence

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.db.Cursor;
     import com.sleepycat.db.Database;
    @@ -321,8 +319,8 @@ import com.sleepycat.db.OperationStatus;
     ...
       
     // For this example, hard code the search key and data
    -String searchKey = "Al";
    -String searchData = "Fa";
    +String searchKey = "Alaska";
    +String searchData = "Fa";
     
     Cursor cursor = null;
     Database myDatabase = null;
    @@ -335,9 +333,9 @@ try {
         cursor = myDatabase.openCursor(null, null);
     
         DatabaseEntry theKey = 
    -         new DatabaseEntry(searchKey.getBytes("UTF-8"));
    +         new DatabaseEntry(searchKey.getBytes("UTF-8"));
         DatabaseEntry theData = 
    -         new DatabaseEntry(searchData.getBytes("UTF-8"));
    +         new DatabaseEntry(searchData.getBytes("UTF-8"));
     
         // Open a cursor using a database handle
         cursor = myDatabase.openCursor(null, null);
    @@ -345,21 +343,21 @@ try {
         // Perform the search
         OperationStatus retVal = cursor.getSearchBothRange(theKey, theData, 
                                                            LockMode.DEFAULT);
    -    // NOTFOUND is returned if a record cannot be found whose key begins 
    -    // with the search key AND whose data begins with the search data.
    +    // NOTFOUND is returned if a record cannot be found whose key 
    +    // matches the search key AND whose data begins with the search data.
         if (retVal == OperationStatus.NOTFOUND) {
    -        System.out.println(searchKey + "/" + searchData + 
    -                           " not matched in database " + 
    +        System.out.println(searchKey + "/" + searchData + 
    +                           " not matched in database " + 
                                myDatabase.getDatabaseName());
         } else {
             // Upon completing a search, the key and data DatabaseEntry 
             // parameters for getSearchBothRange() are populated with the 
             // key/data values of the found record.
    -        String foundKey = new String(theKey.getData());
    -        String foundData = new String(theData.getData());
    -        System.out.println("Found record " + foundKey + "/" + foundData + 
    -                           "for search key/data: " + searchKey + 
    -                           "/" + searchData);
    +        String foundKey = new String(theKey.getData(), "UTF-8");
    +        String foundData = new String(theData.getData(), "UTF-8");
    +        System.out.println("Found record " + foundKey + "/" + foundData + 
    +                           "for search key/data: " + searchKey + 
    +                           "/" + searchData);
         }
     
     } catch (Exception e) {
    @@ -525,7 +523,7 @@ Arizona/Florence
    only String objects for the keys and data.

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
           
     import com.sleepycat.db.Cursor;
     import com.sleepycat.db.Database;
    @@ -545,7 +543,7 @@ try {
     
         // Create DatabaseEntry objects
         // searchKey is some String.
    -    DatabaseEntry theKey = new DatabaseEntry(searchKey.getBytes("UTF-8"));
    +    DatabaseEntry theKey = new DatabaseEntry(searchKey.getBytes("UTF-8"));
         DatabaseEntry theData = new DatabaseEntry();
     
         // Open a cursor using a database handle
    @@ -560,10 +558,10 @@ try {
         // print the duplicates.
         if (cursor.count() > 1) {
             while (retVal == OperationStatus.SUCCESS) {
    -            String keyString = new String(theKey.getData());
    -            String dataString = new String(theData.getData());
    -            System.out.println("Key | Data : " +  keyString + " | " + 
    -                               dataString + "");
    +            String keyString = new String(theKey.getData(), "UTF-8");
    +            String dataString = new String(theData.getData(), "UTF-8");
    +            System.out.println("Key | Data : " +  keyString + " | " + 
    +                               dataString + "");
        
                 retVal = cursor.getNextDup(theKey, theData, LockMode.DEFAULT);
             }
    diff --git a/db/docs/gsg/JAVA/PutEntryWCursor.html b/db/docs/gsg/JAVA/PutEntryWCursor.html
    index d4cada443..cbad1a7ec 100644
    --- a/db/docs/gsg/JAVA/PutEntryWCursor.html
    +++ b/db/docs/gsg/JAVA/PutEntryWCursor.html
    @@ -42,10 +42,7 @@
         

    Note that when putting records to the database using a cursor, the - cursor is positioned at the record you inserted. Also, you can not - transactionally protect a put that is performed using a cursor; - if you want to transactionall protect your database writes, - put recrods using the database handle directly. + cursor is positioned at the record you inserted.

      @@ -140,7 +137,7 @@

    For example:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
         
     import com.sleepycat.db.Cursor;
     import com.sleepycat.db.Database;
    @@ -150,11 +147,11 @@ import com.sleepycat.db.OperationStatus;
     ...
       
     // Create the data to put into the database
    -String key1str = "My first string";
    -String data1str = "My first data";
    -String key2str = "My second string";
    -String data2str = "My second data";
    -String data3str = "My third data";
    +String key1str = "My first string";
    +String data1str = "My first data";
    +String key2str = "My second string";
    +String data2str = "My second data";
    +String data3str = "My third data";
       
     Cursor cursor = null;
     Database myDatabase = null;
    @@ -163,11 +160,11 @@ try {
         // Database open omitted for brevity
         ...
     
    -    DatabaseEntry key1 = new DatabaseEntry(key1str.getBytes("UTF-8"));
    -    DatabaseEntry data1 = new DatabaseEntry(data1str.getBytes("UTF-8"));
    -    DatabaseEntry key2 = new DatabaseEntry(key2str.getBytes("UTF-8"));
    -    DatabaseEntry data2 = new DatabaseEntry(data2str.getBytes("UTF-8"));
    -    DatabaseEntry data3 = new DatabaseEntry(data3str.getBytes("UTF-8"));
    +    DatabaseEntry key1 = new DatabaseEntry(key1str.getBytes("UTF-8"));
    +    DatabaseEntry data1 = new DatabaseEntry(data1str.getBytes("UTF-8"));
    +    DatabaseEntry key2 = new DatabaseEntry(key2str.getBytes("UTF-8"));
    +    DatabaseEntry data2 = new DatabaseEntry(data2str.getBytes("UTF-8"));
    +    DatabaseEntry data3 = new DatabaseEntry(data3str.getBytes("UTF-8"));
     
         // Open a cursor using a database handle
         cursor = myDatabase.openCursor(null, null);
    diff --git a/db/docs/gsg/JAVA/ReplacingEntryWCursor.html b/db/docs/gsg/JAVA/ReplacingEntryWCursor.html
    index 29cff39a6..beb492675 100644
    --- a/db/docs/gsg/JAVA/ReplacingEntryWCursor.html
    +++ b/db/docs/gsg/JAVA/ReplacingEntryWCursor.html
    @@ -61,7 +61,7 @@ try {
         ...
         // Create DatabaseEntry objects
         // searchKey is some String.
    -    DatabaseEntry theKey = new DatabaseEntry(searchKey.getBytes("UTF-8"));
    +    DatabaseEntry theKey = new DatabaseEntry(searchKey.getBytes("UTF-8"));
         DatabaseEntry theData = new DatabaseEntry();
     
         // Open a cursor using a database handle
    @@ -72,9 +72,9 @@ try {
                                                      LockMode.DEFAULT);
         
         // Replacement data
    -    String replaceStr = "My replacement string";
    +    String replaceStr = "My replacement string";
         DatabaseEntry replacementData = 
    -        new DatabaseEntry(replaceStr.getBytes("UTF-8"));
    +        new DatabaseEntry(replaceStr.getBytes("UTF-8"));
         cursor.putCurrent(replacementData);
     } catch (Exception e) {
         // Exception handling goes here
    diff --git a/db/docs/gsg/JAVA/accessmethods.html b/db/docs/gsg/JAVA/accessmethods.html
    index 02469bb95..dcbd74844 100644
    --- a/db/docs/gsg/JAVA/accessmethods.html
    +++ b/db/docs/gsg/JAVA/accessmethods.html
    @@ -141,7 +141,7 @@
             

    Once you have made this decision, you must choose between either - BTree or Queue, or Hash or Recno. This decision is described next. + BTree or Hash, or Queue or Recno. This decision is described next.

    diff --git a/db/docs/gsg/JAVA/bindAPI.html b/db/docs/gsg/JAVA/bindAPI.html index ac872849a..b8ce535ef 100644 --- a/db/docs/gsg/JAVA/bindAPI.html +++ b/db/docs/gsg/JAVA/bindAPI.html @@ -38,8 +38,12 @@ and out of Java byte arrays for storage in a database can be a nontrivial operation. To help you with this problem, DB provides the Bind APIs. While these APIs are described in detail in the - Sleepycat Java Collections Tutorial (see - http://www.sleepycat.com/docs/ref/toc.html), + + + + Berkeley DB Collections Tutorial, + + this section provides a brief introduction to using the Bind APIs with:

      @@ -52,14 +56,14 @@
    • Complex objects that implement Java serialization.

      Use this if you are storing objects that implement - Serializable and if you do not want to sort on - this information.

      + Serializable and if you do not need to sort them. +

    • Non-serialized complex objects.

      If you are storing objects that do not implement serialization, you can create your own custom tuple bindings. Note that you should - use custom tuple bindings even if your objects are serializeable if + use custom tuple bindings even if your objects are serializable if you want to sort on that data.

    @@ -132,7 +136,7 @@
  • Create an EntryBinding object.

    When you do this, you use TupleBinding.getPrimitiveBinding() - to return the binding that you use for the conversion.

    + to return an appropriate binding for the conversion.

  • Use the EntryBinding object to place @@ -143,7 +147,7 @@

    Once the data is stored in the DatabaseEntry, you can put it to the database in whatever manner you wish. For example:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.bind.EntryBinding;
     import com.sleepycat.bind.tuple.TupleBinding;
    @@ -157,8 +161,8 @@ Database myDatabase = null;
     
     // Need a key for the put.
     try {
    -    String aKey = "myLong";
    -    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));    
    +    String aKey = "myLong";
    +    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));    
     
         // Now build the DatabaseEntry using a TupleBinding
         Long myLong = new Long(123456789l);
    @@ -174,7 +178,7 @@ try {
             

    Retrieval from the DatabaseEntry object is performed in much the same way:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
           
     import com.sleepycat.bind.EntryBinding;
     import com.sleepycat.bind.tuple.TupleBinding;
    @@ -190,8 +194,8 @@ Database myDatabase = null;
     
     try {
         // Need a key for the get
    -    String aKey = "myLong";
    -    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
    +    String aKey = "myLong";
    +    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
         
         // Need a DatabaseEntry to hold the associated data.
         DatabaseEntry theData = new DatabaseEntry();
    @@ -208,11 +212,11 @@ try {
             // Use the binding to convert the byte array contained in theData
             // to a Long type.
             Long theLong = (Long) myBinding.entryToObject(theData);
    -        retKey = new String(theKey.getData());
    -        System.out.println("For key: '" + retKey + "' found Long: '" + 
    -                            theLong + "'.");
    +        retKey = new String(theKey.getData(), "UTF-8");
    +        System.out.println("For key: '" + retKey + "' found Long: '" + 
    +                            theLong + "'.");
         } else {
    -        System.out.println("No record found for key '" + retKey + "'.");
    +        System.out.println("No record found for key '" + retKey + "'.");
         }
     } catch (Exception e) {
         // Exception handling goes here
    @@ -222,7 +226,7 @@ try {
             
    -

    Serializeable Complex Objects

    +

    Serializable Complex Objects

    @@ -241,7 +245,7 @@ try { DB database, you must convert them to and from a byte array. The first instinct for many Java programmers is to do this using Java serialization. While this is functionally a correct solution, the result - is poor performance because this causes the class information + is poor space-performance because this causes the class information to be stored on every such database record. This information can be quite large and it is redundant — the class information does not vary for serialized objects of the same type.

    @@ -256,7 +260,7 @@ try { object information to be saved off to a unique Database dedicated for that purpose. This means that you do not have to duplicate that information on each record in the Database - that your application is using to store it's information.

    + that your application is using to store its information.

    Note that when you use the Bind APIs to perform serialization, you still receive all the benefits of serialization. You can still use arbitrarily @@ -281,12 +285,13 @@ try {

    • -

      If you need to sort based on the objects your are storing. - The sort order is meaningless for the byte arrays that you - obtain through serialization. Consequently, you should not use serialization for keys if you - care about their sort order. You should - also not use serialization for record data if your - Database supports duplicate records and you care about sort order. +

      + If you need to sort based on the objects your are storing. + The sort order is meaningless for the byte arrays that you + obtain through serialization. Consequently, you should not use serialization for keys if you + care about their sort order. You should + also not use serialization for record data if your + Database supports duplicate records and you care about sort order.

    • @@ -317,13 +322,14 @@ try {
    -

    To serialize and store a serializeable complex object using the +

    To store a serializable complex object using the Bind APIs:

    1. -

      Implement the class whose instances that you want to store. - Note that this class must implement java.io.Serializable. +

      + Implement java.io.Serializable in the class whose instances that + you want to store.

    2. @@ -353,7 +359,7 @@ try { looks something like this:

      -
      package com.sleepycat.examples.db.GettingStarted;    
      +          
      package db.GettingStarted;    
       
       import java.io.Serializable;
       
      @@ -394,7 +400,7 @@ public class MyData implements Serializable {
       }

      You can then store instances of this class as follows:

      -
      package com.sleepycat.examples.db.GettingStarted;
      +          
      package db.GettingStarted;
       
       import com.sleepycat.bind.EntryBinding;
       import com.sleepycat.bind.serial.StoredClassCatalog;
      @@ -406,13 +412,13 @@ import com.sleepycat.db.DatabaseType;
       ...
       
       // The key data.
      -String aKey = "myData";
      +String aKey = "myData";
       
       // The data data
       MyData data2Store = new MyData();
       data2Store.setLong(123456789l);
       data2Store.setDouble(1234.9876543);
      -data2Store.setDescription("A test instance of this class");
      +data2Store.setDescription("A test instance of this class");
       
       try {
           // Open the database that you will use to store your data
      @@ -420,13 +426,13 @@ try {
           myDbConfig.setAllowCreate(true);
           myDbConfig.setSortedDuplicates(true);
           myDbConfig.setType(DatabaseType.BTREE);
      -    Database myDatabase = new Database("myDb", null, myDbConfig);
      +    Database myDatabase = new Database("myDb", null, myDbConfig);
       
           // Open the database that you use to store your class information.
           // The db used to store class information does not require duplicates
           // support.
           myDbConfig.setSortedDuplicates(false);
      -    Database myClassDb = new Database("classDb", null, myDbConfig); 
      +    Database myClassDb = new Database("classDb", null, myDbConfig); 
       
           // Instantiate the class catalog
           StoredClassCatalog classCatalog = new StoredClassCatalog(myClassDb);
      @@ -436,7 +442,7 @@ try {
                                                        MyData.class);
       
           // Create the DatabaseEntry for the key
      -    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
      +    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
       
           // Create the DatabaseEntry for the data. Use the EntryBinding object
           // that was just created to populate the DatabaseEntry
      @@ -465,7 +471,7 @@ try {
               DatabaseEntry using the Bind APIs in much the
               same way as is described above. For example:

      -
      package com.sleepycat.examples.db.GettingStarted;
      +          
      package db.GettingStarted;
       
       import com.sleepycat.bind.EntryBinding;
       import com.sleepycat.bind.serial.StoredClassCatalog;
      @@ -479,17 +485,17 @@ import com.sleepycat.db.LockMode;
       ...
       
       // The key data.
      -String aKey = "myData";
      +String aKey = "myData";
       
       try {
           // Open the database that stores your data
           DatabaseConfig myDbConfig = new DatabaseConfig();
           myDbConfig.setAllowCreate(false);
           myDbConfig.setType(DatabaseType.BTREE);
      -    Database myDatabase = new Database("myDb", null, myDbConfig);
      +    Database myDatabase = new Database("myDb", null, myDbConfig);
       
           // Open the database that stores your class information.
      -    Database myClassDb = new Database("classDb", null, myDbConfig); 
      +    Database myClassDb = new Database("classDb", null, myDbConfig); 
       
           // Instantiate the class catalog
           StoredClassCatalog classCatalog = new StoredClassCatalog(myClassDb);
      @@ -499,7 +505,7 @@ try {
                                                        MyData.class);
       
           // Create DatabaseEntry objects for the key and data
      -    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
      +    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
           DatabaseEntry theData = new DatabaseEntry();
       
           // Do the get as normal
      @@ -536,18 +542,18 @@ try {
             

      For information on using serialization to store complex objects, see - Serializeable Complex Objects. + Serializable Complex Objects.

      To store complex objects using a custom tuple binding:

      1. Implement the class whose instances that you want to store. - Note that you do not have to implement serialization.

        + Note that you do not have to implement the Serializable interface.

      2. -

        Implement the com.sleepycat.bind.tuple.TupleBinding - interface.

        +

        Write a tuple binding using the com.sleepycat.bind.tuple.TupleBinding + class.

      3. Open (create) your database. Unlike serialization, you only @@ -569,7 +575,7 @@ try { following class:

        -
        package com.sleepycat.examples.db.GettingStarted;
        +        
        package db.GettingStarted;
         
         public class MyData2 {
             private long longData;
        @@ -579,7 +585,7 @@ public class MyData2 {
             public MyData2() {
                 longData = 0;
                 doubleData = new Double(0.0);
        -        description = "";
        +        description = "";
             }
         
             public void setLong(long data) {
        @@ -651,7 +657,7 @@ public class MyData2 {
                 

      For example:

      -
      package com.sleepycat.examples.db.GettingStarted;
      +        
      package db.GettingStarted;
       
       import com.sleepycat.bind.tuple.TupleBinding;
       import com.sleepycat.bind.tuple.TupleInput;
      @@ -706,7 +712,7 @@ public class MyTupleBinding extends TupleBinding {
               

    For example:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.bind.tuple.TupleBinding;
     import com.sleepycat.db.DatabaseEntry;
    @@ -718,7 +724,7 @@ TupleBinding keyBinding = new MyTupleBinding();
     MyData2 theKeyData = new MyData2();
     theKeyData.setLong(123456789l);
     theKeyData.setDouble(new Double(12345.6789));
    -theKeyData.setString("My key data");
    +theKeyData.setString("My key data");
     
     DatabaseEntry myKey = new DatabaseEntry();
     
    diff --git a/db/docs/gsg/JAVA/btree.html b/db/docs/gsg/JAVA/btree.html
    index 5deb0fa36..fc2545ee2 100644
    --- a/db/docs/gsg/JAVA/btree.html
    +++ b/db/docs/gsg/JAVA/btree.html
    @@ -305,7 +305,7 @@
                 to support sorted duplicate records:
             

    -
    package com.sleepycat.examples.db.GettingStarted;
    +          
    package db.GettingStarted;
     
     import java.io.FileNotFoundException;
     
    @@ -328,12 +328,12 @@ try {
         myDbConfig.setSortedDuplicates(true);
     
        // Open the database
    -   myDb = new Database("mydb.db", null, myDbConfig);
    +   myDb = new Database("mydb.db", null, myDbConfig);
     } catch(DatabaseException dbe) {
    -    System.err.println("MyDbs: " + dbe.toString());
    +    System.err.println("MyDbs: " + dbe.toString());
         System.exit(-1);
     } catch(FileNotFoundException fnfe) {
    -    System.err.println("MyDbs: " + fnfe.toString());
    +    System.err.println("MyDbs: " + fnfe.toString());
         System.exit(-1);
     } 
  • @@ -381,7 +381,7 @@ try { do not sort well when viewed as byte strings. There are several solutions to this problem, one being to provide a custom comparison function. See - http://www.sleepycat.com/docs/ref/am_misc/faq.html + http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_misc/faq.html for more information.

    @@ -464,7 +464,7 @@ try { following:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +          
    package db.GettingStarted;
     
     import java.util.Comparator;
     
    @@ -486,7 +486,7 @@ public class MyDataComparator implements Comparator {
             To use this comparator:
         

    -
    package com.sleepycat.examples.db.GettingStarted;
    +          
    package db.GettingStarted;
     
     import java.io.FileNotFoundException;
     import java.util.Comparator;
    @@ -508,7 +508,7 @@ try {
     
         // Open the database that you will use to store your data
         myDbConfig.setSortedDuplicates(true);
    -    myDatabase = new Database("myDb", null, myDbConfig);
    +    myDatabase = new Database("myDb", null, myDbConfig);
     } catch (DatabaseException dbe) {
         // Exception handling goes here
     } catch (FileNotFoundException fnfe) {
    diff --git a/db/docs/gsg/JAVA/concepts.html b/db/docs/gsg/JAVA/concepts.html
    index 8404051db..161e6a25b 100644
    --- a/db/docs/gsg/JAVA/concepts.html
    +++ b/db/docs/gsg/JAVA/concepts.html
    @@ -42,7 +42,7 @@
             Conceptually, DB databases contain records.
             Logically each record represents a single entry in the database. 
             Each such record contains two pieces of information: a key and a data.
    -        This manual will on occaison describe a a record's
    +        This manual will on occasion describe a a record's
             key or a record's data when it is
             necessary to speak to one or the other portion of a database
             record.
    diff --git a/db/docs/gsg/JAVA/coredbclose.html b/db/docs/gsg/JAVA/coredbclose.html
    index 29908b785..6ded493dc 100644
    --- a/db/docs/gsg/JAVA/coredbclose.html
    +++ b/db/docs/gsg/JAVA/coredbclose.html
    @@ -9,7 +9,7 @@
         
         
         
    -    
    +    
       
       
         

    In ExampleDatabaseRead.run(), we call MyDbs.setup() to open our databases. Then we create the bindings that we need for using our data objects with @@ -187,7 +187,7 @@ import com.sleepycat.db.OperationStatus;

    displayInventoryRecord(foundKey, theInventory); } } catch (Exception e) { - System.err.println("Error on inventory cursor:"); + System.err.println("Error on inventory cursor:"); System.err.println(e.toString()); e.printStackTrace(); } finally { @@ -206,40 +206,40 @@ import com.sleepycat.db.OperationStatus;
    Inventory theInventory) throws DatabaseException { - String theSKU = new String(theKey.getData()); - System.out.println(theSKU + ":"); - System.out.println("\t " + theInventory.getItemName()); - System.out.println("\t " + theInventory.getCategory()); - System.out.println("\t " + theInventory.getVendor()); - System.out.println("\t\tNumber in stock: " + + String theSKU = new String(theKey.getData(), "UTF-8"); + System.out.println(theSKU + ":"); + System.out.println("\t " + theInventory.getItemName()); + System.out.println("\t " + theInventory.getCategory()); + System.out.println("\t " + theInventory.getVendor()); + System.out.println("\t\tNumber in stock: " + theInventory.getVendorInventory()); - System.out.println("\t\tPrice per unit: " + + System.out.println("\t\tPrice per unit: " + theInventory.getVendorPrice()); - System.out.println("\t\tContact: "); + System.out.println("\t\tContact: "); DatabaseEntry searchKey = null; try { searchKey = - new DatabaseEntry(theInventory.getVendor().getBytes("UTF-8")); + new DatabaseEntry(theInventory.getVendor().getBytes("UTF-8")); } catch (IOException willNeverOccur) {} DatabaseEntry foundVendor = new DatabaseEntry(); if (myDbs.getVendorDB().get(null, searchKey, foundVendor, LockMode.DEFAULT) != OperationStatus.SUCCESS) { - System.out.println("Could not find vendor: " + - theInventory.getVendor() + "."); + System.out.println("Could not find vendor: " + + theInventory.getVendor() + "."); System.exit(-1); } else { Vendor theVendor = (Vendor)vendorBinding.entryToObject(foundVendor); - System.out.println("\t\t " + theVendor.getAddress()); - System.out.println("\t\t " + theVendor.getCity() + ", " + - theVendor.getState() + " " + theVendor.getZipcode()); - System.out.println("\t\t Business Phone: " + + System.out.println("\t\t " + theVendor.getAddress()); + System.out.println("\t\t " + theVendor.getCity() + ", " + + theVendor.getState() + " " + theVendor.getZipcode()); + System.out.println("\t\t Business Phone: " + theVendor.getBusinessPhoneNumber()); - System.out.println("\t\t Sales Rep: " + + System.out.println("\t\t Sales Rep: " + theVendor.getRepName()); - System.out.println("\t\t " + + System.out.println("\t\t " + theVendor.getRepPhoneNumber()); } }
    @@ -248,7 +248,7 @@ import com.sleepycat.db.OperationStatus;
    document, this is relatively uninteresting. You can see how this is implemented by looking at:

    -
    DB_INSTALL/examples_java/src/com/sleepycat/examples/db/GettingStarted
    +
    DB_INSTALL/examples_java/db/GettingStarted

    where DB_INSTALL is the location where you placed your DB distribution. diff --git a/db/docs/gsg/JAVA/dbErrorReporting.html b/db/docs/gsg/JAVA/dbErrorReporting.html index d36831daf..261db41fb 100644 --- a/db/docs/gsg/JAVA/dbErrorReporting.html +++ b/db/docs/gsg/JAVA/dbErrorReporting.html @@ -93,7 +93,7 @@ handler, first implement the handler:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
     
     import com.sleepycat.db.Environment;
     import com.sleepycat.db.MessageHandler;
    @@ -114,7 +114,7 @@ public class MyMessageHandler implements MessageHandler  {
             it on the database's DatabaseConfig object:
         

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
     
     import com.sleepycat.db.DatabaseConfig;
     
    diff --git a/db/docs/gsg/JAVA/dbconfig.html b/db/docs/gsg/JAVA/dbconfig.html
    index 51454bca2..cf7d93bbe 100644
    --- a/db/docs/gsg/JAVA/dbconfig.html
    +++ b/db/docs/gsg/JAVA/dbconfig.html
    @@ -108,8 +108,7 @@
         applications use BTree. For this reason, where configuration issues are
         dependent on the type of access method in use, this chapter will focus on
         BTree only. For configuration descriptions surrounding the other access
    -    methods, see the Berkeley DB Programmer's Tutorial and Reference
    -    Guide.
    +    methods, see the Berkeley DB Programmer's Reference Guide.
       

    @@ -274,8 +273,8 @@ method, or use the db_stat command line utility. - The number of locks that could not be obtained due to conflicts is - held in the lock statistic's st_nconflicts field. + The number of unavailable locks that your application waited for is + held in the lock statistic's st_lock_wait field.

    @@ -339,7 +338,7 @@ filesystem's block size causes DB to write pages in block size increments. As a result, it is possible for a partial page to be written as the result of a transactional commit. For more - information, see http://www.sleepycat.com/docs/ref/transapp/reclimit.html. + information, see http://www.oracle.com/technology/documentation/berkeley-db/db/ref/transapp/reclimit.html.

    diff --git a/db/docs/gsg/JAVA/dbtJavaUsage.html b/db/docs/gsg/JAVA/dbtJavaUsage.html index 191aa5252..69d46266d 100644 --- a/db/docs/gsg/JAVA/dbtJavaUsage.html +++ b/db/docs/gsg/JAVA/dbtJavaUsage.html @@ -44,7 +44,7 @@ Again, remember that you can find the complete implementation for these functions in:

    -
    DB_INSTALL/examples_java/src/com/sleepycat/examples/db/GettingStarted
    +
    DB_INSTALL/examples_java/db/GettingStarted

    where DB_INSTALL is the location where you placed your DB distribution. @@ -79,7 +79,7 @@

    // File Inventory.java
    -package com.sleepycat.examples.db.GettingStarted;
    +package db.GettingStarted;
     
     public class Inventory {
     
    @@ -135,7 +135,7 @@ public class Inventory {
           

    // File Vendor.java
    -package com.sleepycat.examples.db.GettingStarted;
    +package db.GettingStarted;
     
     import java.io.Serializable;
     
    @@ -184,8 +184,7 @@ public class Vendor implements Serializable {
     
         ...
         // Corresponding getter methods omitted for brevity.
    -    // See examples/com/sleepycat/examples/je/gettingStarted/
    -    //   examples/Vendor.java
    +    // See examples/je/gettingStarted/Vendor.java
         // for a complete implementation of this class.
     
     } 
    @@ -202,7 +201,7 @@ public class Vendor implements Serializable {

    // File InventoryBinding.java
    -package com.sleepycat.examples.db.GettingStarted;
    +package db.GettingStarted;
     
     import com.sleepycat.bind.tuple.TupleBinding;
     import com.sleepycat.bind.tuple.TupleInput;
    @@ -320,7 +319,7 @@ public class InventoryBinding extends TupleBinding {
             

    // File: MyDbs.java
    -package com.sleepycat.examples.db.GettingStarted;
    +package db.GettingStarted;
                                                                                                                                       
     import com.sleepycat.bind.serial.StoredClassCatalog;
     
    @@ -346,9 +345,9 @@ import java.io.FileNotFoundException; 
    // Needed for object serialization private StoredClassCatalog classCatalog; - private String vendordb = "VendorDB.db"; - private String inventorydb = "InventoryDB.db"; - private String classcatalogdb = "ClassCatalogDB.db"; + private String vendordb = "VendorDB.db"; + private String inventorydb = "InventoryDB.db"; + private String classcatalogdb = "ClassCatalogDB.db"; // Our constructor does nothing public MyDbs() {}
    @@ -371,25 +370,25 @@ import java.io.FileNotFoundException;
    // Now open, or create and open, our databases // Open the vendors and inventory databases try { - vendordb = databasesHome + "/" + vendordb; + vendordb = databasesHome + "/" + vendordb; vendorDb = new Database(vendordb, null, myDbConfig); - inventorydb = databasesHome + "/" + inventorydb; + inventorydb = databasesHome + "/" + inventorydb; inventoryDb = new Database(inventorydb, null, myDbConfig); // Open the class catalog db. This is used to // optimize class serialization. - classcatalogdb = databasesHome + "/" + classcatalogdb; + classcatalogdb = databasesHome + "/" + classcatalogdb; classCatalogDb = new Database(classcatalogdb, null, myDbConfig); } catch(FileNotFoundException fnfe) { - System.err.println("MyDbs: " + fnfe.toString()); + System.err.println("MyDbs: " + fnfe.toString()); System.exit(-1); } }
    @@ -435,7 +434,7 @@ import java.io.FileNotFoundException;
    classCatalogDb.close(); }
    } catch(DatabaseException dbe) { - System.err.println("Error closing MyDbs: " + + System.err.println("Error closing MyDbs: " + dbe.toString()); System.exit(-1); } @@ -460,7 +459,7 @@ import java.io.FileNotFoundException;

    First we need the usual series of import statements:

    // File: ExampleDatabaseLoad.java
    -package com.sleepycat.examples.db.GettingStarted;
    +package db.GettingStarted;
                                                                                                                                            
     import java.io.BufferedReader;
     import java.io.File;
    @@ -469,6 +468,7 @@ import java.io.FileNotFoundException;
     import java.io.IOException;
     import java.io.InputStreamReader;
     import java.util.ArrayList;
    +import java.util.List;
     
     import com.sleepycat.bind.EntryBinding;
     import com.sleepycat.bind.serial.SerialBinding;
    @@ -491,9 +491,9 @@ import com.sleepycat.db.DatabaseException; 
    public class ExampleDatabaseLoad {
     
    -    private static String myDbsPath = "./";
    -    private static File inventoryFile = new File("./inventory.txt");
    -    private static File vendorsFile = new File("./vendors.txt");
    +    private static String myDbsPath = "./";
    +    private static File inventoryFile = new File("./inventory.txt");
    +    private static File vendorsFile = new File("./vendors.txt");
     
         // DatabaseEntries used for loading records
         private static DatabaseEntry theKey = new DatabaseEntry();
    @@ -517,8 +517,8 @@ import com.sleepycat.db.DatabaseException; 
    handles for you.

        private static void usage() {
    -        System.out.println("ExampleDatabaseLoad [-h <database home>]");
    -        System.out.println("      [-s <selections file>] [-v <vendors file>]");
    +        System.out.println("ExampleDatabaseLoad [-h <database home>]");
    +        System.out.println("      [-s <selections file>] [-v <vendors file>]");
             System.exit(-1);
         }
     
    @@ -527,15 +527,15 @@ import com.sleepycat.db.DatabaseException; 
    try { edl.run(args); } catch (DatabaseException dbe) { - System.err.println("ExampleDatabaseLoad: " + dbe.toString()); + System.err.println("ExampleDatabaseLoad: " + dbe.toString()); dbe.printStackTrace(); } catch (Exception e) { - System.out.println("Exception: " + e.toString()); + System.out.println("Exception: " + e.toString()); e.printStackTrace(); } finally { myDbs.close(); } - System.out.println("All done."); + System.out.println("All done."); }

    Next we write the ExampleDatabaseLoad.run() method. This method is responsible for initializing all objects. @@ -551,9 +551,9 @@ import com.sleepycat.db.DatabaseException;

    myDbs.setup(myDbsPath); // path to the environment home - System.out.println("loading vendors db."); + System.out.println("loading vendors db."); loadVendorsDb(); - System.out.println("loading inventory db."); + System.out.println("loading inventory db."); loadInventoryDb(); }

    This next method loads the vendor database. This method @@ -567,7 +567,7 @@ import com.sleepycat.db.DatabaseException;

    // and loads it into a list for us to work with. The integer // parameter represents the number of fields expected in the // file. - ArrayList vendors = loadFile(vendorsFile, 8); + List vendors = loadFile(vendorsFile, 8); // Now load the data into the database. The vendor's name is the // key, and the data is a Vendor class object. @@ -592,7 +592,7 @@ import com.sleepycat.db.DatabaseException;
    // ASSUMES THE VENDOR'S NAME IS UNIQUE! String vendorName = theVendor.getVendorName(); try { - theKey = new DatabaseEntry(vendorName.getBytes("UTF-8")); + theKey = new DatabaseEntry(vendorName.getBytes("UTF-8")); } catch (IOException willNeverOccur) {} // Convert the Vendor object to a DatabaseEntry object @@ -614,7 +614,7 @@ import com.sleepycat.db.DatabaseException;
    // and loads it into a list for us to work with. The integer // parameter represents the number of fields expected in the // file. - ArrayList inventoryArray = loadFile(inventoryFile, 6); + List inventoryArray = loadFile(inventoryFile, 6); // Now load the data into the database. The item's sku is the // key, and the data is an Inventory class object. @@ -626,7 +626,7 @@ import com.sleepycat.db.DatabaseException;
    String[] sArray = (String[])inventoryArray.get(i); String sku = sArray[1]; try { - theKey = new DatabaseEntry(sku.getBytes("UTF-8")); + theKey = new DatabaseEntry(sku.getBytes("UTF-8")); } catch (IOException willNeverOccur) {} Inventory theInventory = new Inventory(); @@ -659,8 +659,8 @@ import com.sleepycat.db.DatabaseException;
    // Implementation omitted for brevity. } - private ArrayList loadFile(File theFile, int numFields) { - ArrayList records = new ArrayList(); + private List loadFile(File theFile, int numFields) { + List records = new ArrayList(); // Implementation omitted for brevity. return records; } @@ -673,7 +673,7 @@ import com.sleepycat.db.DatabaseException; implemented by looking at ExampleDatabaseLoad.java in:

    -
    DB_INSTALL/examples_java/src/com/sleepycat/examples/db/GettingStarted
    +
    DB_INSTALL/examples_java/db/GettingStarted

    where DB_INSTALL is the location where you placed your DB distribution. diff --git a/db/docs/gsg/JAVA/environments.html b/db/docs/gsg/JAVA/environments.html index fa1493eb4..95107b29c 100644 --- a/db/docs/gsg/JAVA/environments.html +++ b/db/docs/gsg/JAVA/environments.html @@ -45,7 +45,7 @@

    While environments are frequently not used by applications running in embedded environments where every byte counts, they will be used by - virutally any other DB application requiring anything other than + virtually any other DB application requiring anything other than the bare minimum functionality. An environment is essentially an encapsulation of one or more databases. Essentially, you open an environment and then you open databases in that environment. @@ -64,7 +64,7 @@

    It is possible in DB to contain multiple databases in a - single physical file on disk. This is desireable for those + single physical file on disk. This is desirable for those application that open more than a few handful of databases. However, in order to have more than one database contained in a single physical file, your application @@ -116,15 +116,16 @@ obtain a high-degree of recoverability in the face of an application or system crash. Once enabled, the logging subsystem allows the application to perform two kinds of recovery - ("normal" and "catastrophic") through the use of the information + ("normal" and "catastrophic") through the use of the information contained in the log files.

    - All of these topics are described in the Berkeley DB - Programmer's Reference Guide. + For more information on these topics, see the + Berkeley DB Getting Started with Transaction Processing guide and the + Berkeley DB Getting Started with Replicated Applications guide.

    - You can obtain DB by visiting the Sleepycat download page: - http://www.sleepycat.com/download/index.shtml. + You can obtain DB by visiting the Berkeley DB download page: + http://www.oracle.com/technology/software/products/berkeley-db/db/index.html.

    To install DB, untar or unzip the distribution to the directory of @@ -49,9 +49,9 @@

    That page also contains links to more documentation for DB. In - particular, you will find links for the Berkeley DB - Programmer's Tutorial and Reference Guide as - well as the API reference documentation. + particular, you will find links for the + Berkeley DB Programmer's Reference Guide + as well as the API reference documentation.

    @@ -169,7 +187,7 @@
    - Database Properties + Database Properties
    @@ -249,7 +267,7 @@
    - Serializeable Complex Objects + Serializable Complex Objects
    @@ -477,7 +495,7 @@
    3.3. InventoryBinding.java
    3.4. Stored Class Catalog Management with MyDbs
    3.5. ExampleDatabaseLoad.java
    -
    4.1. ExampleDatabaseRead.java
    +
    4.1. ExampleDatabaseRead.java
    5.1. ItemNameKeyCreator.java
    5.2. SecondaryDatabase Management with MyDbs
    5.3. SecondaryDatabase usage with ExampleDatabaseRead
    diff --git a/db/docs/gsg/JAVA/indexes.html b/db/docs/gsg/JAVA/indexes.html index 4c2af490c..59182ab2e 100644 --- a/db/docs/gsg/JAVA/indexes.html +++ b/db/docs/gsg/JAVA/indexes.html @@ -259,6 +259,13 @@ +
    +

    Note

    +

    + Primary databases must not support duplicate records. + Secondary records point to primary records using the primary key, so that key must be unique. +

    +

    So to open (create) a secondary database, you:

      @@ -283,7 +290,7 @@

    For example:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.bind.tuple.TupleBinding;
     import com.sleepycat.db.Database;
    @@ -311,7 +318,7 @@ mySecConfig.setSortedDuplicates(true);
     Database myDb = null;
     SecondaryDatabase mySecDb = null;
     try {
    -    String dbName = "myPrimaryDatabase";
    +    String dbName = "myPrimaryDatabase";
     
         myDb = new Database(dbName, null, myDbConfig);
     
    @@ -328,7 +335,7 @@ try {
         mySecConfig.setKeyCreator(keyCreator);
     
         // Perform the actual open
    -    String secDbName = "mySecondaryDatabase";
    +    String secDbName = "mySecondaryDatabase";
         mySecDb = new SecondaryDatabase(secDbName, null, myDb, mySecConfig); 
     } catch (DatabaseException de) {
         // Exception handling goes here ...
    diff --git a/db/docs/gsg/JAVA/introduction.html b/db/docs/gsg/JAVA/introduction.html
    index f9ec3edec..fad63309c 100644
    --- a/db/docs/gsg/JAVA/introduction.html
    +++ b/db/docs/gsg/JAVA/introduction.html
    @@ -101,7 +101,7 @@
             
           
           

    - Welcome to Sleepycat's Berkeley DB (DB). DB is a general-purpose embedded + Welcome to Berkeley DB (DB). DB is a general-purpose embedded database engine that is capable of providing a wealth of data management services. It is designed from the ground up for high-throughput applications requiring in-process, bullet-proof management of mission-critical data. DB can @@ -137,7 +137,7 @@ as to ensure that data is never left in an inconsistent state for any reason (such as software bugs or hardware failures). For those applications, a transaction subsystem can be enabled and used to - transactionally protect database writes. + transactional-protect database writes.

    The list of operating systems on which DB is available is too long to @@ -145,8 +145,8 @@ operating systems, as well as on many embedded platforms.

    - Finally, DB is available in a wealth of programming languages. Sleepycat - officially supports DB in C, C++, and Java, but the library is also + Finally, DB is available in a wealth of programming languages. + DB is officially supported in C, C++, and Java, but the library is also available in many other languages, especially scripting languages such as Perl and Python.

    @@ -199,7 +199,7 @@ addition to being presented in this book, these final programs are also available in the DB software distribution. You can find them in

    -
    DB_INSTALL/examples_java/src/com/sleepycat/examples/db/GettingStarted
    +
    DB_INSTALL/examples_java/db/GettingStarted

    where DB_INSTALL is the location where you placed your DB distribution. diff --git a/db/docs/gsg/JAVA/javaindexusage.html b/db/docs/gsg/JAVA/javaindexusage.html index 08c269405..ddb17114d 100644 --- a/db/docs/gsg/JAVA/javaindexusage.html +++ b/db/docs/gsg/JAVA/javaindexusage.html @@ -72,13 +72,13 @@

    In our key creator class, we make use of a custom tuple binding called InventoryBinding. This class is described in InventoryBinding.java.

    You can find InventoryBinding.java in:

    -
    DB_INSTALL/examples_java/src/com/sleepycat/examples/db/GettingStarted
    +
    DB_INSTALL/examples_java/db/GettingStarted

    where DB_INSTALL is the location where you placed your DB distribution.

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.db.DatabaseEntry;
     import com.sleepycat.db.DatabaseException;
    @@ -104,18 +104,13 @@ public class ItemNameKeyCreator implements SecondaryKeyCreator {
             DatabaseEntry resultEntry) // set the key data on this.
             throws DatabaseException {
     
    -        if (dataEntry == null) {
    -            throw new DatabaseException("Missing primary record data " +
    -                "in key creator.");
    -        }
    -
             try {
                 // Convert dataEntry to an Inventory object
                 Inventory inventoryItem = 
                     (Inventory) theBinding.entryToObject(dataEntry);
                 // Get the item name and use that as the key
                 String theItem = inventoryItem.getItemName();
    -            resultEntry.setData(theItem.getBytes("UTF-8"));
    +            resultEntry.setData(theItem.getBytes("UTF-8"));
             } catch (IOException willNeverOccur) {}
     
             return true;
    @@ -154,7 +149,7 @@ public class ItemNameKeyCreator implements SecondaryKeyCreator {
             

    // File MyDbs.java
    -package com.sleepycat.examples.db.GettingStarted;
    +package db.GettingStarted;
                                                                                                                                            
     import java.io.FileNotFoundException;
                                                                                                                                            
    @@ -175,10 +170,10 @@ public class MyDbs {
         private Database classCatalogDb = null;
         private SecondaryDatabase itemNameIndexDb = null;
     
    -    private String vendordb = "VendorDB.db";
    -    private String inventorydb = "InventoryDB.db";
    -    private String classcatalogdb = "ClassCatalogDB.db";
    -    private String itemnameindexdb = "ItemNameIndexDB.db";
    +    private String vendordb = "VendorDB.db";
    +    private String inventorydb = "InventoryDB.db";
    +    private String classcatalogdb = "ClassCatalogDB.db";
    +    private String itemnameindexdb = "ItemNameIndexDB.db";
     
         // Needed for object serialization
         private StoredClassCatalog classCatalog;
    @@ -202,8 +197,8 @@ public class MyDbs {
     
             myDbConfig.setErrorStream(System.err);
             mySecConfig.setErrorStream(System.err);
    -        myDbConfig.setErrorPrefix("MyDbs");
    -        mySecConfig.setErrorPrefix("MyDbs");
    +        myDbConfig.setErrorPrefix("MyDbs");
    +        mySecConfig.setErrorPrefix("MyDbs");
             myDbConfig.setType(DatabaseType.BTREE);
             mySecConfig.setType(DatabaseType.BTREE);
             myDbConfig.setAllowCreate(true);
    @@ -212,24 +207,24 @@ public class MyDbs {
             // Now open, or create and open, our databases
             // Open the vendors and inventory databases
             try {
    -            vendordb = databasesHome + "/" + vendordb;
    +            vendordb = databasesHome + "/" + vendordb;
                 vendorDb = new Database(vendordb,
                                         null,
                                         myDbConfig);
     
    -            inventorydb = databasesHome + "/" + inventorydb;
    +            inventorydb = databasesHome + "/" + inventorydb;
                 inventoryDb = new Database(inventorydb,
                                             null,
                                             myDbConfig);
     
                 // Open the class catalog db. This is used to
                 // optimize class serialization.
    -            classcatalogdb = databasesHome + "/" + classcatalogdb;
    +            classcatalogdb = databasesHome + "/" + classcatalogdb;
                 classCatalogDb = new Database(classcatalogdb,
                                               null,
                                               myDbConfig);
             } catch(FileNotFoundException fnfe) {
    -            System.err.println("MyDbs: " + fnfe.toString());
    +            System.err.println("MyDbs: " + fnfe.toString());
                 System.exit(-1);
             }
     
    @@ -257,13 +252,13 @@ public class MyDbs {
             mySecConfig.setKeyCreator(keyCreator);
             // Now open it
             try {
    -            itemnameindexdb = databasesHome + "/" + itemnameindexdb;
    +            itemnameindexdb = databasesHome + "/" + itemnameindexdb;
                 itemNameIndexDb = new SecondaryDatabase(itemnameindexdb,
                                                         null,
                                                         inventoryDb,
                                                         mySecConfig);
             } catch(FileNotFoundException fnfe) {
    -            System.err.println("MyDbs: " + fnfe.toString());
    +            System.err.println("MyDbs: " + fnfe.toString());
                 System.exit(-1);
             }
         }
    @@ -300,7 +295,7 @@ public class MyDbs {
                 }
     
             } catch(DatabaseException dbe) {
    -            System.err.println("Error closing MyDbs: " +
    +            System.err.println("Error closing MyDbs: " +
                                     dbe.toString());
                 System.exit(-1);
             }
    @@ -309,7 +304,7 @@ public class MyDbs {
               

    That completes our update to MyDbs. You can find the complete class implementation in:

    -
    DB_INSTALL/examples_java/src/com/sleepycat/examples/db/GettingStarted
    +
    DB_INSTALL/examples_java/db/GettingStarted

    where DB_INSTALL is the location where you placed your DB distribution. @@ -348,7 +343,7 @@ public class MyDbs { to seek to the item name key and then display all matching records.

    Remember that you can find ExampleDatabaseRead.java in:

    -
    DB_INSTALL/examples_java/src/com/sleepycat/examples/db/GettingStarted
    +
    DB_INSTALL/examples_java/db/GettingStarted

    where DB_INSTALL is the location where you placed your DB distribution. @@ -362,7 +357,7 @@ public class MyDbs { First we need to import an additional class in order to use the secondary cursor:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +          
    package db.GettingStarted;
     
     import java.io.IOException;
     
    @@ -379,7 +374,7 @@ import com.sleepycat.db.OperationStatus;
               
               
        public class ExampleDatabaseRead {
     
    -    private static String myDbsPath = "./";
    +    private static String myDbsPath = "./";
     
         // Encapsulates the database environment and databases.
         private static MyDbs myDbs = new MyDbs();
    @@ -426,7 +421,7 @@ import com.sleepycat.db.OperationStatus;
                 // searchKey is the key that we want to find in the
                 // secondary db.
                 DatabaseEntry searchKey =
    -                new DatabaseEntry(locateItem.getBytes("UTF-8"));
    +                new DatabaseEntry(locateItem.getBytes("UTF-8"));
     
                 // foundKey and foundData are populated from the primary
                 // entry that is associated with the secondary db key.
    @@ -452,7 +447,7 @@ import com.sleepycat.db.OperationStatus;
                         foundData, LockMode.DEFAULT);
                 }
             } catch (Exception e) {
    -            System.err.println("Error on inventory secondary cursor:");
    +            System.err.println("Error on inventory secondary cursor:");
                 System.err.println(e.toString());
                 e.printStackTrace();
             } finally {
    @@ -467,7 +462,7 @@ import com.sleepycat.db.OperationStatus;
             line switch. To see how this is done, see
             ExampleDatabaseRead.java in:
             

    -
    DB_INSTALL/examples_java/src/com/sleepycat/examples/db/GettingStarted
    +
    DB_INSTALL/examples_java/db/GettingStarted

    where DB_INSTALL is the location where you placed your DB distribution. diff --git a/db/docs/gsg/JAVA/joins.html b/db/docs/gsg/JAVA/joins.html index a22619540..15a0654e3 100644 --- a/db/docs/gsg/JAVA/joins.html +++ b/db/docs/gsg/JAVA/joins.html @@ -36,7 +36,7 @@

    If you have two or more secondary databases associated with a primary - database, then you can retrieve primary records based on the union of + database, then you can retrieve primary records based on the intersection of multiple secondary entries. You do this using a JoinCursor. @@ -56,7 +56,7 @@ is fairly simple with a limited number of data members, few of which would be interesting from a query perspective. But suppose, instead, that we were storing - information on something with many more queryable characteristics, such + information on something with many more characteristics that can be queried, such as an automobile. In that case, you may be storing information such as color, number of doors, fuel mileage, automobile type, number of passengers, make, model, and year, to name just a few. @@ -145,7 +145,8 @@

  • Create an array of secondary cursors, and place in it each - of the cursors that are participating in your join query. + of the cursors that are participating in your join query. Note that this array must be null + terminated.

  • @@ -185,7 +186,7 @@

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.db.Database;
     import com.sleepycat.db.DatabaseEntry;
    @@ -211,9 +212,9 @@ SecondaryDatabase automotiveTypeDB = null;
     SecondaryDatabase automotiveMakeDB = null;
     
     // Query strings:
    -String theColor = "red";
    -String theType = "minivan";
    -String theMake = "Toyota";
    +String theColor = "red";
    +String theType = "minivan";
    +String theMake = "Toyota";
     
     // Secondary cursors used for the query:
     SecondaryCursor colorSecCursor = null;
    @@ -232,9 +233,9 @@ DatabaseEntry foundData = new DatabaseEntry();
     
     try {
         // Database entries used for the query:
    -    DatabaseEntry color = new DatabaseEntry(theColor.getBytes("UTF-8"));
    -    DatabaseEntry type = new DatabaseEntry(theType.getBytes("UTF-8"));
    -    DatabaseEntry make = new DatabaseEntry(theMake.getBytes("UTF-8"));
    +    DatabaseEntry color = new DatabaseEntry(theColor.getBytes("UTF-8"));
    +    DatabaseEntry type = new DatabaseEntry(theType.getBytes("UTF-8"));
    +    DatabaseEntry make = new DatabaseEntry(theMake.getBytes("UTF-8"));
     
         colorSecCursor = automotiveColorDB.openSecondaryCursor(null, null); 
         typeSecCursor = automotiveTypeDB.openSecondaryCursor(null, null); 
    @@ -257,7 +258,8 @@ try {
             // positioned cursors
             SecondaryCursor[] cursorArray = {colorSecCursor,
                                              typeSecCursor, 
    -                                         makeSecCursor};
    +                                         makeSecCursor,
    +                                         null};
     
             // Create the join cursor
             joinCursor = automotiveDB.join(cursorArray, null);
    @@ -325,7 +327,7 @@ try {
     					scenario.
     				

    - Default value is false (automatic cursor sorting is performed). + The default value is false (automatic cursor sorting is performed).

    For example: diff --git a/db/docs/gsg/JAVA/keyCreator.html b/db/docs/gsg/JAVA/keyCreator.html index 5eae91890..09f087522 100644 --- a/db/docs/gsg/JAVA/keyCreator.html +++ b/db/docs/gsg/JAVA/keyCreator.html @@ -72,8 +72,8 @@

    One thing to remember when implementing this method is that you will - need a way to extract the necessary information from the data - DatabaseEntry and/or the key + need a way to extract the necessary information from the data's + DatabaseEntry and/or the key's DatabaseEntry that are provided on calls to this method. If you are using complex objects, then you are probably using the Bind APIs to perform this conversion. The easiest thing to do is to @@ -83,7 +83,7 @@ The Bind APIs are introduced in Using the BIND APIs.

    - Also, SecondaryKeyCreator.createSecondaryKey() returns a + SecondaryKeyCreator.createSecondaryKey() returns a boolean. A return value of false indicates that no secondary key exists, and therefore no record should be added to the secondary database for that primary record. If a record already exists in the secondary database, it is deleted. @@ -93,7 +93,7 @@ for its record data:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
     
     public class PersonData {
         private String userID;
    @@ -133,7 +133,7 @@ public class PersonData {
             Then in this case you might create a key creator as follows:
         

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
     
     import com.sleepycat.bind.tuple.TupleBinding;
     import com.sleepycat.db.SecondaryKeyCreator;
    @@ -156,25 +156,19 @@ public class FullNameKeyCreator implements SecondaryKeyCreator {
                                           DatabaseEntry dataEntry,
                                           DatabaseEntry resultEntry) {
     
    -        // If the dataEntry parameter is null, then we can
    -        // not create the key
    -        if (dataEntry == null) {
    -            return false;
    -        } else {           // Create the key
    -            try {
    -                PersonData pd = 
    -                    (PersonData) theBinding.entryToObject(dataEntry);
    -                String fullName = pd.getFamiliarName() + " " + 
    +        try {
    +            PersonData pd = 
    +                (PersonData) theBinding.entryToObject(dataEntry);
    +                String fullName = pd.getFamiliarName() + " " + 
                         pd.getSurname();
    -                resultEntry.setData(fullName.getBytes("UTF-8"));
    -            } catch (IOException willNeverOccur) {}
    -        }
    +                resultEntry.setData(fullName.getBytes("UTF-8"));
    +        } catch (IOException willNeverOccur) {}
             return true;
         }
     } 

    Finally, you use this key creator as follows:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +      
    package db.GettingStarted;
     
     import com.sleepycat.bind.tuple.TupleBinding;
     
    @@ -201,7 +195,7 @@ try {
         mySecConfig.setType(DatabaseType.BTREE);
     
         //Perform the actual open
    -    String secDbName = "mySecondaryDatabase";
    +    String secDbName = "mySecondaryDatabase";
         mySecDb = new SecondaryDatabase(secDbName, null, myDb, mySecConfig);
     } catch (DatabaseException de) {
         // Exception handling goes here
    diff --git a/db/docs/gsg/JAVA/preface.html b/db/docs/gsg/JAVA/preface.html
    index 56de76890..afd10d9f0 100644
    --- a/db/docs/gsg/JAVA/preface.html
    +++ b/db/docs/gsg/JAVA/preface.html
    @@ -44,20 +44,29 @@
                   Conventions Used in this Book
                 
               
    +          
    +
    +
    + + For More Information + +
    +
    +

    Welcome to Berkeley DB (DB). This document introduces - DB, version 4.3. + DB, version 4.5. It is intended to provide a rapid introduction to the DB API set and related concepts. The goal of this document is to provide you with an efficient mechanism with which you can evaluate DB against your project's technical requirements. As such, this document is intended for Java developers and senior software architects who are - looking for an in-process data management solution. No prior experience with Sleepycat technologies is - expected or required. + looking for an in-process data management solution. No prior + experience with Berkeley DB is expected or required.

    @@ -77,14 +86,14 @@ - "The Database() - constructor returns a Database class object." + "The Database() + constructor returns a Database class object."

    - Variable or non-literal text is presented in italics. For example: "Go to your - DB_INSTALL directory." + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALL directory."

    Program examples are displayed in a monospaced font on a shaded background. @@ -109,7 +118,7 @@ import com.sleepycat.db.DatabaseConfig; // Allow the database to be created. DatabaseConfig myDbConfig = new DatabaseConfig(); myDbConfig.setAllowCreate(true); -Database myDb = new Database("mydb.db", null, myDbConfig);

    +Database myDb = new Database("mydb.db", null, myDbConfig);

    Note

    @@ -117,6 +126,69 @@ myDbConfig.setAllowCreate(true); as this.

    +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + DB application: +

    + +

    Both the key and data for a database record are returned as - DatabaseEntry objects. These objects are + byte arrays in DatabaseEntry objects. These objects are passed as parameter values to the Database.get() method.

    In order to retrieve your data once Database.get() @@ -219,7 +219,7 @@ try { byte array back to the appropriate datatype. For example:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
           
     import com.sleepycat.db.DatabaseEntry;
     import com.sleepycat.db.Database;
    @@ -232,13 +232,13 @@ Database myDatabase = null;
     // Database opens omitted for clarity.
     // Database may be opened read-only.  
       
    -String aKey = "myFirstKey";
    +String aKey = "myFirstKey";
     
     try {
         // Create a pair of DatabaseEntry objects. theKey
         // is used to perform the search. theData is used
         // to store the data returned by the get() operation.
    -    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
    +    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
         DatabaseEntry theData = new DatabaseEntry();
         
         // Perform the get.
    @@ -247,11 +247,11 @@ try {
     
             // Recreate the data String.
             byte[] retData = theData.getData();
    -        String foundData = new String(retData);
    -        System.out.println("For key: '" + aKey + "' found data: '" + 
    -                            foundData + "'.");
    +        String foundData = new String(retData, "UTF-8");
    +        System.out.println("For key: '" + aKey + "' found data: '" + 
    +                            foundData + "'.");
         } else {
    -        System.out.println("No record found for key '" + aKey + "'.");
    +        System.out.println("No record found for key '" + aKey + "'.");
         } 
     } catch (Exception e) {
         // Exception handling goes here
    @@ -280,13 +280,13 @@ try {
           

    You can also delete every record in the database by using - Database.truncate(). + Environment.truncateDatabase().

    For example:

    -
    package com.sleepycat.examples.db.GettingStarted;
    +        
    package db.GettingStarted;
     
     import com.sleepycat.db.DatabaseEntry;
     import com.sleepycat.db.Database;
    @@ -298,8 +298,8 @@ Database myDatabase = null;
     // Database can NOT be opened read-only.  
       
     try {
    -    String aKey = "myFirstKey";
    -    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
    +    String aKey = "myFirstKey";
    +    DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes("UTF-8"));
         
         // Perform the deletion. All records that use this key are
         // deleted.
    @@ -320,7 +320,7 @@ try {
             

    When you perform a database modification, your modification is made in the in-memory cache. This means that your data modifications - are not necessarily written to disk, and so your data may not appear + are not necessarily flushed to disk, and so your data may not appear in the database after an application restart.

    @@ -332,17 +332,19 @@ try { experience database corruption.

    - Therefore, if you care about whether your data persists across - application runs, and to guard against the rare possibility of + Therefore, if you care if your data is durable across system + failures, and to guard against the rare possibility of database corruption, you should use transactions to protect your database modifications. Every time you commit a transaction, DB ensures that the data will not be lost due to application or - system failure. - - - For information on transactions, see the Berkeley DB - Programmer's Tutorial and Reference Guide. - + system failure. Transaction usage is described in the + + + + + + Berkeley DB Getting Started with Transaction Processing guide. +

    If you do not want to use transactions, then the assumption is that @@ -355,10 +357,11 @@ try { If, however, you are not using transactions for some reason and you still want some guarantee that your database modifications are persistent, then you should periodically + run environment syncs. - - Syncs cause the entire contents of your in-memory cache to be written to disk. As + Syncs cause any dirty entries in the in-memory cache and the + operating system's file cache to be written to disk. As such, they are quite expensive and you should use them sparingly.

    diff --git a/db/docs/gsg_db_rep/C/Replication-C-GSG.pdf b/db/docs/gsg_db_rep/C/Replication-C-GSG.pdf new file mode 100644 index 000000000..85cdab4d0 Binary files /dev/null and b/db/docs/gsg_db_rep/C/Replication-C-GSG.pdf differ diff --git a/db/docs/gsg_db_rep/C/addfeatures.html b/db/docs/gsg_db_rep/C/addfeatures.html new file mode 100644 index 000000000..117a07589 --- /dev/null +++ b/db/docs/gsg_db_rep/C/addfeatures.html @@ -0,0 +1,191 @@ + + + + + + Chapter 5. Additional Features + + + + + + + + +

    +
    +
    +
    +
    +

    Chapter 5. Additional Features

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Delayed Synchronization + +
    +
    + + Managing Blocking Operations + +
    +
    + + Stop Auto-Initialization + +
    +
    + + Client to Client Transfer + +
    +
    +
    +
    + + Identifying Peers + +
    +
    +
    +
    + + Bulk Transfers + +
    +
    +
    +

    + Beyond the basic functionality that we have discussed so far in + this book, there are several replication features that you + should understand. These are all optional to use, but provide + useful functionality under the right circumstances. +

    +

    + These additional features are: +

    + +
    +
    +
    +
    +

    Delayed Synchronization

    +
    +
    +
    +
    +

    + When a replication group has a new master, all replicas must + synchronize with that master. This means they must ensure + that the contents of their local database(s) are identical + to that contained by the new master. +

    +

    + This synchronization process can result in quite a lot of + network activity. It can also put a large strain on the + master server, especially if is part of a large + replication group or if there is somehow a large difference between + the master's database(s) and the contents of its replicas. +

    +

    + It is therefore possible to delay synchronization for any + replica that discovers it has a new master. You would do + this so as to give the master time to synchronize other + replicas before proceeding with the delayed replicas. +

    +

    + To delay synchronization of a replica environment, you + specify + + DB_REP_CONF_DELAYCLIENT to + DB_ENV->rep_set_config() + + and then specify 1 to the onoff + parameter. (Specify 0 to turn the feature off.) + + +

    +

    + If you use delayed synchronization, then you must manually + synchronize the replica at some future time. Until you do this, the replica is out of + sync with the master, and it will ignore all database changes forwarded to it from + the master. +

    +

    + You synchronize a delayed replica by calling + DB_ENV->rep_sync() + + + on the replica that has been delayed. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/apioverview.html b/db/docs/gsg_db_rep/C/apioverview.html new file mode 100644 index 000000000..4b201d88c --- /dev/null +++ b/db/docs/gsg_db_rep/C/apioverview.html @@ -0,0 +1,225 @@ + + + + + + The Replication APIs + + + + + + + + + +
    +
    +
    +
    +

    The Replication APIs

    +
    +
    +
    +
    +

    + There are two ways that you can choose to implement + replication in your transactional application. The first, + and preferred, mechanism is to use the pre-packaged + replication framework that comes with the + DB distribution. This framework should be sufficient + for most customers. +

    +

    + If for some reason the Replication Framework + does not meet your application's technical requirements, + you will have to use the replication APIs available + through the Berkeley DB library to write your own custom + replication framework. +

    +

    + Both of these approaches are described in slightly greater + detail in this section. The bulk of the chapters later in + this book are dedicated to these two replication + implementation mechanisms. +

    +
    +
    +
    +
    +

    Replication Framework Overview

    +
    +
    +
    +
    +

    + DB's pre-packaged replication framework exists + as a layer on top of the DB library. The replication framework is a + multi-threaded implementation that allows you to easily add + replication to your existing transactional application. + + You access and manage the replication framework using methods that are + available off the + DB_ENV + + class. + + +

    +

    + The replication framework: +

    +
    +
      +
    • +

      + Provides a multi-threaded communications layer + using pthreads (on Unix-style systems and + similar derivatives such as Mac OS X), or + Windows threads on Microsoft Windows systems. +

      +
    • +
    • +

      + Uses TCP/IP sockets. Network traffic is + handled via threads that handle inbound and + outbound messages. However, each + process uses a single socket + that is shared using select(). +

      +

      + Note that for this reason, the replication framework is + limited to a maximum of 60 replicas (on + Windows) and approximately 1000 replicas (on + Unix and related systems), depending on how + your system is configured. +

      +
    • +
    • +

      + Requires a single process for the master replica. +

      +
    • +
    • +

      + Requires that only one instance of the + environment handle be used. +

      +
    • +
    • +

      + Upon application startup, a master can be + selected either manually or via elections. + After startup time, however, during the course of + normal operations it is possible for the + replication group to need to locate a new master (due + to network or other hardware related problems, + for example) and in this scenario elections are + always used to select the new master. +

      +
    • +
    +
    +

    + If your application has technical requirements that do + not conform to the implementation provided by the + replication framework, you must write a custom + replication framework using the DB replication APIs + directly. See the next section for introductory + details. +

    +
    +
    +
    +
    +
    +

    Replication API Overview

    +
    +
    +
    +
    +

    + The replication API is a series of Berkeley DB library + classes and methods that you can use to build your own + replication infrastructure. You should use the + replication API only if the replication framework does not meet your + application's technical requirements. +

    +

    + To make use of the replication API, you must write your + own networking code. This frees you from the technical + constraints imposed by the replication framework. For example, by + writing your own framework, you can: +

    +
    +
      +
    • +

      + Use a threading package other than + pthreads (Unix) or Windows threads + (Microsoft Windows). This might be interesting + to you if you are using a platform + whose preferred threading package + is something other than (for + example) pthreads, such as is the case for + Sun Microsystem's Solaris operating systems. +

      +
    • +
    • +

      + Implement your own sockets. The + replication framework uses TCP/IP sockets. While + this should be acceptable for the + majority of applications, sometimes + UDP or even raw sockets might be + desired. +

      +
    • +
    • +

      + Write a multi-process master + replica. +

      +
    • +
    +
    +

    + For information on writing a replicated application + using the Berkeley DB replication APIs, see the + Berkeley DB Programmer's Reference Guide. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/bulk.html b/db/docs/gsg_db_rep/C/bulk.html new file mode 100644 index 000000000..b339aa6c8 --- /dev/null +++ b/db/docs/gsg_db_rep/C/bulk.html @@ -0,0 +1,139 @@ + + + + + + Bulk Transfers + + + + + + + + +
    +
    +
    +
    +

    Bulk Transfers

    +
    +
    +
    +
    +

    + By default, messages are sent from the master to replicas as they are generated. + This can degrade replication performance because the various participating + environments must handle a fair amount of network I/O activity. +

    +

    + You can alleviate this problem by configuring your master environment for bulk + transfers. Bulk transfers simply cause replication messages to accumulate in a + buffer until a triggering event occurs. When this event occurs, the entire + contents of the buffer is sent to the replica, thereby eliminating excessive + network I/O. +

    +

    + Note that if you are using replica to replica transfers, then you might want any + replica that can service replication requests to also be configured for bulk + transfers. +

    +

    + The events that result in a bulk transfer of replication messages to a replica + will differ depending on if the transmitting environment is a master or a + replica. +

    +

    + If the servicing environment is a master environment, then bulk a bulk transfer + occurs when: +

    +
    +
      +
    1. +

      + Bulk transfers are configured for the master environment, and +

      +
    2. +
    3. +

      + the message buffer is full or +

      +
    4. +
    5. +

      + a permanent record (for example, a transaction commit or a + checkpoint record) is placed in the buffer for the replica. +

      +
    6. +
    +
    +

    + If the servicing environment is a replica environment (that is, replica to replica + transfers are in use), then a bulk transfer occurs when: +

    +
    +
      +
    1. +

      + Bulk transfers are configured for the transmitting replica, and +

      +
    2. +
    3. +

      + the message buffer is full or +

      +
    4. +
    5. +

      + the replica servicing the request is able to completely satisfy + the request with the contents of the message buffer. +

      +
    6. +
    +
    +

    + To configure bulk transfers, specify + + + DB_REP_CONF_BULK to + DB_ENV->rep_set_config() + + and then specify 1 to the onoff + parameter. (Specify 0 to turn the feature off.) + + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/C/c2ctransfer.html b/db/docs/gsg_db_rep/C/c2ctransfer.html new file mode 100644 index 000000000..8145d4000 --- /dev/null +++ b/db/docs/gsg_db_rep/C/c2ctransfer.html @@ -0,0 +1,131 @@ + + + + + + Client to Client Transfer + + + + + + + + + +
    +
    +
    +
    +

    Client to Client Transfer

    +
    +
    +
    +
    +

    + It is possible to use a replica instead of a master to synchronize another + replica. This serves to take the request load off a master that might otherwise + occur if multiple replicas attempted to synchronize with the master at the same + time. +

    +

    + For best results, use this feature combined with the delayed synchronization + feature (see Delayed Synchronization). +

    +

    + For example, suppose your replication group consists of four environments. Upon + application startup, all three replicas will immediately attempt to synchronize + with the master. But at the same time, the master itself might be busy with a heavy + database write load. +

    +

    + To solve this problem, delay synchronization for two of the three replicas. Allow + the third replica to synchronize as normal with the master. Then, start + synchronization for each of the delayed replicas (since this is a manual process, + you can do them one at a time if that best suits your application). + Assuming you have configured replica to replica synchronization correctly, the + delayed replicas will synchronize using the up-to-date replica, rather than using + the master. +

    +

    + When you are using the replication framework, you configure replica to replica synchronization by + declaring one environment to be a peer of another environment. If an + environment is a peer, then + it can be used for synchronization purposes. +

    +
    +
    +
    +
    +

    Identifying Peers

    +
    +
    +
    +
    +

    + You can designate one replica to be a peer of + another, and then use this special + status for permanent message acknowledgments, + and for replica-to-replica synchronization. + You might want to do this if you have + machines that you know are on fast, reliable + network connections and so you are willing to + accept the overhead of waiting for + acknowledgments from those specific machines. +

    +

    + An environment is currently allowed to have only one + peer. +

    +

    + Note that peers are not required to be a + bi-directional. That is, just because machine A + declares machine B to be a peer, that does not mean + machine B must also declare machine A to be a peer. +

    +

    + You declare a peer for the current environment + when you add that environment to the list of known + sites. You do this by + specifying the + DB_REPMGR_PEER flag to + DB_ENV->repmgr_add_remote_site(). + + + +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/elections.html b/db/docs/gsg_db_rep/C/elections.html new file mode 100644 index 000000000..8157cf14a --- /dev/null +++ b/db/docs/gsg_db_rep/C/elections.html @@ -0,0 +1,227 @@ + + + + + + Holding Elections + + + + + + + + + +
    +
    +
    +
    +

    Holding Elections

    +
    +
    +
    +
    +

    + Finding a master environment is one of the fundamental activities that + every replication replica must perform. Upon startup, the + underlying DB replication code will attempt to + locate a master. If a master cannot be found, then the + environment should initiate an election. +

    +

    + How elections are held depends upon the API that you use to + implement replication. For example, if you are using the + replication framework elections are held transparently without any + input from your application's code. In this case, + DB will determine which environment is the master and which + are replicas. +

    +
    +
    +
    +
    +

    Influencing Elections

    +
    +
    +
    +
    +

    + If you want to control the election process, you can declare + a specific environment to be the master. Note that for the replication framework, + it is only possible to do this at application startup. + Should the master become unavailable during run-time for any + reason, an election is held. The environment that receives + the most number of votes, wins the election and becomes the + master. A machine receives a vote because it has the most + number of log records. +

    +

    + Because ties are possible when elections are held, + it is possible to influence which environment will win + the election. How you do this depends on which API you + are using. In particular, if you are writing a custom replication + layer, then there are a great many ways to manually influence + elections. +

    +

    + One such mechanism is priorities. When votes are + cast during an election, both the number of log records + contained in the environment and + the environment's priority are considered. So given two + environments with the same number of log records, votes + are cast for the environment with the higher priority. +

    +

    + Therefore, if you have a machine that you prefer to + become a master in the event of an election, assign it + a high priority. Assuming that the election is held at + a time when the preferred machine has up-to-date log + records, that machine will win the election. +

    +
    +
    +
    +
    +
    +

    Winning Elections

    +
    +
    +
    +
    +

    + To win an election: +

    +
    +
      +
    1. +

      + There cannot currently be a + master environment. +

      +
    2. +
    3. +

      + The environment must have the most + recent log records. Part of + holding the election is + determining which environments have + the most recent log records. + This process happens + automatically; your code does + not need to involve itself in + this process. +

      +
    4. +
    5. +

      + The environment must receive the most + number of votes from the + replication environments that are + participating in the election. +

      +
    6. +
    +
    +

    + If you are using the replication framework, then in the event of a + tie vote the environment with the highest priority wins + the election. If two or more environments receive the same + number of votes and have the same priority, then + the underlying replication code picks one of the + environments to + be the winner. Which winner will be picked by the + replication code is unpredictable from the + perspective of your application code. +

    +
    +
    +
    +
    +
    +

    Switching Masters

    +
    +
    +
    +
    +

    + To switch masters: +

    +
    +
      +
    1. +

      + Start up the environment that you want + to be master as normal. At this + time it is a replica. Make + sure this environment has a higher + priority than all the other + environments. +

      +
    2. +
    3. +

      + Allow the new environment to run for a + time as a replica. This allows + it to obtain the most recent + copies of the log files. +

      +
    4. +
    5. +

      + Shut down the current master. + This should force an election. + Because the new environment has the + highest priority, it will win + the election, provided it has + had enough time to obtain all + the log records. +

      +
    6. +
    7. +

      + Optionally restart the old + master environment. Because there is + currently a master environment, an + election will not be held and + the old master will now run as + a replica environment. +

      +
    8. +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/electiontimes.html b/db/docs/gsg_db_rep/C/electiontimes.html new file mode 100644 index 000000000..8f6a2cf9e --- /dev/null +++ b/db/docs/gsg_db_rep/C/electiontimes.html @@ -0,0 +1,152 @@ + + + + + + Managing Election Times + + + + + + + + + +
    +
    +
    +
    +

    Managing Election Times

    +
    +
    +
    +
    +

    + Where it comes to elections, there are two timeout + values with which you should be concerned: election + timeouts and election retries. +

    +
    +
    +
    +
    +

    Managing Election Timeouts

    +
    +
    +
    +
    +

    + When a environment calls for an election, it will wait + some amount of time for the other replicas in the + replication group to respond. The amount of time + that the environment will wait before declaring the + election completed is the election timeout. +

    +

    + If the environment hears from all other known replicas before + the election timeout occurs, the election is considered + a success and a master is elected. +

    +

    + If only a subset of replicas respond, then the success + or failure of the election is determined by (1) + how many replicas have responded and (2) the + election policy that is in place at the time. + For example, usually it only takes a simple + majority of replicas to elect a master. If + there are enough votes for a given environment to + meet that standard, then the master has been + elected and the election is considered a + success. +

    +

    + However, upon application startup you can + require that all known replicas must participate in the + election. Or, it is possible that not enough + votes are cast to select a master even with a + simple majority. If either of these conditions + occur when the election timeout value is + reached, the election is considered a failure + and a master is not elected. At this point, + your replication group is operating without a + master, which means that, essentially, + your replicated application has been placed in + read-only mode. +

    +

    + Note, however, that the replication framework will attempt a + new election after a given amount of time has + passed. See the next section for details. +

    +

    + You set the election timeout value using + DB_ENV->rep_set_timeout(). + + To do so, specify the + DB_REP_ELECTION_TIMEOUT + flag to the which parameter and then a + timeout value in microseconds to the + timeout parameter. +

    +
    +
    +
    +
    +
    +

    Managing Election Retry Times

    +
    +
    +
    +
    +

    + In the event that a election fails (see the + previous section), an election will not be + attempted again until the election retry + timeout value has expired. +

    +

    + You set the retry timeout value using + DB_ENV->rep_set_timeout(). + + To do so, specify the + DB_REP_ELECTION_RETRY + flag to the which parameter and then a + retry value in microseconds to the + timeout parameter. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/exampledoloop.html b/db/docs/gsg_db_rep/C/exampledoloop.html new file mode 100644 index 000000000..859f4a837 --- /dev/null +++ b/db/docs/gsg_db_rep/C/exampledoloop.html @@ -0,0 +1,643 @@ + + + + + + Example Processing Loop + + + + + + + + + +
    +
    +
    +
    +

    Example Processing Loop

    +
    +
    +
    +
    +

    + In this section we take the example + processing loop that we presented in the + previous section and we flesh it out to + provide a more complete example. We do this + by updating the + doloop() + function that our original transaction + application used + (see Function: doloop()) + + + to fully support our replicated application. +

    +

    + In the following example code, code that we + add to the original example is presented in + bold. +

    +

    + To begin, we include a new header file into + our application so that we can check for the + ENOENT return value later + in our processing loop. We also define our + APP_DATA + structure, and we define a + sleeptime value. + + + Finally, we + add a new forward declaration for our event + callback. + + + +

    +
    /*
    + * File: rep_mgr.c
    + */
    +
    +#include <stdlib.h>
    +#include <string.h>
    +#include <errno.h>
    +#ifndef _WIN32
    +#include <unistd.h>
    +#endif
    +
    +#include <db.h>
    +
    +#ifdef _WIN32
    +extern int getopt(int, char * const *, const char *);
    +#endif
    +
    +
    +#define CACHESIZE   (10 * 1024 * 1024)
    +#define DATABASE    "quote.db"
    +#define SLEEPTIME 3
    +
    +const char *progname = "rep_mgr";
    +
    +typedef struct {
    +    int is_master;
    +} APP_DATA;
    +
    +int create_env(const char *, DB_ENV **);
    +int env_init(DB_ENV *, const char *);
    +int doloop (DB_ENV *);
    +int print_stocks(DBC *);
    +void *event_callback(DB_ENV *, u_int32_t, void *); 
    +

    + In our main() function, most of what we + have to add to it is some new variable declarations and + initializations: +

    +
    int
    +main(int argc, char *argv[])
    +{
    +    extern char *optarg;
    +    DB_ENV *dbenv;
    +    const char *home;
    +    char ch, *host, *portstr;
    +    int ret, local_is_set, totalsites;
    +    u_int32_t port;
    +    /* Used to track whether this is a replica or a master */
    +    APP_DATA my_app_data;
    +
    +    my_app_data.is_master = 0;  /* Assume that we start as a replica */
    +    dbenv = NULL;
    +
    +    ret = local_is_set = totalsites = 0;
    +    home = NULL;
    +

    + The rest of our main() function + is unchanged, except that we make our + APP_DATA structure available through our + environment handle's app_private + field: +

    +
    +    if ((ret = create_env(progname, &dbenv)) != 0)
    +            goto err;
    +
    +    /* Make APP_DATA available through the environment handle */
    +    dbenv->app_private = &my_app_data;
    +
    +    /* Default priority is 100 */
    +    dbenv->rep_set_priority(dbenv, 100);
    +
    +    /* Collect the command line options */
    +    while ((ch = getopt(argc, argv, "h:m:o:p:")) != EOF)
    +        switch (ch) {
    +        case 'h':
    +            home = optarg;
    +            break;
    +        /* Set the host and port used by this environment */
    +        case 'm':
    +            host = strtok(optarg, ":");
    +            if ((portstr = strtok(NULL, ":")) == NULL) {
    +                fprintf(stderr, "Bad host specification.\n");
    +                goto err;
    +            }
    +            port = (unsigned short)atoi(portstr);
    +            if (dbenv->repmgr_set_local_site(dbenv, host, port, 0) != 0) {
    +                fprintf(stderr,
    +                    "Could not set local address %s.\n", host);
    +                goto err;
    +            }
    +            local_is_set = 1;
    +            break;
    +        /* Identify another site in the replication group */
    +        case 'o':
    +            host = strtok(optarg, ":");
    +            if ((portstr = strtok(NULL, ":")) == NULL) {
    +                fprintf(stderr, "Bad host specification.\n");
    +                goto err;
    +            }
    +            port = (unsigned short)atoi(portstr);
    +            if (dbenv->repmgr_add_remote_site(dbenv, host, port, 0) != 0) {
    +                fprintf(stderr,
    +                    "Could not add site %s.\n", host);
    +                goto err;
    +            }
    +            break;
    +        /* Set the number of sites in this replication group */
    +        case 'n':
    +            totalsites = atoi(optarg);
    +            if ((ret = dbenv->rep_set_nsites(dbenv, totalsites)) != 0)
    +                dbenv->err(dbenv, ret, "set_nsites");
    +            break;
    +        /* Set this replica's election priority */
    +        case 'p':
    +            dbenv->rep_set_priority(dbenv, atoi(optarg));
    +            break; 
    +        case '?':
    +        default:
    +            usage();
    +        }
    +
    +    /* Error check command line. */
    +    if (home == NULL || !local_is_set || !totalsites)
    +        usage();
    +
    +    if ((ret = env_init(dbenv, home)) != 0)
    +            goto err;
    +
    +    if ((ret = dbenv->repmgr_start(dbenv, 3, DB_REP_ELECTION)) != 0)
    +        goto err;
    +
    +    /* Sleep to give ourselves time to find a master. */
    +    sleep(5);
    +
    +    if ((ret = doloop(dbenv)) != 0) {
    +        dbenv->err(dbenv, ret, "Application failed");
    +        goto err;
    +    }
    +
    +err: if (dbenv != NULL)
    +        (void)dbenv->close(dbenv, 0);
    +
    +    return (ret);
    +} 
    +

    + Having updated our main(), we must also + update our create_env() function to + register our event_callback callback. + Notice that our env_init() function, which is + responsible for actually opening our environment handle, is + unchanged: +

    +
    int
    +create_env(char *progname, DB_ENV **dbenvp)
    +{
    +    DB_ENV *dbenv;
    +    int ret;
    +
    +    if ((ret = db_env_create(&dbenv, 0)) != 0) {
    +        fprintf(stderr, "can't create env handle: %s\n",
    +            db_strerror(ret));
    +        return (ret);
    +    }
    +
    +    dbenv->set_errfile(dbenv, stderr);
    +    dbenv->set_errpfx(dbenv, progname);
    +    (void)dbenv->set_event_notify(dbenv, event_callback);
    +
    +    *dbenvp = dbenv;
    +    return (0);
    +} 
    +
    +int
    +env_init(DB_ENV *dbenv, const char *home)
    +{
    +    u_int32_t flags;
    +    int ret;
    +
    +    (void)dbenv->set_cachesize(dbenv, 0, CACHESIZE, 0);
    +    (void)dbenv->set_flags(dbenv, DB_TXN_NOSYNC, 1);
    +
    +    flags = DB_CREATE |
    +            DB_INIT_LOCK |
    +            DB_INIT_LOG |
    +            DB_INIT_MPOOL |
    +            DB_INIT_TXN |
    +            DB_INIT_REP |
    +            DB_THREAD |
    +            DB_RECOVER;
    +    if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0)
    +        dbenv->err(dbenv, ret, "can't open environment");
    +    return (ret);
    +}
    +

    + That done, we need to implement our + event_callback() callback. Note that what we use + here is no different from the callback that we described in + the previous section. However, for the sake of completeness we + provide the implementation here again. +

    +
    +        
    +          /*
    + * A callback used to determine whether the local environment is a replica
    + * or a master. This is called by the replication framework
    + * when the local replication environment changes state.
    + */
    +void *
    +event_callback(DB_ENV *dbenv, u_int32_t which, void *info)
    +{
    +    APP_DATA *app = dbenv->app_private;
    +
    +    info = NULL;                /* Currently unused. */
    +
    +    switch (which) {
    +    case DB_EVENT_REP_MASTER:
    +        app->is_master = 1;
    +        break;
    +
    +    case DB_EVENT_REP_CLIENT:
    +        app->is_master = 0;
    +        break;
    +
    +    case DB_EVENT_REP_STARTUPDONE: /* fallthrough */
    +    case DB_EVENT_REP_NEWMASTER:
    +        /* Ignore. */
    +        break;
    +
    +    default:
    +        dbenv->errx(dbenv, "ignoring event %d", which);
    +    }
    +}
    +        
    +      
    +

    + That done, we need to update our + doloop() + function. This is the place where we most + heavily modify our application. + + +

    +

    + We begin by introducing APP_DATA to the + function: +

    +
    /*
    + * Provides the main data processing function for our application.
    + * This function provides a command line prompt to which the user
    + * can provide a ticker string and a stock price. Once a value is
    + * entered to the application, the application writes the value to
    + * the database and then displays the entire database.
    + */
    +#define BUFSIZE 1024
    +int
    +doloop(DB_ENV *dbenv)
    +{
    +    DB *dbp;
    +    APP_DATA *app_data;
    +    DBT key, data;
    +    char buf[BUFSIZE], *rbuf;
    +    int ret;
    +    u_int32_t flags;
    +
    +    dbp = NULL;
    +    ret = 0;
    +    memset(&key, 0, sizeof(key));
    +    memset(&data, 0, sizeof(data));
    +    app_data = dbenv->app_private;
    +

    + Next we begin to modify our main loop. + To start, upon entering the loop we create the database handle and configure it as + normal. But we also have to decide what flags we will use for + the open. Again, it depends on whether we are a replica or a + master. +

    +
        for (;;) {
    +        if (dbp == NULL) {
    +            if ((ret = db_create(&dbp, dbenv, 0)) != 0)
    +                return (ret);
    +
    +            /* Set page size small so page allocation is cheap. */
    +            if ((ret = dbp->set_pagesize(dbp, 512)) != 0)
    +                goto err;
    +
    +            flags = DB_AUTO_COMMIT;
    +            if (app_data->is_master)
    +                flags |= DB_CREATE; 
    +

    + When we open the database, we modify our error handling to + account for the case where the database does not yet exist. This can + happen if our code is running as a replica and the replication framework has not + yet had a chance to create the databases for us. Recall that replicas never + write to their own databases directly, and so they cannot + create databases on their own. +

    +

    + If we detect that the database does not yet exist, we simply + close the database handle, sleep for a short period of time + and then continue processing. This gives the replication framework a chance to + create the database so that our replica can continue + operations. +

    +
                if ((ret = dbp->open(dbp,
    +                NULL, DATABASE, NULL, DB_BTREE, flags, 0)) != 0) {
    +                if (ret == ENOENT) {
    +                    printf(
    +                      "No stock database yet available.\n");
    +                    if ((ret = dbp->close(dbp, 0)) != 0) {
    +                        dbenv->err(dbenv, ret,
    +                            "DB->close");
    +                        goto err;
    +                    }
    +                    dbp = NULL;
    +                    sleep(SLEEPTIME);
    +                    continue;
    +                }
    +                dbenv->err(dbenv, ret, "DB->open");
    +                goto err;
    +            }
    +        } 
    +

    + Next we modify our prompt, so that if the local process is running + as a replica, we can tell from the shell that the prompt is for a + read-only process. +

    +
            printf("QUOTESERVER%s> ",
    +            app_data->is_master ? "" : " (read-only)");
    +        fflush(stdout); 
    +

    + When we collect data from the prompt, there is a case that says + if no data is entered then show the entire stocks database. + This display is performed by our + print_stocks() + function + + (which has not + required a modification since we first introduced it in + + Function: print_stocks() + + + ). +

    +

    + When we call + print_stocks(), + + we check for a dead replication handle. Dead + replication handles happen whenever a replication election + results in a previously committed transaction becoming + invalid. This is an error scenario caused by a new master having a + slightly older version of the data than the original + master and so all replicas must modify their database(s) to + reflect that of the new master. In this situation, some + number of previously committed transactions may have to be + unrolled. From the replica's perspective, the database + handles should all be closed and then opened again. +

    +
            if (fgets(buf, sizeof(buf), stdin) == NULL)
    +            break;
    +        if (strtok(&buf[0], " \t\n") == NULL) {
    +            switch ((ret = print_stocks(dbp))) {
    +            case 0:
    +                continue;
    +            case DB_REP_HANDLE_DEAD:
    +                (void)dbp->close(dbp, DB_NOSYNC);
    +                dbp = NULL;
    +                dbenv->errx(dbenv, "Got a dead replication handle");
    +                continue; 
    +            default:
    +                dbp->err(dbp, ret, "Error traversing data");
    +                goto err;
    +            }
    +        }
    +        rbuf = strtok(NULL, " \t\n");
    +        if (rbuf == NULL || rbuf[0] == '\0') {
    +            if (strncmp(buf, "exit", 4) == 0 ||
    +                strncmp(buf, "quit", 4) == 0)
    +                break;
    +            dbenv->errx(dbenv, "Format: TICKER VALUE");
    +            continue;
    +        }
    +

    + That done, we need to add a little error checking to our + command prompt to make sure the user is not attempting to + modify the database at a replica. Remember, replicas must never + modify their local databases on their own. This guards against + that happening due to user input at the prompt. +

    +
            if (!app_data->is_master) {
    +            dbenv->errx(dbenv, "Can't update at client");
    +            continue;
    +        }
    +        key.data = buf;
    +        key.size = (u_int32_t)strlen(buf);
    +
    +        data.data = rbuf;
    +        data.size = (u_int32_t)strlen(rbuf);
    +
    +        if ((ret = dbp->put(dbp,
    +            NULL, &key, &data, 0)) != 0) {
    +            dbp->err(dbp, ret, "DB->put");
    +            goto err;
    +        }
    +    }
    +
    +err:    if (dbp != NULL)
    +        (void)dbp->close(dbp, DB_NOSYNC);
    +
    +    return (ret);
    +} 
    +

    + With that completed, we are all done updating our application + for replication. + + The only remaining + function, print_stocks(), + + + + is unmodified from when we + originally introduced it. For details on that function, see + + Function: print_stocks() + + + . +

    +
    +
    +
    +
    +

    Running It

    +
    +
    +
    +
    +

    + To run our replicated application, we need to make + sure each participating environment has its own unique + home directory. We can do this by running + each site on a separate networked machine, but that + is not strictly necessary; multiple instances of this + code can run on the same machine provided the + environment home restriction is observed. +

    +

    + To run a process, make sure the environment home + exists and then start the process using the + -h option to specify that + directory. You must also use the -m + option to identify the local host and port that this + process will use to listen for replication messages, and + the -o option to identify the other + processes in the replication group. Finally, use the + -p option to specify a priority. + The process that you designate to have the highest priority will become + the master. +

    +
    > mkdir env1
    +> ./rep_mgr -h env1 -n 2 -m localhost:8080 -o localhost:8081 -p 10
    +No stock database yet available.
    +No stock database yet available.  
    +

    + Now, start another process. This time, change the environment + home to something else, use the -m to at + least change the port number the process is listening on, and + use the -o option to identify the host and + port of the other replication process: +

    +
    > mkdir env2
    +> ./rep_mgr -h env2 -n 2 -m localhost:8081 -o localhost:8080 -p 20
    +

    + After a short pause, the second process should display the master + prompt: +

    +
    +QUOTESERVER > 
    +

    + And the first process should + display the read-only prompt: +

    +
    +QUOTESERVER (read-only)> 
    +

    + Now go to the master process and give it a couple of stocks and stock + prices: +

    +
    QUOTESERVER> FAKECO 9.87
    +QUOTESERVER> NOINC .23
    +QUOTESERVER> 
    +

    + Then, go to the replica and hit return at the prompt to + see the new values: +

    +
    QUOTESERVER (read-only)> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  9.87
    +        NOINC    .23 
    +QUOTESERVER (read-only)> 
    +

    + Doing the same at the master results in the same thing: +

    +
    QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  9.87
    +        NOINC    .23 
    +QUOTESERVER> 
    +

    + You can change a stock by simply entering the stock value and + new price at the master's prompt: +

    +
    QUOTESERVER> FAKECO 10.01 
    +QUOTESERVER> 
    +

    + Then, go to either the master or the replica to see the updated + database: +

    +
    QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  10.01
    +        NOINC    .23 
    +QUOTESERVER> 
    +

    + And on the replica: +

    +
    QUOTESERVER (read-only)> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  10.01
    +        NOINC    .23 
    +QUOTESERVER (read-only)> 
    +

    + Finally, to quit the applications, simply type + quit at both prompts: +

    +
    QUOTESERVER (read-only)> quit
    +> 
    +

    + And on the master as well: +

    +
    QUOTESERVER> quit
    +> 
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/fmwrkconnectretry.html b/db/docs/gsg_db_rep/C/fmwrkconnectretry.html new file mode 100644 index 000000000..c86b01c37 --- /dev/null +++ b/db/docs/gsg_db_rep/C/fmwrkconnectretry.html @@ -0,0 +1,76 @@ + + + + + + Managing Connection Retries + + + + + + + + + +
    +
    +
    +
    +

    Managing Connection Retries

    +
    +
    +
    +
    +

    + In the event that a communication failure occurs between + two environments in a replication group, the replication framework will wait a set + amount of time before attempting to re-establish the + connection. You can configure this wait value using + + + DB_ENV->rep_set_timeout(). + + To do so, specify the + DB_REP_CONNECTION_RETRY + flag to the which parameter and then a + retry value in microseconds to the + timeout parameter. + + + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/C/fwrkmasterreplica.html b/db/docs/gsg_db_rep/C/fwrkmasterreplica.html new file mode 100644 index 000000000..975bdd027 --- /dev/null +++ b/db/docs/gsg_db_rep/C/fwrkmasterreplica.html @@ -0,0 +1,301 @@ + + + + + + Chapter 4. Replica versus Master Processes + + + + + + + + + +
    +
    +
    +
    +

    Chapter 4. Replica versus Master Processes

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Determining State + +
    +
    + + Processing Loop + +
    +
    + + Example Processing Loop + +
    +
    +
    +
    + + Running It + +
    +
    +
    +
    +
    +

    + Every environment participating in a replicated application + must know whether it is a master or + replica. The reason for this is + because, simply, the master can modify the database while + replicas cannot. As a result, not only will you open + databases differently depended on whether the environment is + running as a master, but the environment will frequently + behave quit a bit differently depending on whether it + thinks it is operating as the read/write interface for + your database. +

    +

    + Moreover, an environment must also be capable of + gracefully switching between master and replica states. + This means that the environment must be able to detect when + it has switched states. +

    +

    + Not surprisingly, a large part of your application's code + will be tied up in knowing which state a given + environment is in and then in the logic of how to behave depending on + its state. +

    +

    + This chapter shows you how to determine your environment's + state, and it then shows you some sample code on how + an application might behave depending on whether it is a + master or a replica in a replicated application. +

    +
    +
    +
    +
    +

    Determining State

    +
    +
    +
    +
    +

    + In order to determine whether your code is + running as a master or a replica, you implement a + callback whose function it is to respond to + events that happen within the DB library. +

    +

    + Note that this callback is usable for events beyond + those required for replication purposes. In this + section, however, we only discuss the + replication-specific events. +

    +

    + The callback is required to determine + which event has been passed to it, and then take + action depending on the event. For replication, + the events that we care about are: +

    +
    +
      +
    • +

      + DB_EVENT_REP_MASTER + +

      +

      + The local environment is now a master. +

      +
    • +
    • +

      + DB_EVENT_REP_CLIENT + +

      +

      + The local environment is now a replica. +

      +
    • +
    • +

      + DB_EVENT_REP_STARTUPDONE + +

      +

      + The replica has completed startup + synchronization and is now + processing log records received + from the master. +

      +
    • +
    • +

      + DB_EVENT_REP_NEWMASTER + +

      +

      + An election was held and a new + environment was made a master. However, + the current environment is + not the master. This + event exists so that you can + cause your code to take some + unique action in the event that the + replication groups switches masters. +

      +
    • +
    +
    +

    + Note that these events are raised whenever the + state is established. That is, when the current + environment becomes a client, and that includes + at application startup, the event is raised. + Also, when an election is held and a client is elected to be a + master, then the event occurs. +

    +

    + The implementation of this callback is fairly + simple. First you pass a structure to the + environment handle that you can use to record the + environment's state, and then you implement a switch + statement within the callback that you use to + record the current state, depending on the + arriving event. +

    +

    + For example: +

    +
    #include <db.h>
    +/* Forward declaration */
    +void *event_callback(DB_ENV *, u_int32_t, void *);
    +
    +...
    +
    +/* The structure we use to track our environment's state */
    +typedef struct {
    +    int is_master;
    +} APP_DATA;
    +
    +...
    +
    +/*
    + * Inside our main() function, we declare an APP_DATA variable.
    + */
    +APP_DATA my_app_data;
    +my_app_data.is_master = 0; /* Assume we start as a replica */
    +
    +...
    +
    +/*
    + * Now we create our environment handle and set the APP_DATA structure
    + * to it's app_private member.
    + */
    +if ((ret = db_env_create(&dbenv, 0)) != 0 ) {
    +    fprintf(stderr, "Error creating handles: %s\n",
    +        db_strerror(ret));
    +    goto err;
    +}
    +dbenv->app_private = &my_app_data;
    +
    +/* Having done that, register the callback with the
    + * Berkeley DB library
    + */
    +dbenv->set_event_notify(dbenv, event_callback); 
    +

    + That done, we still need to implement the callback itself. This + implementation can be fairly trivial. +

    +
    /*
    + * A callback used to determine whether the local environment is a replica
    + * or a master. This is called by the replication framework
    + * when the local environment changes state.
    + */
    +void *
    +event_callback(DB_ENV *dbenv, u_int32_t which, void *info)
    +{
    +    APP_DATA *app = dbenv->app_private;
    +
    +    info = NULL;                /* Currently unused. */
    +
    +    switch (which) {
    +    case DB_EVENT_REP_MASTER:
    +        app->is_master = 1;
    +        break;
    +
    +    case DB_EVENT_REP_CLIENT:
    +        app->is_master = 0;
    +        break;
    +
    +    case DB_EVENT_REP_STARTUPDONE: /* fallthrough */
    +    case DB_EVENT_REP_NEWMASTER:
    +        /* Ignore. */
    +        break;
    +
    +    default:
    +        dbenv->errx(dbenv, "ignoring event %d", which);
    +    }
    +} 
    +

    + Notice how we access the + APP_DATA information using the environment + handle's app_private data member. We also ignore + the DB_EVENT_REP_NEWMASTER and + DB_EVENT_REP_STARTUPDONE cases since these are not + relevant for simple replicated applications. +

    +

    + Of course, this only gives us the current state of the environment. We + still need the code that determines what to do when the environment + changes state and how to behave depending on the state (described + in the next section). +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/fwrkpermmessage.html b/db/docs/gsg_db_rep/C/fwrkpermmessage.html new file mode 100644 index 000000000..ecb3b882c --- /dev/null +++ b/db/docs/gsg_db_rep/C/fwrkpermmessage.html @@ -0,0 +1,355 @@ + + + + + + Permanent Message Handling + + + + + + + + + +
    +
    +
    +
    +

    Permanent Message Handling

    +
    +
    +
    +
    +

    + As described in Permanent Message Handling, + messages are marked permanent if they contain database + modifications that should be committed at the replica. + DB's replication code decides if it must flush its + transaction logs to disk depending on whether it receives + sufficient permanent message acknowledgments from the + participating replica. More importantly, the thread + performing the transaction commit blocks + until it either receives enough acknowledgments, or the + acknowledgment timeout expires. +

    +

    + The replication framework is fully capable of managing permanent messages + for you if your application requires it (most do). + Almost all of the details of this are handled by the + replication framework for you. However, you do have to set some policies + that tell the replication framework how to handle permanent messages. +

    +

    + There are two things that you have to do: +

    +
    +
      +
    • +

      + Determine how many acknowledgments + must be received by the master. +

      +
    • +
    • +

      + Identify the amount of time that + replicas have to send their + acknowledgments. +

      +
    • +
    +
    +
    +
    +
    +
    +

    Identifying Permanent Message Policies

    +
    +
    +
    +
    +

    + + You identify permanent message policies using the + + DB_ENV->repmgr_set_ack_policy() + + method. + + + + + Note that you can set permanent message + policies at any time during the life of the + application. +

    +

    + The following permanent message policies are available when you use + the replication framework: +

    +
    +
      +
    • +

      + DB_REPMGR_ACKS_NONE + +

      +

      + No permanent message acknowledgments are required. If + this policy is selected, permanent message handling is + essentially "turned off." That is, the master will + never wait for replica acknowledgments. In this case, + transaction log data is either flushed or not strictly + depending on the type of commit that is being performed + (synchronous or asynchronous). +

      +
    • +
    • +

      + DB_REPMGR_ACKS_ONE + +

      +

      + At least one replica must acknowledge the permanent + message within the timeout period. +

      +
    • +
    • +

      + DB_REPMGR_ACKS_ONE_PEER + +

      +

      + At least one electable peer must acknowledge the permanent + message within the timeout period. + + Note that an + electable peer is simply another + environment that can be elected to be a master (that + is, it has a priority greater than 0). Do not confuse + this with the concept of a peer as used for client to + client transfers. See + Client to Client Transfer + for more information on client to client transfers. +

      +
    • +
    • +

      + DB_REPMGR_ACKS_ALL + +

      +

      + All environments must acknowledge the message within + the timeout period. This + policy should be selected only if your replication + group has a small number of replicas, and those replicas + are on extremely reliable networks and servers. +

      +

      + When this flag is used, the actual number of + environments that must respond is + determined by the value set for + DB_ENV->rep_set_nsites(). + + +

      +
    • +
    • +

      + DB_REPMGR_ACKS_ALL_PEERS + +

      +

      + All electable peers must acknowledge the message within the + timeout period. This + policy should be selected only if your replication + group is small, and its various environments + are on extremely reliable networks and servers. +

      +

      + Note that an + electable peer is simply another + environment that can be elected to be a master (that + is, it has a priority greater than 0). Do not confuse + this with the concept of a peer as used for client to + client transfers. See + Client to Client Transfer + for more information on client to client transfers. +

      +
    • +
    • +

      + DB_REPMGR_ACKS_QUORUM + +

      +

      + A quorum of electable peers must acknowledge the message within the timeout period. + A quorum is reached when acknowledgments are received from the minimum number + of environments needed to ensure that the record remains durable + if an election is held. That is, the master wants to hear from enough + electable replicas that they have committed the record so that if an election + is held, the master knows the record will exist even if a new master is selected. +

      +

      + Note that an + electable peer is simply another + environment that can be elected to be a master (that + is, it has a priority greater than 0). Do not confuse + this with the concept of a peer as used for client to + client transfers. See + Client to Client Transfer + for more information on client to client transfers. +

      +
    • +
    +
    +

    + By default, a quorum of sites must must acknowledge a permanent + message in order for it considered to have been successfully + transmitted. The actual number of environments that must respond is + calculated using the value set with + DB_ENV->rep_set_nsites(). + + +

    +
    +
    +
    +
    +
    +

    Setting the Permanent Message Timeout

    +
    +
    +
    +
    +

    + The permanent message timeout represents the + maximum amount of time the committing thread + will block waiting for message + acknowledgments. If sufficient + acknowledgments arrive before this timeout has + expired, the thread continues operations as + normal. However, if this timeout expires, the + committing thread flushes its transaction log + buffer before continuing with normal + operations. +

    +

    + You set the timeout value using the + DB_ENV->rep_set_timeout() + + method. When you do this, you provide the + DB_REP_ACK_TIMEOUT flag to + the which parameter, and the + timeout value in microseconds to the + timeout parameter. +

    +

    + For example: +

    +
        dbenv->rep_set_timeout(dbenv, DB_REP_ACK_TIMEOUT, 100); 
    +

    + This timeout value can be set at anytime during the + life of the application. +

    +
    +
    +
    +
    +
    +

    Adding a Permanent Message Policy to + rep_mgr + + +

    +
    +
    +
    +
    +

    + For illustration purposes, we will now update + rep_mgr + + + such that it requires only one acknowledgment from + a replica on transactional commits. Also, we will give + this acknowledgment a 500 microsecond timeout + value. This means that our application's main + thread will block for up to 500 microseconds waiting + for an acknowledgment. If it does not receive at + least one acknowledgment in that amount of time, + DB will flush the transaction logs to disk + before continuing on. +

    +

    + This is a very simple update. We can perform the + entire thing immediately before we parse our + command line options. This is where we configure + our environment handle anyway, so it is a good + place to put it. +

    +
        /*      
    +     * Create and configure the environment handle.
    +     */
    +    if ((ret = db_env_create(&dbenv, 0)) != 0 ) {
    +        fprintf(stderr, "Error creating handles: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +    
    +    dbenv->set_errfile(dbenv, stderr);
    +    dbenv->set_errpfx(dbenv, progname);
    +
    +    (void)dbenv->set_cachesize(dbenv, 0, CACHESIZE, 0);
    +
    +    /* Default priority is 100 */
    +    dbenv->rep_set_priority(dbenv, 100);
    +    /* Permanent messages require at least one ack */
    +    dbenv->repmgr_set_ack_policy(dbenv, DB_REPMGR_ACKS_ONE);
    +    /* Give 500 microseconds to receive the ack */
    +    dbenv->rep_set_timeout(dbenv, DB_REP_ACK_TIMEOUT, 500);
    +
    +    /* Collect the command line options */
    +    while ((ch = getopt(argc, argv, "h:m:o:p:")) != EOF)
    +
    +    ... 
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/gettingStarted.css b/db/docs/gsg_db_rep/C/gettingStarted.css new file mode 100644 index 000000000..c1b4c86b7 --- /dev/null +++ b/db/docs/gsg_db_rep/C/gettingStarted.css @@ -0,0 +1,41 @@ +body { width: 45em; + margin-left: 3em; + font-family: Arial, Helvetica, sans-serif; + font-size: 11pt; + } + +h2.title { margin-left: -1em; + font-family: Verdana, serif; + font-size: 16pt; + } + +h3.title { font-family: Verdana, serif; + font-size: 14pt; + } + +pre.programlisting { + font-family: monospace; + background-color: #eae8e9; +} + +div.navheader { font-size: 9pt; + width: 60em; + margin-left: -2em; + } + +div.navheader table tr td { font-size: 9pt; } + +div.navfooter { font-size: 9pt; + width: 60em; + margin-left: -2em; + } +div.navfooter table tr td { font-size: 9pt; } + +span.emphasis { font-style: italic; font-size: 9pt;} + +div.appendix div.informaltable { font-size: 9pt; } +div.appendix div.informaltable td { vertical-align: top; } +div.appendix div.informaltable p { margin-top: .25em; } +div.appendix div.informaltable p { margin-bottom: .25em; } + + diff --git a/db/docs/gsg_db_rep/C/index.html b/db/docs/gsg_db_rep/C/index.html new file mode 100644 index 000000000..4fe9dc3af --- /dev/null +++ b/db/docs/gsg_db_rep/C/index.html @@ -0,0 +1,447 @@ + + + + + + Getting Started with Replicated Berkeley DB Applications + + + + + + + +
    +
    +
    +
    +

    Getting Started with Replicated Berkeley DB Applications

    +
    +
    +
    +

    + Legal Notice +

    +

    + This documentation is distributed under an open source license. + You may review the terms of this license at: + http://www.oracle.com/technology/software/products/berkeley-db/htdocs/oslicensing.html + + +

    +

    + Oracle, Berkeley DB, + + + and + Sleepycat are trademarks or registered trademarks of + Oracle Corporation. All rights to these marks are reserved. + No third-party use is permitted without the + express prior written consent of Oracle Corporation. +

    +

    + To obtain a copy of this document's original source code, please + submit a request to the Oracle Technology Network forum at: + http://forums.oracle.com/forums/forum.jspa?forumID=271 + + +

    +
    +
    +
    +

    9/20/2006

    +
    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Preface + +
    +
    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +
    + + 1. Introduction + +
    +
    +
    +
    + + Overview + +
    +
    +
    +
    + + Replication Environments + +
    +
    + + Replication Databases + +
    +
    + + Communications Layer + +
    +
    + + Selecting a Master + +
    +
    +
    +
    + + Replication Benefits + +
    +
    + + The Replication APIs + +
    +
    +
    +
    + + Replication Framework Overview + +
    +
    + + Replication API Overview + +
    +
    +
    +
    + + Holding Elections + +
    +
    +
    +
    + + Influencing Elections + +
    +
    + + Winning Elections + +
    +
    + + Switching Masters + +
    +
    +
    +
    + + Permanent Message Handling + +
    +
    +
    +
    + + When Not to Manage + Permanent Messages + +
    +
    + + Managing Permanent Messages + +
    +
    + + Implementing Permanent + Message Handling + +
    +
    +
    +
    +
    +
    + + 2. Transactional Application + +
    +
    +
    +
    + + Application Overview + +
    +
    + + Program Listing + +
    +
    +
    +
    + + Function: main() + +
    +
    + + Function: create_env() + +
    +
    + + Function: env_init() + +
    +
    + + Function: doloop() + +
    +
    + + + Function: print_stocks() + + + + +
    +
    +
    +
    +
    +
    + + 3. The DB Replication Framework + +
    +
    +
    +
    + + + Starting and Stopping Replication + + +
    +
    +
    +
    + + Managing Election Policies + +
    +
    + + Selecting the Number of Threads + +
    +
    +
    +
    + + Adding the Replication Framework to + simple_txn + + + +
    +
    + + Permanent Message Handling + +
    +
    +
    +
    + + Identifying Permanent Message Policies + +
    +
    + + Setting the Permanent Message Timeout + +
    +
    + + Adding a Permanent Message Policy to + rep_mgr + + + + +
    +
    +
    +
    + + Managing Election Times + +
    +
    +
    +
    + + Managing Election Timeouts + +
    +
    + + Managing Election Retry Times + +
    +
    +
    +
    + + Managing Connection Retries + +
    +
    +
    +
    + + 4. Replica versus Master Processes + +
    +
    +
    +
    + + Determining State + +
    +
    + + Processing Loop + +
    +
    + + Example Processing Loop + +
    +
    +
    +
    + + Running It + +
    +
    +
    +
    +
    +
    + + 5. Additional Features + +
    +
    +
    +
    + + Delayed Synchronization + +
    +
    + + Managing Blocking Operations + +
    +
    + + Stop Auto-Initialization + +
    +
    + + Client to Client Transfer + +
    +
    +
    +
    + + Identifying Peers + +
    +
    +
    +
    + + Bulk Transfers + +
    +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/introduction.html b/db/docs/gsg_db_rep/C/introduction.html new file mode 100644 index 000000000..e3368a9c3 --- /dev/null +++ b/db/docs/gsg_db_rep/C/introduction.html @@ -0,0 +1,395 @@ + + + + + + Chapter 1. Introduction + + + + + + + + + +
    +
    +
    +
    +

    Chapter 1. Introduction

    +
    +
    +
    +
    + +

    + This book provides a thorough introduction and discussion on + replication as used with Berkeley DB (DB). It begins by offering a + general overview to replication and the benefits it provides. It also + describes the APIs that you use to implement replication, and it + describes architecturally the things that you need to do to your + application code in order to use the replication APIs. Finally, it + discusses the differences in backup and restore strategies that you + might pursue when using replication, especially where it comes to log + file removal. +

    +

    + You should understand the concepts from the + + Berkeley DB Getting Started with Transaction Processing + + + + guide before reading this book. +

    +
    +
    +
    +
    +

    Overview

    +
    +
    +
    +
    +

    + The DB replication APIs allow you to distribute your database + write operations (performed on a read-write master) to one or + more read-only replicas. + For this reason, DB's replication implementation is said to be a + single master, multiple replica replication strategy. +

    +

    + Note that your database write operations can occur only on the + master; any attempt to write to a replica results in an error + being + returned to + + the DB API used to perform the write. +

    +

    + A single replication master and all of its replicas are referred + to as a replication group. While all + members of the replication group can reside on the same + machine, usually each replication participant is placed on a + separate physical machine somewhere on the network. +

    +

    + Note that all replication applications must first be + transactional applications. The data that the master transmits + its replicas are log records that are generated as records are + updated. Upon transactional commit, the master transmits a + transaction record which tells the replicas to commit the + records they previously received from the master. In order for + all of this to work, your replicated application must also be a + transactional application. For this reason, it is + recommended that you write and debug your DB application as + a stand-alone transactional application before introducing the + replication layer to your code. +

    +

    + Finally, be aware that all machines participating in the + replication group must share identical + endianess. Endianess is the byte-order + strategy used by the computing platform to store multibyte + numbers. Berkeley DB is sensitive to byte order and so your + replication infrastructure must be consistent in this area. + We expect to remove this requirement in some future + release of the product. +

    +
    +
    +
    +
    +

    Replication Environments

    +
    +
    +
    +
    +

    + The most important requirement for a replication + participant is that it must use a unique Berkeley DB database + environment independent of all other replication + participants. So while multiple replication participants + can reside on the same physical machine, no two such participants + can share the same environment home directory. +

    +

    + For this reason, technically replication occurs between + unique database environments. So in the strictest sense, + a replication group consists of a master + environment and + one or more replica environments. However, the reality + is that for production code, each such environment will + usually be located on its own unique machine. Consequently, + this manual sometimes talks about replication sites, meaning the + unique combination of environment home directory, host and port that a specific + replication application is using. +

    +

    + There is no DB-specified limit to the number of + environments which can participate in a replication group. + The only limitation here is one of resources — + network bandwidth, for example. +

    +

    + (Note, however, that the replication framework does place a limit on the + number of environments you can use. See + Replication Framework Overview + for details.) +

    +

    + Also, DB's replication implementation requires all + participating environments to be assigned IDs that are + locally unique to the given environment. Depending on the + replication APIs that you choose to use, you may or may not + need to manage this particular detail. +

    +

    + For detailed information on database environments, see + the Berkeley DB Getting Started with Transaction Processing + guide. For more information on environment IDs, see + the Berkeley DB Programmer's Reference Guide. +

    +
    +
    +
    +
    +
    +

    Replication Databases

    +
    +
    +
    +
    +

    + DB's databases are managed and used in exactly the same way + as if you were writing a non-replicated application, with + a couple of caveats. First, the databases maintained in a replicated environment + must reside either in the ENV_HOME + directory, or in the directory identified by the + DB_ENV->set_data_dir() + + + method. Unlike non-replication applications, you cannot place your + databases in a subdirectory below these locations. You should + also not use full path names for your databases or + environments as these are likely to break as to replicated + to other machines. +

    +
    +
    +
    +
    +
    +

    Communications Layer

    +
    +
    +
    +
    +

    + In order to transmit database writes to the replication + replicas, DB requires a communications layer. + DB is agnostic as to what this layer should + look like. The only requirement is that it + be capable of passing two opaque data objects and an + environment ID from the master to its replicas without + corruption. +

    +

    + Because replicas are usually placed on different machines on + the network, the communications layer is usually some kind + of a network-aware implementation. Beyond that, its + implementation details are largely up to you. It could use + TCP/IP sockets, for example, or it could use + raw sockets if they perform better for your particular + application. +

    +

    + Note that you may not have to write your own communications + layer. DB provides a replication framework that + includes a fully-functional TCP/IP-based communications layer. + See The Replication APIs + for more information. +

    +

    + See the Berkeley DB Programmer's Reference Guide + for a description of how to + write your own custom replication communications layer. +

    +
    +
    +
    +
    +
    +

    Selecting a Master

    +
    +
    +
    +
    +

    + Every replication group is allowed one and only one + master environment. Almost always, masters are selected by + holding an election. All such + elections are performed by the underlying Berkeley DB + replication code so you have to do very little to + implement them. +

    +

    + When holding an election, replicas "vote" on who should + be the master. Among replicas participating in the + election, the one with the most up-to-date set of log + records will win the election. Note that it's possible + for there to be a tie. When this occurs, priorities are + used to select the master. See + Holding Elections + for details. +

    +

    + For more information on holding and managing elections, + see Holding Elections. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/manageblock.html b/db/docs/gsg_db_rep/C/manageblock.html new file mode 100644 index 000000000..230d1a3db --- /dev/null +++ b/db/docs/gsg_db_rep/C/manageblock.html @@ -0,0 +1,88 @@ + + + + + + Managing Blocking Operations + + + + + + + + + +
    +
    +
    +
    +

    Managing Blocking Operations

    +
    +
    +
    +
    +

    + When a replica is in the process of synchronizing with its master, all DB + operations are blocked until such a time as the synchronization is completed. + For replicas with a heavy read load, these blocked operations may represent an + unacceptable loss in throughput. +

    +

    + You can configure DB so that it will not block when synchronization is in + process. Instead, the DB operation will fail, + + + immediately returning a DB_REP_LOCKOUT error. + + + + When this happens, it is up to your application to your application to determine + what action to take (that is, logging the event, making an appropriate user + response, retrying the operation, and so forth). +

    +

    + To turn off blocking on synchronization, specify + + DB_REP_CONF_NOWAIT to + DB_ENV->rep_set_config() + + and then specify 1 to the onoff + parameter. (Specify 0 to turn the feature off.) + + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/C/noautoinit.html b/db/docs/gsg_db_rep/C/noautoinit.html new file mode 100644 index 000000000..85771bd35 --- /dev/null +++ b/db/docs/gsg_db_rep/C/noautoinit.html @@ -0,0 +1,88 @@ + + + + + + Stop Auto-Initialization + + + + + + + + + +
    +
    +
    +
    +

    Stop Auto-Initialization

    +
    +
    +
    +
    +

    + As stated in the previous section, when a replication replica is synchronizing + with its master, it will block all DB operations until the synchronization + is completed. You can turn off this behavior (see Managing Blocking Operations), but for replicas that have been out of touch + from their master for a very long time, this may not be enough. +

    +

    + If a replica has been out of touch from its master long enough, it may find that + it is not possible to perform synchronization. When this happens, by default the + master and replica internally decided to completely re-initialize the replica. + This re-initialization involves discarding the replica's current database(s) and + transferring new ones to it from the master. Depending on the size of the master's + databases, this can take a long time, during which time the replica will be + complete non-responsive when it comes to performing database operations. +

    +

    + It is possible that there is a time of the day when it is better to perform a replica + re-initialization. Or, you simply might want to decide to bring the replica up to + speed by restoring it's databases using a hot-backup taken from the master. Either + way, you can decide to prevent automatic-initialization of your replica. To do this + specify + + DB_REP_CONF_NOAUTOINIT to + DB_ENV->rep_set_config() + + and then specify 1 to the onoff + parameter. (Specify 0 to turn the feature off.) + + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/C/permmessages.html b/db/docs/gsg_db_rep/C/permmessages.html new file mode 100644 index 000000000..c2ed56f92 --- /dev/null +++ b/db/docs/gsg_db_rep/C/permmessages.html @@ -0,0 +1,390 @@ + + + + + + Permanent Message Handling + + + + + + + + + +
    +
    +
    +
    +

    Permanent Message Handling

    +
    +
    +
    +
    +

    + Messages received by a replica may be marked with an + special flag that indicates the message is permanent. + Custom replicated applications will receive notification of + this flag via the DB_REP_ISPERM return value + from the + DB_ENV->rep_process_message() + + method. + + There is no hard requirement that a replication application look for, or + respond to, this return code. However, because robust replicated + applications typically do manage permanent messages, we introduce + the concept here. +

    +

    + A message is marked as being permanent if the message + affects transactional integrity. For example, + transaction commit messages are an example of a message + that is marked permanent. What the application does + about the permanent message is driven by the durability + guarantees required by the application. +

    +

    + For example, consider what the replication framework does when it + has permanent message handling turned on and a + transactional commit record is sent to the replicas. + First, the replicas must transactional-commit the data + modifications identified by the message. And then, upon + a successful commit, the replication framework sends the master a + message acknowledgment. +

    +

    + For the master (again, using the replication framework), things are a little more complicated than + simple message acknowledgment. Usually in a replicated + application, the master commits transactions + asynchronously; that is, the commit operation does not + block waiting for log data to be flushed to disk before + returning. So when a master is managing permanent + messages, it typically blocks the committing thread + immediately before commit() + returns. The thread then waits for acknowledgments from + its replicas. If it receives enough acknowledgments, it + continues to operate as normal. +

    +

    + If the master does not + receive message acknowledgments — or, more likely, it does not receive + enough acknowledgments — the + committing thread flushes its log data to disk and then + continues operations as normal. The master application can + do this because replicas that fail to handle a message, for + whatever reason, will eventually catch up to the master. So + by flushing the transaction logs to disk, the master is + ensuring that the data modifications have made it to + stable storage in one location (its own hard drive). +

    +
    +
    +
    +
    +

    When Not to Manage + Permanent Messages

    +
    +
    +
    +
    +

    + There are two reasons why you might + choose to not implement permanent messages. + In part, these go to why you are using + replication in the first place. +

    +

    + One class of applications uses replication so that + the application can improve transaction + through-put. Essentially, the application chooses a + reduced transactional durability guarantee so as to + avoid the overhead forced by the disk I/O required + to flush transaction logs to disk. However, the + application can then regain that durability + guarantee to a certain degree by replicating the + commit to some number of replicas. +

    +

    + Using replication to improve an application's + transactional commit guarantee is called + replicating to the network. +

    +

    + In extreme cases where performance is of critical + importance to the application, the master might + choose to both use asynchronous commits + and decide not to wait for + message acknowledgments. In this case the master + is simply broadcasting its commit activities to its + replicas without waiting for any sort of a reply. An + application like this might also choose to use + something other than TCP/IP for its network + communications since that protocol involves a fair + amount of packet acknowledgment all on its own. Of + course, this sort of an application should also be + very sure about the reliability of both its network and + the machines that are hosting its replicas. +

    +

    + At the other end of the extreme, there is a + class of applications that use replication + purely to improve read performance. This sort + of application might choose to use synchronous + commits on the master because write + performance there is not of critical + performance. In any case, this kind of an + application might not care to know whether its + replicas have received and successfully handled + permanent messages because the primary storage + location is assumed to be on the master, not + the replicas. +

    +
    +
    +
    +
    +
    +

    Managing Permanent Messages

    +
    +
    +
    +
    +

    + With the exception of a rare breed of + replicated applications, most masters need some + view as to whether commits are occurring on + replicas as expected. At a minimum, this is because + masters will not flush their log buffers unless + they have reason to expect that permanent + messages have not been committed on the + replicas. +

    +

    + That said, it is important to remember that + managing permanent messages involves a fair amount + of network traffic. The messages must be sent to + the replicas and the replicas must then acknowledge + the message. This represents a performance overhead + that can be worsened by congested networks or + outright outages. +

    +

    + Therefore, when managing permanent messages, you + must first decide on how many of your replicas must + send acknowledgments before your master decides + that all is well and it can continue normal + operations. When making this decision, you could + decide that all replicas must + send acknowledgments. But unless you have only one + or two replicas, or you are replicating over a very + fast and reliable network, this policy could prove + very harmful to your application's performance. +

    +

    + Therefore, a common strategy is to wait for an + acknowledgment from a simple majority of replicas. + This ensures that commit activity has occurred on + enough machines that you can be reliably certain + that data writes are preserved across your network. +

    +

    + Remember that replicas that do not acknowledge a + permanent message are not necessarily unable to + perform the commit; it might be that network + problems have simply resulted in a delay at the + replica. In any case, the underlying DB + replication code is written such that a replica that + falls behind the master will eventually take action + to catch up. +

    +

    + Depending on your application, it may be + possible for you to code your permanent message + handling such that acknowledgment must come + from only one or two replicas. This is a + particularly attractive strategy if you are + closely managing which machines are eligible to + become masters. Assuming that you have one or + two machines designated to be a master in the + event that the current master goes down, you + may only want to receive acknowledgments from + those specific machines. +

    +

    + Finally, beyond simple message acknowledgment, you + also need to implement an acknowledgment timeout + for your application. This timeout value is simply + meant to ensure that your master does not hang + indefinitely waiting for responses that will never + come because a machine or router is down. +

    +
    +
    +
    +
    +
    +

    Implementing Permanent + Message Handling

    +
    +
    +
    +
    +

    + How you implement permanent message handling + depends on which API you are using to implement + replication. If you are using the replication framework, then + permanent message handling is configured using + policies that you specify to the framework. In + this case, you can configure your application + to: +

    +
    +
      +
    • +

      + Ignore permanent messages (the master + does not wait for acknowledgments). +

      +
    • +
    • +

      + Require acknowledgments from a + quorum. A quorum is reached when + acknowledgments are received from the + minimum number of electable + replicas needed to ensure that + the record remains durable if + an election is held. +

      +

      + The goal here is to be + absolutely sure the record is + durable. The master wants to + hear from enough electable + replicas that they have + committed the record so that if + an election is held, the master + knows the record will exist even + if a new master is selected. +

      +

      + This is the default policy. +

      +
    • +
    • +

      + Require an acknowledgment from at least one replica. +

      +
    • +
    • +

      + Require acknowledgments from + all replicas. +

      +
    • +
    • +

      + Require an acknowledgment from a + peer. (The replication framework allows you to + designate one environment as a peer of + another). +

      +
    • +
    • +

      + Require acknowledgments from + all peers. +

      +
    • +
    +
    +

    + Note that the replication framework simply flushes its transaction + logs and moves on if a permanent message is not + sufficiently acknowledged. +

    +

    + For details on permanent message handling with the + replication framework, see Permanent Message Handling. +

    +

    + If these policies are not sufficient for your + needs, or if you want your application to take more + corrective action than simply flushing log buffers + in the event of an unsuccessful commit, then you + must use write a custom replication implementation. +

    +

    + For custom replication implementation, messages are + sent from the master to its replica using a + send() callback that you + implement. Note, however, that DB's replication + code automatically sets the permanent + flag for you where appropriate. +

    +

    + If the send() callback returns with a + non-zero status, DB flushes the transaction log + buffers for you. Therefore, you must cause your + send() callback to block waiting + for acknowledgments from your replicas. + As a part of implementing the + send() callback, you implement + your permanent message handling policies. This + means that you identify how many replicas must + acknowledge the message before the callback can + return 0. You must also + implement the acknowledgment timeout, if any. +

    +

    + Further, message acknowledgments are sent from the + replicas to the master using a communications + channel that you implement (the replication code + does not provide a channel for acknowledgments). + So implementing permanent messages means that when + you write your replication communications channel, + you must also write it in such a way as to also + handle permanent message acknowledgments. +

    +

    + For more information on implementing permanent + message handling using a custom replication layer, + see the Berkeley DB Programmer's Reference Guide. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/preface.html b/db/docs/gsg_db_rep/C/preface.html new file mode 100644 index 000000000..db9d98bdc --- /dev/null +++ b/db/docs/gsg_db_rep/C/preface.html @@ -0,0 +1,212 @@ + + + + + + Preface + + + + + + + + + +
    +
    +
    +
    +

    Preface

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +

    + This document describes how to write replicated Berkeley DB applications. + The APIs used to implement replication in your application + are described here. This book describes the concepts surrounding replication, the scenarios under which you + might choose to use it, and the architectural requirements that a replication application has over a + transactional application. +

    +

    + This book is aimed at the software engineer responsible for writing a + replicated DB application. +

    +

    + This book assumes that you have already read and understood the + concepts contained in the + Berkeley DB Getting Started with Transaction Processing guide. + +

    +
    +
    +
    +
    +

    Conventions Used in this Book

    +
    +
    +
    +
    +

    + The following typographical conventions are used within in this manual: +

    +

    + Structure names are represented in monospaced font, as are method + names. For example: "DB->open() is a method + on a DB handle." +

    +

    + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALL directory." +

    +

    + Program examples are displayed in a monospaced font on a shaded background. + For example: +

    +
    /* File: gettingstarted_common.h */
    +typedef struct stock_dbs {
    +    DB *inventory_dbp; /* Database containing inventory information */
    +    DB *vendor_dbp;    /* Database containing vendor information */
    +
    +    char *db_home_dir;       /* Directory containing the database files */
    +    char *inventory_db_name; /* Name of the inventory database */
    +    char *vendor_db_name;    /* Name of the vendor database */
    +} STOCK_DBS; 
    +

    + In some situations, programming examples are updated from one chapter to the next. When + this occurs, the new code is presented in monospaced bold font. For example: +

    +
    typedef struct stock_dbs {
    +    DB *inventory_dbp; /* Database containing inventory information */
    +    DB *vendor_dbp;    /* Database containing vendor information */
    +    DB *itemname_sdbp; /* Index based on the item name index */
    +    char *db_home_dir;       /* Directory containing the database files */
    +    char *itemname_db_name;  /* Itemname secondary database */
    +    char *inventory_db_name; /* Name of the inventory database */
    +    char *vendor_db_name;    /* Name of the vendor database */
    +} STOCK_DBS; 
    +
    +

    Note

    +

    + Finally, notes of special interest are represented using a note block such + as this. +

    +
    +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + transactional DB application: +

    + +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/processingloop.html b/db/docs/gsg_db_rep/C/processingloop.html new file mode 100644 index 000000000..94c0035a9 --- /dev/null +++ b/db/docs/gsg_db_rep/C/processingloop.html @@ -0,0 +1,255 @@ + + + + + + Processing Loop + + + + + + + + + +
    +
    +
    +
    +

    Processing Loop

    +
    +
    +
    +
    +

    + Typically the central part of any replication application + is some sort of a continuous loop that constantly + checks the state of the environment (whether it is a + replica or a master), opens and/or closes the + databases as is necessary, and performs other useful + work. A loop such as this one must of necessity + take special care to know whether it is operating + on a master or a replica environment because all of its + activities are dependent upon that state. +

    +

    + The flow of activities through the loop will + generally be as follows: +

    +
    +
      +
    1. +

      + Check whether the environment has + changed state. If it has, you + might want to reopen your + database handles, especially if + you opened your replica's + database handles as read-only. + In this case, you might need to + reopen them as read-write. + However, if you always open your + database handles as read-write, + then it is not automatically necessary to + reopen the databases due to a + state change. Instead, you + could check for a + + DB_REP_HANDLE_DEAD + return code + + + + when you use your + database handle(s). If you see + this, then you need to reopen + your database handle(s). +

      +
    2. +
    3. +

      + If the databases are closed, + create new database handles, + configure the handle as is + appropriate, and then open the + databases. Note that handle + configuration will be different, + depending on whether the handle + is opened as a replica or a + master. At a minimum, the master + should be opened with database + creation privileges, whereas the + replica does not need to be. You + must also open the master such + that its databases are + read-write. You + can open + replicas with read-only + databases, so long as you are + prepared to closed and the reopen + the handle in the event the + client becomes a master. +

      +

      + Also, note that if the local + environment + is a replica, then it is possible + that databases do not currently + exist. In this case, the database + open attempts will fail. Your + code will have to take this + corner case into account + (described below). +

      +
    4. +
    5. +

      + Once the databases are opened, + check to see if the local + environment is a + master. If it is, do whatever it is + a master should do for your + application. +

      +

      + Remember that the code for your + master should include some way + for you to tell the master + to exit gracefully. +

      +
    6. +
    7. +

      + If the local environment is not a + master, then do whatever it is + your replica environments should do. + Again, like the code for your + master environments, you should provide + a way for your replicas to exit + the processing loop gracefully. +

      +
    8. +
    +
    +

    + The following code fragment illustrates + these points (note that we fill out this + fragment with a working example + next in this chapter): +

    +
    /* loop to manage replication activities */
    +
    +DB *dbp;
    +int ret;
    +APP_DATA *app_data;
    +u_int32_t flags;
    +
    +dbp = NULL;
    +ret = 0;
    +
    +/* 
    + * Remember that for this to work, an APP_DATA struct would have first
    + * had to been set to the environment handle's app_private data
    + * member. (dbenv is presumable declared and opened in another part of
    + * the code.)
    + */
    +app_data = dbenv->app_private;
    +
    +
    +/* 
    + * Infinite loop. We exit depending on how the master and replica code
    + * is written.
    + */
    +for (;;) {
    +    /* If dbp is not opened, we need to open it. */
    +    if (dbp == NULL) {
    +        /* 
    +         * Create the handle and then configure it. Before you open
    +         * it, you have to decide what open flags to use:
    +         */
    +         flags = DB_AUTO_COMMIT;
    +         if (app_data->is_master)
    +            flags |= DB_CREATE
    +         /*
    +          * Now you can open your database handle, passing to it the
    +          * flags selected above. 
    +          *
    +          * One thing to watch out for is a case where the databases 
    +          * you are trying to open do not yet exist. This can happen 
    +          * for replicas where the databases are being opened 
    +          * read-only. If this happens, ENOENT is returned by the 
    +          * open() call.
    +          */
    +
    +          if (( ret = dbp->open(...)) != 0) {
    +            if (ret == ENOENT) {
    +                /* Close the database handle, then null it out, then 
    +                 * sleep for some amount of time in order to give 
    +                 * replication a chance to create the databases.
    +                 */
    +                 dbp->close(dbp, 0);   // Ignoring ret code. 
    +                                       // Not robust!
    +                 dbp = NULL;
    +                 sleep(SOME_SLEEPTIME);
    +                 continue;
    +            }
    +            /* 
    +             * Otherwise, some other error has happened and general
    +             * error handling should be used.
    +             */
    +             goto err;
    +          }
    +    }
    +
    +    /*
    +     * Now that the databases have been opened, continue with general
    +     * processing, depending on whether we are a master or a replica.
    +     */
    +     if (app_data->is_master) {
    +        /* 
    +         * Do master stuff here. Don't forget to include a way to
    +         * gracefully exit the loop. */
    +         */
    +     } else {
    +        /* 
    +         * Do replica stuff here. As is the case with the master
    +         * code, be sure to include a way to gracefully exit the
    +         * loop. 
    +         */
    +     }
    +} 
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/repadvantage.html b/db/docs/gsg_db_rep/C/repadvantage.html new file mode 100644 index 000000000..c7ab72c1a --- /dev/null +++ b/db/docs/gsg_db_rep/C/repadvantage.html @@ -0,0 +1,184 @@ + + + + + + Replication Benefits + + + + + + + + + +
    +
    +
    +
    +

    Replication Benefits

    +
    +
    +
    +
    +

    + + Replication offers your application a number of benefits that + can be a tremendous help. Primarily replication's benefits + revolve around performance, but there is also a benefit in + terms of data durability guarantees. +

    +

    + Briefly, the reasons why you might choose to implement + replication in your DB application are: +

    +
    +
    +
      +
    • +

      + Improved application reliability. +

      +

      + By spreading your data across multiple + machines, you can ensure that your + application's data continues to be + available even in the event of a + hardware failure on any given machine in + the replication group. +

      +
    • +
    +
    +
      +
    • +

      + Improve read performance. +

      +

      + By using replication you can spread data reads across + multiple machines on your network. Doing so allows you + to vastly improve your application's read performance. + This strategy might be particularly interesting for + applications that have readers on remote network nodes; + you can push your data to the network's edges thereby + improving application data read responsiveness. +

      +

      + Additionally, depending on how you partition your + data across your replicas, any given replica may + only need to cache part of your data, decreasing + cache misses and reducing I/O on the client. +

      +
    • +
    • +

      + Improve transactional commit performance +

      +

      + In order to commit a transaction and achieve a + transactional durability guarantee, the commit must be + made durable. That is, the commit + must be written to disk (usually, but not always, + synchronously) before the application's thread of + control can continue operations. +

      +

      + Replication allows you to avoid this disk I/O and still + maintain a degree of durability by committing + to the network. In other words, you relax + your transactional durability guarantees on the master, + but by virtue of replicating the data across the + network you gain some additional durability guarantees + above what is provided locally. +

      +

      + Usually this strategy is implemented using some form of + an asynchronous transactional commit on the master. In + this way your data writes will eventually be written to + disk, but your application will not have to wait for + the disk I/O to complete before continuing with its + next operation. +

      +

      + Note that it is possible to cause DB's replication + implementation to wait to hear from one or + more replica's as to whether they have successfully + saved the write before continuing. However, in this + case you might be trading performance for a even + higher durability guarantee (see below). +

      +
    • +
    • +

      + Improve data durability guarantee. +

      +

      + In a traditional transactional application, you commit your + transactions such that data modifications are saved to + disk. Beyond this, the durability of your data is + dependent upon the backup strategy that you choose to + implement for your site. +

      +

      + Replication allows you to increase this durability + guarantee by ensuring that data modifications are + written to multiple machines. This means that multiple + disks, disk controllers, power supplies, and CPUs are + used to ensure that your data modification makes it to + stable storage. In other words, replication allows you + to minimize the problem of a single point of failure + by using more hardware to guarantee your data writes. +

      +

      + If you are using replication for this reason, then you + probably will want to configure your application such + that it waits to hear about a successful commit from + one or more replicas before continuing with the next + operation. This will obviously impact your + application's write performance to some degree + — with the performance penalty being largely dependent + upon the speed and stability of the network connecting + your replication group. +

      +

      + For more information, see Permanent Message Handling. +

      +
    • +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/repapp.html b/db/docs/gsg_db_rep/C/repapp.html new file mode 100644 index 000000000..d46f167d9 --- /dev/null +++ b/db/docs/gsg_db_rep/C/repapp.html @@ -0,0 +1,720 @@ + + + + + + Chapter 3. The DB Replication Framework + + + + + + + + + +
    +
    +
    +
    +

    Chapter 3. The DB Replication Framework

    +
    +
    +
    +
    + +

    + The easiest way to add replication to your transactional + application is to use the replication framework. The replication framework provides a comprehensive + communications layer that enables replication. For a brief listing + of the replication framework's feature set, see + Replication Framework Overview. +

    +

    + To use the replication framework, you make use of special methods off the + DB_ENV class. + + That is: +

    +
    +
      +
    1. +

      + Create an environment handle as normal. +

      +
    2. +
    3. +

      + Configure your environment handle as + needed (e.g. set the error file and + error prefix values, if desired). +

      +
    4. +
    5. +

      + Use the replication framework replication methods to + configure the replication framework. Using these + methods causes DB to know that you + are using the replication framework. +

      +

      + Configuring the replication framework + entails setting its replication + priority, setting the TCP/IP address + that this replication environment will use for + incoming replication messages, identify + TCP/IP addresses of other replication + environments, setting the number of + replication environments in the + replication group, and so forth. These actions are + discussed throughout the remainder of + this chapter. +

      +
    6. +
    7. +

      + Open your environment handle. When you + do this, be sure to specify + + DB_INIT_REP and + DB_THREAD to your + open flags. (This is in addition to the + flags that you normally use for a + single-threaded transactional + application). The first of these causes + replication to be initialized for the + application. The second causes your + environment handle to be free-threaded + (thread safe). Both flags are required + for replication framework usage. + + + +

      +
    8. +
    9. +

      + Start replication by calling + DB_ENV->repmgr_start(). + + +

      +
    10. +
    11. +

      + Open your databases as needed. Masters + must open their databases for read + and write activity. Replicas can open + their databases for read-only activity, but + doing so means they must re-open the + databases if the replica ever becomes a + master. Either way, replicas should never attempt to + write to the database(s) directly. +

      +
    12. +
    +
    +
    +

    Note

    +

    + The replication framework allows you to only use one + environment handle per process. +

    +
    +

    + When you are ready to shut down your application: +

    +
    +
      +
    1. +

      + Close your databases +

      +
    2. +
    3. +

      + Close your environment. This causes + replication to stop as well. +

      +
    4. +
    +
    +
    +

    Note

    +

    + Before you can use the replication framework, you may have to + enable it in your DB library. This is + not a requirement for + Microsoft Windows systems, or Unix systems that + use pthread mutexes by default. Other systems, + notably BSD and BSD-derived systems (such as + Mac OS X), must enable the replication framework when you + configure the DB build. +

    +

    + You do this by not + disabling replication and by configuring the + library with POSIX threads support. In other + words, replication must be turned on in the + build (it is by default), and POSIX thread + support must be enabled if it is not already by + default. To do this, use the + --enable-pthread_api switch + on the configure script. +

    +

    + For example: +

    +
    ../dist/configure --enable-pthread-api
    +
    +
    +
    +
    +
    +

    + Starting and Stopping Replication +

    +
    +
    +
    +
    +

    + As described above, you introduce replication to an + application by starting with a transactional + application, performing some basic replication + configuration, and then starting replication using + DB_ENV->repmgr_start(). + + +

    +

    + You stop replication by closing your environment + cleanly, as is normal for an DB application. +

    +

    + For example, the following code fragment initializes, then + stops and starts replication. Note that other replication + activities are omitted for brevity. +

    +
    +

    Note

    +

    + Note that the following code fragment would be part of a larger + class that must implement + com.sleepycat.db.EventHandler. This + class is used to track state changes between master and + replica. We put off that implementation for the moment, but the + point remains that the following code fragment would be + contained in a method or two that you would include in your + com.sleepycat.db.EventHandler + implementation. +

    +
    +
    #include <db.h>
    +
    +/* Use a 10mb cache */
    +#define CACHESIZE   (10 * 1024 * 1024)
    +
    +...
    +
    +    DB_ENV *dbenv;            /* Environment handle. */
    +    const char *progname;     /* Program name. */
    +    const char *envHome;      /* Environment home directory. */
    +    const char *listen_host;  /* A TCP/IP hostname. */
    +    const char *other_host;   /* A TCP/IP hostname. */
    +    int ret;                  /* Error return code. */
    +    u_int16 listen_port;      /* A TCP/IP port. */
    +    u_int16 other_port;       /* A TCP/IP port. */
    +
    +    /* Initialize variables */
    +    dbenv = NULL;
    +    progname = "example_replication";
    +    envHome = "ENVIRONMENT_HOME";
    +    listen_host = "mymachine.sleepycat.com";
    +    listen_port = 5001;
    +    other_host = "anothermachine.sleepycat.com";
    +    other_port = 4555;
    +    ret = 0;
    +
    +    /* Create the environment handle */
    +    if ((ret = db_env_create(&dbenv, 0)) != 0 ) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* 
    +     * Configure the environment handle. Here we configure asynchronous
    +     * transactional commits for performance reasons. 
    +     */
    +    dbenv->set_errfile(dbenv, stderr);
    +    dbenv->set_errpfx(dbenv, progname);
    +    (void)dbenv->set_cachesize(dbenv, 0, CACHESIZE, 0);
    +    (void)dbenv->set_flags(dbenv, DB_TXN_NOSYNC, 1);
    +
    +
    +    /*
    +     * Configure the local address. This is the local hostname and port
    +     * that this replication participant will use to receive incoming
    +     * replication messages. Note that this can be performed only once for
    +     * the application. It is required.
    +     */
    +     if ((ret = dbenv->repmgr_set_local_site(dbenv, listen_host,
    +                                              listen_port, 0)) != 0) {
    +        fprintf(stderr, "Could not set local address (%d).\n", ret);
    +        goto err;
    +     }
    +
    +    /*
    +     * Set this application's priority. This is used for elections.
    +     *
    +     * Set this number to a positive integer, or 0 if you do not want this
    +     * site to be able to become a master.
    +     */
    +    dbenv->rep_set_priority(dbenv, 100);
    +
    +    /*
    +     * Add a site to the list of replication environments known to this
    +     * application. 
    +     */
    +    if (dbenv->repmgr_add_remote_site(dbenv, other_host, other_port) != 0) {
    +        fprintf(stderr, "Could not add site %s.\n", other_host);
    +        goto err;
    +    }
    +
    +    /*
    +     * Identify the number of sites in the replication group. This is
    +     * necessary so that elections and permanent message handling can be
    +     * performed correctly.
    +     */
    +    if (dbenv->repmgr_add_nsites(dbenv, 2) != 0) {
    +        fprintf(stderr, "Could not set the number of sites.\n";
    +        goto err;
    +    }
    +
    +    /* Open the environment handle. Note that we add DB_THREAD and
    +     * DB_INIT_REP to the list of flags. These are required.
    +     */
    +    if ((ret = dbenv->open(dbenv, home, DB_CREATE | DB_RECOVER |
    +                                        DB_INIT_LOCK | DB_INIT_LOG |
    +                                        DB_INIT_MPOOL | DB_INIT_TXN  |
    +                                        DB_THREAD | DB_INIT_REP,
    +                                        0)) != 0) {
    +        goto err;
    +    }
    +
    +    /* Start the replication framework such that it uses 3 threads. */
    +    if ((ret = dbenv->repmgr_start(dbenv, 3, DB_REP_ELECTION)) != 0)
    +        goto err;
    +
    +    /* Sleep to give ourselves time to find a master */
    +    sleep(5);
    +
    +    /*
    +     **********************************************************
    +     *** All other application code goes here, including  *****
    +     *** database opens                                   *****
    +     **********************************************************
    +     */
    +
    +err: /* 
    +      * Make sure all your database handles are closed 
    +      *  (omitted from this example). 
    +      */
    +
    +    /* Close the environment */
    +    if (dbenv != NULL)
    +        (void)dbenv->close(dbenv, 0);
    +
    +    /* All done */
    +    return (ret); 
    +
    +
    +
    +
    +

    Managing Election Policies

    +
    +
    +
    +
    +

    + Before continuing, it is worth taking a look at the + + + startup election flags accepted by + DB_ENV->repgmr_start(). + + These flags control how your replication application will + behave when it first starts up. + + + +

    +

    + In the previous example, we specified + DB_REP_ELECTION + + when we started replication. This causes the + application to try to find a master upon startup. If it + cannot, it calls for an election. In the event an + election is held, the environment receiving the most number of + votes will become the master. +

    +

    + There's some important points to make here: +

    +
    +
      +
    • +

      + This + flag + + only requires that other + environments in the replication group + participate in the vote. There is no + requirement that + all such + environments participate. In other + words, if an environment + starts up, it can call for an + election, and select a master, even + if all other environment have not yet + joined the replication group. +

      +
    • +
    • +

      + It only requires a simple majority of + participating environments to elect a master. The number of + environments used to calculate the simple + majority is based on the value set for + + DB_ENV->rep_set_nsites(). + + + + + This is always true of elections held using the replication framework. +

      +
    • +
    • +

      + As always, the environment participating in the election with the most + up-to-date log files is selected as + master. If an environment with better log files + has not yet joined the replication + group, it may not become the master. +

      +
    • +
    +
    +

    + Any one of these points may be enough to cause a + less-than-optimum environment to be selected as master. + Therefore, to give you a better degree of control over + which environment becomes a master at application startup, + the replication framework offers the following start-up + flags: + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FlagDescription
    + DB_REP_MASTER + +

    + The application starts up and declares itself to be a master + without calling for an election. It is an error for more + than one environment to start up using this flag, or for + an environment + to use this flag when a master already exists. +

    +

    + Note that no replication group should + ever operate with more than + one master. +

    +

    + In the event that a environment attempts to become a + master when a master already exists, the + replication code will resolve the problem by + holding an election. Note, however, that there + is always a possibility of data loss in the face + of duplicate masters, because once a master is + selected, the environment that loses the election will + have to roll back any transactions committed + until it is in sync with the "real" master. +

    +
    + DB_REP_CLIENT + +

    + The application starts up and declares + itself to be a replica without calling for + an election. Note that the application + can still become a master if a subsequent + application starts up, calls for an + election, and this application is elected + master. +

    +
    + DB_REP_ELECTION + +

    + As described above, the application starts up, + looks for a master, and if one is not found calls + for an election. +

    +
    + DB_REP_FULL_ELECTION + +

    + Identical to + DB_REP_ELECTION + + except that the election requires all + known members of the replication group to + participate. If a given environment has not yet + started but it is included in the + replication group count (using + DB_ENV->rep_set_nsites()) + + + then a master can not be elected. +

    +
    +
    +
    +
    +
    +
    +
    +

    Selecting the Number of Threads

    +
    +
    +
    +
    +

    + Under the hood, the replication framework is threaded and you can + control the number of threads used to process messages received from + other replicas. The threads that the replication framework uses are: +

    +
    +
      +
    • +

      + Incoming message thread. This thread + receives messages from the site's + socket and passes those messages to + message processing threads (see below) + for handling. +

      +
    • +
    • +

      + Outgoing message thread. Outgoing + are performed in whatever thread + performed a write to the database(s). + That is, the thread that called, for + example, + DB->put() + + + is the thread that writes replication messages + about that fact to the socket. +

      +

      + Note that if this write activity would + cause the thread to be blocked due to + some condition on the socket, the replication framework + will hand the outgoing message to the + incoming message thread, and it will + then write the message to the socket. + This prevents your database write + threads from blocking due to abnormal + network I/O conditions. +

      +
    • +
    • +

      + Message processing threads are + responsible for parsing and then + responding to incoming replication + messages. Typically, a response will + include write activity to your + database(s), so these threads can be + busy performing disk I/O. +

      +
    • +
    +
    +

    + Of these threads, the only ones that you have any + configuration control over are the message processing + threads. In this case, you can determine how many + of these threads you want to run. +

    +

    + It is always a bit of an art to decide on a thread count, + but the short answer is you probably do not need more + than three threads here, and it is likely that one will + suffice. That said, the best thing to do is set your + thread count to a fairly low number and then increase + it if it appears that your application will benefit + from the additional threads. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/repmgr_init_example_c.html b/db/docs/gsg_db_rep/C/repmgr_init_example_c.html new file mode 100644 index 000000000..c3b850cd1 --- /dev/null +++ b/db/docs/gsg_db_rep/C/repmgr_init_example_c.html @@ -0,0 +1,383 @@ + + + + + + Adding the Replication Framework to + simple_txn + + + + + + + + + + + +
    +
    +
    +
    +

    Adding the Replication Framework to + simple_txn + +

    +
    +
    +
    +
    +

    + We now use the methods described above to add partial + support to the + simple_txn + + example that we presented in + Transactional Application. + That is, in this section we will: +

    +
    +
      +
    • +

      + Enhance our command line options to + accept information of interest to a + replicated application. +

      +
    • +
    • +

      + Configure our environment handle to use + replication and the replication framework. +

      +
    • +
    • +

      + Minimally configure the replication framework. +

      +
    • +
    • +

      + Start replication. +

      +
    • +
    +
    +

    + Note that when we are done with this section, we will be + only partially ready to run the application. Some critical + pieces will be missing; specifically, we will not yet be + handling the differences between a master and a + replica. (We do that in the next chapter). +

    +

    + Also, note that in the following code fragments, additions + and changes to the code are marked in bold. +

    +

    + To begin, we copy the + simple_txn + + code to a new file called + rep_mgr.c. + + + We then make the corresponding change to the program name. + + + +

    +
    /*
    + * File: rep_mgr.c
    + */
    +
    +#include <stdlib.h>
    +#include <string.h>
    +#ifndef _WIN32
    +#include <unistd.h>
    +#endif
    +
    +#include <db.h>
    +
    +#ifdef _WIN32
    +extern int getopt(int, char * const *, const char *);
    +#endif
    +
    +#define CACHESIZE   (10 * 1024 * 1024)
    +#define DATABASE    "quote.db"
    +
    +const char *progname = "rep_mgr";
    +
    +int create_env(const char *, DB_ENV **);
    +int env_init(DB_ENV *, const char *);
    +int doloop (DB_ENV *);
    +int print_stocks(DBC *); 
    +

    + Next we update our usage function. The application will continue to + accept the -h parameter so that we can identify + the environment home directory used by this application. However, + we also add the +

    +
    +
      +
    • +

      + -m parameter which allows us to + identify the host and port used by this application to + listen for replication messages. +

      +
    • +
    • +

      + -o parameter which allows us to + specify other replicas. +

      +
    • +
    • +

      + -n parameter which allows us to + identify the number of sites in this replication + group. +

      +
    • +
    • +

      + -p option, which is used to identify + this replica's priority (recall that the priority is + used as a tie breaker for elections) +

      +
    • +
    +
    +
    /* Usage function */
    +static void
    +usage()
    +{
    +    fprintf(stderr, "usage: %s ", progname);
    +    fprintf(stderr, "[-h home] -m host:port [-o host:port]\n");
    +    fprintf(stderr, "\t\t[-p priority]\n");
    +    fprintf(stderr, "where:\n");
    +    fprintf(stderr, "\t-h identifies the environment home directory\n");
    +    fprintf(stderr, "\t-o identifies another site participating in "); 
    +    fprintf(stderr, "this replication group\n");
    +    fprintf(stderr, "\t-m identifies the host and port used by this ");
    +    fprintf(stderr, "site (required).\n");
    +    fprintf(stderr, "\t-n identifies the number of sites in this ");
    +    fprintf(stderr, "replication group (required).\n");
    +    fprintf(stderr, "\t-p identifies the election priority used by ");
    +    fprintf(stderr, "this replica.\n");
    +    exit(EXIT_FAILURE);
    +} 
    +

    + Now we can begin working on our main() function. + We begin by adding a couple of variables that we will use to + collect TCP/IP host and port information. + + + + We also declare a couple + of flags that we use to make sure some required information is + provided to this application. + +

    +
    int
    +main(int argc, char *argv[])
    +{
    +    extern char *optarg;
    +    DB_ENV *dbenv;
    +    const char *home;
    +    char ch, *host, *portstr;
    +    int ret, local_is_set, totalsites;
    +    u_int32_t port;
    +
    +    dbenv = NULL;
    +
    +    ret = local_is_set = totalsites = 0;
    +    home = NULL; 
    +

    + At this time we can create our environment handle and configure it + exactly as we did for simple_txn. + The only thing that we will do differently here is that we will set a priority, + arbitrarily picked to be 100, so that we can be sure the environment has + a priority other than 0 (the default value). This ensures that the + environment can become a master via an election. +

    +
        if ((ret = create_env(progname, &dbenv)) != 0)
    +            goto err;
    +
    +    /* Default priority is 100 */
    +    dbenv->rep_set_priority(dbenv, 100);   
    +

    + Now we collect our command line arguments. As we do so, we will + configure host and port information as required, and we will + configure the application's election priority if necessary. +

    +
        /* Collect the command line options */
    +    while ((ch = getopt(argc, argv, "h:m:o:p:")) != EOF)
    +        switch (ch) {
    +        case 'h':
    +            home = optarg;
    +            break;
    +        /* Set the host and port used by this environment */
    +        case 'm':
    +            host = strtok(optarg, ":");
    +            if ((portstr = strtok(NULL, ":")) == NULL) {
    +                fprintf(stderr, "Bad host specification.\n");
    +                goto err;
    +            }
    +            port = (unsigned short)atoi(portstr);
    +            if (dbenv->repmgr_set_local_site(dbenv, host, port, 0) != 0) {
    +                fprintf(stderr,
    +                    "Could not set local address %s.\n", host);
    +                goto err;
    +            }
    +            local_is_set = 1;
    +            break;
    +        /* Identify another site in the replication group */
    +        case 'o':
    +            host = strtok(optarg, ":");
    +            if ((portstr = strtok(NULL, ":")) == NULL) {
    +                fprintf(stderr, "Bad host specification.\n");
    +                goto err;
    +            }
    +            port = (unsigned short)atoi(portstr);
    +            if (dbenv->repmgr_add_remote_site(dbenv, host, port, 0) != 0) {
    +                fprintf(stderr,
    +                    "Could not add site %s.\n", host);
    +                goto err;
    +            }
    +            break;
    +        /* Set the number of sites in this replication group */
    +        case 'n':
    +            totalsites = atoi(optarg);
    +            if ((ret = dbenv->rep_set_nsites(dbenv, totalsites)) != 0)
    +                dbenv->err(dbenv, ret, "set_nsites");
    +            break;
    +        /* Set this replica's election priority */
    +        case 'p':
    +            dbenv->rep_set_priority(dbenv, atoi(optarg));
    +            break; 
    +        case '?':
    +        default:
    +            usage();
    +        }
    +
    +    /* Error check command line. */
    +    if (home == NULL || !local_is_set || !totalsites)
    +        usage(); 
    +

    + Having done that, we can call env_init(), which we use to + open our environment handle. Note that this function changes + slightly for this update (see below). +

    +
        if ((ret = env_init(dbenv, home)) != 0)
    +        goto err; 
    +

    + Finally, we start replication before we go into the + doloop() function (where we perform all our + database access). +

    +
    +    if ((ret = dbenv->repmgr_start(dbenv, 3, DB_REP_ELECTION)) != 0)
    +        goto err; 
    +
    +    if ((ret = doloop(dbenv)) != 0) {
    +        dbenv->err(dbenv, ret, "Application failed");
    +        goto err;
    +    }
    +
    +err: if (dbenv != NULL)
    +        (void)dbenv->close(dbenv, 0);
    +
    +    return (ret);
    +} 
    +

    + Beyond that, the rest of our application remains the same for + now, with the exception of the env_init() + function, which we use to actually open our environment handle. + The flags + + + + + + we use to open the environment are slightly different for a + replicated application than they are for a non-replicated + application. Namely, replication requires the + + DB_INIT_REP flag. + + + +

    +

    + Also, because we are using the replication framework, we must prepare + our environment for threaded usage. For this reason, we also + need the DB_THREAD flag. +

    +
     int
    +env_init(DB_ENV *dbenv, const char *home)
    +{
    +    u_int32_t flags;
    +    int ret;
    +
    +    (void)dbenv->set_cachesize(dbenv, 0, CACHESIZE, 0);
    +    (void)dbenv->set_flags(dbenv, DB_TXN_NOSYNC, 1);
    +
    +    flags = DB_CREATE | 
    +            DB_INIT_LOCK | 
    +            DB_INIT_LOG | 
    +            DB_INIT_MPOOL |
    +            DB_INIT_TXN | 
    +            DB_INIT_REP |
    +            DB_THREAD |
    +            DB_RECOVER;
    +    if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0)
    +        dbenv->err(dbenv, ret, "can't open environment");
    +    return (ret);
    +}
    +

    + This completes our replication updates for the moment. We are not as + yet ready to actually run this program; there remains a few + critical pieces left to add to it. However, the work that we + performed in this section represents a solid foundation for the + remainder of our replication work. +

    +
    + + + diff --git a/db/docs/gsg_db_rep/C/simpleprogramlisting.html b/db/docs/gsg_db_rep/C/simpleprogramlisting.html new file mode 100644 index 000000000..2df5281f9 --- /dev/null +++ b/db/docs/gsg_db_rep/C/simpleprogramlisting.html @@ -0,0 +1,557 @@ + + + + + + Program Listing + + + + + + + + + +
    +
    +
    +
    +

    Program Listing

    +
    +
    +
    +
    +

    + Our example program is a fairly simple transactional + application. At this early stage of its development, the + application contains no hint that it must be network-aware + so the only command line argument that it takes is one that + allows us to specify the environment home directory. + (Eventually, we will specify things like host names and + ports from the command line). +

    +

    + Note that the application performs all writes under the + protection of a transaction; however, multiple database + operations are not performed per transaction. Consequently, + we simplify things a bit by using autocommit for our + database writes. +

    +

    + Also, this application is single-threaded. It is possible + to write a multi-threaded or multi-process application that + performs replication. That said, the concepts described in + this book are applicable to both single threaded and + multi-threaded applications so nothing + is gained by multi-threading this application other than + distracting complexity. This manual + does, however, identify where care must be taken when + performing replication with a non-single threaded + application. +

    +

    + Finally, remember that transaction processing is not described in + this manual. Rather, see the + Berkeley DB Getting Started with Transaction Processing guide for details on + that topic. +

    +
    +
    +
    +
    +

    Function: main()

    +
    +
    +
    +
    +

    + Our program begins with the usual assortment of + include statements. +

    +
    /*
    + * File: simple_txn.c
    + */
    +
    +#include <stdlib.h>
    +#include <string.h>
    +#ifndef _WIN32
    +#include <unistd.h>
    +#endif
    +
    +#include <db.h> 
    +
    +#ifdef _WIN32
    +extern int getopt(int, char * const *, const char *);
    +#endif  
    +

    + We then define a few values. One is the size of our cache, + which we keep deliberately small for this example, and the + other is the name of our database. We also provide a global + variable that is the name of our program; this is used for + error reporting later on. +

    +
    #define CACHESIZE   (10 * 1024 * 1024)
    +#define DATABASE    "quote.db"
    +
    +const char *progname = "simple_txn";  
    +

    + Then we perform a couple of forward declarations. The first + of these, create_env() and + env_init() are used to open + and initialize our environment. +

    +

    + Next we declare + doloop(), which is the function that we use to + add data to the database and then display its contents. This is + essentially a big do loop, hence the + function's name. +

    +

    + Finally, we have print_stocks, which is + used to display a database record once it has been retrieved from the + database. +

    +
    +int create_env(const char *, DB_ENV **);
    +int env_init(DB_ENV *, const char *);
    +int doloop (DB_ENV *);
    +int print_stocks(DBC *);  
    +

    + Next we need our usage() function, + which is fairly trivial at this point: +

    +
    /* Usage function */
    +static void
    +usage()
    +{
    +    fprintf(stderr, "usage: %s ", progname);
    +    fprintf(stderr, "[-h home]\n");
    +    exit(EXIT_FAILURE);
    +}  
    +

    + That completed, we can jump into our application's + main() function. If you are familiar with + DB transactional applications, you will not find any + surprises here. We begin by declaring and initializing the + usual set of variables: +

    +
    int
    +main(int argc, char *argv[])
    +{
    +    extern char *optarg;
    +    DB_ENV *dbenv;
    +    const char *home;
    +    char ch;
    +    int ret;
    +
    +    dbenv = NULL;
    +
    +    ret = 0;
    +    home = NULL;  
    +

    + Now we create and configure our environment handle. + We do this with our create_env() function, which we will + show a little later in this example. + +

    +
        if ((ret = create_env(progname, &dbenv)) != 0)
    +            goto err; 
    +

    + Then we parse the command line arguments: +

    +
        while ((ch = getopt(argc, argv, "h:")) != EOF)
    +        switch (ch) {
    +        case 'h':
    +            home = optarg;
    +            break;
    +        case '?':
    +        default:
    +            usage();
    +        }
    +
    +    /* Error check command line. */
    +    if (home == NULL)
    +        usage();  
    +

    + Now we can open our environment. We do this with our + env_init() function which we will describe + a little later in this chapter. +

    +
        if ((ret = env_init(dbenv, home)) != 0)
    +            goto err; 
    +

    + Now that we have opened the environment, we can call our + doloop() function. This function performs the basic + database interaction. Notice that we have not yet opened any databases. In + a traditional transactional application we would probably open the + databases before calling our our main data processing function. + However, the eventual replicated application will want to handle + database open and close in the main processing loop, so in a nod to what this + application will eventually become we do a slightly unusual thing + here. +

    +
        if ((ret = doloop(dbenv)) != 0) {
    +        dbenv->err(dbenv, ret, "Application failed");
    +        goto err;
    +    }  
    +

    + Finally, we provide our application shutdown code. Note, again, + that in a traditional transactional application all databases would + also be closed here. But, again, due to the way this application + will eventually behave, we cause the database close to occur in the + doloop() function. +

    +
    err: if (dbenv != NULL)
    +        (void)dbenv->close(dbenv, 0);
    +
    +    return (ret);
    +}  
    +
    +
    +
    +
    +
    +

    Function: create_env()

    +
    +
    +
    +
    +

    + Having written our main() + function, we now implement the first of our utility + functions that we use to manage our environments. + This function exists only to make our code easier + to manage, and all it does is create an environment + handle for us. +

    +
    int
    +create_env(char *progname, DB_ENV **dbenvp)
    +{
    +    DB_ENV *dbenv;
    +    int ret;
    +
    +    if ((ret = db_env_create(&dbenv, 0)) != 0) {
    +        fprintf(stderr, "can't create env handle: %s\n",
    +            db_strerror(ret));
    +        return (ret);
    +    }
    +
    +    dbenv->set_errfile(dbenv, stderr);
    +    dbenv->set_errpfx(dbenv, progname);
    +
    +    *dbenvp = dbenv;
    +    return (0);
    +}  
    +
    +
    +
    +
    +
    +

    Function: env_init()

    +
    +
    +
    +
    +

    + Having written the function that initializes an + environment handle, we now implement the function + that opens the handle. Again, there should be no + surprises here for anyone familiar with DB + applications. The open flags that we use are those + normally used for a transactional application. +

    +
     int
    +env_init(DB_ENV *dbenv, const char *home)
    +{
    +    u_int32_t flags;
    +    int ret;
    +
    +    (void)dbenv->set_cachesize(dbenv, 0, CACHESIZE, 0);
    +    (void)dbenv->set_flags(dbenv, DB_TXN_NOSYNC, 1);
    +
    +    flags = DB_CREATE | 
    +            DB_INIT_LOCK | 
    +            DB_INIT_LOG | 
    +            DB_INIT_MPOOL |
    +            DB_INIT_TXN | 
    +            DB_RECOVER;
    +    if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0)
    +        dbenv->err(dbenv, ret, "can't open environment");
    +    return (ret);
    +}  
    +
    +
    +
    +
    +
    +

    Function: doloop()

    +
    +
    +
    +
    +

    + Having written our main() + function and utility functions, we now implement + our application's + primary data processing function. This + function provides a command prompt at which the + user can enter a stock ticker value and a price for + that value. This information is then entered to the + database. +

    +

    + To display the database, simply enter + return at the prompt. +

    +

    + To begin, we declare a database pointer, + several DBT variables, and + the usual assortment of variables used for buffers + and return codes. We also initialize all of this. +

    +
    #define BUFSIZE 1024
    +int
    +doloop(DB_ENV *dbenv)
    +{
    +    DB *dbp;
    +    DBT key, data;
    +    char buf[BUFSIZE], *rbuf;
    +    int ret;
    +    u_int32_t db_flags;
    +
    +    dbp = NULL;
    +    memset(&key, 0, sizeof(key));
    +    memset(&data, 0, sizeof(data));
    +    ret = 0;  
    +

    + Next, we begin the loop and we immediately open our + database if it has not already been opened. Notice that + we specify autocommit when we open the database. In + this case, autocommit is important because we will only + ever write to our database using it. There is no need + for explicit transaction handles and commit/abort code + in this application, because we are not combining + multiple database operations together under a single + transaction. +

    +

    + Autocommit is described in greater detail in the + Berkeley DB Getting Started with Transaction Processing guide. +

    +
        for (;;) {
    +
    +        if (dbp == NULL) {
    +            if ((ret = db_create(&dbp, dbenv, 0)) != 0)
    +                return (ret);
    +
    +            /* Set page size small so page allocation is cheap. */
    +            if ((ret = dbp->set_pagesize(dbp, 512)) != 0)
    +                goto err;
    +
    +            db_flags = DB_AUTO_COMMIT | DB_CREATE;
    +
    +            if ((ret = dbp->open(dbp, NULL, DATABASE,
    +                NULL, DB_BTREE, db_flags, 0)) != 0) {
    +                dbenv->err(dbenv, ret, "DB->open");
    +                goto err;
    +            }
    +        }  
    +

    + Now we implement our command prompt. This is a simple and not + very robust implementation of a command prompt. + If the user enters the keywords exit + or quit, the loop is exited and the + application ends. If the user enters nothing and instead simply + presses return, the entire contents of the + database is displayed. We use our + print_stocks() function to display the + database. (That implementation is shown next in this chapter.) +

    +

    + Notice that very little error checking is performed on the data + entered at this prompt. If the user fails to enter at least one + space in the value string, a simple help message is printed and + the prompt is returned to the user. That is the only error + checking performed here. In a real-world application, + at a minimum the application would probably check to ensure + that the price was in fact an integer or float value. + However, in order to keep this example code as simple as + possible, we refrain from implementing a thorough user interface. +

    +
            printf("QUOTESERVER > ");
    +        fflush(stdout);
    +
    +        if (fgets(buf, sizeof(buf), stdin) == NULL)
    +            break;
    +        if (strtok(&buf[0], " \t\n") == NULL) {
    +            switch ((ret = print_stocks(dbp))) {
    +            case 0:
    +                continue;
    +            default:
    +                dbp->err(dbp, ret, "Error traversing data");
    +                goto err;
    +            }
    +        }
    +        rbuf = strtok(NULL, " \t\n");
    +        if (rbuf == NULL || rbuf[0] == '\0') {
    +            if (strncmp(buf, "exit", 4) == 0 ||
    +                strncmp(buf, "quit", 4) == 0)
    +                break;
    +            dbenv->errx(dbenv, "Format: TICKER VALUE");
    +            continue;
    +        }  
    +

    + Now we assign data to the DBTs that + we will use to write the new information to the database. +

    +
            key.data = buf;
    +        key.size = (u_int32_t)strlen(buf);
    +
    +        data.data = rbuf;
    +        data.size = (u_int32_t)strlen(rbuf);  
    +

    + Having done that, we can write the new information to the + database. Remember that this application uses autocommit, + so no explicit transaction management is required. Also, + the database is not configured for duplicate records, so + the data portion of a record is overwritten if the provided + key already exists in the database. However, in this case + DB returns DB_KEYEXIST — which + we ignore. +

    +
            if ((ret = dbp->put(dbp, NULL, &key, &data, 0)) != 0)
    +        {
    +            dbp->err(dbp, ret, "DB->put");
    +            if (ret != DB_KEYEXIST)
    +                goto err;
    +        } 
    +    }  
    +

    + Finally, we close our database before returning from the + function. +

    +
    err:    if (dbp != NULL)
    +        (void)dbp->close(dbp, DB_NOSYNC);
    +
    +    return (ret);
    +}  
    +
    +
    +
    +
    +
    +

    + Function: print_stocks() + + +

    +
    +
    +
    +
    +

    + The print_stocks() + + function + + simply takes a database handle, opens a cursor, and uses + it to display all the information it finds in a database. + This is trivial cursor operation that should hold + no surprises for you. We simply provide it here for + the sake of completeness. +

    +

    + If you are unfamiliar with basic cursor operations, + please see the Getting Started with Berkeley DB + guide. +

    +
    /*
    + * A function that takes a cursor and displays the entire
    + * contents of the database to which the cursor belongs.
    + */
    +int
    +print_stocks(DB *dbp)
    +{
    +    DBC *dbc;
    +    DBT key, data;
    +#define MAXKEYSIZE  10
    +#define MAXDATASIZE 20
    +    char keybuf[MAXKEYSIZE + 1], databuf[MAXDATASIZE + 1];
    +    int ret, t_ret;
    +    u_int32_t keysize, datasize;
    +
    +    if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0) {
    +        dbp->err(dbp, ret, "can't open cursor");
    +        return (ret);
    +    }
    +
    +    memset(&key, 0, sizeof(key));
    +    memset(&data, 0, sizeof(data));
    +
    +    printf("\tSymbol\tPrice\n");
    +    printf("\t======\t=====\n");
    +
    +    for (ret = dbc->c_get(dbc, &key, &data, DB_FIRST);
    +        ret == 0;
    +        ret = dbc->c_get(dbc, &key, &data, DB_NEXT)) {
    +        keysize = key.size > MAXKEYSIZE ? MAXKEYSIZE : key.size;
    +        memcpy(keybuf, key.data, keysize);
    +        keybuf[keysize] = '\0';
    +
    +        datasize = data.size >= MAXDATASIZE ? MAXDATASIZE : data.size;
    +        memcpy(databuf, data.data, datasize);
    +        databuf[datasize] = '\0';
    +
    +        printf("\t%s\t%s\n", keybuf, databuf);
    +    }
    +    printf("\n");
    +    fflush(stdout);
    +
    +    if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0)
    +        ret = t_ret;
    +
    +    switch (ret) {
    +    case 0:
    +    case DB_NOTFOUND:
    +        return (0);
    +    default:
    +        return (ret);
    +    }
    +}  
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/C/txnapp.html b/db/docs/gsg_db_rep/C/txnapp.html new file mode 100644 index 000000000..5f3fe1446 --- /dev/null +++ b/db/docs/gsg_db_rep/C/txnapp.html @@ -0,0 +1,174 @@ + + + + + + Chapter 2. Transactional Application + + + + + + + + + +
    +
    +
    +
    +

    Chapter 2. Transactional Application

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Application Overview + +
    +
    + + Program Listing + +
    +
    +
    +
    + + Function: main() + +
    +
    + + Function: create_env() + +
    +
    + + Function: env_init() + +
    +
    + + Function: doloop() + +
    +
    + + + Function: print_stocks() + + + + +
    +
    +
    +
    +
    +

    + In this chapter, we build a simple transaction-protected DB + application. Throughout the remainder of this book, we will add + replication to this example. We do this to underscore the concepts + that we are presenting in this book; the first being that you + should start with a working transactional program and then add + replication to it. +

    +

    + Note that this book assumes you already know how to write a + transaction-protected DB application, so we will not be + covering those concepts in this book. To learn how to write a + transaction-protected application, see the + Berkeley DB Getting Started with Transaction Processing guide. +

    +
    +
    +
    +
    +

    Application Overview

    +
    +
    +
    +
    +

    + Our application maintains a stock market quotes database. + This database contains records whose key is the stock + market symbol and whose data is the stock's price. +

    +

    + The application operates by presenting you with a command + line prompt. You then enter the stock symbol and its value, + separated by a space. The application takes this + information, writes it to the database. +

    +

    + To see the contents of the database, simply press + return at the command prompt. +

    +

    + To quit the application, type 'quit' or 'exit' at the + command prompt. +

    +

    + For example, the following illustrates the application's + usage. In it, we use entirely fictitious stock market + symbols and price values. +

    +
    > ./simple_txn -h env_home_dir
    +QUOTESERVER> stock1 88
    +QUOTESERVER> stock2 .08
    +QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        stock1  88
    +
    +QUOTESERVER> stock1 88.9
    +QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        stock1  88.9
    +        stock2  .08
    +
    +QUOTESERVER> quit 
    +>
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/Replication-CXX-GSG.pdf b/db/docs/gsg_db_rep/CXX/Replication-CXX-GSG.pdf new file mode 100644 index 000000000..0ee3ce3ab Binary files /dev/null and b/db/docs/gsg_db_rep/CXX/Replication-CXX-GSG.pdf differ diff --git a/db/docs/gsg_db_rep/CXX/addfeatures.html b/db/docs/gsg_db_rep/CXX/addfeatures.html new file mode 100644 index 000000000..1adee537f --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/addfeatures.html @@ -0,0 +1,191 @@ + + + + + + Chapter 5. Additional Features + + + + + + + + + +
    +
    +
    +
    +

    Chapter 5. Additional Features

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Delayed Synchronization + +
    +
    + + Managing Blocking Operations + +
    +
    + + Stop Auto-Initialization + +
    +
    + + Client to Client Transfer + +
    +
    +
    +
    + + Identifying Peers + +
    +
    +
    +
    + + Bulk Transfers + +
    +
    +
    +

    + Beyond the basic functionality that we have discussed so far in + this book, there are several replication features that you + should understand. These are all optional to use, but provide + useful functionality under the right circumstances. +

    +

    + These additional features are: +

    + +
    +
    +
    +
    +

    Delayed Synchronization

    +
    +
    +
    +
    +

    + When a replication group has a new master, all replicas must + synchronize with that master. This means they must ensure + that the contents of their local database(s) are identical + to that contained by the new master. +

    +

    + This synchronization process can result in quite a lot of + network activity. It can also put a large strain on the + master server, especially if is part of a large + replication group or if there is somehow a large difference between + the master's database(s) and the contents of its replicas. +

    +

    + It is therefore possible to delay synchronization for any + replica that discovers it has a new master. You would do + this so as to give the master time to synchronize other + replicas before proceeding with the delayed replicas. +

    +

    + To delay synchronization of a replica environment, you + specify + + DB_REP_CONF_DELAYCLIENT to + + DbEnv::rep_set_config() + and then specify 1 to the onoff + parameter. (Specify 0 to turn the feature off.) + + +

    +

    + If you use delayed synchronization, then you must manually + synchronize the replica at some future time. Until you do this, the replica is out of + sync with the master, and it will ignore all database changes forwarded to it from + the master. +

    +

    + You synchronize a delayed replica by calling + + DbEnv::rep_sync() + + on the replica that has been delayed. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/apioverview.html b/db/docs/gsg_db_rep/CXX/apioverview.html new file mode 100644 index 000000000..5b713eb23 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/apioverview.html @@ -0,0 +1,225 @@ + + + + + + The Replication APIs + + + + + + + + + +
    +
    +
    +
    +

    The Replication APIs

    +
    +
    +
    +
    +

    + There are two ways that you can choose to implement + replication in your transactional application. The first, + and preferred, mechanism is to use the pre-packaged + replication framework that comes with the + DB distribution. This framework should be sufficient + for most customers. +

    +

    + If for some reason the Replication Framework + does not meet your application's technical requirements, + you will have to use the replication APIs available + through the Berkeley DB library to write your own custom + replication framework. +

    +

    + Both of these approaches are described in slightly greater + detail in this section. The bulk of the chapters later in + this book are dedicated to these two replication + implementation mechanisms. +

    +
    +
    +
    +
    +

    Replication Framework Overview

    +
    +
    +
    +
    +

    + DB's pre-packaged replication framework exists + as a layer on top of the DB library. The replication framework is a + multi-threaded implementation that allows you to easily add + replication to your existing transactional application. + + You access and manage the replication framework using methods that are + available off the + + DbEnv + class. + + +

    +

    + The replication framework: +

    +
    +
      +
    • +

      + Provides a multi-threaded communications layer + using pthreads (on Unix-style systems and + similar derivatives such as Mac OS X), or + Windows threads on Microsoft Windows systems. +

      +
    • +
    • +

      + Uses TCP/IP sockets. Network traffic is + handled via threads that handle inbound and + outbound messages. However, each + process uses a single socket + that is shared using select(). +

      +

      + Note that for this reason, the replication framework is + limited to a maximum of 60 replicas (on + Windows) and approximately 1000 replicas (on + Unix and related systems), depending on how + your system is configured. +

      +
    • +
    • +

      + Requires a single process for the master replica. +

      +
    • +
    • +

      + Requires that only one instance of the + environment handle be used. +

      +
    • +
    • +

      + Upon application startup, a master can be + selected either manually or via elections. + After startup time, however, during the course of + normal operations it is possible for the + replication group to need to locate a new master (due + to network or other hardware related problems, + for example) and in this scenario elections are + always used to select the new master. +

      +
    • +
    +
    +

    + If your application has technical requirements that do + not conform to the implementation provided by the + replication framework, you must write a custom + replication framework using the DB replication APIs + directly. See the next section for introductory + details. +

    +
    +
    +
    +
    +
    +

    Replication API Overview

    +
    +
    +
    +
    +

    + The replication API is a series of Berkeley DB library + classes and methods that you can use to build your own + replication infrastructure. You should use the + replication API only if the replication framework does not meet your + application's technical requirements. +

    +

    + To make use of the replication API, you must write your + own networking code. This frees you from the technical + constraints imposed by the replication framework. For example, by + writing your own framework, you can: +

    +
    +
      +
    • +

      + Use a threading package other than + pthreads (Unix) or Windows threads + (Microsoft Windows). This might be interesting + to you if you are using a platform + whose preferred threading package + is something other than (for + example) pthreads, such as is the case for + Sun Microsystem's Solaris operating systems. +

      +
    • +
    • +

      + Implement your own sockets. The + replication framework uses TCP/IP sockets. While + this should be acceptable for the + majority of applications, sometimes + UDP or even raw sockets might be + desired. +

      +
    • +
    • +

      + Write a multi-process master + replica. +

      +
    • +
    +
    +

    + For information on writing a replicated application + using the Berkeley DB replication APIs, see the + Berkeley DB Programmer's Reference Guide. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/bulk.html b/db/docs/gsg_db_rep/CXX/bulk.html new file mode 100644 index 000000000..25646dc08 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/bulk.html @@ -0,0 +1,139 @@ + + + + + + Bulk Transfers + + + + + + + + +
    +
    +
    +
    +

    Bulk Transfers

    +
    +
    +
    +
    +

    + By default, messages are sent from the master to replicas as they are generated. + This can degrade replication performance because the various participating + environments must handle a fair amount of network I/O activity. +

    +

    + You can alleviate this problem by configuring your master environment for bulk + transfers. Bulk transfers simply cause replication messages to accumulate in a + buffer until a triggering event occurs. When this event occurs, the entire + contents of the buffer is sent to the replica, thereby eliminating excessive + network I/O. +

    +

    + Note that if you are using replica to replica transfers, then you might want any + replica that can service replication requests to also be configured for bulk + transfers. +

    +

    + The events that result in a bulk transfer of replication messages to a replica + will differ depending on if the transmitting environment is a master or a + replica. +

    +

    + If the servicing environment is a master environment, then bulk a bulk transfer + occurs when: +

    +
    +
      +
    1. +

      + Bulk transfers are configured for the master environment, and +

      +
    2. +
    3. +

      + the message buffer is full or +

      +
    4. +
    5. +

      + a permanent record (for example, a transaction commit or a + checkpoint record) is placed in the buffer for the replica. +

      +
    6. +
    +
    +

    + If the servicing environment is a replica environment (that is, replica to replica + transfers are in use), then a bulk transfer occurs when: +

    +
    +
      +
    1. +

      + Bulk transfers are configured for the transmitting replica, and +

      +
    2. +
    3. +

      + the message buffer is full or +

      +
    4. +
    5. +

      + the replica servicing the request is able to completely satisfy + the request with the contents of the message buffer. +

      +
    6. +
    +
    +

    + To configure bulk transfers, specify + + + DB_REP_CONF_BULK to + + DbEnv::rep_set_config() + and then specify 1 to the onoff + parameter. (Specify 0 to turn the feature off.) + + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/c2ctransfer.html b/db/docs/gsg_db_rep/CXX/c2ctransfer.html new file mode 100644 index 000000000..13b479d0e --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/c2ctransfer.html @@ -0,0 +1,131 @@ + + + + + + Client to Client Transfer + + + + + + + + + +
    +
    +
    +
    +

    Client to Client Transfer

    +
    +
    +
    +
    +

    + It is possible to use a replica instead of a master to synchronize another + replica. This serves to take the request load off a master that might otherwise + occur if multiple replicas attempted to synchronize with the master at the same + time. +

    +

    + For best results, use this feature combined with the delayed synchronization + feature (see Delayed Synchronization). +

    +

    + For example, suppose your replication group consists of four environments. Upon + application startup, all three replicas will immediately attempt to synchronize + with the master. But at the same time, the master itself might be busy with a heavy + database write load. +

    +

    + To solve this problem, delay synchronization for two of the three replicas. Allow + the third replica to synchronize as normal with the master. Then, start + synchronization for each of the delayed replicas (since this is a manual process, + you can do them one at a time if that best suits your application). + Assuming you have configured replica to replica synchronization correctly, the + delayed replicas will synchronize using the up-to-date replica, rather than using + the master. +

    +

    + When you are using the replication framework, you configure replica to replica synchronization by + declaring one environment to be a peer of another environment. If an + environment is a peer, then + it can be used for synchronization purposes. +

    +
    +
    +
    +
    +

    Identifying Peers

    +
    +
    +
    +
    +

    + You can designate one replica to be a peer of + another, and then use this special + status for permanent message acknowledgments, + and for replica-to-replica synchronization. + You might want to do this if you have + machines that you know are on fast, reliable + network connections and so you are willing to + accept the overhead of waiting for + acknowledgments from those specific machines. +

    +

    + An environment is currently allowed to have only one + peer. +

    +

    + Note that peers are not required to be a + bi-directional. That is, just because machine A + declares machine B to be a peer, that does not mean + machine B must also declare machine A to be a peer. +

    +

    + You declare a peer for the current environment + when you add that environment to the list of known + sites. You do this by + specifying the + DB_REPMGR_PEER flag to + + DbEnv::repmgr_add_remote_site(). + + +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/elections.html b/db/docs/gsg_db_rep/CXX/elections.html new file mode 100644 index 000000000..8157cf14a --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/elections.html @@ -0,0 +1,227 @@ + + + + + + Holding Elections + + + + + + + + + +
    +
    +
    +
    +

    Holding Elections

    +
    +
    +
    +
    +

    + Finding a master environment is one of the fundamental activities that + every replication replica must perform. Upon startup, the + underlying DB replication code will attempt to + locate a master. If a master cannot be found, then the + environment should initiate an election. +

    +

    + How elections are held depends upon the API that you use to + implement replication. For example, if you are using the + replication framework elections are held transparently without any + input from your application's code. In this case, + DB will determine which environment is the master and which + are replicas. +

    +
    +
    +
    +
    +

    Influencing Elections

    +
    +
    +
    +
    +

    + If you want to control the election process, you can declare + a specific environment to be the master. Note that for the replication framework, + it is only possible to do this at application startup. + Should the master become unavailable during run-time for any + reason, an election is held. The environment that receives + the most number of votes, wins the election and becomes the + master. A machine receives a vote because it has the most + number of log records. +

    +

    + Because ties are possible when elections are held, + it is possible to influence which environment will win + the election. How you do this depends on which API you + are using. In particular, if you are writing a custom replication + layer, then there are a great many ways to manually influence + elections. +

    +

    + One such mechanism is priorities. When votes are + cast during an election, both the number of log records + contained in the environment and + the environment's priority are considered. So given two + environments with the same number of log records, votes + are cast for the environment with the higher priority. +

    +

    + Therefore, if you have a machine that you prefer to + become a master in the event of an election, assign it + a high priority. Assuming that the election is held at + a time when the preferred machine has up-to-date log + records, that machine will win the election. +

    +
    +
    +
    +
    +
    +

    Winning Elections

    +
    +
    +
    +
    +

    + To win an election: +

    +
    +
      +
    1. +

      + There cannot currently be a + master environment. +

      +
    2. +
    3. +

      + The environment must have the most + recent log records. Part of + holding the election is + determining which environments have + the most recent log records. + This process happens + automatically; your code does + not need to involve itself in + this process. +

      +
    4. +
    5. +

      + The environment must receive the most + number of votes from the + replication environments that are + participating in the election. +

      +
    6. +
    +
    +

    + If you are using the replication framework, then in the event of a + tie vote the environment with the highest priority wins + the election. If two or more environments receive the same + number of votes and have the same priority, then + the underlying replication code picks one of the + environments to + be the winner. Which winner will be picked by the + replication code is unpredictable from the + perspective of your application code. +

    +
    +
    +
    +
    +
    +

    Switching Masters

    +
    +
    +
    +
    +

    + To switch masters: +

    +
    +
      +
    1. +

      + Start up the environment that you want + to be master as normal. At this + time it is a replica. Make + sure this environment has a higher + priority than all the other + environments. +

      +
    2. +
    3. +

      + Allow the new environment to run for a + time as a replica. This allows + it to obtain the most recent + copies of the log files. +

      +
    4. +
    5. +

      + Shut down the current master. + This should force an election. + Because the new environment has the + highest priority, it will win + the election, provided it has + had enough time to obtain all + the log records. +

      +
    6. +
    7. +

      + Optionally restart the old + master environment. Because there is + currently a master environment, an + election will not be held and + the old master will now run as + a replica environment. +

      +
    8. +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/electiontimes.html b/db/docs/gsg_db_rep/CXX/electiontimes.html new file mode 100644 index 000000000..c7c0318cf --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/electiontimes.html @@ -0,0 +1,152 @@ + + + + + + Managing Election Times + + + + + + + + + +
    +
    +
    +
    +

    Managing Election Times

    +
    +
    +
    +
    +

    + Where it comes to elections, there are two timeout + values with which you should be concerned: election + timeouts and election retries. +

    +
    +
    +
    +
    +

    Managing Election Timeouts

    +
    +
    +
    +
    +

    + When a environment calls for an election, it will wait + some amount of time for the other replicas in the + replication group to respond. The amount of time + that the environment will wait before declaring the + election completed is the election timeout. +

    +

    + If the environment hears from all other known replicas before + the election timeout occurs, the election is considered + a success and a master is elected. +

    +

    + If only a subset of replicas respond, then the success + or failure of the election is determined by (1) + how many replicas have responded and (2) the + election policy that is in place at the time. + For example, usually it only takes a simple + majority of replicas to elect a master. If + there are enough votes for a given environment to + meet that standard, then the master has been + elected and the election is considered a + success. +

    +

    + However, upon application startup you can + require that all known replicas must participate in the + election. Or, it is possible that not enough + votes are cast to select a master even with a + simple majority. If either of these conditions + occur when the election timeout value is + reached, the election is considered a failure + and a master is not elected. At this point, + your replication group is operating without a + master, which means that, essentially, + your replicated application has been placed in + read-only mode. +

    +

    + Note, however, that the replication framework will attempt a + new election after a given amount of time has + passed. See the next section for details. +

    +

    + You set the election timeout value using + + DbEnv::rep_set_timeout(). + To do so, specify the + DB_REP_ELECTION_TIMEOUT + flag to the which parameter and then a + timeout value in microseconds to the + timeout parameter. +

    +
    +
    +
    +
    +
    +

    Managing Election Retry Times

    +
    +
    +
    +
    +

    + In the event that a election fails (see the + previous section), an election will not be + attempted again until the election retry + timeout value has expired. +

    +

    + You set the retry timeout value using + + DbEnv::rep_set_timeout(). + To do so, specify the + DB_REP_ELECTION_RETRY + flag to the which parameter and then a + retry value in microseconds to the + timeout parameter. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/exampledoloop.html b/db/docs/gsg_db_rep/CXX/exampledoloop.html new file mode 100644 index 000000000..77c3c0780 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/exampledoloop.html @@ -0,0 +1,541 @@ + + + + + + Example Processing Loop + + + + + + + + + +
    +
    +
    +
    +

    Example Processing Loop

    +
    +
    +
    +
    +

    + In this section we take the example + processing loop that we presented in the + previous section and we flesh it out to + provide a more complete example. We do this + by updating the + doloop() + function that our original transaction + application used + + (see Method: RepMgr::doloop()) + + to fully support our replicated application. +

    +

    + In the following example code, code that we + add to the original example is presented in + bold. +

    +

    + To begin, we include a new header file into + our application so that we can check for the + ENOENT return value later + in our processing loop. We also define our + APP_DATA + structure, and we define a + sleeptime value. + + + + + Finally, we update RepMgr + to have a new method for our event notification + callback, and to add a new data member for our + APP_DATA data member. + +

    +
    #include <db_cxx.h>
    +#include <iostream>
    +#include <errno.h>
    +
    +...
    +// Skipping all the RepHostInfoObj and RepConfigInfo code, which does not
    +// change.
    +...
    +
    +using std::cout;
    +using std::cin;
    +using std::cerr;
    +using std::endl;
    +using std::flush;
    +
    +#define CACHESIZE   (10 * 1024 * 1024)
    +#define DATABASE    "quote.db"
    +#define SLEEPTIME   3
    +
    +const char *progname = "RepMgr";
    +
    +// Struct used to store information in Db app_private field.
    +typedef struct {
    +    int is_master;
    +} APP_DATA;
    +
    +class RepMgr
    +{
    +public:
    +    // Constructor.
    +    RepMgr();
    +    // Initialization method. Creates and opens our environment handle.
    +    int init(RepConfigInfo* config);
    +    // The doloop is where all the work is performed.
    +    int doloop();
    +    // terminate() provides our shutdown code.
    +    int terminate();
    +
    +    // event notification callback
    +    static void 
    +    event_callback(DbEnv * dbenv, u_int32_t which, void *info);
    +
    +private:
    +    // disable copy constructor.
    +    RepMgr(const RepMgr &);
    +    void operator = (const RepMgr &);
    +
    +    // internal data members.
    +    APP_DATA        app_data;
    +    RepConfigInfo   *app_config;
    +    DbEnv           dbenv;
    +
    +    // private methods.
    +    // print_stocks() is used to display the contents of our database.
    +    static int print_stocks(Db *dbp);
    +}; 
    +

    + That done, we can skip the + + main() method, because it does not change. + + + Instead, we skip down to our + RepMgr constructor where we initialize our + APP_DATA is_master data member: + + +

    +
    +RepMgr::RepMgr() : app_config(0), dbenv(0)
    +{
    +    app_data.is_master = 0; // assume I start out as client
    +}
    +
    +

    + That done, we must also + update RepMgr::init() to do a couple + of things. First, we need to register our event callback with + the environment handle. We also need to make our + APP_DATA data member available through our + environment handle's app_private + field. This is a fairly trivial update, and it happens at the + top of the method (we skip the rest of the method's listing + since it does not change): + +

    +
    int RepMgr::init(RepConfigInfo *config)
    +{
    +    int ret = 0;
    +
    +    app_config = config;
    +
    +    dbenv.set_errfile(stderr);
    +    dbenv.set_errpfx(progname);
    +    dbenv.set_app_private(&app_data);
    +    dbenv.set_event_notify(event_callback);
    +
    +    ...  
    +

    + That done, we need to implement our + event_callback() callback. Note that what we use + here is no different from the callback that we described in + the previous section. However, for the sake of completeness we + provide the implementation here again. +

    +
    +        
    +          /*
    + * A callback used to determine whether the local environment is a replica
    + * or a master. This is called by the replication framework
    + * when the local replication environment changes state.
    + */
    +void RepMgr::event_callback(DbEnv *dbenv, u_int32_t which, void *info)
    +{
    +    APP_DATA *app = dbenv->get_app_private();
    +
    +    info = NULL;                /* Currently unused. */
    +
    +    switch (which) {
    +    case DB_EVENT_REP_MASTER:
    +        app->is_master = 1;
    +        break;
    +
    +    case DB_EVENT_REP_CLIENT:
    +        app->is_master = 0;
    +        break;
    +
    +    case DB_EVENT_REP_STARTUPDONE: /* fallthrough */
    +    case DB_EVENT_REP_NEWMASTER:
    +        /* Ignore. */
    +        break;
    +
    +    default:
    +        dbenv->errx(dbenv, "ignoring event %d", which);
    +    }
    +}
    +        
    +      
    +

    + That done, we need to update our + doloop() + + + method. +

    +

    + We begin by updating our database handle open flags to + determine which flags to use, depending on whether the + application is running as a master. +

    +
    #define BUFSIZE 1024
    +int RepMgr::doloop()
    +{
    +    Db *dbp;
    +    Dbt key, data;
    +    char buf[BUFSIZE], *rbuf;
    +    int ret;
    +
    +    dbp = NULL;
    +    memset(&key, 0, sizeof(key));
    +    memset(&data, 0, sizeof(data));
    +    ret = 0; 
    +
    +    for (;;) {
    +        if (dbp == NULL) {
    +            dbp = new Db(&dbenv, 0);
    +
    +            // Set page size small so page allocation is cheap.
    +            if ((ret = dbp->set_pagesize(512)) != 0)
    +                goto err;
    +
    +            try {
    +                dbp->open(NULL, DATABASE, NULL, DB_BTREE,
    +                    app_data.is_master ? DB_CREATE | DB_AUTO_COMMIT :
    +                    DB_AUTO_COMMIT, 0); 
    +

    + When we open the database, we modify our error handling to + account for the case where the database does not yet exist. This can + happen if our code is running as a replica and the replication framework has not + yet had a chance to create the databases for us. Recall that replicas never + write to their own databases directly, and so they cannot + create databases on their own. +

    +

    + If we detect that the database does not yet exist, we simply + close the database handle, sleep for a short period of time + and then continue processing. This gives the replication framework a chance to + create the database so that our replica can continue + operations. +

    +
                } catch(DbException dbe) {
    +                /* It is expected that this condition will be triggered
    +                 * when client sites start up.
    +                 * It can take a while for the master site to be found
    +                 * and synced, and no DB will be available until then.
    +                 */
    +                if (dbe.get_errno() == ENOENT) {
    +                    cout << "No stock db available yet - retrying." << endl;
    +                    try {
    +                        dbp->close(0);
    +                    } catch (DbException dbe2) {
    +                        cout << "Unexpected error closing after failed"
    +                             << " open, message: " << dbe2.what() << endl;
    +                        dbp = NULL;
    +                        goto err;
    +                    }
    +                    dbp = NULL;
    +                    sleep(SLEEPTIME);
    +                    continue;
    +                } else {
    +                    dbenv.err(ret, "DB->open");
    +                    throw dbe;
    +                }
    +            }
    +        } 
    +

    + Next we modify our prompt, so that if the local process is running + as a replica, we can tell from the shell that the prompt is for a + read-only process. +

    +
            cout << "QUOTESERVER" ;
    +        if (!app_data.is_master)
    +            cout << "(read-only)";
    +        cout << "> " << flush; 
    +

    + When we collect data from the prompt, there is a case that says + if no data is entered then show the entire stocks database. + This display is performed by our + print_stocks() + + method + (which has not + required a modification since we first introduced it in + + + Method: RepMgr::print_stocks() + + ). +

    +

    + When we call + print_stocks(), + + we check for a dead replication handle. Dead + replication handles happen whenever a replication election + results in a previously committed transaction becoming + invalid. This is an error scenario caused by a new master having a + slightly older version of the data than the original + master and so all replicas must modify their database(s) to + reflect that of the new master. In this situation, some + number of previously committed transactions may have to be + unrolled. From the replica's perspective, the database + handles should all be closed and then opened again. +

    +
    +        if (fgets(buf, sizeof(buf), stdin) == NULL)
    +            break;
    +        if (strtok(&buf[0], " \t\n") == NULL) {
    +            switch ((ret = print_stocks(dbp))) {
    +            case 0:
    +                continue;
    +            case DB_REP_HANDLE_DEAD:
    +                (void)dbp->close(DB_NOSYNC);
    +                cout << "closing db handle due to rep handle dead" << endl;
    +                dbp = NULL;
    +                continue;
    +            default:
    +                dbp->err(ret, "Error traversing data");
    +                goto err;
    +            }
    +        }
    +        rbuf = strtok(NULL, " \t\n");
    +        if (rbuf == NULL || rbuf[0] == '\0') {
    +            if (strncmp(buf, "exit", 4) == 0 ||
    +                strncmp(buf, "quit", 4) == 0)
    +                break;
    +            dbenv.errx("Format: TICKER VALUE");
    +            continue;
    +        } 
    +

    + That done, we need to add a little error checking to our + command prompt to make sure the user is not attempting to + modify the database at a replica. Remember, replicas must never + modify their local databases on their own. This guards against + that happening due to user input at the prompt. +

    +
            if (!app_data.is_master) {
    +            dbenv->errx(dbenv, "Can't update at client");
    +            continue;
    +        }
    +
    +        key.set_data(buf);
    +        key.set_size((u_int32_t)strlen(buf));
    +
    +        data.set_data(rbuf);
    +        data.set_size((u_int32_t)strlen(rbuf));
    +
    +        if ((ret = dbp->put(NULL, &key, &data, 0)) != 0)
    +        {
    +            dbp->err(ret, "DB->put");
    +            if (ret != DB_KEYEXIST)
    +                goto err;
    +        }
    +    }
    +
    +err:    if (dbp != NULL)
    +        (void)dbp->close(dbp, DB_NOSYNC);
    +
    +    return (ret);
    +} 
    +

    + With that completed, we are all done updating our application + for replication. + + The only remaining + + method, print_stocks(), + + + is unmodified from when we + originally introduced it. For details on that function, see + + + Method: RepMgr::print_stocks() + + . +

    +
    +
    +
    +
    +

    Running It

    +
    +
    +
    +
    +

    + To run our replicated application, we need to make + sure each participating environment has its own unique + home directory. We can do this by running + each site on a separate networked machine, but that + is not strictly necessary; multiple instances of this + code can run on the same machine provided the + environment home restriction is observed. +

    +

    + To run a process, make sure the environment home + exists and then start the process using the + -h option to specify that + directory. You must also use the -m + option to identify the local host and port that this + process will use to listen for replication messages, and + the -o option to identify the other + processes in the replication group. Finally, use the + -p option to specify a priority. + The process that you designate to have the highest priority will become + the master. +

    +
    > mkdir env1
    +> ./RepMgr -h env1 -n 2 -m localhost:8080 -o localhost:8081 -p 10
    +No stock database yet available.
    +No stock database yet available.  
    +

    + Now, start another process. This time, change the environment + home to something else, use the -m to at + least change the port number the process is listening on, and + use the -o option to identify the host and + port of the other replication process: +

    +
    > mkdir env2
    +> ./RepMgr -h env2 -n 2 -m localhost:8081 -o localhost:8080 -p 20
    +

    + After a short pause, the second process should display the master + prompt: +

    +
    +QUOTESERVER > 
    +

    + And the first process should + display the read-only prompt: +

    +
    +QUOTESERVER (read-only)> 
    +

    + Now go to the master process and give it a couple of stocks and stock + prices: +

    +
    QUOTESERVER> FAKECO 9.87
    +QUOTESERVER> NOINC .23
    +QUOTESERVER> 
    +

    + Then, go to the replica and hit return at the prompt to + see the new values: +

    +
    QUOTESERVER (read-only)> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  9.87
    +        NOINC    .23 
    +QUOTESERVER (read-only)> 
    +

    + Doing the same at the master results in the same thing: +

    +
    QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  9.87
    +        NOINC    .23 
    +QUOTESERVER> 
    +

    + You can change a stock by simply entering the stock value and + new price at the master's prompt: +

    +
    QUOTESERVER> FAKECO 10.01 
    +QUOTESERVER> 
    +

    + Then, go to either the master or the replica to see the updated + database: +

    +
    QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  10.01
    +        NOINC    .23 
    +QUOTESERVER> 
    +

    + And on the replica: +

    +
    QUOTESERVER (read-only)> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  10.01
    +        NOINC    .23 
    +QUOTESERVER (read-only)> 
    +

    + Finally, to quit the applications, simply type + quit at both prompts: +

    +
    QUOTESERVER (read-only)> quit
    +> 
    +

    + And on the master as well: +

    +
    QUOTESERVER> quit
    +> 
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/fmwrkconnectretry.html b/db/docs/gsg_db_rep/CXX/fmwrkconnectretry.html new file mode 100644 index 000000000..3d3890613 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/fmwrkconnectretry.html @@ -0,0 +1,76 @@ + + + + + + Managing Connection Retries + + + + + + + + + +
    +
    +
    +
    +

    Managing Connection Retries

    +
    +
    +
    +
    +

    + In the event that a communication failure occurs between + two environments in a replication group, the replication framework will wait a set + amount of time before attempting to re-establish the + connection. You can configure this wait value using + + + + DbEnv::rep_set_timeout(). + To do so, specify the + DB_REP_CONNECTION_RETRY + flag to the which parameter and then a + retry value in microseconds to the + timeout parameter. + + + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/fwrkmasterreplica.html b/db/docs/gsg_db_rep/CXX/fwrkmasterreplica.html new file mode 100644 index 000000000..dc04d0f66 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/fwrkmasterreplica.html @@ -0,0 +1,297 @@ + + + + + + Chapter 4. Replica versus Master Processes + + + + + + + + + +
    +
    +
    +
    +

    Chapter 4. Replica versus Master Processes

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Determining State + +
    +
    + + Processing Loop + +
    +
    + + Example Processing Loop + +
    +
    +
    +
    + + Running It + +
    +
    +
    +
    +
    +

    + Every environment participating in a replicated application + must know whether it is a master or + replica. The reason for this is + because, simply, the master can modify the database while + replicas cannot. As a result, not only will you open + databases differently depended on whether the environment is + running as a master, but the environment will frequently + behave quit a bit differently depending on whether it + thinks it is operating as the read/write interface for + your database. +

    +

    + Moreover, an environment must also be capable of + gracefully switching between master and replica states. + This means that the environment must be able to detect when + it has switched states. +

    +

    + Not surprisingly, a large part of your application's code + will be tied up in knowing which state a given + environment is in and then in the logic of how to behave depending on + its state. +

    +

    + This chapter shows you how to determine your environment's + state, and it then shows you some sample code on how + an application might behave depending on whether it is a + master or a replica in a replicated application. +

    +
    +
    +
    +
    +

    Determining State

    +
    +
    +
    +
    +

    + In order to determine whether your code is + running as a master or a replica, you implement a + callback whose function it is to respond to + events that happen within the DB library. +

    +

    + Note that this callback is usable for events beyond + those required for replication purposes. In this + section, however, we only discuss the + replication-specific events. +

    +

    + The callback is required to determine + which event has been passed to it, and then take + action depending on the event. For replication, + the events that we care about are: +

    +
    +
      +
    • +

      + DB_EVENT_REP_MASTER + +

      +

      + The local environment is now a master. +

      +
    • +
    • +

      + DB_EVENT_REP_CLIENT + +

      +

      + The local environment is now a replica. +

      +
    • +
    • +

      + DB_EVENT_REP_STARTUPDONE + +

      +

      + The replica has completed startup + synchronization and is now + processing log records received + from the master. +

      +
    • +
    • +

      + DB_EVENT_REP_NEWMASTER + +

      +

      + An election was held and a new + environment was made a master. However, + the current environment is + not the master. This + event exists so that you can + cause your code to take some + unique action in the event that the + replication groups switches masters. +

      +
    • +
    +
    +

    + Note that these events are raised whenever the + state is established. That is, when the current + environment becomes a client, and that includes + at application startup, the event is raised. + Also, when an election is held and a client is elected to be a + master, then the event occurs. +

    +

    + The implementation of this callback is fairly + simple. First you pass a structure to the + environment handle that you can use to record the + environment's state, and then you implement a switch + statement within the callback that you use to + record the current state, depending on the + arriving event. +

    +

    + For example: +

    +
    #include <db_cxx.h>
    +/* Forward declaration */
    +void *event_callback(DbEnv *, u_int32_t, void *);
    +
    +...
    +
    +/* The structure we use to track our environment's state */
    +typedef struct {
    +    int is_master;
    +} APP_DATA;
    +
    +...
    +
    +/*
    + * Inside our main() function, we declare an APP_DATA variable.
    + */
    +APP_DATA my_app_data;
    +my_app_data.is_master = 0; /* Assume we start as a replica */
    +
    +...
    +
    +/*
    + * Now we open our environment handle and set the APP_DATA structure
    + * to it's app_private member.
    + */
    +DbEnv *dbenv = new DbEnv(0);
    +dbenv->set_app_private(&my_app_data);
    +
    +/* Having done that, register the callback with the
    + * Berkeley DB library
    + */
    +dbenv->set_event_notify(event_callback); 
    +

    + That done, we still need to implement the callback itself. This + implementation can be fairly trivial. +

    +
    /*
    + * A callback used to determine whether the local environment is a replica
    + * or a master. This is called by the replication framework
    + * when the local environment changes state.
    + */
    +void *
    +event_callback(DbEnv *dbenv, u_int32_t which, void *info)
    +{
    +    APP_DATA *app = dbenv->get_app_private();
    +
    +    info = NULL;                /* Currently unused. */
    +
    +    switch (which) {
    +    case DB_EVENT_REP_MASTER:
    +        app->is_master = 1;
    +        break;
    +
    +    case DB_EVENT_REP_CLIENT:
    +        app->is_master = 0;
    +        break;
    +
    +    case DB_EVENT_REP_STARTUPDONE: /* fallthrough */
    +    case DB_EVENT_REP_NEWMASTER:
    +        /* Ignore. */
    +        break;
    +
    +    default:
    +        dbenv->errx(dbenv, "ignoring event %d", which);
    +    }
    +} 
    +

    + Notice how we access the + APP_DATA information using the environment + handle's app_private data member. We also ignore + the DB_EVENT_REP_NEWMASTER and + DB_EVENT_REP_STARTUPDONE cases since these are not + relevant for simple replicated applications. +

    +

    + Of course, this only gives us the current state of the environment. We + still need the code that determines what to do when the environment + changes state and how to behave depending on the state (described + in the next section). +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/fwrkpermmessage.html b/db/docs/gsg_db_rep/CXX/fwrkpermmessage.html new file mode 100644 index 000000000..b5fa7c4ab --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/fwrkpermmessage.html @@ -0,0 +1,372 @@ + + + + + + Permanent Message Handling + + + + + + + + + +
    +
    +
    +
    +

    Permanent Message Handling

    +
    +
    +
    +
    +

    + As described in Permanent Message Handling, + messages are marked permanent if they contain database + modifications that should be committed at the replica. + DB's replication code decides if it must flush its + transaction logs to disk depending on whether it receives + sufficient permanent message acknowledgments from the + participating replica. More importantly, the thread + performing the transaction commit blocks + until it either receives enough acknowledgments, or the + acknowledgment timeout expires. +

    +

    + The replication framework is fully capable of managing permanent messages + for you if your application requires it (most do). + Almost all of the details of this are handled by the + replication framework for you. However, you do have to set some policies + that tell the replication framework how to handle permanent messages. +

    +

    + There are two things that you have to do: +

    +
    +
      +
    • +

      + Determine how many acknowledgments + must be received by the master. +

      +
    • +
    • +

      + Identify the amount of time that + replicas have to send their + acknowledgments. +

      +
    • +
    +
    +
    +
    +
    +
    +

    Identifying Permanent Message Policies

    +
    +
    +
    +
    +

    + + You identify permanent message policies using the + + + + + Note that you can set permanent message + policies at any time during the life of the + application. +

    +

    + The following permanent message policies are available when you use + the replication framework: +

    +
    +
      +
    • +

      + DB_REPMGR_ACKS_NONE + +

      +

      + No permanent message acknowledgments are required. If + this policy is selected, permanent message handling is + essentially "turned off." That is, the master will + never wait for replica acknowledgments. In this case, + transaction log data is either flushed or not strictly + depending on the type of commit that is being performed + (synchronous or asynchronous). +

      +
    • +
    • +

      + DB_REPMGR_ACKS_ONE + +

      +

      + At least one replica must acknowledge the permanent + message within the timeout period. +

      +
    • +
    • +

      + DB_REPMGR_ACKS_ONE_PEER + +

      +

      + At least one electable peer must acknowledge the permanent + message within the timeout period. + + Note that an + electable peer is simply another + environment that can be elected to be a master (that + is, it has a priority greater than 0). Do not confuse + this with the concept of a peer as used for client to + client transfers. See + Client to Client Transfer + for more information on client to client transfers. +

      +
    • +
    • +

      + DB_REPMGR_ACKS_ALL + +

      +

      + All environments must acknowledge the message within + the timeout period. This + policy should be selected only if your replication + group has a small number of replicas, and those replicas + are on extremely reliable networks and servers. +

      +

      + When this flag is used, the actual number of + environments that must respond is + determined by the value set for + + DbEnv::rep_set_nsites(). + +

      +
    • +
    • +

      + DB_REPMGR_ACKS_ALL_PEERS + +

      +

      + All electable peers must acknowledge the message within the + timeout period. This + policy should be selected only if your replication + group is small, and its various environments + are on extremely reliable networks and servers. +

      +

      + Note that an + electable peer is simply another + environment that can be elected to be a master (that + is, it has a priority greater than 0). Do not confuse + this with the concept of a peer as used for client to + client transfers. See + Client to Client Transfer + for more information on client to client transfers. +

      +
    • +
    • +

      + DB_REPMGR_ACKS_QUORUM + +

      +

      + A quorum of electable peers must acknowledge the message within the timeout period. + A quorum is reached when acknowledgments are received from the minimum number + of environments needed to ensure that the record remains durable + if an election is held. That is, the master wants to hear from enough + electable replicas that they have committed the record so that if an election + is held, the master knows the record will exist even if a new master is selected. +

      +

      + Note that an + electable peer is simply another + environment that can be elected to be a master (that + is, it has a priority greater than 0). Do not confuse + this with the concept of a peer as used for client to + client transfers. See + Client to Client Transfer + for more information on client to client transfers. +

      +
    • +
    +
    +

    + By default, a quorum of sites must must acknowledge a permanent + message in order for it considered to have been successfully + transmitted. The actual number of environments that must respond is + calculated using the value set with + + DbEnv::rep_set_nsites(). + +

    +
    +
    +
    +
    +
    +

    Setting the Permanent Message Timeout

    +
    +
    +
    +
    +

    + The permanent message timeout represents the + maximum amount of time the committing thread + will block waiting for message + acknowledgments. If sufficient + acknowledgments arrive before this timeout has + expired, the thread continues operations as + normal. However, if this timeout expires, the + committing thread flushes its transaction log + buffer before continuing with normal + operations. +

    +

    + You set the timeout value using the + + DbEnv::rep_set_timeout() + method. When you do this, you provide the + DB_REP_ACK_TIMEOUT flag to + the which parameter, and the + timeout value in microseconds to the + timeout parameter. +

    +

    + For example: +

    +
        dbenv->rep_set_timeout(DB_REP_ACK_TIMEOUT, 100); 
    +

    + This timeout value can be set at anytime during the + life of the application. +

    +
    +
    +
    +
    +
    +

    Adding a Permanent Message Policy to + + RepMgr + +

    +
    +
    +
    +
    +

    + For illustration purposes, we will now update + + RepMgr + + such that it requires only one acknowledgment from + a replica on transactional commits. Also, we will give + this acknowledgment a 500 microsecond timeout + value. This means that our application's main + thread will block for up to 500 microseconds waiting + for an acknowledgment. If it does not receive at + least one acknowledgment in that amount of time, + DB will flush the transaction logs to disk + before continuing on. +

    +

    + This is a very simple update. We can perform the + entire thing in + RepMgr::init() + + immediately after we set the application's priority + and before we open our environment handle. +

    +
    int RepMgr::init(RepConfigInfo *config)
    +{
    +    int ret = 0;
    +
    +    app_config = config;
    +
    +    dbenv.set_errfile(stderr);
    +    dbenv.set_errpfx(progname);
    +
    +    if ((ret = dbenv.repmgr_set_local_site(app_config->this_host.host,
    +        app_config->this_host.port, 0)) != 0) {
    +        cerr << "Could not set listen address to host:port "
    +             << app_config->this_host.host << ":"
    +             << app_config->this_host.port
    +             << "error: " << ret << endl;
    +    }
    +
    +    for ( REP_HOST_INFO *cur = app_config->other_hosts; cur != NULL;
    +        cur = cur->next) {
    +        if ((ret = dbenv.repmgr_add_remote_site(cur->host, cur->port,
    +                                                0)) != 0) {
    +                cerr << "could not add site." << endl
    +        }
    +    }
    +
    +    if (app_config->totalsites > 0) {
    +        try {
    +            if ((ret = dbenv.rep_set_nsites(app_config->totalsites)) != 0)
    +                dbenv.err(ret, "set_nsites");
    +        } catch (DbException dbe) {
    +            cerr << "rep_set_nsites call failed. Continuing." << endl;
    +        }
    +    }
    +
    +    dbenv.rep_set_priority(app_config->priority);
    +
    +    /* Permanent messages require at least one ack */
    +    dbenv.repmgr_set_ack_policy(DB_REPMGR_ACKS_ONE);
    +    /* Give 500 microseconds to receive the ack */
    +    dbenv.rep_set_timeout(DB_REP_ACK_TIMEOUT, 500);
    +
    +    dbenv.set_cachesize(0, CACHESIZE, 0);
    +    dbenv.set_flags(DB_TXN_NOSYNC, 1);
    +
    +    ... 
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/gettingStarted.css b/db/docs/gsg_db_rep/CXX/gettingStarted.css new file mode 100644 index 000000000..c1b4c86b7 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/gettingStarted.css @@ -0,0 +1,41 @@ +body { width: 45em; + margin-left: 3em; + font-family: Arial, Helvetica, sans-serif; + font-size: 11pt; + } + +h2.title { margin-left: -1em; + font-family: Verdana, serif; + font-size: 16pt; + } + +h3.title { font-family: Verdana, serif; + font-size: 14pt; + } + +pre.programlisting { + font-family: monospace; + background-color: #eae8e9; +} + +div.navheader { font-size: 9pt; + width: 60em; + margin-left: -2em; + } + +div.navheader table tr td { font-size: 9pt; } + +div.navfooter { font-size: 9pt; + width: 60em; + margin-left: -2em; + } +div.navfooter table tr td { font-size: 9pt; } + +span.emphasis { font-style: italic; font-size: 9pt;} + +div.appendix div.informaltable { font-size: 9pt; } +div.appendix div.informaltable td { vertical-align: top; } +div.appendix div.informaltable p { margin-top: .25em; } +div.appendix div.informaltable p { margin-bottom: .25em; } + + diff --git a/db/docs/gsg_db_rep/CXX/index.html b/db/docs/gsg_db_rep/CXX/index.html new file mode 100644 index 000000000..8d9affd41 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/index.html @@ -0,0 +1,460 @@ + + + + + + Getting Started with Replicated Berkeley DB Applications + + + + + + + +
    +
    +
    +
    +

    Getting Started with Replicated Berkeley DB Applications

    +
    +
    +
    +

    + Legal Notice +

    +

    + This documentation is distributed under an open source license. + You may review the terms of this license at: + http://www.oracle.com/technology/software/products/berkeley-db/htdocs/oslicensing.html + + +

    +

    + Oracle, Berkeley DB, + + + and + Sleepycat are trademarks or registered trademarks of + Oracle Corporation. All rights to these marks are reserved. + No third-party use is permitted without the + express prior written consent of Oracle Corporation. +

    +

    + To obtain a copy of this document's original source code, please + submit a request to the Oracle Technology Network forum at: + http://forums.oracle.com/forums/forum.jspa?forumID=271 + + +

    +
    +
    +
    +

    9/20/2006

    +
    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Preface + +
    +
    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +
    + + 1. Introduction + +
    +
    +
    +
    + + Overview + +
    +
    +
    +
    + + Replication Environments + +
    +
    + + Replication Databases + +
    +
    + + Communications Layer + +
    +
    + + Selecting a Master + +
    +
    +
    +
    + + Replication Benefits + +
    +
    + + The Replication APIs + +
    +
    +
    +
    + + Replication Framework Overview + +
    +
    + + Replication API Overview + +
    +
    +
    +
    + + Holding Elections + +
    +
    +
    +
    + + Influencing Elections + +
    +
    + + Winning Elections + +
    +
    + + Switching Masters + +
    +
    +
    +
    + + Permanent Message Handling + +
    +
    +
    +
    + + When Not to Manage + Permanent Messages + +
    +
    + + Managing Permanent Messages + +
    +
    + + Implementing Permanent + Message Handling + +
    +
    +
    +
    +
    +
    + + 2. Transactional Application + +
    +
    +
    +
    + + Application Overview + +
    +
    + + Program Listing + +
    +
    +
    +
    + + + Class: RepConfigInfo + + + +
    +
    + + Class: RepMgr + +
    +
    + + Function: usage() + +
    +
    + + Function: main() + +
    +
    + + Method: RepMgr::init() + +
    +
    + + Method: RepMgr::doloop() + +
    +
    + + + + Method: RepMgr::print_stocks() + + + +
    +
    +
    +
    +
    +
    + + 3. The DB Replication Framework + +
    +
    +
    +
    + + + Starting and Stopping Replication + + +
    +
    +
    +
    + + Managing Election Policies + +
    +
    + + Selecting the Number of Threads + +
    +
    +
    +
    + + Adding the Replication Framework to + + SimpleTxn + + +
    +
    + + Permanent Message Handling + +
    +
    +
    +
    + + Identifying Permanent Message Policies + +
    +
    + + Setting the Permanent Message Timeout + +
    +
    + + Adding a Permanent Message Policy to + + RepMgr + + + +
    +
    +
    +
    + + Managing Election Times + +
    +
    +
    +
    + + Managing Election Timeouts + +
    +
    + + Managing Election Retry Times + +
    +
    +
    +
    + + Managing Connection Retries + +
    +
    +
    +
    + + 4. Replica versus Master Processes + +
    +
    +
    +
    + + Determining State + +
    +
    + + Processing Loop + +
    +
    + + Example Processing Loop + +
    +
    +
    +
    + + Running It + +
    +
    +
    +
    +
    +
    + + 5. Additional Features + +
    +
    +
    +
    + + Delayed Synchronization + +
    +
    + + Managing Blocking Operations + +
    +
    + + Stop Auto-Initialization + +
    +
    + + Client to Client Transfer + +
    +
    +
    +
    + + Identifying Peers + +
    +
    +
    +
    + + Bulk Transfers + +
    +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/introduction.html b/db/docs/gsg_db_rep/CXX/introduction.html new file mode 100644 index 000000000..e23296295 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/introduction.html @@ -0,0 +1,395 @@ + + + + + + Chapter 1. Introduction + + + + + + + + + +
    +
    +
    +
    +

    Chapter 1. Introduction

    +
    +
    +
    +
    + +

    + This book provides a thorough introduction and discussion on + replication as used with Berkeley DB (DB). It begins by offering a + general overview to replication and the benefits it provides. It also + describes the APIs that you use to implement replication, and it + describes architecturally the things that you need to do to your + application code in order to use the replication APIs. Finally, it + discusses the differences in backup and restore strategies that you + might pursue when using replication, especially where it comes to log + file removal. +

    +

    + You should understand the concepts from the + + Berkeley DB Getting Started with Transaction Processing + + + + guide before reading this book. +

    +
    +
    +
    +
    +

    Overview

    +
    +
    +
    +
    +

    + The DB replication APIs allow you to distribute your database + write operations (performed on a read-write master) to one or + more read-only replicas. + For this reason, DB's replication implementation is said to be a + single master, multiple replica replication strategy. +

    +

    + Note that your database write operations can occur only on the + master; any attempt to write to a replica results in an error + being + + raised by + the DB API used to perform the write. +

    +

    + A single replication master and all of its replicas are referred + to as a replication group. While all + members of the replication group can reside on the same + machine, usually each replication participant is placed on a + separate physical machine somewhere on the network. +

    +

    + Note that all replication applications must first be + transactional applications. The data that the master transmits + its replicas are log records that are generated as records are + updated. Upon transactional commit, the master transmits a + transaction record which tells the replicas to commit the + records they previously received from the master. In order for + all of this to work, your replicated application must also be a + transactional application. For this reason, it is + recommended that you write and debug your DB application as + a stand-alone transactional application before introducing the + replication layer to your code. +

    +

    + Finally, be aware that all machines participating in the + replication group must share identical + endianess. Endianess is the byte-order + strategy used by the computing platform to store multibyte + numbers. Berkeley DB is sensitive to byte order and so your + replication infrastructure must be consistent in this area. + We expect to remove this requirement in some future + release of the product. +

    +
    +
    +
    +
    +

    Replication Environments

    +
    +
    +
    +
    +

    + The most important requirement for a replication + participant is that it must use a unique Berkeley DB database + environment independent of all other replication + participants. So while multiple replication participants + can reside on the same physical machine, no two such participants + can share the same environment home directory. +

    +

    + For this reason, technically replication occurs between + unique database environments. So in the strictest sense, + a replication group consists of a master + environment and + one or more replica environments. However, the reality + is that for production code, each such environment will + usually be located on its own unique machine. Consequently, + this manual sometimes talks about replication sites, meaning the + unique combination of environment home directory, host and port that a specific + replication application is using. +

    +

    + There is no DB-specified limit to the number of + environments which can participate in a replication group. + The only limitation here is one of resources — + network bandwidth, for example. +

    +

    + (Note, however, that the replication framework does place a limit on the + number of environments you can use. See + Replication Framework Overview + for details.) +

    +

    + Also, DB's replication implementation requires all + participating environments to be assigned IDs that are + locally unique to the given environment. Depending on the + replication APIs that you choose to use, you may or may not + need to manage this particular detail. +

    +

    + For detailed information on database environments, see + the Berkeley DB Getting Started with Transaction Processing + guide. For more information on environment IDs, see + the Berkeley DB Programmer's Reference Guide. +

    +
    +
    +
    +
    +
    +

    Replication Databases

    +
    +
    +
    +
    +

    + DB's databases are managed and used in exactly the same way + as if you were writing a non-replicated application, with + a couple of caveats. First, the databases maintained in a replicated environment + must reside either in the ENV_HOME + directory, or in the directory identified by the + + DbEnv::set_data_dir() + + method. Unlike non-replication applications, you cannot place your + databases in a subdirectory below these locations. You should + also not use full path names for your databases or + environments as these are likely to break as to replicated + to other machines. +

    +
    +
    +
    +
    +
    +

    Communications Layer

    +
    +
    +
    +
    +

    + In order to transmit database writes to the replication + replicas, DB requires a communications layer. + DB is agnostic as to what this layer should + look like. The only requirement is that it + be capable of passing two opaque data objects and an + environment ID from the master to its replicas without + corruption. +

    +

    + Because replicas are usually placed on different machines on + the network, the communications layer is usually some kind + of a network-aware implementation. Beyond that, its + implementation details are largely up to you. It could use + TCP/IP sockets, for example, or it could use + raw sockets if they perform better for your particular + application. +

    +

    + Note that you may not have to write your own communications + layer. DB provides a replication framework that + includes a fully-functional TCP/IP-based communications layer. + See The Replication APIs + for more information. +

    +

    + See the Berkeley DB Programmer's Reference Guide + for a description of how to + write your own custom replication communications layer. +

    +
    +
    +
    +
    +
    +

    Selecting a Master

    +
    +
    +
    +
    +

    + Every replication group is allowed one and only one + master environment. Almost always, masters are selected by + holding an election. All such + elections are performed by the underlying Berkeley DB + replication code so you have to do very little to + implement them. +

    +

    + When holding an election, replicas "vote" on who should + be the master. Among replicas participating in the + election, the one with the most up-to-date set of log + records will win the election. Note that it's possible + for there to be a tie. When this occurs, priorities are + used to select the master. See + Holding Elections + for details. +

    +

    + For more information on holding and managing elections, + see Holding Elections. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/manageblock.html b/db/docs/gsg_db_rep/CXX/manageblock.html new file mode 100644 index 000000000..baeb8ed90 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/manageblock.html @@ -0,0 +1,88 @@ + + + + + + Managing Blocking Operations + + + + + + + + + +
    +
    +
    +
    +

    Managing Blocking Operations

    +
    +
    +
    +
    +

    + When a replica is in the process of synchronizing with its master, all DB + operations are blocked until such a time as the synchronization is completed. + For replicas with a heavy read load, these blocked operations may represent an + unacceptable loss in throughput. +

    +

    + You can configure DB so that it will not block when synchronization is in + process. Instead, the DB operation will fail, + + + immediately returning a DB_REP_LOCKOUT error. + + + + When this happens, it is up to your application to your application to determine + what action to take (that is, logging the event, making an appropriate user + response, retrying the operation, and so forth). +

    +

    + To turn off blocking on synchronization, specify + + DB_REP_CONF_NOWAIT to + + DbEnv::rep_set_config() + and then specify 1 to the onoff + parameter. (Specify 0 to turn the feature off.) + + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/noautoinit.html b/db/docs/gsg_db_rep/CXX/noautoinit.html new file mode 100644 index 000000000..a3aaa2145 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/noautoinit.html @@ -0,0 +1,88 @@ + + + + + + Stop Auto-Initialization + + + + + + + + + +
    +
    +
    +
    +

    Stop Auto-Initialization

    +
    +
    +
    +
    +

    + As stated in the previous section, when a replication replica is synchronizing + with its master, it will block all DB operations until the synchronization + is completed. You can turn off this behavior (see Managing Blocking Operations), but for replicas that have been out of touch + from their master for a very long time, this may not be enough. +

    +

    + If a replica has been out of touch from its master long enough, it may find that + it is not possible to perform synchronization. When this happens, by default the + master and replica internally decided to completely re-initialize the replica. + This re-initialization involves discarding the replica's current database(s) and + transferring new ones to it from the master. Depending on the size of the master's + databases, this can take a long time, during which time the replica will be + complete non-responsive when it comes to performing database operations. +

    +

    + It is possible that there is a time of the day when it is better to perform a replica + re-initialization. Or, you simply might want to decide to bring the replica up to + speed by restoring it's databases using a hot-backup taken from the master. Either + way, you can decide to prevent automatic-initialization of your replica. To do this + specify + + DB_REP_CONF_NOAUTOINIT to + + DbEnv::rep_set_config() + and then specify 1 to the onoff + parameter. (Specify 0 to turn the feature off.) + + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/permmessages.html b/db/docs/gsg_db_rep/CXX/permmessages.html new file mode 100644 index 000000000..b404585b8 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/permmessages.html @@ -0,0 +1,390 @@ + + + + + + Permanent Message Handling + + + + + + + + + +
    +
    +
    +
    +

    Permanent Message Handling

    +
    +
    +
    +
    +

    + Messages received by a replica may be marked with an + special flag that indicates the message is permanent. + Custom replicated applications will receive notification of + this flag via the DB_REP_ISPERM return value + from the + + DbEnv::rep_process_message() + method. + + There is no hard requirement that a replication application look for, or + respond to, this return code. However, because robust replicated + applications typically do manage permanent messages, we introduce + the concept here. +

    +

    + A message is marked as being permanent if the message + affects transactional integrity. For example, + transaction commit messages are an example of a message + that is marked permanent. What the application does + about the permanent message is driven by the durability + guarantees required by the application. +

    +

    + For example, consider what the replication framework does when it + has permanent message handling turned on and a + transactional commit record is sent to the replicas. + First, the replicas must transactional-commit the data + modifications identified by the message. And then, upon + a successful commit, the replication framework sends the master a + message acknowledgment. +

    +

    + For the master (again, using the replication framework), things are a little more complicated than + simple message acknowledgment. Usually in a replicated + application, the master commits transactions + asynchronously; that is, the commit operation does not + block waiting for log data to be flushed to disk before + returning. So when a master is managing permanent + messages, it typically blocks the committing thread + immediately before commit() + returns. The thread then waits for acknowledgments from + its replicas. If it receives enough acknowledgments, it + continues to operate as normal. +

    +

    + If the master does not + receive message acknowledgments — or, more likely, it does not receive + enough acknowledgments — the + committing thread flushes its log data to disk and then + continues operations as normal. The master application can + do this because replicas that fail to handle a message, for + whatever reason, will eventually catch up to the master. So + by flushing the transaction logs to disk, the master is + ensuring that the data modifications have made it to + stable storage in one location (its own hard drive). +

    +
    +
    +
    +
    +

    When Not to Manage + Permanent Messages

    +
    +
    +
    +
    +

    + There are two reasons why you might + choose to not implement permanent messages. + In part, these go to why you are using + replication in the first place. +

    +

    + One class of applications uses replication so that + the application can improve transaction + through-put. Essentially, the application chooses a + reduced transactional durability guarantee so as to + avoid the overhead forced by the disk I/O required + to flush transaction logs to disk. However, the + application can then regain that durability + guarantee to a certain degree by replicating the + commit to some number of replicas. +

    +

    + Using replication to improve an application's + transactional commit guarantee is called + replicating to the network. +

    +

    + In extreme cases where performance is of critical + importance to the application, the master might + choose to both use asynchronous commits + and decide not to wait for + message acknowledgments. In this case the master + is simply broadcasting its commit activities to its + replicas without waiting for any sort of a reply. An + application like this might also choose to use + something other than TCP/IP for its network + communications since that protocol involves a fair + amount of packet acknowledgment all on its own. Of + course, this sort of an application should also be + very sure about the reliability of both its network and + the machines that are hosting its replicas. +

    +

    + At the other end of the extreme, there is a + class of applications that use replication + purely to improve read performance. This sort + of application might choose to use synchronous + commits on the master because write + performance there is not of critical + performance. In any case, this kind of an + application might not care to know whether its + replicas have received and successfully handled + permanent messages because the primary storage + location is assumed to be on the master, not + the replicas. +

    +
    +
    +
    +
    +
    +

    Managing Permanent Messages

    +
    +
    +
    +
    +

    + With the exception of a rare breed of + replicated applications, most masters need some + view as to whether commits are occurring on + replicas as expected. At a minimum, this is because + masters will not flush their log buffers unless + they have reason to expect that permanent + messages have not been committed on the + replicas. +

    +

    + That said, it is important to remember that + managing permanent messages involves a fair amount + of network traffic. The messages must be sent to + the replicas and the replicas must then acknowledge + the message. This represents a performance overhead + that can be worsened by congested networks or + outright outages. +

    +

    + Therefore, when managing permanent messages, you + must first decide on how many of your replicas must + send acknowledgments before your master decides + that all is well and it can continue normal + operations. When making this decision, you could + decide that all replicas must + send acknowledgments. But unless you have only one + or two replicas, or you are replicating over a very + fast and reliable network, this policy could prove + very harmful to your application's performance. +

    +

    + Therefore, a common strategy is to wait for an + acknowledgment from a simple majority of replicas. + This ensures that commit activity has occurred on + enough machines that you can be reliably certain + that data writes are preserved across your network. +

    +

    + Remember that replicas that do not acknowledge a + permanent message are not necessarily unable to + perform the commit; it might be that network + problems have simply resulted in a delay at the + replica. In any case, the underlying DB + replication code is written such that a replica that + falls behind the master will eventually take action + to catch up. +

    +

    + Depending on your application, it may be + possible for you to code your permanent message + handling such that acknowledgment must come + from only one or two replicas. This is a + particularly attractive strategy if you are + closely managing which machines are eligible to + become masters. Assuming that you have one or + two machines designated to be a master in the + event that the current master goes down, you + may only want to receive acknowledgments from + those specific machines. +

    +

    + Finally, beyond simple message acknowledgment, you + also need to implement an acknowledgment timeout + for your application. This timeout value is simply + meant to ensure that your master does not hang + indefinitely waiting for responses that will never + come because a machine or router is down. +

    +
    +
    +
    +
    +
    +

    Implementing Permanent + Message Handling

    +
    +
    +
    +
    +

    + How you implement permanent message handling + depends on which API you are using to implement + replication. If you are using the replication framework, then + permanent message handling is configured using + policies that you specify to the framework. In + this case, you can configure your application + to: +

    +
    +
      +
    • +

      + Ignore permanent messages (the master + does not wait for acknowledgments). +

      +
    • +
    • +

      + Require acknowledgments from a + quorum. A quorum is reached when + acknowledgments are received from the + minimum number of electable + replicas needed to ensure that + the record remains durable if + an election is held. +

      +

      + The goal here is to be + absolutely sure the record is + durable. The master wants to + hear from enough electable + replicas that they have + committed the record so that if + an election is held, the master + knows the record will exist even + if a new master is selected. +

      +

      + This is the default policy. +

      +
    • +
    • +

      + Require an acknowledgment from at least one replica. +

      +
    • +
    • +

      + Require acknowledgments from + all replicas. +

      +
    • +
    • +

      + Require an acknowledgment from a + peer. (The replication framework allows you to + designate one environment as a peer of + another). +

      +
    • +
    • +

      + Require acknowledgments from + all peers. +

      +
    • +
    +
    +

    + Note that the replication framework simply flushes its transaction + logs and moves on if a permanent message is not + sufficiently acknowledged. +

    +

    + For details on permanent message handling with the + replication framework, see Permanent Message Handling. +

    +

    + If these policies are not sufficient for your + needs, or if you want your application to take more + corrective action than simply flushing log buffers + in the event of an unsuccessful commit, then you + must use write a custom replication implementation. +

    +

    + For custom replication implementation, messages are + sent from the master to its replica using a + send() callback that you + implement. Note, however, that DB's replication + code automatically sets the permanent + flag for you where appropriate. +

    +

    + If the send() callback returns with a + non-zero status, DB flushes the transaction log + buffers for you. Therefore, you must cause your + send() callback to block waiting + for acknowledgments from your replicas. + As a part of implementing the + send() callback, you implement + your permanent message handling policies. This + means that you identify how many replicas must + acknowledge the message before the callback can + return 0. You must also + implement the acknowledgment timeout, if any. +

    +

    + Further, message acknowledgments are sent from the + replicas to the master using a communications + channel that you implement (the replication code + does not provide a channel for acknowledgments). + So implementing permanent messages means that when + you write your replication communications channel, + you must also write it in such a way as to also + handle permanent message acknowledgments. +

    +

    + For more information on implementing permanent + message handling using a custom replication layer, + see the Berkeley DB Programmer's Reference Guide. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/preface.html b/db/docs/gsg_db_rep/CXX/preface.html new file mode 100644 index 000000000..e384eee45 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/preface.html @@ -0,0 +1,216 @@ + + + + + + Preface + + + + + + + + + +
    +
    +
    +
    +

    Preface

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +

    + This document describes how to write replicated Berkeley DB applications. + The APIs used to implement replication in your application + are described here. This book describes the concepts surrounding replication, the scenarios under which you + might choose to use it, and the architectural requirements that a replication application has over a + transactional application. +

    +

    + This book is aimed at the software engineer responsible for writing a + replicated DB application. +

    +

    + This book assumes that you have already read and understood the + concepts contained in the + Berkeley DB Getting Started with Transaction Processing guide. + +

    +
    +
    +
    +
    +

    Conventions Used in this Book

    +
    +
    +
    +
    +

    + The following typographical conventions are used within in this manual: +

    +

    + Class names are represented in monospaced font, as are method + names. For example: + + + + "DbEnv::open() is a + DbEnv class method." +

    +

    + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALL directory." +

    +

    + Program examples are displayed in a monospaced font on a shaded background. + For example: +

    +
    typedef struct vendor {
    +    char name[MAXFIELD];             // Vendor name
    +    char street[MAXFIELD];           // Street name and number
    +    char city[MAXFIELD];             // City
    +    char state[3];                   // Two-digit US state code
    +    char zipcode[6];                 // US zipcode
    +    char phone_number[13];           // Vendor phone number
    +} VENDOR; 
    +

    + In some situations, programming examples are updated from one chapter to the next. When + this occurs, the new code is presented in monospaced bold font. For example: +

    +
    typedef struct vendor {
    +    char name[MAXFIELD];             // Vendor name
    +    char street[MAXFIELD];           // Street name and number
    +    char city[MAXFIELD];             // City
    +    char state[3];                   // Two-digit US state code
    +    char zipcode[6];                 // US zipcode
    +    char phone_number[13];           // Vendor phone number
    +    char sales_rep[MAXFIELD];        // Name of sales representative
    +    char sales_rep_phone[MAXFIELD];  // Sales rep's phone number 
    +} VENDOR; 
    +
    +

    Note

    +

    + Finally, notes of special interest are represented using a note block such + as this. +

    +
    +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + transactional DB application: +

    + +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/processingloop.html b/db/docs/gsg_db_rep/CXX/processingloop.html new file mode 100644 index 000000000..3f18d2310 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/processingloop.html @@ -0,0 +1,259 @@ + + + + + + Processing Loop + + + + + + + + + +
    +
    +
    +
    +

    Processing Loop

    +
    +
    +
    +
    +

    + Typically the central part of any replication application + is some sort of a continuous loop that constantly + checks the state of the environment (whether it is a + replica or a master), opens and/or closes the + databases as is necessary, and performs other useful + work. A loop such as this one must of necessity + take special care to know whether it is operating + on a master or a replica environment because all of its + activities are dependent upon that state. +

    +

    + The flow of activities through the loop will + generally be as follows: +

    +
    +
      +
    1. +

      + Check whether the environment has + changed state. If it has, you + might want to reopen your + database handles, especially if + you opened your replica's + database handles as read-only. + In this case, you might need to + reopen them as read-write. + However, if you always open your + database handles as read-write, + then it is not automatically necessary to + reopen the databases due to a + state change. Instead, you + could check for a + + DB_REP_HANDLE_DEAD + return code + + + + when you use your + database handle(s). If you see + this, then you need to reopen + your database handle(s). +

      +
    2. +
    3. +

      + If the databases are closed, + create new database handles, + configure the handle as is + appropriate, and then open the + databases. Note that handle + configuration will be different, + depending on whether the handle + is opened as a replica or a + master. At a minimum, the master + should be opened with database + creation privileges, whereas the + replica does not need to be. You + must also open the master such + that its databases are + read-write. You + can open + replicas with read-only + databases, so long as you are + prepared to closed and the reopen + the handle in the event the + client becomes a master. +

      +

      + Also, note that if the local + environment + is a replica, then it is possible + that databases do not currently + exist. In this case, the database + open attempts will fail. Your + code will have to take this + corner case into account + (described below). +

      +
    4. +
    5. +

      + Once the databases are opened, + check to see if the local + environment is a + master. If it is, do whatever it is + a master should do for your + application. +

      +

      + Remember that the code for your + master should include some way + for you to tell the master + to exit gracefully. +

      +
    6. +
    7. +

      + If the local environment is not a + master, then do whatever it is + your replica environments should do. + Again, like the code for your + master environments, you should provide + a way for your replicas to exit + the processing loop gracefully. +

      +
    8. +
    +
    +

    + The following code fragment illustrates + these points (note that we fill out this + fragment with a working example + next in this chapter): +

    +
    /* loop to manage replication activities */
    +
    +Db *dbp;
    +int ret;
    +APP_DATA *app_data;
    +u_int32_t flags;
    +
    +dbp = NULL;
    +ret = 0;
    +
    +/* 
    + * Remember that for this to work, an APP_DATA struct would have first
    + * had to been set to the environment handle's app_private data
    + * member. (dbenv is presumable declared and opened in another part of
    + * the code.)
    + */
    +app_data = dbenv->get_app_private();
    +
    +
    +/* 
    + * Infinite loop. We exit depending on how the master and replica code
    + * is written.
    + */
    +for (;;) {
    +    /* If dbp is not opened, we need to open it. */
    +    if (dbp == NULL) {
    +        /* 
    +         * Create the handle and then configure it. Before you open
    +         * it, you have to decide what open flags to use:
    +         */
    +         flags = DB_AUTO_COMMIT;
    +         if (app_data->is_master)
    +            flags |= DB_CREATE
    +        /*
    +         * Now you can open your database handle, passing to it the
    +         * flags selected above. 
    +         *
    +         * One thing to watch out for is a case where the databases 
    +         * you are trying to open do not yet exist. This can happen 
    +         * for replicas where the databases are being opened 
    +         * read-only. If this happens, ENOENT is returned by the 
    +         * open() call.
    +         */
    +         try {
    +            dbp->open(NULL, DATABASE, NULL, DB_BTREE,
    +                    app_data->is_master ? DB_CREATE | DB_AUTO_COMMIT :
    +                    DB_AUTO_COMMIT, 0);
    +         } catch(DbException dbe) {
    +            if (dbe.get_errno() == ENOENT) {
    +                cout << "No stock db available yet - retrying." << endl;
    +                try {
    +                    dbp->close(0);
    +                } catch (DbException dbe2) {
    +                    cout << "Unexpected error closing after failed" <<
    +                            " open, message: " << dbe2.what() << endl;
    +                    dbp = NULL;
    +                    goto err;
    +                 }
    +                 dbp = NULL;
    +                 sleep(SLEEPTIME);
    +                 continue;
    +            } else {
    +                dbenv.err(ret, "DB->open");
    +                throw dbe;
    +            }
    +         }
    +    }
    +
    +    /*
    +     * Now that the databases have been opened, continue with general
    +     * processing, depending on whether we are a master or a replica.
    +     */
    +     if (app_data->is_master) {
    +        /* 
    +         * Do master stuff here. Don't forget to include a way to
    +         * gracefully exit the loop. */
    +         */
    +     } else {
    +        /* 
    +         * Do replica stuff here. As is the case with the master
    +         * code, be sure to include a way to gracefully exit the
    +         * loop. 
    +         */
    +     }
    +} 
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/repadvantage.html b/db/docs/gsg_db_rep/CXX/repadvantage.html new file mode 100644 index 000000000..c7ab72c1a --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/repadvantage.html @@ -0,0 +1,184 @@ + + + + + + Replication Benefits + + + + + + + + + +
    +
    +
    +
    +

    Replication Benefits

    +
    +
    +
    +
    +

    + + Replication offers your application a number of benefits that + can be a tremendous help. Primarily replication's benefits + revolve around performance, but there is also a benefit in + terms of data durability guarantees. +

    +

    + Briefly, the reasons why you might choose to implement + replication in your DB application are: +

    +
    +
    +
      +
    • +

      + Improved application reliability. +

      +

      + By spreading your data across multiple + machines, you can ensure that your + application's data continues to be + available even in the event of a + hardware failure on any given machine in + the replication group. +

      +
    • +
    +
    +
      +
    • +

      + Improve read performance. +

      +

      + By using replication you can spread data reads across + multiple machines on your network. Doing so allows you + to vastly improve your application's read performance. + This strategy might be particularly interesting for + applications that have readers on remote network nodes; + you can push your data to the network's edges thereby + improving application data read responsiveness. +

      +

      + Additionally, depending on how you partition your + data across your replicas, any given replica may + only need to cache part of your data, decreasing + cache misses and reducing I/O on the client. +

      +
    • +
    • +

      + Improve transactional commit performance +

      +

      + In order to commit a transaction and achieve a + transactional durability guarantee, the commit must be + made durable. That is, the commit + must be written to disk (usually, but not always, + synchronously) before the application's thread of + control can continue operations. +

      +

      + Replication allows you to avoid this disk I/O and still + maintain a degree of durability by committing + to the network. In other words, you relax + your transactional durability guarantees on the master, + but by virtue of replicating the data across the + network you gain some additional durability guarantees + above what is provided locally. +

      +

      + Usually this strategy is implemented using some form of + an asynchronous transactional commit on the master. In + this way your data writes will eventually be written to + disk, but your application will not have to wait for + the disk I/O to complete before continuing with its + next operation. +

      +

      + Note that it is possible to cause DB's replication + implementation to wait to hear from one or + more replica's as to whether they have successfully + saved the write before continuing. However, in this + case you might be trading performance for a even + higher durability guarantee (see below). +

      +
    • +
    • +

      + Improve data durability guarantee. +

      +

      + In a traditional transactional application, you commit your + transactions such that data modifications are saved to + disk. Beyond this, the durability of your data is + dependent upon the backup strategy that you choose to + implement for your site. +

      +

      + Replication allows you to increase this durability + guarantee by ensuring that data modifications are + written to multiple machines. This means that multiple + disks, disk controllers, power supplies, and CPUs are + used to ensure that your data modification makes it to + stable storage. In other words, replication allows you + to minimize the problem of a single point of failure + by using more hardware to guarantee your data writes. +

      +

      + If you are using replication for this reason, then you + probably will want to configure your application such + that it waits to hear about a successful commit from + one or more replicas before continuing with the next + operation. This will obviously impact your + application's write performance to some degree + — with the performance penalty being largely dependent + upon the speed and stability of the network connecting + your replication group. +

      +

      + For more information, see Permanent Message Handling. +

      +
    • +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/repapp.html b/db/docs/gsg_db_rep/CXX/repapp.html new file mode 100644 index 000000000..240383791 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/repapp.html @@ -0,0 +1,711 @@ + + + + + + Chapter 3. The DB Replication Framework + + + + + + + + + +
    +
    +
    +
    +

    Chapter 3. The DB Replication Framework

    +
    +
    +
    +
    + +

    + The easiest way to add replication to your transactional + application is to use the replication framework. The replication framework provides a comprehensive + communications layer that enables replication. For a brief listing + of the replication framework's feature set, see + Replication Framework Overview. +

    +

    + To use the replication framework, you make use of special methods off the + + DbEnv class. + That is: +

    +
    +
      +
    1. +

      + Create an environment handle as normal. +

      +
    2. +
    3. +

      + Configure your environment handle as + needed (e.g. set the error file and + error prefix values, if desired). +

      +
    4. +
    5. +

      + Use the replication framework replication methods to + configure the replication framework. Using these + methods causes DB to know that you + are using the replication framework. +

      +

      + Configuring the replication framework + entails setting its replication + priority, setting the TCP/IP address + that this replication environment will use for + incoming replication messages, identify + TCP/IP addresses of other replication + environments, setting the number of + replication environments in the + replication group, and so forth. These actions are + discussed throughout the remainder of + this chapter. +

      +
    6. +
    7. +

      + Open your environment handle. When you + do this, be sure to specify + + DB_INIT_REP and + DB_THREAD to your + open flags. (This is in addition to the + flags that you normally use for a + single-threaded transactional + application). The first of these causes + replication to be initialized for the + application. The second causes your + environment handle to be free-threaded + (thread safe). Both flags are required + for replication framework usage. + + + +

      +
    8. +
    9. +

      + Start replication by calling + + DbEnv::repmgr_start(). + +

      +
    10. +
    11. +

      + Open your databases as needed. Masters + must open their databases for read + and write activity. Replicas can open + their databases for read-only activity, but + doing so means they must re-open the + databases if the replica ever becomes a + master. Either way, replicas should never attempt to + write to the database(s) directly. +

      +
    12. +
    +
    +
    +

    Note

    +

    + The replication framework allows you to only use one + environment handle per process. +

    +
    +

    + When you are ready to shut down your application: +

    +
    +
      +
    1. +

      + Close your databases +

      +
    2. +
    3. +

      + Close your environment. This causes + replication to stop as well. +

      +
    4. +
    +
    +
    +

    Note

    +

    + Before you can use the replication framework, you may have to + enable it in your DB library. This is + not a requirement for + Microsoft Windows systems, or Unix systems that + use pthread mutexes by default. Other systems, + notably BSD and BSD-derived systems (such as + Mac OS X), must enable the replication framework when you + configure the DB build. +

    +

    + You do this by not + disabling replication and by configuring the + library with POSIX threads support. In other + words, replication must be turned on in the + build (it is by default), and POSIX thread + support must be enabled if it is not already by + default. To do this, use the + --enable-pthread_api switch + on the configure script. +

    +

    + For example: +

    +
    ../dist/configure --enable-pthread-api
    +
    +
    +
    +
    +
    +

    + Starting and Stopping Replication +

    +
    +
    +
    +
    +

    + As described above, you introduce replication to an + application by starting with a transactional + application, performing some basic replication + configuration, and then starting replication using + + DbEnv::repmgr_start(). + +

    +

    + You stop replication by closing your environment + cleanly, as is normal for an DB application. +

    +

    + For example, the following code fragment initializes, then + stops and starts replication. Note that other replication + activities are omitted for brevity. +

    +
    +

    Note

    +

    + Note that the following code fragment would be part of a larger + class that must implement + com.sleepycat.db.EventHandler. This + class is used to track state changes between master and + replica. We put off that implementation for the moment, but the + point remains that the following code fragment would be + contained in a method or two that you would include in your + com.sleepycat.db.EventHandler + implementation. +

    +
    +
    #include <db_cxx.h>
    +
    +/* Use a 10mb cache */
    +#define CACHESIZE   (10 * 1024 * 1024)
    +
    +...
    +
    +    DbEnv *dbenv;            /* Environment handle. */
    +    const char *progname;     /* Program name. */
    +    const char *envHome;      /* Environment home directory. */
    +    const char *listen_host;  /* A TCP/IP hostname. */
    +    const char *other_host;   /* A TCP/IP hostname. */
    +    u_int16 listen_port;      /* A TCP/IP port. */
    +    u_int16 other_port;       /* A TCP/IP port. */
    +
    +    /* Initialize variables */
    +    dbenv = NULL;
    +    progname = "example_replication";
    +    envHome = "ENVIRONMENT_HOME";
    +    listen_host = "mymachine.sleepycat.com";
    +    listen_port = 5001;
    +    other_host = "anothermachine.sleepycat.com";
    +    other_port = 4555;
    +
    +    try {
    +        /* Create the environment handle */
    +        dbenv = new DbEnv(0);
    +
    +        /*
    +         * Configure the environment handle. Here we configure 
    +         * asynchronous transactional commits for performance reasons. 
    +         */
    +        dbenv->set_errfile(stderr);
    +        dbenv->set_errpfx(progname);
    +        (void)dbenv->set_cachesize(0, CACHESIZE, 0);
    +        (void)dbenv->set_flags(DB_TXN_NOSYNC, 1);
    +
    +        /*
    +         * Configure the local address. This is the local hostname and 
    +         * port that this replication participant will use to receive 
    +         * incoming replication messages. Note that this can be performed 
    +         * only once for the application. It is required.
    +         */
    +       dbenv->repmgr_set_local_site(listen_host, listen_port, 0);
    +
    +       /*
    +        * Set this application's priority. This is used for elections.
    +        *
    +        * Set this number to a positive integer, or 0 if you do not want
    +        * this site to be able to become a master.
    +        */
    +        dbenv->rep_set_priority(100);
    +
    +        /*
    +         * Add a site to the list of replication environments known to 
    +         * this application. 
    +         */
    +         dbenv->repmgr_add_remote_site(other_host, other_port);
    +
    +        /*
    +         * Identify the number of sites in the replication group. This is
    +         * necessary so that elections and permanent message handling can 
    +         * be performed correctly.
    +         */
    +         dbenv->repmgr_add_nsites(2);
    +
    +        /* Open the environment handle. Note that we add DB_THREAD and
    +         * DB_INIT_REP to the list of flags. These are required.
    +         */
    +         dbenv->open(home, DB_CREATE | DB_RECOVER |
    +                           DB_INIT_LOCK | DB_INIT_LOG |
    +                           DB_INIT_MPOOL | DB_INIT_TXN  |
    +                           DB_THREAD | DB_INIT_REP,
    +                           0);
    +
    +        /* Start the replication framework such that it uses 3 threads. */
    +         dbenv->repmgr_start(3, DB_REP_ELECTION);
    +
    +       /* Sleep to give ourselves time to find a master */
    +        sleep(5);
    +
    +       /*
    +        **********************************************************
    +        *** All other application code goes here, including  *****
    +        *** database opens                                   *****
    +        **********************************************************
    +        */
    +
    +
    +    } catch (DbException &de) {
    +        /* Error handling goes here */
    +    }
    +
    +    /* Close out the application here.
    +    try {
    +        /* 
    +         * Make sure all your database handles are closed 
    +         *  (omitted from this example). 
    +         */
    +
    +        /* Close the environment */
    +        if (dbenv != NULL)
    +            (void)dbenv->close(dbenv, 0);
    +
    +    } catch (DbException &de) {
    +        /* Error handling goes here */
    +    }
    +
    +    /* All done */ 
    +
    +
    +
    +
    +

    Managing Election Policies

    +
    +
    +
    +
    +

    + Before continuing, it is worth taking a look at the + + + startup election flags accepted by + + DbEnv::repgmr_start(). + These flags control how your replication application will + behave when it first starts up. + + + +

    +

    + In the previous example, we specified + DB_REP_ELECTION + + when we started replication. This causes the + application to try to find a master upon startup. If it + cannot, it calls for an election. In the event an + election is held, the environment receiving the most number of + votes will become the master. +

    +

    + There's some important points to make here: +

    +
    +
      +
    • +

      + This + flag + + only requires that other + environments in the replication group + participate in the vote. There is no + requirement that + all such + environments participate. In other + words, if an environment + starts up, it can call for an + election, and select a master, even + if all other environment have not yet + joined the replication group. +

      +
    • +
    • +

      + It only requires a simple majority of + participating environments to elect a master. The number of + environments used to calculate the simple + majority is based on the value set for + + + DbEnv::rep_set_nsites(). + + + + This is always true of elections held using the replication framework. +

      +
    • +
    • +

      + As always, the environment participating in the election with the most + up-to-date log files is selected as + master. If an environment with better log files + has not yet joined the replication + group, it may not become the master. +

      +
    • +
    +
    +

    + Any one of these points may be enough to cause a + less-than-optimum environment to be selected as master. + Therefore, to give you a better degree of control over + which environment becomes a master at application startup, + the replication framework offers the following start-up + flags: + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FlagDescription
    + DB_REP_MASTER + +

    + The application starts up and declares itself to be a master + without calling for an election. It is an error for more + than one environment to start up using this flag, or for + an environment + to use this flag when a master already exists. +

    +

    + Note that no replication group should + ever operate with more than + one master. +

    +

    + In the event that a environment attempts to become a + master when a master already exists, the + replication code will resolve the problem by + holding an election. Note, however, that there + is always a possibility of data loss in the face + of duplicate masters, because once a master is + selected, the environment that loses the election will + have to roll back any transactions committed + until it is in sync with the "real" master. +

    +
    + DB_REP_CLIENT + +

    + The application starts up and declares + itself to be a replica without calling for + an election. Note that the application + can still become a master if a subsequent + application starts up, calls for an + election, and this application is elected + master. +

    +
    + DB_REP_ELECTION + +

    + As described above, the application starts up, + looks for a master, and if one is not found calls + for an election. +

    +
    + DB_REP_FULL_ELECTION + +

    + Identical to + DB_REP_ELECTION + + except that the election requires all + known members of the replication group to + participate. If a given environment has not yet + started but it is included in the + replication group count (using + + DbEnv::rep_set_nsites()) + + then a master can not be elected. +

    +
    +
    +
    +
    +
    +
    +
    +

    Selecting the Number of Threads

    +
    +
    +
    +
    +

    + Under the hood, the replication framework is threaded and you can + control the number of threads used to process messages received from + other replicas. The threads that the replication framework uses are: +

    +
    +
      +
    • +

      + Incoming message thread. This thread + receives messages from the site's + socket and passes those messages to + message processing threads (see below) + for handling. +

      +
    • +
    • +

      + Outgoing message thread. Outgoing + are performed in whatever thread + performed a write to the database(s). + That is, the thread that called, for + example, + + Db::put() + + is the thread that writes replication messages + about that fact to the socket. +

      +

      + Note that if this write activity would + cause the thread to be blocked due to + some condition on the socket, the replication framework + will hand the outgoing message to the + incoming message thread, and it will + then write the message to the socket. + This prevents your database write + threads from blocking due to abnormal + network I/O conditions. +

      +
    • +
    • +

      + Message processing threads are + responsible for parsing and then + responding to incoming replication + messages. Typically, a response will + include write activity to your + database(s), so these threads can be + busy performing disk I/O. +

      +
    • +
    +
    +

    + Of these threads, the only ones that you have any + configuration control over are the message processing + threads. In this case, you can determine how many + of these threads you want to run. +

    +

    + It is always a bit of an art to decide on a thread count, + but the short answer is you probably do not need more + than three threads here, and it is likely that one will + suffice. That said, the best thing to do is set your + thread count to a fairly low number and then increase + it if it appears that your application will benefit + from the additional threads. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/repmgr_init_example_c.html b/db/docs/gsg_db_rep/CXX/repmgr_init_example_c.html new file mode 100644 index 000000000..42be987b1 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/repmgr_init_example_c.html @@ -0,0 +1,520 @@ + + + + + + Adding the Replication Framework to + + SimpleTxn + + + + + + + + + + +
    +
    +
    +
    +

    Adding the Replication Framework to + + SimpleTxn +

    +
    +
    +
    +
    +

    + We now use the methods described above to add partial + support to the + + SimpleTxn + example that we presented in + Transactional Application. + That is, in this section we will: +

    +
    +
      +
    • +

      + Enhance our command line options to + accept information of interest to a + replicated application. +

      +
    • +
    • +

      + Configure our environment handle to use + replication and the replication framework. +

      +
    • +
    • +

      + Minimally configure the replication framework. +

      +
    • +
    • +

      + Start replication. +

      +
    • +
    +
    +

    + Note that when we are done with this section, we will be + only partially ready to run the application. Some critical + pieces will be missing; specifically, we will not yet be + handling the differences between a master and a + replica. (We do that in the next chapter). +

    +

    + Also, note that in the following code fragments, additions + and changes to the code are marked in bold. +

    +

    + To begin, we copy the + + SimpleTxn + code to a new file called + RepMgr.cpp. + + + + + Having done that, we must make some significant + changes to our + RepConfigInfo + class because now we will be using it to + maintain a lot more information. + +

    +

    + First, we create a new structure, + RepHostInfoObj, which we use to store + host and port information for all "other" servers + identified to the application via the + -o command line option. This structure + is chain-able, which makes cleaning up at program shutdown + time easier. +

    +
    #include <db_cxx.h>
    +#include <iostream>
    +
    +// Chain-able struct used to store host information.
    +typedef struct RepHostInfoObj{
    +    char* host;
    +    int port;
    +    RepHostInfoObj* next; // used for chaining multiple "other" hosts.
    +} REP_HOST_INFO; 
    +

    + Next, we update our RepConfigInfo class + definition to manage a lot more information and a new method. +

    +
    class RepConfigInfo {
    +public:
    +    RepConfigInfo();
    +    virtual ~RepConfigInfo();
    +
    +    void addOtherHost(char* host, int port);
    +public:
    +    u_int32_t start_policy;
    +    char* home;
    +    bool got_listen_address;
    +    REP_HOST_INFO this_host;
    +    int totalsites;
    +    int priority;
    +    // used to store a set of optional other hosts.
    +    REP_HOST_INFO *other_hosts;
    +}; 
    +

    + Then, we update our constructor to initialize our new variables. +

    +
    RepConfigInfo::RepConfigInfo()
    +{
    +    start_policy = DB_REP_ELECTION;
    +    home = "TESTDIR";
    +    got_listen_address = false;
    +    totalsites = 0;
    +    priority = 100;
    +    other_hosts = NULL;
    +} 
    +

    + Next, we implement our new method, RepConfigInfo::addOtherHost, + which is used to create RepHostInfoObj instances and add them to + the chain of "other" hosts. +

    +
    +        
    +          RepConfigInfo::addOtherHost(char* host, int port)
    +{
    +    REP_HOST_INFO *newinfo;
    +    newinfo = (REP_HOST_INFO*)malloc(sizeof(REP_HOST_INFO));
    +    newinfo->host = host;
    +    newinfo->port = port;
    +    if (other_hosts == NULL) {
    +        other_hosts = newinfo;
    +        newinfo->next = NULL;
    +    } else {
    +        newinfo->next = other_hosts;
    +        other_hosts = newinfo;
    +    }
    +} 
    +        
    +      
    +

    + Having done that, we update our class destructor to release the RepHostInfoObj + chain of objects at class destruction time. +

    +
    RepConfigInfo::~RepConfigInfo()
    +{
    +    // release any other_hosts structs.
    +    if (other_hosts != NULL) {
    +        REP_HOST_INFO *CurItem = other_hosts;
    +        while (CurItem->next != NULL)
    +        {
    +            REP_HOST_INFO *TmpItem = CurItem;
    +            free(CurItem);
    +            CurItem = TmpItem;
    +        }
    +        free(CurItem);
    +    }
    +    other_hosts = NULL;
    +} 
    +

    + Having completed our update to the + RepConfigInfo + + class, we can now start making + changes to the main portion of our program. We begin by changing + the program's name. +

    +
    using std::cout;
    +using std::cin;
    +using std::cerr;
    +using std::endl;
    +using std::flush;
    +                
    +#define CACHESIZE   (10 * 1024 * 1024)
    +#define DATABASE    "quote.db"
    +                
    +const char *progname = "RepMgr"; 
    +

    + Next we update our usage function. The application will continue to + accept the -h parameter so that we can identify + the environment home directory used by this application. However, + we also add the +

    +
    +
      +
    • +

      + -m parameter which allows us to + identify the host and port used by this application to + listen for replication messages. +

      +
    • +
    • +

      + -o parameter which allows us to + specify other replicas. +

      +
    • +
    • +

      + -n parameter which allows us to + identify the number of sites in this replication + group. +

      +
    • +
    • +

      + -p option, which is used to identify + this replica's priority (recall that the priority is + used as a tie breaker for elections) +

      +
    • +
    +
    +
    class RepMgr
    +{
    +public:
    +    // Constructor.
    +    RepMgr();
    +    // Initialization method. Creates and opens our environment handle.
    +    int init(RepConfigInfo* config);
    +    // The doloop is where all the work is performed.
    +    int doloop();
    +    // terminate() provides our shutdown code.
    +    int terminate();
    +
    +private:
    +    // disable copy constructor.
    +    RepMgr(const RepMgr &);
    +    void operator = (const RepMgr &);
    +
    +    // internal data members.
    +    RepConfigInfo   *app_config;
    +    DbEnv           dbenv;
    +
    +    // private methods.
    +    // print_stocks() is used to display the contents of our database.
    +    static int print_stocks(Db *dbp);
    +};
    +
    +static void usage()
    +{
    +    cerr << "usage: " << progname << endl
    +         << "[-h home][-o host:port][-m host:port]"
    +         << "[-n nsites][-p priority]" << endl;
    +
    +    cerr << "\t -m host:port (required; m stands for me)" << endl
    +         << "\t -o host:port (optional; o stands for other; any "
    +         << "number of these may be specified)" << endl
    +         << "\t -h home directory" << endl
    +         << "\t -n nsites (optional; number of sites in replication "
    +         << "group; defaults to 0" << endl
    +         << "\t  in which case we try to dynamically compute the "
    +         << "number of sites in" << endl
    +         << "\t  the replication group)" << endl
    +         << "\t -p priority (optional: defaults to 100)" << endl;
    +
    +    exit(EXIT_FAILURE);
    +} 
    +

    + Now we can begin working on our main() function. + We begin by adding a couple of variables that we will use to + collect TCP/IP host and port information. + + + +

    +
    int main(int argc, char **argv)
    +{
    +    RepConfigInfo config;
    +    char ch, *portstr, *tmphost;
    +    int tmpport;
    +    int ret; 
    +

    + Now we collect our command line arguments. As we do so, we will + configure host and port information as required, and we will + configure the application's election priority if necessary. +

    +
        // Extract the command line parameters
    +    while ((ch = getopt(argc, argv, "h:m:n:o:p:")) != EOF) {
    +        switch (ch) {
    +        case 'h':
    +            config.home = optarg;
    +            break;
    +        case 'm':
    +            config.this_host.host = strtok(optarg, ":");
    +            if ((portstr = strtok(NULL, ":")) == NULL) {
    +                cerr << "Bad host specification." << endl;
    +                usage();
    +            }
    +            config.this_host.port = (unsigned short)atoi(portstr);
    +            config.got_listen_address = true;
    +            break;
    +        case 'n':
    +            config.totalsites = atoi(optarg);
    +            break;
    +        case 'o':
    +            tmphost = strtok(optarg, ":");
    +            if ((portstr = strtok(NULL, ":")) == NULL) {
    +                cerr << "Bad host specification." << endl;
    +                usage();
    +            }
    +            tmpport = (unsigned short)atoi(portstr);
    +            config.addOtherHost(tmphost, tmpport);
    +            break;
    +        case 'p':
    +            config.priority = atoi(optarg);
    +            break;
    +        case '?':
    +        default:
    +            usage();
    +        }
    +    }
    +
    +    // Error check command line.
    +    if ((!config.got_listen_address) || config.home == NULL)
    +        usage(); 
    +

    + Having done that, the remainder of our main() + function is left unchanged: +

    +
        RepMgr runner;
    +    try {
    +        if((ret = runner.init(&config)) != 0)
    +            goto err;
    +        if((ret = runner.doloop()) != 0)
    +            goto err;
    +    } catch (DbException dbe) {
    +        cerr << "Caught an exception during initialization or"
    +            << " processing: " << dbe.what() << endl;
    +    }
    +err:
    +    runner.terminate();
    +    return 0;
    +}  
    +

    + Now we need to update our + RepMgr::init() + + method. Our updates are at first related to configuring + replication. First, we need to update the method so that we can + identify the local site to the environment handle (that is, the site identified by the +-m command line option): +

    +
    RepMgr::RepMgr() : app_config(0), dbenv(0)
    +{
    +}
    +
    +int RepMgr::init(RepConfigInfo *config)
    +{
    +    int ret = 0;
    +
    +    app_config = config;
    +
    +    dbenv.set_errfile(stderr);
    +    dbenv.set_errpfx(progname);
    +
    +    if ((ret = dbenv.repmgr_set_local_site(app_config->this_host.host,
    +        app_config->this_host.port, 0)) != 0) {
    +        cerr << "Could not set listen address to host:port "
    +             << app_config->this_host.host << ":"
    +             << app_config->this_host.port
    +             << "error: " << ret << endl;
    +    } 
    +

    + And we also add code to allow us to identify "other" sites to the environment handle (that is, +the sites that we identify using the -o command line +option). To do this, we iterate over each of the "other" sites provided to +us using the -o command line option, and we add each one +individually in turn: +

    +
        for ( REP_HOST_INFO *cur = app_config->other_hosts; cur != NULL;
    +        cur = cur->next) {
    +        if ((ret = dbenv.repmgr_add_remote_site(cur->host, cur->port,
    +                                                0)) != 0) {
    +                cerr << "could not add site." << endl
    +        }
    +    }  
    +

    + And then we need code to allow us to identify the total number of sites + in this replication group, and to set the environment's priority. +

    +
        if (app_config->totalsites > 0) {
    +        try {
    +            if ((ret = dbenv.rep_set_nsites(app_config->totalsites)) != 0)
    +                dbenv.err(ret, "set_nsites");
    +        } catch (DbException dbe) {
    +            cerr << "rep_set_nsites call failed. Continuing." << endl;
    +        }
    +    } 
    +    dbenv.rep_set_priority(app_config->priority);  
    +

    + + + We can now open our environment. Note that the flags + + + + we use to open the environment are slightly different for a + replicated application than they are for a non-replicated + application. Namely, replication requires the + + DB_INIT_REP flag. + + + +

    +

    + Also, because we are using the replication framework, we must prepare + our environment for threaded usage. For this reason, we also + need the DB_THREAD flag. +

    +
        dbenv.set_cachesize(0, CACHESIZE, 0);
    +    dbenv.set_flags(DB_TXN_NOSYNC, 1);
    +
    +    try {
    +        dbenv.open(app_config->home, 
    +            DB_CREATE | 
    +            DB_RECOVER |
    +            DB_THREAD | 
    +            DB_INIT_REP |
    +            DB_INIT_LOCK | 
    +            DB_INIT_LOG |
    +            DB_INIT_MPOOL | 
    +            DB_INIT_TXN, 
    +            0);
    +    } catch(DbException dbe) {
    +        cerr  << "Caught an exception during DB environment open." << endl
    +              << "Ensure that the home directory is created prior to starting"
    +              << " the application." << endl;
    +        ret = ENOENT;
    +        goto err;
    +    }
    +

    + Finally, we start replication before we exit this method. + Immediately after exiting this method, our application will go into + the + RepMgr::doloop() + + method, which is where + the bulk of our application's work is performed. We update that + method in the next chapter. +

    +
        if ((ret = dbenv.repmgr_start(3, app_config->start_policy)) != 0)
    +        goto err;
    +
    +err:
    +    return ret;
    +} 
    +

    + This completes our replication updates for the moment. We are not as + yet ready to actually run this program; there remains a few + critical pieces left to add to it. However, the work that we + performed in this section represents a solid foundation for the + remainder of our replication work. +

    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/simpleprogramlisting.html b/db/docs/gsg_db_rep/CXX/simpleprogramlisting.html new file mode 100644 index 000000000..40e395005 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/simpleprogramlisting.html @@ -0,0 +1,628 @@ + + + + + + Program Listing + + + + + + + + + +
    +
    +
    +
    +

    Program Listing

    +
    +
    +
    +
    +

    + Our example program is a fairly simple transactional + application. At this early stage of its development, the + application contains no hint that it must be network-aware + so the only command line argument that it takes is one that + allows us to specify the environment home directory. + (Eventually, we will specify things like host names and + ports from the command line). +

    +

    + Note that the application performs all writes under the + protection of a transaction; however, multiple database + operations are not performed per transaction. Consequently, + we simplify things a bit by using autocommit for our + database writes. +

    +

    + Also, this application is single-threaded. It is possible + to write a multi-threaded or multi-process application that + performs replication. That said, the concepts described in + this book are applicable to both single threaded and + multi-threaded applications so nothing + is gained by multi-threading this application other than + distracting complexity. This manual + does, however, identify where care must be taken when + performing replication with a non-single threaded + application. +

    +

    + Finally, remember that transaction processing is not described in + this manual. Rather, see the + Berkeley DB Getting Started with Transaction Processing guide for details on + that topic. +

    +
    +
    +
    +
    +

    + Class: RepConfigInfo + +

    +
    +
    +
    +
    +

    + Before we begin, we present a + class that we will use to maintain useful + information for us. Under normal circumstances, + this class would not be necessary for a simple + transactional example such as this. However, this code will + grow into a replicated example that needs to + track a lot more information for the + application, and so we lay the groundwork for + it here. +

    +

    + The class that we create is called + RepConfigInfo + + and its only purpose at this time is to track + the location of our environment home directory. +

    +
    #include <db_cxx.h>
    +#include <iostream>
    +
    +class RepConfigInfo {
    +public:
    +    RepConfigInfo();
    +    virtual ~RepConfigInfo();
    +
    +public:
    +    char* home;
    +};
    +
    +
    +RepConfigInfo::RepConfigInfo()
    +{
    +    home = "TESTDIR";
    +}
    +
    +RepConfigInfo::~RepConfigInfo()
    +{
    +}  
    +
    +
    +
    +
    +
    +

    Class: RepMgr

    +
    +
    +
    +
    +

    + Our transactional example will + instantiate a class, + RepMgr, that performs + all our work for us. Before we implement our + main() function, we show + the RepMgr class + declaration. +

    +

    + First, we provide some declarations and + definitions that are needed later in + our example: +

    +
    using std::cout;
    +using std::cin;
    +using std::cerr;
    +using std::endl;
    +using std::flush;
    +
    +#define CACHESIZE   (10 * 1024 * 1024)
    +#define DATABASE    "quote.db"
    +
    +const char *progname = "SimpleTxn";  
    +

    + And then we define our RepMgr class: +

    +
    class RepMgr
    +{
    +public:
    +    // Constructor.
    +    RepMgr();
    +    // Initialization method. Creates and opens our environment handle.
    +    int init(RepConfigInfo* config);
    +    // The doloop is where all the work is performed.
    +    int doloop();
    +    // terminate() provides our shutdown code.
    +    int terminate();
    +
    +private:
    +    // disable copy constructor.
    +    RepMgr(const RepMgr &);
    +    void operator = (const RepMgr &);
    +
    +    // internal data members.
    +    RepConfigInfo   *app_config;
    +    DbEnv           dbenv;
    +
    +    // private methods.
    +    // print_stocks() is used to display the contents of our database.
    +    static int print_stocks(Db *dbp);
    +};  
    +

    + Note that we show the implementation of the various + RepMgr methods later in this section. +

    +
    +
    +
    +
    +
    +

    Function: usage()

    +
    +
    +
    +
    +

    + Our usage() is at this + stage of development trivial because we only + have one command line argument to manage. + Still, we show it here for the sake of + completeness. +

    +
    static void usage()
    +{
    +    cerr << "usage: " << progname << endl
    +         << "-h home" << endl;
    +
    +    exit(EXIT_FAILURE);
    +}  
    +
    +
    +
    +
    +
    +

    Function: main()

    +
    +
    +
    +
    +

    + Now we provide our main() + function. This is a trivial function whose only + job is to collect command line information, + then instantiate a RepMgr + object, run it, then terminate it. +

    +

    + We begin by declaring some useful variables. Of + these, note that we instantiate our + RepConfigInfo + object here. Recall that this is used to store + information useful to our code. This class becomes more + interesting later in this book. +

    +
    int main(int argc, char **argv)
    +{
    +    RepConfigInfo config;
    +    char ch;
    +    int ret;  
    +

    + Then we collect our command line information. Again, this is at + this point fairly trivial: +

    +
        // Extract the command line parameters
    +    while ((ch = getopt(argc, argv, "h:")) != EOF) {
    +        switch (ch) {
    +        case 'h':
    +            config.home = optarg;
    +            break;
    +        case '?':
    +        default:
    +            usage();
    +        }
    +    }
    +
    +    // Error check command line.
    +    if (config.home == NULL)
    +        usage();  
    +

    + Now we instantiate and initialize our RepMgr + class, which is what is responsible for doing all our real work. + The RepMgr::init() method creates and + opens our environment handle. +

    +
        RepMgr runner;
    +    try {
    +        if((ret = runner.init(&config)) != 0)
    +            goto err;  
    +

    + Then we call the RepMgr::doloop() + method, which is where the actual transactional work is + performed for this application. +

    +
            if((ret = runner.doloop()) != 0)
    +            goto err;  
    +

    + Finally, catch exceptions and terminate the program: +

    +
        } catch (DbException dbe) {
    +        cerr << "Caught an exception during initialization or"
    +            << " processing: " << dbe.what() << endl;
    +    }
    +err:
    +    runner.terminate();
    +    return 0;
    +}  
    +
    +
    +
    +
    +
    +

    Method: RepMgr::init()

    +
    +
    +
    +
    +

    + The RepMgr::init() + method is used to create and open our environment handle. + For readers familiar with writing transactional + DB applications, there should be no surprises + here. However, we will be adding to this in later + chapters as we roll replication into this example. +

    +

    + First, we show the class constructor + implementation, which is only used to initialize a + few variables: +

    +
    RepMgr::RepMgr() : app_config(0), dbenv(0)
    +{
    +}  
    +

    + We now provide the init() method + implementation. The only thing of interest here is that we specify + DB_TXN_NOSYNC to our environment. This causes + our transactional commits to become non-durable, which is something + that we are doing only because of the nature of our example. +

    +
    int RepMgr::init(RepConfigInfo *config)
    +{
    +    int ret = 0;
    +
    +    app_config = config;
    +
    +    dbenv.set_errfile(stderr);
    +    dbenv.set_errpfx(progname);
    +
    +    /*
    +     * We can now open our environment.
    +     */
    +    dbenv.set_cachesize(0, CACHESIZE, 0);
    +    dbenv.set_flags(DB_TXN_NOSYNC, 1);
    +
    +    try {
    +        dbenv.open(app_config->home, 
    +            DB_CREATE | 
    +            DB_RECOVER |
    +            DB_INIT_LOCK | 
    +            DB_INIT_LOG |
    +            DB_INIT_MPOOL | 
    +            DB_INIT_TXN, 
    +            0);
    +    } catch(DbException dbe) {
    +        cerr << "Caught an exception during DB environment open." << endl
    +            << "Ensure that the home directory is created prior to starting"
    +            << " the application." << endl;
    +        ret = ENOENT;
    +        goto err;
    +    }
    +
    +err:
    +    return ret;
    +}  
    +

    + Finally, we present the RepMgr::terminate() + method here. All this does is close the environment handle. Again, + there should be no surprises here, but we provide the + implementation for the sake of completeness anyway. +

    +
    int RepMgr::terminate()
    +{
    +    try {
    +        dbenv.close(0);
    +    } catch (DbException dbe) {
    +        cerr << "error closing environment: " << dbe.what() << endl;
    +    }
    +    return 0;
    +}  
    +
    +
    +
    +
    +
    +

    Method: RepMgr::doloop()

    +
    +
    +
    +
    +

    + Having written our main() + function and support utility methods, we now implement + our application's + primary data processing method. This + method provides a command prompt at which the + user can enter a stock ticker value and a price for + that value. This information is then entered to the + database. +

    +

    + To display the database, simply enter + return at the prompt. +

    +

    + To begin, we declare a database pointer, + several Dbt variables, and + the usual assortment of variables used for buffers + and return codes. We also initialize all of this. +

    +
    #define BUFSIZE 1024
    +int RepMgr::doloop()
    +{
    +    Db *dbp;
    +    Dbt key, data;
    +    char buf[BUFSIZE], *rbuf;
    +    int ret;
    +
    +    dbp = NULL;
    +    memset(&key, 0, sizeof(key));
    +    memset(&data, 0, sizeof(data));
    +    ret = 0;  
    +

    + Next, we begin the loop and we immediately open our + database if it has not already been opened. Notice that + we specify autocommit when we open the database. In + this case, autocommit is important because we will only + ever write to our database using it. There is no need + for explicit transaction handles and commit/abort code + in this application, because we are not combining + multiple database operations together under a single + transaction. +

    +

    + Autocommit is described in greater detail in the + Berkeley DB Getting Started with Transaction Processing guide. +

    +
        for (;;) {
    +        if (dbp == NULL) {
    +            dbp = new Db(&dbenv, 0);
    +
    +            // Set page size small so page allocation is cheap.
    +            if ((ret = dbp->set_pagesize(512)) != 0)
    +                goto err;
    +
    +            try {
    +                dbp->open(NULL, DATABASE, NULL, DB_BTREE,
    +                    DB_CREATE | DB_AUTO_COMMIT, 0);
    +            } catch(DbException dbe) {
    +                dbenv.err(ret, "DB->open");
    +                throw dbe;
    +            }
    +        }  
    +

    + Now we implement our command prompt. This is a simple and not + very robust implementation of a command prompt. + If the user enters the keywords exit + or quit, the loop is exited and the + application ends. If the user enters nothing and instead simply + presses return, the entire contents of the + database is displayed. We use our + print_stocks() method to display the + database. (That implementation is shown next in this chapter.) +

    +

    + Notice that very little error checking is performed on the data + entered at this prompt. If the user fails to enter at least one + space in the value string, a simple help message is printed and + the prompt is returned to the user. That is the only error + checking performed here. In a real-world application, + at a minimum the application would probably check to ensure + that the price was in fact an integer or float value. + However, in order to keep this example code as simple as + possible, we refrain from implementing a thorough user interface. +

    +
            cout << "QUOTESERVER" ;
    +        cout << "> " << flush;
    +
    +        if (fgets(buf, sizeof(buf), stdin) == NULL)
    +            break;
    +        if (strtok(&buf[0], " \t\n") == NULL) {
    +            switch ((ret = print_stocks(dbp))) {
    +            case 0:
    +                continue;
    +            default:
    +                dbp->err(ret, "Error traversing data");
    +                goto err;
    +            }
    +        }
    +        rbuf = strtok(NULL, " \t\n");
    +        if (rbuf == NULL || rbuf[0] == '\0') {
    +            if (strncmp(buf, "exit", 4) == 0 ||
    +                strncmp(buf, "quit", 4) == 0)
    +                break;
    +            dbenv.errx("Format: TICKER VALUE");
    +            continue;
    +        }  
    +

    + Now we assign data to the Dbts that + we will use to write the new information to the database. +

    +
            key.set_data(buf);
    +        key.set_size((u_int32_t)strlen(buf));
    +
    +        data.set_data(rbuf);
    +        data.set_size((u_int32_t)strlen(rbuf));  
    +

    + Having done that, we can write the new information to the + database. Remember that this application uses autocommit, + so no explicit transaction management is required. Also, + the database is not configured for duplicate records, so + the data portion of a record is overwritten if the provided + key already exists in the database. However, in this case + DB returns DB_KEYEXIST — which + we ignore. +

    +
            if ((ret = dbp->put(NULL, &key, &data, 0)) != 0)
    +        {
    +            dbp->err(ret, "DB->put");
    +            if (ret != DB_KEYEXIST)
    +                goto err;
    +        }
    +    }  
    +

    + Finally, we close our database before returning from the + method. +

    +
    err:    if (dbp != NULL) {
    +        (void)dbp->close(DB_NOSYNC);
    +        cout << "database closed" << endl;
    +        }
    +
    +    return (ret);
    +}  
    +
    +
    +
    +
    +
    +

    + + Method: RepMgr::print_stocks() + +

    +
    +
    +
    +
    +

    + The print_stocks() + + + method + simply takes a database handle, opens a cursor, and uses + it to display all the information it finds in a database. + This is trivial cursor operation that should hold + no surprises for you. We simply provide it here for + the sake of completeness. +

    +

    + If you are unfamiliar with basic cursor operations, + please see the Getting Started with Berkeley DB + guide. +

    +
    int RepMgr::print_stocks(Db *dbp)
    +{
    +    Dbc *dbc;
    +    Dbt key, data;
    +#define MAXKEYSIZE  10
    +#define MAXDATASIZE 20
    +    char keybuf[MAXKEYSIZE + 1], databuf[MAXDATASIZE + 1];
    +    int ret, t_ret;
    +    u_int32_t keysize, datasize;
    +
    +    if ((ret = dbp->cursor(NULL, &dbc, 0)) != 0) {
    +        dbp->err(ret, "can't open cursor");
    +        return (ret);
    +    }
    +
    +    memset(&key, 0, sizeof(key));
    +    memset(&data, 0, sizeof(data));
    +
    +    cout << "\tSymbol\tPrice" << endl
    +        << "\t======\t=====" << endl;
    +
    +    for (ret = dbc->get(&key, &data, DB_FIRST);
    +        ret == 0;
    +        ret = dbc->get(&key, &data, DB_NEXT)) {
    +        keysize = key.get_size() > MAXKEYSIZE ? MAXKEYSIZE : key.get_size();
    +        memcpy(keybuf, key.get_data(), keysize);
    +        keybuf[keysize] = '\0';
    +
    +        datasize = data.get_size() >=
    +            MAXDATASIZE ? MAXDATASIZE : data.get_size();
    +        memcpy(databuf, data.get_data(), datasize);
    +        databuf[datasize] = '\0';
    +
    +        cout << "\t" << keybuf << "\t" << databuf << endl;
    +    }
    +    cout << endl << flush;
    +
    +    if ((t_ret = dbc->close()) != 0 && ret == 0) {
    +        cout << "closed cursor" << endl;
    +        ret = t_ret;
    +    }
    +
    +    switch (ret) {
    +    case 0:
    +    case DB_NOTFOUND:
    +        return (0);
    +    default:
    +        return (ret);
    +    }
    +}  
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/CXX/txnapp.html b/db/docs/gsg_db_rep/CXX/txnapp.html new file mode 100644 index 000000000..c8b12fa93 --- /dev/null +++ b/db/docs/gsg_db_rep/CXX/txnapp.html @@ -0,0 +1,187 @@ + + + + + + Chapter 2. Transactional Application + + + + + + + + + +
    +
    +
    +
    +

    Chapter 2. Transactional Application

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Application Overview + +
    +
    + + Program Listing + +
    +
    +
    +
    + + + Class: RepConfigInfo + + + +
    +
    + + Class: RepMgr + +
    +
    + + Function: usage() + +
    +
    + + Function: main() + +
    +
    + + Method: RepMgr::init() + +
    +
    + + Method: RepMgr::doloop() + +
    +
    + + + + Method: RepMgr::print_stocks() + + + +
    +
    +
    +
    +
    +

    + In this chapter, we build a simple transaction-protected DB + application. Throughout the remainder of this book, we will add + replication to this example. We do this to underscore the concepts + that we are presenting in this book; the first being that you + should start with a working transactional program and then add + replication to it. +

    +

    + Note that this book assumes you already know how to write a + transaction-protected DB application, so we will not be + covering those concepts in this book. To learn how to write a + transaction-protected application, see the + Berkeley DB Getting Started with Transaction Processing guide. +

    +
    +
    +
    +
    +

    Application Overview

    +
    +
    +
    +
    +

    + Our application maintains a stock market quotes database. + This database contains records whose key is the stock + market symbol and whose data is the stock's price. +

    +

    + The application operates by presenting you with a command + line prompt. You then enter the stock symbol and its value, + separated by a space. The application takes this + information, writes it to the database. +

    +

    + To see the contents of the database, simply press + return at the command prompt. +

    +

    + To quit the application, type 'quit' or 'exit' at the + command prompt. +

    +

    + For example, the following illustrates the application's + usage. In it, we use entirely fictitious stock market + symbols and price values. +

    +
    > ./SimpleTxn -h env_home_dir
    +QUOTESERVER> stock1 88
    +QUOTESERVER> stock2 .08
    +QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        stock1  88
    +
    +QUOTESERVER> stock1 88.9
    +QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        stock1  88.9
    +        stock2  .08
    +
    +QUOTESERVER> quit 
    +>
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/Replication-JAVA-GSG.pdf b/db/docs/gsg_db_rep/JAVA/Replication-JAVA-GSG.pdf new file mode 100644 index 000000000..6c612292a Binary files /dev/null and b/db/docs/gsg_db_rep/JAVA/Replication-JAVA-GSG.pdf differ diff --git a/db/docs/gsg_db_rep/JAVA/addfeatures.html b/db/docs/gsg_db_rep/JAVA/addfeatures.html new file mode 100644 index 000000000..223d1d985 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/addfeatures.html @@ -0,0 +1,192 @@ + + + + + + Chapter 5. Additional Features + + + + + + + + + +
    +
    +
    +
    +

    Chapter 5. Additional Features

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Delayed Synchronization + +
    +
    + + Managing Blocking Operations + +
    +
    + + Stop Auto-Initialization + +
    +
    + + Client to Client Transfer + +
    +
    +
    +
    + + Identifying Peers + +
    +
    +
    +
    + + Bulk Transfers + +
    +
    +
    +

    + Beyond the basic functionality that we have discussed so far in + this book, there are several replication features that you + should understand. These are all optional to use, but provide + useful functionality under the right circumstances. +

    +

    + These additional features are: +

    + +
    +
    +
    +
    +

    Delayed Synchronization

    +
    +
    +
    +
    +

    + When a replication group has a new master, all replicas must + synchronize with that master. This means they must ensure + that the contents of their local database(s) are identical + to that contained by the new master. +

    +

    + This synchronization process can result in quite a lot of + network activity. It can also put a large strain on the + master server, especially if is part of a large + replication group or if there is somehow a large difference between + the master's database(s) and the contents of its replicas. +

    +

    + It is therefore possible to delay synchronization for any + replica that discovers it has a new master. You would do + this so as to give the master time to synchronize other + replicas before proceeding with the delayed replicas. +

    +

    + To delay synchronization of a replica environment, you + specify + + + ReplicationConfig.DELAYCLIENT and + true to + Environment.setReplicationConfig(). + To turn off delayed synchronization, specify + false for the + ReplicationConfig.DELAYCLIENT field. + +

    +

    + If you use delayed synchronization, then you must manually + synchronize the replica at some future time. Until you do this, the replica is out of + sync with the master, and it will ignore all database changes forwarded to it from + the master. +

    +

    + You synchronize a delayed replica by calling + + + Environment.syncReplication() + on the replica that has been delayed. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/apioverview.html b/db/docs/gsg_db_rep/JAVA/apioverview.html new file mode 100644 index 000000000..938a33c1f --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/apioverview.html @@ -0,0 +1,227 @@ + + + + + + The Replication APIs + + + + + + + + + +
    +
    +
    +
    +

    The Replication APIs

    +
    +
    +
    +
    +

    + There are two ways that you can choose to implement + replication in your transactional application. The first, + and preferred, mechanism is to use the pre-packaged + replication framework that comes with the + DB distribution. This framework should be sufficient + for most customers. +

    +

    + If for some reason the Replication Framework + does not meet your application's technical requirements, + you will have to use the replication APIs available + through the Berkeley DB library to write your own custom + replication framework. +

    +

    + Both of these approaches are described in slightly greater + detail in this section. The bulk of the chapters later in + this book are dedicated to these two replication + implementation mechanisms. +

    +
    +
    +
    +
    +

    Replication Framework Overview

    +
    +
    +
    +
    +

    + DB's pre-packaged replication framework exists + as a layer on top of the DB library. The replication framework is a + multi-threaded implementation that allows you to easily add + replication to your existing transactional application. + + + You access and manage the replication framework using special + methods and classes designated for its use. + Mostly these are centered around the + Environment + and + EnvironmentConfig + classes. + +

    +

    + The replication framework: +

    +
    +
      +
    • +

      + Provides a multi-threaded communications layer + using pthreads (on Unix-style systems and + similar derivatives such as Mac OS X), or + Windows threads on Microsoft Windows systems. +

      +
    • +
    • +

      + Uses TCP/IP sockets. Network traffic is + handled via threads that handle inbound and + outbound messages. However, each + process uses a single socket + that is shared using select(). +

      +

      + Note that for this reason, the replication framework is + limited to a maximum of 60 replicas (on + Windows) and approximately 1000 replicas (on + Unix and related systems), depending on how + your system is configured. +

      +
    • +
    • +

      + Requires a single process for the master replica. +

      +
    • +
    • +

      + Requires that only one instance of the + environment handle be used. +

      +
    • +
    • +

      + Upon application startup, a master can be + selected either manually or via elections. + After startup time, however, during the course of + normal operations it is possible for the + replication group to need to locate a new master (due + to network or other hardware related problems, + for example) and in this scenario elections are + always used to select the new master. +

      +
    • +
    +
    +

    + If your application has technical requirements that do + not conform to the implementation provided by the + replication framework, you must write a custom + replication framework using the DB replication APIs + directly. See the next section for introductory + details. +

    +
    +
    +
    +
    +
    +

    Replication API Overview

    +
    +
    +
    +
    +

    + The replication API is a series of Berkeley DB library + classes and methods that you can use to build your own + replication infrastructure. You should use the + replication API only if the replication framework does not meet your + application's technical requirements. +

    +

    + To make use of the replication API, you must write your + own networking code. This frees you from the technical + constraints imposed by the replication framework. For example, by + writing your own framework, you can: +

    +
    +
      +
    • +

      + Use a threading package other than + pthreads (Unix) or Windows threads + (Microsoft Windows). This might be interesting + to you if you are using a platform + whose preferred threading package + is something other than (for + example) pthreads, such as is the case for + Sun Microsystem's Solaris operating systems. +

      +
    • +
    • +

      + Implement your own sockets. The + replication framework uses TCP/IP sockets. While + this should be acceptable for the + majority of applications, sometimes + UDP or even raw sockets might be + desired. +

      +
    • +
    • +

      + Write a multi-process master + replica. +

      +
    • +
    +
    +

    + For information on writing a replicated application + using the Berkeley DB replication APIs, see the + Berkeley DB Programmer's Reference Guide. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/bulk.html b/db/docs/gsg_db_rep/JAVA/bulk.html new file mode 100644 index 000000000..a2515ef18 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/bulk.html @@ -0,0 +1,140 @@ + + + + + + Bulk Transfers + + + + + + + + +
    +
    +
    +
    +

    Bulk Transfers

    +
    +
    +
    +
    +

    + By default, messages are sent from the master to replicas as they are generated. + This can degrade replication performance because the various participating + environments must handle a fair amount of network I/O activity. +

    +

    + You can alleviate this problem by configuring your master environment for bulk + transfers. Bulk transfers simply cause replication messages to accumulate in a + buffer until a triggering event occurs. When this event occurs, the entire + contents of the buffer is sent to the replica, thereby eliminating excessive + network I/O. +

    +

    + Note that if you are using replica to replica transfers, then you might want any + replica that can service replication requests to also be configured for bulk + transfers. +

    +

    + The events that result in a bulk transfer of replication messages to a replica + will differ depending on if the transmitting environment is a master or a + replica. +

    +

    + If the servicing environment is a master environment, then bulk a bulk transfer + occurs when: +

    +
    +
      +
    1. +

      + Bulk transfers are configured for the master environment, and +

      +
    2. +
    3. +

      + the message buffer is full or +

      +
    4. +
    5. +

      + a permanent record (for example, a transaction commit or a + checkpoint record) is placed in the buffer for the replica. +

      +
    6. +
    +
    +

    + If the servicing environment is a replica environment (that is, replica to replica + transfers are in use), then a bulk transfer occurs when: +

    +
    +
      +
    1. +

      + Bulk transfers are configured for the transmitting replica, and +

      +
    2. +
    3. +

      + the message buffer is full or +

      +
    4. +
    5. +

      + the replica servicing the request is able to completely satisfy + the request with the contents of the message buffer. +

      +
    6. +
    +
    +

    + To configure bulk transfers, specify + + + + ReplicationConfig.BULK and + true to + Environment.setReplicationConfig(). + To turn off this feature, specify + false for the + ReplicationConfig.BULK field. + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/c2ctransfer.html b/db/docs/gsg_db_rep/JAVA/c2ctransfer.html new file mode 100644 index 000000000..4491d318b --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/c2ctransfer.html @@ -0,0 +1,135 @@ + + + + + + Client to Client Transfer + + + + + + + + + +
    +
    +
    +
    +

    Client to Client Transfer

    +
    +
    +
    +
    +

    + It is possible to use a replica instead of a master to synchronize another + replica. This serves to take the request load off a master that might otherwise + occur if multiple replicas attempted to synchronize with the master at the same + time. +

    +

    + For best results, use this feature combined with the delayed synchronization + feature (see Delayed Synchronization). +

    +

    + For example, suppose your replication group consists of four environments. Upon + application startup, all three replicas will immediately attempt to synchronize + with the master. But at the same time, the master itself might be busy with a heavy + database write load. +

    +

    + To solve this problem, delay synchronization for two of the three replicas. Allow + the third replica to synchronize as normal with the master. Then, start + synchronization for each of the delayed replicas (since this is a manual process, + you can do them one at a time if that best suits your application). + Assuming you have configured replica to replica synchronization correctly, the + delayed replicas will synchronize using the up-to-date replica, rather than using + the master. +

    +

    + When you are using the replication framework, you configure replica to replica synchronization by + declaring one environment to be a peer of another environment. If an + environment is a peer, then + it can be used for synchronization purposes. +

    +
    +
    +
    +
    +

    Identifying Peers

    +
    +
    +
    +
    +

    + You can designate one replica to be a peer of + another, and then use this special + status for permanent message acknowledgments, + and for replica-to-replica synchronization. + You might want to do this if you have + machines that you know are on fast, reliable + network connections and so you are willing to + accept the overhead of waiting for + acknowledgments from those specific machines. +

    +

    + An environment is currently allowed to have only one + peer. +

    +

    + Note that peers are not required to be a + bi-directional. That is, just because machine A + declares machine B to be a peer, that does not mean + machine B must also declare machine A to be a peer. +

    +

    + You declare a peer for the current environment + when you add that environment to the list of known + sites. You do this by + + + constructing a ReplicationHostAddress + object that specifies true for the + isPeer parameter, and + then providing that object to + EnvironmentConfig.replicationManagerAddRemoteSite() + when you add the remote site to the + local replication site. + +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/elections.html b/db/docs/gsg_db_rep/JAVA/elections.html new file mode 100644 index 000000000..8157cf14a --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/elections.html @@ -0,0 +1,227 @@ + + + + + + Holding Elections + + + + + + + + + +
    +
    +
    +
    +

    Holding Elections

    +
    +
    +
    +
    +

    + Finding a master environment is one of the fundamental activities that + every replication replica must perform. Upon startup, the + underlying DB replication code will attempt to + locate a master. If a master cannot be found, then the + environment should initiate an election. +

    +

    + How elections are held depends upon the API that you use to + implement replication. For example, if you are using the + replication framework elections are held transparently without any + input from your application's code. In this case, + DB will determine which environment is the master and which + are replicas. +

    +
    +
    +
    +
    +

    Influencing Elections

    +
    +
    +
    +
    +

    + If you want to control the election process, you can declare + a specific environment to be the master. Note that for the replication framework, + it is only possible to do this at application startup. + Should the master become unavailable during run-time for any + reason, an election is held. The environment that receives + the most number of votes, wins the election and becomes the + master. A machine receives a vote because it has the most + number of log records. +

    +

    + Because ties are possible when elections are held, + it is possible to influence which environment will win + the election. How you do this depends on which API you + are using. In particular, if you are writing a custom replication + layer, then there are a great many ways to manually influence + elections. +

    +

    + One such mechanism is priorities. When votes are + cast during an election, both the number of log records + contained in the environment and + the environment's priority are considered. So given two + environments with the same number of log records, votes + are cast for the environment with the higher priority. +

    +

    + Therefore, if you have a machine that you prefer to + become a master in the event of an election, assign it + a high priority. Assuming that the election is held at + a time when the preferred machine has up-to-date log + records, that machine will win the election. +

    +
    +
    +
    +
    +
    +

    Winning Elections

    +
    +
    +
    +
    +

    + To win an election: +

    +
    +
      +
    1. +

      + There cannot currently be a + master environment. +

      +
    2. +
    3. +

      + The environment must have the most + recent log records. Part of + holding the election is + determining which environments have + the most recent log records. + This process happens + automatically; your code does + not need to involve itself in + this process. +

      +
    4. +
    5. +

      + The environment must receive the most + number of votes from the + replication environments that are + participating in the election. +

      +
    6. +
    +
    +

    + If you are using the replication framework, then in the event of a + tie vote the environment with the highest priority wins + the election. If two or more environments receive the same + number of votes and have the same priority, then + the underlying replication code picks one of the + environments to + be the winner. Which winner will be picked by the + replication code is unpredictable from the + perspective of your application code. +

    +
    +
    +
    +
    +
    +

    Switching Masters

    +
    +
    +
    +
    +

    + To switch masters: +

    +
    +
      +
    1. +

      + Start up the environment that you want + to be master as normal. At this + time it is a replica. Make + sure this environment has a higher + priority than all the other + environments. +

      +
    2. +
    3. +

      + Allow the new environment to run for a + time as a replica. This allows + it to obtain the most recent + copies of the log files. +

      +
    4. +
    5. +

      + Shut down the current master. + This should force an election. + Because the new environment has the + highest priority, it will win + the election, provided it has + had enough time to obtain all + the log records. +

      +
    6. +
    7. +

      + Optionally restart the old + master environment. Because there is + currently a master environment, an + election will not be held and + the old master will now run as + a replica environment. +

      +
    8. +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/electiontimes.html b/db/docs/gsg_db_rep/JAVA/electiontimes.html new file mode 100644 index 000000000..7a39ac11a --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/electiontimes.html @@ -0,0 +1,146 @@ + + + + + + Managing Election Times + + + + + + + + + +
    +
    +
    +
    +

    Managing Election Times

    +
    +
    +
    +
    +

    + Where it comes to elections, there are two timeout + values with which you should be concerned: election + timeouts and election retries. +

    +
    +
    +
    +
    +

    Managing Election Timeouts

    +
    +
    +
    +
    +

    + When a environment calls for an election, it will wait + some amount of time for the other replicas in the + replication group to respond. The amount of time + that the environment will wait before declaring the + election completed is the election timeout. +

    +

    + If the environment hears from all other known replicas before + the election timeout occurs, the election is considered + a success and a master is elected. +

    +

    + If only a subset of replicas respond, then the success + or failure of the election is determined by (1) + how many replicas have responded and (2) the + election policy that is in place at the time. + For example, usually it only takes a simple + majority of replicas to elect a master. If + there are enough votes for a given environment to + meet that standard, then the master has been + elected and the election is considered a + success. +

    +

    + However, upon application startup you can + require that all known replicas must participate in the + election. Or, it is possible that not enough + votes are cast to select a master even with a + simple majority. If either of these conditions + occur when the election timeout value is + reached, the election is considered a failure + and a master is not elected. At this point, + your replication group is operating without a + master, which means that, essentially, + your replicated application has been placed in + read-only mode. +

    +

    + Note, however, that the replication framework will attempt a + new election after a given amount of time has + passed. See the next section for details. +

    +

    + You set the election timeout value using + Environment.setReplicationTimeout(). + You pass this method the + ReplicationTimeoutType.ELECTION_TIMEOUT + constant and a timeout value in microseconds. +

    +
    +
    +
    +
    +
    +

    Managing Election Retry Times

    +
    +
    +
    +
    +

    + In the event that a election fails (see the + previous section), an election will not be + attempted again until the election retry + timeout value has expired. +

    +

    + You set the election timeout value using + Environment.setReplicationTimeout(). + You pass this method the + ReplicationTimeoutType.ELECTION_RETRY + constant and a retry value in microseconds. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/exampledoloop.html b/db/docs/gsg_db_rep/JAVA/exampledoloop.html new file mode 100644 index 000000000..d1da6e978 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/exampledoloop.html @@ -0,0 +1,559 @@ + + + + + + Example Processing Loop + + + + + + + + + +
    +
    +
    +
    +

    Example Processing Loop

    +
    +
    +
    +
    +

    + In this section we take the example + processing loop that we presented in the + previous section and we flesh it out to + provide a more complete example. We do this + by updating the + doloop() + function that our original transaction + application used + + + (see Method: SimpleTxn.doloop()) + to fully support our replicated application. +

    +

    + In the following example code, code that we + add to the original example is presented in + bold. +

    +

    + To begin, we must implement a way to track whether + our application is running as a master or a client. + There are many ways to do this, but in this case + what we will do is extend + com.sleepycat.db.Environment + to carry the information. We do this by creating + the RepQuoteEnvironment + class. +

    +
    +        
    +          package db.repquote;
    +
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +public class RepQuoteEnvironment extends Environment
    +{
    +    private boolean isMaster;
    +
    +    public RepQuoteEnvironment(final java.io.File host,
    +        EnvironmentConfig config)
    +        throws DatabaseException, java.io.FileNotFoundException
    +    {
    +        super(host, config);
    +        isMaster = false;
    +    }
    +
    +    boolean getIsMaster()
    +    {
    +        return isMaster;
    +    }
    +
    +    public void setIsMaster(boolean isMaster)
    +    {
    +        this.isMaster = isMaster;
    +    }
    +} 
    +        
    +      
    +

    + Next, we go to RepQuoteExample.java and + we include the + RepQuoteEnvironment class + as well as the + EventHandler class. We then + cause our RepQuoteExample + class to implement + EventHandler. We also + change our environment handle to be an instance + of RepQuoteEnvironment + instead of Environment. +

    +

    + Note that we also import the + com.sleepycat.db.ReplicationHandleDeadException + class. We will discuss what that exception is + used for a little later in this example. +

    +
    package db.repquote;
    +
    +import java.io.FileNotFoundException;
    +import java.io.BufferedReader;
    +import java.io.InputStreamReader;
    +import java.io.IOException;
    +import java.io.UnsupportedEncodingException;
    +import java.lang.Thread;
    +import java.lang.InterruptedException;
    +
    +import com.sleepycat.db.Cursor;
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.DatabaseType;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.EventHandler;
    +import com.sleepycat.db.LockMode;
    +import com.sleepycat.db.OperationStatus;
    +import com.sleepycat.db.ReplicationHandleDeadException;
    +
    +import db.repquote.RepConfig;
    +import db.repquote.RepQuoteEnvironment
    +
    +public class RepQuoteExample  implements EventHandler
    +{
    +    private RepConfig repConfig;
    +    private RepQuoteEnvironment dbenv; 
    +

    + That done, we can skip the + + + main() method and + our class constructor, because they do not change. + + Instead, we skip down to our + + + init() method + where we take care of opening our environment and setting + the event handler. +

    +

    + To update our init() method, we only need + to do a couple of things. First, we identify the current class as + the event handler. Then, when we open our environment, we + instantiate a RepQuoteEnvironment + class instead of an Environment + class. +

    +
        public int init(RepConfig config)
    +        throws DatabaseException
    +    {
    +        int ret = 0;
    +        appConfig = config;
    +        EnvironmentConfig envConfig = new EnvironmentConfig();
    +        envConfig.setErrorStream(System.err);
    +        envConfig.setErrorPrefix(RepConfig.progname);
    +
    +        envConfig.setReplicationManagerLocalSite(appConfig.getThisHost());
    +        for (ReplicationHostAddress host = appConfig.getFirstOtherHost();
    +            host != null; host = appConfig.getNextOtherHost())
    +        {
    +            envConfig.replicationManagerAddRemoteSite(host);
    +        }
    +
    +        if (appConfig.totalSites > 0)
    +            envConfig.setReplicationNumSites(appConfig.totalSites);
    +        envConfig.setReplicationPriority(appConfig.priority);
    +
    +        envConfig.setReplicationManagerAckPolicy(
    +            ReplicationManagerAckPolicy.ALL);
    +        envConfig.setCacheSize(RepConfig.CACHESIZE);
    +        envConfig.setTxnNoSync(true);
    +
    +        envConfig.setEventHandler(this);
    +
    +        envConfig.setAllowCreate(true);
    +        envConfig.setRunRecovery(true);
    +        envConfig.setThreaded(true);
    +        envConfig.setInitializeReplication(true);
    +        envConfig.setInitializeLocking(true);
    +        envConfig.setInitializeLogging(true);
    +        envConfig.setInitializeCache(true);
    +        envConfig.setTransactional(true);
    +        envConfig.setVerboseReplication(appConfig.verbose);
    +        try {
    +            dbenv = new RepQuoteEnvironment(appConfig.getHome(), envConfig);
    +        } catch(FileNotFoundException e) {
    +            System.err.println("FileNotFound exception: " + e.toString());
    +            System.err.println(
    +                "Ensure that the environment directory is pre-created.");
    +            ret = 1;
    +        }
    +
    +        // start replication manager
    +        dbenv.replicationManagerStart(3, appConfig.startPolicy);
    +        return ret;
    +    } 
    +

    + That done, we need to implement our + handleEvent() method. + This method is required because we are now implementing + com.sleepycat.db.EventHandler. We use this + method to track whether we are operating as a master. +

    +
        public int handleEvent(EventType event)
    +    {
    +        int ret = 0;
    +        if (event == EventType.REP_MASTER)
    +            dbenv.setIsMaster(true);
    +        else if (event == EventType.REP_CLIENT)
    +            dbenv.setIsMaster(false);
    +        else if (event == EventType.REP_NEW_MASTER) {
    +            // ignored for now.
    +        } else {
    +            System.err.println("Unknown event callback received.\n");
    +            ret = 1;
    +        }
    +        return ret;
    +    } 
    +

    + That done, we need to update our + doloop() + + + method. +

    +

    + We begin by updating our DatabaseConfig + instance to determine which options to use, depending on whether the + application is running as a master. +

    +
        public int doloop()
    +        throws DatabaseException
    +    {
    +        Database db = null;
    +
    +        for (;;)
    +        {
    +            if (db == null) {
    +                DatabaseConfig dbconf = new DatabaseConfig();
    +                // Set page size small so page allocation is cheap.
    +                dbconf.setPageSize(512);
    +                dbconf.setType(DatabaseType.BTREE);
    +                if (dbenv.getIsMaster()) {
    +                    dbconf.setAllowCreate(true);
    +                }
    +                dbconf.setTransactional(true); 
    +

    + When we open the database, we modify our error handling to + account for the case where the database does not yet exist. This can + happen if our code is running as a replica and the replication framework has not + yet had a chance to create the databases for us. Recall that replicas never + write to their own databases directly, and so they cannot + create databases on their own. +

    +

    + If we detect that the database does not yet exist, we simply + close the database handle, sleep for a short period of time + and then continue processing. This gives the replication framework a chance to + create the database so that our replica can continue + operations. +

    +
                    try {
    +                    db = dbenv.openDatabase
    +                        (null, RepConfig.progname, null, dbconf);
    +                } catch (java.io.FileNotFoundException e) {
    +                    System.err.println("no stock database available yet.");
    +                    if (db != null) {
    +                        db.close(true);
    +                        db = null;
    +                    }
    +                    try {
    +                        Thread.sleep(RepConfig.SLEEPTIME);
    +                    } catch (InterruptedException ie) {}
    +                    continue;
    +                }
    +            } 
    +

    + Next we modify our prompt, so that if the local process is running + as a replica, we can tell from the shell that the prompt is for a + read-only process. +

    +
                BufferedReader stdin =
    +                new BufferedReader(new InputStreamReader(System.in));
    +
    +            // listen for input, and add it to the database.
    +            System.out.print("QUOTESERVER");
    +            if (!dbenv.getIsMaster())
    +                System.out.print("(read-only)");
    +            System.out.print("> ");
    +            System.out.flush();
    +            String nextline = null;
    +            try {
    +                nextline = stdin.readLine();
    +            } catch (IOException ioe) {
    +                System.err.println("Unable to get data from stdin");
    +                break;
    +            }
    +            String[] words = nextline.split("\\s"); 
    +

    + When we collect data from the prompt, there is a case that says + if no data is entered then show the entire stocks database. + This display is performed by our + print_stocks() + + method + (which has not + required a modification since we first introduced it in + + + + Method: SimpleTxn.printStocks() + ). +

    +

    + When we call + + printStocks(), + we check for a dead replication handle. Dead + replication handles happen whenever a replication election + results in a previously committed transaction becoming + invalid. This is an error scenario caused by a new master having a + slightly older version of the data than the original + master and so all replicas must modify their database(s) to + reflect that of the new master. In this situation, some + number of previously committed transactions may have to be + unrolled. From the replica's perspective, the database + handles should all be closed and then opened again. +

    +
                // A blank line causes the DB to be dumped to stdout.
    +            if (words.length == 0 ||
    +                (words.length == 1 && words[0].length() == 0)) {
    +                try {
    +                    printStocks(db);
    +                } catch (DeadlockException de) {
    +                    continue;
    +                // Dead replication handles are caused by an election
    +                // resulting in a previously committing read becoming
    +                // invalid. Close the db handle and reopen.
    +                } catch (ReplicationHandleDeadException rhde) {
    +                    db.close(true); // close no sync.
    +                    db = null;
    +                    continue;
    +                } catch (DatabaseException e) {
    +                    System.err.println("Got db exception reading " +
    +                        "replication DB: " + e.toString());
    +                    break;
    +                }
    +                continue;
    +            }
    +
    +            if (words.length == 1 &&
    +                (words[0].compareToIgnoreCase("quit") == 0 ||
    +                words[0].compareToIgnoreCase("exit") == 0)) {
    +                break;
    +            } else if (words.length != 2) {
    +                System.err.println("Format: TICKER VALUE");
    +                continue;
    +            } 
    +

    + That done, we need to add a little error checking to our + command prompt to make sure the user is not attempting to + modify the database at a replica. Remember, replicas must never + modify their local databases on their own. This guards against + that happening due to user input at the prompt. +

    +
                if (!dbenv.getIsMaster()) {
    +                System.err.println("Can't update client.");
    +                continue;
    +            }
    +
    +            DatabaseEntry key = new DatabaseEntry(words[0].getBytes());
    +            DatabaseEntry data = new DatabaseEntry(words[1].getBytes());
    +
    +            db.put(null, key, data);
    +        }
    +        if (db != null)
    +            db.close(true);
    +        return 0;
    +    } 
    +

    + With that completed, we are all done updating our application + for replication. + + The only remaining + + + method, printStocks(), + + is unmodified from when we + originally introduced it. For details on that function, see + + + + Method: SimpleTxn.printStocks() + . +

    +
    +
    +
    +
    +

    Running It

    +
    +
    +
    +
    +

    + To run our replicated application, we need to make + sure each participating environment has its own unique + home directory. We can do this by running + each site on a separate networked machine, but that + is not strictly necessary; multiple instances of this + code can run on the same machine provided the + environment home restriction is observed. +

    +

    + To run a process, make sure the environment home + exists and then start the process using the + -h option to specify that + directory. You must also use the -m + option to identify the local host and port that this + process will use to listen for replication messages, and + the -o option to identify the other + processes in the replication group. Finally, use the + -p option to specify a priority. + The process that you designate to have the highest priority will become + the master. +

    +
    > mkdir env1
    +> java db.repquote.RepQuoteExample -h env1 -n 2 -m localhost:8080 \
    +-o localhost:8081 -p 10
    +No stock database yet available.
    +No stock database yet available.  
    +

    + Now, start another process. This time, change the environment + home to something else, use the -m to at + least change the port number the process is listening on, and + use the -o option to identify the host and + port of the other replication process: +

    +
    > mkdir env2
    +> java db.repquote.RepQuoteExample -h env2 -n 2 -m localhost:8081 \
    +-o localhost:8080 -p 20
    +

    + After a short pause, the second process should display the master + prompt: +

    +
    +QUOTESERVER > 
    +

    + And the first process should + display the read-only prompt: +

    +
    +QUOTESERVER (read-only)> 
    +

    + Now go to the master process and give it a couple of stocks and stock + prices: +

    +
    QUOTESERVER> FAKECO 9.87
    +QUOTESERVER> NOINC .23
    +QUOTESERVER> 
    +

    + Then, go to the replica and hit return at the prompt to + see the new values: +

    +
    QUOTESERVER (read-only)> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  9.87
    +        NOINC    .23 
    +QUOTESERVER (read-only)> 
    +

    + Doing the same at the master results in the same thing: +

    +
    QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  9.87
    +        NOINC    .23 
    +QUOTESERVER> 
    +

    + You can change a stock by simply entering the stock value and + new price at the master's prompt: +

    +
    QUOTESERVER> FAKECO 10.01 
    +QUOTESERVER> 
    +

    + Then, go to either the master or the replica to see the updated + database: +

    +
    QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  10.01
    +        NOINC    .23 
    +QUOTESERVER> 
    +

    + And on the replica: +

    +
    QUOTESERVER (read-only)> 
    +        Symbol  Price
    +        ======  =====
    +        FAKECO  10.01
    +        NOINC    .23 
    +QUOTESERVER (read-only)> 
    +

    + Finally, to quit the applications, simply type + quit at both prompts: +

    +
    QUOTESERVER (read-only)> quit
    +> 
    +

    + And on the master as well: +

    +
    QUOTESERVER> quit
    +> 
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/fmwrkconnectretry.html b/db/docs/gsg_db_rep/JAVA/fmwrkconnectretry.html new file mode 100644 index 000000000..6fe429ade --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/fmwrkconnectretry.html @@ -0,0 +1,81 @@ + + + + + + Managing Connection Retries + + + + + + + + + +
    +
    +
    +
    +

    Managing Connection Retries

    +
    +
    +
    +
    +

    + In the event that a communication failure occurs between + two environments in a replication group, the replication framework will wait a set + amount of time before attempting to re-establish the + connection. You can configure this wait value using + + + + + To do so, specify the + DB_REP_CONNECTION_RETRY + flag to the which parameter and then a + retry value in microseconds to the + timeout parameter. + + + + Environment.setReplicationTimeout(). + You pass this method the + ReplicationTimeoutType.CONNECTION_RETRY + constant and a retry value in microseconds. + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/fwrkmasterreplica.html b/db/docs/gsg_db_rep/JAVA/fwrkmasterreplica.html new file mode 100644 index 000000000..d7694c2c6 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/fwrkmasterreplica.html @@ -0,0 +1,270 @@ + + + + + + Chapter 4. Replica versus Master Processes + + + + + + + + + +
    +
    +
    +
    +

    Chapter 4. Replica versus Master Processes

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Determining State + +
    +
    + + Processing Loop + +
    +
    + + Example Processing Loop + +
    +
    +
    +
    + + Running It + +
    +
    +
    +
    +
    +

    + Every environment participating in a replicated application + must know whether it is a master or + replica. The reason for this is + because, simply, the master can modify the database while + replicas cannot. As a result, not only will you open + databases differently depended on whether the environment is + running as a master, but the environment will frequently + behave quit a bit differently depending on whether it + thinks it is operating as the read/write interface for + your database. +

    +

    + Moreover, an environment must also be capable of + gracefully switching between master and replica states. + This means that the environment must be able to detect when + it has switched states. +

    +

    + Not surprisingly, a large part of your application's code + will be tied up in knowing which state a given + environment is in and then in the logic of how to behave depending on + its state. +

    +

    + This chapter shows you how to determine your environment's + state, and it then shows you some sample code on how + an application might behave depending on whether it is a + master or a replica in a replicated application. +

    +
    +
    +
    +
    +

    Determining State

    +
    +
    +
    +
    +

    + In order to determine whether your code is running + as a master or a replica, you must write your + application as an implementation of + com.sleepycat.db.EventHandler. + This class gives you a single method, + handleEvent(), within + which you can detect and respond to various events + that occur in your DB code. +

    +

    + Note that EventHandler + responds to a number of + com.sleepycat.db.EventType + events, only some of which are related to + replication. For replication, the events that we + care about are: +

    +
    +
      +
    • +

      + + EventType.REP_MASTER +

      +

      + The local environment is now a master. +

      +
    • +
    • +

      + + EventType.REP_CLIENT +

      +

      + The local environment is now a replica. +

      +
    • +
    • +

      + + EventType.REP_STARTUPDONE +

      +

      + The replica has completed startup + synchronization and is now + processing log records received + from the master. +

      +
    • +
    • +

      + + EventType.REP_NEWMASTER +

      +

      + An election was held and a new + environment was made a master. However, + the current environment is + not the master. This + event exists so that you can + cause your code to take some + unique action in the event that the + replication groups switches masters. +

      +
    • +
    +
    +

    + Note that these events are raised whenever the + state is established. That is, when the current + environment becomes a client, and that includes + at application startup, the event is raised. + Also, when an election is held and a client is elected to be a + master, then the event occurs. +

    +

    + The EventHandler + implementation is fairly simple. First you detect + the event, and then you record the state change + in some data member maintained in a location that + is convenient to you. +

    +

    + For example: +

    +
    +package db.repquote;
    +
    +// We make our main class an EventHandler implementation
    +...
    +import com.sleepycat.db.EventHandler;
    +...
    +
    +public class MyReplicationClass implements EventHandler
    +{
    +
    +...
    +
    +// Somewhere we provide a data member that is used to track
    +// whether we are a master server. This could be in our main
    +// class, or it could be part of a supporting class.
    +private boolean isMaster;
    +
    +...
    +
    +isMaster = false;
    +
    +...
    +
    +// In the code where we open our environment and start replication,
    +// we must identify the class that is the event handler. In this
    +// example, we are performing this from within the class that 
    +// implements com.sleepycat.db.EventHandler so we identify
    +// "this" class as the event handler
    +envConfig.setEventHandler(this); 
    +

    + That done, we still need to implement the handleEvent + method. This implementation can be fairly trivial. +

    +
        public int handleEvent(EventType event)
    +    {
    +        int ret = 0;
    +        if (event == EventType.REP_MASTER)
    +            dbenv.setIsMaster(true);
    +        else if (event == EventType.REP_CLIENT)
    +            dbenv.setIsMaster(false);
    +        else if (event == EventType.REP_NEW_MASTER) {
    +            // ignored for now.
    +        } else {
    +            System.err.println("Unknown event callback received.\n");
    +            ret = 1;
    +        }
    +        return ret;
    +    } 
    +

    + Of course, this only gives us the current state of the environment. We + still need the code that determines what to do when the environment + changes state and how to behave depending on the state (described + in the next section). +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/fwrkpermmessage.html b/db/docs/gsg_db_rep/JAVA/fwrkpermmessage.html new file mode 100644 index 000000000..7eda5259f --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/fwrkpermmessage.html @@ -0,0 +1,358 @@ + + + + + + Permanent Message Handling + + + + + + + + + +
    +
    +
    +
    +

    Permanent Message Handling

    +
    +
    +
    +
    +

    + As described in Permanent Message Handling, + messages are marked permanent if they contain database + modifications that should be committed at the replica. + DB's replication code decides if it must flush its + transaction logs to disk depending on whether it receives + sufficient permanent message acknowledgments from the + participating replica. More importantly, the thread + performing the transaction commit blocks + until it either receives enough acknowledgments, or the + acknowledgment timeout expires. +

    +

    + The replication framework is fully capable of managing permanent messages + for you if your application requires it (most do). + Almost all of the details of this are handled by the + replication framework for you. However, you do have to set some policies + that tell the replication framework how to handle permanent messages. +

    +

    + There are two things that you have to do: +

    +
    +
      +
    • +

      + Determine how many acknowledgments + must be received by the master. +

      +
    • +
    • +

      + Identify the amount of time that + replicas have to send their + acknowledgments. +

      +
    • +
    +
    +
    +
    +
    +
    +

    Identifying Permanent Message Policies

    +
    +
    +
    +
    +

    + + You identify permanent message policies using the + + + + ReplicationManagerAckPolicy + class which you pass to the environment + using the + EnvironmentConfig.setReplicationManagerAckPolicy + method. + + + Note that you can set permanent message + policies at any time during the life of the + application. +

    +

    + The following permanent message policies are available when you use + the replication framework: +

    +
    +
      +
    • +

      + + ReplicationManagerAckPolicy.NONE +

      +

      + No permanent message acknowledgments are required. If + this policy is selected, permanent message handling is + essentially "turned off." That is, the master will + never wait for replica acknowledgments. In this case, + transaction log data is either flushed or not strictly + depending on the type of commit that is being performed + (synchronous or asynchronous). +

      +
    • +
    • +

      + + ReplicationManagerAckPolicy.ONE +

      +

      + At least one replica must acknowledge the permanent + message within the timeout period. +

      +
    • +
    • +

      + + ReplicationManagerAckPolicy.ONE_PEER +

      +

      + At least one electable peer must acknowledge the permanent + message within the timeout period. + + Note that an + electable peer is simply another + environment that can be elected to be a master (that + is, it has a priority greater than 0). Do not confuse + this with the concept of a peer as used for client to + client transfers. See + Client to Client Transfer + for more information on client to client transfers. +

      +
    • +
    • +

      + + ReplicationManagerAckPolicy.ALL +

      +

      + All environments must acknowledge the message within + the timeout period. This + policy should be selected only if your replication + group has a small number of replicas, and those replicas + are on extremely reliable networks and servers. +

      +

      + When this flag is used, the actual number of + environments that must respond is + determined by the value set for + + + EnvironmentConfig.setReplicationNumSites(). +

      +
    • +
    • +

      + + ReplicationManagerAckPolicy.ALL_PEERS +

      +

      + All electable peers must acknowledge the message within the + timeout period. This + policy should be selected only if your replication + group is small, and its various environments + are on extremely reliable networks and servers. +

      +

      + Note that an + electable peer is simply another + environment that can be elected to be a master (that + is, it has a priority greater than 0). Do not confuse + this with the concept of a peer as used for client to + client transfers. See + Client to Client Transfer + for more information on client to client transfers. +

      +
    • +
    • +

      + + ReplicationManagerAckPolicy.QUORUM +

      +

      + A quorum of electable peers must acknowledge the message within the timeout period. + A quorum is reached when acknowledgments are received from the minimum number + of environments needed to ensure that the record remains durable + if an election is held. That is, the master wants to hear from enough + electable replicas that they have committed the record so that if an election + is held, the master knows the record will exist even if a new master is selected. +

      +

      + Note that an + electable peer is simply another + environment that can be elected to be a master (that + is, it has a priority greater than 0). Do not confuse + this with the concept of a peer as used for client to + client transfers. See + Client to Client Transfer + for more information on client to client transfers. +

      +
    • +
    +
    +

    + By default, a quorum of sites must must acknowledge a permanent + message in order for it considered to have been successfully + transmitted. The actual number of environments that must respond is + calculated using the value set with + + + EnvironmentConfig.setReplicationNumSites(). +

    +
    +
    +
    +
    +
    +

    Setting the Permanent Message Timeout

    +
    +
    +
    +
    +

    + The permanent message timeout represents the + maximum amount of time the committing thread + will block waiting for message + acknowledgments. If sufficient + acknowledgments arrive before this timeout has + expired, the thread continues operations as + normal. However, if this timeout expires, the + committing thread flushes its transaction log + buffer before continuing with normal + operations. +

    +

    + You set the timeout value using + Environment.setReplicationTimeout(). + You pass this method the + ReplicationTimeoutType.ACK_TIMEOUT + constant and a timeout value in microseconds. +

    +

    + For example: +

    +
      dbenv.setReplicationTimeout(ReplicationTimeoutType.ACK_TIMEOUT, 100); 
    +

    + This timeout value can be set at anytime during the + life of the application. +

    +
    +
    +
    +
    +
    +

    Adding a Permanent Message Policy to + + + RepQuoteExample +

    +
    +
    +
    +
    +

    + For illustration purposes, we will now update + + + RepQuoteExample + such that it requires only one acknowledgment from + a replica on transactional commits. Also, we will give + this acknowledgment a 500 microsecond timeout + value. This means that our application's main + thread will block for up to 500 microseconds waiting + for an acknowledgment. If it does not receive at + least one acknowledgment in that amount of time, + DB will flush the transaction logs to disk + before continuing on. +

    +

    + This is a very simple update. We can perform the + entire thing in + + RepQuoteExample.init() + immediately after we set the application's priority + and before we open our environment handle. +

    +
        public int init(RepConfig config)
    +        throws DatabaseException
    +    {
    +        int ret = 0;
    +        appConfig = config;
    +        EnvironmentConfig envConfig = new EnvironmentConfig();
    +        envConfig.setErrorStream(System.err);
    +        envConfig.setErrorPrefix(RepConfig.progname);
    +
    +        envConfig.setReplicationManagerLocalSite(appConfig.getThisHost());
    +        for (ReplicationHostAddress host = appConfig.getFirstOtherHost();
    +            host != null; host = appConfig.getNextOtherHost())
    +        {
    +            envConfig.replicationManagerAddRemoteSite(host);
    +        }
    +
    +        if (appConfig.totalSites > 0)
    +            envConfig.setReplicationNumSites(appConfig.totalSites);
    +        envConfig.setReplicationPriority(appConfig.priority);
    +
    +        envConfig.setReplicationManagerAckPolicy(
    +                ReplicationManagerAckPolicy.ALL);
    +        envConfig.setReplicationTimeout(ReplicationTimeoutType.ACK_TIMEOUT,
    +                500); 
    +
    +        envConfig.setCacheSize(RepConfig.CACHESIZE);
    +        envConfig.setTxnNoSync(true);
    +    ... 
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/gettingStarted.css b/db/docs/gsg_db_rep/JAVA/gettingStarted.css new file mode 100644 index 000000000..c1b4c86b7 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/gettingStarted.css @@ -0,0 +1,41 @@ +body { width: 45em; + margin-left: 3em; + font-family: Arial, Helvetica, sans-serif; + font-size: 11pt; + } + +h2.title { margin-left: -1em; + font-family: Verdana, serif; + font-size: 16pt; + } + +h3.title { font-family: Verdana, serif; + font-size: 14pt; + } + +pre.programlisting { + font-family: monospace; + background-color: #eae8e9; +} + +div.navheader { font-size: 9pt; + width: 60em; + margin-left: -2em; + } + +div.navheader table tr td { font-size: 9pt; } + +div.navfooter { font-size: 9pt; + width: 60em; + margin-left: -2em; + } +div.navfooter table tr td { font-size: 9pt; } + +span.emphasis { font-style: italic; font-size: 9pt;} + +div.appendix div.informaltable { font-size: 9pt; } +div.appendix div.informaltable td { vertical-align: top; } +div.appendix div.informaltable p { margin-top: .25em; } +div.appendix div.informaltable p { margin-bottom: .25em; } + + diff --git a/db/docs/gsg_db_rep/JAVA/index.html b/db/docs/gsg_db_rep/JAVA/index.html new file mode 100644 index 000000000..07402f6b2 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/index.html @@ -0,0 +1,460 @@ + + + + + + Getting Started with Replicated Berkeley DB Applications + + + + + + + +
    +
    +
    +
    +

    Getting Started with Replicated Berkeley DB Applications

    +
    +
    +
    +

    + Legal Notice +

    +

    + This documentation is distributed under an open source license. + You may review the terms of this license at: + http://www.oracle.com/technology/software/products/berkeley-db/htdocs/oslicensing.html + + +

    +

    + Oracle, Berkeley DB, + + + and + Sleepycat are trademarks or registered trademarks of + Oracle Corporation. All rights to these marks are reserved. + No third-party use is permitted without the + express prior written consent of Oracle Corporation. +

    +

    + Java™ and all Java-based marks are a trademark + or registered trademark of Sun Microsystems, + Inc, in the United States and other countries. +

    +

    + To obtain a copy of this document's original source code, please + submit a request to the Oracle Technology Network forum at: + http://forums.oracle.com/forums/forum.jspa?forumID=271 + + +

    +
    +
    +
    +

    9/20/2006

    +
    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Preface + +
    +
    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +
    + + 1. Introduction + +
    +
    +
    +
    + + Overview + +
    +
    +
    +
    + + Replication Environments + +
    +
    + + Replication Databases + +
    +
    + + Communications Layer + +
    +
    + + Selecting a Master + +
    +
    +
    +
    + + Replication Benefits + +
    +
    + + The Replication APIs + +
    +
    +
    +
    + + Replication Framework Overview + +
    +
    + + Replication API Overview + +
    +
    +
    +
    + + Holding Elections + +
    +
    +
    +
    + + Influencing Elections + +
    +
    + + Winning Elections + +
    +
    + + Switching Masters + +
    +
    +
    +
    + + Permanent Message Handling + +
    +
    +
    +
    + + When Not to Manage + Permanent Messages + +
    +
    + + Managing Permanent Messages + +
    +
    + + Implementing Permanent + Message Handling + +
    +
    +
    +
    +
    +
    + + 2. Transactional Application + +
    +
    +
    +
    + + Application Overview + +
    +
    + + Program Listing + +
    +
    +
    +
    + + + + Class: RepConfig + + +
    +
    + + Class: SimpleTxn + +
    +
    + + Method: SimpleTxn.main() + +
    +
    + + Method: SimpleTxn.init() + +
    +
    + + Method: SimpleTxn.doloop() + +
    +
    + + + + + Method: SimpleTxn.printStocks() + + +
    +
    +
    +
    +
    +
    + + 3. The DB Replication Framework + +
    +
    +
    +
    + + + Starting and Stopping Replication + + +
    +
    +
    +
    + + Managing Election Policies + +
    +
    + + Selecting the Number of Threads + +
    +
    +
    +
    + + Adding the Replication Framework to + + + + +
    +
    + + Permanent Message Handling + +
    +
    +
    +
    + + Identifying Permanent Message Policies + +
    +
    + + Setting the Permanent Message Timeout + +
    +
    + + Adding a Permanent Message Policy to + + + RepQuoteExample + + +
    +
    +
    +
    + + Managing Election Times + +
    +
    +
    +
    + + Managing Election Timeouts + +
    +
    + + Managing Election Retry Times + +
    +
    +
    +
    + + Managing Connection Retries + +
    +
    +
    +
    + + 4. Replica versus Master Processes + +
    +
    +
    +
    + + Determining State + +
    +
    + + Processing Loop + +
    +
    + + Example Processing Loop + +
    +
    +
    +
    + + Running It + +
    +
    +
    +
    +
    +
    + + 5. Additional Features + +
    +
    +
    +
    + + Delayed Synchronization + +
    +
    + + Managing Blocking Operations + +
    +
    + + Stop Auto-Initialization + +
    +
    + + Client to Client Transfer + +
    +
    +
    +
    + + Identifying Peers + +
    +
    +
    +
    + + Bulk Transfers + +
    +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/introduction.html b/db/docs/gsg_db_rep/JAVA/introduction.html new file mode 100644 index 000000000..dce03b363 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/introduction.html @@ -0,0 +1,395 @@ + + + + + + Chapter 1. Introduction + + + + + + + + + +
    +
    +
    +
    +

    Chapter 1. Introduction

    +
    +
    +
    +
    + +

    + This book provides a thorough introduction and discussion on + replication as used with Berkeley DB (DB). It begins by offering a + general overview to replication and the benefits it provides. It also + describes the APIs that you use to implement replication, and it + describes architecturally the things that you need to do to your + application code in order to use the replication APIs. Finally, it + discusses the differences in backup and restore strategies that you + might pursue when using replication, especially where it comes to log + file removal. +

    +

    + You should understand the concepts from the + + Berkeley DB Getting Started with Transaction Processing + + + + guide before reading this book. +

    +
    +
    +
    +
    +

    Overview

    +
    +
    +
    +
    +

    + The DB replication APIs allow you to distribute your database + write operations (performed on a read-write master) to one or + more read-only replicas. + For this reason, DB's replication implementation is said to be a + single master, multiple replica replication strategy. +

    +

    + Note that your database write operations can occur only on the + master; any attempt to write to a replica results in an error + being + + raised by + the DB API used to perform the write. +

    +

    + A single replication master and all of its replicas are referred + to as a replication group. While all + members of the replication group can reside on the same + machine, usually each replication participant is placed on a + separate physical machine somewhere on the network. +

    +

    + Note that all replication applications must first be + transactional applications. The data that the master transmits + its replicas are log records that are generated as records are + updated. Upon transactional commit, the master transmits a + transaction record which tells the replicas to commit the + records they previously received from the master. In order for + all of this to work, your replicated application must also be a + transactional application. For this reason, it is + recommended that you write and debug your DB application as + a stand-alone transactional application before introducing the + replication layer to your code. +

    +

    + Finally, be aware that all machines participating in the + replication group must share identical + endianess. Endianess is the byte-order + strategy used by the computing platform to store multibyte + numbers. Berkeley DB is sensitive to byte order and so your + replication infrastructure must be consistent in this area. + We expect to remove this requirement in some future + release of the product. +

    +
    +
    +
    +
    +

    Replication Environments

    +
    +
    +
    +
    +

    + The most important requirement for a replication + participant is that it must use a unique Berkeley DB database + environment independent of all other replication + participants. So while multiple replication participants + can reside on the same physical machine, no two such participants + can share the same environment home directory. +

    +

    + For this reason, technically replication occurs between + unique database environments. So in the strictest sense, + a replication group consists of a master + environment and + one or more replica environments. However, the reality + is that for production code, each such environment will + usually be located on its own unique machine. Consequently, + this manual sometimes talks about replication sites, meaning the + unique combination of environment home directory, host and port that a specific + replication application is using. +

    +

    + There is no DB-specified limit to the number of + environments which can participate in a replication group. + The only limitation here is one of resources — + network bandwidth, for example. +

    +

    + (Note, however, that the replication framework does place a limit on the + number of environments you can use. See + Replication Framework Overview + for details.) +

    +

    + Also, DB's replication implementation requires all + participating environments to be assigned IDs that are + locally unique to the given environment. Depending on the + replication APIs that you choose to use, you may or may not + need to manage this particular detail. +

    +

    + For detailed information on database environments, see + the Berkeley DB Getting Started with Transaction Processing + guide. For more information on environment IDs, see + the Berkeley DB Programmer's Reference Guide. +

    +
    +
    +
    +
    +
    +

    Replication Databases

    +
    +
    +
    +
    +

    + DB's databases are managed and used in exactly the same way + as if you were writing a non-replicated application, with + a couple of caveats. First, the databases maintained in a replicated environment + must reside either in the ENV_HOME + directory, or in the directory identified by the + + + EnvironmentConfig.addDataDir() + method. Unlike non-replication applications, you cannot place your + databases in a subdirectory below these locations. You should + also not use full path names for your databases or + environments as these are likely to break as to replicated + to other machines. +

    +
    +
    +
    +
    +
    +

    Communications Layer

    +
    +
    +
    +
    +

    + In order to transmit database writes to the replication + replicas, DB requires a communications layer. + DB is agnostic as to what this layer should + look like. The only requirement is that it + be capable of passing two opaque data objects and an + environment ID from the master to its replicas without + corruption. +

    +

    + Because replicas are usually placed on different machines on + the network, the communications layer is usually some kind + of a network-aware implementation. Beyond that, its + implementation details are largely up to you. It could use + TCP/IP sockets, for example, or it could use + raw sockets if they perform better for your particular + application. +

    +

    + Note that you may not have to write your own communications + layer. DB provides a replication framework that + includes a fully-functional TCP/IP-based communications layer. + See The Replication APIs + for more information. +

    +

    + See the Berkeley DB Programmer's Reference Guide + for a description of how to + write your own custom replication communications layer. +

    +
    +
    +
    +
    +
    +

    Selecting a Master

    +
    +
    +
    +
    +

    + Every replication group is allowed one and only one + master environment. Almost always, masters are selected by + holding an election. All such + elections are performed by the underlying Berkeley DB + replication code so you have to do very little to + implement them. +

    +

    + When holding an election, replicas "vote" on who should + be the master. Among replicas participating in the + election, the one with the most up-to-date set of log + records will win the election. Note that it's possible + for there to be a tie. When this occurs, priorities are + used to select the master. See + Holding Elections + for details. +

    +

    + For more information on holding and managing elections, + see Holding Elections. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/manageblock.html b/db/docs/gsg_db_rep/JAVA/manageblock.html new file mode 100644 index 000000000..620562e2c --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/manageblock.html @@ -0,0 +1,91 @@ + + + + + + Managing Blocking Operations + + + + + + + + + +
    +
    +
    +
    +

    Managing Blocking Operations

    +
    +
    +
    +
    +

    + When a replica is in the process of synchronizing with its master, all DB + operations are blocked until such a time as the synchronization is completed. + For replicas with a heavy read load, these blocked operations may represent an + unacceptable loss in throughput. +

    +

    + You can configure DB so that it will not block when synchronization is in + process. Instead, the DB operation will fail, + + + + + immediately throwing a + com.sleepycat.db.ReplicationLockoutException + exception. + + When this happens, it is up to your application to your application to determine + what action to take (that is, logging the event, making an appropriate user + response, retrying the operation, and so forth). +

    +

    + To turn off blocking on synchronization, specify + + + ReplicationConfig.NOWAIT and + true to + Environment.setReplicationConfig(). + To turn off this feature, specify + false for the + ReplicationConfig.NOWAIT field. + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/noautoinit.html b/db/docs/gsg_db_rep/JAVA/noautoinit.html new file mode 100644 index 000000000..1a6decd6e --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/noautoinit.html @@ -0,0 +1,89 @@ + + + + + + Stop Auto-Initialization + + + + + + + + + +
    +
    +
    +
    +

    Stop Auto-Initialization

    +
    +
    +
    +
    +

    + As stated in the previous section, when a replication replica is synchronizing + with its master, it will block all DB operations until the synchronization + is completed. You can turn off this behavior (see Managing Blocking Operations), but for replicas that have been out of touch + from their master for a very long time, this may not be enough. +

    +

    + If a replica has been out of touch from its master long enough, it may find that + it is not possible to perform synchronization. When this happens, by default the + master and replica internally decided to completely re-initialize the replica. + This re-initialization involves discarding the replica's current database(s) and + transferring new ones to it from the master. Depending on the size of the master's + databases, this can take a long time, during which time the replica will be + complete non-responsive when it comes to performing database operations. +

    +

    + It is possible that there is a time of the day when it is better to perform a replica + re-initialization. Or, you simply might want to decide to bring the replica up to + speed by restoring it's databases using a hot-backup taken from the master. Either + way, you can decide to prevent automatic-initialization of your replica. To do this + specify + + + ReplicationConfig.NOAUTOINIT and + true to + Environment.setReplicationConfig(). + To turn off this feature, specify + false for the + ReplicationConfig.NOAUTOINIT field. + +

    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/permmessages.html b/db/docs/gsg_db_rep/JAVA/permmessages.html new file mode 100644 index 000000000..9a8747053 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/permmessages.html @@ -0,0 +1,390 @@ + + + + + + Permanent Message Handling + + + + + + + + + +
    +
    +
    +
    +

    Permanent Message Handling

    +
    +
    +
    +
    +

    + Messages received by a replica may be marked with an + special flag that indicates the message is permanent. + Custom replicated applications will receive notification of + this flag via the DB_REP_ISPERM return value + from the + + + method. + + There is no hard requirement that a replication application look for, or + respond to, this return code. However, because robust replicated + applications typically do manage permanent messages, we introduce + the concept here. +

    +

    + A message is marked as being permanent if the message + affects transactional integrity. For example, + transaction commit messages are an example of a message + that is marked permanent. What the application does + about the permanent message is driven by the durability + guarantees required by the application. +

    +

    + For example, consider what the replication framework does when it + has permanent message handling turned on and a + transactional commit record is sent to the replicas. + First, the replicas must transactional-commit the data + modifications identified by the message. And then, upon + a successful commit, the replication framework sends the master a + message acknowledgment. +

    +

    + For the master (again, using the replication framework), things are a little more complicated than + simple message acknowledgment. Usually in a replicated + application, the master commits transactions + asynchronously; that is, the commit operation does not + block waiting for log data to be flushed to disk before + returning. So when a master is managing permanent + messages, it typically blocks the committing thread + immediately before commit() + returns. The thread then waits for acknowledgments from + its replicas. If it receives enough acknowledgments, it + continues to operate as normal. +

    +

    + If the master does not + receive message acknowledgments — or, more likely, it does not receive + enough acknowledgments — the + committing thread flushes its log data to disk and then + continues operations as normal. The master application can + do this because replicas that fail to handle a message, for + whatever reason, will eventually catch up to the master. So + by flushing the transaction logs to disk, the master is + ensuring that the data modifications have made it to + stable storage in one location (its own hard drive). +

    +
    +
    +
    +
    +

    When Not to Manage + Permanent Messages

    +
    +
    +
    +
    +

    + There are two reasons why you might + choose to not implement permanent messages. + In part, these go to why you are using + replication in the first place. +

    +

    + One class of applications uses replication so that + the application can improve transaction + through-put. Essentially, the application chooses a + reduced transactional durability guarantee so as to + avoid the overhead forced by the disk I/O required + to flush transaction logs to disk. However, the + application can then regain that durability + guarantee to a certain degree by replicating the + commit to some number of replicas. +

    +

    + Using replication to improve an application's + transactional commit guarantee is called + replicating to the network. +

    +

    + In extreme cases where performance is of critical + importance to the application, the master might + choose to both use asynchronous commits + and decide not to wait for + message acknowledgments. In this case the master + is simply broadcasting its commit activities to its + replicas without waiting for any sort of a reply. An + application like this might also choose to use + something other than TCP/IP for its network + communications since that protocol involves a fair + amount of packet acknowledgment all on its own. Of + course, this sort of an application should also be + very sure about the reliability of both its network and + the machines that are hosting its replicas. +

    +

    + At the other end of the extreme, there is a + class of applications that use replication + purely to improve read performance. This sort + of application might choose to use synchronous + commits on the master because write + performance there is not of critical + performance. In any case, this kind of an + application might not care to know whether its + replicas have received and successfully handled + permanent messages because the primary storage + location is assumed to be on the master, not + the replicas. +

    +
    +
    +
    +
    +
    +

    Managing Permanent Messages

    +
    +
    +
    +
    +

    + With the exception of a rare breed of + replicated applications, most masters need some + view as to whether commits are occurring on + replicas as expected. At a minimum, this is because + masters will not flush their log buffers unless + they have reason to expect that permanent + messages have not been committed on the + replicas. +

    +

    + That said, it is important to remember that + managing permanent messages involves a fair amount + of network traffic. The messages must be sent to + the replicas and the replicas must then acknowledge + the message. This represents a performance overhead + that can be worsened by congested networks or + outright outages. +

    +

    + Therefore, when managing permanent messages, you + must first decide on how many of your replicas must + send acknowledgments before your master decides + that all is well and it can continue normal + operations. When making this decision, you could + decide that all replicas must + send acknowledgments. But unless you have only one + or two replicas, or you are replicating over a very + fast and reliable network, this policy could prove + very harmful to your application's performance. +

    +

    + Therefore, a common strategy is to wait for an + acknowledgment from a simple majority of replicas. + This ensures that commit activity has occurred on + enough machines that you can be reliably certain + that data writes are preserved across your network. +

    +

    + Remember that replicas that do not acknowledge a + permanent message are not necessarily unable to + perform the commit; it might be that network + problems have simply resulted in a delay at the + replica. In any case, the underlying DB + replication code is written such that a replica that + falls behind the master will eventually take action + to catch up. +

    +

    + Depending on your application, it may be + possible for you to code your permanent message + handling such that acknowledgment must come + from only one or two replicas. This is a + particularly attractive strategy if you are + closely managing which machines are eligible to + become masters. Assuming that you have one or + two machines designated to be a master in the + event that the current master goes down, you + may only want to receive acknowledgments from + those specific machines. +

    +

    + Finally, beyond simple message acknowledgment, you + also need to implement an acknowledgment timeout + for your application. This timeout value is simply + meant to ensure that your master does not hang + indefinitely waiting for responses that will never + come because a machine or router is down. +

    +
    +
    +
    +
    +
    +

    Implementing Permanent + Message Handling

    +
    +
    +
    +
    +

    + How you implement permanent message handling + depends on which API you are using to implement + replication. If you are using the replication framework, then + permanent message handling is configured using + policies that you specify to the framework. In + this case, you can configure your application + to: +

    +
    +
      +
    • +

      + Ignore permanent messages (the master + does not wait for acknowledgments). +

      +
    • +
    • +

      + Require acknowledgments from a + quorum. A quorum is reached when + acknowledgments are received from the + minimum number of electable + replicas needed to ensure that + the record remains durable if + an election is held. +

      +

      + The goal here is to be + absolutely sure the record is + durable. The master wants to + hear from enough electable + replicas that they have + committed the record so that if + an election is held, the master + knows the record will exist even + if a new master is selected. +

      +

      + This is the default policy. +

      +
    • +
    • +

      + Require an acknowledgment from at least one replica. +

      +
    • +
    • +

      + Require acknowledgments from + all replicas. +

      +
    • +
    • +

      + Require an acknowledgment from a + peer. (The replication framework allows you to + designate one environment as a peer of + another). +

      +
    • +
    • +

      + Require acknowledgments from + all peers. +

      +
    • +
    +
    +

    + Note that the replication framework simply flushes its transaction + logs and moves on if a permanent message is not + sufficiently acknowledged. +

    +

    + For details on permanent message handling with the + replication framework, see Permanent Message Handling. +

    +

    + If these policies are not sufficient for your + needs, or if you want your application to take more + corrective action than simply flushing log buffers + in the event of an unsuccessful commit, then you + must use write a custom replication implementation. +

    +

    + For custom replication implementation, messages are + sent from the master to its replica using a + send() callback that you + implement. Note, however, that DB's replication + code automatically sets the permanent + flag for you where appropriate. +

    +

    + If the send() callback returns with a + non-zero status, DB flushes the transaction log + buffers for you. Therefore, you must cause your + send() callback to block waiting + for acknowledgments from your replicas. + As a part of implementing the + send() callback, you implement + your permanent message handling policies. This + means that you identify how many replicas must + acknowledge the message before the callback can + return 0. You must also + implement the acknowledgment timeout, if any. +

    +

    + Further, message acknowledgments are sent from the + replicas to the master using a communications + channel that you implement (the replication code + does not provide a channel for acknowledgments). + So implementing permanent messages means that when + you write your replication communications channel, + you must also write it in such a way as to also + handle permanent message acknowledgments. +

    +

    + For more information on implementing permanent + message handling using a custom replication layer, + see the Berkeley DB Programmer's Reference Guide. +

    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/preface.html b/db/docs/gsg_db_rep/JAVA/preface.html new file mode 100644 index 000000000..909206faa --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/preface.html @@ -0,0 +1,223 @@ + + + + + + Preface + + + + + + + + + +
    +
    +
    +
    +

    Preface

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +

    + This document describes how to write replicated Berkeley DB applications. + The APIs used to implement replication in your application + are described here. This book describes the concepts surrounding replication, the scenarios under which you + might choose to use it, and the architectural requirements that a replication application has over a + transactional application. +

    +

    + This book is aimed at the software engineer responsible for writing a + replicated DB application. +

    +

    + This book assumes that you have already read and understood the + concepts contained in the + Berkeley DB Getting Started with Transaction Processing guide. + +

    +
    +
    +
    +
    +

    Conventions Used in this Book

    +
    +
    +
    +
    +

    + The following typographical conventions are used within in this manual: +

    +

    + Class names are represented in monospaced font, as are method + names. For example: + + "The Environment() + constructor returns an Environment class object." + + +

    +

    + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALL directory." +

    +

    + Program examples are displayed in a monospaced font on a shaded background. + For example: +

    +
    import com.sleepycat.db.DatabaseConfig;
    +
    +...
    +
    +// Allow the database to be created.
    +DatabaseConfig myDbConfig = new DatabaseConfig();
    +myDbConfig.setAllowCreate(true);
    +

    + In some situations, programming examples are updated from one chapter to the next. When + this occurs, the new code is presented in monospaced bold font. For example: +

    +
    import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +
    +...
    +
    +// Allow the database to be created.
    +DatabaseConfig myDbConfig = new DatabaseConfig();
    +myDbConfig.setAllowCreate(true);
    +Database myDb = new Database("mydb.db", null, myDbConfig); 
    +
    +

    Note

    +

    + Finally, notes of special interest are represented using a note block such + as this. +

    +
    +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + transactional DB application: +

    + +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/processingloop.html b/db/docs/gsg_db_rep/JAVA/processingloop.html new file mode 100644 index 000000000..72ee804ad --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/processingloop.html @@ -0,0 +1,215 @@ + + + + + + Processing Loop + + + + + + + + + +
    +
    +
    +
    +

    Processing Loop

    +
    +
    +
    +
    +

    + Typically the central part of any replication application + is some sort of a continuous loop that constantly + checks the state of the environment (whether it is a + replica or a master), opens and/or closes the + databases as is necessary, and performs other useful + work. A loop such as this one must of necessity + take special care to know whether it is operating + on a master or a replica environment because all of its + activities are dependent upon that state. +

    +

    + The flow of activities through the loop will + generally be as follows: +

    +
    +
      +
    1. +

      + Check whether the environment has + changed state. If it has, you + might want to reopen your + database handles, especially if + you opened your replica's + database handles as read-only. + In this case, you might need to + reopen them as read-write. + However, if you always open your + database handles as read-write, + then it is not automatically necessary to + reopen the databases due to a + state change. Instead, you + could check for a + + + ReplicationHandleDeadException + exception + + + when you use your + database handle(s). If you see + this, then you need to reopen + your database handle(s). +

      +
    2. +
    3. +

      + If the databases are closed, + create new database handles, + configure the handle as is + appropriate, and then open the + databases. Note that handle + configuration will be different, + depending on whether the handle + is opened as a replica or a + master. At a minimum, the master + should be opened with database + creation privileges, whereas the + replica does not need to be. You + must also open the master such + that its databases are + read-write. You + can open + replicas with read-only + databases, so long as you are + prepared to closed and the reopen + the handle in the event the + client becomes a master. +

      +

      + Also, note that if the local + environment + is a replica, then it is possible + that databases do not currently + exist. In this case, the database + open attempts will fail. Your + code will have to take this + corner case into account + (described below). +

      +
    4. +
    5. +

      + Once the databases are opened, + check to see if the local + environment is a + master. If it is, do whatever it is + a master should do for your + application. +

      +

      + Remember that the code for your + master should include some way + for you to tell the master + to exit gracefully. +

      +
    6. +
    7. +

      + If the local environment is not a + master, then do whatever it is + your replica environments should do. + Again, like the code for your + master environments, you should provide + a way for your replicas to exit + the processing loop gracefully. +

      +
    8. +
    +
    +

    + The following code fragment illustrates + these points (note that we fill out this + fragment with a working example + next in this chapter): +

    +
    // loop to manage replication activities 
    +public int doloop()
    +{
    +    Database db = null;
    +
    +
    +// Infinite loop. We exit depending on how the master and replica code
    +// is written.
    +for (;;) {
    +    /* If dbp is not opened, we need to open it. */
    +    if (db == null) {
    +         // Create the handle and then configure it. Before you open
    +         // it, you have to decide what open flags to use:
    +         DatabaseConfig dbconf = new DatabaseConfig();
    +         dbconf.setType(DatabaseType.BTREE);
    +         if (isMaster) {
    +            dbconf.setAllowCreate(true);
    +         }
    +
    +         // Now you can open your database handle, passing to it the
    +         // optins selected above. 
    +         
    +         try {
    +            db = dbenv.openDatabase
    +                 (null, progname, null, dbconf);
    +         } catch(java.io.FileNotFoundException e) {
    +                // Put your error handling code here.
    +         }
    +    }
    +
    +     // Now that the databases have been opened, continue with general
    +     // processing, depending on whether we are a master or a replica.
    +     if (isMaster) {
    +         // Do master stuff here. Don't forget to include a way to
    +         // gracefully exit the loop.
    +     } else {
    +         // Do replica stuff here. As is the case with the master
    +         // code, be sure to include a way to gracefully exit the
    +         // loop. 
    +     }
    +} 
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/repadvantage.html b/db/docs/gsg_db_rep/JAVA/repadvantage.html new file mode 100644 index 000000000..c7ab72c1a --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/repadvantage.html @@ -0,0 +1,184 @@ + + + + + + Replication Benefits + + + + + + + + + +
    +
    +
    +
    +

    Replication Benefits

    +
    +
    +
    +
    +

    + + Replication offers your application a number of benefits that + can be a tremendous help. Primarily replication's benefits + revolve around performance, but there is also a benefit in + terms of data durability guarantees. +

    +

    + Briefly, the reasons why you might choose to implement + replication in your DB application are: +

    +
    +
    +
      +
    • +

      + Improved application reliability. +

      +

      + By spreading your data across multiple + machines, you can ensure that your + application's data continues to be + available even in the event of a + hardware failure on any given machine in + the replication group. +

      +
    • +
    +
    +
      +
    • +

      + Improve read performance. +

      +

      + By using replication you can spread data reads across + multiple machines on your network. Doing so allows you + to vastly improve your application's read performance. + This strategy might be particularly interesting for + applications that have readers on remote network nodes; + you can push your data to the network's edges thereby + improving application data read responsiveness. +

      +

      + Additionally, depending on how you partition your + data across your replicas, any given replica may + only need to cache part of your data, decreasing + cache misses and reducing I/O on the client. +

      +
    • +
    • +

      + Improve transactional commit performance +

      +

      + In order to commit a transaction and achieve a + transactional durability guarantee, the commit must be + made durable. That is, the commit + must be written to disk (usually, but not always, + synchronously) before the application's thread of + control can continue operations. +

      +

      + Replication allows you to avoid this disk I/O and still + maintain a degree of durability by committing + to the network. In other words, you relax + your transactional durability guarantees on the master, + but by virtue of replicating the data across the + network you gain some additional durability guarantees + above what is provided locally. +

      +

      + Usually this strategy is implemented using some form of + an asynchronous transactional commit on the master. In + this way your data writes will eventually be written to + disk, but your application will not have to wait for + the disk I/O to complete before continuing with its + next operation. +

      +

      + Note that it is possible to cause DB's replication + implementation to wait to hear from one or + more replica's as to whether they have successfully + saved the write before continuing. However, in this + case you might be trading performance for a even + higher durability guarantee (see below). +

      +
    • +
    • +

      + Improve data durability guarantee. +

      +

      + In a traditional transactional application, you commit your + transactions such that data modifications are saved to + disk. Beyond this, the durability of your data is + dependent upon the backup strategy that you choose to + implement for your site. +

      +

      + Replication allows you to increase this durability + guarantee by ensuring that data modifications are + written to multiple machines. This means that multiple + disks, disk controllers, power supplies, and CPUs are + used to ensure that your data modification makes it to + stable storage. In other words, replication allows you + to minimize the problem of a single point of failure + by using more hardware to guarantee your data writes. +

      +

      + If you are using replication for this reason, then you + probably will want to configure your application such + that it waits to hear about a successful commit from + one or more replicas before continuing with the next + operation. This will obviously impact your + application's write performance to some degree + — with the performance penalty being largely dependent + upon the speed and stability of the network connecting + your replication group. +

      +

      + For more information, see Permanent Message Handling. +

      +
    • +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/repapp.html b/db/docs/gsg_db_rep/JAVA/repapp.html new file mode 100644 index 000000000..63d48f58a --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/repapp.html @@ -0,0 +1,705 @@ + + + + + + Chapter 3. The DB Replication Framework + + + + + + + + + +
    +
    +
    +
    +

    Chapter 3. The DB Replication Framework

    +
    +
    +
    +
    + +

    + The easiest way to add replication to your transactional + application is to use the replication framework. The replication framework provides a comprehensive + communications layer that enables replication. For a brief listing + of the replication framework's feature set, see + Replication Framework Overview. +

    +

    + To use the replication framework, you make use of special methods off the + Environment and + EnvironmentConfig + classes. You also use a series of related classes to perform + your implementation. For example, in order to detect whether + your code is running as a master or a replica, you must + implement com.sleepycat.db.EventHandler. + (see Determining State). + That is: +

    +
    +
      +
    1. +

      + Create an environment handle as normal. +

      +
    2. +
    3. +

      + Configure your environment handle as + needed (e.g. set the error file and + error prefix values, if desired). +

      +
    4. +
    5. +

      + Use the replication framework replication methods to + configure the replication framework. Using these + methods causes DB to know that you + are using the replication framework. +

      +

      + Configuring the replication framework + entails setting its replication + priority, setting the TCP/IP address + that this replication environment will use for + incoming replication messages, identify + TCP/IP addresses of other replication + environments, setting the number of + replication environments in the + replication group, and so forth. These actions are + discussed throughout the remainder of + this chapter. +

      +
    6. +
    7. +

      + Open your environment handle. When you + do this, be sure to specify + + + + + EnvironmentConfig.setInitializeReplication() + when you configure your environment + handle. This is in addition to the + configuration that you would normally + use for a transactional application. + This causes replication to be + initialized for the application. + +

      +
    8. +
    9. +

      + Start replication by calling + + + Environment.replicationManagerStart(). +

      +
    10. +
    11. +

      + Open your databases as needed. Masters + must open their databases for read + and write activity. Replicas can open + their databases for read-only activity, but + doing so means they must re-open the + databases if the replica ever becomes a + master. Either way, replicas should never attempt to + write to the database(s) directly. +

      +
    12. +
    +
    +
    +

    Note

    +

    + The replication framework allows you to only use one + environment handle per process. +

    +
    +

    + When you are ready to shut down your application: +

    +
    +
      +
    1. +

      + Close your databases +

      +
    2. +
    3. +

      + Close your environment. This causes + replication to stop as well. +

      +
    4. +
    +
    +
    +

    Note

    +

    + Before you can use the replication framework, you may have to + enable it in your DB library. This is + not a requirement for + Microsoft Windows systems, or Unix systems that + use pthread mutexes by default. Other systems, + notably BSD and BSD-derived systems (such as + Mac OS X), must enable the replication framework when you + configure the DB build. +

    +

    + You do this by not + disabling replication and by configuring the + library with POSIX threads support. In other + words, replication must be turned on in the + build (it is by default), and POSIX thread + support must be enabled if it is not already by + default. To do this, use the + --enable-pthread_api switch + on the configure script. +

    +

    + For example: +

    +
    ../dist/configure --enable-pthread-api
    +
    +
    +
    +
    +
    +

    + Starting and Stopping Replication +

    +
    +
    +
    +
    +

    + As described above, you introduce replication to an + application by starting with a transactional + application, performing some basic replication + configuration, and then starting replication using + + + Environment.replicationManagerStart(). +

    +

    + You stop replication by closing your environment + cleanly, as is normal for an DB application. +

    +

    + For example, the following code fragment initializes, then + stops and starts replication. Note that other replication + activities are omitted for brevity. +

    +
    +

    Note

    +

    + Note that the following code fragment would be part of a larger + class that must implement + com.sleepycat.db.EventHandler. This + class is used to track state changes between master and + replica. We put off that implementation for the moment, but the + point remains that the following code fragment would be + contained in a method or two that you would include in your + com.sleepycat.db.EventHandler + implementation. +

    +
    +
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.ReplicationHostAddress;
    +import com.sleepycat.db.ReplicationManagerStartPolicy;
    +
    +...
    +    String progname = "example_replication";
    +    String envHome = "TESTDIR";
    +    int cachesize = 10 * 1024 * 1024;
    +
    +    Environment dbenv;
    +    ReplicationHostAddress thisHost;
    +    String listenHost = "mymachine.sleepycat.com";
    +    int listenPort = 8080;
    +
    +    ReplicationHostAddress otherReplica;
    +    String otherHost = "anothermachine.sleepycat.com";
    +    int otherPort = 8081;
    +
    +
    +try {
    +    // Configure the environment handle
    +    EnvironmentConfig envConfig = new EnvironmentConfig();
    +    envConfig.setErrorStream(System.err);
    +    envConfig.setErrorPrefix(progname);
    +    envConfig.setCacheSize(cachesize);
    +    envConfig.setTxnNoSync(true);
    +
    +    // Identify the local replication site. This is the local hostname and 
    +    // port that this replication participant will use to receive 
    +    // incoming replication messages. Note that this can be
    +    // performed only once for the application. It is required.
    +    thisHost = new ReplicationHostAddress(listenHost, listenPort);
    +    envConfig.setReplicationManagerLocalSite(thisHost);
    +
    +    // Set this application's priority. This is used for elections.
    +    // 
    +    // Set this number to a positive integer, or 0 if you do not want
    +    // this site to be able to become a master.
    +    envConfig.setReplicationPriority(100);
    +    // Add a site to the list of replication environments known to 
    +    // this application.
    +    otherReplica = new ReplicationHostAddress(otherHost, otherPort);
    +    envConfig.replicationManagerAddRemoteSite(otherReplica);
    +
    +    // Identify the number of sites in the replication group. This is
    +    // necessary so that elections and permanent message
    +    // handling can be performed correctly.
    +    envConfig.setReplicationNumSites(2);
    +
    +    // Configure the environment's subsystems. Note that we initialize
    +    // replication. This is required.
    +    envConfig.setAllowCreate(true);
    +    envConfig.setRunRecovery(true);
    +    envConfig.setThreaded(true);
    +    envConfig.setInitializeReplication(true);
    +    envConfig.setInitializeLocking(true);
    +    envConfig.setInitializeLogging(true);
    +    envConfig.setInitializeCache(true);
    +    envConfig.setTransactional(true);
    +
    +    // Missing from this is where we set the event handle and the
    +    // acknowledgement policy. We discuss these things later in this 
    +    // book. 
    +
    +    // Open our environment handle.
    +    try {
    +        dbenv = new Environment(envHome, envConfig);
    +    } catch(FileNotFoundException e) {
    +        System.err.println("FileNotFound exception: " + e.toString());
    +        System.err.println(
    +            "Ensure that the environment directory is pre-created.");
    +    }
    +
    +    // Start the replication framework such that it has three threads.
    +    dbenv.replicationManagerStart(3,
    +        ReplicationManagerStartPolicy.REP_ELECTION);
    +
    +    //////////////////////////////////////////////////
    +    // All other application code goes here, including
    +    // database opens.
    +    //////////////////////////////////////////////////
    +
    +} catch (DatabaseException dbe) {
    +    // Error handling goes here
    +}
    +
    +// Close out your application here.
    +try {
    +    // Make sure all your databases are closed.
    +
    +    // Closing your environment stops replication.
    +   dbenv.close();
    +} catch (DatabaseException dbe) {
    +    // Error handling here.
    +}
    +
    +// All done.  
    +
    +
    +
    +
    +

    Managing Election Policies

    +
    +
    +
    +
    +

    + Before continuing, it is worth taking a look at the + + + + + startup election options that you can set for + replication. You set these using the + ReplicationManagerStartPolicy + class that you pass to the + Environment.replicationManagerStart() + method. + + +

    +

    + In the previous example, we specified + + ReplicationManagerStartPolicy.REP_ELECTION + when we started replication. This causes the + application to try to find a master upon startup. If it + cannot, it calls for an election. In the event an + election is held, the environment receiving the most number of + votes will become the master. +

    +

    + There's some important points to make here: +

    +
    +
      +
    • +

      + This + + option + only requires that other + environments in the replication group + participate in the vote. There is no + requirement that + all such + environments participate. In other + words, if an environment + starts up, it can call for an + election, and select a master, even + if all other environment have not yet + joined the replication group. +

      +
    • +
    • +

      + It only requires a simple majority of + participating environments to elect a master. The number of + environments used to calculate the simple + majority is based on the value set for + + + + EnvironmentConfig.setReplicationNumSites(). + + + This is always true of elections held using the replication framework. +

      +
    • +
    • +

      + As always, the environment participating in the election with the most + up-to-date log files is selected as + master. If an environment with better log files + has not yet joined the replication + group, it may not become the master. +

      +
    • +
    +
    +

    + Any one of these points may be enough to cause a + less-than-optimum environment to be selected as master. + Therefore, to give you a better degree of control over + which environment becomes a master at application startup, + the replication framework offers the following start-up + + options: +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    + ReplicationManagerStartPolicy. REP_MASTER + +

    + The application starts up and declares itself to be a master + without calling for an election. It is an error for more + than one environment to start up using this flag, or for + an environment + to use this flag when a master already exists. +

    +

    + Note that no replication group should + ever operate with more than + one master. +

    +

    + In the event that a environment attempts to become a + master when a master already exists, the + replication code will resolve the problem by + holding an election. Note, however, that there + is always a possibility of data loss in the face + of duplicate masters, because once a master is + selected, the environment that loses the election will + have to roll back any transactions committed + until it is in sync with the "real" master. +

    +
    + ReplicationManagerStartPolicy. REP_CLIENT + +

    + The application starts up and declares + itself to be a replica without calling for + an election. Note that the application + can still become a master if a subsequent + application starts up, calls for an + election, and this application is elected + master. +

    +
    + ReplicationManagerStartPolicy. REP_ELECTION + +

    + As described above, the application starts up, + looks for a master, and if one is not found calls + for an election. +

    +
    + ReplicationManagerStartPolicy. REP_FULL_ELECTION + +

    + Identical to + + ReplicationManagerStartPolicy. REP_ELECTION + except that the election requires all + known members of the replication group to + participate. If a given environment has not yet + started but it is included in the + replication group count (using + + + EnvironmentConfig.setReplicationNumSites()) + then a master can not be elected. +

    +
    +
    +
    +
    +
    +
    +
    +

    Selecting the Number of Threads

    +
    +
    +
    +
    +

    + Under the hood, the replication framework is threaded and you can + control the number of threads used to process messages received from + other replicas. The threads that the replication framework uses are: +

    +
    +
      +
    • +

      + Incoming message thread. This thread + receives messages from the site's + socket and passes those messages to + message processing threads (see below) + for handling. +

      +
    • +
    • +

      + Outgoing message thread. Outgoing + are performed in whatever thread + performed a write to the database(s). + That is, the thread that called, for + example, + + + Database.put() + is the thread that writes replication messages + about that fact to the socket. +

      +

      + Note that if this write activity would + cause the thread to be blocked due to + some condition on the socket, the replication framework + will hand the outgoing message to the + incoming message thread, and it will + then write the message to the socket. + This prevents your database write + threads from blocking due to abnormal + network I/O conditions. +

      +
    • +
    • +

      + Message processing threads are + responsible for parsing and then + responding to incoming replication + messages. Typically, a response will + include write activity to your + database(s), so these threads can be + busy performing disk I/O. +

      +
    • +
    +
    +

    + Of these threads, the only ones that you have any + configuration control over are the message processing + threads. In this case, you can determine how many + of these threads you want to run. +

    +

    + It is always a bit of an art to decide on a thread count, + but the short answer is you probably do not need more + than three threads here, and it is likely that one will + suffice. That said, the best thing to do is set your + thread count to a fairly low number and then increase + it if it appears that your application will benefit + from the additional threads. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/repmgr_init_example_c.html b/db/docs/gsg_db_rep/JAVA/repmgr_init_example_c.html new file mode 100644 index 000000000..cc5a06bc4 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/repmgr_init_example_c.html @@ -0,0 +1,529 @@ + + + + + + Adding the Replication Framework to + + + + + + + + + + + + +
    +
    +
    +
    +

    Adding the Replication Framework to + + +

    +
    +
    +
    +
    +

    + We now use the methods described above to add partial + support to the + + + example that we presented in + Transactional Application. + That is, in this section we will: +

    +
    +
      +
    • +

      + Enhance our command line options to + accept information of interest to a + replicated application. +

      +
    • +
    • +

      + Configure our environment handle to use + replication and the replication framework. +

      +
    • +
    • +

      + Minimally configure the replication framework. +

      +
    • +
    • +

      + Start replication. +

      +
    • +
    +
    +

    + Note that when we are done with this section, we will be + only partially ready to run the application. Some critical + pieces will be missing; specifically, we will not yet be + handling the differences between a master and a + replica. (We do that in the next chapter). +

    +

    + Also, note that in the following code fragments, additions + and changes to the code are marked in bold. +

    +

    + To begin, we make some significant changes to our + RepConfig class because we will be + using it to maintain a lot more information that we needed + for our simple transactional example. +

    +

    + We begin by changing our package name and then importing a few new + classes. java.util.Vector is used to + organize a list of "other host" definitions (that is, the host and + port information for the other replication participants known to + this application). We also need a couple of classes used to manage + individual host and port information, as well as replication + startup policy information. +

    +
    package db.repquote;
    +
    +import java.util.Vector;
    +
    +import com.sleepycat.db.ReplicationHostAddress;
    +import com.sleepycat.db.ReplicationManagerStartPolicy;
    +
    +public class RepConfig
    +{ 
    +

    + Next we add considerably to the constants and data members used by + this class. All of this is used to manage information necessary for + replication purposes. We also at this point change the program's + name, since we will be doing that to the main class in our + application a little later in this description. +

    +
        // Constant values used in the RepQuote application.
    +    public static final String progname = "RepQuoteExample";
    +    public static final int CACHESIZE = 10 * 1024 * 1024;
    +    public static final int SLEEPTIME = 5000;
    +
    +    // member variables containing configuration information
    +    public String home; // String specifying the home directory for rep files.
    +    public Vector otherHosts; // stores an optional set of "other" hosts.
    +    public int priority; // priority within the replication group.
    +    public ReplicationManagerStartPolicy startPolicy;
    +    public ReplicationHostAddress thisHost; // The host address to listen to.
    +    // Optional parameter specifying the # of sites in the replication group.
    +    public int totalSites;
    +
    +    // member variables used internally.
    +    private int currOtherHost;
    +    private boolean gotListenAddress;
    +

    + Now we update our class constructor to initialize all of these new + variables: +

    +
        public RepConfig()
    +    {
    +        startPolicy = ReplicationManagerStartPolicy.REP_ELECTION;
    +        home = "TESTDIR";
    +        gotListenAddress = false;
    +        totalSites = 0;
    +        priority = 100;
    +        currOtherHost = 0;
    +        thisHost = new ReplicationHostAddress();
    +        otherHosts = new Vector();
    +    } 
    +

    + Finally, we finish updating this class by providing a series of new + getter and setter methods. These are used primarily for setting a + retrieving host information of interest to our replicated + application: +

    +
        public java.io.File getHome()
    +    {
    +        return new java.io.File(home);
    +    }
    +
    +    public void setThisHost(String host, int port)
    +    {
    +        gotListenAddress = true;
    +        thisHost.port = port;
    +        thisHost.host = host;
    +    }
    +
    +    public ReplicationHostAddress getThisHost()
    +    {
    +        if (!gotListenAddress) {
    +            System.err.println("Warning: no host specified.");
    +            System.err.println("Returning default.");
    +        }
    +        return thisHost;
    +    }
    +
    +    public boolean gotListenAddress() {
    +        return gotListenAddress;
    +    }
    +
    +    public void addOtherHost(String host, int port, boolean peer)
    +    {
    +        ReplicationHostAddress newInfo = 
    +            new ReplicationHostAddress(host, port, peer);
    +        otherHosts.add(newInfo);
    +    }
    +
    +    public ReplicationHostAddress getFirstOtherHost()
    +    {
    +        currOtherHost = 0;
    +        if (otherHosts.size() == 0)
    +            return null;
    +        return (ReplicationHostAddress)otherHosts.get(currOtherHost);
    +    }
    +
    +    public ReplicationHostAddress getNextOtherHost()
    +    {
    +        currOtherHost++;
    +        if (currOtherHost >= otherHosts.size())
    +            return null;
    +        return (ReplicationHostAddress)otherHosts.get(currOtherHost);
    +    }
    +
    +    public ReplicationHostAddress getOtherHost(int i)
    +    {
    +        if (i >= otherHosts.size())
    +            return null;
    +        return (ReplicationHostAddress)otherHosts.get(i);
    +    }
    +} 
    +

    + Having completed our update to the + + RepConfig + class, we can now start making + changes to the main portion of our program. We begin by changing + the program's name. (This, of course, means that we copy our +SimpleTxn code to a file named RepQuoteExample.java.) +

    +
    package db.repquote;
    +                            
    +import java.io.FileNotFoundException;
    +import java.io.BufferedReader;
    +import java.io.InputStreamReader;
    +import java.io.IOException;
    +import java.io.UnsupportedEncodingException;
    +import java.lang.Thread;
    +import java.lang.InterruptedException;
    +
    +import com.sleepycat.db.Cursor;
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.DatabaseType;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.LockMode;
    +import com.sleepycat.db.OperationStatus;
    +import db.repquote.RepConfig;
    +
    +public class RepQuoteExample
    +{
    +    private RepConfig repConfig;
    +    private Environment dbenv; 
    +

    + Next we update our usage function. The application will continue to + accept the -h parameter so that we can identify + the environment home directory used by this application. However, + we also add the +

    +
    +
      +
    • +

      + -m parameter which allows us to + identify the host and port used by this application to + listen for replication messages. +

      +
    • +
    • +

      + -o parameter which allows us to + specify other replicas. +

      +
    • +
    • +

      + -n parameter which allows us to + identify the number of sites in this replication + group. +

      +
    • +
    • +

      + -p option, which is used to identify + this replica's priority (recall that the priority is + used as a tie breaker for elections) +

      +
    • +
    +
    +
    +    public RepQuoteExample()
    +        throws DatabaseException
    +    {
    +        repConfig = null;
    +        dbenv = null;
    +    }
    +
    +    public static void usage()
    +    {
    +        System.err.println("usage: " + repConfig.progname);
    +        System.err.println("[-h home][-o host:port][-m host:port]" +
    +            "[-f host:port][-n nsites][-p priority]");
    +
    +        System.err.println("\t -m host:port (required; m stands for me)\n" +
    +             "\t -o host:port (optional; o stands for other; any " +
    +             "number of these may be specified)\n" +
    +             "\t -h home directory\n" +
    +             "\t -n nsites (optional; number of sites in replication " +
    +             "group; defaults to 0\n" +
    +             "\t    in which case we try to dynamically compute the " +
    +             "number of sites in\n" +
    +             "\t    the replication group)\n" +
    +             "\t -p priority (optional: defaults to 100)\n");
    +
    +        System.exit(1);
    +    } 
    +

    + Now we can begin working on our main() function. + We begin by adding a couple of variables that we will use to + collect TCP/IP host and port information. + + + +

    +
        public static void main(String[] argv)
    +        throws Exception
    +    {
    +        RepConfig config = new RepConfig();
    +        String tmpHost;
    +        int tmpPort = 0; 
    +

    + Now we collect our command line arguments. As we do so, we will + configure host and port information as required, and we will + configure the application's election priority if necessary. +

    +
            // Extract the command line parameters
    +        for (int i = 0; i < argv.length; i++)
    +        {
    +            if (argv[i].compareTo("-h") == 0) {
    +                // home - a string arg.
    +                i++;
    +                config.home = argv[i];
    +           } else if (argv[i].compareTo("-m") == 0) {
    +                // "me" should be host:port
    +                i++;
    +                String[] words = argv[i].split(":");
    +                if (words.length != 2) {
    +                    System.err.println(
    +                        "Invalid host specification host:port needed.");
    +                    usage();
    +                }
    +                try {
    +                    tmpPort = Integer.parseInt(words[1]);
    +                } catch (NumberFormatException nfe) {
    +                    System.err.println("Invalid host specification, " +
    +                        "could not parse port number.");
    +                    usage();
    +                }
    +                config.setThisHost(words[0], tmpPort);
    +            } else if (argv[i].compareTo("-n") == 0) {
    +                i++;
    +                config.totalSites = Integer.parseInt(argv[i]);
    +            } else if (argv[i].compareTo("-o") == 0) {
    +                i++;
    +                String[] words = argv[i].split(":");
    +                if (words.length != 2) {
    +                    System.err.println(
    +                        "Invalid host specification host:port needed.");
    +                    usage();
    +                }
    +                try {
    +                    tmpPort = Integer.parseInt(words[1]);
    +                } catch (NumberFormatException nfe) {
    +                    System.err.println("Invalid host specification, " +
    +                        "could not parse port number.");
    +                    usage();
    +                }
    +                config.addOtherHost(words[0], tmpPort, isPeer);
    +           } else if (argv[i].compareTo("-p") == 0) {
    +                i++;
    +                config.priority = Integer.parseInt(argv[i]);
    +            } else {
    +                System.err.println("Unrecognized option: " + argv[i]);
    +                usage();
    +            }
    +        } 
    +
    +        // Error check command line.
    +        if ((!config.gotListenAddress()) || config.home.length() == 0)
    +            usage(); 
    +

    + Having done that, the remainder of our main() + function is left unchanged, with the exception of a few name changes required by the + new class name: +

    +
            RepQuoteExample runner = null;
    +        try {
    +            runner = new RepQuoteExample();
    +            runner.init(config);
    +
    +            runner.doloop();
    +            runner.terminate();
    +        } catch (DatabaseException dbe) {
    +            System.err.println("Caught an exception during " +
    +                "initialization or processing: " + dbe.toString());
    +            if (runner != null)
    +                runner.terminate();
    +        }
    +            System.exit(0);
    +    } // end main     
    +

    + Now we need to update our + + RepQuoteExample.init() + method. Our updates are at first related to configuring + replication. First, we need to update the method so that we can + identify the local site to the environment handle (that is, the site identified by the +-m command line option): +

    +
        public int init(RepConfig config)
    +        throws DatabaseException
    +    {
    +        int ret = 0;
    +        appConfig = config;
    +        EnvironmentConfig envConfig = new EnvironmentConfig();
    +        envConfig.setErrorStream(System.err);
    +        envConfig.setErrorPrefix(RepConfig.progname);
    +
    +        envConfig.setReplicationManagerLocalSite(appConfig.getThisHost()); 
    +

    + And we also add code to allow us to identify "other" sites to the environment handle (that is, +the sites that we identify using the -o command line +option). To do this, we iterate over each of the "other" sites provided to +us using the -o command line option, and we add each one +individually in turn: +

    +
            for (ReplicationHostAddress host = appConfig.getFirstOtherHost();
    +            host != null; host = appConfig.getNextOtherHost())
    +        {
    +            envConfig.replicationManagerAddRemoteSite(host);
    +        } 
    +

    + And then we need code to allow us to identify the total number of sites + in this replication group, and to set the environment's priority. +

    +
            if (appConfig.totalSites > 0)
    +            envConfig.setReplicationNumSites(appConfig.totalSites);
    +        envConfig.setReplicationPriority(appConfig.priority);  
    +

    + + + + + We can now open our environment. Note that the options + + we use to open the environment are slightly different for a + replicated application than they are for a non-replicated + application. Namely, replication requires the + + + + EnvironmentConfig.setInitializeReplication() option. + +

    +

    + Also, because we are using the replication framework, we must prepare + our environment for threaded usage. For this reason, we also + need the DB_THREAD flag. +

    +
            envConfig.setCacheSize(RepConfig.CACHESIZE);
    +        envConfig.setTxnNoSync(true);
    +
    +        envConfig.setAllowCreate(true);
    +        envConfig.setRunRecovery(true);
    +        envConfig.setInitializeReplication(true);
    +        envConfig.setInitializeLocking(true);
    +        envConfig.setInitializeLogging(true);
    +        envConfig.setInitializeCache(true);
    +        envConfig.setTransactional(true);
    +        try {
    +            dbenv = new Environment(appConfig.getHome(), envConfig);
    +        } catch(FileNotFoundException e) {
    +            System.err.println("FileNotFound exception: " + e.toString());
    +            System.err.println(
    +                "Ensure that the environment directory is pre-created.");
    +            ret = 1;
    +        } 
    +

    + Finally, we start replication before we exit this method. + Immediately after exiting this method, our application will go into + the + + RepQuoteExample.doloop() + method, which is where + the bulk of our application's work is performed. We update that + method in the next chapter. +

    +
            // start replication manager
    +        dbenv.replicationManagerStart(3, appConfig.startPolicy);
    +        return ret;
    +    } 
    +

    + This completes our replication updates for the moment. We are not as + yet ready to actually run this program; there remains a few + critical pieces left to add to it. However, the work that we + performed in this section represents a solid foundation for the + remainder of our replication work. +

    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/simpleprogramlisting.html b/db/docs/gsg_db_rep/JAVA/simpleprogramlisting.html new file mode 100644 index 000000000..f106a191f --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/simpleprogramlisting.html @@ -0,0 +1,564 @@ + + + + + + Program Listing + + + + + + + + + +
    +
    +
    +
    +

    Program Listing

    +
    +
    +
    +
    +

    + Our example program is a fairly simple transactional + application. At this early stage of its development, the + application contains no hint that it must be network-aware + so the only command line argument that it takes is one that + allows us to specify the environment home directory. + (Eventually, we will specify things like host names and + ports from the command line). +

    +

    + Note that the application performs all writes under the + protection of a transaction; however, multiple database + operations are not performed per transaction. Consequently, + we simplify things a bit by using autocommit for our + database writes. +

    +

    + Also, this application is single-threaded. It is possible + to write a multi-threaded or multi-process application that + performs replication. That said, the concepts described in + this book are applicable to both single threaded and + multi-threaded applications so nothing + is gained by multi-threading this application other than + distracting complexity. This manual + does, however, identify where care must be taken when + performing replication with a non-single threaded + application. +

    +

    + Finally, remember that transaction processing is not described in + this manual. Rather, see the + Berkeley DB Getting Started with Transaction Processing guide for details on + that topic. +

    +
    +
    +
    +
    +

    + + Class: RepConfig +

    +
    +
    +
    +
    +

    + Before we begin, we present a + class that we will use to maintain useful + information for us. Under normal circumstances, + this class would not be necessary for a simple + transactional example such as this. However, this code will + grow into a replicated example that needs to + track a lot more information for the + application, and so we lay the groundwork for + it here. +

    +

    + The class that we create is called + + RepConfig + and its only purpose at this time is to track + the location of our environment home directory. +

    +
    package db.simpletxn;
    +
    +public class RepConfig
    +{
    +    // Constant values used in the RepQuote application.
    +    public static final String progname = "SimpleTxn";
    +    public static final int CACHESIZE = 10 * 1024 * 1024;
    +
    +    // member variables containing configuration information
    +    public String home; // String specifying the home directory for 
    +                        // rep files.
    +
    +    public RepConfig()
    +    {
    +        home = "TESTDIR";
    +    }
    +
    +    public java.io.File getHome()
    +    {
    +        return new java.io.File(home);
    +    }
    +
    +}  
    +
    +
    +
    +
    +
    +

    Class: SimpleTxn

    +
    +
    +
    +
    +

    + Our transactional example will + consist of a class, + SimpleTxn, that performs + all our work for us. +

    +

    + First, we provide the package declaration and + then a few import statements that the class + needs. +

    +
    package db.simpletxn;
    +
    +import java.io.FileNotFoundException;
    +import java.io.BufferedReader;
    +import java.io.InputStreamReader;
    +import java.io.IOException;
    +import java.io.UnsupportedEncodingException;
    +
    +import com.sleepycat.db.Cursor;
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.DatabaseType;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.LockMode;
    +import com.sleepycat.db.OperationStatus;
    +import db.simpletxn.RepConfig;
    +
    +public class SimpleTxn
    +{
    +    private RepConfig repConfig;
    +    private Environment dbenv; 
    +

    + Next, we provide our class constructor. This simply initializes our + class data members. +

    +
        public SimpleTxn()
    +        throws DatabaseException
    +    {
    +        repConfig = null;
    +        dbenv = null;
    +    }  
    +

    + And then we provide our usage() method. At + this point, this method has very little to report: +

    +
        public static void usage()
    +    {
    +        System.err.println("usage: " + repConfig.progname);
    +        System.err.println("[-h home]");
    +
    +        System.err.println("\t -h home directory\n");
    +
    +        System.exit(1);
    +    }  
    +
    +
    +
    +
    +
    +

    Method: SimpleTxn.main()

    +
    +
    +
    +
    +

    + Having implemented our + usage() + method, we can jump directly into our + main() + method. This method begins by instantiating a + RepConfig object, and + then collecting the command line arguments so + that it can populate the object with the + appropriate data (just the environment home + directory, at this time): +

    +
        public static void main(String[] argv)
    +        throws Exception
    +    {
    +        RepConfig config = new RepConfig();
    +        // Extract the command line parameters
    +        for (int i = 0; i < argv.length; i++)
    +        {
    +            if (argv[i].compareTo("-h") == 0) {
    +                // home - a string arg.
    +                i++;
    +                config.home = argv[i];
    +            } else {
    +                System.err.println("Unrecognized option: " + argv[i]);
    +                usage();
    +            }
    +        }  
    +

    + And then perform a little sanity checking on the command line + input: +

    +
            // Error check command line.
    +        if (config.home.length() == 0)
    +            usage();  
    +

    + Now we perform the class' work. To begin, we initialize the + object. The init() method actually + opens our environment for us (shown in the next section). +

    +
            SimpleTxn runner = null;
    +        try {
    +            runner = new SimpleTxn();
    +            runner.init(config);  
    +

    + And then we call our doloop() + method. This method is where we perform all our database + activity. See Method: SimpleTxn.doloop() + for it's details. +

    +
                        runner.doloop();  
    +

    + And then, finally terminate the application (which closes our + environment handle) and end the method. +

    +
                runner.terminate();
    +        } catch (DatabaseException dbe) {
    +            System.err.println("Caught an exception during " +
    +                "initialization or processing: " + dbe.toString());
    +            if (runner != null)
    +                runner.terminate();
    +        }
    +            System.exit(0);
    +    } // end main  
    +
    +
    +
    +
    +
    +

    Method: SimpleTxn.init()

    +
    +
    +
    +
    +

    + The SimpleTxn.init() + method is used to open our environment handle. + For readers familiar with writing transactional + DB applications, there should be no surprises + here. However, we will be adding to this in later + chapters as we roll replication into this example. +

    +

    + The only thing worth noting in this method here is that + we relax our transactional durability guarantee for this application. + We do this because the application will eventually be replicated and + so we don't need a high durability guarantee. +

    +
        public int init(RepConfig config)
    +        throws DatabaseException
    +    {
    +        int ret = 0;
    +        repConfig = config;
    +        EnvironmentConfig envConfig = new EnvironmentConfig();
    +        envConfig.setErrorStream(System.err);
    +        envConfig.setErrorPrefix(RepConfig.progname);
    +
    +        envConfig.setCacheSize(RepConfig.CACHESIZE);
    +        envConfig.setTxnNoSync(true);
    +
    +        envConfig.setAllowCreate(true);
    +        envConfig.setRunRecovery(true);
    +        envConfig.setInitializeLocking(true);
    +        envConfig.setInitializeLogging(true);
    +        envConfig.setInitializeCache(true);
    +        envConfig.setTransactional(true);
    +        try {
    +            dbenv = new Environment(repConfig.getHome(), envConfig);
    +        } catch(FileNotFoundException e) {
    +            System.err.println("FileNotFound exception: " + e.toString());
    +            System.err.println(
    +                "Ensure that the environment directory is pre-created.");
    +            ret = 1;
    +        }
    +
    +        return ret;
    +    }  
    +

    + Finally, we present the SimpleTxn.terminate() + method here. All this does is close the environment handle. Again, + there should be no surprises here, but we provide the + implementation for the sake of completeness anyway. +

    +
        public void terminate()
    +        throws DatabaseException
    +    {
    +            dbenv.close();
    +    }  
    +
    +
    +
    +
    +
    +

    Method: SimpleTxn.doloop()

    +
    +
    +
    +
    +

    + We now implement our application's + primary data processing method. This + method provides a command prompt at which the + user can enter a stock ticker value and a price for + that value. This information is then entered to the + database. +

    +

    + To display the database, simply enter + return at the prompt. +

    +

    + To begin, we declare a database pointer: +

    +
        public int doloop()
    +        throws DatabaseException, , UnsupportedEncodingException
    +    {
    +        Database db = null;  
    +

    + Next, we begin the loop and we immediately open our + database if it has not already been opened. +

    +
            for (;;)
    +        {
    +            if (db == null) {
    +                DatabaseConfig dbconf = new DatabaseConfig();
    +                // Set page size small so page allocation is cheap.
    +                dbconf.setPageSize(512);
    +                dbconf.setType(DatabaseType.BTREE);
    +                dbconf.setAllowCreate(true);
    +                dbconf.setTransactional(true);
    +
    +                try {
    +                    db = dbenv.openDatabase(null,           // Txn handle
    +                                        RepConfig.progname, // db filename
    +                                        null,               // db name
    +                                        dbconf);
    +               } catch (FileNotFoundException fnfe) {
    +                 System.err.println("File not found exception" + fnfe.toString());
    +                // Get here only if the environment home directory
    +                // somehow does not exist.
    +               }
    +            }  
    +

    + Now we implement our command prompt. This is a simple and not + very robust implementation of a command prompt. + If the user enters the keywords exit + or quit, the loop is exited and the + application ends. If the user enters nothing and instead simply + presses return, the entire contents of the + database is displayed. We use our + printStocks() method to display the + database. (That implementation is shown next in this chapter.) +

    +

    + Notice that very little error checking is performed on the data + entered at this prompt. If the user fails to enter at least one + space in the value string, a simple help message is printed and + the prompt is returned to the user. That is the only error + checking performed here. In a real-world application, + at a minimum the application would probably check to ensure + that the price was in fact an integer or float value. + However, in order to keep this example code as simple as + possible, we refrain from implementing a thorough user interface. +

    +
                BufferedReader stdin =
    +                new BufferedReader(new InputStreamReader(System.in));
    +
    +            // listen for input, and add it to the database.
    +            System.out.print("QUOTESERVER> ");
    +            System.out.flush();
    +            String nextline = null;
    +            try {
    +                nextline = stdin.readLine();
    +            } catch (IOException ioe) {
    +                System.err.println("Unable to get data from stdin");
    +                break;
    +            }
    +            String[] words = nextline.split("\\s");
    +
    +            // A blank line causes the DB to be dumped to stdout.
    +            if (words.length == 0 ||
    +                (words.length == 1 && words[0].length() == 0)) {
    +                try {
    +                    printStocks(db);
    +                } catch (DatabaseException e) {
    +                    System.err.println("Got db exception reading " +
    +                        "DB: " + e.toString());
    +                    break;
    +                }
    +                continue;
    +            }
    +
    +            if (words.length == 1 &&
    +                (words[0].compareToIgnoreCase("quit") == 0 ||
    +                words[0].compareToIgnoreCase("exit") == 0)) {
    +                break;
    +            } else if (words.length != 2) {
    +                System.err.println("Format: TICKER VALUE");
    +                continue;
    +            }  
    +

    + Now we assign data to the DatabaseEntry + classes that we will use to write the new information to the database. +

    +
                DatabaseEntry key =
    +                    new DatabaseEntry(words[0].getBytes("UTF-8"));
    +            DatabaseEntry data =
    +                    new DatabaseEntry(words[1].getBytes("UTF-8"));  
    +

    + Having done that, we can write the new information to the + database. Remember that because a transaction handle is not + explicitly used, but we did open the database such that it + supports transactions, then autocommit is automatically + used for this database write. +

    +

    + Autocommit is described in the + Berkeley DB Getting Started with Transaction Processing guide. +

    +

    + Also, the database is not configured for duplicate records, so + the data portion of a record is overwritten if the provided + key already exists in the database. However, in this case + DB returns OperationStatus.KEYEXIST — which + we ignore. +

    +
                db.put(null, key, data);  
    +

    + Finally, we close our database before returning from the + method. +

    +
            }
    +        if (db != null)
    +            db.close(true);
    +        return 0;
    +    }  
    +
    +
    +
    +
    +
    +

    + + + Method: SimpleTxn.printStocks() +

    +
    +
    +
    +
    +

    + The + printStocks() + + method + simply takes a database handle, opens a cursor, and uses + it to display all the information it finds in a database. + This is trivial cursor operation that should hold + no surprises for you. We simply provide it here for + the sake of completeness. +

    +

    + If you are unfamiliar with basic cursor operations, + please see the Getting Started with Berkeley DB + guide. +

    +
        public void terminate()
    +        throws DatabaseException
    +    {
    +            dbenv.close();
    +    }
    +
    +    /*
    +     * void return type since error conditions are propagated
    +     * via exceptions.
    +     */
    +    private void printStocks(Database db)
    +        throws DatabaseException
    +    {
    +        Cursor dbc = db.openCursor(null, null);
    +
    +        System.out.println("\tSymbol\tPrice");
    +        System.out.println("\t======\t=====");
    +
    +        DatabaseEntry key = new DatabaseEntry();
    +        DatabaseEntry data = new DatabaseEntry();
    +        OperationStatus ret;
    +        for (ret = dbc.getFirst(key, data, LockMode.DEFAULT);
    +            ret == OperationStatus.SUCCESS;
    +            ret = dbc.getNext(key, data, LockMode.DEFAULT)) {
    +            String keystr = new String
    +                (key.getData(), key.getOffset(), key.getSize());
    +            String datastr = new String
    +                (data.getData(), data.getOffset(), data.getSize());
    +            System.out.println("\t"+keystr+"\t"+datastr);
    +
    +        }
    +        dbc.close();
    +    }
    +} // end class  
    +
    +
    + + + diff --git a/db/docs/gsg_db_rep/JAVA/txnapp.html b/db/docs/gsg_db_rep/JAVA/txnapp.html new file mode 100644 index 000000000..58e675765 --- /dev/null +++ b/db/docs/gsg_db_rep/JAVA/txnapp.html @@ -0,0 +1,182 @@ + + + + + + Chapter 2. Transactional Application + + + + + + + + + +
    +
    +
    +
    +

    Chapter 2. Transactional Application

    +
    +
    +
    +
    + +

    + In this chapter, we build a simple transaction-protected DB + application. Throughout the remainder of this book, we will add + replication to this example. We do this to underscore the concepts + that we are presenting in this book; the first being that you + should start with a working transactional program and then add + replication to it. +

    +

    + Note that this book assumes you already know how to write a + transaction-protected DB application, so we will not be + covering those concepts in this book. To learn how to write a + transaction-protected application, see the + Berkeley DB Getting Started with Transaction Processing guide. +

    +
    +
    +
    +
    +

    Application Overview

    +
    +
    +
    +
    +

    + Our application maintains a stock market quotes database. + This database contains records whose key is the stock + market symbol and whose data is the stock's price. +

    +

    + The application operates by presenting you with a command + line prompt. You then enter the stock symbol and its value, + separated by a space. The application takes this + information, writes it to the database. +

    +

    + To see the contents of the database, simply press + return at the command prompt. +

    +

    + To quit the application, type 'quit' or 'exit' at the + command prompt. +

    +

    + For example, the following illustrates the application's + usage. In it, we use entirely fictitious stock market + symbols and price values. +

    +
    > java db.simpletxn.SimpleTxn -h env_home_dir
    +QUOTESERVER> stock1 88
    +QUOTESERVER> stock2 .08
    +QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        stock1  88
    +
    +QUOTESERVER> stock1 88.9
    +QUOTESERVER> 
    +        Symbol  Price
    +        ======  =====
    +        stock1  88.9
    +        stock2  .08
    +
    +QUOTESERVER> quit 
    +>
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf b/db/docs/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf new file mode 100644 index 000000000..622ee100b Binary files /dev/null and b/db/docs/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf differ diff --git a/db/docs/gsg_txn/C/abortresults.html b/db/docs/gsg_txn/C/abortresults.html new file mode 100644 index 000000000..abf4a86e9 --- /dev/null +++ b/db/docs/gsg_txn/C/abortresults.html @@ -0,0 +1,95 @@ + + + + + + Aborting a Transaction + + + + + + + + + +
    +
    +
    +
    +

    Aborting a Transaction

    +
    +
    +
    +
    +

    + When you abort a transaction, all database modifications performed + under the protection of the transaction are discarded, and all + locks currently held by the transaction are released. In this event, + your data is simply left in the + state that it was in before the transaction began performing data + modifications. +

    +

    + Note that aborting a transaction may result in disk + + I/O if your logs are backed by the filesystem. + + + It is possible that during the course of your transaction, + logging data and/or database + pages + + were written to backing files on disk. For this reason, DB + notes that the abort occurred in its log files so that at a + minimum the database can be brought into a consistent state at + recovery time. +

    +

    + Also, once you have aborted a transaction, the transaction + handle that you used for the transaction is no longer valid. To + perform database activities under the control of a new + transaction, you must obtain a fresh transactional handle. +

    +

    + To abort a transaction, call + DB_TXN->abort(). + + + + +

    +
    + + + diff --git a/db/docs/gsg_txn/C/architectrecovery.html b/db/docs/gsg_txn/C/architectrecovery.html new file mode 100644 index 000000000..d461d9194 --- /dev/null +++ b/db/docs/gsg_txn/C/architectrecovery.html @@ -0,0 +1,446 @@ + + + + + + Designing Your Application for Recovery + + + + + + + + + +
    +
    +
    +
    +

    Designing Your Application for Recovery

    +
    +
    +
    +
    +

    + When building your DB application, you should consider how you will run recovery. If you are building a + single threaded, single process application, it is fairly simple to run recovery when your application first + opens its environment. In this case, you need only decide if you want to run recovery every time you open + your application (recommended) or only some of the time, presumably triggered by a start up option + controlled by your application's user. +

    +

    + However, for multi-threaded and multi-process applications, you need to carefully consider how you will + design your application's startup code so as to run recovery only when it makes sense to do so. +

    +
    +
    +
    +
    +

    Recovery for Multi-Threaded Applications

    +
    +
    +
    +
    +

    + If your application uses only one environment handle, then handling recovery for a multi-threaded + application is no more difficult than for a single threaded application. You simply open the environment + in the application's main thread, and then pass that handle to each of the threads that will be + performing DB operations. We illustrate this with our final example in this book (see + Transaction Example + + + + for more information). +

    +

    + Alternatively, you can have each worker thread open its own environment handle. However, in this case, + designing for recovery is a bit more complicated. +

    +

    + Generally, when a thread performing database operations fails + or hangs, it is frequently best to simply + restart the application and run recovery upon application + startup as normal. However, not all applications can afford + to restart because a single thread has misbehaved. +

    +

    + If you are attempting to continue operations in the face of a misbehaving thread, + then at a minimum recovery must be run if a thread performing database operations fails or hangs. +

    +

    + Remember that recovery clears the environment of all + outstanding locks, including any that might be outstanding + from an aborted thread. If these locks are not cleared, + other threads performing database operations can back up + behind the locks obtained but never cleared by the failed + thread. The result will be an application that hangs + indefinitely. +

    +

    + To run recovery under these circumstances: +

    +
    +
      +
    1. +

      + Suspend or shutdown all other threads performing + database operations. +

      +
    2. +
    3. +

      + Discarding any open environment handles. Note that + attempting to gracefully close these handles may be + asking for trouble; the close can fail if the + environment is already in need of recovery. For + this reason, it is best and easiest to simply discard the handle. +

      +
    4. +
    5. +

      + Open new handles, running recovery as you open + them. + See Normal Recovery for more information. +

      +
    6. +
    7. +

      + Restart all your database threads. +

      +
    8. +
    +
    +

    + A traditional way to handle this activity is to spawn a watcher thread that is responsible for making + sure all is well with your threads, and performing the above actions if not. +

    +

    + However, in the case where each worker thread opens and maintains its own environment handle, recovery + is complicated for two reasons: +

    +
    +
      +
    1. +

      + For some applications and workloads, it might be + worthwhile to give your database threads the + ability to gracefully finalize any on-going + transactions. If this is the case, your + code must be capable of signaling each thread + to halt DB activities and close its + environment. If you simply run recovery against the + environment, your database threads will + detect this and fail in the midst of performing their + database operations. +

      +
    2. +
    3. +

      + Your code must be capable of ensuring only one + thread runs recovery before allowing all other + threads to open their respective environment + handles. Recovery should be single threaded because when + recovery is run against an environment, it is + deleted and then recreated. This will cause all + other processes and threads to "fail" when they + attempt operations against the newly recovered + environment. If all threads run recovery + when they start up, then it is likely that some + threads will fail because the environment that they + are using has been recovered. This will cause the thread to have to re-execute its own recovery + path. At best, this is inefficient and at worst it could cause your application to fall into an + endless recovery pattern. +

      +
    4. +
    +
    +
    +
    +
    +
    +
    +

    Recovery in Multi-Process Applications

    +
    +
    +
    +
    +

    + Frequently, DB applications use multiple processes to interact with the databases. For example, you may + have a long-running process, such as some kind of server, and then a series of administrative tools that + you use to inspect and administer the underlying databases. Or, in some web-based architectures, different + services are run as independent processes that are managed by the server. +

    +

    + In any case, recovery for a multi-process environment is complicated for two reasons: +

    +
    +
      +
    1. +

      + In the event that recovery must be run, you might + want to notify processes interacting with the environment + that recovery is about to occur and give them a + chance to gracefully terminate. Whether it is + worthwhile for you to do this is entirely dependent + upon the nature of your application. Some + long-running applications with multiple processes + performing meaningful work might want to do this. + Other applications with processes performing database + operations that are likely to be harmed by error conditions in other + processes will likely find it to be not worth the + effort. For this latter group, the chances of + performing a graceful shutdown may be low anyway. +

      +
    2. +
    3. +

      + Unlike single process scenarios, it can quickly become wasteful for every process interacting + with the databases to run recovery when it starts up. This is partly because recovery + does take some amount of time to run, but mostly you want to + avoid a situation where your server must + reopen all its environment handles just because you fire up a command line database + administrative utility that always runs recovery. +

      +
    4. +
    +
    +

    + DB offers you two methods by which you can manage recovery for multi-process DB applications. + Each has different strengths and weaknesses, and they are described in the next sections. +

    +
    +
    +
    +
    +

    Effects of Multi-Process Recovery

    +
    +
    +
    +
    +

    + Before continuing, it is worth noting that the following sections describe recovery processes than + can result in one process running recovery while other processes are currently actively performing + database operations. +

    +

    + When this happens, the current database operation will + abnormally fail, indicating a DB_RUNRECOVERY condition. + This means that your application should immediately abandon any database operations that it may have + on-going, discard any environment handles it has opened, and obtain and open new handles. +

    +

    + The net effect of this is that any writes performed by unresolved transactions will be lost. + For persistent applications (servers, for example), the services it provides will also be + unavailable for the amount of time that it takes to complete a recovery and for all participating + processes to reopen their environment handles. +

    +
    +
    +
    +
    +
    +

    Process Registration

    +
    +
    +
    +
    +

    + One way to handle multi-process recovery is for every process to "register" its environment. In + doing so, the process gains the ability to see if any other applications are using the + environment and, if so, whether they have suffered an abnormal termination. If an abnormal + termination is detected, the process runs recovery; otherwise, it does not. +

    +

    + Note that using process registration also ensures that + recovery is serialized across applications. That is, + only one process at a time has a chance to run + recovery. Generally this means that the first process + to start up will run recovery, and all other processes + will silently not run recovery because it is not + needed. +

    +

    + To cause your application to register its environment, you specify + + the DB_REGISTER flag when you open your environment. + Note that you must also specify DB_RECOVER or + DB_RECOVER_FATAL for your environment open. + + + + If during the open, DB determines that recovery must be run, this indicates the type of + recovery that is run. If you do not specify either type of recovery, then no recovery is run if + the registration process identifies a need for it. In this case, the environment open simply + fails by + returning DB_RUNRECOVERY. + +

    +

    + Be aware that there are some limitations/requirements if you want your various processes to + coordinate recovery using this registration process: +

    +
    +
      +
    1. +

      + There can be only one environment handle per + environment per process. In the case of multi-threaded + processes, the environment handle must be shared across threads. +

      +
    2. +
    3. +

      + All processes sharing the environment must use registration. If registration is + not uniformly used across all participating processes, then you can see inconsistent results + in terms of your application's ability to recognize that recovery must be run. +

      +
    4. +
    5. +

      + You can not use this mechanism with the failchk() + mechanism + described in the next section. +

      +
    6. +
    +
    +
    +
    +
    +
    +
    +

    Failure Checking

    +
    +
    +
    +
    +

    + For very large and robust multi-process applications, the most common way to ensure all the + processes are working as intended is to make use of a watchdog process. To assist a watchdog + process, DB offers a failure checking mechanism. +

    +

    + When a thread of control fails with open environment handles, the result is that there may be + resources left locked or corrupted. Other threads of control may encountered these unavailable resources + quickly or not at all, depending on data access patterns. +

    +

    + In any case, the DB failure checking mechanism allows a watchdog to detect if an environment is + unusable as a result of a thread of control failure. It should be called periodically + (for example, once a minute) from the watchdog process. If the environment is deemed unusable, then + the watchdog process is notified that recovery should be run. It is then up to the watchdog to + actually run recovery. It is also the watchdog's responsibility to decide what to do about currently + running processes before running recovery. The watchdog could, for example, attempt to + gracefully shutdown or kill all relevant processes before running recovery. +

    +

    + Note that failure checking need not be run from a separate process, although conceptually that is + how the mechanism is meant to be used. This same mechanism could be used in a multi-threaded + application that wants to have a watchdog thread. +

    +

    + To use failure checking you must: +

    +
    +
      +
    1. +

      + + Provide an is_alive() call back using the + DB_ENV->set_isalive() + + method. + + + DB uses this method to determine whether a specified process and thread + is alive when the failure checking is performed. +

      +
    2. +
    3. +

      + Possibly provide a + + + thread_id callback + + + + + that uniquely identifies a process + and thread of control. This + callback + + is only necessary if the standard process and thread + identification functions for your platform are not sufficient to for use by failure + checking. This is rarely necessary and is usually because the thread and/or process ids + used by your system cannot fit into an unsigned integer. +

      +

      + You provide this callback using the + DB_ENV->set_thread_id() + + method. See the API reference for this method for more information on when setting a thread + id callback might be necessary. +

      +
    4. +
    5. +

      + Call the + DB_ENV->failchk() + + + method periodically. You can do this either periodically (once per minute, for example), or + whenever a thread of control exits for your application. +

      +

      + If this method determines that a thread of control exited holding read locks, those locks + are automatically released. If the thread of control exited with an unresolved transaction, + that transaction is aborted. If any other problems exist beyond these such that the + environment must be recovered, the method will + return DB_RUNRECOVERY. + +

      +
    6. +
    +
    +

    + Note that this mechanism should not be mixed with the process registration method of multi-process + recovery described in the previous section. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/autocommit.html b/db/docs/gsg_txn/C/autocommit.html new file mode 100644 index 000000000..4ae0787f0 --- /dev/null +++ b/db/docs/gsg_txn/C/autocommit.html @@ -0,0 +1,223 @@ + + + + + + Auto Commit + + + + + + + + + +
    +
    +
    +
    +

    Auto Commit

    +
    +
    +
    +
    +

    + While transactions are frequently used to provide atomicity to + multiple database operations, it is sometimes necessary to perform + a single database operation under the control of a transaction. + Rather than force you to obtain a transaction, perform the single + write operation, and then either commit or abort the transaction, + you can automatically group this sequence of events using + auto commit. +

    +

    + To use auto commit: +

    +
    +
      +
    1. +

      + Open your environment and your databases so that they support + transactions. See Enabling Transactions + for details. +

      +

      + Note that frequently auto commit is used for the environment + or database open. To use auto commit for either your + environment or database open, specify + DB_AUTO_COMMIT to the + + DB_ENV->set_flags() + + or + DB->open() + + method. If you specify auto commit for the environment + open, then you do not need to also specify auto commit + for the database open. +

      +
    2. +
    3. +

      + Do not provide a transactional handle to the method that is + performing the database write operation. +

      +
    4. +
    +
    +

    + Note that auto commit is not available for cursors. You must always + open your cursor using a transaction if you want the cursor's + operations to be transactional protected. See + Transactional Cursors for details on using + transactional cursors. +

    +

    + For example, the following uses auto commit to perform the database write operation: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    DBT key, data;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    const char *keystr ="thekey";
    +    const char *datastr = "thedata";
    +    
    +    dbp = NULL;
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE |    /* Create the environment if it does 
    +                                * not already exist. */
    +                DB_INIT_TXN  | /* Initialize transactions */
    +                DB_INIT_LOCK | /* Initialize locking. */
    +                DB_INIT_LOG  | /* Initialize logging */
    +                DB_INIT_MPOOL; /* Initialize the in-memory cache. */
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database creation failed");
    +        goto err;
    +    }
    +
    +    db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    /* 
    +     * Open the database. Note that we are using auto commit for the open, 
    +     * so the database is able to support transactions.
    +     */
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    db_flags,   /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database '%s' open failed",
    +            file_name);
    +        goto err;
    +    }
    +
    +    /* Prepare the DBTs */
    +    memset(&key, 0, sizeof(DBT));
    +    memset(&data, 0, sizeof(DBT));
    +
    +    key.data = &keystr;
    +    key.size = strlen(keystr) + 1;
    +    data.data = &datastr;
    +    data.size = strlen(datastr) + 1;
    +
    +
    +    /*
    +     * Perform the database write. A txn handle is not provided, but the
    +     * database support auto commit, so auto commit is used for the write.
    +     */
    +    ret = dbp->put(dbp, NULL, &key, &data, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database put failed.");
    +        goto err;
    +    }
    +
    +err:
    +    /* Close the database */
    +    if (dbp != NULL) {
    +        ret_c = dbp->close(dbp, 0);
    +        if (ret_c != 0) {
    +            envp->err(envp, ret_c, "Database close failed.");
    +            ret = ret_c
    +        }
    +    }
    +
    +
    +    /* Close the environment */
    +    if (envp != NULL) {
    +        ret_c = envp->close(envp, 0);
    +        if (ret_c != 0) {
    +            fprintf(stderr, "environment close failed: %s\n",
    +                db_strerror(ret_c));
    +            ret = ret_c;
    +        }
    +    }
    +
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +} 
    +
    + + + diff --git a/db/docs/gsg_txn/C/backuprestore.html b/db/docs/gsg_txn/C/backuprestore.html new file mode 100644 index 000000000..f9ae32bd7 --- /dev/null +++ b/db/docs/gsg_txn/C/backuprestore.html @@ -0,0 +1,341 @@ + + + + + + Backup Procedures + + + + + + + + + +
    +
    +
    +
    +

    Backup Procedures

    +
    +
    +
    +
    +

    + Durability is an important part of your + transactional guarantees. It means that once a transaction has been + successfully committed, your application will always see the results of that + transaction. +

    +

    + Of course, no software algorithm can guarantee durability in the face of physical data loss. Hard drives + can fail, and if you have not copied your data to locations other than your primary disk drives, + then you will lose data when those drives fail. Therefore, in order to truly obtain a durability + guarantee, you need to ensure that any data stored on disk is backed up to secondary or alternative storage, + such as secondary disk drives, or offline tapes. +

    +

    + There are three different types of backups that you can + perform with DB databases and log files. They are: +

    +
    +
      +
    • +

      + Offline backups +

      +

      + This type of backup is perhaps the easiest to perform as it + involves simply copying database and log files to an + offline storage area. It also gives you a snapshot of the + database at a fixed, known point in time. However, you + cannot perform this type of a backup while you are performing + writes to the database. +

      +
    • +
    • +

      + Hot backups +

      +

      + This type of backup gives you a snapshot of your database. + Since your application can be writing to the database at the time that the + snapshot is being taken, you do not necessarily know what + the exact state of the database is for that given snapshot. +

      +
    • +
    • +

      + Incremental backups +

      +

      + This type of backup refreshes a previously performed backup. +

      +
    • +
    +
    +

    + Once you have performed a backup, you can + perform catastrophic recovery to restore + your databases from the backup. See + Catastrophic Recovery + for more information. +

    +

    + Note that you can also maintain a hot failover. See + Using Hot Failovers + for more information. +

    +
    +
    +
    +
    +

    About Unix Copy Utilities

    +
    +
    +
    +
    +

    + + If you are copying database files you must copy databases atomically, + in multiples of the database page size. In other words, the reads made by + the copy program must not be interleaved with writes by + other threads of control, and the copy program must read the + databases in multiples of the underlying database page size. + Generally, this is not a problem because operating systems + already make this guarantee and system utilities normally + read in power-of-2 sized chunks, which are larger than the + largest possible Berkeley DB database page size. +

    +

    + On some platforms (most notably, some releases of Solaris), the copy utility (cp) was + implemented using the mmap() system call rather than the + read() system call. Because mmap() did not make the same + guarantee of read atomicity as did read(), the cp utility + could create corrupted copies of the databases. +

    +

    + Also, some platforms have implementations of the tar utility that performs 10KB block + reads by default. Even when an output block size is specified, the utility will still not read the + underlying databases in multiples of the specified block size. Again, the result can be a corrupted backup. +

    +

    + To fix these problems, use the dd utility instead of cp or + tar. When you use dd, make sure you specify a block size that is + equal to, or an even multiple of, your database page size. Finally, if you plan to use a system + utility to copy database files, you may want to use a system call trace utility (for example, + ktrace or truss) to make sure you are not using a I/O size that is + smaller than your database page size. You can also use these utilities to make sure the system utility is + not using a system call other than read(). +

    +
    +
    +
    +
    +
    +

    Offline Backups

    +
    +
    +
    +
    +

    + To create an offline backup: +

    +
    +
      +
    1. +

      + Commit or abort all on-going transactions. +

      +
    2. +
    3. +

      + Pause all database writes. +

      +
    4. +
    5. +

      + Force a checkpoint. See + Checkpoints + for details. +

      +
    6. +
    7. +

      + Copy all your database files to the backup location. + + Note that you can simply copy all of the database + files, or you can determine which database files + have been written during the lifetime of the current + logs. To do this, use either the + + DB_ENV->log_archive() + + method with the DB_ARCH_DATA + option, + + + + or use the db_archive + command with the -s option. + +

      +

      + However, be aware that backing up just the modified databases only works if you have all of your + log files. If you have been removing log files for any reason then using + + log_archive() + + + + can result in an + unrecoverable backup because you might not be notified of a database file that was modified. +

      +
    8. +
    9. +

      + Copy the last log file to your backup location. + Your log files are named + log.xxxxxxxxxx, + where xxxxxxxxxx is a + sequential number. The last log file is the file + with the highest number. +

      +
    10. +
    +
    +
    +
    +
    +
    +
    +

    Hot Backup

    +
    +
    +
    +
    +

    + To create a hot backup, you do not have to stop database + operations. Transactions may be on-going and you can be writing + to your database at the time of the backup. However, this means + that you do not know exactly what the state of your database is + at the time of the backup. +

    +

    + You can use the db_hotbackup command line utility to create a hot backup for you. This + utility will (optionally) run a checkpoint and the copy all necessary files to a target directory. +

    +

    + Alternatively, you can manually create a hot backup as follows: +

    +
    +
      +
    1. +

      + Copy all your database files to the backup location. + + Note that you can simply copy all of the database + files, or you can determine which database files + have been written during the lifetime of the current + logs. To do this, use either the + + DB_ENV->log_archive() + + with the DB_ARCH_DATA + option, + + + + or use the db_archive + command with the -s option. + +

      +
    2. +
    3. +

      + Copy all logs to your backup location. +

      +
    4. +
    +
    +
    +

    Note

    +

    + It is important to copy your database files and + then your logs. In this way, + you can complete or roll back any database operations that were only partially completed + when you copied the databases. +

    +
    +
    +
    +
    +
    +
    +

    Incremental Backups

    +
    +
    +
    +
    +

    + Once you have created a full backup (that is, either a + offline or hot backup), you can create incremental backups. + To do this, simply copy all of your currently existing log + files to your backup location. +

    +

    + Incremental backups do not require you to run a checkpoint + or to cease database write operations. +

    +

    + When you are working with incremental backups, remember + that the greater the number of log files contained in + your backup, the longer recovery will take. + You should run full backups + on some interval, and then do incremental backups on a shorter interval. + How frequently you need to run a full backup + is determined by the rate at which your databases change and + how sensitive your application is to lengthy recoveries + (should one be required). +

    +

    + You can also shorten recovery time by running recovery against the backup as you take each incremental + backup. Running recovery as you go means that there will be less work for DB to do if you should + ever need to restore your environment from the backup. +

    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/blocking_deadlocks.html b/db/docs/gsg_txn/C/blocking_deadlocks.html new file mode 100644 index 000000000..cc7712aeb --- /dev/null +++ b/db/docs/gsg_txn/C/blocking_deadlocks.html @@ -0,0 +1,674 @@ + + + + + + Locks, Blocks, and Deadlocks + + + + + + + + + +
    +
    +
    +
    +

    Locks, Blocks, and Deadlocks

    +
    +
    +
    +
    +

    + It is important to understand how locking works in a + concurrent application before continuing with a description of + the concurrency mechanisms DB makes available to you. + Blocking and deadlocking have important performance implications + for your application. Consequently, this section provides a + fundamental description of these concepts, and how they affect + DB operations. +

    +
    +
    +
    +
    +

    Locks

    +
    +
    +
    +
    +

    + When one thread of control wants to obtain access to an + object, it requests a lock for that + object. This lock is what allows DB to provide your + application with its transactional isolation guarantees by + ensuring that: +

    +
    +
      +
    • +

      + no other thread of control can read that object (in + the case of an exclusive lock), and +

      +
    • +
    • +

      + no other thread of control can modify that object + (in the case of an exclusive or non-exclusive lock). +

      +
    • +
    +
    +
    +
    +
    +
    +

    Lock Resources

    +
    +
    +
    +
    +

    + When locking occurs, there are conceptually three resources + in use: +

    +
    +
      +
    1. +

      + The locker. +

      +

      + This is the thing that holds the lock. In a + transactional application, the locker is a + transaction handle. + + For non-transactional operations, the locker is a cursor or a + DB + + + + handle. + + +

      +
    2. +
    3. +

      + The lock. +

      +

      + This is the actual data structure that locks + the object. In DB, a locked + object structure in the lock manager + is representative of the object that + is locked. +

      +
    4. +
    5. +

      + The locked object. +

      +

      + The thing that your application + actually wants to lock. + In a DB + application, the locked object is usually a + + database page, which in turn contains + multiple database entries (key and data). + + However, for Queue databases, + individual database records are locked. + + + + +

      +
    6. +
    +
    +

    + You can configure how many total lockers, locks, + and locked objects your + application is allowed to support. See + Configuring the Locking Subsystem + for details. +

    +

    + The following figure shows a transaction handle, + Txn A, that is holding a lock on + database + page + + 002. In this graphic, Txn + A is the locker, and the locked object is + page + + 002. Only a single lock is in use + in this operation. +

    +
    + +
    +
    +
    +
    +
    +
    +

    Types of Locks

    +
    +
    +
    +
    +

    + DB applications support both exclusive and + non-exclusive locks. Exclusive + locks are granted when a + locker wants to write to an object. For this reason, + exclusive locks are also sometimes called + write locks. +

    +

    + An exclusive lock prevents any other locker from + obtaining any sort of a lock on the object. This + provides isolation by ensuring that no other locker can + observe or modify an exclusively locked object until the locker is done + writing to that object. +

    +

    + Non-exclusive locks are granted + for read-only access. For this reason, non-exclusive + locks are also sometimes called read + locks. Since multiple lockers can + simultaneously hold read locks on the same + object, read locks are also + sometimes called shared locks. +

    +

    + A non-exclusive lock prevents any other locker from + modifying the locked object while the locker is still + reading the object. This is how transactional cursors are able to + achieve repeatable reads; by default, the + cursor's transaction holds + a read lock on any object that the cursor has examined until + such a time as the transaction is committed + or aborted. + + You can avoid these read locks by using + snapshot isolation. See Using Snapshot Isolation + for details. + +

    +

    + In the following figure, Txn A and + Txn B are both holding read locks on + page + + 002, while Txn C + is holding a write lock on + page + + 003: +

    +
    + +
    +
    +
    +
    +
    +
    +

    Lock Lifetime

    +
    +
    +
    +
    +

    + A locker holds its locks until such a time as it does + not need the lock any more. What this means is: +

    +
    +
      +
    1. +

      + A transaction holds any locks that it obtains + until the transaction is committed or aborted. +

      +
    2. +
    3. +

      + All non-transaction operations hold locks + until such a time as the operation is completed. + For cursor operations, the lock is held until the cursor is moved to a new position or + closed. +

      +
    4. +
    +
    +
    +
    +
    +
    +
    +
    +

    Blocks

    +
    +
    +
    +
    +

    + Simply put, a thread of control is blocked when it attempts + to obtain a lock, but that attempt is denied because some + other thread of control holds a conflicting lock. + Once blocked, the thread of control is temporarily unable + to make any forward progress until the requested lock is + obtained or the operation requesting the lock is + abandoned. +

    +

    + Be aware that when we talk about blocking, strictly + speaking the thread is not what is attempting to obtain the + lock. Rather, some object within the thread (such as a + cursor) is attempting to obtain the + lock. However, once a locker attempts to + obtain a lock, the entire thread of control must pause until the lock + request is in some way resolved. +

    +

    + For example, if Txn A holds a write lock (an exclusive + lock) on + object + + 002, then if Txn B tries to obtain a read or write lock on + that + object, + + the thread of control in which Txn + B is running + is blocked: +

    +
    + +
    +

    + However, if Txn A only holds a read + lock (a shared lock) on + object + + 002, then only those handles that attempt to obtain a + write lock on that + object + + will block. +

    +
    + +
    +
    +

    Note

    +

    + The previous description describes DB's default + behavior when it cannot obtain a lock. It is + possible to configure DB transactions so that + they will not block. Instead, if a lock is + unavailable, the application is immediately notified of a + deadlock situation. See No Wait on Blocks + for more information. +

    +
    +
    +
    +
    +
    +

    Blocking and Application Performance

    +
    +
    +
    +
    +

    + Multi-threaded + + and multi-process + + applications typically perform better than simple + single-threaded applications because the + application can perform one part of its workload + (updating + a database record, + + for example) while it is waiting for some other + lengthy operation to complete (performing disk or + network I/O, for example). This performance + improvement is particularly noticeable if you use + hardware that offers multiple CPUs, because the threads + + and processes + + can run simultaneously. +

    +

    + That said, concurrent applications can see reduced + workload throughput if their threads of control are + seeing a large amount of lock contention. That is, + if threads are blocking on lock requests, then that + represents a performance penalty for your + application. +

    +

    + Consider once again the previous diagram of a blocked write lock request. + In that diagram, Txn C cannot + obtain its requested write lock because + Txn A and Txn + B are both already holding read locks on + the requested + object. + + In this case, the thread in which + Txn C is running will pause until + such a time as Txn C either + obtains its write lock, or the operation + that is requesting the lock is abandoned. + The fact that Txn + C's thread has temporarily halted all + forward progress represents a performance penalty + for your application. +

    +

    + Moreover, any read locks that are requested while + Txn C is waiting for its write + lock will also block until such a time as + Txn C has obtained and + subsequently released its write lock. +

    +
    +
    +
    +
    +
    +

    Avoiding Blocks

    +
    +
    +
    +
    +

    + Reducing lock contention is an important part of + performance tuning your concurrent DB + application. Applications that have multiple + threads of control obtaining exclusive (write) + locks are prone to contention issues. Moreover, as + you increase the numbers of lockers and as you + increase the time that a lock is held, you increase + the chances of your application seeing lock contention. +

    +

    + As you are designing your application, try to do + the following in order to reduce lock contention: +

    +
    +
      +
    • +

      + Reduce the length of time your application + holds locks. +

      +

      + Shorter lived transactions will result in + shorter lock lifetimes, which will in turn + help to reduce lock contention. +

      +

      + In addition, by default transactional cursors hold read + locks until such a time as the transaction is completed. + For this reason, try to + minimize the time you keep + transactional cursors + opened, or reduce your isolation + levels – see below. +

      +
    • +
    • +

      + If possible, access heavily accessed (read + or write) items toward the end of the + transaction. This reduces the amount of + time that a heavily used + + page + + + is locked by the transaction. +

      +
    • +
    • +

      + Reduce your application's isolation + guarantees. +

      +

      + By reducing your isolation guarantees, you + reduce the situations in which a lock can + block another lock. Try using uncommitted reads + for your read operations in order to + prevent a read lock being blocked by a + write lock. +

      +

      + In addition, for cursors you can use degree + 2 (read committed) isolation, which causes + the cursor to release its read locks as + soon as it is done reading the record (as + opposed to holding its read locks until the + transaction ends). +

      +

      + Be aware that reducing your + isolation guarantees can have + adverse consequences for your + application. Before deciding + to reduce your isolation, take + care to examine your + application's isolation + requirements. + For information on isolation + levels, see + Isolation. +

      +
    • +
    • +

      + Consider your data access patterns. +

      +

      + Depending on the nature of your application, + this may be something that you can not + do anything about. However, if it is + possible to create your threads such that + they operate only on non-overlapping + portions of your database, then you can + reduce lock contention because your + threads will rarely (if ever) block on one another's + locks. +

      +
    • +
    +
    +
    +

    Note

    +

    + It is possible to configure DB's transactions + so that they never wait on blocked lock requests. + Instead, if they are blocked on a lock request, + they will notify the application of a deadlock (see + the next section). +

    +

    + You configure this behavior on a transaction by + transaction basis. See No Wait on Blocks for more information. +

    +
    +
    +
    +
    +
    +
    +
    +

    Deadlocks

    +
    +
    +
    +
    +

    + A deadlock occurs when two or more threads of control are + blocked, each waiting on a resource held by the other + thread. When this happens, there is no + possibility of the threads ever making forward progress + unless some outside agent takes action to break the + deadlock. +

    +

    + For example, if + Txn A is + blocked by Txn B at the same time + Txn B is blocked by Txn + A then the threads of control containing + Txn A and Txn B are + deadlocked; neither thread can make + any forward progress because neither thread will ever release the lock + that is blocking the other thread. +

    +
    + +
    +

    + When two threads of control deadlock, the only + solution is to have a mechanism external to the two threads + capable of recognizing the deadlock and notifying at least + one thread that it is in a deadlock situation. + Once notified, a thread of + control must abandon the attempted operation in order to + resolve the deadlock. + + + DB's locking subsystem offers a deadlock notification + mechanism. See + Configuring Deadlock Detection + for more information. + + + +

    +

    + Note that when one locker in a thread of control is blocked + waiting on a lock held by another locker in that same + thread of the control, the thread is said to be + self-deadlocked. +

    +
    +
    +
    +
    +

    Deadlock Avoidance

    +
    +
    +
    +
    +

    + The things that you do to avoid lock contention also + help to reduce deadlocks (see Avoiding Blocks). + + + Beyond that, you can also do the following in order to + avoid deadlocks: + + + +

    +
    +
      +
    • +

      + Make sure all threads access data in the same + order as all other threads. So long as threads + lock database pages + in the same basic order, there is no + possibility of a deadlock (threads can still + block, however). +

      +

      + Be aware that if you are using secondary databases (indices), it is not possible to obtain + locks in a consistent order because you cannot predict the order in which locks are obtained + in secondary databases. If you are writing a concurrent application and you are using + secondary databases, you must be prepared to handle deadlocks. +

      +
    • +
    • +

      + If you are using BTrees in which you are + constantly adding and then deleting data, turn + Btree reverse split off. See + Reverse BTree Splits + for more information. +

      +
    • +
    • +

      + Declare a read/modify/write lock for those + situations where you are reading a record in + preparation of modifying and then writing the + record. Doing this causes DB to give your + read operation a write lock. This means that no + other thread of control can share a read lock + (which might cause contention), but it also + means that the writer thread will not have to + wait to obtain a write lock when it is ready to + write the modified data back to the database. +

      +

      + For information on declaring + read/modify/write locks, see + Read/Modify/Write. +

      +
    • +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/deadlock.jpg b/db/docs/gsg_txn/C/deadlock.jpg new file mode 100644 index 000000000..0995a84d8 Binary files /dev/null and b/db/docs/gsg_txn/C/deadlock.jpg differ diff --git a/db/docs/gsg_txn/C/enabletxn.html b/db/docs/gsg_txn/C/enabletxn.html new file mode 100644 index 000000000..719fba4bc --- /dev/null +++ b/db/docs/gsg_txn/C/enabletxn.html @@ -0,0 +1,928 @@ + + + + + + Chapter 2. Enabling Transactions + + + + + + + + + +
    +
    +
    +
    +

    Chapter 2. Enabling Transactions

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Environments + +
    +
    +
    +
    + + File Naming + +
    +
    + + Error Support + +
    +
    + + Shared Memory Regions + +
    +
    + + Security Considerations + +
    +
    +
    +
    + + Opening a Transactional Environment and + Database + + + +
    +
    +
    +

    + In order to use transactions with your application, you must turn them + on. To do this you must: +

    +
    +
      +
    • +

      + Use an + environment (see Environments for details). +

      +
    • +
    • +

      + Turn on transactions for your environment. + + + + + You do this by providing the DB_INIT_TXN + flag to the + + DB_ENV->open() + method. + + + + Note that initializing the transactional subsystem implies that + the logging subsystem is also initialized. Also, note that + if you do not initialize transactions when you first create + your environment, then you cannot use transactions for that + environment after that. This is because DB + allocates certain structures needed for transactional + locking that are not available if the environment is + created without transactional support. + +

      +
    • +
    • +

      + Initialize the in-memory cache by + + passing the DB_INIT_MPOOL + flag to the + + DB_ENV->open() + method. + + + +

      +
    • +
    • +

      + Initialize the locking subsystem. This is what provides locking for concurrent applications. It also is used + to perform deadlock detection. See Concurrency + for more information. +

      +

      + You initialize the locking subsystem by + + passing the DB_INIT_LOCK + flag to the + + DB_ENV->open() + method. + + + +

      +
    • +
    • +

      + Initialize the logging subsystem. While this is enabled by + default for transactional applications, we suggest that + you explicitly initialize it anyway for the purposes of code readability. The logging + subsystem is what provides your transactional application its durability guarantee, and it is required for + recoverability purposes. See Managing DB Files + for more information. +

      +

      + You initialize the logging subsystem by + + passing the DB_INIT_LOG + flag to the + + DB_ENV->open() + method. + + + +

      +
    • +
    • +

      + Transaction-enable your databases. You do this by + + + + encapsulating the database open in a transaction. + + + + + + Note that the common practice is for auto commit to be used to + transaction-protect the database open. To use auto-commit, you + must still enable transactions as described here, but you do + not have to explicitly use a transaction when you open your + database. An example of this is given in the next section. + +

      +
    • +
    +
    +
    +
    +
    +
    +

    Environments

    +
    +
    +
    +
    +

    + For simple DB applications, environments are optional. However, in + order to transaction protect your database operations, you must use an + environment. +

    +

    + An environment, represents an + encapsulation of one or more databases and any associated log and + region files. They are used to support multi-threaded + and multi-process applications by allowing different threads of + control to share the in-memory cache, the locking tables, the + logging subsystem, and the file namespace. By sharing these things, + your concurrent application is more efficient than if each thread + of control had to manage these resources on its own. +

    +

    + By default all DB databases are backed by files on disk. In + addition to these files, transactional DB applications create + logs that are also by default stored on disk (they can optionally + be backed using shared memory). Finally, transactional + DB applications also create and use shared-memory regions that + are also typically backed by the filesystem. But like databases and + logs, the regions can be maintained strictly in-memory if your + application requires it. For an example of an application that + manages all environment files in-memory, see + In-Memory Transaction Example. + + +

    +
    +
    +
    +
    +

    File Naming

    +
    +
    +
    +
    +

    + In order to operate, your DB application must be able to + locate its database files, log files, and region files. If these + are stored in the filesystem, then you must tell DB where + they are located (a number of mechanisms exist that allow you to + identify the location of these files – see below). Otherwise, + by default they are located in the current working directory. +

    +
    +
    +
    +
    +

    Specifying the Environment Home Directory

    +
    +
    +
    +
    +

    + The environment home directory is used to determine where + DB files are located. Its location + is identified using one of the following mechanisms, in the + following order of priority: +

    +
    +
      +
    • +

      + If no information is given as to where to put the + environment home, then the current working + directory is used. +

      +
    • +
    • +

      + If a home directory is specified on the + DB_ENV->open() + + + method, + + then that location is always used for the environment + home. +

      +
    • +
    • +

      + If a home directory is not supplied to + DB_ENV->open(), + + + then the directory identified by the DB_HOME environment variable + is used if you specify + + either the DB_USE_ENVIRON or + DB_USE_ENVIRON_ROOT flags to the + DB_ENV->open() + + method. Both flags allow you to identify the + path to the environment's home directory + using the DB_HOME environment variable. However, + DB_USE_ENVIRON_ROOT is honored only if the + process is run with root or administrative privileges. + + + +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    Specifying File Locations

    +
    +
    +
    +
    +

    + By default, all DB files are created relative to the environment + home directory. For example, suppose your environment home is in + /export/myAppHome. Also suppose you name your database + data/myDatabase.db. + + Then in this case, the database is placed in: + /export/myAppHome/data/myDatabase.db. + +

    +

    + That said, DB always defers to absolute pathnames. + This means that if you provide an absolute filename when you + name your database, then that file is not + placed relative to the environment home directory. Instead, it + is placed in the exact location that you specified for the + filename. +

    +

    + On UNIX systems, an absolute pathname is a name that begins with a + forward slash ('/'). On Windows systems, an absolute pathname is a + name that begins with one of the following: +

    +
    +
      +
    • +

      + A backslash ('\'). +

      +
    • +
    • +

      + Any alphabetic letter, followed by a colon (':'), followed + by a backslash ('\'). +

      +
    • +
    +
    +
    +

    Note

    +

    + Try not to use absolute path names for your + environment's files. Under certain recovery scenarios, absolute path names can + render your environment unrecoverable. This occurs if you are attempting to recover + you environment on a system that does not support the absolute path name that you used. +

    +
    +
    +
    +
    +
    +
    +

    Identifying Specific File Locations

    +
    +
    +
    +
    +

    + As described in the previous sections, DB will place all its + files in or relative to the environment home directory. + You can also cause a + specific database file to be placed in a particular location by + using an absolute path name for its name. In this + situation, the environment's home directory is not + considered when naming the file. +

    +

    + It is frequently desirable to place database, log, and region files on separate + disk drives. By spreading I/O across multiple drives, you + can increase parallelism and improve throughput. + Additionally, by placing log files and database files on + separate drives, you improve your application's + reliability by providing your application with a greater + chance of surviving a disk failure. +

    +

    + You can cause DB's files to be placed in specific + locations using the following mechanisms: +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    File TypeTo Override
    database files +

    + You can cause database files to be created + in a directory other than the + environment home by using the + DB_ENV->set_data_dir() + + + method. + The directory identified + here must exist. If a relative path is + provided, then the directory location is + resolved relative to the environment's home + directory. +

    +

    + This method modifies the directory + used for database files created and managed by + a single environment handle; it does not + configure the entire environment. + This + method may not be called after the + environment has been opened. + +

    +

    + You can also set a default data location that is used by + the entire environment by using the + set_data_dir parameter + in the environment's DB_CONFIG file. + Note that the set_data_dir + parameter overrides any value set by the + DB_ENV->set_data_dir() + + + method. +

    +
    Log files +

    + You can cause log files to be created + in a directory other than the environment home + directory by using the + DB_ENV->set_lg_dir() + + + method. The directory identified + here must exist. If a relative path is + provided, then the directory location is + resolved relative to the environment's home + directory. +

    +

    + This method modifies the directory + used for database files created and managed by + a single environment handle; it does not + configure the entire environment. + This + method may not be called after the + environment has been opened. + +

    +

    + You can also set a default log file location that is used by + the entire environment by using the + set_lg_dir parameter + in the environment's DB_CONFIG file. + Note that the set_lg_dir + parameter overrides any value set by the + DB_ENV->set_lg_dir() + + + method. +

    +
    Region files + If backed by the filesystem, region + files are always placed in the environment home + directory. +
    +
    +

    + Note that the DB_CONFIG must reside in the + environment home directory. Parameters are specified in it one + parameter to a line. Each parameter is followed by a space, + which is followed by the parameter value. For example: +

    +
        set_data_dir /export1/db/env_data_files 
    +
    +
    +
    +
    +
    +
    +

    Error Support

    +
    +
    +
    +
    +

    + To simplify error handling and to aid in application debugging, environments offer several useful + methods. + + Note that many of these + methods are identical to the error handling methods available for the + DB + + + structure. + + + + + They are: +

    +
    +
      +
    • +

      + set_errcall() + +

      +

      + Defines the function that is called when an error message is + issued by DB. The error prefix and message are passed to + this callback. It is up to the application to display this + information correctly. +

      +
    • +
    • +

      + set_errfile() +

      +

      + Sets the C library FILE * to be used for + displaying error messages issued by the DB library. +

      +
    • +
    • +

      + set_errpfx() + +

      +

      + Sets the prefix used to for any error messages issued by the + DB library. +

      +
    • +
    • +

      + err() +

      +

      + Issues an error message based upon a DB error code a message text that you supply. + The error message is sent to the + callback function as defined by set_errcall(). + If that method has not been used, then the error message is sent to the + file defined by + set_errfile(). + + If none of these methods have been used, then the error message is sent to + standard error. +

      +

      + The error message consists of the prefix string + (as defined by set_errprefix()), + an optional printf-style formatted message, + the DB error message associated with the supplied error code, + and a trailing newline. +

      +
    • +
    • +

      + errx() +

      +

      + Behaves identically to err() except + that you do not provide the DB error code and so + the DB message text is not displayed. +

      +
    • +
    +
    +

    + In addition, you can use the db_strerror() + function to directly return the error string that corresponds to a + particular error number. For more information on the + db_strerror() function, see the Error Returns + section of the Getting Started with Berkeley DB guide. +

    +
    +
    +
    +
    +
    +

    Shared Memory Regions

    +
    +
    +
    +
    +

    + The subsystems that you enable for an environment (in our case, + transaction, logging, locking, and the memory pool) + are described by one or more regions. The regions contain all of the + state information that needs to be shared among threads and/or + processes using the environment. +

    +

    + Regions may be backed by the file system, by heap memory, or by + system shared memory. +

    +
    +
    +
    +
    +

    Regions Backed by Files

    +
    +
    +
    +
    +

    + By default, shared memory regions are created as files in the environment's + home directory (not the environment's data + directory). If it is available, the POSIX mmap + interface is used to map these files into your application's + address space. If mmap + is not available, then the UNIX shmget interfaces + are used instead (again, if they are available). +

    +

    + In this default case, the region files are named + __db.### + (for example, __db.001, __db.002, + and so on). +

    +
    +
    +
    +
    +
    +

    Regions Backed by Heap Memory

    +
    +
    +
    +
    +

    + If heap memory is used to back your shared memory regions, + the environment may only be + accessed by a single process, although that process may be + multi-threaded. In this case, the regions are managed only in + memory, and they are not written to the filesystem. You + indicate that heap memory is to be used for the region files by + specifying + + DB_PRIVATE to the + DB_ENV->open() + + method. + + + + +

    +

    + (For an example of an entirely in-memory transactional + application, see + + In-Memory Transaction Example.) + + + +

    +
    +
    +
    +
    +
    +

    Regions Backed by System Memory

    +
    +
    +
    +
    +

    + Finally, you can cause system memory to be used for your + regions instead of memory-mapped files. You do this by providing + + DB_SYSTEM_MEM to the + DB_ENV->open() + + method. + + + +

    +

    + When region files are backed by system memory, DB creates a + single file in the environment's home directory. This file + contains information necessary to identify the system shared + memory in use by the environment. By creating this file, DB + enables multiple processes to share the environment. +

    +

    + The system memory that is used is architecture-dependent. For + example, on systems supporting X/Open-style shared memory + interfaces, such as UNIX systems, the shmget(2) + and related System V IPC interfaces are used. + + + + Additionally, VxWorks systems use system memory. In these cases, + an initial segment ID must be specified by the application to + ensure that applications do not overwrite each other's + environments, so that the number of segments created does not + grow without bounds. See the + + DB_ENV->set_shm_key() + + + method for more information. + +

    +

    + On Windows platforms, the use of system memory for the region files + is problematic because the operating system uses reference counting + to clean up shared objects in the paging file automatically. In + addition, the default access permissions for shared objects are + different from files, which may cause problems when an environment + is accessed by multiple processes running as different users. See + Windows notes + or more information. +

    +
    +
    +
    +
    +
    +
    +

    Security Considerations

    +
    +
    +
    +
    +

    + When using environments, there are some security considerations to + keep in mind: +

    +
    +
      +
    • +

      + Database environment permissions +

      +

      + The directory used for the environment + should have its permissions set to ensure that files in the + environment are not accessible to users without appropriate + permissions. Applications that add to the user's permissions + (for example, UNIX setuid or + setgid applications), must be + carefully checked to not permit illegal use of those + permissions such as general file access in the environment + directory. +

      +
    • +
    • +

      + Environment variables +

      +

      + Setting + + + the DB_USE_ENVIRON or + DB_USE_ENVIRON_ROOT flags + + + + so that environment variables can be used during file naming + can be dangerous. Setting those flags in DB + applications with additional permissions (for example, UNIX + setuid or setgid + applications) could potentially allow users + to read and write databases to which they would not normally + have access. +

      +

      + For example, suppose you write a DB application + that runs setuid. This means that + when the application runs, it does so under a + userid different than that of the application's caller. + This is especially problematic if the application is + granting stronger privileges to a user than the user + might ordinarily have. +

      +

      + Now, if + + the DB_USE_ENVIRON or + DB_USE_ENVIRON_ROOT flags + are set for the environment, + + + + + then the environment that the application is + using is modifiable using the + DB_HOME environment variable. In + this scenario, if the uid used by the application has + sufficiently broad privileges, then the application's caller + can read and/or write databases owned by another user + simply by setting his + DB_HOME environment variable to the + environment used by that other user. +

      +

      + Note that this scenario need not be malicious; the + wrong environment could be used by the application + simply by inadvertently specifying the wrong path to + DB_HOME. +

      +

      + As always, you should use setuid + sparingly, if at all. But if you do use + setuid, then you should refrain from + specifying + + the DB_USE_ENVIRON or + DB_USE_ENVIRON_ROOT flags + + + for the environment open. And, of course, if you must + use setuid, then make sure you use + the weakest uid possible – preferably one that is + used only by the application itself. +

      +
    • +
    • +

      + File permissions +

      +

      + By default, DB always creates database and log files readable and + writable by the owner and the group (that is, + S_IRUSR, + S_IWUSR, S_IRGRP and + S_IWGRP; or octal mode 0660 on historic + UNIX systems). The group ownership of created files is based + on the system and directory defaults, and is not further + specified by DB. +

      +
    • +
    • +

      + Temporary backing files +

      +

      + If an unnamed database is created and the cache is too small + to hold the database in memory, Berkeley DB will create a + temporary physical file to enable it to page the database to + disk as needed. In this case, environment variables such as + TMPDIR may be used to specify the + location of that temporary file. Although temporary backing + files are created readable and writable by the owner only + (S_IRUSR and S_IWUSR, + or octal mode 0600 on historic UNIX systems), some + filesystems may not sufficiently protect temporary files + created in random directories from improper access. To be + absolutely safe, applications storing sensitive data in + unnamed databases should use the + DB_ENV->set_tmp_dir() + + + method to specify a temporary directory with known permissions. +

      +
    • +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/envopen.html b/db/docs/gsg_txn/C/envopen.html new file mode 100644 index 000000000..46fc26bc8 --- /dev/null +++ b/db/docs/gsg_txn/C/envopen.html @@ -0,0 +1,241 @@ + + + + + + Opening a Transactional Environment and + Database + + + + + + + + + + + +
    +
    +
    +
    +

    Opening a Transactional Environment and + Database + +

    +
    +
    +
    +
    +

    + To enable transactions for your environment, you must initialize the + transactional subsystem. Note that doing this also initializes the + logging subsystem. In addition, you must initialize the memory pool + (in-memory cache). Frequently, but not always, you will also + initialize the locking subsystem. For example: +

    +

    + Notice in the following example that you create your environment + handle using the db_env_create() function before you open + the environment: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t env_flags;
    +    DB_ENV *envp;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE |    /* Create the environment if it does 
    +                                * not already exist. */
    +                DB_INIT_TXN  | /* Initialize transactions */
    +                DB_INIT_LOCK | /* Initialize locking. */
    +                DB_INIT_LOG  | /* Initialize logging */
    +                DB_INIT_MPOOL; /* Initialize the in-memory cache. */
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +err:
    +    /* Close the environment */
    +    if (envp != NULL) {
    +        ret_c = envp->close(envp, 0);
    +        if (ret_c != 0) {
    +            fprintf(stderr, "environment close failed: %s\n",
    +                db_strerror(ret_c));
    +            ret = ret_c;
    +        }
    +    }
    +
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +} 
    +

    + You then create and open your database(s) as you would for a non-transactional system. + + The only difference is that you must pass the environment handle to + the + + db_create() function, + + + and you must open the database within a transaction. + Typically auto commit is used for this purpose. To do so, pass + DB_AUTO_COMMIT to the database open command. + Also, make sure you close all your databases before you close + your environment. + For example: + + + +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    
    +    dbp = NULL;
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE |    /* Create the environment if it does 
    +                                * not already exist. */
    +                DB_INIT_TXN  | /* Initialize transactions */
    +                DB_INIT_LOCK | /* Initialize locking. */
    +                DB_INIT_LOG  | /* Initialize logging */
    +                DB_INIT_MPOOL; /* Initialize the in-memory cache. */
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database creation failed");
    +        goto err;
    +    }
    +
    +    db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    db_flags,   /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database '%s' open failed",
    +            file_name);
    +        goto err;
    +    }
    +
    +
    +err:
    +    /* Close the database */
    +    if (dbp != NULL) {
    +        ret_c = dbp->close(dbp, 0);
    +        if (ret_c != 0) {
    +            envp->err(envp, ret_c, "Database close failed.");
    +            ret = ret_c
    +        }
    +    }
    +
    +
    +    /* Close the environment */
    +    if (envp != NULL) {
    +        ret_c = envp->close(envp, 0);
    +        if (ret_c != 0) {
    +            fprintf(stderr, "environment close failed: %s\n",
    +                db_strerror(ret_c));
    +            ret = ret_c;
    +        }
    +    }
    +
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +} 
    +
    +

    Note

    +

    + Never close a database that has active transactions. Make sure + all transactions are resolved (either committed or aborted) + before closing the database. +

    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/filemanagement.html b/db/docs/gsg_txn/C/filemanagement.html new file mode 100644 index 000000000..57c5a0b66 --- /dev/null +++ b/db/docs/gsg_txn/C/filemanagement.html @@ -0,0 +1,403 @@ + + + + + + Chapter 5. Managing DB Files + + + + + + + + + +
    +
    +
    +
    +

    Chapter 5. Managing DB Files

    +
    +
    +
    +
    + +

    + DB is capable of storing several types of files on disk: +

    +
    +
      +
    • +

      + Data files, which contain the actual data in your database. +

      +
    • +
    • +

      + Log files, which contain information required to recover your + database in the event of a system or application failure. +

      +
    • +
    • +

      + Region files, which contain information necessary for the + overall operation of your application. +

      +
    • +
    • +

      + Temporary files, which are created only under certain special circumstances. These files never need to + be backed up or otherwise managed and so they are not a consideration for the topics described in this + chapter. See Security Considerations + for more information on temporary files. +

      +
    • +
    +
    +

    + Of these, you must manage your data and log files by ensuring that they + are backed up. You should also pay attention to the amount of disk space + your log files are consuming, and periodically remove any unneeded + files. Finally, you can optionally tune your logging subsystem to best + suit your application's needs and requirements. + These topics are discussed in this chapter. +

    +
    +
    +
    +
    +

    Checkpoints

    +
    +
    +
    +
    +

    + Before we can discuss DB file management, we need to + describe checkpoints. When databases are modified (that is, a + transaction is committed), the modifications are recorded in + DB's logs, but they are not + necessarily reflected in the actual database files on disk. +

    +

    + This means that as time goes on, increasingly + more data is contained in your log files that is not + contained in your data files. As a result, you must keep more + log files around than you might actually need. Also, any + recovery run from your log files will take increasingly longer + amounts of time, because there is more data in the log files + that must be reflected back into the data files during the + recovery process. +

    +

    + You can reduce these problems by periodically + running a checkpoint against your environment. The checkpoint: +

    +
    +
      +
    • +

      + Flushes dirty pages from the in-memory cache. This means that data modifications found in your + in-memory cache are written to the database files on disk. Note that a checkpoint also causes data + dirtied by an uncommitted transaction to also be written to your database files on disk. In this latter + case, DB's normal recovery is used to remove any such modifications that were subsequently + abandoned by your application using a transaction abort. +

      +

      + Normal recovery is describe in Recovery Procedures. +

      +
    • +
    • +

      + Writes a checkpoint record. +

      +
    • +
    • +

      + Flushes the log. This causes all log data that has not yet been written to disk to be written. +

      +
    • +
    • +

      + Writes a list of open databases. +

      +
    • +
    +
    +

    + There are several ways to run a checkpoint. One way is to use + the db_checkpoint command line utility. (Note, however, that this command line utility + cannot be used if your environment was opened using + + DB_PRIVATE.) + + +

    +

    + You can also run a thread that periodically checkpoints your + environment for you by calling the + DB_ENV->txn_checkpoint() + + + method. +

    +

    + Note that you can prevent a checkpoint from occurring unless more + than a specified amount of log data has been written since the + last checkpoint. You can also prevent the checkpoint from + running unless more than a specified amount of time has + occurred since the last checkpoint. These conditions are + particularly interesting if you have multiple threads + or processes + running checkpoints. +

    +

    + For configuration information, see the + + DB_ENV->txn_checkpoint() API reference page. + + + +

    +

    + Note that running checkpoints can be quite expensive. DB must + flush every dirty page to the backing database files. On the + other hand, if you do not run checkpoints often enough, your + recovery time can be unnecessarily long and you may be using more + disk space than you really need. Also, you cannot remove log files + until a checkpoint is run. Therefore, deciding how frequently + to run a checkpoint is one of the most + common tuning activity for DB applications. +

    +

    + For example, to run a checkpoint from a separate thread of control: +

    +
    #include <stdio.h>
    +#include <pthread.h>
    +#include <stdlib.h>
    +#include "db.h"     
    +
    +void *checkpoint_thread(void *);
    +
    +int
    +main(void)
    +{
    +    int ret;
    +    u_int32_t env_flags;
    +    DB_ENV *envp;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    pthread_t ptid;
    +
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN;     /* Initialize transactions */
    +
    +    /* Open the environment. */
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +
    +    /* Start a checkpoint thread. */ 
    +    if ((ret = pthread_create( 
    +        &ptid, NULL, checkpoint_thread, (void *)envp)) != 0) { 
    +            fprintf(stderr, 
    +                "txnapp: failed spawning checkpoint thread: %s\n", 
    +                strerror(ret)); 
    +            goto err;
    +    }
    +
    +    /* 
    +     * All other threads and application shutdown code 
    +     * omitted for brevity. 
    +     */
    +
    +    ...
    +}
    +
    +
    +void * 
    +checkpoint_thread(void *arg) { 
    +    DB_ENV *dbenv; 
    +    int ret;
    +
    +    dbenv = arg;
    +
    +    /* Checkpoint once a minute. */ 
    +    for (;; sleep(60)) 
    +        if ((ret = dbenv->txn_checkpoint(dbenv, 0, 0, 0)) != 0) { 
    +            dbenv->err(dbenv, ret, "checkpoint thread"); 
    +            exit (1); 
    +        }
    +
    +    /* NOTREACHED */ 
    +} 
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/gettingStarted.css b/db/docs/gsg_txn/C/gettingStarted.css new file mode 100644 index 000000000..c1b4c86b7 --- /dev/null +++ b/db/docs/gsg_txn/C/gettingStarted.css @@ -0,0 +1,41 @@ +body { width: 45em; + margin-left: 3em; + font-family: Arial, Helvetica, sans-serif; + font-size: 11pt; + } + +h2.title { margin-left: -1em; + font-family: Verdana, serif; + font-size: 16pt; + } + +h3.title { font-family: Verdana, serif; + font-size: 14pt; + } + +pre.programlisting { + font-family: monospace; + background-color: #eae8e9; +} + +div.navheader { font-size: 9pt; + width: 60em; + margin-left: -2em; + } + +div.navheader table tr td { font-size: 9pt; } + +div.navfooter { font-size: 9pt; + width: 60em; + margin-left: -2em; + } +div.navfooter table tr td { font-size: 9pt; } + +span.emphasis { font-style: italic; font-size: 9pt;} + +div.appendix div.informaltable { font-size: 9pt; } +div.appendix div.informaltable td { vertical-align: top; } +div.appendix div.informaltable p { margin-top: .25em; } +div.appendix div.informaltable p { margin-bottom: .25em; } + + diff --git a/db/docs/gsg_txn/C/hotfailover.html b/db/docs/gsg_txn/C/hotfailover.html new file mode 100644 index 000000000..fa3dcc152 --- /dev/null +++ b/db/docs/gsg_txn/C/hotfailover.html @@ -0,0 +1,210 @@ + + + + + + Using Hot Failovers + + + + + + + + + +
    +
    +
    +
    +

    Using Hot Failovers

    +
    +
    +
    +
    +

    + You can maintain a backup that can be used for failover purposes. + Hot failovers differ from the backup and restore + procedures described previously in this chapter in that data + used for traditional backups is typically copied to offline storage. + Recovery time for a traditional backup is determined by: +

    +
    +
      +
    • +

      + How quickly you can retrieve that storage media. + Typically storage media for critical backups is moved + to a safe facility in a remote location, so this step can + take a relatively long time. +

      +
    • +
    • +

      + How fast you can read the backup from the storage media + to a local disk drive. If you have very large backups, + or if your storage media is very slow, this can be a + lengthy process. +

      +
    • +
    • +

      + How long it takes you to run catastrophic recovery + against the newly restored backup. As described earlier + in this chapter, this process can be lengthy because + every log file must be examined during the recovery + process. +

      +
    • +
    +
    +

    + When you use a hot failover, the backup is maintained + at a location that is reasonably fast to access. Usually, this + is a second disk drive local to the machine. + In this situation, recovery time is very quick + because you only have to reopen your + environment and database, using the failover environment + for the environment open. +

    +

    + Hot failovers obviously do not protect you from truly + catastrophic disasters (such as a fire in your machine room) + because the backup is still local to the machine. However, + you can guard against more mundane problems (such as a broken + disk drive) by keeping the backup on a + second drive that is managed by an alternate disk controller. +

    +

    + To maintain a hot failover: +

    +
    +
      +
    1. +

      + Copy all the active database files to the failover + directory. Use the db_archive + command line utility with the + -s option to identify all the active + database files. +

      +
    2. +
    3. +

      + Identify all the inactive log files in your production + environment and move these to the failover + directory. Use the db_archive + command with no command line options to obtain a list + of these log files. +

      +
    4. +
    5. +

      + Identify the active log files in your production + environment, and copy these to the + failover directory. Use the + db_archive command with the + -l option to obtain a list of these + log files. +

      +
    6. +
    7. +

      + Run catastrophic recovery against the failover + directory. Use the db_recover + command with the -c option to do + this. +

      +
    8. +
    9. +

      + Optionally copy the backup to an archival location. +

      +
    10. +
    +
    +

    + Once you have performed this procedure, you can maintain an + active hot backup by repeating steps 2 - 5 as often + as is required by your application. +

    +
    +

    Note

    +

    + If you perform step 1, steps 2-5 must follow in order to + ensure consistency of your hot backup. +

    +
    +
    +

    Note

    +

    + Rather than use the previous procedure, you can use the db_hotbackup command line utility + to do the same thing. This utility will (optionally) run a checkpoint and then copy all necessary files to a target + directory for you. +

    +
    +

    + To actually perform a failover, simply: +

    +
    +
      +
    1. +

      + Shut down all processes which are running against the original environment. +

      +
    2. +
    3. +

      + If you have an archival copy of the backup environment, you can optionally try copying the remaining + log files from the original environment and running catastrophic recovery against that backup + environment. Do this only if you have a an archival copy of the backup + environment. +

      +

      + This step can allow you to recover data created or modified in the original environment, but which + did not have a chance to be reflected in the hot backup environment. +

      +
    4. +
    5. +

      + Reopen your environment and databases as normal, but use + the backup environment instead of the production + environment. +

      +
    6. +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/index.html b/db/docs/gsg_txn/C/index.html new file mode 100644 index 000000000..e43890ce3 --- /dev/null +++ b/db/docs/gsg_txn/C/index.html @@ -0,0 +1,525 @@ + + + + + + Getting Started with Berkeley DB Transaction Processing + + + + + + + +
    +
    +
    +
    +

    Getting Started with Berkeley DB Transaction Processing

    +
    +
    +
    +

    + Legal Notice +

    +

    + This documentation is distributed under an open source license. + You may review the terms of this license at: + http://www.oracle.com/technology/software/products/berkeley-db/htdocs/oslicensing.html + + +

    +

    + Oracle, Berkeley DB, + + + and + Sleepycat are trademarks or registered trademarks of + Oracle Corporation. All rights to these marks are reserved. + No third-party use is permitted without the + express prior written consent of Oracle Corporation. +

    +

    + To obtain a copy of this document's original source code, please + submit a request to the Oracle Technology Network forum at: + http://forums.oracle.com/forums/forum.jspa?forumID=271 + + +

    +
    +
    +
    +

    9/20/2006

    +
    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Preface + +
    +
    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +
    + + 1. Introduction + +
    +
    +
    +
    + + Transaction Benefits + +
    +
    +
    +
    + + A Note on System Failure + +
    +
    + + Application Requirements + +
    +
    + + Multi-threaded + and Multi-process + Applications + +
    +
    +
    +
    + + Recoverability + +
    +
    + + Performance Tuning + +
    +
    +
    +
    + + 2. Enabling Transactions + +
    +
    +
    +
    + + Environments + +
    +
    +
    +
    + + File Naming + +
    +
    + + Error Support + +
    +
    + + Shared Memory Regions + +
    +
    + + Security Considerations + +
    +
    +
    +
    + + Opening a Transactional Environment and + Database + + + +
    +
    +
    +
    + + 3. Transaction Basics + +
    +
    +
    +
    + + Committing a Transaction + +
    +
    +
    +
    + + Non-Durable Transactions + +
    +
    +
    +
    + + Aborting a Transaction + +
    +
    + + Auto Commit + +
    +
    + + Nested Transactions + +
    +
    + + Transactional Cursors + +
    +
    + + Secondary Indices with Transaction Applications + +
    +
    + + Configuring the Transaction Subsystem + +
    +
    +
    +
    + + 4. Concurrency + +
    +
    +
    +
    + + Which DB Handles are Free-Threaded + +
    +
    + + Locks, Blocks, and Deadlocks + +
    +
    +
    +
    + + Locks + +
    +
    + + Blocks + +
    +
    + + Deadlocks + +
    +
    +
    +
    + + The Locking Subsystem + +
    +
    +
    +
    + + Configuring the Locking Subsystem + +
    +
    + + Configuring Deadlock Detection + +
    +
    + + Resolving Deadlocks + +
    +
    +
    +
    + + Isolation + +
    +
    +
    +
    + + Supported Degrees of Isolation + +
    +
    + + Reading Uncommitted Data + +
    +
    + + Committed Reads + +
    +
    + + Using Snapshot Isolation + +
    +
    +
    +
    + + Transactional Cursors and Concurrent Applications + +
    +
    +
    +
    + + Using Cursors with Uncommitted Data + +
    +
    +
    +
    + + Read/Modify/Write + +
    +
    + + No Wait on Blocks + +
    +
    + + Reverse BTree Splits + +
    +
    +
    +
    + + 5. Managing DB Files + +
    +
    +
    +
    + + Checkpoints + +
    +
    + + Backup Procedures + +
    +
    +
    +
    + + About Unix Copy Utilities + +
    +
    + + Offline Backups + +
    +
    + + Hot Backup + +
    +
    + + Incremental Backups + +
    +
    +
    +
    + + Recovery Procedures + +
    +
    +
    +
    + + Normal Recovery + +
    +
    + + Catastrophic Recovery + +
    +
    +
    +
    + + Designing Your Application for Recovery + +
    +
    +
    +
    + + Recovery for Multi-Threaded Applications + +
    +
    + + Recovery in Multi-Process Applications + +
    +
    +
    +
    + + Using Hot Failovers + +
    +
    + + Removing Log Files + +
    +
    + + Configuring the Logging Subsystem + +
    +
    +
    +
    + + Setting the Log File Size + +
    +
    + + Configuring the Logging Region Size + +
    +
    + + Configuring In-Memory Logging + +
    +
    + + Setting the In-Memory Log Buffer Size + +
    +
    +
    +
    +
    +
    + + 6. Summary and Examples + +
    +
    +
    +
    + + Anatomy of a Transactional Application + +
    +
    + + Transaction Example + +
    +
    + + In-Memory Transaction Example + +
    +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/inmem_txnexample_c.html b/db/docs/gsg_txn/C/inmem_txnexample_c.html new file mode 100644 index 000000000..591032c09 --- /dev/null +++ b/db/docs/gsg_txn/C/inmem_txnexample_c.html @@ -0,0 +1,618 @@ + + + + + + In-Memory Transaction Example + + + + + + + + +
    +
    +
    +
    +

    In-Memory Transaction Example

    +
    +
    +
    +
    +

    + DB is sometimes used for applications that simply need to cache + data retrieved from some other location (such as a remote database + server). DB is also often used in embedded systems. +

    +

    + In both cases, applications may want to use transactions for + atomicity, consistency, and isolation guarantees, but they may also want + to forgo the durability guarantee entirely. In doing so, they can keep + their DB environment and databases entirely in-memory so + as to avoid the performance impact of unneeded disk I/O. +

    +

    + To do this: +

    +
    +
      +
    • +

      + Refrain from specifying a home directory when you open your + environment. The exception to this is if you are using the + DB_CONFIG configuration file — in + that case you must identify the environment's home + directory so that the configuration file can be found. +

      +
    • +
    • +

      + Configure your environment to back your regions from + system memory instead of the filesystem. +

      +
    • +
    • +

      + Configure your logging subsystem such that log files are kept + entirely in-memory. +

      +
    • +
    • +

      + Increase the size of your in-memory log buffer so that it + is large enough to hold the largest set of concurrent write operations. +

      +
    • +
    • +

      + Increase the size of your in-memory cache so that it can + hold your entire data set. You do not want your cache to + page to disk. +

      +
    • +
    • +

      + Do not specify a file name when you open your database(s). +

      +
    • +
    +
    +

    + As an example, this section takes the transaction example provided + in Transaction Example + and it updates that example so that the environment, database, log + files, and regions are all kept entirely in-memory. +

    +

    + For illustration purposes, we also modify this example so that + uncommitted reads are no longer used to enable the + count_records() + + function. Instead, we simply provide a transaction handle to + count_records() + + so as to avoid the self-deadlock. Be aware that using a transaction handle here rather than + uncommitted reads will work just as well as if we had continued to use uncommitted reads. However, + the usage of the transaction handle here will + probably cause more deadlocks than using read-uncommitted does, because more locking is being performed in + this case. +

    +

    + To begin, we simplify the beginning of our example a bit. Because + we no longer need an environment home directory, we can remove all + the code that we used to determine path delimiters + and include the getopt function. We can also + remove our usage() function because we no + longer require any command line arguments. +

    +
    /* File: txn_guide_inmemory.c */
    +
    +/* We assume an ANSI-compatible compiler */
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <string.h>
    +#include <pthread.h>
    +#include <db.h>
    +
    +/* Run 5 writers threads at a time. */
    +#define NUMWRITERS 5
    +
    +/*
    + * Printing of pthread_t is implementation-specific, so we
    + * create our own thread IDs for reporting purposes.
    + */
    +int global_thread_num;
    +pthread_mutex_t thread_num_lock;
    +
    +/* Forward declarations */
    +int count_records(DB *, DB_TXN *);
    +int open_db(DB **, const char *, const char *, DB_ENV *, u_int32_t);
    +int writer_thread(void *);  
    +

    + Next, in our main(), we also eliminate some + variables that this example no longer needs. In particular, we are able to remove + the + db_home_dir + + and + file_name + + variables. We also remove all our getopt code. +

    +
    int
    +main(void)
    +{
    +    /* Initialize our handles */
    +    DB *dbp = NULL;
    +    DB_ENV *envp = NULL;
    +
    +    pthread_t writer_threads[NUMWRITERS];
    +    int i, ret, ret_t;
    +    u_int32_t env_flags;
    +
    +    /* Application name */
    +    const char *prog_name = "txn_guide_inmemory";  
    +

    + Next we create our environment as always. However, we add + DB_PRIVATE to our environment open flags. This + flag causes our environment to back regions using our + application's heap memory rather than by using the filesystem. + This is the first important step to keeping our DB data + entirely in-memory. +

    +

    + We also remove the DB_RECOVER flag from the environment open flags. Because our databases, + logs, and regions are maintained in-memory, there will never be anything to recover. +

    +

    + Note that we show the additional code here in + bold. +

    +
        /* Create the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    env_flags =
    +      DB_CREATE     |  /* Create the environment if it does not exist */ 
    +      DB_INIT_LOCK  |  /* Initialize the locking subsystem */
    +      DB_INIT_LOG   |  /* Initialize the logging subsystem */
    +      DB_INIT_TXN   |  /* Initialize the transactional subsystem. This
    +                        * also turns on logging. */
    +      DB_INIT_MPOOL |  /* Initialize the memory pool (in-memory cache) */
    +      DB_PRIVATE    |  /* Region files are not backed by the filesystem. 
    +                        * Instead, they are backed by heap memory.  */
    +      DB_THREAD;       /* Cause the environment to be free-threaded */ 
    +

    + Now we configure our environment to keep the log files in memory, + increase the log buffer size to 10 MB, and increase our in-memory + cache to 10 MB. These values should be more than enough for our + application's workload. +

    +
    +        
    +              /* Specify in-memory logging */
    +    ret = envp->set_flags(envp, DB_LOG_INMEMORY, 1);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error setting log subsystem to in-memory: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* 
    +     * Specify the size of the in-memory log buffer. 
    +     */
    +    ret = envp->set_lg_bsize(envp, 10 * 1024 * 1024);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error increasing the log buffer size: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* 
    +     * Specify the size of the in-memory cache. 
    +     */
    +    ret = envp->set_cachesize(envp, 0, 
    +        10 * 1024 * 1024, 1);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error increasing the cache size: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +        
    +      
    +

    + Next, we open the environment and setup our lock detection. This is + identical to how the example previously worked, except that we do not + provide a location for the environment's home directory. +

    +
        /*
    +     * Indicate that we want db to perform lock detection internally.
    +     * Also indicate that the transaction with the fewest number of
    +     * write locks will receive the deadlock notification in 
    +     * the event of a deadlock.
    +     */  
    +    ret = envp->set_lk_detect(envp, DB_LOCK_MINWRITE);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error setting lock detect: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    } 
    +
    +    /* Now actually open the environment */
    +    ret = envp->open(envp, NULL, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    } 
    +

    + When we call + open_db(), + + which is what we use + to open our database, we no not provide a database filename for the + third parameter. When the filename is NULL, the database is not + backed by the filesystem. +

    +
        /*
    +     * If we had utility threads (for running checkpoints or 
    +     * deadlock detection, for example) we would spawn those
    +     * here. However, for a simple example such as this,
    +     * that is not required.
    +     */
    +
    +    /* Open the database */
    +    ret = open_db(&dbp, prog_name, NULL, 
    +      envp, DB_DUPSORT);
    +    if (ret != 0)
    +        goto err; 
    +

    + After that, our main() function is unchanged, + except that when we + close the database, + + we change the error message string so as to not reference the database filename. +

    +
        /* Initialize a pthread mutex. Used to help provide thread ids. */
    +    (void)pthread_mutex_init(&thread_num_lock, NULL);
    +
    +    /* Start the writer threads. */
    +    for (i = 0; i < NUMWRITERS; i++)
    +        (void)pthread_create(
    +      &writer_threads[i], NULL, (void *)writer_thread, (void *)dbp);
    +
    +    /* Join the writers */
    +    for (i = 0; i < NUMWRITERS; i++)
    +        (void)pthread_join(writer_threads[i], NULL);
    +
    +err:
    +    /* Close our database handle, if it was opened. */
    +    if (dbp != NULL) {
    +        ret_t = dbp->close(dbp, 0);
    +        if (ret_t != 0) {
    +            fprintf(stderr, "%s database close failed.\n",
    +                db_strerror(ret_t));
    +            ret = ret_t;
    +        }
    +    }
    +
    +    /* Close our environment, if it was opened. */
    +    if (envp != NULL) {
    +        ret_t = envp->close(envp, 0);
    +        if (ret_t != 0) {
    +            fprintf(stderr, "environment close failed: %s\n",
    +                db_strerror(ret_t));
    +                ret = ret_t;
    +        }
    +    }
    +
    +    /* Final status message and return. */
    +    printf("I'm all done.\n");
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +} 
    +

    + That completes main(). The bulk of our + writer_thread() function implementation is + unchanged from the initial transaction example, except that we no + longer check for DB_KEYEXISTS in our + DB->put() return code. Because we are + configuring for a completely in-memory database, there is no + possibility that we can run this code against an existing database. + Therefore, there is no way that DB_KEYEXISTS + will be returned by DB->put(). +

    +
    /* 
    + * A function that performs a series of writes to a
    + * Berkeley DB database. The information written
    + * to the database is largely nonsensical, but the
    + * mechanism of transactional commit/abort and
    + * deadlock detection is illustrated here.
    + */
    +int
    +writer_thread(void *args)
    +{
    +    DBT key, value;
    +    DB_TXN *txn;
    +    int i, j, payload, ret, thread_num;
    +    int retry_count, max_retries = 20;   /* Max retry on a deadlock */
    +    char *key_strings[] = {"key 1", "key 2", "key 3", "key 4",
    +                           "key 5", "key 6", "key 7", "key 8",
    +                           "key 9", "key 10"};
    +
    +    DB *dbp = (DB *)args;
    +    DB_ENV *envp = dbp->get_env(dbp);
    +
    +    /* Get the thread number */
    +    (void)pthread_mutex_lock(&thread_num_lock);
    +    global_thread_num++;
    +    thread_num = global_thread_num;
    +    (void)pthread_mutex_unlock(&thread_num_lock);
    +
    +    /* Initialize the random number generator */
    +    srand((u_int)pthread_self());
    +
    +    /* Write 50 times and then quit */
    +    for (i = 0; i < 50; i++) {
    +        retry_count = 0; /* Used for deadlock retries */
    +
    +retry:
    +        ret = envp->txn_begin(envp, NULL, &txn, 0);
    +        if (ret != 0) {
    +            envp->err(envp, ret, "txn_begin failed");
    +            return (EXIT_FAILURE);
    +        }
    +        for (j = 0; j < 10; j++) {
    +            /* Set up our key and values DBTs */
    +            memset(&key, 0, sizeof(DBT));
    +            key.data = key_strings[j];
    +            key.size = (strlen(key_strings[j]) + 1) * sizeof(char);
    +
    +            memset(&value, 0, sizeof(DBT));
    +            payload = rand() + i;
    +            value.data = &payload;
    +            value.size = sizeof(int);
    +
    +            /* Perform the database put. */
    +            switch (ret = dbp->put(dbp, txn, &key, &value, 0)) {
    +                case 0:
    +                    break;
    +
    +                /*
    +                 * Here's where we perform deadlock detection. If 
    +                 * DB_LOCK_DEADLOCK is returned by the put operation, 
    +                 * then this thread has been chosen to break a deadlock.
    +                 * It must abort its operation, and optionally retry the
    +                 * put.
    +                 */
    +                case DB_LOCK_DEADLOCK:
    +                    /* 
    +                     * First that we MUST do is abort the 
    +                     * transaction.
    +                     */
    +                    (void)txn->abort(txn);
    +                    /*
    +                     * Now we decide if we want to retry the operation.
    +                     * If we have retried less than max_retries,
    +                     * increment the retry count and goto retry.
    +                     */
    +                    if (retry_count < max_retries) {
    +                        printf("Writer %i: Got DB_LOCK_DEADLOCK.\n", 
    +                            thread_num);
    +                        printf("Writer %i: Retrying write operation.\n",
    +                            thread_num);
    +                        retry_count++;
    +                        goto retry;
    +                    }
    +                    /*
    +                     * Otherwise, just give up.
    +                     */
    +                    printf("Writer %i: ", thread_num);
    +                    printf("Got DB_LOCK_DEADLOCK and out of retries.\n");
    +                    printf("Writer %i: Giving up.\n", thread_num);
    +                    return (EXIT_FAILURE);
    +                /* 
    +                 * If a generic error occurs, we simply abort the 
    +                 * transaction and exit the thread completely.
    +                 */
    +                default:
    +                    envp->err(envp, ret, "db put failed");
    +                    ret = txn->abort(txn);
    +                    if (ret != 0)
    +                        envp->err(envp, ret, "txn abort failed");
    +                    return (EXIT_FAILURE);
    +             } /** End case statement **/
    +
    +        }   /** End for loop **/  
    +

    + The only other change to writer_thread() + is that we pass count_records() a + transaction handle, rather than configuring our entire + application for uncommitted reads. Both mechanisms work well-enough + for preventing a self-deadlock. However, the individual count + in this example will tend to be lower than the counts seen in + the previous transaction example, because + count_records() can no longer see records + created but not yet committed by other threads. +

    +
            /* 
    +         * print the number of records found in the database. 
    +         * See count_records() for usage information.
    +         */
    +        printf("Thread %i. Record count: %i\n", thread_num, 
    +            count_records(dbp, txn));
    +
    +        /* 
    +         * If all goes well, we can commit the transaction and
    +         * loop to the next transaction.
    +         */
    +        ret = txn->commit(txn, 0);
    +        if (ret != 0) {
    +            envp->err(envp, ret, "txn commit failed");
    +            return (EXIT_FAILURE);
    +        }
    +    }
    +    return (EXIT_SUCCESS);
    +} 
    +

    + Next we update + count_records(). + + The only difference + here is that we no longer specify DB_READ_UNCOMMITTED when + we open our cursor. Note that even this minor change is not required. + If we do not configure our database to support uncommitted reads, + DB_READ_UNCOMMITTED on the cursor open will be silently + ignored. However, we remove the flag anyway from the cursor open so as to + avoid confusion. +

    +
    int
    +count_records(DB *dbp, DB_TXN *txn)
    +{
    +    DBT key, value;
    +    DBC *cursorp;
    +    int count, ret;
    +
    +    cursorp = NULL;
    +    count = 0;
    +
    +    /* Get the cursor */
    +    ret = dbp->cursor(dbp, txn, &cursorp, 0);
    +    if (ret != 0) {
    +        dbp->err(dbp, ret, "count_records: cursor open failed.");
    +        goto cursor_err;
    +    }
    +
    +    /* Get the key DBT used for the database read */
    +    memset(&key, 0, sizeof(DBT));
    +    memset(&value, 0, sizeof(DBT));
    +    do {
    +        ret = cursorp->c_get(cursorp, &key, &value, DB_NEXT);
    +        switch (ret) {
    +            case 0:
    +                count++;
    +                break;
    +            case DB_NOTFOUND:
    +                break;
    +            default:
    +                dbp->err(envp, ret, 
    +                    "Count records unspecified error");
    +                goto cursor_err;
    +        }
    +    } while (ret == 0);
    +
    +cursor_err:
    +    if (cursorp != NULL) {
    +        ret = cursorp->c_close(cursorp);
    +        if (ret != 0) {
    +            dbp->err(dbp, ret,
    +                "count_records: cursor close failed.");
    +        }
    +    }
    +
    +    return (count);
    +}
    +

    + Finally, we update + open_db(). + + This involves + removing DB_READ_UNCOMMITTED from the + open flags. + + We are also careful to change our database open error + message to no longer use the file_name + variable because that value will always be NULL for this example. +

    +
    /* Open a Berkeley DB database */
    +int
    +open_db(DB **dbpp, const char *progname, const char *file_name,
    +  DB_ENV *envp, u_int32_t extra_flags)
    +{
    +    int ret;
    +    u_int32_t open_flags;
    +    DB *dbp;
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "%s: %s\n", progname,
    +                db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +
    +    /* Point to the memory malloc'd by db_create() */
    +    *dbpp = dbp;
    +
    +    if (extra_flags != 0) {
    +        ret = dbp->set_flags(dbp, extra_flags);
    +        if (ret != 0) {
    +            dbp->err(dbp, ret, 
    +                "open_db: Attempt to set extra flags failed.");
    +            return (EXIT_FAILURE);
    +        }
    +    }
    +
    +    /* Now open the database */
    +    open_flags = DB_CREATE        | /* Allow database creation */ 
    +                 DB_THREAD        |        
    +                 DB_AUTO_COMMIT;    /* Allow auto commit */
    +
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    open_flags, /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        dbp->err(dbp, ret, "Database  open failed");
    +        return (EXIT_FAILURE);
    +    }
    +    return (EXIT_SUCCESS);
    +} 
    +

    + This completes our in-memory transactional example. If you would like to + experiment with this code, you can find the example in the following + location in your DB distribution: +

    +
    DB_INSTALL/examples_c/txn_guide
    +
    + + + diff --git a/db/docs/gsg_txn/C/introduction.html b/db/docs/gsg_txn/C/introduction.html new file mode 100644 index 000000000..0cd478d9a --- /dev/null +++ b/db/docs/gsg_txn/C/introduction.html @@ -0,0 +1,441 @@ + + + + + + Chapter 1. Introduction + + + + + + + + + +
    +
    +
    +
    +

    Chapter 1. Introduction

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Transaction Benefits + +
    +
    +
    +
    + + A Note on System Failure + +
    +
    + + Application Requirements + +
    +
    + + Multi-threaded + and Multi-process + Applications + +
    +
    +
    +
    + + Recoverability + +
    +
    + + Performance Tuning + +
    +
    +
    +

    + This book provides a thorough introduction and discussion on transactions as + used with Berkeley DB (DB). It begins by offering a general overview to + transactions, the guarantees they provide, and the general application + infrastructure required to obtain full transactional protection for your + data. +

    +

    + This book also provides detailed examples on how to write a + transactional application. Both single threaded and multi-threaded (as well as multi-process + applications) are discussed. A detailed description of various + backup and recovery strategies is included in this manual, as is a + discussion on performance considerations for your transactional application. +

    +

    + You should understand the concepts from the + + Getting Started with Berkeley DB + + + + guide before reading this book. +

    +
    +
    +
    +
    +

    Transaction Benefits

    +
    +
    +
    +
    +

    + Transactions offer your application's data protection from + application or system failures. That is, DB transactions offer + your application full ACID support: +

    +
    +
      +
    • +

      + Atomicity +

      +

      + Multiple database operations are treated as a single unit of + work. Once committed, all write operations performed under + the protection of the transaction are saved to your databases. + Further, in the event that you abort a transaction, all write + operations performed during the transaction are discarded. + In this event, your database is left in the state it was in + before the transaction began, regardless of the number or + type of write operations you may have performed during the + course of the transaction. +

      +

      + Note that DB transactions can span one or more + database handles. +

      +
    • +
    • +

      + Consistency +

      +

      + Your databases will never see a partially completed + transaction. This is true even if your application fails while there are + in-progress transactions. If the application or system fails, + then either all of the database changes appear when the + application next runs, or none of them appear. +

      +

      + In other words, whatever consistency requirements your application has will never be violated by DB. + If, for example, your application requires every record to include an employee ID, and your + code faithfully adds that ID to its database records, then DB will never + violate that consistency requirement. The ID will remain in the database records until such a time as your + application chooses to delete it. +

      +
    • +
    • +

      + Isolation +

      +

      + While a transaction is in progress, your databases will appear + to the transaction as if there are no other operations + occurring outside of the transaction. That is, operations + wrapped inside a transaction will always have a clean and + consistent view of your databases. They never have to see + updates currently in progress under the protection of another transaction. + Note, however, that isolation guarantees can be + + relaxed from the default setting. See + Isolation + for more information. +

      +
    • +
    • +

      + Durability +

      +

      + Once committed to your databases, your modifications will + persist even in the event of an application or system failure. + Note that like isolation, your durability guarantee can be + relaxed. See Non-Durable Transactions + for more information. +

      +
    • +
    +
    +
    +
    +
    +
    +

    A Note on System Failure

    +
    +
    +
    +
    +

    + From time to time this manual mentions that transactions protect your data against 'system or application + failure.' This is + true up to a certain extent. However, not all failures are created equal and no data protection + mechanism can protect you against every conceivable way a computing system can find to die. +

    +

    + Generally, when this book talks about protection against failures, it means that + transactions offer protection against + the likeliest culprits for system and application crashes. So long as your data modifications have been + committed to disk, those modifications should persist even if your application or OS subsequently fails. + And, even if the application or OS fails in the middle of a transaction commit (or abort), the data on disk + should be either in a consistent state, or there should be enough data available to bring + your databases into a consistent state (via a recovery procedure, for example). You may, however, + lose whatever data you were committing at the + time of the failure, but your databases will be otherwise unaffected. +

    +

    + Of course, if your disk fails, then the transactional benefits described in this book + are only as good as the backups you have taken. + + By spreading your data and log files across separate disks, + you can minimize the risk of data loss due to a disk failure, but even in this case it is possible to + conjure a scenario where even this protection is insufficient (a fire in the machine room, for example) and + you must go to your backups for protection. + +

    +

    + Finally, by following the programming examples shown in this book, you can write your code so as to protect + your data in the event that your code crashes. However, no programming API can protect you against logic + failures in your own code; transactions cannot protect you from simply writing the wrong thing to your + databases. +

    +
    +
    +
    +
    +
    +

    Application Requirements

    +
    +
    +
    +
    +

    + In order to use transactions, your application has certain + requirements beyond what is required of non-transactional protected + applications. They are: +

    +
    +
      +
    • +

      + Environments. +

      +

      + Environments are optional for non-transactional + applications, but they are required for transactional + applications. +

      +

      + Environment usage is described in detail in + Transaction Basics. +

      +
    • +
    • +

      + Transaction subsystem. +

      +

      + In order to use transactions, you must explicitly + enable the transactional subsystem for your + application, and this must be done at the time that + your environment is first created. +

      +
    • +
    • +

      + Logging subsystem. +

      +

      + The logging subsystem is required for recovery purposes, but + its usage also means your application may require a + little more administrative effort than it does when logging + is not in use. See Managing DB Files for more information. +

      +
    • +
    • +

      + DB_TXN + + + + handles. +

      +

      + In order to obtain the atomicity guarantee offered by + the transactional subsystem (that is, combine multiple + operations in a single unit of work), your application must use + transaction handles. These handles are obtained from your + DB_ENV + + + + objects. They should normally be short-lived, and their usage is + reasonably simple. To complete a transaction and save + the work it performed, you + call its commit() method. To + complete a transaction and discard its work, you call its + abort() method. +

      +

      + In addition, it is possible to use auto commit if you want + to transactional protect a single write operation. Auto + commit allows a transaction to be used without + obtaining an explicit transaction handle. See + Auto Commit + for information on how to use auto commit. +

      +
    • +
    • +

      + Database + + open requirements. +

      +

      + + In addition to using + environments and initializing the + correct subsystems, your + + application must transaction protect the database + + opens, + and any secondary index associations, + + if subsequent operations on the databases are to be transaction + protected. The database open and secondary index + association are commonly transaction protected using + auto commit. +

      +
    • +
    • +

      + Deadlock detection. +

      +

      + Typically transactional applications use multiple + threads of control when accessing the database. Any + time multiple threads are used on a single resource, + the potential for lock contention arises. In turn, lock + contention can lead to deadlocks. See + Locks, Blocks, and Deadlocks + for more information. +

      +

      + Therefore, transactional applications must frequently + include code for detecting and responding to deadlocks. + Note that this requirement is not + specific to transactions + – you can certainly write concurrent + non-transactional DB applications. Further, not + every transactional application uses concurrency and + so not every transactional application must + manage deadlocks. Still, deadlock management is so + frequently a characteristic of transactional + applications that we discuss it in this + book. See Concurrency + for more information. +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    Multi-threaded + and Multi-process + Applications

    +
    +
    +
    +
    +

    + DB is designed to support multi-threaded and + multi-process applications, but their usage means + you must pay careful attention to issues of concurrency. + Transactions help your application's concurrency by providing various levels of + isolation for your threads of control. In addition, DB + provides mechanisms that allow you to detect and respond to + deadlocks (but strictly speaking, this is not limited to just + transactional applications). +

    +

    + Isolation means that database modifications made by + one transaction will not normally be seen by readers from another + transaction until the first commits its changes. Different threads + use different transaction handles, so + this mechanism is normally used to provide isolation between + database operations performed by different threads. +

    +

    + Note that DB supports different isolation levels. For example, + you can configure your application to see uncommitted reads, which means + that one transaction can see data that has been modified but not yet + committed by another transaction. Doing this might mean your + transaction reads data "dirtied" by another transaction, + but which subsequently might change before that + other transaction commits its changes. + On the other hand, lowering your isolation + requirements means that your application can experience + improved throughput due to reduced lock contention. +

    +

    + For more information on concurrency, on managing isolation + levels, and on deadlock detection, see Concurrency. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/isolation.html b/db/docs/gsg_txn/C/isolation.html new file mode 100644 index 000000000..610e02b02 --- /dev/null +++ b/db/docs/gsg_txn/C/isolation.html @@ -0,0 +1,961 @@ + + + + + + Isolation + + + + + + + + + +
    +
    +
    +
    +

    Isolation

    +
    +
    +
    +
    +

    + Isolation guarantees are an important aspect of transactional + protection. Transactions + ensure the data your transaction is working with will not be changed by some other transaction. + Moreover, the modifications made by a transaction will never be viewable outside of that transaction until + the changes have been committed. +

    +

    + That said, there are different degrees of isolation, and you can choose to relax your isolation + guarantees to one degree or another depending on your application's requirements. The primary reason why + you might want to do this is because of performance; the more isolation you ask your transactions to + provide, the more locking that your application must do. With more locking comes a greater chance of + blocking, which in turn causes your threads to pause while waiting for a lock. Therefore, by relaxing + your isolation guarantees, you can potentially improve your application's throughput. + Whether you actually see any improvement depends, of course, on + the nature of your application's data and transactions. +

    +
    +
    +
    +
    +

    Supported Degrees of Isolation

    +
    +
    +
    +
    +

    + DB supports the following levels of isolation: +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DegreeANSI TermDefinition
    1READ UNCOMMITTED + Uncommitted reads means that one transaction will never + overwrite another transaction's dirty data. Dirty data is + data that a transaction has modified but not yet committed + to the underlying data store. However, uncommitted reads allows a + transaction to see data dirtied by another + transaction. In addition, a transaction may read data + dirtied by another transaction, but which subsequently + is aborted by that other transaction. In this latter + case, the reading transaction may be reading data that + never really existed in the database. +
    2READ COMMITTED +

    + Committed read isolation means that degree 1 is observed, except that dirty data is never read. +

    +

    + In addition, this isolation level guarantees that data will never change so long as + it is addressed by the cursor, but the data may change before the reading cursor is closed. + In the case of a transaction, data at the current + cursor position will not change, but once the cursor + moves, the previous referenced data can change. This + means that readers release read locks before the cursor + is closed, and therefore, before the transaction + completes. Note that this level of isolation causes the + cursor to operate in exactly the same way as it does in + the absence of a transaction. +

    +
    3SERIALIZABLE +

    + Committed read is observed, plus the data read by a transaction, T, + will never be dirtied by another transaction before T completes. + This means that both read and write locks are not + released until the transaction completes. +

    +

    + + In addition, + + + + + no transactions will see phantoms. Phantoms are records + returned as a result of a search, but which were not seen by + the same transaction when the identical + search criteria was previously used. +

    +

    + This is DB's default isolation guarantee. +

    +
    +
    +

    + + By default, DB transactions and transactional cursors offer + + serializable isolation. + + + + You can optionally reduce your isolation level by configuring DB to use + uncommitted read isolation. See + Reading Uncommitted Data + for more information. + + You can also configure DB to use committed read isolation. See + Committed Reads + for more information. + +

    +

    + Finally, in addition to DB's normal degrees of isolation, you + can also use snapshot isolation. This allows + you to avoid the read locks that serializable isolation requires. See + Using Snapshot Isolation + for details. +

    +
    +
    +
    +
    +
    +

    Reading Uncommitted Data

    +
    +
    +
    +
    +

    + You can configure your application to read data that has been modified but not yet + committed by another transaction; that is, dirty data. When you do this, you + may see a performance benefit by allowing your + application to not have to block waiting for write locks. On the other hand, the data that your + application is reading may change before the transaction has completed. +

    +

    + When used with transactions, uncommitted reads means that one transaction can see data + modified but not yet committed by another transaction. When + used with transactional cursors, uncommitted reads means + that any database reader can see data modified by the + cursor before the cursor's transaction has committed. +

    +

    + Because of this, uncommitted reads allow a transaction to read data + that may subsequently be aborted by another transaction. In + this case, the reading transaction will have read data that + never really existed in the database. +

    +

    + To configure your application to read uncommitted data: +

    +
    +
      +
    1. +

      + Open your database such that it will allow uncommitted reads. You do this by + + specifying DB_READ_UNCOMMITTED when you open your database. + + +

      +
    2. +
    3. +

      + + Specify DB_READ_UNCOMMITTED + when you create the transaction, + + open the cursor, or read a record from the database. + + + + + +

      +
    4. +
    +
    +

    + For example, the following opens the database such that it supports uncommitted reads, and then creates a + transaction that causes all reads performed within it to use uncommitted reads. Remember that simply opening + the database to support uncommitted reads is not enough; you must also declare your read operations to be + performed using uncommitted reads. +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    DB_TXN *txn;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    const char *keystr ="thekey";
    +    const char *datastr = "thedata";
    +    
    +    dbp = NULL;
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN;     /* Initialize transactions */
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database creation failed");
    +        goto err;
    +    }
    +
    +    db_flags = DB_CREATE |             /* Create the db if it does not 
    +                                        * exist */
    +               DB_AUTO_COMMIT |        /* Enable auto commit */
    +               DB_READ_UNCOMMITTED;    /* Enable uncommitted reads */
    +
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    db_flags,   /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database '%s' open failed",
    +            file_name);
    +        goto err;
    +    }
    +
    +    /* Get the txn handle */
    +    txn = NULL;
    +    ret = envp->txn_begin(envp, NULL, &txn, DB_READ_UNCOMMITTED);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Transaction begin failed.");
    +        goto err;
    +    }
    +
    +    /*
    +     * From here, you perform your database reads and writes as normal,
    +     * committing and aborting the transactions as is necessary, and 
    +     * testing for deadlock exceptions as normal (omitted for brevity). 
    +     */
    +
    +     ...  
    +
    +
    +
    +
    +
    +

    Committed Reads

    +
    +
    +
    +
    +

    + You can configure your transaction so that the data being + read by a transactional cursor is consistent so long as it + is being addressed by the cursor. However, once the cursor is done reading the + + + record (that is, reading records from the page that it currently has locked), + + the cursor releases its lock on that + + + record or page. + + This means that the data the cursor has read and released + may change before the cursor's transaction has completed. +

    +

    + For example, + suppose you have two transactions, Ta and Tb. Suppose further that + Ta has a cursor that reads record R, but does not modify it. Normally, + Tb would then be unable to write record R because + Ta would be holding a read lock on it. But when you configure your transaction for + committed reads, Tb can modify record + R before Ta completes, so long as the reading cursor is no longer + addressing the + + + record or page. + +

    +

    + When you configure your application for this level of isolation, you may see better performance + throughput because there are fewer read locks being held by your transactions. + Read committed isolation is most useful when you have a cursor that is reading and/or writing records in + a single direction, and that does not ever have to go back to re-read those same records. In this case, + you can allow DB to release read locks as it goes, rather than hold them for the life of the + transaction. +

    +

    + To configure your application to use committed reads, do one of the following: +

    +
    +
      +
    • +

      + Create your transaction such that it allows committed reads. You do this by + + specifying DB_READ_COMMITTED when you open the transaction. + + +

      +
    • +
    • +

      + + Specify DB_READ_COMMITTED + when you open the cursor. + + +

      +
    • +
    +
    +

    + For example, the following creates a transaction that allows committed reads: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    DB_TXN *txn;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    
    +    dbp = NULL;
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN;     /* Initialize transactions */
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database creation failed");
    +        goto err;
    +    }
    +
    +    /*
    +     * Notice that we do not have to specify any flags to the database to
    +     * allow committed reads (this is as opposed to uncommitted reads
    +     * where we DO have to specify a flag on the database open.
    +     */
    +    db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    db_flags,   /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database '%s' open failed",
    +            file_name);
    +        goto err;
    +    }
    +
    +    /* Get the txn handle */
    +    txn = NULL;
    +    /*
    +     * Open the transaction and enable committed reads. All cursors open
    +     * with this transaction handle will use read committed isolation.
    +     */
    +    ret = envp->txn_begin(envp, NULL, &txn, DB_READ_COMMITTED);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Transaction begin failed.");
    +        goto err;
    +    }
    +
    +    /*
    +     * From here, you perform your database reads and writes as normal,
    +     * committing and aborting the transactions as is necessary, and 
    +     * testing for deadlock exceptions as normal (omitted for brevity). 
    +     *
    +     * Using transactional cursors with concurrent applications is 
    +     * described in more detail in the following section.
    +     */
    +
    +     ...  
    +
    +
    +
    +
    +
    +

    Using Snapshot Isolation

    +
    +
    +
    +
    +

    + By default DB uses serializable isolation. An + important side effect of this isolation level is that + read operations obtain read locks on database pages, + and then hold those locks until the read operation is + completed. When you are using transactional cursors, this + means that read locks are held until the transaction commits or + aborts. In that case, over time a transactional cursor + can gradually block all other transactions from writing + to the database. +

    +

    + You can avoid this by using snapshot isolation. + Snapshot isolation uses multiversion + concurrency control to guarantee + repeatable reads. What this means is that every time a + writer would take a read lock on a page, instead a copy of + the page is made and the writer operations on that page + copy. This frees other writers from blocking due to a + read lock held on the page. +

    +
    +
    +
    +
    +

    Snapshot Isolation Cost

    +
    +
    +
    +
    +

    + Snapshot isolation does not come without a cost. + Because pages are being duplicated before being + operated upon, the cache will fill up faster. This + means that you might need a larger cache in order to + hold the entire working set in memory. +

    +

    + If the cache becomes full of page copies before old + copies can be discarded, additional I/O will occur as + pages are written to temporary "freezer" files on disk. + This can substantially reduce throughput, and should be + avoided if possible by configuring a large cache and + keeping snapshot isolation transactions short. +

    +

    + You can estimate how large your cache should be by + taking a checkpoint, followed by a call to the + DB_ENV->log_archive() + + + method. The amount of cache required is approximately + double the size of the remaining log files (that is, + the log files that cannot be archived). +

    +
    +
    +
    +
    +
    +

    Snapshot Isolation Transactional Requirements

    +
    +
    +
    +
    +

    + In addition to an increased cache size, you may also + need to increase the maximum number of transactions + that your application supports. (See +

    + Most of the configuration activities that you need to perform + for your transactional DB application will involve the + locking and logging subsystems. See + Concurrency + and + Managing DB Files + for details. +

    + However, there are a couple of things that you can do to + configure your transaction subsystem directly. These things + are: +

    • + Configure the maximum number of simultaneous + transactions needed by your application. + In general, you should not need to do this unless you + use deeply nested transactions or you have many threads all + of which have active transactions. In addition, you may + need to a higher maximum number of transactions if you + are using snapshot isolation. See + Snapshot Isolation Transactional Requirements + for details. +

      + By default, your application can support 20 active + transactions. +

      + You can set the maximum number of simultaneous + transactions supported by your application using + + the + DB_ENV->set_tx_max() + + method. Note that this method must be called + before the environment has been opened. + + +

      + If your application has exceeded this maximum value, + then any attempt to begin a new transaction will fail. +

      + This value can also be set using the + DB_CONFIG file's + set_tx_max parameter. Remember that + the DB_CONFIG must reside in your + environment home directory. +

    • +

      + + Configure the timeout value for your transactions. + + + + This value represents the longest period of time a + transaction can be active. Note, however, that + transaction timeouts are checked only when DB + examines its lock tables for blocked locks + (see Locks, Blocks, and Deadlocks + for more information). Therefore, a transaction's timeout can + have expired, but the application will not be notified until DB + has a reason to examine its lock tables. +

      +

      + Be aware that some transactions may be + inappropriately timed out before the transaction has a + chance to complete. You should therefore use this + mechanism only if you know your application + might have unacceptably long transactions and + you want to make sure your application will + not stall during their execution. + (This might happen if, for example, your + transaction blocks or requests too much + data.) +

      +

      + Note that by default transaction timeouts are set to 0 seconds, which means that they never time + out. +

      +

      + To set the maximum timeout value for your transactions, + use the + DB_ENV->set_timeout() + + + method. This method configures the entire + environment; not just the handle used to set the + configuration. Further, this value may + be set at any time during the application's + lifetime. +

      +

      + This value can also be set using the + DB_CONFIG file's + set_txn_timeout parameter. +

      + +

    + For example: +

    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    DB_TXN *txn;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN;     /* Initialize transactions */
    +
    +    /*
    +     * Configure a maximum transaction timeout of 1 second.
    +     */
    +    ret = envp->set_timeout(envp, DB_SET_TXN_TIMEOUT, 1000000);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error setting txn timeout: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /*
    +     * Configure 40 maximum transactions.
    +     */
    +    ret = envp->set_tx_max(envp, 40);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error setting max txns: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* 
    +     * From here, you open your databases, proceed with your 
    +     * database operations, and respond to deadlocks as 
    +     * is normal (omitted for brevity).
    +     */
    +     ...  
    + for details on how to set this.) + In the worst case scenario, you might need to configure your application for one + more transaction for every page in the cache. This is + because transactions are retained until the last page + they created is evicted from the cache. +

    +
    +
    +
    +
    +
    +

    When to Use Snapshot Isolation

    +
    +
    +
    +
    +

    + Snapshot isolation is best used when all or most + of the following conditions are true: +

    +
    +
      +
    • +

      + You can have a large cache relative to your working data set size. +

      +
    • +
    • +

      + You require repeatable reads. +

      +
    • +
    • +

      + You will be using transactions that routinely work on + the entire database, or more commonly, + there is data in your database that will be very + frequently written by more than one transaction. +

      +
    • +
    • +

      + Read/write contention is + limiting your application's + throughput, or the application + is all or mostly read-only and + contention for the lock manager + mutex is limiting throughput. +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    How to use Snapshot Isolation

    +
    +
    +
    +
    +

    + You use snapshot isolation by: +

    +
    +
      +
    • +

      + Opening the database with + multiversion support. You can + configure this either when you + open your environment or when + you open your database. + + Use the + DB_MULTIVERSION + flag to configure this support. + + + +

      +
    • +
    • +

      + Configure your cursor or + transaction to use snapshot + isolation. +

      +

      + To do this, + + + pass the + DB_TXN_SNAPSHOT flag + when you open the cursor or + create the transaction. If + configured for the transaction, + then this flag is not required + when the cursor is opened. + + + +

      +
    • +
    +
    +

    + The simplest way to take advantage of snapshot + isolation is for queries: keep update + transactions using full read/write locking and + use snapshot isolation on read-only transactions or + cursors. This should minimize blocking of + snapshot isolation transactions and will avoid + deadlock errors. +

    +

    + If the application has update transactions which + read many items and only update a small set (for + example, scanning until a desired record is + found, then modifying it), throughput may be + improved by running some updates at snapshot + isolation as well. But doing this means that + you must manage deadlock errors. + See + Resolving Deadlocks + for details. +

    +

    + The following code fragment turns + on snapshot isolation for a transaction: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    
    +    dbp = NULL;
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE |    /* Create the environment if it does 
    +                                * not already exist. */
    +                DB_INIT_TXN  | /* Initialize transactions */
    +                DB_INIT_LOCK | /* Initialize locking. */
    +                DB_INIT_LOG  | /* Initialize logging */
    +                DB_INIT_MPOOL| /* Initialize the in-memory cache. */
    +                DB_MULTIVERSION; /* Support snapshot isolation */
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database creation failed");
    +        goto err;
    +    }
    +
    +    /* 
    +     * Nothing needs to be supplied here to support snapshot isolation. 
    +     * The environment does, so its databases will too.
    +     */
    +    db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    db_flags,   /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database '%s' open failed",
    +            file_name);
    +        goto err;
    +    }
    +
    +
    +    ....
    +
    +    ret = envp->txn_begin(envp, NULL, &txn, DB_TXN_SNAPSHOT);
    +
    +    /* remainder of the program omitted for brevity */
    +
    + 
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/lockingsubsystem.html b/db/docs/gsg_txn/C/lockingsubsystem.html new file mode 100644 index 000000000..8311ce3b0 --- /dev/null +++ b/db/docs/gsg_txn/C/lockingsubsystem.html @@ -0,0 +1,558 @@ + + + + + + The Locking Subsystem + + + + + + + + + +
    +
    +
    +
    +

    The Locking Subsystem

    +
    +
    +
    +
    +

    + In order to allow concurrent operations, DB provides the locking + subsystem. This subsystem provides inter- and intra- process + concurrency mechanisms. It is extensively used by DB concurrent + applications, but it can also be generally used for non-DB + resources. +

    +

    + This section describes the locking subsystem as it is used to + protect DB resources. In particular, issues on configuration are + examined here. For information on using the locking subsystem to + manage non-DB resources, see the + Berkeley DB Programmer's Reference Guide. +

    +
    +
    +
    +
    +

    Configuring the Locking Subsystem

    +
    +
    +
    +
    +

    + You initialize the locking subsystem by specifying + + DB_INIT_LOCK to the + DB_ENV->open() + + method. + + +

    +

    + Before opening your environment, you can configure various + maximum values for your locking subsystem. Note that these + limits can only be configured before the environment is + opened. Also, these methods configure the entire environment, + not just a specific environment handle. +

    +

    + Finally, each bullet below identifies the + DB_CONFIG file parameter that can be used + to specify the specific locking limit. If used, these + DB_CONFIG file parameters override any + value that you might specify using the environment handle. +

    +

    + The limits that you can configure are as follows: +

    +
    +
      +
    • +

      + The maximum number of lockers + supported by the environment. This value is used by + the environment when it is opened to estimate the amount + of space that it should allocate for various internal + data structures. By default, 1,000 lockers are + supported. +

      +

      + To configure this value, use the + + DB_ENV->set_lk_max_lockers() + + method. + + +

      +

      + As an alternative to this method, you can configure this + value using the DB_CONFIG file's + set_lk_max_lockers parameter. +

      +
    • +
    • +

      + The maximum number of locks supported by the environment. + By default, 1,000 locks are supported. +

      +

      + To configure this value, use the + + DB_ENV->set_lk_max_locks() + + method. + + +

      +

      + As an alternative to this method, you can configure this + value using the DB_CONFIG file's + set_lk_max_locks parameter. +

      +
    • +
    • +

      + The maximum number of locked objects supported by the environment. + By default, 1,000 objects can be locked. +

      +

      + To configure this value, use the + + DB_ENV->set_lk_max_objects() + + method. + + +

      +

      + As an alternative to this method, you can configure this + value using the DB_CONFIG file's + set_lk_max_objects parameter. +

      +
    • +
    +
    +

    + For a definition of lockers, locks, and locked objects, see + Lock Resources. +

    +

    + For example, to configure the maximum number of locks that your + environment can use: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t env_flags;
    +    DB_ENV *envp;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN;     /* Initialize transactions */
    +                                                                                                                                  
    +    /* Configure max locks */
    +    ret = envp->set_lk_max_locks(envp, 5000);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error configuring locks: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* Open the environment. */
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +err:
    +    /* Close the environment */
    +    if (envp != NULL) {
    +        ret_c = envp->close(envp, 0);
    +        if (ret_c != 0) {
    +            fprintf(stderr, "environment close failed: %s\n",
    +                db_strerror(ret_c));
    +            ret = ret_c;
    +        }
    +    }
    +
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +} 
    +
    +
    +
    +
    +
    +

    Configuring Deadlock Detection

    +
    +
    +
    +
    +

    + In order for DB to know that a deadlock has occurred, + some mechanism must be used to perform deadlock + detection. There are three ways that deadlock detection can + occur: +

    +
    +
      +
    1. +

      + Allow DB to internally detect deadlocks as they + occur. +

      +

      + To do this, you use + DB_ENV->set_lk_detect(). + + + This method causes DB to walk its internal lock table + looking for a deadlock whenever a lock request + is blocked. This method also identifies how DB decides which lock + requests are rejected when deadlocks are detected. For example, + DB can decide to reject the lock request for the transaction + that has the most number of locks, the least number of locks, + holds the oldest lock, holds the most number of write locks, and + so forth (see the API reference documentation for a complete + list of the lock detection policies). +

      +

      + You can call this method at any time during your application's + lifetime, but typically it is used before you open your environment. +

      +

      + Note that how you want DB to decide which thread of control should break a deadlock is + extremely dependent on the nature of your application. It is not unusual for some performance + testing to be required in order to make this determination. That said, a transaction that is + holding the maximum number of locks is usually indicative of the transaction that has performed + the most amount of work. Frequently you will not want a transaction that has performed a lot of + work to abandon its efforts and start all over again. It is not therefore uncommon for + application developers to initially select the transaction with the minimum + number of write locks to break the deadlock. +

      +

      + Using this mechanism for deadlock detection means + that your application will never have to wait on a + lock before discovering that a deadlock has + occurred. However, walking the lock table every + time a lock request is blocked can be expensive + from a performance perspective. +

      +
    2. +
    3. +

      + Use a dedicated thread or external process to perform + deadlock detection. Note that this thread must be + performing no other database operations beyond deadlock + detection. +

      +

      + To externally perform lock detection, you can use + either the + DB_ENV->lock_detect() + + + method, or use the + db_deadlock command line + utility. This method (or command) causes DB to walk the + lock table looking for deadlocks. +

      +

      + Note that like + DB_ENV->set_lk_detect(), + + + you also use this method (or command line utility) + to identify which lock requests are rejected in the + event that a deadlock is detected. +

      +

      + Applications that perform deadlock detection in + this way typically run deadlock detection between every few + seconds and a minute. This means that your + application may have to wait to be notified of a + deadlock, but you also save the overhead of walking + the lock table every time a lock request is blocked. +

      +
    4. +
    5. +

      + Lock timeouts. +

      +

      + You can configure your locking subsystem such that + it times out any lock that is not released within a + specified amount of time. To do this, use the + DB_ENV->set_timeout() + + + method. + Note that lock timeouts are only checked when a + lock request is blocked or when deadlock + detection is otherwise performed. Therefore, a lock can have timed out and still be held for + some length of time until DB has a reason to examine its locking tables. +

      +

      + Be aware that extremely long-lived transactions, or + operations that hold locks for a long time, may be + inappropriately timed out before the transaction or + operation has a chance to complete. You should + therefore use this mechanism only if you know your + application will hold locks for very short periods + of time. +

      +
    6. +
    +
    +

    + For example, to configure your application such that DB + checks the lock table for deadlocks every time a lock + request is blocked: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    DB_TXN *txn;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN;     /* Initialize transactions */
    +
    +    /*
    +     * Configure db to perform deadlock detection internally, and to
    +     * choose the transaction that has performed the least amount of writing
    +     * to break the deadlock in the event that one is detected.
    +     */
    +    ret = envp->set_lk_detect(envp, DB_LOCK_MINWRITE);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error setting lk detect: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* 
    +     * From here, you open your databases, proceed with your 
    +     * database operations, and respond to deadlocks as 
    +     * is normal (omitted for brevity).
    +     */
    +
    +     ...  
    +

    + Finally, the following command line call causes + deadlock detection to be run against the + environment contained in /export/dbenv. The + transaction with the youngest lock is chosen to break the + deadlock: +

    +
    > /usr/local/db_install/bin/db_deadlock -h /export/dbenv -a y
    +

    + For more information, see the + + db_deadlock reference documentation. + +

    +
    +
    +
    +
    +
    +

    Resolving Deadlocks

    +
    +
    +
    +
    +

    + When DB determines that a deadlock has occurred, it will + select a thread of control to resolve the deadlock and then + + return DB_LOCK_DEADLOCK to that + thread. + + + + + If a deadlock is detected, the thread must: +

    +
    +
      +
    1. +

      + Cease all read and write operations. +

      +
    2. +
    3. +

      + Close all open cursors. +

      +
    4. +
    5. +

      + Abort the transaction. +

      +
    6. +
    7. +

      + Optionally retry the operation. If your application + retries deadlocked operations, the new attempt must + be made using a new transaction. +

      +
    8. +
    +
    +
    +

    Note

    +

    + If a thread has deadlocked, it may not make any + additional database calls using the handle that has + deadlocked. +

    +
    +

    + For example: +

    +
    retry:
    +    ret = envp->txn_begin(envp, NULL, &txn, 0);
    +    if (ret != 0) {
    +            envp->err(envp, ret, "txn_begin failed");
    +            return (EXIT_FAILURE);
    +    }
    +    ...
    +    /* key and data are Dbts. Their usage is omitted for brevity. */
    +    ...
    +    switch (ret = dbp->put(dbp, txn, &key, &data, 0)) {
    +        case 0:
    +            break;
    +        /* Deadlock handling goes here */
    +        case DB_LOCK_DEADLOCK:
    +            /* Abort the transaction */
    +            (void)txn->abort(txn);
    +
    +            /* 
    +             * retry_count is a counter used to identify how many times
    +             * we've retried this operation. To avoid the potential for
    +             * endless looping, we won't retry more than 
    +             * MAX_DEADLOCK_RETRIES times.
    +             */
    +            if (retry_count < MAX_DEADLOCK_RETRIES) {
    +                printf("Got DB_LOCK_DEADLOCK.\n");
    +                printf("Retrying write operation.\n");
    +                    retry_count++;
    +                    goto retry;
    +             }
    +             printf("Got DB_LOCK_DEADLOCK and out of retries.");
    +             printf("Giving up.\n");
    +             return (EXIT_FAILURE);
    +         default:
    +            /* If some random database error occurs, we just give up */
    +            envp->err(envp, ret, "db put failed");
    +            ret = txn->abort(txn);
    +            if (ret != 0) {
    +                envp->err(envp, ret, "txn abort failed");
    +                return (EXIT_FAILURE);
    +             } 
    +         }
    +    /* If all goes well, commit the transaction */
    +    ret = txn->commit(txn, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "txn commit failed");
    +        return (EXIT_FAILURE);
    +    }
    +
    +    return (EXIT_SUCCESS); 
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/logconfig.html b/db/docs/gsg_txn/C/logconfig.html new file mode 100644 index 000000000..3a5485ca8 --- /dev/null +++ b/db/docs/gsg_txn/C/logconfig.html @@ -0,0 +1,444 @@ + + + + + + Configuring the Logging Subsystem + + + + + + + + + +
    +
    +
    +
    +

    Configuring the Logging Subsystem

    +
    +
    +
    +
    +

    + You can configure the following aspects of the logging + subsystem: +

    +
    + +
    +
    +
    +
    +
    +

    Setting the Log File Size

    +
    +
    +
    +
    +

    + Whenever a pre-defined amount of data is written to a + log file (10 MB by default), DB stops using the + current log file and starts writing to a new file. + You can change the maximum amount of data contained in each + log file by using the + + DB_ENV->set_lg_max() + + method. + + + Note that this method can be used at any time + during an application's lifetime. +

    +

    + Setting the log file size to something larger than its + default value is largely a matter of + convenience and a reflection of the application's + preference in backup media and frequency. However, if + you set the log file size too low relative to your + application's traffic patterns, you can cause + yourself trouble. +

    +

    + From a performance perspective, setting the log file + size to a low value can cause your active transactions to + pause their writing activities more frequently than would + occur with larger log file sizes. Whenever a + transaction completes the log buffer is flushed to + disk. Normally other transactions can continue to + write to the log buffer while this flush is in + progress. However, when one log file is being closed + and another created, all transactions must cease + writing to the log buffer until the switch over is + completed. +

    +

    + Beyond performance concerns, using smaller log files + can cause you to use more physical files on disk. + As a result, your application could run out + of log sequence numbers, depending on how busy your + application is. +

    +

    + Every log file is identified with a 10 digit number. + Moreover, the maximum number of log files that your application + is allowed to create in its lifetime is 2,000,000,000. +

    +

    + For example, if your application performs 6,000 transactions per + second for 24 hours a day, and you are logging 500 bytes of + data per transaction into 10 MB log files, then you + will run out of log files in around 221 years: +

    +
         (10 * 2^20 * 2000000000) / (6000 * 500 * 365 * 60 *60 * 24) = 221 
    +

    + However, if you were writing 2000 bytes of data per + transaction, and using 1 MB log files, then the same + formula shows you running out of log files in 5 years time. +

    +

    + All of these time frames are quite long, to be sure, + but if you do run out of log files after, say, 5 years + of continuous operations, then you must reset your log + sequence numbers. To do so: +

    +
    +
      +
    1. +

      + Backup your databases as if to prepare for + catastrophic failure. See + Backup Procedures + for more information. +

      +
    2. +
    3. +

      + Reset the log file's sequence number using the + db_load utility's + -r option. +

      +
    4. +
    5. +

      + Remove all of the log files from your + environment. Note that this is the only + situation in which all of the log files are + removed from an environment; in all other + cases, at least a single log file is retained. +

      +
    6. +
    7. +

      + Restart your application. +

      +
    8. +
    +
    +
    +
    +
    +
    +
    +

    Configuring the Logging Region Size

    +
    +
    +
    +
    +

    + The logging subsystem's default region size is 60 KB. The + logging region is used to store filenames, and so you may + need to increase its size if a large number of files (that + is, if you have a very large number of databases) will + be opened and registered with DB's log manager. +

    +

    + You can set the size of your logging region by using the + + DB_ENV->set_lg_regionmax() + + + + method. Note that this method can only be called before the + first environment handle for your application is opened. +

    +
    +
    +
    +
    +
    +

    Configuring In-Memory Logging

    +
    +
    +
    +
    +

    + It is possible to configure your logging subsystem such + that logs are maintained entirely in memory. When + you do this, you give up your transactional durability + guarantee. Without log files, you have no way to run + recovery so any system or software failures that you might + experience can corrupt your databases. +

    +

    + However, by giving up your durability guarantees, you can + greatly improve your application's throughput by avoiding + the disk I/O necessary to write logging information to + disk. In this case, you still retain your transactional + atomicity, consistency, and isolation guarantees. +

    +

    + To configure your logging subsystem to maintain your logs + entirely in-memory: +

    +
    +
      +
    • +

      + Make sure your log buffer is capable of holding all + log information that can accumulate during the longest + running transaction. See Setting the In-Memory Log Buffer Size for details. +

      +
    • +
    • +

      + Do not run normal recovery when you open your environment. In this configuration, there are no + log files available against which you can run recovery. As a result, if you specify recovery + when you open your environment, it is ignored. +

      +
    • +
    • +

      + Specify + + DB_LOG_INMEMORY to the + DB_ENV->set_flags() + + + + method. Note that you must specify this before + your application opens its first environment + handle. +

      +
    • +
    +
    +

    + For example: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB_ENV *envp;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +
    +    envp = NULL;
    +
    +    /* Create the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +
    +    /* 
    +     * Indicate that logging is to be performed only in memory. 
    +     * Doing this means that we give up our transactional durability
    +     * guarantee.
    +     */
    +    envp->set_flags(envp, DB_LOG_INMEMORY, 1);
    +
    +    /* 
    +     * Configure the size of our log memory buffer. This must be
    +     * large enough to hold all the logging information likely
    +     * to be created for our longest running transaction. The
    +     * default size for the logging buffer is 1 MB when logging
    +     * is performed in-memory. For this example, we arbitrarily
    +     * set the logging buffer to 5 MB.
    +     */
    +     ret = envp->set_lg_bsize(envp, 5 * 1024 * 1024);
    +     if (ret != 0) {
    +        fprintf(stderr, "Error setting log buffer size: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +     }
    +
    +    /* 
    +     * Set the normal flags for a transactional subsystem. Note that
    +     * we DO NOT specify DB_RECOVER. Also, remember that the logging 
    +     * subsystem is automatically enabled when we initialize the
    +     * transactional subsystem, so we do not explicitly enable
    +     * logging here.
    +     */
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN;     /* Initialize transactions */
    +
    +    /* Open the environment as normal */
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +
    +     /*
    +      * From here, you create transactions and perform database operations
    +      * exactly as you would if you were logging to disk. This part is
    +      * omitted for brevity.
    +      */
    +
    +      ...
    +
    +err:
    +    /* Close the databases (omitted) */
    +
    +    ...
    +
    +    /* Close the environment */
    +    if (envp != NULL) {
    +        ret_c = envp->close(envp, 0);
    +        if (ret_c != 0) {
    +            fprintf(stderr, "environment close failed: %s\n",
    +                db_strerror(ret_c));
    +            ret = ret_c;
    +        }
    +    }
    +
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +} 
    +
    +
    +
    +
    +
    +

    Setting the In-Memory Log Buffer Size

    +
    +
    +
    +
    +

    + When your application is configured for on-disk logging + (the default behavior for transactional applications), log + information is stored in-memory until the storage space + fills up, or a transaction commit forces the log + information to be flushed to disk. +

    +

    + It is possible to increase the amount of memory available + to your file log buffer. Doing so improves throughput for + long-running transactions, or for transactions that produce + a large amount of data. +

    +

    + When you have your logging subsystem configured to maintain + your log entirely in memory (see + Configuring In-Memory Logging), it is very important + to configure your log buffer size because the log buffer + must be capable of holding all log information that can + accumulate during the longest running transaction. + You must make sure that the in-memory log buffer size is + large enough that no transaction will ever span the entire + buffer. You must also avoid a state where the in-memory + buffer is full and no space can be freed because a + transaction that started the first log "file" is still + active. +

    +

    + When your logging subsystem is configured for on-disk + logging, the default log buffer space is 32 KB. When + in-memory logging is configured, the default log buffer + space is 1 MB. +

    +

    + You can increase your log buffer space using the + + DB_ENV->set_lg_bsize() + + + + method. Note that this method can only be called before the + first environment handle for your application is opened. +

    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/logfileremoval.html b/db/docs/gsg_txn/C/logfileremoval.html new file mode 100644 index 000000000..0ed044eb3 --- /dev/null +++ b/db/docs/gsg_txn/C/logfileremoval.html @@ -0,0 +1,206 @@ + + + + + + Removing Log Files + + + + + + + + + +
    +
    +
    +
    +

    Removing Log Files

    +
    +
    +
    +
    +

    + By default DB does not delete log files for you. For this reason, + DB's log files will eventually grow to consume an + unnecessarily large amount of disk space. To guard against + this, you should periodically take administrative action to + remove log files that are no longer in use by your application. +

    +

    + You can remove a log file if all of the following are true: +

    +
    +
      +
    • +

      + the log file is not involved in an active transaction. +

      +
    • +
    • +

      + a checkpoint has been performed + after the log file was + created. +

      +
    • +
    • +

      + the log file is not the only log file in the + environment. +

      +
    • +
    • +

      + the log file that you want to remove has already been + included in an offline or hot backup. + Failure to observe this last condition can cause your + backups to be unusable. +

      +
    • +
    +
    +

    + DB provides several mechanisms to remove log files that + meet all but the last criteria (DB has no way to know which + log files have already been included in a backup). The + following mechanisms make it easy to remove unneeded log files, + but can result in an unusable backup if the log files are not first + saved to your archive location. All of the following + mechanisms automatically delete unneeded log files for you: +

    +
    +
      +
    • +

      + Run the db_archive command line + utility with the -d option. +

      +
    • +
    • +

      + From within your application, call the + + DB_ENV->log_archive() + + method with the DB_ARCH_REMOVE flag. + + +

      +
    • +
    • +

      + + Call + DB_ENV->set_flags() + + method with the DB_LOG_AUTOREMOVE flag. + Note that this flag can be set at any point in + the lifetime of your application. Setting this + parameter affects all environment handles + opened against the environment; not just the + handle used to set the flag. + + +

      +

      + Note that unlike the other log removal mechanisms + identified here, this method actually causes log files + to be removed on an on-going basis as they become + unnecessary. This is extremely desirable behavior if + what you want is to use the absolute minimum amount of + disk space possible for your application. This + mechanism will leave you with + the log files that are required to run normal recovery. + However, it is highly likely that this mechanism will + prevent you from running catastrophic recovery. +

      +

      + Do NOT use this mechanism if you want to be able to + perform catastrophic recovery, or if you want to be + able to maintain a hot backup. +

      +
    • +
    +
    +

    + In order to safely remove log files and still be able to + perform catastrophic recovery, use the + db_archive command line utility as follows: +

    +
    +
      +
    1. +

      + Run either a normal or hot backup as described in + Backup Procedures. Make + sure that all of this data is safely stored to your + backup media before continuing. +

      +
    2. +
    3. +

      + If you have not already done so, perform a checkpoint. + See Checkpoints + for more information. +

      +
    4. +
    5. +

      + If you are maintaining a hot backup, perform the hot + backup procedure as described in + Using Hot Failovers. +

      +
    6. +
    7. +

      + Run the db_archive command line + utility with the -d option against + your production environment. +

      +
    8. +
    9. +

      + Run the db_archive command line + utility with the -d option against + your failover environment, if you are maintaining one. +

      +
    10. +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/maxtxns.html b/db/docs/gsg_txn/C/maxtxns.html new file mode 100644 index 000000000..311587dbf --- /dev/null +++ b/db/docs/gsg_txn/C/maxtxns.html @@ -0,0 +1,239 @@ + + + + + + Configuring the Transaction Subsystem + + + + + + + + + +
    +
    +
    +
    +

    Configuring the Transaction Subsystem

    +
    +
    +
    +
    +

    + Most of the configuration activities that you need to perform + for your transactional DB application will involve the + locking and logging subsystems. See + Concurrency + and + Managing DB Files + for details. +

    +

    + However, there are a couple of things that you can do to + configure your transaction subsystem directly. These things + are: +

    +
    +
      +
    • +

      + Configure the maximum number of simultaneous + transactions needed by your application. + In general, you should not need to do this unless you + use deeply nested transactions or you have many threads all + of which have active transactions. In addition, you may + need to a higher maximum number of transactions if you + are using snapshot isolation. See + Snapshot Isolation Transactional Requirements + for details. +

      +

      + By default, your application can support 20 active + transactions. +

      +

      + You can set the maximum number of simultaneous + transactions supported by your application using + + the + DB_ENV->set_tx_max() + + method. Note that this method must be called + before the environment has been opened. + + +

      +

      + If your application has exceeded this maximum value, + then any attempt to begin a new transaction will fail. +

      +

      + This value can also be set using the + DB_CONFIG file's + set_tx_max parameter. Remember that + the DB_CONFIG must reside in your + environment home directory. +

      +
    • +
    • + +

      + + Configure the timeout value for your transactions. + + + + This value represents the longest period of time a + transaction can be active. Note, however, that + transaction timeouts are checked only when DB + examines its lock tables for blocked locks + (see Locks, Blocks, and Deadlocks + for more information). Therefore, a transaction's timeout can + have expired, but the application will not be notified until DB + has a reason to examine its lock tables. +

      +

      + Be aware that some transactions may be + inappropriately timed out before the transaction has a + chance to complete. You should therefore use this + mechanism only if you know your application + might have unacceptably long transactions and + you want to make sure your application will + not stall during their execution. + (This might happen if, for example, your + transaction blocks or requests too much + data.) +

      +

      + Note that by default transaction timeouts are set to 0 seconds, which means that they never time + out. +

      +

      + To set the maximum timeout value for your transactions, + use the + DB_ENV->set_timeout() + + + method. This method configures the entire + environment; not just the handle used to set the + configuration. Further, this value may + be set at any time during the application's + lifetime. +

      +

      + This value can also be set using the + DB_CONFIG file's + set_txn_timeout parameter. +

      + +
      +
    • +
    +
    +

    + For example: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    DB_TXN *txn;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN;     /* Initialize transactions */
    +
    +    /*
    +     * Configure a maximum transaction timeout of 1 second.
    +     */
    +    ret = envp->set_timeout(envp, DB_SET_TXN_TIMEOUT, 1000000);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error setting txn timeout: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /*
    +     * Configure 40 maximum transactions.
    +     */
    +    ret = envp->set_tx_max(envp, 40);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error setting max txns: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* 
    +     * From here, you open your databases, proceed with your 
    +     * database operations, and respond to deadlocks as 
    +     * is normal (omitted for brevity).
    +     */
    +     ...  
    +
    + + + diff --git a/db/docs/gsg_txn/C/nestedtxn.html b/db/docs/gsg_txn/C/nestedtxn.html new file mode 100644 index 000000000..c202d794d --- /dev/null +++ b/db/docs/gsg_txn/C/nestedtxn.html @@ -0,0 +1,140 @@ + + + + + + Nested Transactions + + + + + + + + + +
    +
    +
    +
    +

    Nested Transactions

    +
    +
    +
    +
    +

    + A nested transaction is used to provide a + transactional guarantee for a subset of operations performed within + the scope of a larger transaction. Doing this allows you to commit + and abort the subset of operations independently of the larger + transaction. +

    +

    + The rules to the usage of a nested transaction are as follows: +

    +
    +
      +
    • +

      + While the nested (child) transaction is active, the parent + transaction may not perform any operations other than to commit + or abort, or to create more child transactions. +

      +
    • +
    • +

      + Committing a nested transaction has no effect on the state + of the parent transaction. The parent transaction is still + uncommitted. However, the parent transaction can now + see any modifications made by the child transaction. + Those modifications, of course, are still hidden to all + other transactions until the parent also commits. +

      +
    • +
    • +

      + Likewise, aborting the nested transaction has no effect on + the state of the parent transaction. The only result of the + abort is that neither the parent nor any + other transactions will see any of the + database modifications performed under the protection of the + nested transaction. +

      +
    • +
    • +

      + If the parent transaction commits or aborts while it has + active children, the child transactions are resolved in the + same way as the parent. That is, if the parent aborts, then + the child transactions abort as well. If the parent commits, + then whatever modifications have been performed by the child + transactions are also committed. +

      +
    • +
    • +

      + The locks held by a nested transaction are not released when + that transaction commits. Rather, they are now held by the + parent transaction until such a time as that parent commits. +

      +
    • +
    • +

      + Any database modifications performed by the nested transaction + are not visible outside of the larger encompassing + transaction until such a time as that parent transaction is + committed. +

      +
    • +
    • +

      + The depth of the nesting that you can achieve with nested + transaction is limited only by memory. +

      +
    • +
    +
    +

    + To create a nested transaction, simply pass the parent transaction's + handle when you created the nested transaction's handle. For + example: +

    +
        /* parent transaction */
    +    DB_TXN *parent_txn, *child_txn;
    +    ret = envp->txn_begin(envp, NULL, &parent_txn, 0);
    +    /* child transaction */
    +    ret = envp->txn_begin(envp, parent_txn, &child_txn, 0); 
    +
    + + + diff --git a/db/docs/gsg_txn/C/perftune-intro.html b/db/docs/gsg_txn/C/perftune-intro.html new file mode 100644 index 000000000..e9dff26fc --- /dev/null +++ b/db/docs/gsg_txn/C/perftune-intro.html @@ -0,0 +1,88 @@ + + + + + + Performance Tuning + + + + + + + + + +
    +
    +
    +
    +

    Performance Tuning

    +
    +
    +
    +
    +

    + From a performance perspective, the use of transactions is not free. + Depending on how you configure them, transaction commits + usually require your application to perform disk I/O that a non-transactional + application does not perform. Also, for multi-threaded + and + multi-process applications, the use of transactions can + result in increased lock contention due to extra locking + requirements driven by transactional isolation guarantees. +

    +

    + There is therefore a performance tuning component to transactional applications + that is not applicable for non-transactional applications (although + some tuning considerations do exist whether or not your application uses + transactions). Where appropriate, these tuning considerations are + introduced in the following chapters. + + + However, for a more complete description of them, see the + + Transaction tuning + + and + + Transaction throughput + + sections of the Berkeley DB Programmer's Reference Guide. + + +

    +
    + + + diff --git a/db/docs/gsg_txn/C/preface.html b/db/docs/gsg_txn/C/preface.html new file mode 100644 index 000000000..e0a70ee9f --- /dev/null +++ b/db/docs/gsg_txn/C/preface.html @@ -0,0 +1,215 @@ + + + + + + Preface + + + + + + + + + +
    +
    +
    +
    +

    Preface

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +

    + This document describes how to use transactions with your Berkeley DB + applications. It is intended to describe how to + transaction protect your application's data. The APIs used to perform this task + are described here, as are the environment infrastructure and administrative tasks + required by a transactional application. This book also + describes multi-threaded and + multi-process DB applications and the requirements they + have for deadlock detection. +

    +

    + This book is aimed at the software engineer responsible for writing a + transactional DB application. +

    +

    + This book assumes that you have already read and understood the + concepts contained in the + Getting Started with Berkeley DB + guide. + + +

    +
    +
    +
    +
    +

    Conventions Used in this Book

    +
    +
    +
    +
    +

    + The following typographical conventions are used within in this manual: +

    +

    + Structure names are represented in monospaced font, as are method + names. For example: "DB->open() is a method + on a DB handle." +

    +

    + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALL directory." +

    +

    + Program examples are displayed in a monospaced font on a shaded background. + For example: +

    +
    /* File: gettingstarted_common.h */
    +typedef struct stock_dbs {
    +    DB *inventory_dbp; /* Database containing inventory information */
    +    DB *vendor_dbp;    /* Database containing vendor information */
    +
    +    char *db_home_dir;       /* Directory containing the database files */
    +    char *inventory_db_name; /* Name of the inventory database */
    +    char *vendor_db_name;    /* Name of the vendor database */
    +} STOCK_DBS; 
    +

    + In some situations, programming examples are updated from one chapter to the next. When + this occurs, the new code is presented in monospaced bold font. For example: +

    +
    typedef struct stock_dbs {
    +    DB *inventory_dbp; /* Database containing inventory information */
    +    DB *vendor_dbp;    /* Database containing vendor information */
    +    DB *itemname_sdbp; /* Index based on the item name index */
    +    char *db_home_dir;       /* Directory containing the database files */
    +    char *itemname_db_name;  /* Itemname secondary database */
    +    char *inventory_db_name; /* Name of the inventory database */
    +    char *vendor_db_name;    /* Name of the vendor database */
    +} STOCK_DBS; 
    +
    +

    Note

    +

    + Finally, notes of special interest are represented using a note block such + as this. +

    +
    +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + transactional DB application: +

    + +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/readblock.jpg b/db/docs/gsg_txn/C/readblock.jpg new file mode 100644 index 000000000..16a511feb Binary files /dev/null and b/db/docs/gsg_txn/C/readblock.jpg differ diff --git a/db/docs/gsg_txn/C/readmodifywrite.html b/db/docs/gsg_txn/C/readmodifywrite.html new file mode 100644 index 000000000..4d6241614 --- /dev/null +++ b/db/docs/gsg_txn/C/readmodifywrite.html @@ -0,0 +1,122 @@ + + + + + + Read/Modify/Write + + + + + + + + + +
    +
    +
    +
    +

    Read/Modify/Write

    +
    +
    +
    +
    +

    + If you are retrieving + a record from the database + + for the purpose of modifying or deleting it, you should declare + a read-modify-write cycle at the time that you read the + record. + + Doing so causes DB to obtain write locks (instead of a read + locks) at the time of the read. This helps to prevent deadlocks by + preventing another transaction from acquiring a read lock on the same + record while the read-modify-write cycle is in progress. +

    +

    + Note that declaring a read-modify-write cycle may actually increase the amount of blocking that your + application sees, because readers immediately obtain write locks and write locks cannot be shared. For this + reason, you should use read-modify-write cycles only if you are seeing a large amount of deadlocking + occurring in your application. +

    +

    + In order to declare a read/modify/write cycle when you perform a + read operation, + + + pass the DB_RMW flag + + to the database or cursor get method. + + + + + + + + +

    +

    + For example: +

    +
    retry:
    +    /* Get the transaction */
    +    ret = envp->txn_begin(envp, NULL, &txn, 0);
    +    if (ret != 0) {
    +            envp->err(envp, ret, "txn_begin failed");
    +            return (EXIT_FAILURE);
    +    }
    +    ...
    +    /* key and data are Dbts. Their usage is omitted for brevity. */
    +    ...
    +    /* Get the data. Declare the read/modify/write cycle here */
    +    ret = dbp->get(dbp, txn, &key, &data, DB_RMW);
    +
    +    ...
    +    /* Modify the key and data as is required (not shown here) */
    +    ...
    +
    +    /* Put the data. Note that you do not have to provide any additional
    +     * flags here due to the read/modify/write cycle. Simply put the 
    +     * data and perform your deadlock detection as normal.
    +     */
    +    ret = dbp->put(dbp, txn, &key, &data, 0);
    +    switch (ret) {
    +        /* Deadlock detection omitted for brevity */
    +        ....  
    +
    + + + diff --git a/db/docs/gsg_txn/C/recovery-intro.html b/db/docs/gsg_txn/C/recovery-intro.html new file mode 100644 index 000000000..ee490b9ba --- /dev/null +++ b/db/docs/gsg_txn/C/recovery-intro.html @@ -0,0 +1,104 @@ + + + + + + Recoverability + + + + + + + + + +
    +
    +
    +
    +

    Recoverability

    +
    +
    +
    +
    +

    + An important part of DB's transactional guarantees is durability. + Durability means that once a + transaction has been committed, the database modifications performed + under its protection will not be lost due to system failure. +

    +

    + In order to provide the transactional durability guarantee, + DB uses a write-ahead logging system. Every operation performed on + your databases is described in a log before it is performed on + your databases. This is done in order to ensure that an operation can be + recovered in the event of an untimely application + or system failure. +

    +

    + + Beyond logging, another important aspect of durability is + recoverability. That is, backup and restore. + + DB supports a normal recovery that runs against a subset of + your log files. This is a routine procedure used whenever your + environment is first opened upon application startup, and it is intended to + ensure that your database is in a consistent state. DB also + supports archival backup and recovery in the case of + catastrophic failure, such as the loss of a physical disk + drive. +

    +

    + This book describes several different backup procedures + you can use to protect your on-disk data. These procedures + range from simple offline backup strategies to hot failovers. Hot failovers + provide not only a backup mechanism, but + also a way to recover from a fatal hardware failure. +

    +

    + This book also describes the recovery procedures you should use + for each of the backup strategies that you might employ. +

    +

    + For a detailed description of backup and restore procedures, see + + Managing DB Files. + + + +

    +
    + + + diff --git a/db/docs/gsg_txn/C/recovery.html b/db/docs/gsg_txn/C/recovery.html new file mode 100644 index 000000000..fdf872d9e --- /dev/null +++ b/db/docs/gsg_txn/C/recovery.html @@ -0,0 +1,322 @@ + + + + + + Recovery Procedures + + + + + + + + + +
    +
    +
    +
    +

    Recovery Procedures

    +
    +
    +
    +
    +

    + DB supports two types of recovery: +

    +
    +
      +
    • +

      + Normal recovery, which is run when your environment is + opened upon application startup, examines only those + log records needed to bring the databases to a consistent + state since the last checkpoint. Normal recovery + starts with any logs used by any transactions active at + the time of the last checkpoint, and examines all logs + from then to the current logs. +

      +
    • +
    • +

      + Catastrophic recovery, which is performed in the same + way that normal recovery is except that it examines + all available log files. You use catastrophic recovery + to restore your databases from a previously created backup. +

      +
    • +
    +
    +

    + Of these two, normal recovery should be considered a routine + matter; in fact you should run normal + recovery whenever you start up your application. +

    +

    + Catastrophic recovery is run whenever you have lost or + corrupted your database files and you want to restore from a + backup. You also run catastrophic recovery when + you create a hot backup + (see Using Hot Failovers for more information). +

    +
    +
    +
    +
    +

    Normal Recovery

    +
    +
    +
    +
    +

    + Normal recovery examines the contents of your environment's + log files, and uses this information to ensure that your + database files are consistent relative to the + information contained in the log files. +

    +

    + Normal recovery also recreates your environment's region files. + This has the desired effect of clearing any unreleased locks + that your application may have held at the time of an + unclean application shutdown. +

    +

    + Normal recovery is run only against those log files created + since the time of your last checkpoint. For this reason, + your recovery time is dependent on how much data has been + written since the last checkpoint, and therefore on how + much log file information there is to examine. If you run + checkpoints infrequently, then normal recovery can + take a relatively long time. +

    +
    +

    Note

    +

    + You should run normal recovery every + time you perform application startup. +

    +
    +

    + To run normal recovery: +

    +
    +
      +
    • +

      + Make sure all your environment handles are closed. +

      +
    • +
    • +

      + Normal recovery must + be single-threaded. +

      +
    • +
    • +

      + Provide the DB_RECOVER flag when + you open your environment. +

      +
    • +
    +
    +

    + You can also run recovery by pausing or shutting down your + application and using the db_recover + command line utility. +

    +

    + For example: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "db.h"     
    +
    +int
    +main(void)
    +{
    +    int ret;
    +    u_int32_t env_flags;
    +    DB_ENV *envp;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    /* Open the environment, specifying that recovery is to be run. */
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN   |  /* Initialize transactions */
    +                DB_RECOVER;      /* Run normal recovery */
    +
    +    /* Open the environment. */
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    ...
    +    /*
    +     * All other operations are identical from here. Notice, however,
    +     * that we have not created any other threads of control before
    +     * recovery is complete. You want to run recovery for
    +     * the first thread in your application that opens an environment,
    +     * but not for any subsequent threads.
    +     */ 
    +
    +
    +
    +
    +
    +

    Catastrophic Recovery

    +
    +
    +
    +
    +

    + Use catastrophic recovery when you are + recovering your databases from a previously created backup. + Note that to restore your databases from a previous backup, you + should copy the backup to a new environment directory, and + then run catastrophic recovery. Failure to do so can lead to + the internal database structures being out of sync with your log files. +

    +

    + Catastrophic recovery must be run single-threaded. +

    +

    + To run catastrophic recovery: +

    +
    +
      +
    • +

      + Shutdown all database operations. +

      +
    • +
    • +

      + Restore the backup to an empty directory. +

      +
    • +
    • +

      + Provide the DB_RECOVER_FATAL flag when + you open your environment. This environment open + must be single-threaded. +

      +
    • +
    +
    +

    + You can also run recovery by pausing or shutting down your + application and using the db_recover + command line utility with the the -c option. +

    +

    + Note that catastrophic recovery examines every available + log file — not just those log files created since the + last checkpoint as is the case for normal recovery. For this reason, + catastrophic recovery is likely to take longer than does + normal recovery. +

    +

    + For example: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "db.h"     
    +
    +int
    +main(void)
    +{
    +    int ret;
    +    u_int32_t env_flags;
    +    DB_ENV *envp;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    /* Open the environment, specifying that recovery is to be run. */
    +    env_flags = DB_CREATE     |  /* If the environment does not
    +                                  * exist, create it. */
    +                DB_INIT_LOCK  |  /* Initialize locking */
    +                DB_INIT_LOG   |  /* Initialize logging */
    +                DB_INIT_MPOOL |  /* Initialize the cache */
    +                DB_THREAD     |  /* Free-thread the env handle. */
    +                DB_INIT_TXN   |  /* Initialize transactions */
    +                DB_RECOVER_FATAL;      /* Run catastrophic recovery */
    +
    +    /* Open the environment. */
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    ...
    +    /*
    +     * All other operations are identical from here. Notice, however,
    +     * that we have not created any other threads of control before
    +     * recovery is complete. You want to run recovery for
    +     * the first thread in your application that opens an environment,
    +     * but not for any subsequent threads.
    +     */ 
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/reversesplit.html b/db/docs/gsg_txn/C/reversesplit.html new file mode 100644 index 000000000..b35db1a81 --- /dev/null +++ b/db/docs/gsg_txn/C/reversesplit.html @@ -0,0 +1,195 @@ + + + + + + Reverse BTree Splits + + + + + + + + + +
    +
    +
    +
    +

    Reverse BTree Splits

    +
    +
    +
    +
    +

    + If your application is using the Btree access method, and your + application is repeatedly deleting then adding records to your + database, then you might be able to reduce lock contention by + turning off reverse Btree splits. +

    +

    + As pages are emptied in a database, DB attempts to + delete empty pages in order to keep + the database as small as possible and minimize search time. + Moreover, when a page in the database fills + up, DB, of course, adds additional pages + to make room for more data. +

    +

    + Adding and deleting pages in the database requires that the + writing thread lock the parent page. Consequently, as the + number of pages in your database diminishes, your application + will see increasingly more lock contention; the maximum level + of concurrency in a database of two pages is far smaller than + that in a database of 100 pages, because there are fewer pages + that can be locked. +

    +

    + Therefore, if you prevent the database from being reduced to a + minimum number of pages, you can improve your application's + concurrency throughput. Note, however, that you should do so + only if your application tends to delete and then add the same + data. If this is not the case, then preventing reverse Btree + splits can harm your database search time. +

    +

    + To turn off reverse Btree splits, + + provide the + DB_REVSPLITOFF flag to the + DB->set_flags() + + method. + + +

    +

    + For example: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    
    +    dbp = NULL;
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE      | 
    +                DB_INIT_LOCK   | 
    +                DB_INIT_LOG    | 
    +                DB_INIT_TXN    |
    +                DB_THREAD      | 
    +                DB_INIT_MPOOL;
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database creation failed");
    +        goto err;
    +    }
    +
    +    /* Set btree reverse split to off */
    +    ret = db->set_flags(&db, DB_REVSPLITOFF);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Turning off Btree reverse split failed");
    +        goto err;
    +    }
    +
    +    db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    db_flags,   /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database '%s' open failed",
    +            file_name);
    +        goto err;
    +    }
    +
    +
    +err:
    +    /* Close the database */
    +    if (dbp != NULL) {
    +        ret_c = dbp->close(dbp, 0);
    +        if (ret_c != 0) {
    +            envp->err(envp, ret_c, "Database close failed.");
    +            ret = ret_c
    +        }
    +    }
    +
    +
    +    /* Close the environment */
    +    if (envp != NULL) {
    +        ret_c = envp->close(envp, 0);
    +        if (ret_c != 0) {
    +            fprintf(stderr, "environment close failed: %s\n",
    +                db_strerror(ret_c));
    +            ret = ret_c;
    +        }
    +    }
    +
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +} 
    +
    + + + diff --git a/db/docs/gsg_txn/C/rwlocks1.jpg b/db/docs/gsg_txn/C/rwlocks1.jpg new file mode 100644 index 000000000..0fc88fd31 Binary files /dev/null and b/db/docs/gsg_txn/C/rwlocks1.jpg differ diff --git a/db/docs/gsg_txn/C/simplelock.jpg b/db/docs/gsg_txn/C/simplelock.jpg new file mode 100644 index 000000000..8dca4ad82 Binary files /dev/null and b/db/docs/gsg_txn/C/simplelock.jpg differ diff --git a/db/docs/gsg_txn/C/txn_ccursor.html b/db/docs/gsg_txn/C/txn_ccursor.html new file mode 100644 index 000000000..a7e040d9c --- /dev/null +++ b/db/docs/gsg_txn/C/txn_ccursor.html @@ -0,0 +1,201 @@ + + + + + + Transactional Cursors and Concurrent Applications + + + + + + + + + +
    +
    +
    +
    +

    Transactional Cursors and Concurrent Applications

    +
    +
    +
    +
    +

    + When you use transactional cursors with a concurrent application, remember that + in the event of a deadlock you must make sure that you close your cursor before you abort and retry your + transaction. +

    +

    + Also, remember that when you are using the default isolation level, + every time your cursor reads a record it locks + that record until the encompassing transaction is resolved. This + means that walking your database with a transactional cursor + increases the chance of lock contention. +

    +

    + For this reason, if you must routinely walk your database with a + transactional cursor, consider using a reduced isolation level + such as read committed. +

    +
    +
    +
    +
    +

    Using Cursors with Uncommitted Data

    +
    +
    +
    +
    +

    + + As described in Reading Uncommitted Data + above, it is possible to relax your transaction's isolation + level such that it can read data modified but not yet committed + by another transaction. You can configure this when you create + your transaction handle, and when you do so then all cursors opened + inside that transaction will automatically use uncommitted reads. +

    +

    + You can also do this when you create a cursor handle from within + a serializable transaction. When you do this, only those + cursors configured for uncommitted reads uses uncommitted reads. +

    +

    + Either way, you must first configure your database handle to support + uncommitted reads before you can configure your transactions or + your cursors to use them. +

    +

    + The following example shows how to configure an individual cursor handle + to read uncommitted data from within a serializable (full isolation) transaction. + For an example of + configuring a transaction to perform uncommitted reads in + general, see Reading Uncommitted Data. +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    DB *dbp;
    +    DBC *cursorp;
    +    DB_ENV *envp;
    +    DB_TXN *txn;
    +    int ret, c_ret;
    +    char *replacementString = "new string";
    +
    +    dbp = NULL;
    +    envp = NULL;
    +    txn = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE |    /* Create the environment if it does 
    +                                * not already exist. */
    +                DB_INIT_TXN  | /* Initialize transactions */
    +                DB_INIT_LOCK | /* Initialize locking. */
    +                DB_INIT_LOG  | /* Initialize logging */
    +                DB_INIT_MPOOL; /* Initialize the in-memory cache. */
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database creation failed");
    +        goto err;
    +    }
    +
    +    db_flags = DB_CREATE |             /* Create the db if it does not 
    +                                        * exist */
    +               DB_AUTO_COMMIT |        /* Enable auto commit */
    +               DB_READ_UNCOMMITTED;    /* Enable uncommitted reads */
    +
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    db_flags,   /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database '%s' open failed",
    +            file_name);
    +        goto err;
    +    }
    +
    +    /* Get the txn handle */
    +    /* Note that this is a degree 3 transaction */
    +    ret = envp->txn_begin(envp, NULL, &txn, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Transaction begin failed.");
    +        goto err;
    +    }
    +
    +    /* Get the cursor, supply the txn handle at that time */
    +    /* Cause the cursor to perform uncommitted reads */
    +    ret = dbp->cursor(dbp, txn, &cursorp, DB_READ_UNCOMMITTED);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Cursor open failed.");
    +        txn->abort(txn);
    +        goto err;
    +    }
    +
    +    /*
    +     * From here, you perform your cursor reads and writes as normal,
    +     * committing and aborting the transactions as is necessary, and 
    +     * testing for deadlock exceptions as normal (omitted for brevity). 
    +     */
    +
    +     ...  
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/txnconcurrency.html b/db/docs/gsg_txn/C/txnconcurrency.html new file mode 100644 index 000000000..ed0de1bff --- /dev/null +++ b/db/docs/gsg_txn/C/txnconcurrency.html @@ -0,0 +1,360 @@ + + + + + + Chapter 4. Concurrency + + + + + + + + + +
    +
    +
    +
    +

    Chapter 4. Concurrency

    +
    +
    +
    +
    + +

    + + DB offers a great deal of support for multi-threaded + + and multi-process + + applications even when transactions are not in use. Many of DB's + handles are + thread-safe, or + can be made thread-safe by providing the appropriate flag at handle creation time, + and DB provides a + flexible locking subsystem for managing databases in a concurrent + application. Further, DB provides a robust mechanism for + detecting and responding to deadlocks. All of these concepts are + explored in this chapter. +

    +

    + Before continuing, it is useful to define a few terms that will appear + throughout this chapter: +

    +
    +
      +
    • +

      + Thread of control +

      +

      + Refers to a thread that is performing work in your application. + Typically, in this book that thread will be performing DB + operations. +

      +

      + Note that this term can also be taken to mean a separate process + that is performing work — DB supports multi-process + operations on your databases. +

      +

      + Also, DB is agnostic with regard to the type or style of + threads in use in your application. So if you are using + multiple threads + (as opposed to multiple processes) to perform concurrent + database access, you are free to use whatever thread package is + best for your platform and application. That said, this manual + will use pthreads for its threading examples because those have + the best chance of being supported across a large range of + platforms. +

      +
    • +
    • +

      + Locking +

      +

      + When a thread of control obtains + access to a shared resource, it is said to be + locking that resource. Note that + DB supports both exclusive and non-exclusive locks. See + Locks for more information. +

      +
    • +
    • +

      + Free-threaded +

      +

      + Data structures and objects are free-threaded if they can be + shared across threads of control without any explicit locking on + the part of the application. Some books, libraries, and + programming languages may use the term + thread-safe for data structures or objects + that have this characteristic. The two terms mean the + same thing. +

      +

      + For a description of free-threaded DB objects, see + Which DB Handles are Free-Threaded. +

      +
    • +
    • +

      + Blocked +

      +

      + When a thread cannot obtain a lock because some other + thread already holds a lock on that object, the lock + attempt is said to be blocked. See + Blocks for more information. +

      +
    • +
    • +

      + Deadlock +

      +

      + Occurs when two or more threads of control attempt to access conflicting resource in such a way as none + of the threads can any longer may further progress. +

      +

      + For example, if Thread A is blocked waiting for a resource held by Thread + B, while at the same time Thread B is blocked waiting for a + resource held by Thread A, then neither thread can make any + forward progress. In this situation, Thread A and Thread B + are said to be deadlocked. +

      +

      + For more information, see Deadlocks. +

      +
    • +
    +
    +
    +
    +
    +
    +

    Which DB Handles are Free-Threaded

    +
    +
    +
    +
    +

    + The following describes to what extent and under what conditions + individual handles are free-threaded. +

    +
    +
      +
    • +

      + DB_ENV + + +

      +

      + Free-threaded so long as + + the DB_THREAD flag is provided to + the environment open() + method. + + +

      +
    • +
    • +

      + DB + + +

      +

      + Free-threaded so long as + + the DB_THREAD flag is provided to + the database open() + method, or if the database is opened using a + free-threaded environment handle. + + +

      +
    • +
    • +

      + DBC + + +

      +

      + Cursors are not free-threaded. However, they + can be used by multiple threads of control so + long as the application serializes access to the handle. +

      +
    • +
    • +

      + DB_TXN + + + +

      +

      + Access must be serialized by the application across threads of control. +

      +
    • +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/txncursor.html b/db/docs/gsg_txn/C/txncursor.html new file mode 100644 index 000000000..593048353 --- /dev/null +++ b/db/docs/gsg_txn/C/txncursor.html @@ -0,0 +1,155 @@ + + + + + + Transactional Cursors + + + + + + + + + +
    +
    +
    +
    +

    Transactional Cursors

    +
    +
    +
    +
    +

    + You can transaction-protect your cursor operations by + specifying a transaction handle at the time that you create + your cursor. Beyond that, you do not ever + provide a transaction handle directly to a cursor method. +

    +

    + Note that if you transaction-protect a cursor, then you must + make sure that the cursor is closed before you either commit or + abort the transaction. For example: +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    DBT key, data;
    +    DBC *cursorp;
    +    DB_TXN *txn = NULL;
    +    int ret, c_ret;
    +    char *replacementString = "new string";
    +
    +    ...
    +    /* environment and db handle creation omitted */
    +    ...
    +
    +    /* Get the txn handle */
    +    txn = NULL;
    +    ret = envp->txn_begin(envp, NULL, &txn, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Transaction begin failed.");
    +        goto err;
    +    }
    +
    +    /* Get the cursor, supply the txn handle at that time */
    +    ret = dbp->cursor(dbp, txn, &cursorp, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Cursor open failed.");
    +        txn->abort(txn);
    +        goto err;
    +    }
    +
    +    /* 
    +     * Now use the cursor. Note that we do not supply any txn handles to these
    +     * methods.
    +     */
    +    /* Prepare the DBTs */
    +    memset(&key, 0, sizeof(DBT));
    +    memset(&data, 0, sizeof(DBT));
    +    while (cursor->c_get(&key, &data, DB_NEXT) == 0) {
    +        data->data = (void *)replacementString;
    +        data->size = (strlen(replacementString) + 1) * sizeof(char);
    +        c_ret = cursor->c_put(cursor, &key, &data, DB_CURRENT);
    +        if (c_ret != 0) {
    +            /* abort the transaction and goto error */ 
    +            envp->err(envp, ret, "Cursor put failed.");
    +            cursorp->c_close(cursorp);
    +            cursorp = NULL;
    +            txn->abort(txn);
    +            goto err;
    +        }
    +    }
    +
    +    /* 
    +     * Commit the transaction. Note that the transaction handle
    +     * can no longer be used.
    +     */ 
    +    ret = cursorp->c_close(cursorp);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Cursor close failed.");
    +        txn->abort(txn);
    +        goto err;
    +    }
    +    ret = txn->commit(txn, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Transaction commit failed.");
    +        goto err;
    +    }
    +
    +err:
    +    /* Close the cursor (if the handle is not NULL)
    +     * and perform whatever other cleanup is required */
    +
    +    /* Close the database */
    +
    +    /* Close the environment */
    +
    +    ...
    +
    +    if (c_ret != 0)
    +        ret = c_ret;
    +    
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +} 
    +
    + + + diff --git a/db/docs/gsg_txn/C/txnexample_c.html b/db/docs/gsg_txn/C/txnexample_c.html new file mode 100644 index 000000000..4f414bd19 --- /dev/null +++ b/db/docs/gsg_txn/C/txnexample_c.html @@ -0,0 +1,757 @@ + + + + + + Transaction Example + + + + + + + + + +
    +
    +
    +
    +

    Transaction Example

    +
    +
    +
    +
    +

    + The following code provides a fully functional example of a + multi-threaded transactional DB application. For improved + portability across platforms, this examples uses pthreads to + provide threading support. +

    +

    + The example opens an environment and database and then creates 5 + threads, each of which writes 500 records to the database. The keys + used for these writes are pre-determined strings, while the data is + a random value. This means that the actual data is arbitrary and + therefore uninteresting; we picked it only because it requires + minimum code to implement and therefore will stay out of the way of + the main points of this example. +

    +

    + Each thread writes 10 records under a single transaction + before committing and writing another 10 (this is repeated 50 + times). At the end of each transaction, but before committing, each + thread calls a function that uses a cursor to read every record in + the database. We do this in order to make some points about + database reads in a transactional environment. +

    +

    + Of course, each writer thread performs deadlock detection as + described in this manual. In addition, normal recovery is performed + when the environment is opened. +

    +

    + We start with our normal include directives: +

    +
    /* File: txn_guide.c */
    +
    +/* We assume an ANSI-compatible compiler */
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <string.h>
    +#include <pthread.h>
    +#include <db.h>
    +
    +#ifdef _WIN32
    +extern int getopt(int, char * const *, const char *);
    +#else
    +#include <unistd.h>
    +#endif 
    +

    + We also need a directive that we use to identify how many threads we + want our program to create: +

    +
    /* Run 5 writers threads at a time.  */
    +#define NUMWRITERS 5 
    +

    + Next we declare a couple of global + variables (used by our threads), and we provide our forward + declarations for the functions used by this example. +

    +
    /*
    + * Printing of pthread_t is implementation-specific, so we
    + * create our own thread IDs for reporting purposes.
    + */
    +int global_thread_num;
    +pthread_mutex_t thread_num_lock;
    +
    +/* Forward declarations */
    +int count_records(DB *, DB_TXN *);
    +int open_db(DB **, const char *, const char *, DB_ENV *, u_int32_t);
    +int usage(void);
    +void *writer_thread(void *);  
    +

    + We now implement our usage function, which identifies our only command line + parameter: +

    +
    /* Usage function */
    +int
    +usage()
    +{
    +    fprintf(stderr, " [-h <database_home_directory>]\n");
    +    return (EXIT_FAILURE); 
    +}  
    +

    + With that, we have finished up our program's housekeeping, and we can + now move on to the main part of our program. As usual, we begin with + main(). First we declare all our variables, and + then we initialize our DB handles. +

    +
    int
    +main(int argc, char *argv[])
    +{
    +    /* Initialize our handles */
    +    DB *dbp = NULL;
    +    DB_ENV *envp = NULL; 
    +
    +    pthread_t writer_threads[NUMWRITERS];
    +    int ch, i, ret, ret_t;
    +    u_int32_t env_flags;
    +    char *db_home_dir;
    +    /* Application name */
    +    const char *prog_name = "txn_guide";
    +    /* Database file name */
    +    const char *file_name = "mydb.db";  
    +

    + Now we need to parse our command line. In this case, all we want is to + know where our environment directory is. If the -h + option is not provided when this example is run, the current working + directory is used instead. +

    +
        /* Parse the command line arguments */
    +#ifdef _WIN32
    +    db_home_dir = ".\\";
    +#else
    +    db_home_dir = "./";
    +#endif
    +    while ((ch = getopt(argc, argv, "h:")) != EOF)
    +        switch (ch) {
    +        case 'h':
    +            db_home_dir = optarg;
    +            break;
    +        case '?':
    +        default:
    +            return (usage());
    +        }  
    +

    + Next we create our database handle, and we define our environment open flags. + There are a few things to notice here: +

    +
    +
      +
    • +

      + We specify DB_RECOVER, which means that normal + recovery is run every time we start the application. This is + highly desirable and recommended for most + applications. +

      +
    • +
    • +

      + We also specify DB_THREAD, which means our + environment handle will be free-threaded. This is very + important because we will be sharing the environment handle + across threads. +

      +
    • +
    +
    +
        /* Create the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    env_flags =
    +      DB_CREATE     |  /* Create the environment if it does not exist */ 
    +      DB_RECOVER    |  /* Run normal recovery. */
    +      DB_INIT_LOCK  |  /* Initialize the locking subsystem */
    +      DB_INIT_LOG   |  /* Initialize the logging subsystem */
    +      DB_INIT_TXN   |  /* Initialize the transactional subsystem. This
    +                        * also turns on logging. */
    +      DB_INIT_MPOOL |  /* Initialize the memory pool (in-memory cache) */
    +      DB_THREAD;       /* Cause the environment to be free-threaded */  
    +

    + Now we configure how we want deadlock detection performed. In our case, we will cause DB to perform deadlock + detection by walking its internal lock tables looking for a block every time a lock is requested. Further, in the + event of a deadlock, the thread that holds the youngest lock will receive the deadlock notification. +

    +
    +

    Note

    +

    + You will notice that every database operation checks the + operation's status return code, and if an error + (non-zero) status is returned, we log the error and then go to + a err label in our program. Unlike + object-oriented programs such as C++ or Java, we do not have + try blocks in C. Therefore, this is the best + way for us to implement cascading error handling for this + example. +

    +
    +
        /*
    +     * Indicate that we want db to perform lock detection internally.
    +     * Also indicate that the transaction with the fewest number of
    +     * write locks will receive the deadlock notification in 
    +     * the event of a deadlock.
    +     */  
    +    ret = envp->set_lk_detect(envp, DB_LOCK_MINWRITE);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error setting lock detect: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    } 
    +

    + Now we open our environment. +

    +
        /*
    +     * If we had utility threads (for running checkpoints or 
    +     * deadlock detection, for example) we would spawn those
    +     * here. However, for a simple example such as this,
    +     * that is not required.
    +     */
    +
    +    /* Now actually open the environment */
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    } 
    +

    + Now we call the function that will open our database for us. This is + not very interesting, except that you will notice that we are + specifying DB_DUPSORT. This is required purely by + the data that we are writing to the database, and it is only necessary + if you run the application more than once without first deleting the environment. +

    +

    + Also, we do not provide any error logging here because the + open_db() function does that for us. + (The implementation of open_db() is described + later in this section.) +

    +
         /* Open the database */
    +    ret = open_db(&dbp, prog_name, file_name, envp, DB_DUPSORT);
    +    if (ret != 0)
    +        goto err;  
    +

    + Now we create our threads. In this example we are using pthreads + for our threading package. A description of threading (beyond how + it impacts DB usage) is beyond the scope of this manual. + However, the things that we are doing here should be familiar to + anyone who has prior experience with any threading package. We are + simply initializing a mutex, creating our threads, and then joining + our threads, which causes our program to wait until the joined + threads have completed before continuing operations in the main + thread. +

    +
         /* Initialize a pthread mutex. Used to help provide thread ids. */
    +    (void)pthread_mutex_init(&thread_num_lock, NULL);
    +
    +    /* Start the writer threads. */
    +    for (i = 0; i < NUMWRITERS; i++)
    +        (void)pthread_create(&writer_threads[i], NULL, 
    +            writer_thread, (void *)dbp);
    +
    +    /* Join the writers */
    +    for (i = 0; i < NUMWRITERS; i++)
    +        (void)pthread_join(writer_threads[i], NULL);  
    +

    + Finally, to wrap up main(), we close out our + database and environment handle, as is normal for any DB + application. Notice that this is where our err + label is placed in our application. If any database operation prior + to this point in the program returns an error status, the program + simply jumps to this point and closes our handles if necessary + before exiting the application completely. +

    +
    err:
    +    /* Close our database handle, if it was opened. */
    +    if (dbp != NULL) {
    +        ret_t = dbp->close(dbp, 0);
    +        if (ret_t != 0) {
    +            fprintf(stderr, "%s database close failed: %s\n",
    +                file_name, db_strerror(ret_t));
    +            ret = ret_t;
    +        }
    +    }
    +
    +    /* Close our environment, if it was opened. */
    +    if (envp != NULL) {
    +        ret_t = envp->close(envp, 0);
    +        if (ret_t != 0) {
    +            fprintf(stderr, "environment close failed: %s\n",
    +                db_strerror(ret_t));
    +                ret = ret_t;
    +        }
    +    }
    +
    +    /* Final status message and return. */
    +    printf("I'm all done.\n");
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +}  
    +

    + Now that we have completed main(), we need to + implement the function that our writer threads will actually run. This + is where the bulk of our transactional code resides. +

    +

    + We start as usual with variable declarations and initialization. +

    +
    /* 
    + * A function that performs a series of writes to a
    + * Berkeley DB database. The information written
    + * to the database is largely nonsensical, but the
    + * mechanisms of transactional commit/abort and
    + * deadlock detection are illustrated here.
    + */
    +void *
    +writer_thread(void *args)
    +{
    +    DBT key, value;
    +    DB_TXN *txn;
    +    int i, j, payload, ret, thread_num;
    +    int retry_count, max_retries = 20;   /* Max retry on a deadlock */
    +    char *key_strings[] = {"key 1", "key 2", "key 3", "key 4",
    +                           "key 5", "key 6", "key 7", "key 8",
    +                           "key 9", "key 10"};
    +
    +    DB *dbp = (DB *)args;
    +    DB_ENV *envp = dbp->get_env(dbp);  
    +

    + Now we want a thread number for reporting purposes. It is possible to + use the pthread_t value directly for this purpose, + but how that is done unfortunately differs depending + on the pthread implementation you are using. So instead we use a + mutex-protected global variable to obtain a simple integer for + our reporting purposes. +

    +

    + Note that we are also use this thread id for initializing a random number generator, which we do here. + We use this random number generator for data generation. +

    +
        /* Get the thread number */
    +    (void)pthread_mutex_lock(&thread_num_lock);
    +    global_thread_num++;
    +    thread_num = global_thread_num;
    +    (void)pthread_mutex_unlock(&thread_num_lock); 
    +
    +    /* Initialize the random number generator */
    +    srand((u_int)pthread_self());  
    +

    + Now we begin the loop that we use to write data to the database. + + Notice that at the beginning of the top loop, we begin a new + transaction. + + + + We will actually use 50 transactions per writer + thread, although we will only ever have one active transaction per + thread at a time. Within each transaction, we will perform 10 + database writes. +

    +

    + By combining multiple writes together under a single transaction, + we increase the likelihood that a deadlock will occur. Normally, + you want to reduce the potential for a deadlock and in this case + the way to do that is to perform a single write per transaction. + To avoid deadlocks, we could be using auto commit to + write to our database for this workload. +

    +

    + However, we want to show deadlock handling and by performing + multiple writes per transaction we can actually observe deadlocks + occurring. We also want to underscore the idea that you can + combing multiple database operations together in a single atomic + unit of work in order to improve the efficiency of your writes. +

    +

    + Finally, on an issue of style, you will notice the + retry label that we place immediately before our + transaction begin code. We use this to loop in the event that a + deadlock is detected and the write operation has to be performed. A + great many people dislike looping with goto + statements, and we certainly could have written this code to avoid + it. However, we find that using the + goto in this case greatly helps to clarify the + code, so we ignore the bias against goto + programming in order to clearly support looping in the event of + what is really an error condition. +

    +
        /* Write 50 times and then quit */
    +    for (i = 0; i < 50; i++) {
    +        retry_count = 0; /* Used for deadlock retries */
    +
    +retry:
    +        /* Begin our transaction. */
    +        ret = envp->txn_begin(envp, NULL, &txn, 0);
    +        if (ret != 0) {
    +            envp->err(envp, ret, "txn_begin failed");
    +            return ((void *)EXIT_FAILURE);
    +        }  
    +

    + Now we begin the inner loop that we use to actually + perform the write. Notice that we use a case + statement to examine the return code from the database put. + This case statement is what we use to determine whether we need + to abort (or abort/retry in the case of a deadlock) our current + transaction. +

    +
            for (j = 0; j < 10; j++) {
    +            /* Set up our key and values DBTs */
    +            memset(&key, 0, sizeof(DBT));
    +            key.data = key_strings[j];
    +            key.size = (strlen(key_strings[j]) + 1) * sizeof(char);
    +
    +            memset(&value, 0, sizeof(DBT));
    +            payload = rand() + i;
    +            value.data = &payload;
    +            value.size = sizeof(int);
    +
    +            /* Perform the database put. */
    +            switch (ret = dbp->put(dbp, txn, &key, &value, 0)) {
    +                case 0:
    +                    break;
    +                /* 
    +                 * Our database is configured for sorted duplicates, 
    +                 * so there is a potential for a KEYEXIST error return. 
    +                 * If we get one, simply ignore it and continue on.
    +                 *
    +                 * Note that you will see KEYEXIST errors only after you
    +                 * have run this program at least once.
    +                 */
    +                case DB_KEYEXIST:
    +                    printf("Got keyexists.\n");
    +                    break;
    +                /*
    +                 * Here's where we perform deadlock detection. If 
    +                 * DB_LOCK_DEADLOCK is returned by the put operation, 
    +                 * then this thread has been chosen to break a deadlock.
    +                 * It must abort its operation, and optionally retry the
    +                 * put.
    +                 */
    +                case DB_LOCK_DEADLOCK:
    +                    /* 
    +                     * First thing we MUST do is abort the 
    +                     * transaction.
    +                     */
    +                    (void)txn->abort(txn);
    +                    /*
    +                     * Now we decide if we want to retry the operation.
    +                     * If we have retried less than max_retries,
    +                     * increment the retry count and goto retry.
    +                     */
    +                    if (retry_count < max_retries) {
    +                        printf("Writer %i: Got DB_LOCK_DEADLOCK.\n", 
    +                            thread_num);
    +                        printf("Writer %i: Retrying write operation.\n",
    +                            thread_num);
    +                        retry_count++;
    +                        goto retry;
    +                    }
    +                    /*
    +                     * Otherwise, just give up.
    +                     */
    +                    printf("Writer %i: ", thread_num);
    +                    printf("Got DB_LOCK_DEADLOCK and out of retries.\n");
    +                    printf("Writer %i: Giving up.\n", thread_num);
    +                    return ((void *)EXIT_FAILURE);
    +                /* 
    +                 * If a generic error occurs, we simply abort the 
    +                 * transaction and exit the thread completely.
    +                 */
    +                default:
    +                    envp->err(envp, ret, "db put failed");
    +                    ret = txn->abort(txn);
    +                    if (ret != 0)
    +                        envp->err(envp, ret, "txn abort failed");
    +                    return ((void *)EXIT_FAILURE);
    +             } /** End case statement **/
    +
    +        }   /** End for loop **/  
    +

    + Having completed the inner database write loop, we could simply + commit the transaction and continue on to the next block of 10 + writes. However, we want to first illustrate a few points about + transactional processing so instead we call our + count_records() + + + function before calling the transaction + commit. + count_records() + + uses a cursor to read every + record in the database and return a count of the number of records + that it found. +

    +
            /* 
    +         * print the number of records found in the database. 
    +         * See count_records() for usage information.
    +         */
    +        printf("Thread %i. Record count: %i\n", thread_num, 
    +            count_records(dbp, NULL));
    +
    +        /* 
    +         * If all goes well, we can commit the transaction and
    +         * loop to the next transaction.
    +         */
    +        ret = txn->commit(txn, 0);
    +        if (ret != 0) {
    +            envp->err(envp, ret, "txn commit failed");
    +            return ((void *)EXIT_FAILURE);
    +        }
    +    }
    +    return ((void *)EXIT_SUCCESS);
    +}  
    +

    + + If you look at the + count_records() + + function prototype at the beginning of this example, you will see that the + function's second parameter takes a transaction handle. However, + our usage of the function here does not pass a transaction handle + through to the function. +

    +

    + + Because + count_records() + + reads every record in the database, if used incorrectly the thread + will self-deadlock. The writer thread has just written 500 records + to the database, but because the transaction used for that write + has not yet been committed, each of those 500 records are still + locked by the thread's transaction. If we then simply run a + non-transactional cursor over the database from within the same + thread that has locked those 500 records, the cursor will + block when it tries to read one of those transactional + protected records. The thread immediately stops operation at that + point while the cursor waits for the read lock it has + requested. Because that read lock will never be released (the thread + can never make any forward progress), this represents a + self-deadlock for the the thread. +

    +

    + There are three ways to prevent this self-deadlock: +

    +
    +
      +
    1. +

      + We can move the call to + count_records() + + to a point after the thread's transaction has committed. +

      +
    2. +
    3. +

      + We can allow + count_records() + + to operate under the same transaction as all of the writes + were performed (this is what the transaction parameter for + the function is for). +

      +
    4. +
    5. +

      + We can reduce our isolation guarantee for the application + by allowing uncommitted reads. +

      +
    6. +
    +
    +

    + For this example, we choose to use option 3 (uncommitted reads) to avoid + the deadlock. This means that we have to open our database such + that it supports uncommitted reads, and we have to open our cursor handle + so that it knows to perform uncommitted reads. +

    +

    + Note that in In-Memory Transaction Example, + we simply perform the cursor operation using the same transaction + as is used for the thread's writes. +

    +

    + The following is the + count_records() + + implementation. There is not anything particularly interesting + about this function other than specifying uncommitted reads when + we open the cursor handle, but we include the function here anyway + for the sake of completeness. +

    +
    /* 
    + * This simply counts the number of records contained in the
    + * database and returns the result.
    + *
    + * Note that this function exists only for illustrative purposes.
    + * A more straight-forward way to count the number of records in
    + * a database is to use DB->stat() or DB->stat_print().
    + */
    +
    +int
    +count_records(DB *dbp, DB_TXN *txn)
    +{
    +    DBT key, value;
    +    DBC *cursorp;
    +    int count, ret;
    +
    +    cursorp = NULL;
    +    count = 0;
    +
    +    /* Get the cursor */
    +    ret = dbp->cursor(dbp, txn, &cursorp, DB_READ_UNCOMMITTED);
    +    if (ret != 0) {
    +        dbp->err(dbp, ret, "count_records: cursor open failed.");
    +        goto cursor_err;
    +    }
    +
    +    /* Get the key DBT used for the database read */
    +    memset(&key, 0, sizeof(DBT));
    +    memset(&value, 0, sizeof(DBT));
    +    do {
    +        ret = cursorp->c_get(cursorp, &key, &value, DB_NEXT);
    +        switch (ret) {
    +            case 0:
    +                count++;
    +                break;
    +            case DB_NOTFOUND:
    +                break;
    +            default:
    +                dbp->err(envp, ret, "Count records unspecified error");
    +                goto cursor_err;
    +        }
    +    } while (ret == 0);
    +
    +cursor_err:
    +    if (cursorp != NULL) {
    +        ret = cursorp->c_close(cursorp);
    +        if (ret != 0) {
    +            dbp->err(dbp, ret,
    +                "count_records: cursor close failed.");
    +        }
    +    }
    +
    +    return (count);
    +}  
    +

    + Finally, we provide the implementation of our + open_db() + + function. This function should hold + no surprises for you. Note, however, that we do specify uncommitted reads + when we open the database. If we did not do this, then our + count_records() + + function would cause our + thread to self-deadlock because the cursor could not be opened to + support uncommitted reads (that flag on the cursor open would, in fact, + be silently ignored by DB). +

    +
    /* Open a Berkeley DB database */
    +int
    +open_db(DB **dbpp, const char *progname, const char *file_name,
    +  DB_ENV *envp, u_int32_t extra_flags)
    +{
    +    int ret;
    +    u_int32_t open_flags;
    +    DB *dbp;
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "%s: %s\n", progname,
    +                db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +
    +    /* Point to the memory malloc'd by db_create() */
    +    *dbpp = dbp;
    +
    +    if (extra_flags != 0) {
    +        ret = dbp->set_flags(dbp, extra_flags);
    +        if (ret != 0) {
    +            dbp->err(dbp, ret, 
    +                "open_db: Attempt to set extra flags failed.");
    +            return (EXIT_FAILURE);
    +        }
    +    }
    +
    +    /* Now open the database */
    +    open_flags = DB_CREATE              | /* Allow database creation */ 
    +                 DB_READ_UNCOMMITTED    | /* Allow uncommitted reads */
    +                 DB_AUTO_COMMIT;          /* Allow auto commit */
    +
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    open_flags, /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        dbp->err(dbp, ret, "Database '%s' open failed",
    +            file_name);
    +        return (EXIT_FAILURE);
    +    }
    +    return (EXIT_SUCCESS);
    +}  
    +

    + This completes our transactional example. If you would like to + experiment with this code, you can find the example in the following + location in your DB distribution: +

    +
    DB_INSTALL/examples_c/txn_guide
    +
    + + + diff --git a/db/docs/gsg_txn/C/txnindices.html b/db/docs/gsg_txn/C/txnindices.html new file mode 100644 index 000000000..97d5746f2 --- /dev/null +++ b/db/docs/gsg_txn/C/txnindices.html @@ -0,0 +1,130 @@ + + + + + + Secondary Indices with Transaction Applications + + + + + + + + + +
    +
    +
    +
    +

    Secondary Indices with Transaction Applications

    +
    +
    +
    +
    +

    + You can use transactions with your secondary indices so long as you + + open the secondary index so that it supports transactions (that is, + you wrap the database open in a transaction, or use auto commit, + in the same way as when you open a primary transactional database). + + + + + In addition, you must make sure that when you associate the + secondary index with the primary database, the association is + performed using a transaction. The easiest thing to do here is + to simply specify DB_AUTO_COMMIT when you + perform the association. + +

    +

    + All other aspects of using secondary indices with transactions are + identical to using secondary indices without transactions. In + addition, transaction-protecting + + cursors opened against secondary indices is performed in + exactly the same way as when you use transactional cursors + against a primary database. + + + See Transactional Cursors for details. +

    +

    + Note that when you use transactions to protect your database writes, your secondary indices are protected from + corruption because updates to the primary and the secondaries are performed in a single atomic transaction. +

    +

    + For example: +

    +
    #include <db.h>
    +
    +...
    +
    +DB_ENV *envp;      /* Environment pointer */
    +DB *dbp, *sdbp;    /* Primary and secondary DB handles */
    +u_int32_t flags;   /* Primary database open flags */
    +int ret;           /* Function return value */
    +
    +/* Environment and primary database opens omitted */
    +
    +/* Secondary */
    +ret = db_create(&sdbp, envp, 0);
    +if (ret != 0) {
    +  /* Error handling goes here */
    +}
    +/* open the secondary database */
    +ret = sdbp->open(sdbp,          /* DB structure pointer */
    +                 NULL,            /* Transaction pointer */
    +                 "my_secdb.db",   /* On-disk file that holds the database. */
    +                 NULL,            /* Optional logical database name */
    +                 DB_BTREE,        /* Database access method */
    +                 DB_AUTO_COMMIT,  /* Open flags */
    +                 0);              /* File mode (using defaults) */
    +if (ret != 0) {
    +  /* Error handling goes here */
    +}
    +
    +/* Now associate the secondary to the primary */
    +dbp->associate(dbp,            /* Primary database */
    +               NULL,           /* TXN id */
    +               sdbp,           /* Secondary database */
    +               get_sales_rep,  /* Callback used for key creation. This
    +                                * is described in the Getting Started
    +                                * guide. */
    +               DB_AUTO_COMMIT);/* Flags */
    +
    + + + diff --git a/db/docs/gsg_txn/C/txnnowait.html b/db/docs/gsg_txn/C/txnnowait.html new file mode 100644 index 000000000..3f88f5794 --- /dev/null +++ b/db/docs/gsg_txn/C/txnnowait.html @@ -0,0 +1,91 @@ + + + + + + No Wait on Blocks + + + + + + + + + +
    +
    +
    +
    +

    No Wait on Blocks

    +
    +
    +
    +
    +

    + Normally when a DB transaction is blocked on a lock request, it + must wait until the requested lock becomes available before its + thread-of-control can proceed. However, it is possible to configure a + transaction handle such that it will report a deadlock rather + than wait for the block to clear. +

    +

    + You do this on a transaction by transaction basis by specifying + + + DB_TXN_NOWAIT + to the + DB_ENV->txn_begin() + + + method. + + + +

    +

    + For example: +

    +
        /* Get the transaction */
    +    DB_TXN *txn = NULL;
    +    ret = envp->txn_begin(envp, NULL, &txn, DB_TXN_NOWAIT);
    +    if (ret != 0) {
    +            envp->err(envp, ret, "txn_begin failed");
    +            return (EXIT_FAILURE);
    +    }
    +        ....  
    +    /* Deadlock detection and exception handling omitted for brevity. */
    +
    + + + diff --git a/db/docs/gsg_txn/C/usingtxns.html b/db/docs/gsg_txn/C/usingtxns.html new file mode 100644 index 000000000..828b21263 --- /dev/null +++ b/db/docs/gsg_txn/C/usingtxns.html @@ -0,0 +1,590 @@ + + + + + + Chapter 3. Transaction Basics + + + + + + + + + +
    +
    +
    +
    +

    Chapter 3. Transaction Basics

    +
    +
    +
    +
    + +

    + Once you have enabled transactions for your environment and your databases, + you can use them to protect your database operations. You do this by + acquiring a transaction handle and then using that handle for any + database operation that you want to participate in that transaction. +

    +

    + You obtain a transaction handle using the + DB_ENV->txn_begin() method. + + + + +

    +

    + Once you have completed all of the operations that you want to include + in the transaction, you must commit the transaction using the + DB_TXN->commit() method. + + + + + +

    +

    + If, for any reason, you want to abandon the transaction, you abort + it using + DB_TXN->abort(). + + + + + + +

    +

    + Any transaction handle that has been committed or aborted can no longer + be used by your application. +

    +

    + Finally, you must make sure that all transaction handles are either + committed or aborted before closing your databases and environment. +

    +
    +

    Note

    +

    + If you only want to transaction protect a single database write operation, you can use auto commit to + perform the transaction administration. When you use auto commit, you do not need an explicit transaction + handle. See Auto Commit for more information. +

    +
    +

    + For example, the following example opens a transactional-enabled environment and + database, obtains a transaction handle, and then performs a write + operation under its protection. In the event of any failure in the + write operation, the transaction is aborted and the database is left in a + state as if no operations had ever been attempted in the first place. +

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +
    +#include "db.h"
    +
    +int
    +main(void)
    +{
    +    int ret, ret_c;
    +    u_int32_t db_flags, env_flags;
    +    DB *dbp;
    +    DB_ENV *envp;
    +    DBT key, data;
    +    DB_TXN *txn;
    +    const char *db_home_dir = "/tmp/myEnvironment";
    +    const char *file_name = "mydb.db";
    +    const char *keystr ="thekey";
    +    const char *datastr = "thedata";
    +    
    +    dbp = NULL;
    +    envp = NULL;
    +
    +    /* Open the environment */
    +    ret = db_env_create(&envp, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error creating environment handle: %s\n",
    +            db_strerror(ret));
    +        return (EXIT_FAILURE);
    +    }
    +                                                                                                                                  
    +    env_flags = DB_CREATE |    /* Create the environment if it does 
    +                                * not already exist. */
    +                DB_INIT_TXN  | /* Initialize transactions */
    +                DB_INIT_LOCK | /* Initialize locking. */
    +                DB_INIT_LOG  | /* Initialize logging */
    +                DB_INIT_MPOOL; /* Initialize the in-memory cache. */
    +
    +    ret = envp->open(envp, db_home_dir, env_flags, 0);
    +    if (ret != 0) {
    +        fprintf(stderr, "Error opening environment: %s\n",
    +            db_strerror(ret));
    +        goto err;
    +    }
    +
    +    /* Initialize the DB handle */
    +    ret = db_create(&dbp, envp, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database creation failed");
    +        goto err;
    +    }
    +
    +    db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    /* 
    +     * Open the database. Note that we are using auto commit for the open, 
    +     * so the database is able to support transactions.
    +     */
    +    ret = dbp->open(dbp,        /* Pointer to the database */
    +                    NULL,       /* Txn pointer */
    +                    file_name,  /* File name */
    +                    NULL,       /* Logical db name */
    +                    DB_BTREE,   /* Database type (using btree) */
    +                    db_flags,   /* Open flags */
    +                    0);         /* File mode. Using defaults */
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database '%s' open failed",
    +            file_name);
    +        goto err;
    +    }
    +
    +    /* Prepare the DBTs */
    +    memset(&key, 0, sizeof(DBT));
    +    memset(&data, 0, sizeof(DBT));
    +
    +    key.data = &keystr;
    +    key.size = strlen(keystr) + 1;
    +    data.data = &datastr;
    +    data.size = strlen(datastr) + 1;
    +
    +    /* Get the txn handle */
    +    txn = NULL;
    +    ret = envp->txn_begin(envp, NULL, &txn, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Transaction begin failed.");
    +        goto err;
    +    }
    +
    +    /*
    +     * Perform the database write. If this fails, abort the transaction.
    +     */
    +    ret = dbp->put(dbp, txn, &key, &data, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Database put failed.");
    +        txn->abort(txn);
    +        goto err;
    +    }
    +
    +    /* 
    +     * Commit the transaction. Note that the transaction handle
    +     * can no longer be used.
    +     */ 
    +    ret = txn->commit(txn, 0);
    +    if (ret != 0) {
    +        envp->err(envp, ret, "Transaction commit failed.");
    +        goto err;
    +    }
    +
    +err:
    +    /* Close the database */
    +    if (dbp != NULL) {
    +        ret_c = dbp->close(dbp, 0);
    +        if (ret_c != 0) {
    +            envp->err(envp, ret_c, "Database close failed.");
    +            ret = ret_c
    +        }
    +    }
    +
    +
    +    /* Close the environment */
    +    if (envp != NULL) {
    +        ret_c = envp->close(envp, 0);
    +        if (ret_c != 0) {
    +            fprintf(stderr, "environment close failed: %s\n",
    +                db_strerror(ret_c));
    +            ret = ret_c;
    +        }
    +    }
    +
    +    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
    +} 
    +
    +
    +
    +
    +

    Committing a Transaction

    +
    +
    +
    +
    +

    + In order to fully understand what is happening when you commit + a transaction, you must first understand a little about what + DB is doing with + + + the logging subsystem. + + + + + Logging causes all database write operations to be identified in + + logs, and by default these + logs are backed by files on disk. These logs are used to restore your databases + + + + + in the event of a system or application failure, so by performing + logging, DB ensures the integrity of your data. +

    +

    + Moreover, DB performs write-ahead + logging. This means that information is written to the logs + before the actual database is changed. + This means that all write activity performed under the + protection of the transaction is noted in the log before + the transaction is committed. Be aware, however, that database + maintains logs in-memory. If you are backing your logs on + disk, the log information will eventually be written to the log + files, but while the transaction is on-going the log data may be + held only in memory. +

    +

    + When you commit a transaction, the following occurs: +

    +
    +
      +
    • +

      + A commit record is written to the log. This + indicates that the modifications made by the + transaction are now permanent. By default, this write is performed synchronously to disk so the + commit record arrives in the log files before any other actions are taken. +

      +
    • +
    • +

      + Any log information held in memory is (by default) + synchronously written to disk. Note that this requirement can be + relaxed, depending on the type of commit you perform. + See Non-Durable Transactions for + more information. + Also, if you are + maintaining your logs entirely in-memory, then this + step will of course not be taken. To configure your + logging system for in-memory usage, see + Configuring In-Memory Logging. + +

      +
    • +
    • +

      + All locks held by the transaction are released. This means + that read operations performed by other transactions or + threads of control can now see the modifications without + resorting to uncommitted reads (see Reading Uncommitted Data for more information). +

      +
    • +
    +
    +

    + To commit a transaction, you simply call + DB_TXN->commit(). + + + + +

    +

    + Notice that committing a transaction does not necessarily cause data + modified in your memory cache to be written to the files + backing your databases on disk. Dirtied database pages are written + for a number of reasons, but a transactional + commit is not one of them. The following are the things that can cause a dirtied + database page to be written to the backing database file: +

    +
    +
      +
    • +

      + Checkpoints. +

      +

      + Checkpoints cause all dirtied pages currently existing + in the cache to be written to disk, and a checkpoint + record is then written to the logs. You can run checkpoints + explicitly. For more information on checkpoints, + see Checkpoints. +

      +
    • +
    • +

      + Cache is full. +

      +

      + If the in-memory cache fills up, then dirtied pages + might be written to disk in order to free up space for other + pages that your application needs to use. Note that if + dirtied pages are written to the database files, then + any log records that describe how those pages were + dirtied are written to disk before the database + pages are written. +

      +
    • +
    +
    +

    + Be aware that because your transaction commit caused database + modifications recorded in your logs to be forced to disk, your modifications + are by default "persistent" in that they can be recovered in the event of + an application or system failure. However, recovery time is + gated by how much data has been modified since the last + checkpoint, so for applications that perform a lot of writes, + you may want to run a checkpoint with some frequency. +

    +

    + Note that once you have committed a transaction, the transaction + handle that you used for the transaction is no longer valid. To + perform database activities under the control of a new + transaction, you must obtain a fresh transaction handle. +

    +
    +
    +
    +
    +

    Non-Durable Transactions

    +
    +
    +
    +
    +

    + As previously noted, by default transaction commits are + durable because they cause the modifications performed + under the transaction to be synchronously recorded in + your on-disk log files. However, it is possible to use + non-durable transactions. +

    +

    + You may want non-durable transactions for performance + reasons. For example, you might be using transactions + simply for the isolation guarantee. + + + In this case, you might + not want a durability guarantee and so you may want to + prevent the disk I/O that normally accompanies a + transaction commit. + + +

    +

    + There are several ways to remove the durability guarantee + for your transactions: +

    +
    +
      +
    • +

      + Specify + + DB_TXN_NOSYNC using the + DB_ENV->set_flags() + + method. + + + This causes DB to not synchronously force any + + log + + data to disk upon transaction commit. + + + That is, the modifications are held entirely + in the in-memory cache and the logging + information is not forced to the filesystem for + long-term storage. + + + Note, however, that the + + logging + + data will eventually make it to the filesystem (assuming no + application or OS crashes) as a part of DB's + management of its logging buffers and/or cache. +

      +

      + This form of a commit provides a weak durability + guarantee because data loss can occur due to + an application + or OS crash. +

      +

      + This behavior is specified on a per-environment + handle basis. In order for your application to exhibit consistent + behavior, you need to specify this + flag + + for all of the environment handles used in your application. +

      +

      + You can achieve this behavior on a transaction by transaction basis by + + specifying DB_TXN_NOSYNC to the + DB_TXN->commit() + + + method. + + + + +

      +
    • +
    • +

      + Specify + + DB_TXN_WRITE_NOSYNC using the + DB_ENV->set_flags() + + method. + + + + + This causes + + logging + + data to be synchronously + written to the OS's file system buffers upon + transaction commit. The data will eventually be + written to disk, but this occurs when the + operating system chooses to schedule the + activity; the transaction commit can complete + successfully before this disk I/O is performed + by the OS. +

      +

      + This form of commit protects you against application + crashes, but not against OS + crashes. This method offers less room for the possibility of data loss than does + DB_TXN_NOSYNC. + +

      +

      + This behavior is specified on a per-environment + handle basis. In order for your application to exhibit consistent + behavior, you need to specify this + flag + + for all of the environment handles used in your application. +

      +
    • +
    • +

      + Maintain your logs entirely in-memory. In this + case, your logs are never written to disk. The + result is that you lose all durability guarantees. + See + Configuring In-Memory Logging + for more information. +

      +
    • +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/wrapup.html b/db/docs/gsg_txn/C/wrapup.html new file mode 100644 index 000000000..32370c29f --- /dev/null +++ b/db/docs/gsg_txn/C/wrapup.html @@ -0,0 +1,283 @@ + + + + + + Chapter 6. Summary and Examples + + + + + + + + + +
    +
    +
    +
    +

    Chapter 6. Summary and Examples

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Anatomy of a Transactional Application + +
    +
    + + Transaction Example + +
    +
    + + In-Memory Transaction Example + +
    +
    +
    +

    + Throughout this manual we have presented the concepts and + mechanisms that you need to provide transactional protection for + your application. In this chapter, we summarize these + mechanisms, and we provide a complete example of a multi-threaded + transactional DB application. +

    +
    +
    +
    +
    +

    Anatomy of a Transactional Application

    +
    +
    +
    +
    +

    + Transactional applications are characterized by performing the + following activities: +

    +
    +
      +
    1. +

      + Create your environment handle. +

      +
    2. +
    3. +

      + Open your environment, specifying that the following + subsystems be used: +

      +
      +
        +
      • +

        + Transactional Subsystem (this also initializes the + logging subsystem). +

        +
      • +
      • +

        + Memory pool (the in-memory cache). +

        +
      • +
      • +

        + Logging subsystem. +

        +
      • +
      • +

        + Locking subsystem (if your application is multi-process or multi-threaded). +

        +
      • +
      +
      +

      + It is also highly recommended that you run normal recovery + upon first environment open. Normal recovery examines only those logs required + to ensure your database files are consistent relative to the information found in your + log files. +

      +
    4. +
    5. +

      + Optionally spawn off any utility threads that you might need. Utility + threads can be used to run checkpoints periodically, or to + periodically run a deadlock detector if you do not want to + use DB's built-in deadlock detector. +

      +
    6. +
    7. +

      + Open whatever database handles that you need. +

      +
    8. +
    9. +

      + Spawn off worker threads. How many of these you need and + how they split their DB workload is entirely up to your + application's requirements. However, any worker threads + that perform write operations against your databases will do + the following: +

      +
      +
        +
      1. +

        + Begin a transaction. +

        +
      2. +
      3. +

        + Perform one or more read and write + operations against your databases. +

        +
      4. +
      5. +

        + Commit the transaction if all goes well. +

        +
      6. +
      7. +

        + Abort and retry the operation if a deadlock is + detected. +

        +
      8. +
      9. +

        + Abort the transaction for most other errors. +

        +
      10. +
      +
      +
    10. +
    11. +

      + On application shutdown: +

      +
      +
        +
      1. +

        + Make sure there are no opened cursors. +

        +
      2. +
      3. +

        + Make sure there are no active transactions. Either + abort or commit all transactions before shutting + down. +

        +
      4. +
      5. +

        + Close your databases +

        +
      6. +
      7. +

        + Close your environment. +

        +
      8. +
      +
      +
    12. +
    +
    +
    +

    Note

    +

    + Robust applications should monitor their database worker threads to + make sure they have not died unexpectedly. If a thread does + terminate abnormally, you must shutdown all your worker threads + and then run normal recovery (you will have to reopen your + environment to do this). This is the only way to clear any + resources (such as a lock or a mutex) that the abnormally + exiting worker thread might have been holding at the time that + it died. +

    +

    + Failure to perform this recovery can cause your + still-functioning worker threads to eventually block forever + while waiting for a lock that will never be released. +

    +
    +

    + In addition to these activities, which are all entirely handled by + code within your application, there are some administrative + activities that you should perform: +

    +
    +
      +
    • +

      + Periodically checkpoint your application. Checkpoints will + reduce the time to run recovery in the event that one is + required. See Checkpoints + for details. +

      +
    • +
    • +

      + Periodically back up your database and log files. This is + required in order to fully obtain the durability guarantee + made by DB's transaction ACID support. See + Backup Procedures + for more information. +

      +
    • +
    • +

      + You may want to maintain a hot failover if 24x7 processing + with rapid restart in the face of a disk hit is important + to you. See Using Hot Failovers + for more information. +

      +
    • +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/C/writeblock.jpg b/db/docs/gsg_txn/C/writeblock.jpg new file mode 100644 index 000000000..4b382b82f Binary files /dev/null and b/db/docs/gsg_txn/C/writeblock.jpg differ diff --git a/db/docs/gsg_txn/CXX/BerkeleyDB-Core-Cxx-Txn.pdf b/db/docs/gsg_txn/CXX/BerkeleyDB-Core-Cxx-Txn.pdf new file mode 100644 index 000000000..27b08a31c Binary files /dev/null and b/db/docs/gsg_txn/CXX/BerkeleyDB-Core-Cxx-Txn.pdf differ diff --git a/db/docs/gsg_txn/CXX/abortresults.html b/db/docs/gsg_txn/CXX/abortresults.html new file mode 100644 index 000000000..6f28eb125 --- /dev/null +++ b/db/docs/gsg_txn/CXX/abortresults.html @@ -0,0 +1,95 @@ + + + + + + Aborting a Transaction + + + + + + + + + +
    +
    +
    +
    +

    Aborting a Transaction

    +
    +
    +
    +
    +

    + When you abort a transaction, all database modifications performed + under the protection of the transaction are discarded, and all + locks currently held by the transaction are released. In this event, + your data is simply left in the + state that it was in before the transaction began performing data + modifications. +

    +

    + Note that aborting a transaction may result in disk + + I/O if your logs are backed by the filesystem. + + + It is possible that during the course of your transaction, + logging data and/or database + pages + + were written to backing files on disk. For this reason, DB + notes that the abort occurred in its log files so that at a + minimum the database can be brought into a consistent state at + recovery time. +

    +

    + Also, once you have aborted a transaction, the transaction + handle that you used for the transaction is no longer valid. To + perform database activities under the control of a new + transaction, you must obtain a fresh transactional handle. +

    +

    + To abort a transaction, call + + DbTxn::abort(). + + + +

    +
    + + + diff --git a/db/docs/gsg_txn/CXX/architectrecovery.html b/db/docs/gsg_txn/CXX/architectrecovery.html new file mode 100644 index 000000000..8d785bc30 --- /dev/null +++ b/db/docs/gsg_txn/CXX/architectrecovery.html @@ -0,0 +1,446 @@ + + + + + + Designing Your Application for Recovery + + + + + + + + + +
    +
    +
    +
    +

    Designing Your Application for Recovery

    +
    +
    +
    +
    +

    + When building your DB application, you should consider how you will run recovery. If you are building a + single threaded, single process application, it is fairly simple to run recovery when your application first + opens its environment. In this case, you need only decide if you want to run recovery every time you open + your application (recommended) or only some of the time, presumably triggered by a start up option + controlled by your application's user. +

    +

    + However, for multi-threaded and multi-process applications, you need to carefully consider how you will + design your application's startup code so as to run recovery only when it makes sense to do so. +

    +
    +
    +
    +
    +

    Recovery for Multi-Threaded Applications

    +
    +
    +
    +
    +

    + If your application uses only one environment handle, then handling recovery for a multi-threaded + application is no more difficult than for a single threaded application. You simply open the environment + in the application's main thread, and then pass that handle to each of the threads that will be + performing DB operations. We illustrate this with our final example in this book (see + Transaction Example + + + + for more information). +

    +

    + Alternatively, you can have each worker thread open its own environment handle. However, in this case, + designing for recovery is a bit more complicated. +

    +

    + Generally, when a thread performing database operations fails + or hangs, it is frequently best to simply + restart the application and run recovery upon application + startup as normal. However, not all applications can afford + to restart because a single thread has misbehaved. +

    +

    + If you are attempting to continue operations in the face of a misbehaving thread, + then at a minimum recovery must be run if a thread performing database operations fails or hangs. +

    +

    + Remember that recovery clears the environment of all + outstanding locks, including any that might be outstanding + from an aborted thread. If these locks are not cleared, + other threads performing database operations can back up + behind the locks obtained but never cleared by the failed + thread. The result will be an application that hangs + indefinitely. +

    +

    + To run recovery under these circumstances: +

    +
    +
      +
    1. +

      + Suspend or shutdown all other threads performing + database operations. +

      +
    2. +
    3. +

      + Discarding any open environment handles. Note that + attempting to gracefully close these handles may be + asking for trouble; the close can fail if the + environment is already in need of recovery. For + this reason, it is best and easiest to simply discard the handle. +

      +
    4. +
    5. +

      + Open new handles, running recovery as you open + them. + See Normal Recovery for more information. +

      +
    6. +
    7. +

      + Restart all your database threads. +

      +
    8. +
    +
    +

    + A traditional way to handle this activity is to spawn a watcher thread that is responsible for making + sure all is well with your threads, and performing the above actions if not. +

    +

    + However, in the case where each worker thread opens and maintains its own environment handle, recovery + is complicated for two reasons: +

    +
    +
      +
    1. +

      + For some applications and workloads, it might be + worthwhile to give your database threads the + ability to gracefully finalize any on-going + transactions. If this is the case, your + code must be capable of signaling each thread + to halt DB activities and close its + environment. If you simply run recovery against the + environment, your database threads will + detect this and fail in the midst of performing their + database operations. +

      +
    2. +
    3. +

      + Your code must be capable of ensuring only one + thread runs recovery before allowing all other + threads to open their respective environment + handles. Recovery should be single threaded because when + recovery is run against an environment, it is + deleted and then recreated. This will cause all + other processes and threads to "fail" when they + attempt operations against the newly recovered + environment. If all threads run recovery + when they start up, then it is likely that some + threads will fail because the environment that they + are using has been recovered. This will cause the thread to have to re-execute its own recovery + path. At best, this is inefficient and at worst it could cause your application to fall into an + endless recovery pattern. +

      +
    4. +
    +
    +
    +
    +
    +
    +
    +

    Recovery in Multi-Process Applications

    +
    +
    +
    +
    +

    + Frequently, DB applications use multiple processes to interact with the databases. For example, you may + have a long-running process, such as some kind of server, and then a series of administrative tools that + you use to inspect and administer the underlying databases. Or, in some web-based architectures, different + services are run as independent processes that are managed by the server. +

    +

    + In any case, recovery for a multi-process environment is complicated for two reasons: +

    +
    +
      +
    1. +

      + In the event that recovery must be run, you might + want to notify processes interacting with the environment + that recovery is about to occur and give them a + chance to gracefully terminate. Whether it is + worthwhile for you to do this is entirely dependent + upon the nature of your application. Some + long-running applications with multiple processes + performing meaningful work might want to do this. + Other applications with processes performing database + operations that are likely to be harmed by error conditions in other + processes will likely find it to be not worth the + effort. For this latter group, the chances of + performing a graceful shutdown may be low anyway. +

      +
    2. +
    3. +

      + Unlike single process scenarios, it can quickly become wasteful for every process interacting + with the databases to run recovery when it starts up. This is partly because recovery + does take some amount of time to run, but mostly you want to + avoid a situation where your server must + reopen all its environment handles just because you fire up a command line database + administrative utility that always runs recovery. +

      +
    4. +
    +
    +

    + DB offers you two methods by which you can manage recovery for multi-process DB applications. + Each has different strengths and weaknesses, and they are described in the next sections. +

    +
    +
    +
    +
    +

    Effects of Multi-Process Recovery

    +
    +
    +
    +
    +

    + Before continuing, it is worth noting that the following sections describe recovery processes than + can result in one process running recovery while other processes are currently actively performing + database operations. +

    +

    + When this happens, the current database operation will + abnormally fail, indicating a DB_RUNRECOVERY condition. + This means that your application should immediately abandon any database operations that it may have + on-going, discard any environment handles it has opened, and obtain and open new handles. +

    +

    + The net effect of this is that any writes performed by unresolved transactions will be lost. + For persistent applications (servers, for example), the services it provides will also be + unavailable for the amount of time that it takes to complete a recovery and for all participating + processes to reopen their environment handles. +

    +
    +
    +
    +
    +
    +

    Process Registration

    +
    +
    +
    +
    +

    + One way to handle multi-process recovery is for every process to "register" its environment. In + doing so, the process gains the ability to see if any other applications are using the + environment and, if so, whether they have suffered an abnormal termination. If an abnormal + termination is detected, the process runs recovery; otherwise, it does not. +

    +

    + Note that using process registration also ensures that + recovery is serialized across applications. That is, + only one process at a time has a chance to run + recovery. Generally this means that the first process + to start up will run recovery, and all other processes + will silently not run recovery because it is not + needed. +

    +

    + To cause your application to register its environment, you specify + + the DB_REGISTER flag when you open your environment. + Note that you must also specify DB_RECOVER or + DB_RECOVER_FATAL for your environment open. + + + + If during the open, DB determines that recovery must be run, this indicates the type of + recovery that is run. If you do not specify either type of recovery, then no recovery is run if + the registration process identifies a need for it. In this case, the environment open simply + fails by + returning DB_RUNRECOVERY. + +

    +

    + Be aware that there are some limitations/requirements if you want your various processes to + coordinate recovery using this registration process: +

    +
    +
      +
    1. +

      + There can be only one environment handle per + environment per process. In the case of multi-threaded + processes, the environment handle must be shared across threads. +

      +
    2. +
    3. +

      + All processes sharing the environment must use registration. If registration is + not uniformly used across all participating processes, then you can see inconsistent results + in terms of your application's ability to recognize that recovery must be run. +

      +
    4. +
    5. +

      + You can not use this mechanism with the failchk() + mechanism + described in the next section. +

      +
    6. +
    +
    +
    +
    +
    +
    +
    +

    Failure Checking

    +
    +
    +
    +
    +

    + For very large and robust multi-process applications, the most common way to ensure all the + processes are working as intended is to make use of a watchdog process. To assist a watchdog + process, DB offers a failure checking mechanism. +

    +

    + When a thread of control fails with open environment handles, the result is that there may be + resources left locked or corrupted. Other threads of control may encountered these unavailable resources + quickly or not at all, depending on data access patterns. +

    +

    + In any case, the DB failure checking mechanism allows a watchdog to detect if an environment is + unusable as a result of a thread of control failure. It should be called periodically + (for example, once a minute) from the watchdog process. If the environment is deemed unusable, then + the watchdog process is notified that recovery should be run. It is then up to the watchdog to + actually run recovery. It is also the watchdog's responsibility to decide what to do about currently + running processes before running recovery. The watchdog could, for example, attempt to + gracefully shutdown or kill all relevant processes before running recovery. +

    +

    + Note that failure checking need not be run from a separate process, although conceptually that is + how the mechanism is meant to be used. This same mechanism could be used in a multi-threaded + application that wants to have a watchdog thread. +

    +

    + To use failure checking you must: +

    +
    +
      +
    1. +

      + + Provide an is_alive() call back using the + + Dbenv::set_isalive() + method. + + + DB uses this method to determine whether a specified process and thread + is alive when the failure checking is performed. +

      +
    2. +
    3. +

      + Possibly provide a + + + thread_id callback + + + + + that uniquely identifies a process + and thread of control. This + callback + + is only necessary if the standard process and thread + identification functions for your platform are not sufficient to for use by failure + checking. This is rarely necessary and is usually because the thread and/or process ids + used by your system cannot fit into an unsigned integer. +

      +

      + You provide this callback using the + + DbEnv::set_thread_id() + method. See the API reference for this method for more information on when setting a thread + id callback might be necessary. +

      +
    4. +
    5. +

      + Call the + + DbEnv::failchk() + + method periodically. You can do this either periodically (once per minute, for example), or + whenever a thread of control exits for your application. +

      +

      + If this method determines that a thread of control exited holding read locks, those locks + are automatically released. If the thread of control exited with an unresolved transaction, + that transaction is aborted. If any other problems exist beyond these such that the + environment must be recovered, the method will + return DB_RUNRECOVERY. + +

      +
    6. +
    +
    +

    + Note that this mechanism should not be mixed with the process registration method of multi-process + recovery described in the previous section. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/autocommit.html b/db/docs/gsg_txn/CXX/autocommit.html new file mode 100644 index 000000000..7150c437a --- /dev/null +++ b/db/docs/gsg_txn/CXX/autocommit.html @@ -0,0 +1,179 @@ + + + + + + Auto Commit + + + + + + + + + +
    +
    +
    +
    +

    Auto Commit

    +
    +
    +
    +
    +

    + While transactions are frequently used to provide atomicity to + multiple database operations, it is sometimes necessary to perform + a single database operation under the control of a transaction. + Rather than force you to obtain a transaction, perform the single + write operation, and then either commit or abort the transaction, + you can automatically group this sequence of events using + auto commit. +

    +

    + To use auto commit: +

    +
    +
      +
    1. +

      + Open your environment and your databases so that they support + transactions. See Enabling Transactions + for details. +

      +

      + Note that frequently auto commit is used for the environment + or database open. To use auto commit for either your + environment or database open, specify + DB_AUTO_COMMIT to the + + + DbEnv::set_flags() + or + + Db::open() + method. If you specify auto commit for the environment + open, then you do not need to also specify auto commit + for the database open. +

      +
    2. +
    3. +

      + Do not provide a transactional handle to the method that is + performing the database write operation. +

      +
    4. +
    +
    +

    + Note that auto commit is not available for cursors. You must always + open your cursor using a transaction if you want the cursor's + operations to be transactional protected. See + Transactional Cursors for details on using + transactional cursors. +

    +

    + For example, the following uses auto commit to perform the database write operation: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    u_int32_t db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    Db *dbp = NULL;
    +    const char *file_name = "mydb.db";
    +    const char *keystr ="thekey";
    +    const char *datastr = "thedata";
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +        dbp = new Db(&myEnv, 0);
    +
    +        // Open the database. Note that we are using auto commit for 
    +        // the open, so the database is able to support transactions.
    +        dbp->open(NULL,       // Txn pointer
    +                  file_name,  // File name
    +                  NULL,       // Logical db name */
    +                  DB_BTREE,   // Database type (using btree)
    +                  db_flags,   // Open flags
    +                  0);         // File mode. Using defaults
    +
    +        Dbt key, data;
    +        key.set_data(keystr);
    +        key.set_size((strlen(keystr) + 1) * sizeof(char));
    +        key.set_data(datastr);
    +        key.set_size((strlen(datastr) + 1) * sizeof(char));
    +
    +        // Perform the write. Because the database was opened to support
    +        // auto commit, this write is performed using auto commit.
    +        db->put(NULL, &key, &data, 0);
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database and environment: "
    +                  << file_name << ", "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +    }
    +
    +    try {
    +        if (dbp != NULL) 
    +            dbp->close(0);
    +        myEnv.close(0);
    +    } catch(DbException &e) {
    +        std::cerr << "Error closing database and environment: "
    +                  << file_name << ", "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    return (EXIT_SUCCESS);
    +} 
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/backuprestore.html b/db/docs/gsg_txn/CXX/backuprestore.html new file mode 100644 index 000000000..711e8b181 --- /dev/null +++ b/db/docs/gsg_txn/CXX/backuprestore.html @@ -0,0 +1,341 @@ + + + + + + Backup Procedures + + + + + + + + + +
    +
    +
    +
    +

    Backup Procedures

    +
    +
    +
    +
    +

    + Durability is an important part of your + transactional guarantees. It means that once a transaction has been + successfully committed, your application will always see the results of that + transaction. +

    +

    + Of course, no software algorithm can guarantee durability in the face of physical data loss. Hard drives + can fail, and if you have not copied your data to locations other than your primary disk drives, + then you will lose data when those drives fail. Therefore, in order to truly obtain a durability + guarantee, you need to ensure that any data stored on disk is backed up to secondary or alternative storage, + such as secondary disk drives, or offline tapes. +

    +

    + There are three different types of backups that you can + perform with DB databases and log files. They are: +

    +
    +
      +
    • +

      + Offline backups +

      +

      + This type of backup is perhaps the easiest to perform as it + involves simply copying database and log files to an + offline storage area. It also gives you a snapshot of the + database at a fixed, known point in time. However, you + cannot perform this type of a backup while you are performing + writes to the database. +

      +
    • +
    • +

      + Hot backups +

      +

      + This type of backup gives you a snapshot of your database. + Since your application can be writing to the database at the time that the + snapshot is being taken, you do not necessarily know what + the exact state of the database is for that given snapshot. +

      +
    • +
    • +

      + Incremental backups +

      +

      + This type of backup refreshes a previously performed backup. +

      +
    • +
    +
    +

    + Once you have performed a backup, you can + perform catastrophic recovery to restore + your databases from the backup. See + Catastrophic Recovery + for more information. +

    +

    + Note that you can also maintain a hot failover. See + Using Hot Failovers + for more information. +

    +
    +
    +
    +
    +

    About Unix Copy Utilities

    +
    +
    +
    +
    +

    + + If you are copying database files you must copy databases atomically, + in multiples of the database page size. In other words, the reads made by + the copy program must not be interleaved with writes by + other threads of control, and the copy program must read the + databases in multiples of the underlying database page size. + Generally, this is not a problem because operating systems + already make this guarantee and system utilities normally + read in power-of-2 sized chunks, which are larger than the + largest possible Berkeley DB database page size. +

    +

    + On some platforms (most notably, some releases of Solaris), the copy utility (cp) was + implemented using the mmap() system call rather than the + read() system call. Because mmap() did not make the same + guarantee of read atomicity as did read(), the cp utility + could create corrupted copies of the databases. +

    +

    + Also, some platforms have implementations of the tar utility that performs 10KB block + reads by default. Even when an output block size is specified, the utility will still not read the + underlying databases in multiples of the specified block size. Again, the result can be a corrupted backup. +

    +

    + To fix these problems, use the dd utility instead of cp or + tar. When you use dd, make sure you specify a block size that is + equal to, or an even multiple of, your database page size. Finally, if you plan to use a system + utility to copy database files, you may want to use a system call trace utility (for example, + ktrace or truss) to make sure you are not using a I/O size that is + smaller than your database page size. You can also use these utilities to make sure the system utility is + not using a system call other than read(). +

    +
    +
    +
    +
    +
    +

    Offline Backups

    +
    +
    +
    +
    +

    + To create an offline backup: +

    +
    +
      +
    1. +

      + Commit or abort all on-going transactions. +

      +
    2. +
    3. +

      + Pause all database writes. +

      +
    4. +
    5. +

      + Force a checkpoint. See + Checkpoints + for details. +

      +
    6. +
    7. +

      + Copy all your database files to the backup location. + + Note that you can simply copy all of the database + files, or you can determine which database files + have been written during the lifetime of the current + logs. To do this, use either the + + + DbEnv::log_archive() + method with the DB_ARCH_DATA + option, + + + + or use the db_archive + command with the -s option. + +

      +

      + However, be aware that backing up just the modified databases only works if you have all of your + log files. If you have been removing log files for any reason then using + + log_archive() + + + + can result in an + unrecoverable backup because you might not be notified of a database file that was modified. +

      +
    8. +
    9. +

      + Copy the last log file to your backup location. + Your log files are named + log.xxxxxxxxxx, + where xxxxxxxxxx is a + sequential number. The last log file is the file + with the highest number. +

      +
    10. +
    +
    +
    +
    +
    +
    +
    +

    Hot Backup

    +
    +
    +
    +
    +

    + To create a hot backup, you do not have to stop database + operations. Transactions may be on-going and you can be writing + to your database at the time of the backup. However, this means + that you do not know exactly what the state of your database is + at the time of the backup. +

    +

    + You can use the db_hotbackup command line utility to create a hot backup for you. This + utility will (optionally) run a checkpoint and the copy all necessary files to a target directory. +

    +

    + Alternatively, you can manually create a hot backup as follows: +

    +
    +
      +
    1. +

      + Copy all your database files to the backup location. + + Note that you can simply copy all of the database + files, or you can determine which database files + have been written during the lifetime of the current + logs. To do this, use either the + + + DbEnv::log_archive() + with the DB_ARCH_DATA + option, + + + + or use the db_archive + command with the -s option. + +

      +
    2. +
    3. +

      + Copy all logs to your backup location. +

      +
    4. +
    +
    +
    +

    Note

    +

    + It is important to copy your database files and + then your logs. In this way, + you can complete or roll back any database operations that were only partially completed + when you copied the databases. +

    +
    +
    +
    +
    +
    +
    +

    Incremental Backups

    +
    +
    +
    +
    +

    + Once you have created a full backup (that is, either a + offline or hot backup), you can create incremental backups. + To do this, simply copy all of your currently existing log + files to your backup location. +

    +

    + Incremental backups do not require you to run a checkpoint + or to cease database write operations. +

    +

    + When you are working with incremental backups, remember + that the greater the number of log files contained in + your backup, the longer recovery will take. + You should run full backups + on some interval, and then do incremental backups on a shorter interval. + How frequently you need to run a full backup + is determined by the rate at which your databases change and + how sensitive your application is to lengthy recoveries + (should one be required). +

    +

    + You can also shorten recovery time by running recovery against the backup as you take each incremental + backup. Running recovery as you go means that there will be less work for DB to do if you should + ever need to restore your environment from the backup. +

    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/blocking_deadlocks.html b/db/docs/gsg_txn/CXX/blocking_deadlocks.html new file mode 100644 index 000000000..69c14830f --- /dev/null +++ b/db/docs/gsg_txn/CXX/blocking_deadlocks.html @@ -0,0 +1,674 @@ + + + + + + Locks, Blocks, and Deadlocks + + + + + + + + + +
    +
    +
    +
    +

    Locks, Blocks, and Deadlocks

    +
    +
    +
    +
    +

    + It is important to understand how locking works in a + concurrent application before continuing with a description of + the concurrency mechanisms DB makes available to you. + Blocking and deadlocking have important performance implications + for your application. Consequently, this section provides a + fundamental description of these concepts, and how they affect + DB operations. +

    +
    +
    +
    +
    +

    Locks

    +
    +
    +
    +
    +

    + When one thread of control wants to obtain access to an + object, it requests a lock for that + object. This lock is what allows DB to provide your + application with its transactional isolation guarantees by + ensuring that: +

    +
    +
      +
    • +

      + no other thread of control can read that object (in + the case of an exclusive lock), and +

      +
    • +
    • +

      + no other thread of control can modify that object + (in the case of an exclusive or non-exclusive lock). +

      +
    • +
    +
    +
    +
    +
    +
    +

    Lock Resources

    +
    +
    +
    +
    +

    + When locking occurs, there are conceptually three resources + in use: +

    +
    +
      +
    1. +

      + The locker. +

      +

      + This is the thing that holds the lock. In a + transactional application, the locker is a + transaction handle. + + For non-transactional operations, the locker is a cursor or a + + Db + + + handle. + + +

      +
    2. +
    3. +

      + The lock. +

      +

      + This is the actual data structure that locks + the object. In DB, a locked + object structure in the lock manager + is representative of the object that + is locked. +

      +
    4. +
    5. +

      + The locked object. +

      +

      + The thing that your application + actually wants to lock. + In a DB + application, the locked object is usually a + + database page, which in turn contains + multiple database entries (key and data). + + However, for Queue databases, + individual database records are locked. + + + + +

      +
    6. +
    +
    +

    + You can configure how many total lockers, locks, + and locked objects your + application is allowed to support. See + Configuring the Locking Subsystem + for details. +

    +

    + The following figure shows a transaction handle, + Txn A, that is holding a lock on + database + page + + 002. In this graphic, Txn + A is the locker, and the locked object is + page + + 002. Only a single lock is in use + in this operation. +

    +
    + +
    +
    +
    +
    +
    +
    +

    Types of Locks

    +
    +
    +
    +
    +

    + DB applications support both exclusive and + non-exclusive locks. Exclusive + locks are granted when a + locker wants to write to an object. For this reason, + exclusive locks are also sometimes called + write locks. +

    +

    + An exclusive lock prevents any other locker from + obtaining any sort of a lock on the object. This + provides isolation by ensuring that no other locker can + observe or modify an exclusively locked object until the locker is done + writing to that object. +

    +

    + Non-exclusive locks are granted + for read-only access. For this reason, non-exclusive + locks are also sometimes called read + locks. Since multiple lockers can + simultaneously hold read locks on the same + object, read locks are also + sometimes called shared locks. +

    +

    + A non-exclusive lock prevents any other locker from + modifying the locked object while the locker is still + reading the object. This is how transactional cursors are able to + achieve repeatable reads; by default, the + cursor's transaction holds + a read lock on any object that the cursor has examined until + such a time as the transaction is committed + or aborted. + + You can avoid these read locks by using + snapshot isolation. See Using Snapshot Isolation + for details. + +

    +

    + In the following figure, Txn A and + Txn B are both holding read locks on + page + + 002, while Txn C + is holding a write lock on + page + + 003: +

    +
    + +
    +
    +
    +
    +
    +
    +

    Lock Lifetime

    +
    +
    +
    +
    +

    + A locker holds its locks until such a time as it does + not need the lock any more. What this means is: +

    +
    +
      +
    1. +

      + A transaction holds any locks that it obtains + until the transaction is committed or aborted. +

      +
    2. +
    3. +

      + All non-transaction operations hold locks + until such a time as the operation is completed. + For cursor operations, the lock is held until the cursor is moved to a new position or + closed. +

      +
    4. +
    +
    +
    +
    +
    +
    +
    +
    +

    Blocks

    +
    +
    +
    +
    +

    + Simply put, a thread of control is blocked when it attempts + to obtain a lock, but that attempt is denied because some + other thread of control holds a conflicting lock. + Once blocked, the thread of control is temporarily unable + to make any forward progress until the requested lock is + obtained or the operation requesting the lock is + abandoned. +

    +

    + Be aware that when we talk about blocking, strictly + speaking the thread is not what is attempting to obtain the + lock. Rather, some object within the thread (such as a + cursor) is attempting to obtain the + lock. However, once a locker attempts to + obtain a lock, the entire thread of control must pause until the lock + request is in some way resolved. +

    +

    + For example, if Txn A holds a write lock (an exclusive + lock) on + object + + 002, then if Txn B tries to obtain a read or write lock on + that + object, + + the thread of control in which Txn + B is running + is blocked: +

    +
    + +
    +

    + However, if Txn A only holds a read + lock (a shared lock) on + object + + 002, then only those handles that attempt to obtain a + write lock on that + object + + will block. +

    +
    + +
    +
    +

    Note

    +

    + The previous description describes DB's default + behavior when it cannot obtain a lock. It is + possible to configure DB transactions so that + they will not block. Instead, if a lock is + unavailable, the application is immediately notified of a + deadlock situation. See No Wait on Blocks + for more information. +

    +
    +
    +
    +
    +
    +

    Blocking and Application Performance

    +
    +
    +
    +
    +

    + Multi-threaded + + and multi-process + + applications typically perform better than simple + single-threaded applications because the + application can perform one part of its workload + (updating + a database record, + + for example) while it is waiting for some other + lengthy operation to complete (performing disk or + network I/O, for example). This performance + improvement is particularly noticeable if you use + hardware that offers multiple CPUs, because the threads + + and processes + + can run simultaneously. +

    +

    + That said, concurrent applications can see reduced + workload throughput if their threads of control are + seeing a large amount of lock contention. That is, + if threads are blocking on lock requests, then that + represents a performance penalty for your + application. +

    +

    + Consider once again the previous diagram of a blocked write lock request. + In that diagram, Txn C cannot + obtain its requested write lock because + Txn A and Txn + B are both already holding read locks on + the requested + object. + + In this case, the thread in which + Txn C is running will pause until + such a time as Txn C either + obtains its write lock, or the operation + that is requesting the lock is abandoned. + The fact that Txn + C's thread has temporarily halted all + forward progress represents a performance penalty + for your application. +

    +

    + Moreover, any read locks that are requested while + Txn C is waiting for its write + lock will also block until such a time as + Txn C has obtained and + subsequently released its write lock. +

    +
    +
    +
    +
    +
    +

    Avoiding Blocks

    +
    +
    +
    +
    +

    + Reducing lock contention is an important part of + performance tuning your concurrent DB + application. Applications that have multiple + threads of control obtaining exclusive (write) + locks are prone to contention issues. Moreover, as + you increase the numbers of lockers and as you + increase the time that a lock is held, you increase + the chances of your application seeing lock contention. +

    +

    + As you are designing your application, try to do + the following in order to reduce lock contention: +

    +
    +
      +
    • +

      + Reduce the length of time your application + holds locks. +

      +

      + Shorter lived transactions will result in + shorter lock lifetimes, which will in turn + help to reduce lock contention. +

      +

      + In addition, by default transactional cursors hold read + locks until such a time as the transaction is completed. + For this reason, try to + minimize the time you keep + transactional cursors + opened, or reduce your isolation + levels – see below. +

      +
    • +
    • +

      + If possible, access heavily accessed (read + or write) items toward the end of the + transaction. This reduces the amount of + time that a heavily used + + page + + + is locked by the transaction. +

      +
    • +
    • +

      + Reduce your application's isolation + guarantees. +

      +

      + By reducing your isolation guarantees, you + reduce the situations in which a lock can + block another lock. Try using uncommitted reads + for your read operations in order to + prevent a read lock being blocked by a + write lock. +

      +

      + In addition, for cursors you can use degree + 2 (read committed) isolation, which causes + the cursor to release its read locks as + soon as it is done reading the record (as + opposed to holding its read locks until the + transaction ends). +

      +

      + Be aware that reducing your + isolation guarantees can have + adverse consequences for your + application. Before deciding + to reduce your isolation, take + care to examine your + application's isolation + requirements. + For information on isolation + levels, see + Isolation. +

      +
    • +
    • +

      + Consider your data access patterns. +

      +

      + Depending on the nature of your application, + this may be something that you can not + do anything about. However, if it is + possible to create your threads such that + they operate only on non-overlapping + portions of your database, then you can + reduce lock contention because your + threads will rarely (if ever) block on one another's + locks. +

      +
    • +
    +
    +
    +

    Note

    +

    + It is possible to configure DB's transactions + so that they never wait on blocked lock requests. + Instead, if they are blocked on a lock request, + they will notify the application of a deadlock (see + the next section). +

    +

    + You configure this behavior on a transaction by + transaction basis. See No Wait on Blocks for more information. +

    +
    +
    +
    +
    +
    +
    +
    +

    Deadlocks

    +
    +
    +
    +
    +

    + A deadlock occurs when two or more threads of control are + blocked, each waiting on a resource held by the other + thread. When this happens, there is no + possibility of the threads ever making forward progress + unless some outside agent takes action to break the + deadlock. +

    +

    + For example, if + Txn A is + blocked by Txn B at the same time + Txn B is blocked by Txn + A then the threads of control containing + Txn A and Txn B are + deadlocked; neither thread can make + any forward progress because neither thread will ever release the lock + that is blocking the other thread. +

    +
    + +
    +

    + When two threads of control deadlock, the only + solution is to have a mechanism external to the two threads + capable of recognizing the deadlock and notifying at least + one thread that it is in a deadlock situation. + Once notified, a thread of + control must abandon the attempted operation in order to + resolve the deadlock. + + + DB's locking subsystem offers a deadlock notification + mechanism. See + Configuring Deadlock Detection + for more information. + + + +

    +

    + Note that when one locker in a thread of control is blocked + waiting on a lock held by another locker in that same + thread of the control, the thread is said to be + self-deadlocked. +

    +
    +
    +
    +
    +

    Deadlock Avoidance

    +
    +
    +
    +
    +

    + The things that you do to avoid lock contention also + help to reduce deadlocks (see Avoiding Blocks). + + + Beyond that, you can also do the following in order to + avoid deadlocks: + + + +

    +
    +
      +
    • +

      + Make sure all threads access data in the same + order as all other threads. So long as threads + lock database pages + in the same basic order, there is no + possibility of a deadlock (threads can still + block, however). +

      +

      + Be aware that if you are using secondary databases (indices), it is not possible to obtain + locks in a consistent order because you cannot predict the order in which locks are obtained + in secondary databases. If you are writing a concurrent application and you are using + secondary databases, you must be prepared to handle deadlocks. +

      +
    • +
    • +

      + If you are using BTrees in which you are + constantly adding and then deleting data, turn + Btree reverse split off. See + Reverse BTree Splits + for more information. +

      +
    • +
    • +

      + Declare a read/modify/write lock for those + situations where you are reading a record in + preparation of modifying and then writing the + record. Doing this causes DB to give your + read operation a write lock. This means that no + other thread of control can share a read lock + (which might cause contention), but it also + means that the writer thread will not have to + wait to obtain a write lock when it is ready to + write the modified data back to the database. +

      +

      + For information on declaring + read/modify/write locks, see + Read/Modify/Write. +

      +
    • +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/deadlock.jpg b/db/docs/gsg_txn/CXX/deadlock.jpg new file mode 100644 index 000000000..0995a84d8 Binary files /dev/null and b/db/docs/gsg_txn/CXX/deadlock.jpg differ diff --git a/db/docs/gsg_txn/CXX/enabletxn.html b/db/docs/gsg_txn/CXX/enabletxn.html new file mode 100644 index 000000000..19ab65b21 --- /dev/null +++ b/db/docs/gsg_txn/CXX/enabletxn.html @@ -0,0 +1,942 @@ + + + + + + Chapter 2. Enabling Transactions + + + + + + + + + +
    +
    +
    +
    +

    Chapter 2. Enabling Transactions

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Environments + +
    +
    +
    +
    + + File Naming + +
    +
    + + Error Support + +
    +
    + + Shared Memory Regions + +
    +
    + + Security Considerations + +
    +
    +
    +
    + + Opening a Transactional Environment and + Database + + + +
    +
    +
    +

    + In order to use transactions with your application, you must turn them + on. To do this you must: +

    +
    +
      +
    • +

      + Use an + environment (see Environments for details). +

      +
    • +
    • +

      + Turn on transactions for your environment. + + + + + You do this by providing the DB_INIT_TXN + flag to the + DbEnv::open() + + method. + + + + Note that initializing the transactional subsystem implies that + the logging subsystem is also initialized. Also, note that + if you do not initialize transactions when you first create + your environment, then you cannot use transactions for that + environment after that. This is because DB + allocates certain structures needed for transactional + locking that are not available if the environment is + created without transactional support. + +

      +
    • +
    • +

      + Initialize the in-memory cache by + + passing the DB_INIT_MPOOL + flag to the + DbEnv::open() + + method. + + + +

      +
    • +
    • +

      + Initialize the locking subsystem. This is what provides locking for concurrent applications. It also is used + to perform deadlock detection. See Concurrency + for more information. +

      +

      + You initialize the locking subsystem by + + passing the DB_INIT_LOCK + flag to the + DbEnv::open() + + method. + + + +

      +
    • +
    • +

      + Initialize the logging subsystem. While this is enabled by + default for transactional applications, we suggest that + you explicitly initialize it anyway for the purposes of code readability. The logging + subsystem is what provides your transactional application its durability guarantee, and it is required for + recoverability purposes. See Managing DB Files + for more information. +

      +

      + You initialize the logging subsystem by + + passing the DB_INIT_LOG + flag to the + DbEnv::open() + + method. + + + +

      +
    • +
    • +

      + Transaction-enable your databases. You do this by + + + + encapsulating the database open in a transaction. + + + + + + Note that the common practice is for auto commit to be used to + transaction-protect the database open. To use auto-commit, you + must still enable transactions as described here, but you do + not have to explicitly use a transaction when you open your + database. An example of this is given in the next section. + +

      +
    • +
    +
    +
    +
    +
    +
    +

    Environments

    +
    +
    +
    +
    +

    + For simple DB applications, environments are optional. However, in + order to transaction protect your database operations, you must use an + environment. +

    +

    + An environment, represents an + encapsulation of one or more databases and any associated log and + region files. They are used to support multi-threaded + and multi-process applications by allowing different threads of + control to share the in-memory cache, the locking tables, the + logging subsystem, and the file namespace. By sharing these things, + your concurrent application is more efficient than if each thread + of control had to manage these resources on its own. +

    +

    + By default all DB databases are backed by files on disk. In + addition to these files, transactional DB applications create + logs that are also by default stored on disk (they can optionally + be backed using shared memory). Finally, transactional + DB applications also create and use shared-memory regions that + are also typically backed by the filesystem. But like databases and + logs, the regions can be maintained strictly in-memory if your + application requires it. For an example of an application that + manages all environment files in-memory, see + In-Memory Transaction Example. + + +

    +
    +
    +
    +
    +

    File Naming

    +
    +
    +
    +
    +

    + In order to operate, your DB application must be able to + locate its database files, log files, and region files. If these + are stored in the filesystem, then you must tell DB where + they are located (a number of mechanisms exist that allow you to + identify the location of these files – see below). Otherwise, + by default they are located in the current working directory. +

    +
    +
    +
    +
    +

    Specifying the Environment Home Directory

    +
    +
    +
    +
    +

    + The environment home directory is used to determine where + DB files are located. Its location + is identified using one of the following mechanisms, in the + following order of priority: +

    +
    +
      +
    • +

      + If no information is given as to where to put the + environment home, then the current working + directory is used. +

      +
    • +
    • +

      + If a home directory is specified on the + + DbEnv::open() + + method, + + then that location is always used for the environment + home. +

      +
    • +
    • +

      + If a home directory is not supplied to + + DbEnv::open(), + + then the directory identified by the DB_HOME environment variable + is used if you specify + + either the DB_USE_ENVIRON or + DB_USE_ENVIRON_ROOT flags to the + + DbEnv::open() + method. Both flags allow you to identify the + path to the environment's home directory + using the DB_HOME environment variable. However, + DB_USE_ENVIRON_ROOT is honored only if the + process is run with root or administrative privileges. + + + +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    Specifying File Locations

    +
    +
    +
    +
    +

    + By default, all DB files are created relative to the environment + home directory. For example, suppose your environment home is in + /export/myAppHome. Also suppose you name your database + data/myDatabase.db. + + Then in this case, the database is placed in: + /export/myAppHome/data/myDatabase.db. + +

    +

    + That said, DB always defers to absolute pathnames. + This means that if you provide an absolute filename when you + name your database, then that file is not + placed relative to the environment home directory. Instead, it + is placed in the exact location that you specified for the + filename. +

    +

    + On UNIX systems, an absolute pathname is a name that begins with a + forward slash ('/'). On Windows systems, an absolute pathname is a + name that begins with one of the following: +

    +
    +
      +
    • +

      + A backslash ('\'). +

      +
    • +
    • +

      + Any alphabetic letter, followed by a colon (':'), followed + by a backslash ('\'). +

      +
    • +
    +
    +
    +

    Note

    +

    + Try not to use absolute path names for your + environment's files. Under certain recovery scenarios, absolute path names can + render your environment unrecoverable. This occurs if you are attempting to recover + you environment on a system that does not support the absolute path name that you used. +

    +
    +
    +
    +
    +
    +
    +

    Identifying Specific File Locations

    +
    +
    +
    +
    +

    + As described in the previous sections, DB will place all its + files in or relative to the environment home directory. + You can also cause a + specific database file to be placed in a particular location by + using an absolute path name for its name. In this + situation, the environment's home directory is not + considered when naming the file. +

    +

    + It is frequently desirable to place database, log, and region files on separate + disk drives. By spreading I/O across multiple drives, you + can increase parallelism and improve throughput. + Additionally, by placing log files and database files on + separate drives, you improve your application's + reliability by providing your application with a greater + chance of surviving a disk failure. +

    +

    + You can cause DB's files to be placed in specific + locations using the following mechanisms: +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    File TypeTo Override
    database files +

    + You can cause database files to be created + in a directory other than the + environment home by using the + + DbEnv::set_data_dir() + + method. + The directory identified + here must exist. If a relative path is + provided, then the directory location is + resolved relative to the environment's home + directory. +

    +

    + This method modifies the directory + used for database files created and managed by + a single environment handle; it does not + configure the entire environment. + This + method may not be called after the + environment has been opened. + +

    +

    + You can also set a default data location that is used by + the entire environment by using the + set_data_dir parameter + in the environment's DB_CONFIG file. + Note that the set_data_dir + parameter overrides any value set by the + + DbEnv::set_data_dir() + + method. +

    +
    Log files +

    + You can cause log files to be created + in a directory other than the environment home + directory by using the + + DbEnv::set_lg_dir() + + method. The directory identified + here must exist. If a relative path is + provided, then the directory location is + resolved relative to the environment's home + directory. +

    +

    + This method modifies the directory + used for database files created and managed by + a single environment handle; it does not + configure the entire environment. + This + method may not be called after the + environment has been opened. + +

    +

    + You can also set a default log file location that is used by + the entire environment by using the + set_lg_dir parameter + in the environment's DB_CONFIG file. + Note that the set_lg_dir + parameter overrides any value set by the + + DbEnv::set_lg_dir() + + method. +

    +
    Region files + If backed by the filesystem, region + files are always placed in the environment home + directory. +
    +
    +

    + Note that the DB_CONFIG must reside in the + environment home directory. Parameters are specified in it one + parameter to a line. Each parameter is followed by a space, + which is followed by the parameter value. For example: +

    +
        set_data_dir /export1/db/env_data_files 
    +
    +
    +
    +
    +
    +
    +

    Error Support

    +
    +
    +
    +
    +

    + To simplify error handling and to aid in application debugging, environments offer several useful + methods. + + Note that many of these + methods are identical to the error handling methods available for the + + Db + + + class. + + + + They are: +

    +
    +
      +
    • +

      + set_error_stream() + +

      +

      + Sets the + C++ ostream + + to be used for displaying error messages issued by the DB library. +

      +
    • +
    • +

      + set_errcall() + +

      +

      + Defines the function that is called when an error message is + issued by DB. The error prefix and message are passed to + this callback. It is up to the application to display this + information correctly. +

      +
    • +
    • +

      + set_errfile() +

      +

      + Sets the C library FILE * to be used for + displaying error messages issued by the DB library. +

      +
    • +
    • +

      + set_errpfx() + +

      +

      + Sets the prefix used to for any error messages issued by the + DB library. +

      +
    • +
    • +

      + err() +

      +

      + Issues an error message based upon a DB error code a message text that you supply. + The error message is sent to the + callback function as defined by set_errcall(). + If that method has not been used, then the error message is sent to the + file defined by + + + set_errfile() or set_error_stream(). + + If none of these methods have been used, then the error message is sent to + standard error. +

      +

      + The error message consists of the prefix string + (as defined by set_errprefix()), + an optional printf-style formatted message, + the DB error message associated with the supplied error code, + and a trailing newline. +

      +
    • +
    • +

      + errx() +

      +

      + Behaves identically to err() except + that you do not provide the DB error code and so + the DB message text is not displayed. +

      +
    • +
    +
    +

    + In addition, you can use the db_strerror() + function to directly return the error string that corresponds to a + particular error number. For more information on the + db_strerror() function, see the Error Returns + section of the Getting Started with Berkeley DB guide. +

    +
    +
    +
    +
    +
    +

    Shared Memory Regions

    +
    +
    +
    +
    +

    + The subsystems that you enable for an environment (in our case, + transaction, logging, locking, and the memory pool) + are described by one or more regions. The regions contain all of the + state information that needs to be shared among threads and/or + processes using the environment. +

    +

    + Regions may be backed by the file system, by heap memory, or by + system shared memory. +

    +
    +
    +
    +
    +

    Regions Backed by Files

    +
    +
    +
    +
    +

    + By default, shared memory regions are created as files in the environment's + home directory (not the environment's data + directory). If it is available, the POSIX mmap + interface is used to map these files into your application's + address space. If mmap + is not available, then the UNIX shmget interfaces + are used instead (again, if they are available). +

    +

    + In this default case, the region files are named + __db.### + (for example, __db.001, __db.002, + and so on). +

    +
    +
    +
    +
    +
    +

    Regions Backed by Heap Memory

    +
    +
    +
    +
    +

    + If heap memory is used to back your shared memory regions, + the environment may only be + accessed by a single process, although that process may be + multi-threaded. In this case, the regions are managed only in + memory, and they are not written to the filesystem. You + indicate that heap memory is to be used for the region files by + specifying + + DB_PRIVATE to the + + DbEnv::open() + method. + + + + +

    +

    + (For an example of an entirely in-memory transactional + application, see + + In-Memory Transaction Example.) + + + +

    +
    +
    +
    +
    +
    +

    Regions Backed by System Memory

    +
    +
    +
    +
    +

    + Finally, you can cause system memory to be used for your + regions instead of memory-mapped files. You do this by providing + + DB_SYSTEM_MEM to the + + DbEnv::open() + method. + + + +

    +

    + When region files are backed by system memory, DB creates a + single file in the environment's home directory. This file + contains information necessary to identify the system shared + memory in use by the environment. By creating this file, DB + enables multiple processes to share the environment. +

    +

    + The system memory that is used is architecture-dependent. For + example, on systems supporting X/Open-style shared memory + interfaces, such as UNIX systems, the shmget(2) + and related System V IPC interfaces are used. + + + + Additionally, VxWorks systems use system memory. In these cases, + an initial segment ID must be specified by the application to + ensure that applications do not overwrite each other's + environments, so that the number of segments created does not + grow without bounds. See the + + + DbEnv::set_shm_key() + + method for more information. + +

    +

    + On Windows platforms, the use of system memory for the region files + is problematic because the operating system uses reference counting + to clean up shared objects in the paging file automatically. In + addition, the default access permissions for shared objects are + different from files, which may cause problems when an environment + is accessed by multiple processes running as different users. See + Windows notes + or more information. +

    +
    +
    +
    +
    +
    +
    +

    Security Considerations

    +
    +
    +
    +
    +

    + When using environments, there are some security considerations to + keep in mind: +

    +
    +
      +
    • +

      + Database environment permissions +

      +

      + The directory used for the environment + should have its permissions set to ensure that files in the + environment are not accessible to users without appropriate + permissions. Applications that add to the user's permissions + (for example, UNIX setuid or + setgid applications), must be + carefully checked to not permit illegal use of those + permissions such as general file access in the environment + directory. +

      +
    • +
    • +

      + Environment variables +

      +

      + Setting + + + the DB_USE_ENVIRON or + DB_USE_ENVIRON_ROOT flags + + + + so that environment variables can be used during file naming + can be dangerous. Setting those flags in DB + applications with additional permissions (for example, UNIX + setuid or setgid + applications) could potentially allow users + to read and write databases to which they would not normally + have access. +

      +

      + For example, suppose you write a DB application + that runs setuid. This means that + when the application runs, it does so under a + userid different than that of the application's caller. + This is especially problematic if the application is + granting stronger privileges to a user than the user + might ordinarily have. +

      +

      + Now, if + + the DB_USE_ENVIRON or + DB_USE_ENVIRON_ROOT flags + are set for the environment, + + + + + then the environment that the application is + using is modifiable using the + DB_HOME environment variable. In + this scenario, if the uid used by the application has + sufficiently broad privileges, then the application's caller + can read and/or write databases owned by another user + simply by setting his + DB_HOME environment variable to the + environment used by that other user. +

      +

      + Note that this scenario need not be malicious; the + wrong environment could be used by the application + simply by inadvertently specifying the wrong path to + DB_HOME. +

      +

      + As always, you should use setuid + sparingly, if at all. But if you do use + setuid, then you should refrain from + specifying + + the DB_USE_ENVIRON or + DB_USE_ENVIRON_ROOT flags + + + for the environment open. And, of course, if you must + use setuid, then make sure you use + the weakest uid possible – preferably one that is + used only by the application itself. +

      +
    • +
    • +

      + File permissions +

      +

      + By default, DB always creates database and log files readable and + writable by the owner and the group (that is, + S_IRUSR, + S_IWUSR, S_IRGRP and + S_IWGRP; or octal mode 0660 on historic + UNIX systems). The group ownership of created files is based + on the system and directory defaults, and is not further + specified by DB. +

      +
    • +
    • +

      + Temporary backing files +

      +

      + If an unnamed database is created and the cache is too small + to hold the database in memory, Berkeley DB will create a + temporary physical file to enable it to page the database to + disk as needed. In this case, environment variables such as + TMPDIR may be used to specify the + location of that temporary file. Although temporary backing + files are created readable and writable by the owner only + (S_IRUSR and S_IWUSR, + or octal mode 0600 on historic UNIX systems), some + filesystems may not sufficiently protect temporary files + created in random directories from improper access. To be + absolutely safe, applications storing sensitive data in + unnamed databases should use the + + DbEnv::set_tmp_dir() + + method to specify a temporary directory with known permissions. +

      +
    • +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/envopen.html b/db/docs/gsg_txn/CXX/envopen.html new file mode 100644 index 000000000..69028ca87 --- /dev/null +++ b/db/docs/gsg_txn/CXX/envopen.html @@ -0,0 +1,190 @@ + + + + + + Opening a Transactional Environment and + Database + + + + + + + + + + + +
    +
    +
    +
    +

    Opening a Transactional Environment and + Database + +

    +
    +
    +
    +
    +

    + To enable transactions for your environment, you must initialize the + transactional subsystem. Note that doing this also initializes the + logging subsystem. In addition, you must initialize the memory pool + (in-memory cache). Frequently, but not always, you will also + initialize the locking subsystem. For example: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_INIT_TXN;     // Initialize transactions
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database environment: "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    try {
    +        myEnv.close(0);
    +    } catch(DbException &e) {
    +        std::cerr << "Error closing database environment: "
    +                << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    return (EXIT_SUCCESS);
    +} 
    +

    + You then create and open your database(s) as you would for a non-transactional system. + + The only difference is that you must pass the environment handle to + the + + + DbEnv::open() method, + + and you must open the database within a transaction. + Typically auto commit is used for this purpose. To do so, pass + DB_AUTO_COMMIT to the database open command. + Also, make sure you close all your databases before you close + your environment. + For example: + + + +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    u_int32_t db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    Db *dbp = NULL;
    +    const char *file_name = "mydb.db";
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +        dbp = new Db(&myEnv, 0);
    +        dbp->open(NULL,       // Txn pointer 
    +                  file_name,  // File name 
    +                  NULL,       // Logical db name 
    +                  DB_BTREE,   // Database type (using btree) 
    +                  db_flags,   // Open flags 
    +                  0);         // File mode. Using defaults 
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database and environment: "
    +                  << file_name << ", "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +    }
    +
    +    try {
    +        dbp->close(0);
    +        myEnv.close(0);
    +    } catch(DbException &e) {
    +        std::cerr << "Error closing database and environment: "
    +                  << file_name << ", "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    return (EXIT_SUCCESS);
    +} 
    +
    +

    Note

    +

    + Never close a database that has active transactions. Make sure + all transactions are resolved (either committed or aborted) + before closing the database. +

    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/filemanagement.html b/db/docs/gsg_txn/CXX/filemanagement.html new file mode 100644 index 000000000..f22698eaf --- /dev/null +++ b/db/docs/gsg_txn/CXX/filemanagement.html @@ -0,0 +1,384 @@ + + + + + + Chapter 5. Managing DB Files + + + + + + + + + +
    +
    +
    +
    +

    Chapter 5. Managing DB Files

    +
    +
    +
    +
    + +

    + DB is capable of storing several types of files on disk: +

    +
    +
      +
    • +

      + Data files, which contain the actual data in your database. +

      +
    • +
    • +

      + Log files, which contain information required to recover your + database in the event of a system or application failure. +

      +
    • +
    • +

      + Region files, which contain information necessary for the + overall operation of your application. +

      +
    • +
    • +

      + Temporary files, which are created only under certain special circumstances. These files never need to + be backed up or otherwise managed and so they are not a consideration for the topics described in this + chapter. See Security Considerations + for more information on temporary files. +

      +
    • +
    +
    +

    + Of these, you must manage your data and log files by ensuring that they + are backed up. You should also pay attention to the amount of disk space + your log files are consuming, and periodically remove any unneeded + files. Finally, you can optionally tune your logging subsystem to best + suit your application's needs and requirements. + These topics are discussed in this chapter. +

    +
    +
    +
    +
    +

    Checkpoints

    +
    +
    +
    +
    +

    + Before we can discuss DB file management, we need to + describe checkpoints. When databases are modified (that is, a + transaction is committed), the modifications are recorded in + DB's logs, but they are not + necessarily reflected in the actual database files on disk. +

    +

    + This means that as time goes on, increasingly + more data is contained in your log files that is not + contained in your data files. As a result, you must keep more + log files around than you might actually need. Also, any + recovery run from your log files will take increasingly longer + amounts of time, because there is more data in the log files + that must be reflected back into the data files during the + recovery process. +

    +

    + You can reduce these problems by periodically + running a checkpoint against your environment. The checkpoint: +

    +
    +
      +
    • +

      + Flushes dirty pages from the in-memory cache. This means that data modifications found in your + in-memory cache are written to the database files on disk. Note that a checkpoint also causes data + dirtied by an uncommitted transaction to also be written to your database files on disk. In this latter + case, DB's normal recovery is used to remove any such modifications that were subsequently + abandoned by your application using a transaction abort. +

      +

      + Normal recovery is describe in Recovery Procedures. +

      +
    • +
    • +

      + Writes a checkpoint record. +

      +
    • +
    • +

      + Flushes the log. This causes all log data that has not yet been written to disk to be written. +

      +
    • +
    • +

      + Writes a list of open databases. +

      +
    • +
    +
    +

    + There are several ways to run a checkpoint. One way is to use + the db_checkpoint command line utility. (Note, however, that this command line utility + cannot be used if your environment was opened using + + DB_PRIVATE.) + + +

    +

    + You can also run a thread that periodically checkpoints your + environment for you by calling the + + DbEnv::txn_checkpoint() + + method. +

    +

    + Note that you can prevent a checkpoint from occurring unless more + than a specified amount of log data has been written since the + last checkpoint. You can also prevent the checkpoint from + running unless more than a specified amount of time has + occurred since the last checkpoint. These conditions are + particularly interesting if you have multiple threads + or processes + running checkpoints. +

    +

    + For configuration information, see the + + + DbEnv::txn_checkpoint() API reference page. + + +

    +

    + Note that running checkpoints can be quite expensive. DB must + flush every dirty page to the backing database files. On the + other hand, if you do not run checkpoints often enough, your + recovery time can be unnecessarily long and you may be using more + disk space than you really need. Also, you cannot remove log files + until a checkpoint is run. Therefore, deciding how frequently + to run a checkpoint is one of the most + common tuning activity for DB applications. +

    +

    + For example, to run a checkpoint from a separate thread of control: +

    +
    #include <pthread.h>
    +#include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +void *checkpoint_thread(void *);
    +
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_INIT_TXN;     // Initialize transactions
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +
    +        // Start a checkpoint thread.
    +        pthread_t ptid;
    +        int ret;
    +        if ((ret = pthread_create( 
    +            &ptid, NULL, checkpoint_thread, (void *)&myEnv)) != 0) { 
    +                fprintf(stderr, 
    +                    "txnapp: failed spawning checkpoint thread: %s\n", 
    +                    strerror(errno)); 
    +                myEnv.close(0);
    +                exit (1); 
    +        }
    +
    +        // All other threads and application shutdown code 
    +        // omitted for brevity. 
    +
    +        ...
    +}
    +
    +void * 
    +checkpoint_thread(void *arg) { 
    +    DbEnv *dbenv = arg; 
    +
    +    // Checkpoint once a minute. 
    +    for (;; sleep(60)) {
    +        try {
    +            dbenv->txn_checkpoint(0, 0, 0));
    +        } catch(DbException &e) {
    +            dbenv->err(e.get_errno(), "checkpoint thread"); 
    +            exit (e.get_errno()); 
    +        }
    +    }
    +
    +    // NOTREACHED 
    +} 
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/gettingStarted.css b/db/docs/gsg_txn/CXX/gettingStarted.css new file mode 100644 index 000000000..c1b4c86b7 --- /dev/null +++ b/db/docs/gsg_txn/CXX/gettingStarted.css @@ -0,0 +1,41 @@ +body { width: 45em; + margin-left: 3em; + font-family: Arial, Helvetica, sans-serif; + font-size: 11pt; + } + +h2.title { margin-left: -1em; + font-family: Verdana, serif; + font-size: 16pt; + } + +h3.title { font-family: Verdana, serif; + font-size: 14pt; + } + +pre.programlisting { + font-family: monospace; + background-color: #eae8e9; +} + +div.navheader { font-size: 9pt; + width: 60em; + margin-left: -2em; + } + +div.navheader table tr td { font-size: 9pt; } + +div.navfooter { font-size: 9pt; + width: 60em; + margin-left: -2em; + } +div.navfooter table tr td { font-size: 9pt; } + +span.emphasis { font-style: italic; font-size: 9pt;} + +div.appendix div.informaltable { font-size: 9pt; } +div.appendix div.informaltable td { vertical-align: top; } +div.appendix div.informaltable p { margin-top: .25em; } +div.appendix div.informaltable p { margin-bottom: .25em; } + + diff --git a/db/docs/gsg_txn/CXX/hotfailover.html b/db/docs/gsg_txn/CXX/hotfailover.html new file mode 100644 index 000000000..fa3dcc152 --- /dev/null +++ b/db/docs/gsg_txn/CXX/hotfailover.html @@ -0,0 +1,210 @@ + + + + + + Using Hot Failovers + + + + + + + + + +
    +
    +
    +
    +

    Using Hot Failovers

    +
    +
    +
    +
    +

    + You can maintain a backup that can be used for failover purposes. + Hot failovers differ from the backup and restore + procedures described previously in this chapter in that data + used for traditional backups is typically copied to offline storage. + Recovery time for a traditional backup is determined by: +

    +
    +
      +
    • +

      + How quickly you can retrieve that storage media. + Typically storage media for critical backups is moved + to a safe facility in a remote location, so this step can + take a relatively long time. +

      +
    • +
    • +

      + How fast you can read the backup from the storage media + to a local disk drive. If you have very large backups, + or if your storage media is very slow, this can be a + lengthy process. +

      +
    • +
    • +

      + How long it takes you to run catastrophic recovery + against the newly restored backup. As described earlier + in this chapter, this process can be lengthy because + every log file must be examined during the recovery + process. +

      +
    • +
    +
    +

    + When you use a hot failover, the backup is maintained + at a location that is reasonably fast to access. Usually, this + is a second disk drive local to the machine. + In this situation, recovery time is very quick + because you only have to reopen your + environment and database, using the failover environment + for the environment open. +

    +

    + Hot failovers obviously do not protect you from truly + catastrophic disasters (such as a fire in your machine room) + because the backup is still local to the machine. However, + you can guard against more mundane problems (such as a broken + disk drive) by keeping the backup on a + second drive that is managed by an alternate disk controller. +

    +

    + To maintain a hot failover: +

    +
    +
      +
    1. +

      + Copy all the active database files to the failover + directory. Use the db_archive + command line utility with the + -s option to identify all the active + database files. +

      +
    2. +
    3. +

      + Identify all the inactive log files in your production + environment and move these to the failover + directory. Use the db_archive + command with no command line options to obtain a list + of these log files. +

      +
    4. +
    5. +

      + Identify the active log files in your production + environment, and copy these to the + failover directory. Use the + db_archive command with the + -l option to obtain a list of these + log files. +

      +
    6. +
    7. +

      + Run catastrophic recovery against the failover + directory. Use the db_recover + command with the -c option to do + this. +

      +
    8. +
    9. +

      + Optionally copy the backup to an archival location. +

      +
    10. +
    +
    +

    + Once you have performed this procedure, you can maintain an + active hot backup by repeating steps 2 - 5 as often + as is required by your application. +

    +
    +

    Note

    +

    + If you perform step 1, steps 2-5 must follow in order to + ensure consistency of your hot backup. +

    +
    +
    +

    Note

    +

    + Rather than use the previous procedure, you can use the db_hotbackup command line utility + to do the same thing. This utility will (optionally) run a checkpoint and then copy all necessary files to a target + directory for you. +

    +
    +

    + To actually perform a failover, simply: +

    +
    +
      +
    1. +

      + Shut down all processes which are running against the original environment. +

      +
    2. +
    3. +

      + If you have an archival copy of the backup environment, you can optionally try copying the remaining + log files from the original environment and running catastrophic recovery against that backup + environment. Do this only if you have a an archival copy of the backup + environment. +

      +

      + This step can allow you to recover data created or modified in the original environment, but which + did not have a chance to be reflected in the hot backup environment. +

      +
    4. +
    5. +

      + Reopen your environment and databases as normal, but use + the backup environment instead of the production + environment. +

      +
    6. +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/index.html b/db/docs/gsg_txn/CXX/index.html new file mode 100644 index 000000000..e43890ce3 --- /dev/null +++ b/db/docs/gsg_txn/CXX/index.html @@ -0,0 +1,525 @@ + + + + + + Getting Started with Berkeley DB Transaction Processing + + + + + + + +
    +
    +
    +
    +

    Getting Started with Berkeley DB Transaction Processing

    +
    +
    +
    +

    + Legal Notice +

    +

    + This documentation is distributed under an open source license. + You may review the terms of this license at: + http://www.oracle.com/technology/software/products/berkeley-db/htdocs/oslicensing.html + + +

    +

    + Oracle, Berkeley DB, + + + and + Sleepycat are trademarks or registered trademarks of + Oracle Corporation. All rights to these marks are reserved. + No third-party use is permitted without the + express prior written consent of Oracle Corporation. +

    +

    + To obtain a copy of this document's original source code, please + submit a request to the Oracle Technology Network forum at: + http://forums.oracle.com/forums/forum.jspa?forumID=271 + + +

    +
    +
    +
    +

    9/20/2006

    +
    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Preface + +
    +
    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +
    + + 1. Introduction + +
    +
    +
    +
    + + Transaction Benefits + +
    +
    +
    +
    + + A Note on System Failure + +
    +
    + + Application Requirements + +
    +
    + + Multi-threaded + and Multi-process + Applications + +
    +
    +
    +
    + + Recoverability + +
    +
    + + Performance Tuning + +
    +
    +
    +
    + + 2. Enabling Transactions + +
    +
    +
    +
    + + Environments + +
    +
    +
    +
    + + File Naming + +
    +
    + + Error Support + +
    +
    + + Shared Memory Regions + +
    +
    + + Security Considerations + +
    +
    +
    +
    + + Opening a Transactional Environment and + Database + + + +
    +
    +
    +
    + + 3. Transaction Basics + +
    +
    +
    +
    + + Committing a Transaction + +
    +
    +
    +
    + + Non-Durable Transactions + +
    +
    +
    +
    + + Aborting a Transaction + +
    +
    + + Auto Commit + +
    +
    + + Nested Transactions + +
    +
    + + Transactional Cursors + +
    +
    + + Secondary Indices with Transaction Applications + +
    +
    + + Configuring the Transaction Subsystem + +
    +
    +
    +
    + + 4. Concurrency + +
    +
    +
    +
    + + Which DB Handles are Free-Threaded + +
    +
    + + Locks, Blocks, and Deadlocks + +
    +
    +
    +
    + + Locks + +
    +
    + + Blocks + +
    +
    + + Deadlocks + +
    +
    +
    +
    + + The Locking Subsystem + +
    +
    +
    +
    + + Configuring the Locking Subsystem + +
    +
    + + Configuring Deadlock Detection + +
    +
    + + Resolving Deadlocks + +
    +
    +
    +
    + + Isolation + +
    +
    +
    +
    + + Supported Degrees of Isolation + +
    +
    + + Reading Uncommitted Data + +
    +
    + + Committed Reads + +
    +
    + + Using Snapshot Isolation + +
    +
    +
    +
    + + Transactional Cursors and Concurrent Applications + +
    +
    +
    +
    + + Using Cursors with Uncommitted Data + +
    +
    +
    +
    + + Read/Modify/Write + +
    +
    + + No Wait on Blocks + +
    +
    + + Reverse BTree Splits + +
    +
    +
    +
    + + 5. Managing DB Files + +
    +
    +
    +
    + + Checkpoints + +
    +
    + + Backup Procedures + +
    +
    +
    +
    + + About Unix Copy Utilities + +
    +
    + + Offline Backups + +
    +
    + + Hot Backup + +
    +
    + + Incremental Backups + +
    +
    +
    +
    + + Recovery Procedures + +
    +
    +
    +
    + + Normal Recovery + +
    +
    + + Catastrophic Recovery + +
    +
    +
    +
    + + Designing Your Application for Recovery + +
    +
    +
    +
    + + Recovery for Multi-Threaded Applications + +
    +
    + + Recovery in Multi-Process Applications + +
    +
    +
    +
    + + Using Hot Failovers + +
    +
    + + Removing Log Files + +
    +
    + + Configuring the Logging Subsystem + +
    +
    +
    +
    + + Setting the Log File Size + +
    +
    + + Configuring the Logging Region Size + +
    +
    + + Configuring In-Memory Logging + +
    +
    + + Setting the In-Memory Log Buffer Size + +
    +
    +
    +
    +
    +
    + + 6. Summary and Examples + +
    +
    +
    +
    + + Anatomy of a Transactional Application + +
    +
    + + Transaction Example + +
    +
    + + In-Memory Transaction Example + +
    +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/inmem_txnexample_c.html b/db/docs/gsg_txn/CXX/inmem_txnexample_c.html new file mode 100644 index 000000000..5e5dd5f0a --- /dev/null +++ b/db/docs/gsg_txn/CXX/inmem_txnexample_c.html @@ -0,0 +1,546 @@ + + + + + + In-Memory Transaction Example + + + + + + + + +
    +
    +
    +
    +

    In-Memory Transaction Example

    +
    +
    +
    +
    +

    + DB is sometimes used for applications that simply need to cache + data retrieved from some other location (such as a remote database + server). DB is also often used in embedded systems. +

    +

    + In both cases, applications may want to use transactions for + atomicity, consistency, and isolation guarantees, but they may also want + to forgo the durability guarantee entirely. In doing so, they can keep + their DB environment and databases entirely in-memory so + as to avoid the performance impact of unneeded disk I/O. +

    +

    + To do this: +

    +
    +
      +
    • +

      + Refrain from specifying a home directory when you open your + environment. The exception to this is if you are using the + DB_CONFIG configuration file — in + that case you must identify the environment's home + directory so that the configuration file can be found. +

      +
    • +
    • +

      + Configure your environment to back your regions from + system memory instead of the filesystem. +

      +
    • +
    • +

      + Configure your logging subsystem such that log files are kept + entirely in-memory. +

      +
    • +
    • +

      + Increase the size of your in-memory log buffer so that it + is large enough to hold the largest set of concurrent write operations. +

      +
    • +
    • +

      + Increase the size of your in-memory cache so that it can + hold your entire data set. You do not want your cache to + page to disk. +

      +
    • +
    • +

      + Do not specify a file name when you open your database(s). +

      +
    • +
    +
    +

    + As an example, this section takes the transaction example provided + in Transaction Example + and it updates that example so that the environment, database, log + files, and regions are all kept entirely in-memory. +

    +

    + For illustration purposes, we also modify this example so that + uncommitted reads are no longer used to enable the + + countRecords() + function. Instead, we simply provide a transaction handle to + + countRecords() + so as to avoid the self-deadlock. Be aware that using a transaction handle here rather than + uncommitted reads will work just as well as if we had continued to use uncommitted reads. However, + the usage of the transaction handle here will + probably cause more deadlocks than using read-uncommitted does, because more locking is being performed in + this case. +

    +

    + To begin, we simplify the beginning of our example a bit. Because + we no longer need an environment home directory, we can remove all + the code that we used to determine path delimiters + and include the getopt function. We can also + remove our usage() function because we no + longer require any command line arguments. +

    +
    // File TxnGuideInMemory.cpp
    +
    +// We assume an ANSI-compatible compiler
    +#include <db_cxx.h>
    +#include <pthread.h>
    +#include <iostream>
    +
    +// Run 5 writers threads at a time.
    +#define NUMWRITERS 5
    +
    +// Printing of pthread_t is implementation-specific, so we
    +// create our own thread IDs for reporting purposes.
    +int global_thread_num;
    +pthread_mutex_t thread_num_lock;
    +
    +// Forward declarations
    +int countRecords(Db *, DbTxn *);
    +int openDb(Db **, const char *, const char *, DbEnv *, u_int32_t);
    +int usage(void);
    +void *writerThread(void *);  
    +

    + Next, in our main(), we also eliminate some + variables that this example no longer needs. In particular, we are able to remove + the + + dbHomeDir + and + + fileName + variables. We also remove all our getopt code. +

    +
    int
    +main(void)
    +{
    +    // Initialize our handles
    +    Db *dbp = NULL;
    +    DbEnv *envp = NULL;
    +
    +    pthread_t writerThreads[NUMWRITERS];
    +    int i;
    +    u_int32_t envFlags;
    +
    +    // Application name
    +    const char *progName = "TxnGuideInMemory";  
    +

    + Next we create our environment as always. However, we add + DB_PRIVATE to our environment open flags. This + flag causes our environment to back regions using our + application's heap memory rather than by using the filesystem. + This is the first important step to keeping our DB data + entirely in-memory. +

    +

    + We also remove the DB_RECOVER flag from the environment open flags. Because our databases, + logs, and regions are maintained in-memory, there will never be anything to recover. +

    +

    + Note that we show the additional code here in + bold. +

    +
        // Env open flags
    +    envFlags =
    +      DB_CREATE     |  // Create the environment if it does not exist
    +      DB_INIT_LOCK  |  // Initialize the locking subsystem
    +      DB_INIT_LOG   |  // Initialize the logging subsystem
    +      DB_INIT_TXN   |  // Initialize the transactional subsystem. This
    +                       // also turns on logging.
    +      DB_INIT_MPOOL |  // Initialize the memory pool (in-memory cache)
    +      DB_PRIVATE    |  // Region files are not backed by the filesystem.
    +                       // Instead, they are backed by heap memory.
    +      DB_THREAD;       // Cause the environment to be free-threaded
    +
    +    try {
    +        // Create the environment 
    +        envp = new DbEnv(0); 
    +

    + Now we configure our environment to keep the log files in memory, + increase the log buffer size to 10 MB, and increase our in-memory + cache to 10 MB. These values should be more than enough for our + application's workload. +

    +
    +        
    +                  // Specify in-memory logging
    +        envp->set_flags(DB_LOG_INMEMORY, 1);
    +
    +        // Specify the size of the in-memory log buffer.
    +        envp->set_lg_bsize(10 * 1024 * 1024);
    +
    +        // Specify the size of the in-memory cache
    +        envp->set_cachesize(0, 10 * 1024 * 1024, 1); 
    +        
    +      
    +

    + Next, we open the environment and setup our lock detection. This is + identical to how the example previously worked, except that we do not + provide a location for the environment's home directory. +

    +
            // Indicate that we want db to internally perform deadlock 
    +        // detection.  Also indicate that the transaction with 
    +        // the fewest number of write locks will receive the 
    +        // deadlock notification in the event of a deadlock.
    +        envp->set_lk_detect(DB_LOCK_MINWRITE);
    +
    +        // Open the environment
    +        envp->open(NULL, envFlags, 0); 
    +

    + When we call + + openDb(), + which is what we use + to open our database, we no not provide a database filename for the + third parameter. When the filename is NULL, the database is not + backed by the filesystem. +

    +
            // If we had utility threads (for running checkpoints or 
    +        // deadlock detection, for example) we would spawn those
    +        // here. However, for a simple example such as this,
    +        // that is not required.
    +
    +        // Open the database
    +        openDb(&dbp, progName, NULL,
    +            envp, DB_DUPSORT);
    +        
    +

    + After that, our main() function is unchanged, + except that when we + + check for exceptions on the database open, + we change the error message string so as to not reference the database filename. +

    +
            // Initialize a pthread mutex. Used to help provide thread ids.
    +        (void)pthread_mutex_init(&thread_num_lock, NULL);
    +
    +        // Start the writer threads.
    +        for (i = 0; i < NUMWRITERS; i++)
    +            (void)pthread_create(
    +                &writerThreads[i], NULL,
    +                writerThread,
    +                (void *)dbp);
    +
    +        // Join the writers
    +        for (i = 0; i < NUMWRITERS; i++)
    +            (void)pthread_join(writerThreads[i], NULL);
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database environment: "
    +                  << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    try {
    +        // Close our database handle if it was opened.
    +        if (dbp != NULL)
    +            dbp->close(0);
    +
    +        // Close our environment if it was opened.
    +        if (envp != NULL)
    +            envp->close(0);
    +    } catch(DbException &e) {
    +        std::cerr << "Error closing database and environment."
    +                  << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    // Final status message and return.
    +
    +    std::cout << "I'm all done." << std::endl;
    +    return (EXIT_SUCCESS);
    +} 
    +

    + That completes main(). The bulk of our + writerThread() function implementation is + unchanged from the initial transaction example, except that we now pass + countRecords a transaction handle, rather than configuring our + application to perform uncommitted reads. Both mechanisms work well-enough + for preventing a self-deadlock. However, the individual count + in this example will tend to be lower than the counts seen in + the previous transaction example, because + countRecords() can no longer see records + created but not yet committed by other threads. +

    +
    // A function that performs a series of writes to a
    +// Berkeley DB database. The information written
    +// to the database is largely nonsensical, but the
    +// mechanism of transactional commit/abort and
    +// deadlock detection is illustrated here.
    +void *
    +writerThread(void *args)
    +{
    +    Db *dbp = (Db *)args;
    +    DbEnv *envp = dbp->get_env(dbp);
    +
    +    int j, thread_num;
    +    int max_retries = 20;   // Max retry on a deadlock
    +    char *key_strings[] = {"key 1", "key 2", "key 3", "key 4",
    +                           "key 5", "key 6", "key 7", "key 8",
    +                           "key 9", "key 10"};
    +
    +    // Get the thread number
    +    (void)pthread_mutex_lock(&thread_num_lock);
    +    global_thread_num++;
    +    thread_num = global_thread_num;
    +    (void)pthread_mutex_unlock(&thread_num_lock);
    +
    +    // Initialize the random number generator 
    +    srand((u_int)pthread_self());
    +
    +    // Perform 50 transactions
    +    for (int i=0; i<50; i++) {
    +        DbTxn *txn;
    +        bool retry = true;
    +        int retry_count = 0;
    +        // while loop is used for deadlock retries
    +        while (retry) {
    +            // try block used for deadlock detection and
    +            // general db exception handling
    +            try {
    +
    +                // Begin our transaction. We group multiple writes in
    +                // this thread under a single transaction so as to
    +                // (1) show that you can atomically perform multiple 
    +                // writes at a time, and (2) to increase the chances 
    +                // of a deadlock occurring so that we can observe our 
    +                // deadlock detection at work.
    +
    +                // Normally we would want to avoid the potential for 
    +                // deadlocks, so for this workload the correct thing 
    +                // would be to perform our puts with auto commit. But 
    +                // that would excessively simplify our example, so we 
    +                // do the "wrong" thing here instead.
    +                txn = NULL;
    +                envp->txn_begin(NULL, &txn, 0);
    +                // Perform the database write for this transaction.
    +                for (j = 0; j < 10; j++) {
    +                    Dbt key, value;
    +                    key.set_data(key_strings[j]);
    +                    key.set_size((strlen(key_strings[j]) + 1) *
    +                        sizeof(char));
    +
    +                    int payload = rand() + i;
    +                    value.set_data(&payload);
    +                    value.set_size(sizeof(int));
    +
    +                    // Perform the database put
    +                    dbp->put(txn, &key, &value, 0);
    +                }
    +
    +                // countRecords runs a cursor over the entire database.
    +                // We do this to illustrate issues of deadlocking
    +                std::cout << thread_num <<  " : Found "
    +                          <<  countRecords(dbp, txn)
    +                          << " records in the database." << std::endl;
    +
    +                std::cout << thread_num <<  " : committing txn : " << i
    +                          << std::endl;
    +
    +                // commit
    +                try {
    +                    txn->commit(0);
    +                    retry = false;
    +                    txn = NULL;
    +                } catch (DbException &e) {
    +                    std::cout << "Error on txn commit: "
    +                              << e.what() << std::endl;
    +                }
    +            } catch (DbDeadlockException &de) {
    +                // First thing we MUST do is abort the transaction.
    +                if (txn != NULL)
    +                    (void)txn->abort();
    +
    +                // Now we decide if we want to retry the operation.
    +                // If we have retried less than max_retries,
    +                // increment the retry count and goto retry.
    +                if (retry_count < max_retries) {
    +                    std::cout << "############### Writer " << thread_num
    +                              << ": Got DB_LOCK_DEADLOCK.\n"
    +                              << "Retrying write operation."
    +                              << std::endl;
    +                    retry_count++;
    +                    retry = true;
    +                 } else {
    +                    // Otherwise, just give up.
    +                    std::cerr << "Writer " << thread_num
    +                              << ": Got DeadLockException and out of "
    +                              << "retries. Giving up." << std::endl;
    +                    retry = false;
    +                 }
    +           } catch (DbException &e) {
    +                std::cerr << "db put failed" << std::endl;
    +                std::cerr << e.what() << std::endl;
    +                if (txn != NULL)
    +                    txn->abort();
    +                retry = false;
    +           } catch (std::exception &ee) {
    +            std::cerr << "Unknown exception: " << ee.what() << std::endl;
    +            return (0);
    +          }
    +        }
    +    }
    +    return (0);
    +} 
    +

    + Next we update + + countRecords(). + The only difference + here is that we no longer specify DB_READ_UNCOMMITTED when + we open our cursor. Note that even this minor change is not required. + If we do not configure our database to support uncommitted reads, + DB_READ_UNCOMMITTED on the cursor open will be silently + ignored. However, we remove the flag anyway from the cursor open so as to + avoid confusion. +

    +
    int
    +countRecords(Db *dbp, DbTxn *txn)
    +{
    +
    +    Dbc *cursorp = NULL;
    +    int count = 0;
    +
    +    try {
    +        // Get the cursor
    +        dbp->cursor(txn, &cursorp, 0);
    +
    +        Dbt key, value;
    +        while (cursorp->get(&key, &value, DB_NEXT) == 0) {
    +            count++;
    +        }
    +    } catch (DbDeadlockException &de) {
    +        std::cerr << "countRecords: got deadlock" << std::endl;
    +        cursorp->close();
    +        throw de;
    +    } catch (DbException &e) {
    +        std::cerr << "countRecords error:" << std::endl;
    +        std::cerr << e.what() << std::endl;
    +    }
    +
    +    if (cursorp != NULL) {
    +        try {
    +            cursorp->close();
    +        } catch (DbException &e) {
    +            std::cerr << "countRecords: cursor close failed:" << std::endl;
    +            std::cerr << e.what() << std::endl;
    +        }
    +    }
    +
    +    return (count);
    +} 
    +

    + Finally, we update + + openDb(). + This involves + removing DB_READ_UNCOMMITTED from the + open flags. + + +

    +
    // Open a Berkeley DB database
    +int
    +openDb(Db **dbpp, const char *progname, const char *fileName,
    +  DbEnv *envp, u_int32_t extraFlags)
    +{
    +    int ret;
    +    u_int32_t openFlags;
    +
    +    try {
    +        Db *dbp = new Db(envp, 0);
    +
    +        // Point to the new'd Db
    +        *dbpp = dbp;
    +
    +        if (extraFlags != 0)
    +            ret = dbp->set_flags(extraFlags);
    +
    +        // Now open the database
    +        openFlags = DB_CREATE   |      // Allow database creation
    +                    DB_THREAD        |        
    +                    DB_AUTO_COMMIT;    // Allow auto commit
    +
    +        dbp->open(NULL,       // Txn pointer
    +                  fileName,   // File name
    +                  NULL,       // Logical db name
    +                  DB_BTREE,   // Database type (using btree)
    +                  openFlags,  // Open flags
    +                  0);         // File mode. Using defaults
    +    } catch (DbException &e) {
    +        std::cerr << progname << ": openDb: db open failed:" << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    return (EXIT_SUCCESS);
    +} 
    +

    + This completes our in-memory transactional example. If you would like to + experiment with this code, you can find the example in the following + location in your DB distribution: +

    +
    DB_INSTALL/examples_cxx/txn_guide
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/introduction.html b/db/docs/gsg_txn/CXX/introduction.html new file mode 100644 index 000000000..9d03afe4e --- /dev/null +++ b/db/docs/gsg_txn/CXX/introduction.html @@ -0,0 +1,441 @@ + + + + + + Chapter 1. Introduction + + + + + + + + + +
    +
    +
    +
    +

    Chapter 1. Introduction

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Transaction Benefits + +
    +
    +
    +
    + + A Note on System Failure + +
    +
    + + Application Requirements + +
    +
    + + Multi-threaded + and Multi-process + Applications + +
    +
    +
    +
    + + Recoverability + +
    +
    + + Performance Tuning + +
    +
    +
    +

    + This book provides a thorough introduction and discussion on transactions as + used with Berkeley DB (DB). It begins by offering a general overview to + transactions, the guarantees they provide, and the general application + infrastructure required to obtain full transactional protection for your + data. +

    +

    + This book also provides detailed examples on how to write a + transactional application. Both single threaded and multi-threaded (as well as multi-process + applications) are discussed. A detailed description of various + backup and recovery strategies is included in this manual, as is a + discussion on performance considerations for your transactional application. +

    +

    + You should understand the concepts from the + + Getting Started with Berkeley DB + + + + guide before reading this book. +

    +
    +
    +
    +
    +

    Transaction Benefits

    +
    +
    +
    +
    +

    + Transactions offer your application's data protection from + application or system failures. That is, DB transactions offer + your application full ACID support: +

    +
    +
      +
    • +

      + Atomicity +

      +

      + Multiple database operations are treated as a single unit of + work. Once committed, all write operations performed under + the protection of the transaction are saved to your databases. + Further, in the event that you abort a transaction, all write + operations performed during the transaction are discarded. + In this event, your database is left in the state it was in + before the transaction began, regardless of the number or + type of write operations you may have performed during the + course of the transaction. +

      +

      + Note that DB transactions can span one or more + database handles. +

      +
    • +
    • +

      + Consistency +

      +

      + Your databases will never see a partially completed + transaction. This is true even if your application fails while there are + in-progress transactions. If the application or system fails, + then either all of the database changes appear when the + application next runs, or none of them appear. +

      +

      + In other words, whatever consistency requirements your application has will never be violated by DB. + If, for example, your application requires every record to include an employee ID, and your + code faithfully adds that ID to its database records, then DB will never + violate that consistency requirement. The ID will remain in the database records until such a time as your + application chooses to delete it. +

      +
    • +
    • +

      + Isolation +

      +

      + While a transaction is in progress, your databases will appear + to the transaction as if there are no other operations + occurring outside of the transaction. That is, operations + wrapped inside a transaction will always have a clean and + consistent view of your databases. They never have to see + updates currently in progress under the protection of another transaction. + Note, however, that isolation guarantees can be + + relaxed from the default setting. See + Isolation + for more information. +

      +
    • +
    • +

      + Durability +

      +

      + Once committed to your databases, your modifications will + persist even in the event of an application or system failure. + Note that like isolation, your durability guarantee can be + relaxed. See Non-Durable Transactions + for more information. +

      +
    • +
    +
    +
    +
    +
    +
    +

    A Note on System Failure

    +
    +
    +
    +
    +

    + From time to time this manual mentions that transactions protect your data against 'system or application + failure.' This is + true up to a certain extent. However, not all failures are created equal and no data protection + mechanism can protect you against every conceivable way a computing system can find to die. +

    +

    + Generally, when this book talks about protection against failures, it means that + transactions offer protection against + the likeliest culprits for system and application crashes. So long as your data modifications have been + committed to disk, those modifications should persist even if your application or OS subsequently fails. + And, even if the application or OS fails in the middle of a transaction commit (or abort), the data on disk + should be either in a consistent state, or there should be enough data available to bring + your databases into a consistent state (via a recovery procedure, for example). You may, however, + lose whatever data you were committing at the + time of the failure, but your databases will be otherwise unaffected. +

    +

    + Of course, if your disk fails, then the transactional benefits described in this book + are only as good as the backups you have taken. + + By spreading your data and log files across separate disks, + you can minimize the risk of data loss due to a disk failure, but even in this case it is possible to + conjure a scenario where even this protection is insufficient (a fire in the machine room, for example) and + you must go to your backups for protection. + +

    +

    + Finally, by following the programming examples shown in this book, you can write your code so as to protect + your data in the event that your code crashes. However, no programming API can protect you against logic + failures in your own code; transactions cannot protect you from simply writing the wrong thing to your + databases. +

    +
    +
    +
    +
    +
    +

    Application Requirements

    +
    +
    +
    +
    +

    + In order to use transactions, your application has certain + requirements beyond what is required of non-transactional protected + applications. They are: +

    +
    +
      +
    • +

      + Environments. +

      +

      + Environments are optional for non-transactional + applications, but they are required for transactional + applications. +

      +

      + Environment usage is described in detail in + Transaction Basics. +

      +
    • +
    • +

      + Transaction subsystem. +

      +

      + In order to use transactions, you must explicitly + enable the transactional subsystem for your + application, and this must be done at the time that + your environment is first created. +

      +
    • +
    • +

      + Logging subsystem. +

      +

      + The logging subsystem is required for recovery purposes, but + its usage also means your application may require a + little more administrative effort than it does when logging + is not in use. See Managing DB Files for more information. +

      +
    • +
    • +

      + + DbTxn + + + handles. +

      +

      + In order to obtain the atomicity guarantee offered by + the transactional subsystem (that is, combine multiple + operations in a single unit of work), your application must use + transaction handles. These handles are obtained from your + + DbEnv + + + objects. They should normally be short-lived, and their usage is + reasonably simple. To complete a transaction and save + the work it performed, you + call its commit() method. To + complete a transaction and discard its work, you call its + abort() method. +

      +

      + In addition, it is possible to use auto commit if you want + to transactional protect a single write operation. Auto + commit allows a transaction to be used without + obtaining an explicit transaction handle. See + Auto Commit + for information on how to use auto commit. +

      +
    • +
    • +

      + Database + + open requirements. +

      +

      + + In addition to using + environments and initializing the + correct subsystems, your + + application must transaction protect the database + + opens, + and any secondary index associations, + + if subsequent operations on the databases are to be transaction + protected. The database open and secondary index + association are commonly transaction protected using + auto commit. +

      +
    • +
    • +

      + Deadlock detection. +

      +

      + Typically transactional applications use multiple + threads of control when accessing the database. Any + time multiple threads are used on a single resource, + the potential for lock contention arises. In turn, lock + contention can lead to deadlocks. See + Locks, Blocks, and Deadlocks + for more information. +

      +

      + Therefore, transactional applications must frequently + include code for detecting and responding to deadlocks. + Note that this requirement is not + specific to transactions + – you can certainly write concurrent + non-transactional DB applications. Further, not + every transactional application uses concurrency and + so not every transactional application must + manage deadlocks. Still, deadlock management is so + frequently a characteristic of transactional + applications that we discuss it in this + book. See Concurrency + for more information. +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    Multi-threaded + and Multi-process + Applications

    +
    +
    +
    +
    +

    + DB is designed to support multi-threaded and + multi-process applications, but their usage means + you must pay careful attention to issues of concurrency. + Transactions help your application's concurrency by providing various levels of + isolation for your threads of control. In addition, DB + provides mechanisms that allow you to detect and respond to + deadlocks (but strictly speaking, this is not limited to just + transactional applications). +

    +

    + Isolation means that database modifications made by + one transaction will not normally be seen by readers from another + transaction until the first commits its changes. Different threads + use different transaction handles, so + this mechanism is normally used to provide isolation between + database operations performed by different threads. +

    +

    + Note that DB supports different isolation levels. For example, + you can configure your application to see uncommitted reads, which means + that one transaction can see data that has been modified but not yet + committed by another transaction. Doing this might mean your + transaction reads data "dirtied" by another transaction, + but which subsequently might change before that + other transaction commits its changes. + On the other hand, lowering your isolation + requirements means that your application can experience + improved throughput due to reduced lock contention. +

    +

    + For more information on concurrency, on managing isolation + levels, and on deadlock detection, see Concurrency. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/isolation.html b/db/docs/gsg_txn/CXX/isolation.html new file mode 100644 index 000000000..f8bc69fab --- /dev/null +++ b/db/docs/gsg_txn/CXX/isolation.html @@ -0,0 +1,821 @@ + + + + + + Isolation + + + + + + + + + +
    +
    +
    +
    +

    Isolation

    +
    +
    +
    +
    +

    + Isolation guarantees are an important aspect of transactional + protection. Transactions + ensure the data your transaction is working with will not be changed by some other transaction. + Moreover, the modifications made by a transaction will never be viewable outside of that transaction until + the changes have been committed. +

    +

    + That said, there are different degrees of isolation, and you can choose to relax your isolation + guarantees to one degree or another depending on your application's requirements. The primary reason why + you might want to do this is because of performance; the more isolation you ask your transactions to + provide, the more locking that your application must do. With more locking comes a greater chance of + blocking, which in turn causes your threads to pause while waiting for a lock. Therefore, by relaxing + your isolation guarantees, you can potentially improve your application's throughput. + Whether you actually see any improvement depends, of course, on + the nature of your application's data and transactions. +

    +
    +
    +
    +
    +

    Supported Degrees of Isolation

    +
    +
    +
    +
    +

    + DB supports the following levels of isolation: +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DegreeANSI TermDefinition
    1READ UNCOMMITTED + Uncommitted reads means that one transaction will never + overwrite another transaction's dirty data. Dirty data is + data that a transaction has modified but not yet committed + to the underlying data store. However, uncommitted reads allows a + transaction to see data dirtied by another + transaction. In addition, a transaction may read data + dirtied by another transaction, but which subsequently + is aborted by that other transaction. In this latter + case, the reading transaction may be reading data that + never really existed in the database. +
    2READ COMMITTED +

    + Committed read isolation means that degree 1 is observed, except that dirty data is never read. +

    +

    + In addition, this isolation level guarantees that data will never change so long as + it is addressed by the cursor, but the data may change before the reading cursor is closed. + In the case of a transaction, data at the current + cursor position will not change, but once the cursor + moves, the previous referenced data can change. This + means that readers release read locks before the cursor + is closed, and therefore, before the transaction + completes. Note that this level of isolation causes the + cursor to operate in exactly the same way as it does in + the absence of a transaction. +

    +
    3SERIALIZABLE +

    + Committed read is observed, plus the data read by a transaction, T, + will never be dirtied by another transaction before T completes. + This means that both read and write locks are not + released until the transaction completes. +

    +

    + + In addition, + + + + + no transactions will see phantoms. Phantoms are records + returned as a result of a search, but which were not seen by + the same transaction when the identical + search criteria was previously used. +

    +

    + This is DB's default isolation guarantee. +

    +
    +
    +

    + + By default, DB transactions and transactional cursors offer + + serializable isolation. + + + + You can optionally reduce your isolation level by configuring DB to use + uncommitted read isolation. See + Reading Uncommitted Data + for more information. + + You can also configure DB to use committed read isolation. See + Committed Reads + for more information. + +

    +

    + Finally, in addition to DB's normal degrees of isolation, you + can also use snapshot isolation. This allows + you to avoid the read locks that serializable isolation requires. See + Using Snapshot Isolation + for details. +

    +
    +
    +
    +
    +
    +

    Reading Uncommitted Data

    +
    +
    +
    +
    +

    + You can configure your application to read data that has been modified but not yet + committed by another transaction; that is, dirty data. When you do this, you + may see a performance benefit by allowing your + application to not have to block waiting for write locks. On the other hand, the data that your + application is reading may change before the transaction has completed. +

    +

    + When used with transactions, uncommitted reads means that one transaction can see data + modified but not yet committed by another transaction. When + used with transactional cursors, uncommitted reads means + that any database reader can see data modified by the + cursor before the cursor's transaction has committed. +

    +

    + Because of this, uncommitted reads allow a transaction to read data + that may subsequently be aborted by another transaction. In + this case, the reading transaction will have read data that + never really existed in the database. +

    +

    + To configure your application to read uncommitted data: +

    +
    +
      +
    1. +

      + Open your database such that it will allow uncommitted reads. You do this by + + specifying DB_READ_UNCOMMITTED when you open your database. + + +

      +
    2. +
    3. +

      + + Specify DB_READ_UNCOMMITTED + when you create the transaction, + + open the cursor, or read a record from the database. + + + + + +

      +
    4. +
    +
    +

    + For example, the following opens the database such that it supports uncommitted reads, and then creates a + transaction that causes all reads performed within it to use uncommitted reads. Remember that simply opening + the database to support uncommitted reads is not enough; you must also declare your read operations to be + performed using uncommitted reads. +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    u_int32_t db_flags = DB_CREATE |           // Create the db if it does
    +                                               // not exist
    +                         DB_AUTO_COMMIT |      // Enable auto commit
    +                         DB_READ_UNCOMMITTED;  // Enable uncommitted reads
    +
    +    Db *dbp = NULL;
    +    const char *file_name = "mydb.db";
    +    const char *keystr ="thekey";
    +    const char *datastr = "thedata";
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +        dbp = new Db(&myEnv, 0);
    +        dbp->open(NULL,       // Txn pointer 
    +                  file_name,  // File name 
    +                  NULL,       // Logical db name 
    +                  DB_BTREE,   // Database type (using btree) 
    +                  db_flags,   // Open flags 
    +                  0);         // File mode. Using defaults 
    +
    +        DbTxn *txn = NULL;
    +        myEnv.txn_begin(NULL, &txn, DB_READ_UNCOMMITTED);
    +
    +        // From here, you perform your database reads and writes as normal,
    +        // committing and aborting the transactions as is necessary, and
    +        // testing for deadlock exceptions as normal (omitted for brevity). 
    +        
    +        ...
    +
    +
    +
    +
    +
    +

    Committed Reads

    +
    +
    +
    +
    +

    + You can configure your transaction so that the data being + read by a transactional cursor is consistent so long as it + is being addressed by the cursor. However, once the cursor is done reading the + + + record (that is, reading records from the page that it currently has locked), + + the cursor releases its lock on that + + + record or page. + + This means that the data the cursor has read and released + may change before the cursor's transaction has completed. +

    +

    + For example, + suppose you have two transactions, Ta and Tb. Suppose further that + Ta has a cursor that reads record R, but does not modify it. Normally, + Tb would then be unable to write record R because + Ta would be holding a read lock on it. But when you configure your transaction for + committed reads, Tb can modify record + R before Ta completes, so long as the reading cursor is no longer + addressing the + + + record or page. + +

    +

    + When you configure your application for this level of isolation, you may see better performance + throughput because there are fewer read locks being held by your transactions. + Read committed isolation is most useful when you have a cursor that is reading and/or writing records in + a single direction, and that does not ever have to go back to re-read those same records. In this case, + you can allow DB to release read locks as it goes, rather than hold them for the life of the + transaction. +

    +

    + To configure your application to use committed reads, do one of the following: +

    +
    +
      +
    • +

      + Create your transaction such that it allows committed reads. You do this by + + specifying DB_READ_COMMITTED when you open the transaction. + + +

      +
    • +
    • +

      + + Specify DB_READ_COMMITTED + when you open the cursor. + + +

      +
    • +
    +
    +

    + For example, the following creates a transaction that allows committed reads: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    // Notice that we do not have to specify any flags to the database to
    +    // allow committed reads (this is as opposed to uncommitted reads 
    +    // where we DO have to specify a flag on the database open.
    +    u_int32_t db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    Db *dbp = NULL;
    +    const char *file_name = "mydb.db";
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +        dbp = new Db(&myEnv, 0);
    +        dbp->open(NULL,       // Txn pointer
    +                  file_name,  // File name
    +                  NULL,       // Logical db name
    +                  DB_BTREE,   // Database type (using btree)
    +                  db_flags,   // Open flags
    +                  0);         // File mode. Using defaults
    +
    +        DbTxn *txn = NULL;
    +
    +        // Open the transaction and enable committed reads. All cursors 
    +        // open with this transaction handle will use read committed 
    +        // isolation.
    +        myEnv.txn_begin(NULL, &txn, DB_READ_COMMITTED);
    +
    +        // From here, you perform your database reads and writes as normal,
    +        // committing and aborting the transactions as is necessary, 
    +        // testing for deadlock exceptions as normal (omitted for brevity). 
    +
    +        // Using transactional cursors with concurrent applications is 
    +        // described in more detail in the following section.
    +        
    +        ...
    +
    +
    +
    +
    +
    +

    Using Snapshot Isolation

    +
    +
    +
    +
    +

    + By default DB uses serializable isolation. An + important side effect of this isolation level is that + read operations obtain read locks on database pages, + and then hold those locks until the read operation is + completed. When you are using transactional cursors, this + means that read locks are held until the transaction commits or + aborts. In that case, over time a transactional cursor + can gradually block all other transactions from writing + to the database. +

    +

    + You can avoid this by using snapshot isolation. + Snapshot isolation uses multiversion + concurrency control to guarantee + repeatable reads. What this means is that every time a + writer would take a read lock on a page, instead a copy of + the page is made and the writer operations on that page + copy. This frees other writers from blocking due to a + read lock held on the page. +

    +
    +
    +
    +
    +

    Snapshot Isolation Cost

    +
    +
    +
    +
    +

    + Snapshot isolation does not come without a cost. + Because pages are being duplicated before being + operated upon, the cache will fill up faster. This + means that you might need a larger cache in order to + hold the entire working set in memory. +

    +

    + If the cache becomes full of page copies before old + copies can be discarded, additional I/O will occur as + pages are written to temporary "freezer" files on disk. + This can substantially reduce throughput, and should be + avoided if possible by configuring a large cache and + keeping snapshot isolation transactions short. +

    +

    + You can estimate how large your cache should be by + taking a checkpoint, followed by a call to the + + DbEnv::log_archive() + + method. The amount of cache required is approximately + double the size of the remaining log files (that is, + the log files that cannot be archived). +

    +
    +
    +
    +
    +
    +

    Snapshot Isolation Transactional Requirements

    +
    +
    +
    +
    +

    + In addition to an increased cache size, you may also + need to increase the maximum number of transactions + that your application supports. (See +

    + Most of the configuration activities that you need to perform + for your transactional DB application will involve the + locking and logging subsystems. See + Concurrency + and + Managing DB Files + for details. +

    + However, there are a couple of things that you can do to + configure your transaction subsystem directly. These things + are: +

    • + Configure the maximum number of simultaneous + transactions needed by your application. + In general, you should not need to do this unless you + use deeply nested transactions or you have many threads all + of which have active transactions. In addition, you may + need to a higher maximum number of transactions if you + are using snapshot isolation. See + Snapshot Isolation Transactional Requirements + for details. +

      + By default, your application can support 20 active + transactions. +

      + You can set the maximum number of simultaneous + transactions supported by your application using + + the + + DbEnv::set_tx_max() + method. Note that this method must be called + before the environment has been opened. + + +

      + If your application has exceeded this maximum value, + then any attempt to begin a new transaction will fail. +

      + This value can also be set using the + DB_CONFIG file's + set_tx_max parameter. Remember that + the DB_CONFIG must reside in your + environment home directory. +

    • +

      + + Configure the timeout value for your transactions. + + + + This value represents the longest period of time a + transaction can be active. Note, however, that + transaction timeouts are checked only when DB + examines its lock tables for blocked locks + (see Locks, Blocks, and Deadlocks + for more information). Therefore, a transaction's timeout can + have expired, but the application will not be notified until DB + has a reason to examine its lock tables. +

      +

      + Be aware that some transactions may be + inappropriately timed out before the transaction has a + chance to complete. You should therefore use this + mechanism only if you know your application + might have unacceptably long transactions and + you want to make sure your application will + not stall during their execution. + (This might happen if, for example, your + transaction blocks or requests too much + data.) +

      +

      + Note that by default transaction timeouts are set to 0 seconds, which means that they never time + out. +

      +

      + To set the maximum timeout value for your transactions, + use the + + DbEnv::set_timeout() + + method. This method configures the entire + environment; not just the handle used to set the + configuration. Further, this value may + be set at any time during the application's + lifetime. +

      +

      + This value can also be set using the + DB_CONFIG file's + set_txn_timeout parameter. +

      + +

    + For example: +

    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        // Configure a maximum transaction timeout of 1 second.
    +        myEnv.set_timeout(1000000, DB_SET_TXN_TIMEOUT);
    +        // Configure 40 maximum transactions.
    +        myEnv.set_tx_max(40);
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +
    +        // From here, you open your databases, proceed with your 
    +        // database operations, and respond to deadlocks as 
    +        // is normal (omitted for brevity).
    +
    +        
    +        ...
    + for details on how to set this.) + In the worst case scenario, you might need to configure your application for one + more transaction for every page in the cache. This is + because transactions are retained until the last page + they created is evicted from the cache. +

    +
    +
    +
    +
    +
    +

    When to Use Snapshot Isolation

    +
    +
    +
    +
    +

    + Snapshot isolation is best used when all or most + of the following conditions are true: +

    +
    +
      +
    • +

      + You can have a large cache relative to your working data set size. +

      +
    • +
    • +

      + You require repeatable reads. +

      +
    • +
    • +

      + You will be using transactions that routinely work on + the entire database, or more commonly, + there is data in your database that will be very + frequently written by more than one transaction. +

      +
    • +
    • +

      + Read/write contention is + limiting your application's + throughput, or the application + is all or mostly read-only and + contention for the lock manager + mutex is limiting throughput. +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    How to use Snapshot Isolation

    +
    +
    +
    +
    +

    + You use snapshot isolation by: +

    +
    +
      +
    • +

      + Opening the database with + multiversion support. You can + configure this either when you + open your environment or when + you open your database. + + Use the + DB_MULTIVERSION + flag to configure this support. + + + +

      +
    • +
    • +

      + Configure your cursor or + transaction to use snapshot + isolation. +

      +

      + To do this, + + + pass the + DB_TXN_SNAPSHOT flag + when you open the cursor or + create the transaction. If + configured for the transaction, + then this flag is not required + when the cursor is opened. + + + +

      +
    • +
    +
    +

    + The simplest way to take advantage of snapshot + isolation is for queries: keep update + transactions using full read/write locking and + use snapshot isolation on read-only transactions or + cursors. This should minimize blocking of + snapshot isolation transactions and will avoid + deadlock errors. +

    +

    + If the application has update transactions which + read many items and only update a small set (for + example, scanning until a desired record is + found, then modifying it), throughput may be + improved by running some updates at snapshot + isolation as well. But doing this means that + you must manage deadlock errors. + See + Resolving Deadlocks + for details. +

    +

    + The following code fragment turns + on snapshot isolation for a transaction: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_INIT_TXN   |  // Initialize transactions
    +                          DB_MULTIVERSION; // Support snapshot isolation.
    +
    +    // Note that no special flags are required here for snapshot isolation.
    +    // This is because it is already enabled at the environment level.
    +    u_int32_t db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    Db *dbp = NULL;
    +    const char *file_name = "mydb.db";
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +        dbp = new Db(&myEnv, 0);
    +        dbp->open(NULL,       // Txn pointer 
    +                  file_name,  // File name 
    +                  NULL,       // Logical db name 
    +                  DB_BTREE,   // Database type (using btree) 
    +                  db_flags,   // Open flags 
    +                  0);         // File mode. Using defaults
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database and environment: "
    +                  << file_name << ", "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +    }
    +
    +    ....
    +
    +    envp->txn_begin(NULL, txn, DB_TXN_SNAPSHOT);
    +
    +    // Remainder of program omitted for brevity.
    +
    + 
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/lockingsubsystem.html b/db/docs/gsg_txn/CXX/lockingsubsystem.html new file mode 100644 index 000000000..81631cb28 --- /dev/null +++ b/db/docs/gsg_txn/CXX/lockingsubsystem.html @@ -0,0 +1,502 @@ + + + + + + The Locking Subsystem + + + + + + + + + +
    +
    +
    +
    +

    The Locking Subsystem

    +
    +
    +
    +
    +

    + In order to allow concurrent operations, DB provides the locking + subsystem. This subsystem provides inter- and intra- process + concurrency mechanisms. It is extensively used by DB concurrent + applications, but it can also be generally used for non-DB + resources. +

    +

    + This section describes the locking subsystem as it is used to + protect DB resources. In particular, issues on configuration are + examined here. For information on using the locking subsystem to + manage non-DB resources, see the + Berkeley DB Programmer's Reference Guide. +

    +
    +
    +
    +
    +

    Configuring the Locking Subsystem

    +
    +
    +
    +
    +

    + You initialize the locking subsystem by specifying + + DB_INIT_LOCK to the + + DbEnv::open() + method. + + +

    +

    + Before opening your environment, you can configure various + maximum values for your locking subsystem. Note that these + limits can only be configured before the environment is + opened. Also, these methods configure the entire environment, + not just a specific environment handle. +

    +

    + Finally, each bullet below identifies the + DB_CONFIG file parameter that can be used + to specify the specific locking limit. If used, these + DB_CONFIG file parameters override any + value that you might specify using the environment handle. +

    +

    + The limits that you can configure are as follows: +

    +
    +
      +
    • +

      + The maximum number of lockers + supported by the environment. This value is used by + the environment when it is opened to estimate the amount + of space that it should allocate for various internal + data structures. By default, 1,000 lockers are + supported. +

      +

      + To configure this value, use the + + + DbEnv::set_lk_max_lockers() + method. + + +

      +

      + As an alternative to this method, you can configure this + value using the DB_CONFIG file's + set_lk_max_lockers parameter. +

      +
    • +
    • +

      + The maximum number of locks supported by the environment. + By default, 1,000 locks are supported. +

      +

      + To configure this value, use the + + + DbEnv::set_lk_max_locks() + method. + + +

      +

      + As an alternative to this method, you can configure this + value using the DB_CONFIG file's + set_lk_max_locks parameter. +

      +
    • +
    • +

      + The maximum number of locked objects supported by the environment. + By default, 1,000 objects can be locked. +

      +

      + To configure this value, use the + + + DbEnv::set_lk_max_objects() + method. + + +

      +

      + As an alternative to this method, you can configure this + value using the DB_CONFIG file's + set_lk_max_objects parameter. +

      +
    • +
    +
    +

    + For a definition of lockers, locks, and locked objects, see + Lock Resources. +

    +

    + For example, to configure the maximum number of locks that your + environment can use: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_THREAD     |  // Free-thread the env handle.
    +                          DB_INIT_TXN;     // Initialize transactions
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        // Configure max locks
    +        myEnv.set_lk_max_locks(envp, 5000);
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database environment: "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    try {
    +        myEnv.close(0);
    +    } catch(DbException &e) {
    +        std::cerr << "Error closing database environment: "
    +                << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    return (EXIT_SUCCESS);
    +} 
    +
    +
    +
    +
    +
    +

    Configuring Deadlock Detection

    +
    +
    +
    +
    +

    + In order for DB to know that a deadlock has occurred, + some mechanism must be used to perform deadlock + detection. There are three ways that deadlock detection can + occur: +

    +
    +
      +
    1. +

      + Allow DB to internally detect deadlocks as they + occur. +

      +

      + To do this, you use + + DbEnv::set_lk_detect(). + + This method causes DB to walk its internal lock table + looking for a deadlock whenever a lock request + is blocked. This method also identifies how DB decides which lock + requests are rejected when deadlocks are detected. For example, + DB can decide to reject the lock request for the transaction + that has the most number of locks, the least number of locks, + holds the oldest lock, holds the most number of write locks, and + so forth (see the API reference documentation for a complete + list of the lock detection policies). +

      +

      + You can call this method at any time during your application's + lifetime, but typically it is used before you open your environment. +

      +

      + Note that how you want DB to decide which thread of control should break a deadlock is + extremely dependent on the nature of your application. It is not unusual for some performance + testing to be required in order to make this determination. That said, a transaction that is + holding the maximum number of locks is usually indicative of the transaction that has performed + the most amount of work. Frequently you will not want a transaction that has performed a lot of + work to abandon its efforts and start all over again. It is not therefore uncommon for + application developers to initially select the transaction with the minimum + number of write locks to break the deadlock. +

      +

      + Using this mechanism for deadlock detection means + that your application will never have to wait on a + lock before discovering that a deadlock has + occurred. However, walking the lock table every + time a lock request is blocked can be expensive + from a performance perspective. +

      +
    2. +
    3. +

      + Use a dedicated thread or external process to perform + deadlock detection. Note that this thread must be + performing no other database operations beyond deadlock + detection. +

      +

      + To externally perform lock detection, you can use + either the + + DbEnv::lock_detect() + + method, or use the + db_deadlock command line + utility. This method (or command) causes DB to walk the + lock table looking for deadlocks. +

      +

      + Note that like + + DbEnv::set_lk_detect(), + + you also use this method (or command line utility) + to identify which lock requests are rejected in the + event that a deadlock is detected. +

      +

      + Applications that perform deadlock detection in + this way typically run deadlock detection between every few + seconds and a minute. This means that your + application may have to wait to be notified of a + deadlock, but you also save the overhead of walking + the lock table every time a lock request is blocked. +

      +
    4. +
    5. +

      + Lock timeouts. +

      +

      + You can configure your locking subsystem such that + it times out any lock that is not released within a + specified amount of time. To do this, use the + + DbEnv::set_timeout() + + method. + Note that lock timeouts are only checked when a + lock request is blocked or when deadlock + detection is otherwise performed. Therefore, a lock can have timed out and still be held for + some length of time until DB has a reason to examine its locking tables. +

      +

      + Be aware that extremely long-lived transactions, or + operations that hold locks for a long time, may be + inappropriately timed out before the transaction or + operation has a chance to complete. You should + therefore use this mechanism only if you know your + application will hold locks for very short periods + of time. +

      +
    6. +
    +
    +

    + For example, to configure your application such that DB + checks the lock table for deadlocks every time a lock + request is blocked: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        // Configure db to perform deadlock detection internally, and to
    +        // choose the transaction that has performed the least amount 
    +        // of writing to break the deadlock in the event that one 
    +        // is detected.
    +        myEnv.set_lk_detect(DB_LOCK_MINWRITE);
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +     
    +        // From here, you open your databases, proceed with your 
    +        // database operations, and respond to deadlocks as 
    +        // is normal (omitted for brevity).
    +
    +        
    +        ...
    +

    + Finally, the following command line call causes + deadlock detection to be run against the + environment contained in /export/dbenv. The + transaction with the youngest lock is chosen to break the + deadlock: +

    +
    > /usr/local/db_install/bin/db_deadlock -h /export/dbenv -a y
    +

    + For more information, see the + + db_deadlock reference documentation. + +

    +
    +
    +
    +
    +
    +

    Resolving Deadlocks

    +
    +
    +
    +
    +

    + When DB determines that a deadlock has occurred, it will + select a thread of control to resolve the deadlock and then + + + throws DbDeadlockException in that + thread. + + + + If a deadlock is detected, the thread must: +

    +
    +
      +
    1. +

      + Cease all read and write operations. +

      +
    2. +
    3. +

      + Close all open cursors. +

      +
    4. +
    5. +

      + Abort the transaction. +

      +
    6. +
    7. +

      + Optionally retry the operation. If your application + retries deadlocked operations, the new attempt must + be made using a new transaction. +

      +
    8. +
    +
    +
    +

    Note

    +

    + If a thread has deadlocked, it may not make any + additional database calls using the handle that has + deadlocked. +

    +
    +

    + For example: +

    +
    // retry_count is a counter used to identify how many times
    +// we've retried this operation. To avoid the potential for 
    +// endless looping, we won't retry more than MAX_DEADLOCK_RETRIES 
    +// times.
    +
    +// txn is a transaction handle.
    +// key and data are DBT handles. Their usage is not shown here.
    +while (retry_count < MAX_DEADLOCK_RETRIES) {
    +    try {
    +        envp->txn_begin(NULL, txn, 0);
    +        dbp->put(txn, &key, &data, 0);
    +        txn->commit(0);
    +        return (EXIT_SUCCESS);
    +    } catch (DbDeadlockException &de) {
    +        try {
    +            // Abort the transaction and increment the 
    +            // retry counter
    +            txn->abort();
    +            retry_count++;
    +            // If we've retried too many times, log it and exit
    +            if (retry_count >= MAX_DEADLOCK_RETRIES) {
    +                    envp->errx("Exceeded retry limit. Giving up.");
    +                    return (EXIT_FAILURE);
    +            }
    +        } catch (DbException &ae) {
    +            envp->err(ae.get_errno(), "txn abort failed.");
    +            return (EXIT_FAILURE);    
    +        }
    +    } catch (DbException &e) {
    +        try {
    +            // For a generic error, log it and abort.
    +            envp->err(e.get_errno(), "Error putting data.");
    +            txn->abort();
    +        } catch (DbException &ae) {
    +            envp->err(ae.get_errno(), "txn abort failed.");
    +            return (EXIT_FAILURE);    
    +        }
    +    }
    +} 
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/logconfig.html b/db/docs/gsg_txn/CXX/logconfig.html new file mode 100644 index 000000000..ec3268ae7 --- /dev/null +++ b/db/docs/gsg_txn/CXX/logconfig.html @@ -0,0 +1,397 @@ + + + + + + Configuring the Logging Subsystem + + + + + + + + + +
    +
    +
    +
    +

    Configuring the Logging Subsystem

    +
    +
    +
    +
    +

    + You can configure the following aspects of the logging + subsystem: +

    +
    + +
    +
    +
    +
    +
    +

    Setting the Log File Size

    +
    +
    +
    +
    +

    + Whenever a pre-defined amount of data is written to a + log file (10 MB by default), DB stops using the + current log file and starts writing to a new file. + You can change the maximum amount of data contained in each + log file by using the + + + DbEnv::set_lg_max() + method. + + + Note that this method can be used at any time + during an application's lifetime. +

    +

    + Setting the log file size to something larger than its + default value is largely a matter of + convenience and a reflection of the application's + preference in backup media and frequency. However, if + you set the log file size too low relative to your + application's traffic patterns, you can cause + yourself trouble. +

    +

    + From a performance perspective, setting the log file + size to a low value can cause your active transactions to + pause their writing activities more frequently than would + occur with larger log file sizes. Whenever a + transaction completes the log buffer is flushed to + disk. Normally other transactions can continue to + write to the log buffer while this flush is in + progress. However, when one log file is being closed + and another created, all transactions must cease + writing to the log buffer until the switch over is + completed. +

    +

    + Beyond performance concerns, using smaller log files + can cause you to use more physical files on disk. + As a result, your application could run out + of log sequence numbers, depending on how busy your + application is. +

    +

    + Every log file is identified with a 10 digit number. + Moreover, the maximum number of log files that your application + is allowed to create in its lifetime is 2,000,000,000. +

    +

    + For example, if your application performs 6,000 transactions per + second for 24 hours a day, and you are logging 500 bytes of + data per transaction into 10 MB log files, then you + will run out of log files in around 221 years: +

    +
         (10 * 2^20 * 2000000000) / (6000 * 500 * 365 * 60 *60 * 24) = 221 
    +

    + However, if you were writing 2000 bytes of data per + transaction, and using 1 MB log files, then the same + formula shows you running out of log files in 5 years time. +

    +

    + All of these time frames are quite long, to be sure, + but if you do run out of log files after, say, 5 years + of continuous operations, then you must reset your log + sequence numbers. To do so: +

    +
    +
      +
    1. +

      + Backup your databases as if to prepare for + catastrophic failure. See + Backup Procedures + for more information. +

      +
    2. +
    3. +

      + Reset the log file's sequence number using the + db_load utility's + -r option. +

      +
    4. +
    5. +

      + Remove all of the log files from your + environment. Note that this is the only + situation in which all of the log files are + removed from an environment; in all other + cases, at least a single log file is retained. +

      +
    6. +
    7. +

      + Restart your application. +

      +
    8. +
    +
    +
    +
    +
    +
    +
    +

    Configuring the Logging Region Size

    +
    +
    +
    +
    +

    + The logging subsystem's default region size is 60 KB. The + logging region is used to store filenames, and so you may + need to increase its size if a large number of files (that + is, if you have a very large number of databases) will + be opened and registered with DB's log manager. +

    +

    + You can set the size of your logging region by using the + + + DbEnv::set_lg_region() + + + method. Note that this method can only be called before the + first environment handle for your application is opened. +

    +
    +
    +
    +
    +
    +

    Configuring In-Memory Logging

    +
    +
    +
    +
    +

    + It is possible to configure your logging subsystem such + that logs are maintained entirely in memory. When + you do this, you give up your transactional durability + guarantee. Without log files, you have no way to run + recovery so any system or software failures that you might + experience can corrupt your databases. +

    +

    + However, by giving up your durability guarantees, you can + greatly improve your application's throughput by avoiding + the disk I/O necessary to write logging information to + disk. In this case, you still retain your transactional + atomicity, consistency, and isolation guarantees. +

    +

    + To configure your logging subsystem to maintain your logs + entirely in-memory: +

    +
    +
      +
    • +

      + Make sure your log buffer is capable of holding all + log information that can accumulate during the longest + running transaction. See Setting the In-Memory Log Buffer Size for details. +

      +
    • +
    • +

      + Do not run normal recovery when you open your environment. In this configuration, there are no + log files available against which you can run recovery. As a result, if you specify recovery + when you open your environment, it is ignored. +

      +
    • +
    • +

      + Specify + + DB_LOG_INMEMORY to the + + DbEnv::set_flags() + + + method. Note that you must specify this before + your application opens its first environment + handle. +

      +
    • +
    +
    +

    + For example: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    // Set the normal flags for a transactional subsystem. Note that
    +    // we DO NOT specify DB_RECOVER.
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        // Indicate that logging is to be performed only in memory. 
    +        // Doing this means that we give up our transactional durability
    +        // guarantee.
    +        myEnv.set_flags(DB_LOG_INMEMORY, 1);
    +
    +        // Configure the size of our log memory buffer. This must be
    +        // large enough to hold all the logging information likely
    +        // to be created for our longest running transaction. The
    +        // default size for the logging buffer is 1 MB when logging
    +        // is performed in-memory. For this example, we arbitrarily
    +        // set the logging buffer to 5 MB.
    +        myEnv.set_lg_bsize(5 * 1024 * 1024);
    +
    +        // Open the environment as normal.
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database and environment: "
    +                  << file_name << ", "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +    }
    +
    +    // From here, you open databases, create transactions and 
    +    // perform database operations exactly as you would if you 
    +    // were logging to disk. This part is omitted for brevity.  
    +
    +
    +
    +
    +
    +

    Setting the In-Memory Log Buffer Size

    +
    +
    +
    +
    +

    + When your application is configured for on-disk logging + (the default behavior for transactional applications), log + information is stored in-memory until the storage space + fills up, or a transaction commit forces the log + information to be flushed to disk. +

    +

    + It is possible to increase the amount of memory available + to your file log buffer. Doing so improves throughput for + long-running transactions, or for transactions that produce + a large amount of data. +

    +

    + When you have your logging subsystem configured to maintain + your log entirely in memory (see + Configuring In-Memory Logging), it is very important + to configure your log buffer size because the log buffer + must be capable of holding all log information that can + accumulate during the longest running transaction. + You must make sure that the in-memory log buffer size is + large enough that no transaction will ever span the entire + buffer. You must also avoid a state where the in-memory + buffer is full and no space can be freed because a + transaction that started the first log "file" is still + active. +

    +

    + When your logging subsystem is configured for on-disk + logging, the default log buffer space is 32 KB. When + in-memory logging is configured, the default log buffer + space is 1 MB. +

    +

    + You can increase your log buffer space using the + + + DbEnv::set_lg_bsize() + + + method. Note that this method can only be called before the + first environment handle for your application is opened. +

    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/logfileremoval.html b/db/docs/gsg_txn/CXX/logfileremoval.html new file mode 100644 index 000000000..dae151e87 --- /dev/null +++ b/db/docs/gsg_txn/CXX/logfileremoval.html @@ -0,0 +1,206 @@ + + + + + + Removing Log Files + + + + + + + + + +
    +
    +
    +
    +

    Removing Log Files

    +
    +
    +
    +
    +

    + By default DB does not delete log files for you. For this reason, + DB's log files will eventually grow to consume an + unnecessarily large amount of disk space. To guard against + this, you should periodically take administrative action to + remove log files that are no longer in use by your application. +

    +

    + You can remove a log file if all of the following are true: +

    +
    +
      +
    • +

      + the log file is not involved in an active transaction. +

      +
    • +
    • +

      + a checkpoint has been performed + after the log file was + created. +

      +
    • +
    • +

      + the log file is not the only log file in the + environment. +

      +
    • +
    • +

      + the log file that you want to remove has already been + included in an offline or hot backup. + Failure to observe this last condition can cause your + backups to be unusable. +

      +
    • +
    +
    +

    + DB provides several mechanisms to remove log files that + meet all but the last criteria (DB has no way to know which + log files have already been included in a backup). The + following mechanisms make it easy to remove unneeded log files, + but can result in an unusable backup if the log files are not first + saved to your archive location. All of the following + mechanisms automatically delete unneeded log files for you: +

    +
    +
      +
    • +

      + Run the db_archive command line + utility with the -d option. +

      +
    • +
    • +

      + From within your application, call the + + + DbEnv::log_archive() + method with the DB_ARCH_REMOVE flag. + + +

      +
    • +
    • +

      + + Call + + DbEnv::set_flags() + method with the DB_LOG_AUTOREMOVE flag. + Note that this flag can be set at any point in + the lifetime of your application. Setting this + parameter affects all environment handles + opened against the environment; not just the + handle used to set the flag. + + +

      +

      + Note that unlike the other log removal mechanisms + identified here, this method actually causes log files + to be removed on an on-going basis as they become + unnecessary. This is extremely desirable behavior if + what you want is to use the absolute minimum amount of + disk space possible for your application. This + mechanism will leave you with + the log files that are required to run normal recovery. + However, it is highly likely that this mechanism will + prevent you from running catastrophic recovery. +

      +

      + Do NOT use this mechanism if you want to be able to + perform catastrophic recovery, or if you want to be + able to maintain a hot backup. +

      +
    • +
    +
    +

    + In order to safely remove log files and still be able to + perform catastrophic recovery, use the + db_archive command line utility as follows: +

    +
    +
      +
    1. +

      + Run either a normal or hot backup as described in + Backup Procedures. Make + sure that all of this data is safely stored to your + backup media before continuing. +

      +
    2. +
    3. +

      + If you have not already done so, perform a checkpoint. + See Checkpoints + for more information. +

      +
    4. +
    5. +

      + If you are maintaining a hot backup, perform the hot + backup procedure as described in + Using Hot Failovers. +

      +
    6. +
    7. +

      + Run the db_archive command line + utility with the -d option against + your production environment. +

      +
    8. +
    9. +

      + Run the db_archive command line + utility with the -d option against + your failover environment, if you are maintaining one. +

      +
    10. +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/maxtxns.html b/db/docs/gsg_txn/CXX/maxtxns.html new file mode 100644 index 000000000..1a815c290 --- /dev/null +++ b/db/docs/gsg_txn/CXX/maxtxns.html @@ -0,0 +1,203 @@ + + + + + + Configuring the Transaction Subsystem + + + + + + + + + +
    +
    +
    +
    +

    Configuring the Transaction Subsystem

    +
    +
    +
    +
    +

    + Most of the configuration activities that you need to perform + for your transactional DB application will involve the + locking and logging subsystems. See + Concurrency + and + Managing DB Files + for details. +

    +

    + However, there are a couple of things that you can do to + configure your transaction subsystem directly. These things + are: +

    +
    +
      +
    • +

      + Configure the maximum number of simultaneous + transactions needed by your application. + In general, you should not need to do this unless you + use deeply nested transactions or you have many threads all + of which have active transactions. In addition, you may + need to a higher maximum number of transactions if you + are using snapshot isolation. See + Snapshot Isolation Transactional Requirements + for details. +

      +

      + By default, your application can support 20 active + transactions. +

      +

      + You can set the maximum number of simultaneous + transactions supported by your application using + + the + + DbEnv::set_tx_max() + method. Note that this method must be called + before the environment has been opened. + + +

      +

      + If your application has exceeded this maximum value, + then any attempt to begin a new transaction will fail. +

      +

      + This value can also be set using the + DB_CONFIG file's + set_tx_max parameter. Remember that + the DB_CONFIG must reside in your + environment home directory. +

      +
    • +
    • + +

      + + Configure the timeout value for your transactions. + + + + This value represents the longest period of time a + transaction can be active. Note, however, that + transaction timeouts are checked only when DB + examines its lock tables for blocked locks + (see Locks, Blocks, and Deadlocks + for more information). Therefore, a transaction's timeout can + have expired, but the application will not be notified until DB + has a reason to examine its lock tables. +

      +

      + Be aware that some transactions may be + inappropriately timed out before the transaction has a + chance to complete. You should therefore use this + mechanism only if you know your application + might have unacceptably long transactions and + you want to make sure your application will + not stall during their execution. + (This might happen if, for example, your + transaction blocks or requests too much + data.) +

      +

      + Note that by default transaction timeouts are set to 0 seconds, which means that they never time + out. +

      +

      + To set the maximum timeout value for your transactions, + use the + + DbEnv::set_timeout() + + method. This method configures the entire + environment; not just the handle used to set the + configuration. Further, this value may + be set at any time during the application's + lifetime. +

      +

      + This value can also be set using the + DB_CONFIG file's + set_txn_timeout parameter. +

      + +
      +
    • +
    +
    +

    + For example: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        // Configure a maximum transaction timeout of 1 second.
    +        myEnv.set_timeout(1000000, DB_SET_TXN_TIMEOUT);
    +        // Configure 40 maximum transactions.
    +        myEnv.set_tx_max(40);
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +
    +        // From here, you open your databases, proceed with your 
    +        // database operations, and respond to deadlocks as 
    +        // is normal (omitted for brevity).
    +
    +        
    +        ...
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/nestedtxn.html b/db/docs/gsg_txn/CXX/nestedtxn.html new file mode 100644 index 000000000..f15aafb9c --- /dev/null +++ b/db/docs/gsg_txn/CXX/nestedtxn.html @@ -0,0 +1,140 @@ + + + + + + Nested Transactions + + + + + + + + + +
    +
    +
    +
    +

    Nested Transactions

    +
    +
    +
    +
    +

    + A nested transaction is used to provide a + transactional guarantee for a subset of operations performed within + the scope of a larger transaction. Doing this allows you to commit + and abort the subset of operations independently of the larger + transaction. +

    +

    + The rules to the usage of a nested transaction are as follows: +

    +
    +
      +
    • +

      + While the nested (child) transaction is active, the parent + transaction may not perform any operations other than to commit + or abort, or to create more child transactions. +

      +
    • +
    • +

      + Committing a nested transaction has no effect on the state + of the parent transaction. The parent transaction is still + uncommitted. However, the parent transaction can now + see any modifications made by the child transaction. + Those modifications, of course, are still hidden to all + other transactions until the parent also commits. +

      +
    • +
    • +

      + Likewise, aborting the nested transaction has no effect on + the state of the parent transaction. The only result of the + abort is that neither the parent nor any + other transactions will see any of the + database modifications performed under the protection of the + nested transaction. +

      +
    • +
    • +

      + If the parent transaction commits or aborts while it has + active children, the child transactions are resolved in the + same way as the parent. That is, if the parent aborts, then + the child transactions abort as well. If the parent commits, + then whatever modifications have been performed by the child + transactions are also committed. +

      +
    • +
    • +

      + The locks held by a nested transaction are not released when + that transaction commits. Rather, they are now held by the + parent transaction until such a time as that parent commits. +

      +
    • +
    • +

      + Any database modifications performed by the nested transaction + are not visible outside of the larger encompassing + transaction until such a time as that parent transaction is + committed. +

      +
    • +
    • +

      + The depth of the nesting that you can achieve with nested + transaction is limited only by memory. +

      +
    • +
    +
    +

    + To create a nested transaction, simply pass the parent transaction's + handle when you created the nested transaction's handle. For + example: +

    +
        // parent transaction
    +    DbTxn *parentTxn, *childTxn;
    +    ret = myEnv.txn_begin(NULL, &parentTxn, 0);
    +    // child transaction
    +    ret = myEnv.txn_begin(parent_txn, &childTxn, 0); 
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/perftune-intro.html b/db/docs/gsg_txn/CXX/perftune-intro.html new file mode 100644 index 000000000..e9dff26fc --- /dev/null +++ b/db/docs/gsg_txn/CXX/perftune-intro.html @@ -0,0 +1,88 @@ + + + + + + Performance Tuning + + + + + + + + + +
    +
    +
    +
    +

    Performance Tuning

    +
    +
    +
    +
    +

    + From a performance perspective, the use of transactions is not free. + Depending on how you configure them, transaction commits + usually require your application to perform disk I/O that a non-transactional + application does not perform. Also, for multi-threaded + and + multi-process applications, the use of transactions can + result in increased lock contention due to extra locking + requirements driven by transactional isolation guarantees. +

    +

    + There is therefore a performance tuning component to transactional applications + that is not applicable for non-transactional applications (although + some tuning considerations do exist whether or not your application uses + transactions). Where appropriate, these tuning considerations are + introduced in the following chapters. + + + However, for a more complete description of them, see the + + Transaction tuning + + and + + Transaction throughput + + sections of the Berkeley DB Programmer's Reference Guide. + + +

    +
    + + + diff --git a/db/docs/gsg_txn/CXX/preface.html b/db/docs/gsg_txn/CXX/preface.html new file mode 100644 index 000000000..37929aed5 --- /dev/null +++ b/db/docs/gsg_txn/CXX/preface.html @@ -0,0 +1,221 @@ + + + + + + Preface + + + + + + + + + +
    +
    +
    +
    +

    Preface

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +

    + This document describes how to use transactions with your Berkeley DB + applications. It is intended to describe how to + transaction protect your application's data. The APIs used to perform this task + are described here, as are the environment infrastructure and administrative tasks + required by a transactional application. This book also + describes multi-threaded and + multi-process DB applications and the requirements they + have for deadlock detection. +

    +

    + This book is aimed at the software engineer responsible for writing a + transactional DB application. +

    +

    + This book assumes that you have already read and understood the + concepts contained in the + Getting Started with Berkeley DB + guide. + + +

    +
    +
    +
    +
    +

    Conventions Used in this Book

    +
    +
    +
    +
    +

    + The following typographical conventions are used within in this manual: +

    +

    + Class names are represented in monospaced font, as are method + names. For example: + + + + + + "DbEnv::open() is a + DbEnv class method." +

    +

    + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALL directory." +

    +

    + Program examples are displayed in a monospaced font on a shaded background. + For example: +

    +
    typedef struct vendor {
    +    char name[MAXFIELD];             // Vendor name
    +    char street[MAXFIELD];           // Street name and number
    +    char city[MAXFIELD];             // City
    +    char state[3];                   // Two-digit US state code
    +    char zipcode[6];                 // US zipcode
    +    char phone_number[13];           // Vendor phone number
    +} VENDOR; 
    +

    + In some situations, programming examples are updated from one chapter to the next. When + this occurs, the new code is presented in monospaced bold font. For example: +

    +
    typedef struct vendor {
    +    char name[MAXFIELD];             // Vendor name
    +    char street[MAXFIELD];           // Street name and number
    +    char city[MAXFIELD];             // City
    +    char state[3];                   // Two-digit US state code
    +    char zipcode[6];                 // US zipcode
    +    char phone_number[13];           // Vendor phone number
    +    char sales_rep[MAXFIELD];        // Name of sales representative
    +    char sales_rep_phone[MAXFIELD];  // Sales rep's phone number 
    +} VENDOR; 
    +
    +

    Note

    +

    + Finally, notes of special interest are represented using a note block such + as this. +

    +
    +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + transactional DB application: +

    + +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/readblock.jpg b/db/docs/gsg_txn/CXX/readblock.jpg new file mode 100644 index 000000000..16a511feb Binary files /dev/null and b/db/docs/gsg_txn/CXX/readblock.jpg differ diff --git a/db/docs/gsg_txn/CXX/readmodifywrite.html b/db/docs/gsg_txn/CXX/readmodifywrite.html new file mode 100644 index 000000000..62375dc3a --- /dev/null +++ b/db/docs/gsg_txn/CXX/readmodifywrite.html @@ -0,0 +1,124 @@ + + + + + + Read/Modify/Write + + + + + + + + + +
    +
    +
    +
    +

    Read/Modify/Write

    +
    +
    +
    +
    +

    + If you are retrieving + a record from the database + + for the purpose of modifying or deleting it, you should declare + a read-modify-write cycle at the time that you read the + record. + + Doing so causes DB to obtain write locks (instead of a read + locks) at the time of the read. This helps to prevent deadlocks by + preventing another transaction from acquiring a read lock on the same + record while the read-modify-write cycle is in progress. +

    +

    + Note that declaring a read-modify-write cycle may actually increase the amount of blocking that your + application sees, because readers immediately obtain write locks and write locks cannot be shared. For this + reason, you should use read-modify-write cycles only if you are seeing a large amount of deadlocking + occurring in your application. +

    +

    + In order to declare a read/modify/write cycle when you perform a + read operation, + + + pass the DB_RMW flag + + to the database or cursor get method. + + + + + + + + +

    +

    + For example: +

    +
    // Begin the deadlock retry loop as is normal.
    +while (retry_count < MAX_DEADLOCK_RETRIES) {
    +    try {
    +        envp->txn_begin(NULL, txn, 0);
    +
    +        ...
    +        // key and data are DBTs. Their usage is omitted for brevity.
    +        ...
    +
    +        // Read the data. Declare the read/modify/write cycle here
    +        dbp->get(txn, &key, &data, DB_RMW);
    +
    +        ...
    +        // Modify the data as is required. (not shown here)
    +        ...
    +
    +        // Put the data. Note that you do not have to provide any 
    +        // additional flags here due to the read/modify/write 
    +        // cycle. Simply put the data and perform your deadlock 
    +        // detection as normal.
    +        dbp->put(txn, &key, &data, 0);
    +        txn->commit(0);
    +        return (EXIT_SUCCESS);
    +    } catch (DbDeadlockException &de) {
    +        // Deadlock detection and exception handling omitted
    +        // for brevity
    +        ...
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/recovery-intro.html b/db/docs/gsg_txn/CXX/recovery-intro.html new file mode 100644 index 000000000..ee490b9ba --- /dev/null +++ b/db/docs/gsg_txn/CXX/recovery-intro.html @@ -0,0 +1,104 @@ + + + + + + Recoverability + + + + + + + + + +
    +
    +
    +
    +

    Recoverability

    +
    +
    +
    +
    +

    + An important part of DB's transactional guarantees is durability. + Durability means that once a + transaction has been committed, the database modifications performed + under its protection will not be lost due to system failure. +

    +

    + In order to provide the transactional durability guarantee, + DB uses a write-ahead logging system. Every operation performed on + your databases is described in a log before it is performed on + your databases. This is done in order to ensure that an operation can be + recovered in the event of an untimely application + or system failure. +

    +

    + + Beyond logging, another important aspect of durability is + recoverability. That is, backup and restore. + + DB supports a normal recovery that runs against a subset of + your log files. This is a routine procedure used whenever your + environment is first opened upon application startup, and it is intended to + ensure that your database is in a consistent state. DB also + supports archival backup and recovery in the case of + catastrophic failure, such as the loss of a physical disk + drive. +

    +

    + This book describes several different backup procedures + you can use to protect your on-disk data. These procedures + range from simple offline backup strategies to hot failovers. Hot failovers + provide not only a backup mechanism, but + also a way to recover from a fatal hardware failure. +

    +

    + This book also describes the recovery procedures you should use + for each of the backup strategies that you might employ. +

    +

    + For a detailed description of backup and restore procedures, see + + Managing DB Files. + + + +

    +
    + + + diff --git a/db/docs/gsg_txn/CXX/recovery.html b/db/docs/gsg_txn/CXX/recovery.html new file mode 100644 index 000000000..546326ad7 --- /dev/null +++ b/db/docs/gsg_txn/CXX/recovery.html @@ -0,0 +1,288 @@ + + + + + + Recovery Procedures + + + + + + + + + +
    +
    +
    +
    +

    Recovery Procedures

    +
    +
    +
    +
    +

    + DB supports two types of recovery: +

    +
    +
      +
    • +

      + Normal recovery, which is run when your environment is + opened upon application startup, examines only those + log records needed to bring the databases to a consistent + state since the last checkpoint. Normal recovery + starts with any logs used by any transactions active at + the time of the last checkpoint, and examines all logs + from then to the current logs. +

      +
    • +
    • +

      + Catastrophic recovery, which is performed in the same + way that normal recovery is except that it examines + all available log files. You use catastrophic recovery + to restore your databases from a previously created backup. +

      +
    • +
    +
    +

    + Of these two, normal recovery should be considered a routine + matter; in fact you should run normal + recovery whenever you start up your application. +

    +

    + Catastrophic recovery is run whenever you have lost or + corrupted your database files and you want to restore from a + backup. You also run catastrophic recovery when + you create a hot backup + (see Using Hot Failovers for more information). +

    +
    +
    +
    +
    +

    Normal Recovery

    +
    +
    +
    +
    +

    + Normal recovery examines the contents of your environment's + log files, and uses this information to ensure that your + database files are consistent relative to the + information contained in the log files. +

    +

    + Normal recovery also recreates your environment's region files. + This has the desired effect of clearing any unreleased locks + that your application may have held at the time of an + unclean application shutdown. +

    +

    + Normal recovery is run only against those log files created + since the time of your last checkpoint. For this reason, + your recovery time is dependent on how much data has been + written since the last checkpoint, and therefore on how + much log file information there is to examine. If you run + checkpoints infrequently, then normal recovery can + take a relatively long time. +

    +
    +

    Note

    +

    + You should run normal recovery every + time you perform application startup. +

    +
    +

    + To run normal recovery: +

    +
    +
      +
    • +

      + Make sure all your environment handles are closed. +

      +
    • +
    • +

      + Normal recovery must + be single-threaded. +

      +
    • +
    • +

      + Provide the DB_RECOVER flag when + you open your environment. +

      +
    • +
    +
    +

    + You can also run recovery by pausing or shutting down your + application and using the db_recover + command line utility. +

    +

    + For example: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +void *checkpoint_thread(void *);
    +
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_INIT_TXN   |  // Initialize transactions
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_RECOVER;      // Run normal recovery
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +
    +        ...
    +
    +        // All other operations are identical from here. Notice, however,
    +        // that we have not created any other threads of control before
    +        // recovery is complete. You want to run recovery for
    +        // the first thread in your application that opens an environment,
    +        // but not for any subsequent threads.  
    +
    +
    +
    +
    +
    +

    Catastrophic Recovery

    +
    +
    +
    +
    +

    + Use catastrophic recovery when you are + recovering your databases from a previously created backup. + Note that to restore your databases from a previous backup, you + should copy the backup to a new environment directory, and + then run catastrophic recovery. Failure to do so can lead to + the internal database structures being out of sync with your log files. +

    +

    + Catastrophic recovery must be run single-threaded. +

    +

    + To run catastrophic recovery: +

    +
    +
      +
    • +

      + Shutdown all database operations. +

      +
    • +
    • +

      + Restore the backup to an empty directory. +

      +
    • +
    • +

      + Provide the DB_RECOVER_FATAL flag when + you open your environment. This environment open + must be single-threaded. +

      +
    • +
    +
    +

    + You can also run recovery by pausing or shutting down your + application and using the db_recover + command line utility with the the -c option. +

    +

    + Note that catastrophic recovery examines every available + log file — not just those log files created since the + last checkpoint as is the case for normal recovery. For this reason, + catastrophic recovery is likely to take longer than does + normal recovery. +

    +

    + For example: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +void *checkpoint_thread(void *);
    +
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_INIT_TXN   |  // Initialize transactions
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_RECOVER_FATAL;   // Run catastrophic recovery
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +
    +        ...
    +
    +        // All other operations are identical from here. Notice, however,
    +        // that we have not created any other threads of control before
    +        // recovery is complete. You want to run recovery for
    +        // the first thread in your application that opens an environment,
    +        // but not for any subsequent threads.  
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/reversesplit.html b/db/docs/gsg_txn/CXX/reversesplit.html new file mode 100644 index 000000000..9c06afcec --- /dev/null +++ b/db/docs/gsg_txn/CXX/reversesplit.html @@ -0,0 +1,158 @@ + + + + + + Reverse BTree Splits + + + + + + + + + +
    +
    +
    +
    +

    Reverse BTree Splits

    +
    +
    +
    +
    +

    + If your application is using the Btree access method, and your + application is repeatedly deleting then adding records to your + database, then you might be able to reduce lock contention by + turning off reverse Btree splits. +

    +

    + As pages are emptied in a database, DB attempts to + delete empty pages in order to keep + the database as small as possible and minimize search time. + Moreover, when a page in the database fills + up, DB, of course, adds additional pages + to make room for more data. +

    +

    + Adding and deleting pages in the database requires that the + writing thread lock the parent page. Consequently, as the + number of pages in your database diminishes, your application + will see increasingly more lock contention; the maximum level + of concurrency in a database of two pages is far smaller than + that in a database of 100 pages, because there are fewer pages + that can be locked. +

    +

    + Therefore, if you prevent the database from being reduced to a + minimum number of pages, you can improve your application's + concurrency throughput. Note, however, that you should do so + only if your application tends to delete and then add the same + data. If this is not the case, then preventing reverse Btree + splits can harm your database search time. +

    +

    + To turn off reverse Btree splits, + + provide the + DB_REVSPLITOFF flag to the + + Db::set_flags() + method. + + +

    +

    + For example: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize locking
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_THREAD     |  // Free-thread the env handle
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    u_int32_t db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    Db *dbp = NULL;
    +    const char *file_name = "mydb.db";
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +        dbp = new Db(&myEnv, 0);
    +
    +        // Turn off BTree reverse split.
    +        dbp=>set_flags(DB_REVSPLITOFF);
    +
    +        dbp->open(dbp,        // Pointer to the database 
    +                  NULL,       // Txn pointer 
    +                  file_name,  // File name 
    +                  NULL,       // Logical db name 
    +                  DB_BTREE,   // Database type (using btree)
    +                  db_flags,   // Open flags 
    +                  0);         // File mode. Using defaults
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database and environment: "
    +                  << file_name << ", " << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +    }
    +
    +    try {
    +        dbp->close(dbp, 0);
    +        myEnv.close(0);
    +    } catch(DbException &e) {
    +        std::cerr << "Error closing database and environment: "
    +                  << file_name << ", " << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    return (EXIT_SUCCESS);
    +} 
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/rwlocks1.jpg b/db/docs/gsg_txn/CXX/rwlocks1.jpg new file mode 100644 index 000000000..0fc88fd31 Binary files /dev/null and b/db/docs/gsg_txn/CXX/rwlocks1.jpg differ diff --git a/db/docs/gsg_txn/CXX/simplelock.jpg b/db/docs/gsg_txn/CXX/simplelock.jpg new file mode 100644 index 000000000..8dca4ad82 Binary files /dev/null and b/db/docs/gsg_txn/CXX/simplelock.jpg differ diff --git a/db/docs/gsg_txn/CXX/txn_ccursor.html b/db/docs/gsg_txn/CXX/txn_ccursor.html new file mode 100644 index 000000000..be89a3dc8 --- /dev/null +++ b/db/docs/gsg_txn/CXX/txn_ccursor.html @@ -0,0 +1,163 @@ + + + + + + Transactional Cursors and Concurrent Applications + + + + + + + + + +
    +
    +
    +
    +

    Transactional Cursors and Concurrent Applications

    +
    +
    +
    +
    +

    + When you use transactional cursors with a concurrent application, remember that + in the event of a deadlock you must make sure that you close your cursor before you abort and retry your + transaction. +

    +

    + Also, remember that when you are using the default isolation level, + every time your cursor reads a record it locks + that record until the encompassing transaction is resolved. This + means that walking your database with a transactional cursor + increases the chance of lock contention. +

    +

    + For this reason, if you must routinely walk your database with a + transactional cursor, consider using a reduced isolation level + such as read committed. +

    +
    +
    +
    +
    +

    Using Cursors with Uncommitted Data

    +
    +
    +
    +
    +

    + + As described in Reading Uncommitted Data + above, it is possible to relax your transaction's isolation + level such that it can read data modified but not yet committed + by another transaction. You can configure this when you create + your transaction handle, and when you do so then all cursors opened + inside that transaction will automatically use uncommitted reads. +

    +

    + You can also do this when you create a cursor handle from within + a serializable transaction. When you do this, only those + cursors configured for uncommitted reads uses uncommitted reads. +

    +

    + Either way, you must first configure your database handle to support + uncommitted reads before you can configure your transactions or + your cursors to use them. +

    +

    + The following example shows how to configure an individual cursor handle + to read uncommitted data from within a serializable (full isolation) transaction. + For an example of + configuring a transaction to perform uncommitted reads in + general, see Reading Uncommitted Data. +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    u_int32_t db_flags = DB_CREATE |           // Create the db if it does
    +                                               // not exist
    +                         DB_AUTO_COMMIT |      // Enable auto commit
    +                         DB_READ_UNCOMMITTED;  // Enable uncommitted reads
    +
    +    Db *dbp = NULL;
    +    const char *file_name = "mydb.db";
    +
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    Dbc *cursorp = NULL;
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +        dbp = new Db(&myEnv, 0);
    +        dbp->open(NULL,       // Txn pointer
    +                  file_name,  // File name
    +                  NULL,       // Logical db name
    +                  DB_BTREE,   // Database type (using btree)
    +                  db_flags,   // Open flags
    +                  0);         // File mode. Using defaults
    +
    +        DbTxn *txn = NULL;
    +        myEnv.txn_begin(NULL, &txn, 0);
    +        try {
    +            // Get our cursor. Note that we pass the transaction 
    +            // handle here. Note also that we pass the 
    +            // DB_READ_UNCOMMITTED flag here so as to cause the
    +            // cursor to perform uncommitted reads.
    +            db.cursor(txn, &cursorp, DB_READ_UNCOMMITTED); 
    +
    +            // From here, you perform your cursor reads and writes 
    +            // as normal, committing and aborting the transactions as 
    +            // is necessary, and testing for deadlock exceptions as 
    +            // normal (omitted for brevity). 
    +        
    +            ... 
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/txnconcurrency.html b/db/docs/gsg_txn/CXX/txnconcurrency.html new file mode 100644 index 000000000..570a0d0ee --- /dev/null +++ b/db/docs/gsg_txn/CXX/txnconcurrency.html @@ -0,0 +1,360 @@ + + + + + + Chapter 4. Concurrency + + + + + + + + + +
    +
    +
    +
    +

    Chapter 4. Concurrency

    +
    +
    +
    +
    + +

    + + DB offers a great deal of support for multi-threaded + + and multi-process + + applications even when transactions are not in use. Many of DB's + handles are + thread-safe, or + can be made thread-safe by providing the appropriate flag at handle creation time, + and DB provides a + flexible locking subsystem for managing databases in a concurrent + application. Further, DB provides a robust mechanism for + detecting and responding to deadlocks. All of these concepts are + explored in this chapter. +

    +

    + Before continuing, it is useful to define a few terms that will appear + throughout this chapter: +

    +
    +
      +
    • +

      + Thread of control +

      +

      + Refers to a thread that is performing work in your application. + Typically, in this book that thread will be performing DB + operations. +

      +

      + Note that this term can also be taken to mean a separate process + that is performing work — DB supports multi-process + operations on your databases. +

      +

      + Also, DB is agnostic with regard to the type or style of + threads in use in your application. So if you are using + multiple threads + (as opposed to multiple processes) to perform concurrent + database access, you are free to use whatever thread package is + best for your platform and application. That said, this manual + will use pthreads for its threading examples because those have + the best chance of being supported across a large range of + platforms. +

      +
    • +
    • +

      + Locking +

      +

      + When a thread of control obtains + access to a shared resource, it is said to be + locking that resource. Note that + DB supports both exclusive and non-exclusive locks. See + Locks for more information. +

      +
    • +
    • +

      + Free-threaded +

      +

      + Data structures and objects are free-threaded if they can be + shared across threads of control without any explicit locking on + the part of the application. Some books, libraries, and + programming languages may use the term + thread-safe for data structures or objects + that have this characteristic. The two terms mean the + same thing. +

      +

      + For a description of free-threaded DB objects, see + Which DB Handles are Free-Threaded. +

      +
    • +
    • +

      + Blocked +

      +

      + When a thread cannot obtain a lock because some other + thread already holds a lock on that object, the lock + attempt is said to be blocked. See + Blocks for more information. +

      +
    • +
    • +

      + Deadlock +

      +

      + Occurs when two or more threads of control attempt to access conflicting resource in such a way as none + of the threads can any longer may further progress. +

      +

      + For example, if Thread A is blocked waiting for a resource held by Thread + B, while at the same time Thread B is blocked waiting for a + resource held by Thread A, then neither thread can make any + forward progress. In this situation, Thread A and Thread B + are said to be deadlocked. +

      +

      + For more information, see Deadlocks. +

      +
    • +
    +
    +
    +
    +
    +
    +

    Which DB Handles are Free-Threaded

    +
    +
    +
    +
    +

    + The following describes to what extent and under what conditions + individual handles are free-threaded. +

    +
    +
      +
    • +

      + + DbEnv + +

      +

      + Free-threaded so long as + + the DB_THREAD flag is provided to + the environment open() + method. + + +

      +
    • +
    • +

      + + Db + +

      +

      + Free-threaded so long as + + the DB_THREAD flag is provided to + the database open() + method, or if the database is opened using a + free-threaded environment handle. + + +

      +
    • +
    • +

      + + Dbc + +

      +

      + Cursors are not free-threaded. However, they + can be used by multiple threads of control so + long as the application serializes access to the handle. +

      +
    • +
    • +

      + + DbTxn + + +

      +

      + Access must be serialized by the application across threads of control. +

      +
    • +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/txncursor.html b/db/docs/gsg_txn/CXX/txncursor.html new file mode 100644 index 000000000..83bc93bda --- /dev/null +++ b/db/docs/gsg_txn/CXX/txncursor.html @@ -0,0 +1,124 @@ + + + + + + Transactional Cursors + + + + + + + + + +
    +
    +
    +
    +

    Transactional Cursors

    +
    +
    +
    +
    +

    + You can transaction-protect your cursor operations by + specifying a transaction handle at the time that you create + your cursor. Beyond that, you do not ever + provide a transaction handle directly to a cursor method. +

    +

    + Note that if you transaction-protect a cursor, then you must + make sure that the cursor is closed before you either commit or + abort the transaction. For example: +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    // Environment and database opens omitted
    +    ...
    +
    +    DbTxn *txn = NULL;
    +    Dbc *cursorp = NULL;
    +
    +    try {
    +
    +        Dbt key, data;
    +        key.set_data(keystr);
    +        key.set_size((strlen(keystr) + 1) * sizeof(char));
    +        key.set_data(datastr);
    +        key.set_size((strlen(datastr) + 1) * sizeof(char));
    +
    +        DbTxn *txn = NULL;
    +        myEnv.txn_begin(NULL, &txn, 0);
    +        try {
    +            // Get our cursor. Note that we pass the transaction handle here.
    +            db.cursor(txn, &cursorp, 0); 
    +
    +            // Perform our operations. Note that we do not pass a transaction
    +            // handle here.
    +            char *replacementString = "new string";
    +            while (cursor->get(&key, &data, DB_NEXT) == 0) {
    +                data.set_data(void *)replacementString);
    +                data.set_size((strlen(replacementString) + 1) * sizeof(char));
    +                cursor->put(&key, &data, DB_CURRENT);
    +            }
    +
    +            // We're done. Commit the transaction.
    +            cursor->close();
    +            txn->commit(0);
    +        } catch (DbException &e) {
    +            std::cerr << "Error in transaction: "
    +                       << e.what() << std::endl;
    +            cursor->close();
    +            txn->abort();
    +        }
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database and environment: "
    +                  << file_name << ", "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +    }
    +
    +
    +    return (EXIT_SUCCESS);
    +} 
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/txnexample_c.html b/db/docs/gsg_txn/CXX/txnexample_c.html new file mode 100644 index 000000000..1e1c9419c --- /dev/null +++ b/db/docs/gsg_txn/CXX/txnexample_c.html @@ -0,0 +1,674 @@ + + + + + + Transaction Example + + + + + + + + + +
    +
    +
    +
    +

    Transaction Example

    +
    +
    +
    +
    +

    + The following code provides a fully functional example of a + multi-threaded transactional DB application. For improved + portability across platforms, this examples uses pthreads to + provide threading support. +

    +

    + The example opens an environment and database and then creates 5 + threads, each of which writes 500 records to the database. The keys + used for these writes are pre-determined strings, while the data is + a random value. This means that the actual data is arbitrary and + therefore uninteresting; we picked it only because it requires + minimum code to implement and therefore will stay out of the way of + the main points of this example. +

    +

    + Each thread writes 10 records under a single transaction + before committing and writing another 10 (this is repeated 50 + times). At the end of each transaction, but before committing, each + thread calls a function that uses a cursor to read every record in + the database. We do this in order to make some points about + database reads in a transactional environment. +

    +

    + Of course, each writer thread performs deadlock detection as + described in this manual. In addition, normal recovery is performed + when the environment is opened. +

    +

    + We start with our normal include directives: +

    +
    // File TxnGuide.cpp
    +
    +// We assume an ANSI-compatible compiler
    +#include <db_cxx.h>
    +#include <pthread.h>
    +#include <iostream>
    +
    +#ifdef _WIN32
    +extern int getopt(int, char * const *, const char *);
    +#else
    +#include <unistd.h>
    +#endif  
    +

    + We also need a directive that we use to identify how many threads we + want our program to create: +

    +
    // Run 5 writers threads at a time.
    +#define NUMWRITERS 5 
    +

    + Next we declare a couple of global + variables (used by our threads), and we provide our forward + declarations for the functions used by this example. +

    +
    // Printing of pthread_t is implementation-specific, so we
    +// create our own thread IDs for reporting purposes.
    +int global_thread_num;
    +pthread_mutex_t thread_num_lock;
    +
    +// Forward declarations
    +int countRecords(Db *, DbTxn *);
    +int openDb(Db **, const char *, const char *, DbEnv *, u_int32_t);
    +int usage(void);
    +void *writerThread(void *);  
    +

    + We now implement our usage function, which identifies our only command line + parameter: +

    +
    // Usage function
    +int
    +usage()
    +{
    +    std::cerr << " [-h <database_home_directory>]" << std::endl;
    +    return (EXIT_FAILURE);
    +}  
    +

    + With that, we have finished up our program's housekeeping, and we can + now move on to the main part of our program. As usual, we begin with + main(). First we declare all our variables, and + then we initialize our DB handles. +

    +
    int
    +main(int argc, char *argv[])
    +{
    +    // Initialize our handles
    +    Db *dbp = NULL;
    +    DbEnv *envp = NULL; 
    +
    +    pthread_t writerThreads[NUMWRITERS];
    +    int ch, i;
    +    u_int32_t envFlags;
    +    char *dbHomeDir;
    +
    +    // Application name
    +    const char *progName = "TxnGuide";
    +
    +    // Database file name
    +    const char *fileName = "mydb.db";  
    +

    + Now we need to parse our command line. In this case, all we want is to + know where our environment directory is. If the -h + option is not provided when this example is run, the current working + directory is used instead. +

    +
        // Parse the command line arguments
    +#ifdef _WIN32
    +    dbHomeDir = ".\\";
    +#else
    +    dbHomeDir = "./";
    +#endif
    +    while ((ch = getopt(argc, argv, "h:")) != EOF)
    +        switch (ch) {
    +        case 'h':
    +            dbHomeDir = optarg;
    +            break;
    +        case '?':
    +        default:
    +            return (usage());
    +        }  
    +

    + Next we create our database handle, and we define our environment open flags. + There are a few things to notice here: +

    +
    +
      +
    • +

      + We specify DB_RECOVER, which means that normal + recovery is run every time we start the application. This is + highly desirable and recommended for most + applications. +

      +
    • +
    • +

      + We also specify DB_THREAD, which means our + environment handle will be free-threaded. This is very + important because we will be sharing the environment handle + across threads. +

      +
    • +
    +
    +
        // Env open flags
    +    envFlags =
    +      DB_CREATE     |  // Create the environment if it does not exist
    +      DB_RECOVER    |  // Run normal recovery.
    +      DB_INIT_LOCK  |  // Initialize the locking subsystem
    +      DB_INIT_LOG   |  // Initialize the logging subsystem
    +      DB_INIT_TXN   |  // Initialize the transactional subsystem. This
    +                       // also turns on logging.
    +      DB_INIT_MPOOL |  // Initialize the memory pool (in-memory cache)
    +      DB_THREAD;       // Cause the environment to be free-threaded
    +
    +    try {
    +        // Create and open the environment 
    +        envp = new DbEnv(0);  
    +

    + Now we configure how we want deadlock detection performed. In our case, we will cause DB to perform deadlock + detection by walking its internal lock tables looking for a block every time a lock is requested. Further, in the + event of a deadlock, the thread that holds the youngest lock will receive the deadlock notification. +

    +
            // Indicate that we want db to internally perform deadlock 
    +        // detection.  Also indicate that the transaction with 
    +        // the fewest number of write locks will receive the 
    +        // deadlock notification in the event of a deadlock.
    +        envp->set_lk_detect(DB_LOCK_MINWRITE);  
    +

    + Now we open our environment. +

    +
            // If we had utility threads (for running checkpoints or 
    +        // deadlock detection, for example) we would spawn those
    +        // here. However, for a simple example such as this,
    +        // that is not required.
    +
    +        envp->open(dbHomeDir, envFlags, 0); 
    +

    + Now we call the function that will open our database for us. This is + not very interesting, except that you will notice that we are + specifying DB_DUPSORT. This is required purely by + the data that we are writing to the database, and it is only necessary + if you run the application more than once without first deleting the environment. +

    +

    +The implementation of open_db() is described + later in this section. +

    +
            // Open the database
    +        openDb(&dbp, progName, fileName, envp, DB_DUPSORT);  
    +

    + Now we create our threads. In this example we are using pthreads + for our threading package. A description of threading (beyond how + it impacts DB usage) is beyond the scope of this manual. + However, the things that we are doing here should be familiar to + anyone who has prior experience with any threading package. We are + simply initializing a mutex, creating our threads, and then joining + our threads, which causes our program to wait until the joined + threads have completed before continuing operations in the main + thread. +

    +
            // Initialize a pthread mutex. Used to help provide thread ids.
    +        (void)pthread_mutex_init(&thread_num_lock, NULL);
    +
    +        // Start the writer threads.
    +        for (i = 0; i < NUMWRITERS; i++)
    +            (void)pthread_create(&writerThreads[i], NULL,
    +                writerThread, (void *)dbp);
    +
    +        // Join the writers
    +        for (i = 0; i < NUMWRITERS; i++)
    +            (void)pthread_join(writerThreads[i], NULL);
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database environment: "
    +                  << dbHomeDir << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }  
    +

    + Finally, to wrap up main(), we close out our + database and environment handle, as is normal for any DB + application. Notice that this is where our err + label is placed in our application. If any database operation prior + to this point in the program returns an error status, the program + simply jumps to this point and closes our handles if necessary + before exiting the application completely. +

    +
        try {
    +        // Close our database handle if it was opened.
    +        if (dbp != NULL)
    +            dbp->close(0);
    +
    +        // Close our environment if it was opened.
    +        if (envp != NULL)
    +            envp->close(0);
    +    } catch(DbException &e) {
    +        std::cerr << "Error closing database and environment."
    +                  << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    // Final status message and return.
    +
    +    std::cout << "I'm all done." << std::endl;
    +    return (EXIT_SUCCESS);
    +}  
    +

    + Now that we have completed main(), we need to + implement the function that our writer threads will actually run. This + is where the bulk of our transactional code resides. +

    +

    + We start as usual with variable declarations and initialization. +

    +
    // A function that performs a series of writes to a
    +// Berkeley DB database. The information written
    +// to the database is largely nonsensical, but the
    +// mechanisms of transactional commit/abort and
    +// deadlock detection are illustrated here.
    +void *
    +writerThread(void *args)
    +{
    +    int j, thread_num;
    +    int max_retries = 20;   // Max retry on a deadlock
    +    char *key_strings[] = {"key 1", "key 2", "key 3", "key 4",
    +                           "key 5", "key 6", "key 7", "key 8",
    +                           "key 9", "key 10"};
    +
    +    Db *dbp = (Db *)args;
    +    DbEnv *envp = dbp->get_env();  
    +

    + Now we want a thread number for reporting purposes. It is possible to + use the pthread_t value directly for this purpose, + but how that is done unfortunately differs depending + on the pthread implementation you are using. So instead we use a + mutex-protected global variable to obtain a simple integer for + our reporting purposes. +

    +

    + Note that we are also use this thread id for initializing a random number generator, which we do here. + We use this random number generator for data generation. +

    +
        // Get the thread number
    +    (void)pthread_mutex_lock(&thread_num_lock);
    +    global_thread_num++;
    +    thread_num = global_thread_num;
    +    (void)pthread_mutex_unlock(&thread_num_lock); 
    +    
    +    // Initialize the random number generator 
    +    srand((u_int)pthread_self());  
    +

    + Now we begin the loop that we use to write data to the database. + + + Notice that in this top loop, we begin a new transaction. + + + We will actually use 50 transactions per writer + thread, although we will only ever have one active transaction per + thread at a time. Within each transaction, we will perform 10 + database writes. +

    +

    + By combining multiple writes together under a single transaction, + we increase the likelihood that a deadlock will occur. Normally, + you want to reduce the potential for a deadlock and in this case + the way to do that is to perform a single write per transaction. + To avoid deadlocks, we could be using auto commit to + write to our database for this workload. +

    +

    + However, we want to show deadlock handling and by performing + multiple writes per transaction we can actually observe deadlocks + occurring. We also want to underscore the idea that you can + combing multiple database operations together in a single atomic + unit of work in order to improve the efficiency of your writes. +

    +
        // Perform 50 transactions
    +    for (int i=0; i<50; i++) {
    +        DbTxn *txn;
    +        bool retry = true;
    +        int retry_count = 0;
    +        // while loop is used for deadlock retries
    +        while (retry) {
    +            // try block used for deadlock detection and
    +            // general db exception handling
    +            try {
    +
    +                // Begin our transaction. We group multiple writes in
    +                // this thread under a single transaction so as to
    +                // (1) show that you can atomically perform multiple 
    +                // writes at a time, and (2) to increase the chances 
    +                // of a deadlock occurring so that we can observe our 
    +                // deadlock detection at work.
    +
    +                // Normally we would want to avoid the potential for 
    +                // deadlocks, so for this workload the correct thing 
    +                // would be to perform our puts with auto commit. But 
    +                // that would excessively simplify our example, so we 
    +                // do the "wrong" thing here instead.
    +                txn = NULL;
    +                envp->txn_begin(NULL, &txn, 0);  
    +

    + Now we begin the inner loop that we use to actually + perform the write. +

    +
                    // Perform the database write for this transaction.
    +                for (j = 0; j < 10; j++) {
    +                    Dbt key, value;
    +                    key.set_data(key_strings[j]);
    +                    key.set_size((strlen(key_strings[j]) + 1) *
    +                        sizeof(char));
    +
    +                    int payload = rand() + i;
    +                    value.set_data(&payload);
    +                    value.set_size(sizeof(int));
    +
    +                    // Perform the database put
    +                    dbp->put(txn, &key, &value, 0);
    +                }  
    +

    + Having completed the inner database write loop, we could simply + commit the transaction and continue on to the next block of 10 + writes. However, we want to first illustrate a few points about + transactional processing so instead we call our + + countRecords() + + function before calling the transaction + commit. + + countRecords() + uses a cursor to read every + record in the database and return a count of the number of records + that it found. +

    +
                    // countRecords runs a cursor over the entire database.
    +                // We do this to illustrate issues of deadlocking
    +                std::cout << thread_num <<  " : Found " 
    +                          <<  countRecords(dbp, NULL)    
    +                          << " records in the database." << std::endl;
    +
    +                std::cout << thread_num <<  " : committing txn : " << i 
    +                          << std::endl;
    +
    +                // commit
    +                try {
    +                    txn->commit(0);
    +                    retry = false;
    +                    txn = NULL;
    +                } catch (DbException &e) {
    +                    std::cout << "Error on txn commit: "
    +                              << e.what() << std::endl;
    +                }  
    +

    + Finally, we finish our try block. Notice how we examine the + exceptions to determine whether we need to + abort (or abort/retry in the case of a deadlock) our current + transaction. +

    +
               } catch (DbDeadlockException &de) {
    +                // First thing we MUST do is abort the transaction.
    +                if (txn != NULL)
    +                    (void)txn->abort();
    +
    +                // Now we decide if we want to retry the operation.
    +                // If we have retried less than max_retries,
    +                // increment the retry count and goto retry.
    +                if (retry_count < max_retries) {
    +                    std::cout << "############### Writer " << thread_num
    +                              << ": Got DB_LOCK_DEADLOCK.\n"
    +                              << "Retrying write operation."
    +                              << std::endl;
    +                    retry_count++;
    +                    retry = true;
    +                 } else {
    +                    // Otherwise, just give up.
    +                    std::cerr << "Writer " << thread_num
    +                              << ": Got DeadLockException and out of "
    +                              << "retries. Giving up." << std::endl;
    +                    retry = false;
    +                 }
    +           } catch (DbException &e) {
    +                std::cerr << "db put failed" << std::endl;
    +                std::cerr << e.what() << std::endl;
    +                if (txn != NULL)
    +                    txn->abort();
    +                retry = false;
    +           } catch (std::exception &ee) {
    +            std::cerr << "Unknown exception: " << ee.what() << std::endl;
    +            return (0);
    +          }
    +        }
    +    }
    +    return (0);
    +}  
    +

    + + We want to back up for a moment and take a look at the call to countRecords(). + + If you look at the + + countRecords() + function prototype at the beginning of this example, you will see that the + function's second parameter takes a transaction handle. However, + our usage of the function here does not pass a transaction handle + through to the function. +

    +

    + + Because + + countRecords() + reads every record in the database, if used incorrectly the thread + will self-deadlock. The writer thread has just written 500 records + to the database, but because the transaction used for that write + has not yet been committed, each of those 500 records are still + locked by the thread's transaction. If we then simply run a + non-transactional cursor over the database from within the same + thread that has locked those 500 records, the cursor will + block when it tries to read one of those transactional + protected records. The thread immediately stops operation at that + point while the cursor waits for the read lock it has + requested. Because that read lock will never be released (the thread + can never make any forward progress), this represents a + self-deadlock for the the thread. +

    +

    + There are three ways to prevent this self-deadlock: +

    +
    +
      +
    1. +

      + We can move the call to + + countRecords() + to a point after the thread's transaction has committed. +

      +
    2. +
    3. +

      + We can allow + + countRecords() + to operate under the same transaction as all of the writes + were performed (this is what the transaction parameter for + the function is for). +

      +
    4. +
    5. +

      + We can reduce our isolation guarantee for the application + by allowing uncommitted reads. +

      +
    6. +
    +
    +

    + For this example, we choose to use option 3 (uncommitted reads) to avoid + the deadlock. This means that we have to open our database such + that it supports uncommitted reads, and we have to open our cursor handle + so that it knows to perform uncommitted reads. +

    +

    + Note that in In-Memory Transaction Example, + we simply perform the cursor operation using the same transaction + as is used for the thread's writes. +

    +

    + The following is the + + countRecords() + implementation. There is not anything particularly interesting + about this function other than specifying uncommitted reads when + we open the cursor handle, but we include the function here anyway + for the sake of completeness. +

    +
    // This simply counts the number of records contained in the
    +// database and returns the result.
    +//
    +// Note that this method exists only for illustrative purposes.
    +// A more straight-forward way to count the number of records in
    +// a database is to use the Database.getStats() method.
    +int
    +countRecords(Db *dbp, DbTxn *txn)
    +{
    +
    +    Dbc *cursorp = NULL;
    +    int count = 0;
    +
    +    try {
    +        // Get the cursor
    +        dbp->cursor(txn, &cursorp, DB_READ_UNCOMMITTED);
    +
    +        Dbt key, value;
    +        while (cursorp->get(&key, &value, DB_NEXT) == 0) {
    +            count++;
    +        }
    +    } catch (DbDeadlockException &de) {
    +        std::cerr << "countRecords: got deadlock" << std::endl;
    +        cursorp->close();
    +        throw de;
    +    } catch (DbException &e) {
    +        std::cerr << "countRecords error:" << std::endl;
    +        std::cerr << e.what() << std::endl;
    +    }
    +
    +    if (cursorp != NULL) {
    +        try {
    +            cursorp->close();
    +        } catch (DbException &e) {
    +            std::cerr << "countRecords: cursor close failed:" << std::endl;
    +            std::cerr << e.what() << std::endl;
    +        }
    +    }
    +
    +    return (count);
    +}  
    +

    + Finally, we provide the implementation of our + + openDb() + function. This function should hold + no surprises for you. Note, however, that we do specify uncommitted reads + when we open the database. If we did not do this, then our + + countRecords() + function would cause our + thread to self-deadlock because the cursor could not be opened to + support uncommitted reads (that flag on the cursor open would, in fact, + be silently ignored by DB). +

    +
    // Open a Berkeley DB database
    +int
    +openDb(Db **dbpp, const char *progname, const char *fileName,
    +  DbEnv *envp, u_int32_t extraFlags)
    +{
    +    int ret;
    +    u_int32_t openFlags;
    +
    +    try {
    +        Db *dbp = new Db(envp, 0);
    +
    +        // Point to the new'd Db
    +        *dbpp = dbp;
    +
    +        if (extraFlags != 0)
    +            ret = dbp->set_flags(extraFlags);
    +
    +        // Now open the database
    +        openFlags = DB_CREATE              | // Allow database creation
    +                    DB_READ_UNCOMMITTED    | // Allow uncommitted reads
    +                    DB_AUTO_COMMIT;          // Allow auto commit
    +
    +        dbp->open(NULL,       // Txn pointer
    +                  fileName,   // File name
    +                  NULL,       // Logical db name
    +                  DB_BTREE,   // Database type (using btree)
    +                  openFlags,  // Open flags
    +                  0);         // File mode. Using defaults
    +    } catch (DbException &e) {
    +        std::cerr << progname << "open_db: db open failed:" << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    return (EXIT_SUCCESS);
    +}  
    +

    + This completes our transactional example. If you would like to + experiment with this code, you can find the example in the following + location in your DB distribution: +

    +
    DB_INSTALL/examples_cxx/txn_guide
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/txnindices.html b/db/docs/gsg_txn/CXX/txnindices.html new file mode 100644 index 000000000..e4e8502f7 --- /dev/null +++ b/db/docs/gsg_txn/CXX/txnindices.html @@ -0,0 +1,118 @@ + + + + + + Secondary Indices with Transaction Applications + + + + + + + + + +
    +
    +
    +
    +

    Secondary Indices with Transaction Applications

    +
    +
    +
    +
    +

    + You can use transactions with your secondary indices so long as you + + open the secondary index so that it supports transactions (that is, + you wrap the database open in a transaction, or use auto commit, + in the same way as when you open a primary transactional database). + + + + + In addition, you must make sure that when you associate the + secondary index with the primary database, the association is + performed using a transaction. The easiest thing to do here is + to simply specify DB_AUTO_COMMIT when you + perform the association. + +

    +

    + All other aspects of using secondary indices with transactions are + identical to using secondary indices without transactions. In + addition, transaction-protecting + + cursors opened against secondary indices is performed in + exactly the same way as when you use transactional cursors + against a primary database. + + + See Transactional Cursors for details. +

    +

    + Note that when you use transactions to protect your database writes, your secondary indices are protected from + corruption because updates to the primary and the secondaries are performed in a single atomic transaction. +

    +

    + For example: +

    +
    #include <db_cxx.h>
    +
    +...
    +
    +// Environment and primary database open omitted
    +...
    +
    +Db my_index(&envp, 0);    // Secondary
    +
    +// Open the secondary
    +my_index.open(NULL,              // Transaction pointer
    +              "my_secondary.db", // On-disk file that holds the database.
    +              NULL,              // Optional logical database name
    +              DB_BTREE,          // Database access method
    +              DB_AUTO_COMMIT,    // Open flags.
    +              0);                // File mode (using defaults)
    +
    +// Now associate the primary and the secondary
    +my_database.associate(NULL,             // Txn id
    +                      &my_index,        // Associated secondary database
    +                      get_sales_rep,    // Callback used for key extraction.
    +                                        // This is described in the Getting 
    +                                        // Started guide.
    +                      DB_AUTO_COMMIT);  // Flags 
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/txnnowait.html b/db/docs/gsg_txn/CXX/txnnowait.html new file mode 100644 index 000000000..c47f486fd --- /dev/null +++ b/db/docs/gsg_txn/CXX/txnnowait.html @@ -0,0 +1,91 @@ + + + + + + No Wait on Blocks + + + + + + + + + +
    +
    +
    +
    +

    No Wait on Blocks

    +
    +
    +
    +
    +

    + Normally when a DB transaction is blocked on a lock request, it + must wait until the requested lock becomes available before its + thread-of-control can proceed. However, it is possible to configure a + transaction handle such that it will report a deadlock rather + than wait for the block to clear. +

    +

    + You do this on a transaction by transaction basis by specifying + + + DB_TXN_NOWAIT + to the + + DbEnv::txn_begin() + + method. + + + +

    +

    + For example: +

    +
        DbTxn *txn = NULL;
    +    try {
    +        envp->txn_begin(NULL, &txn, DB_TXN_NOWAIT);
    +
    +        ...
    +    } catch (DbException &de) {
    +        // Deadlock detection and exception handling omitted
    +        // for brevity
    +        ...
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/usingtxns.html b/db/docs/gsg_txn/CXX/usingtxns.html new file mode 100644 index 000000000..906664f44 --- /dev/null +++ b/db/docs/gsg_txn/CXX/usingtxns.html @@ -0,0 +1,535 @@ + + + + + + Chapter 3. Transaction Basics + + + + + + + + + +
    +
    +
    +
    +

    Chapter 3. Transaction Basics

    +
    +
    +
    +
    + +

    + Once you have enabled transactions for your environment and your databases, + you can use them to protect your database operations. You do this by + acquiring a transaction handle and then using that handle for any + database operation that you want to participate in that transaction. +

    +

    + You obtain a transaction handle using the + + DbEnv::txn_begin() method. + + + +

    +

    + Once you have completed all of the operations that you want to include + in the transaction, you must commit the transaction using the + + DbTxn::commit() method. + + + + +

    +

    + If, for any reason, you want to abandon the transaction, you abort + it using + + DbTxn::abort(). + + + + + +

    +

    + Any transaction handle that has been committed or aborted can no longer + be used by your application. +

    +

    + Finally, you must make sure that all transaction handles are either + committed or aborted before closing your databases and environment. +

    +
    +

    Note

    +

    + If you only want to transaction protect a single database write operation, you can use auto commit to + perform the transaction administration. When you use auto commit, you do not need an explicit transaction + handle. See Auto Commit for more information. +

    +
    +

    + For example, the following example opens a transactional-enabled environment and + database, obtains a transaction handle, and then performs a write + operation under its protection. In the event of any failure in the + write operation, the transaction is aborted and the database is left in a + state as if no operations had ever been attempted in the first place. +

    +
    #include "db_cxx.h"
    +
    +...
    +                                                                                                                                  
    +int main(void)
    +{
    +    u_int32_t env_flags = DB_CREATE     |  // If the environment does not
    +                                           // exist, create it.
    +                          DB_INIT_LOCK  |  // Initialize locking
    +                          DB_INIT_LOG   |  // Initialize logging
    +                          DB_INIT_MPOOL |  // Initialize the cache
    +                          DB_INIT_TXN;     // Initialize transactions
    +
    +    u_int32_t db_flags = DB_CREATE | DB_AUTO_COMMIT;
    +    Db *dbp = NULL;
    +    const char *file_name = "mydb.db";
    +    const char *keystr ="thekey";
    +    const char *datastr = "thedata";
    +                                                                                                                                  
    +    std::string envHome("/export1/testEnv");
    +    DbEnv myEnv(0);
    +
    +    try {
    +
    +        myEnv.open(envHome.c_str(), env_flags, 0);
    +        dbp = new Db(&myEnv, 0);
    +
    +        // Open the database. Note that we are using auto commit for 
    +        // the open, so the database is able to support transactions.
    +        dbp->open(NULL,       // Txn pointer
    +                  file_name,  // File name
    +                  NULL,       // Logical db name
    +                  DB_BTREE,   // Database type (using btree)
    +                  db_flags,   // Open flags
    +                  0);         // File mode. Using defaults
    +
    +        Dbt key, data;
    +        key.set_data(keystr);
    +        key.set_size((strlen(keystr) + 1) * sizeof(char));
    +        key.set_data(datastr);
    +        key.set_size((strlen(datastr) + 1) * sizeof(char));
    +
    +        DbTxn *txn = NULL;
    +        myEnv.txn_begin(NULL, &txn, 0);
    +        try {
    +            db->put(txn, &key, &data, 0);
    +            txn->commit(0);
    +        } catch (DbException &e) {
    +            std::cerr << "Error in transaction: "
    +                       << e.what() << std::endl;
    +            txn->abort();
    +        }
    +
    +    } catch(DbException &e) {
    +        std::cerr << "Error opening database and environment: "
    +                  << file_name << ", "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +    }
    +
    +    try {
    +        if (dbp != NULL) 
    +            dbp->close(0);
    +        myEnv.close(0);
    +    } catch(DbException &e) {
    +        std::cerr << "Error closing database and environment: "
    +                  << file_name << ", "
    +                  << envHome << std::endl;
    +        std::cerr << e.what() << std::endl;
    +        return (EXIT_FAILURE);
    +    }
    +
    +    return (EXIT_SUCCESS);
    +} 
    +
    +
    +
    +
    +

    Committing a Transaction

    +
    +
    +
    +
    +

    + In order to fully understand what is happening when you commit + a transaction, you must first understand a little about what + DB is doing with + + + the logging subsystem. + + + + + Logging causes all database write operations to be identified in + + logs, and by default these + logs are backed by files on disk. These logs are used to restore your databases + + + + + in the event of a system or application failure, so by performing + logging, DB ensures the integrity of your data. +

    +

    + Moreover, DB performs write-ahead + logging. This means that information is written to the logs + before the actual database is changed. + This means that all write activity performed under the + protection of the transaction is noted in the log before + the transaction is committed. Be aware, however, that database + maintains logs in-memory. If you are backing your logs on + disk, the log information will eventually be written to the log + files, but while the transaction is on-going the log data may be + held only in memory. +

    +

    + When you commit a transaction, the following occurs: +

    +
    +
      +
    • +

      + A commit record is written to the log. This + indicates that the modifications made by the + transaction are now permanent. By default, this write is performed synchronously to disk so the + commit record arrives in the log files before any other actions are taken. +

      +
    • +
    • +

      + Any log information held in memory is (by default) + synchronously written to disk. Note that this requirement can be + relaxed, depending on the type of commit you perform. + See Non-Durable Transactions for + more information. + Also, if you are + maintaining your logs entirely in-memory, then this + step will of course not be taken. To configure your + logging system for in-memory usage, see + Configuring In-Memory Logging. + +

      +
    • +
    • +

      + All locks held by the transaction are released. This means + that read operations performed by other transactions or + threads of control can now see the modifications without + resorting to uncommitted reads (see Reading Uncommitted Data for more information). +

      +
    • +
    +
    +

    + To commit a transaction, you simply call + + DbTxn::commit(). + + + +

    +

    + Notice that committing a transaction does not necessarily cause data + modified in your memory cache to be written to the files + backing your databases on disk. Dirtied database pages are written + for a number of reasons, but a transactional + commit is not one of them. The following are the things that can cause a dirtied + database page to be written to the backing database file: +

    +
    +
      +
    • +

      + Checkpoints. +

      +

      + Checkpoints cause all dirtied pages currently existing + in the cache to be written to disk, and a checkpoint + record is then written to the logs. You can run checkpoints + explicitly. For more information on checkpoints, + see Checkpoints. +

      +
    • +
    • +

      + Cache is full. +

      +

      + If the in-memory cache fills up, then dirtied pages + might be written to disk in order to free up space for other + pages that your application needs to use. Note that if + dirtied pages are written to the database files, then + any log records that describe how those pages were + dirtied are written to disk before the database + pages are written. +

      +
    • +
    +
    +

    + Be aware that because your transaction commit caused database + modifications recorded in your logs to be forced to disk, your modifications + are by default "persistent" in that they can be recovered in the event of + an application or system failure. However, recovery time is + gated by how much data has been modified since the last + checkpoint, so for applications that perform a lot of writes, + you may want to run a checkpoint with some frequency. +

    +

    + Note that once you have committed a transaction, the transaction + handle that you used for the transaction is no longer valid. To + perform database activities under the control of a new + transaction, you must obtain a fresh transaction handle. +

    +
    +
    +
    +
    +

    Non-Durable Transactions

    +
    +
    +
    +
    +

    + As previously noted, by default transaction commits are + durable because they cause the modifications performed + under the transaction to be synchronously recorded in + your on-disk log files. However, it is possible to use + non-durable transactions. +

    +

    + You may want non-durable transactions for performance + reasons. For example, you might be using transactions + simply for the isolation guarantee. + + + In this case, you might + not want a durability guarantee and so you may want to + prevent the disk I/O that normally accompanies a + transaction commit. + + +

    +

    + There are several ways to remove the durability guarantee + for your transactions: +

    +
    +
      +
    • +

      + Specify + + DB_TXN_NOSYNC using the + + DbEnv::set_flags() + method. + + + This causes DB to not synchronously force any + + log + + data to disk upon transaction commit. + + + That is, the modifications are held entirely + in the in-memory cache and the logging + information is not forced to the filesystem for + long-term storage. + + + Note, however, that the + + logging + + data will eventually make it to the filesystem (assuming no + application or OS crashes) as a part of DB's + management of its logging buffers and/or cache. +

      +

      + This form of a commit provides a weak durability + guarantee because data loss can occur due to + an application + or OS crash. +

      +

      + This behavior is specified on a per-environment + handle basis. In order for your application to exhibit consistent + behavior, you need to specify this + flag + + for all of the environment handles used in your application. +

      +

      + You can achieve this behavior on a transaction by transaction basis by + + specifying DB_TXN_NOSYNC to the + + DbTxn::commit() + + method. + + + + +

      +
    • +
    • +

      + Specify + + DB_TXN_WRITE_NOSYNC using the + + DbEnv::set_flags() + method. + + + + + This causes + + logging + + data to be synchronously + written to the OS's file system buffers upon + transaction commit. The data will eventually be + written to disk, but this occurs when the + operating system chooses to schedule the + activity; the transaction commit can complete + successfully before this disk I/O is performed + by the OS. +

      +

      + This form of commit protects you against application + crashes, but not against OS + crashes. This method offers less room for the possibility of data loss than does + DB_TXN_NOSYNC. + +

      +

      + This behavior is specified on a per-environment + handle basis. In order for your application to exhibit consistent + behavior, you need to specify this + flag + + for all of the environment handles used in your application. +

      +
    • +
    • +

      + Maintain your logs entirely in-memory. In this + case, your logs are never written to disk. The + result is that you lose all durability guarantees. + See + Configuring In-Memory Logging + for more information. +

      +
    • +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/wrapup.html b/db/docs/gsg_txn/CXX/wrapup.html new file mode 100644 index 000000000..32370c29f --- /dev/null +++ b/db/docs/gsg_txn/CXX/wrapup.html @@ -0,0 +1,283 @@ + + + + + + Chapter 6. Summary and Examples + + + + + + + + + +
    +
    +
    +
    +

    Chapter 6. Summary and Examples

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Anatomy of a Transactional Application + +
    +
    + + Transaction Example + +
    +
    + + In-Memory Transaction Example + +
    +
    +
    +

    + Throughout this manual we have presented the concepts and + mechanisms that you need to provide transactional protection for + your application. In this chapter, we summarize these + mechanisms, and we provide a complete example of a multi-threaded + transactional DB application. +

    +
    +
    +
    +
    +

    Anatomy of a Transactional Application

    +
    +
    +
    +
    +

    + Transactional applications are characterized by performing the + following activities: +

    +
    +
      +
    1. +

      + Create your environment handle. +

      +
    2. +
    3. +

      + Open your environment, specifying that the following + subsystems be used: +

      +
      +
        +
      • +

        + Transactional Subsystem (this also initializes the + logging subsystem). +

        +
      • +
      • +

        + Memory pool (the in-memory cache). +

        +
      • +
      • +

        + Logging subsystem. +

        +
      • +
      • +

        + Locking subsystem (if your application is multi-process or multi-threaded). +

        +
      • +
      +
      +

      + It is also highly recommended that you run normal recovery + upon first environment open. Normal recovery examines only those logs required + to ensure your database files are consistent relative to the information found in your + log files. +

      +
    4. +
    5. +

      + Optionally spawn off any utility threads that you might need. Utility + threads can be used to run checkpoints periodically, or to + periodically run a deadlock detector if you do not want to + use DB's built-in deadlock detector. +

      +
    6. +
    7. +

      + Open whatever database handles that you need. +

      +
    8. +
    9. +

      + Spawn off worker threads. How many of these you need and + how they split their DB workload is entirely up to your + application's requirements. However, any worker threads + that perform write operations against your databases will do + the following: +

      +
      +
        +
      1. +

        + Begin a transaction. +

        +
      2. +
      3. +

        + Perform one or more read and write + operations against your databases. +

        +
      4. +
      5. +

        + Commit the transaction if all goes well. +

        +
      6. +
      7. +

        + Abort and retry the operation if a deadlock is + detected. +

        +
      8. +
      9. +

        + Abort the transaction for most other errors. +

        +
      10. +
      +
      +
    10. +
    11. +

      + On application shutdown: +

      +
      +
        +
      1. +

        + Make sure there are no opened cursors. +

        +
      2. +
      3. +

        + Make sure there are no active transactions. Either + abort or commit all transactions before shutting + down. +

        +
      4. +
      5. +

        + Close your databases +

        +
      6. +
      7. +

        + Close your environment. +

        +
      8. +
      +
      +
    12. +
    +
    +
    +

    Note

    +

    + Robust applications should monitor their database worker threads to + make sure they have not died unexpectedly. If a thread does + terminate abnormally, you must shutdown all your worker threads + and then run normal recovery (you will have to reopen your + environment to do this). This is the only way to clear any + resources (such as a lock or a mutex) that the abnormally + exiting worker thread might have been holding at the time that + it died. +

    +

    + Failure to perform this recovery can cause your + still-functioning worker threads to eventually block forever + while waiting for a lock that will never be released. +

    +
    +

    + In addition to these activities, which are all entirely handled by + code within your application, there are some administrative + activities that you should perform: +

    +
    +
      +
    • +

      + Periodically checkpoint your application. Checkpoints will + reduce the time to run recovery in the event that one is + required. See Checkpoints + for details. +

      +
    • +
    • +

      + Periodically back up your database and log files. This is + required in order to fully obtain the durability guarantee + made by DB's transaction ACID support. See + Backup Procedures + for more information. +

      +
    • +
    • +

      + You may want to maintain a hot failover if 24x7 processing + with rapid restart in the face of a disk hit is important + to you. See Using Hot Failovers + for more information. +

      +
    • +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/CXX/writeblock.jpg b/db/docs/gsg_txn/CXX/writeblock.jpg new file mode 100644 index 000000000..4b382b82f Binary files /dev/null and b/db/docs/gsg_txn/CXX/writeblock.jpg differ diff --git a/db/docs/gsg_txn/JAVA/BerkeleyDB-Core-JAVA-Txn.pdf b/db/docs/gsg_txn/JAVA/BerkeleyDB-Core-JAVA-Txn.pdf new file mode 100644 index 000000000..b6ade1d95 Binary files /dev/null and b/db/docs/gsg_txn/JAVA/BerkeleyDB-Core-JAVA-Txn.pdf differ diff --git a/db/docs/gsg_txn/JAVA/abortresults.html b/db/docs/gsg_txn/JAVA/abortresults.html new file mode 100644 index 000000000..6a1b87c22 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/abortresults.html @@ -0,0 +1,95 @@ + + + + + + Aborting a Transaction + + + + + + + + + +
    +
    +
    +
    +

    Aborting a Transaction

    +
    +
    +
    +
    +

    + When you abort a transaction, all database modifications performed + under the protection of the transaction are discarded, and all + locks currently held by the transaction are released. In this event, + your data is simply left in the + state that it was in before the transaction began performing data + modifications. +

    +

    + Note that aborting a transaction may result in disk + + I/O if your logs are backed by the filesystem. + + + It is possible that during the course of your transaction, + logging data and/or database + pages + + were written to backing files on disk. For this reason, DB + notes that the abort occurred in its log files so that at a + minimum the database can be brought into a consistent state at + recovery time. +

    +

    + Also, once you have aborted a transaction, the transaction + handle that you used for the transaction is no longer valid. To + perform database activities under the control of a new + transaction, you must obtain a fresh transactional handle. +

    +

    + To abort a transaction, call + + + Transaction.abort(). + + +

    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/architectrecovery.html b/db/docs/gsg_txn/JAVA/architectrecovery.html new file mode 100644 index 000000000..d5bc9a712 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/architectrecovery.html @@ -0,0 +1,337 @@ + + + + + + Designing Your Application for Recovery + + + + + + + + + +
    +
    +
    +
    +

    Designing Your Application for Recovery

    +
    +
    +
    +
    +

    + When building your DB application, you should consider how you will run recovery. If you are building a + single threaded, single process application, it is fairly simple to run recovery when your application first + opens its environment. In this case, you need only decide if you want to run recovery every time you open + your application (recommended) or only some of the time, presumably triggered by a start up option + controlled by your application's user. +

    +

    + However, for multi-threaded and multi-process applications, you need to carefully consider how you will + design your application's startup code so as to run recovery only when it makes sense to do so. +

    +
    +
    +
    +
    +

    Recovery for Multi-Threaded Applications

    +
    +
    +
    +
    +

    + If your application uses only one environment handle, then handling recovery for a multi-threaded + application is no more difficult than for a single threaded application. You simply open the environment + in the application's main thread, and then pass that handle to each of the threads that will be + performing DB operations. We illustrate this with our final example in this book (see + + Transaction Example + + + for more information). +

    +

    + Alternatively, you can have each worker thread open its own environment handle. However, in this case, + designing for recovery is a bit more complicated. +

    +

    + Generally, when a thread performing database operations fails + or hangs, it is frequently best to simply + restart the application and run recovery upon application + startup as normal. However, not all applications can afford + to restart because a single thread has misbehaved. +

    +

    + If you are attempting to continue operations in the face of a misbehaving thread, + then at a minimum recovery must be run if a thread performing database operations fails or hangs. +

    +

    + Remember that recovery clears the environment of all + outstanding locks, including any that might be outstanding + from an aborted thread. If these locks are not cleared, + other threads performing database operations can back up + behind the locks obtained but never cleared by the failed + thread. The result will be an application that hangs + indefinitely. +

    +

    + To run recovery under these circumstances: +

    +
    +
      +
    1. +

      + Suspend or shutdown all other threads performing + database operations. +

      +
    2. +
    3. +

      + Discarding any open environment handles. Note that + attempting to gracefully close these handles may be + asking for trouble; the close can fail if the + environment is already in need of recovery. For + this reason, it is best and easiest to simply discard the handle. +

      +
    4. +
    5. +

      + Open new handles, running recovery as you open + them. + See Normal Recovery for more information. +

      +
    6. +
    7. +

      + Restart all your database threads. +

      +
    8. +
    +
    +

    + A traditional way to handle this activity is to spawn a watcher thread that is responsible for making + sure all is well with your threads, and performing the above actions if not. +

    +

    + However, in the case where each worker thread opens and maintains its own environment handle, recovery + is complicated for two reasons: +

    +
    +
      +
    1. +

      + For some applications and workloads, it might be + worthwhile to give your database threads the + ability to gracefully finalize any on-going + transactions. If this is the case, your + code must be capable of signaling each thread + to halt DB activities and close its + environment. If you simply run recovery against the + environment, your database threads will + detect this and fail in the midst of performing their + database operations. +

      +
    2. +
    3. +

      + Your code must be capable of ensuring only one + thread runs recovery before allowing all other + threads to open their respective environment + handles. Recovery should be single threaded because when + recovery is run against an environment, it is + deleted and then recreated. This will cause all + other processes and threads to "fail" when they + attempt operations against the newly recovered + environment. If all threads run recovery + when they start up, then it is likely that some + threads will fail because the environment that they + are using has been recovered. This will cause the thread to have to re-execute its own recovery + path. At best, this is inefficient and at worst it could cause your application to fall into an + endless recovery pattern. +

      +
    4. +
    +
    +
    +
    +
    +
    +
    +

    Recovery in Multi-Process Applications

    +
    +
    +
    +
    +

    + Frequently, DB applications use multiple processes to interact with the databases. For example, you may + have a long-running process, such as some kind of server, and then a series of administrative tools that + you use to inspect and administer the underlying databases. Or, in some web-based architectures, different + services are run as independent processes that are managed by the server. +

    +

    + In any case, recovery for a multi-process environment is complicated for two reasons: +

    +
    +
      +
    1. +

      + In the event that recovery must be run, you might + want to notify processes interacting with the environment + that recovery is about to occur and give them a + chance to gracefully terminate. Whether it is + worthwhile for you to do this is entirely dependent + upon the nature of your application. Some + long-running applications with multiple processes + performing meaningful work might want to do this. + Other applications with processes performing database + operations that are likely to be harmed by error conditions in other + processes will likely find it to be not worth the + effort. For this latter group, the chances of + performing a graceful shutdown may be low anyway. +

      +
    2. +
    3. +

      + Unlike single process scenarios, it can quickly become wasteful for every process interacting + with the databases to run recovery when it starts up. This is partly because recovery + does take some amount of time to run, but mostly you want to + avoid a situation where your server must + reopen all its environment handles just because you fire up a command line database + administrative utility that always runs recovery. +

      +
    4. +
    +
    +

    + The following sections describe a mechanism that you can use to determine if and when you should run + recovery in a multi-process application. +

    +
    +
    +
    +
    +

    Effects of Multi-Process Recovery

    +
    +
    +
    +
    +

    + Before continuing, it is worth noting that the following sections describe recovery processes than + can result in one process running recovery while other processes are currently actively performing + database operations. +

    +

    + When this happens, the current database operation will + abnormally fail, indicating a DB_RUNRECOVERY condition. + This means that your application should immediately abandon any database operations that it may have + on-going, discard any environment handles it has opened, and obtain and open new handles. +

    +

    + The net effect of this is that any writes performed by unresolved transactions will be lost. + For persistent applications (servers, for example), the services it provides will also be + unavailable for the amount of time that it takes to complete a recovery and for all participating + processes to reopen their environment handles. +

    +
    +
    +
    +
    +
    +

    Process Registration

    +
    +
    +
    +
    +

    + One way to handle multi-process recovery is for every process to "register" its environment. In + doing so, the process gains the ability to see if any other applications are using the + environment and, if so, whether they have suffered an abnormal termination. If an abnormal + termination is detected, the process runs recovery; otherwise, it does not. +

    +

    + Note that using process registration also ensures that + recovery is serialized across applications. That is, + only one process at a time has a chance to run + recovery. Generally this means that the first process + to start up will run recovery, and all other processes + will silently not run recovery because it is not + needed. +

    +

    + To cause your application to register its environment, you specify + + + + true to the EnvironmentConfig.setRegister() + method when you open your environment. Note that you must also specify + true to either EnvironmentConfig.setRunRecovery() + or EnvironmentConfig.setRunFatalRecovery(). + + If during the open, DB determines that recovery must be run, this indicates the type of + recovery that is run. If you do not specify either type of recovery, then no recovery is run if + the registration process identifies a need for it. In this case, the environment open simply + fails by + + throwing RunRecoveryException. +

    +

    + Be aware that there are some limitations/requirements if you want your various processes to + coordinate recovery using this registration process: +

    +
    +
      +
    1. +

      + There can be only one environment handle per + environment per process. In the case of multi-threaded + processes, the environment handle must be shared across threads. +

      +
    2. +
    3. +

      + All processes sharing the environment must use registration. If registration is + not uniformly used across all participating processes, then you can see inconsistent results + in terms of your application's ability to recognize that recovery must be run. +

      +
    4. +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/autocommit.html b/db/docs/gsg_txn/JAVA/autocommit.html new file mode 100644 index 000000000..22d75ac0f --- /dev/null +++ b/db/docs/gsg_txn/JAVA/autocommit.html @@ -0,0 +1,144 @@ + + + + + + Auto Commit + + + + + + + + + +
    +
    +
    +
    +

    Auto Commit

    +
    +
    +
    +
    +

    + While transactions are frequently used to provide atomicity to + multiple database operations, it is sometimes necessary to perform + a single database operation under the control of a transaction. + Rather than force you to obtain a transaction, perform the single + write operation, and then either commit or abort the transaction, + you can automatically group this sequence of events using + auto commit. +

    +

    + To use auto commit: +

    +
    +
      +
    1. +

      + Open your environment and your databases so that they support + transactions. See Enabling Transactions + for details. +

      +
    2. +
    3. +

      + Do not provide a transactional handle to the method that is + performing the database write operation. +

      +
    4. +
    +
    +

    + Note that auto commit is not available for cursors. You must always + open your cursor using a transaction if you want the cursor's + operations to be transactional protected. See + Transactional Cursors for details on using + transactional cursors. +

    +

    + For example, the following uses auto commit to perform the database write operation: +

    +
    package db.txn;
    +                                                                                                                                     
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +    myEnvConfig.setTransactional(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // Open the database.
    +    DatabaseConfig dbConfig = new DatabaseConfig();
    +    dbConfig.setTransactional(true);
    +    dbConfig.setType(DatabaseType.BTREE);
    +    myDatabase = myEnv.openDatabase(null,              // txn handle
    +                                    "sampleDatabase",  // db file name
    +                                    null,              // db name
    +                                    dbConfig);
    +    String keyString = "thekey";
    +    String dataString = "thedata";
    +    DatabaseEntry key = 
    +        new DatabaseEntry(keyString.getBytes("UTF-8"));
    +    DatabaseEntry data = 
    +        new DatabaseEntry(dataString.getBytes("UTF-8"));
    +
    +    // Perform the write. Because the database was opened to 
    +    // support transactions, this write is performed using auto commit.
    +    myDatabase.put(null, key, data);
    +
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} 
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/backuprestore.html b/db/docs/gsg_txn/JAVA/backuprestore.html new file mode 100644 index 000000000..efc75c030 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/backuprestore.html @@ -0,0 +1,336 @@ + + + + + + Backup Procedures + + + + + + + + + +
    +
    +
    +
    +

    Backup Procedures

    +
    +
    +
    +
    +

    + Durability is an important part of your + transactional guarantees. It means that once a transaction has been + successfully committed, your application will always see the results of that + transaction. +

    +

    + Of course, no software algorithm can guarantee durability in the face of physical data loss. Hard drives + can fail, and if you have not copied your data to locations other than your primary disk drives, + then you will lose data when those drives fail. Therefore, in order to truly obtain a durability + guarantee, you need to ensure that any data stored on disk is backed up to secondary or alternative storage, + such as secondary disk drives, or offline tapes. +

    +

    + There are three different types of backups that you can + perform with DB databases and log files. They are: +

    +
    +
      +
    • +

      + Offline backups +

      +

      + This type of backup is perhaps the easiest to perform as it + involves simply copying database and log files to an + offline storage area. It also gives you a snapshot of the + database at a fixed, known point in time. However, you + cannot perform this type of a backup while you are performing + writes to the database. +

      +
    • +
    • +

      + Hot backups +

      +

      + This type of backup gives you a snapshot of your database. + Since your application can be writing to the database at the time that the + snapshot is being taken, you do not necessarily know what + the exact state of the database is for that given snapshot. +

      +
    • +
    • +

      + Incremental backups +

      +

      + This type of backup refreshes a previously performed backup. +

      +
    • +
    +
    +

    + Once you have performed a backup, you can + perform catastrophic recovery to restore + your databases from the backup. See + Catastrophic Recovery + for more information. +

    +

    + Note that you can also maintain a hot failover. See + Using Hot Failovers + for more information. +

    +
    +
    +
    +
    +

    About Unix Copy Utilities

    +
    +
    +
    +
    +

    + + If you are copying database files you must copy databases atomically, + in multiples of the database page size. In other words, the reads made by + the copy program must not be interleaved with writes by + other threads of control, and the copy program must read the + databases in multiples of the underlying database page size. + Generally, this is not a problem because operating systems + already make this guarantee and system utilities normally + read in power-of-2 sized chunks, which are larger than the + largest possible Berkeley DB database page size. +

    +

    + On some platforms (most notably, some releases of Solaris), the copy utility (cp) was + implemented using the mmap() system call rather than the + read() system call. Because mmap() did not make the same + guarantee of read atomicity as did read(), the cp utility + could create corrupted copies of the databases. +

    +

    + Also, some platforms have implementations of the tar utility that performs 10KB block + reads by default. Even when an output block size is specified, the utility will still not read the + underlying databases in multiples of the specified block size. Again, the result can be a corrupted backup. +

    +

    + To fix these problems, use the dd utility instead of cp or + tar. When you use dd, make sure you specify a block size that is + equal to, or an even multiple of, your database page size. Finally, if you plan to use a system + utility to copy database files, you may want to use a system call trace utility (for example, + ktrace or truss) to make sure you are not using a I/O size that is + smaller than your database page size. You can also use these utilities to make sure the system utility is + not using a system call other than read(). +

    +
    +
    +
    +
    +
    +

    Offline Backups

    +
    +
    +
    +
    +

    + To create an offline backup: +

    +
    +
      +
    1. +

      + Commit or abort all on-going transactions. +

      +
    2. +
    3. +

      + Pause all database writes. +

      +
    4. +
    5. +

      + Force a checkpoint. See + Checkpoints + for details. +

      +
    6. +
    7. +

      + Copy all your database files to the backup location. + + Note that you can simply copy all of the database + files, or you can determine which database files + have been written during the lifetime of the current + logs. To do this, use either the + + + Environment.getArchiveDatabases(), + method + + + or use the db_archive + command with the -s option. + +

      +

      + However, be aware that backing up just the modified databases only works if you have all of your + log files. If you have been removing log files for any reason then using + + + getArchiveDatabases(), + + + can result in an + unrecoverable backup because you might not be notified of a database file that was modified. +

      +
    8. +
    9. +

      + Copy the last log file to your backup location. + Your log files are named + log.xxxxxxxxxx, + where xxxxxxxxxx is a + sequential number. The last log file is the file + with the highest number. +

      +
    10. +
    +
    +
    +
    +
    +
    +
    +

    Hot Backup

    +
    +
    +
    +
    +

    + To create a hot backup, you do not have to stop database + operations. Transactions may be on-going and you can be writing + to your database at the time of the backup. However, this means + that you do not know exactly what the state of your database is + at the time of the backup. +

    +

    + You can use the db_hotbackup command line utility to create a hot backup for you. This + utility will (optionally) run a checkpoint and the copy all necessary files to a target directory. +

    +

    + Alternatively, you can manually create a hot backup as follows: +

    +
    +
      +
    1. +

      + Copy all your database files to the backup location. + + Note that you can simply copy all of the database + files, or you can determine which database files + have been written during the lifetime of the current + logs. To do this, use either the + + + Environment.getArchiveDatabases(), + + + or use the db_archive + command with the -s option. + +

      +
    2. +
    3. +

      + Copy all logs to your backup location. +

      +
    4. +
    +
    +
    +

    Note

    +

    + It is important to copy your database files and + then your logs. In this way, + you can complete or roll back any database operations that were only partially completed + when you copied the databases. +

    +
    +
    +
    +
    +
    +
    +

    Incremental Backups

    +
    +
    +
    +
    +

    + Once you have created a full backup (that is, either a + offline or hot backup), you can create incremental backups. + To do this, simply copy all of your currently existing log + files to your backup location. +

    +

    + Incremental backups do not require you to run a checkpoint + or to cease database write operations. +

    +

    + When you are working with incremental backups, remember + that the greater the number of log files contained in + your backup, the longer recovery will take. + You should run full backups + on some interval, and then do incremental backups on a shorter interval. + How frequently you need to run a full backup + is determined by the rate at which your databases change and + how sensitive your application is to lengthy recoveries + (should one be required). +

    +

    + You can also shorten recovery time by running recovery against the backup as you take each incremental + backup. Running recovery as you go means that there will be less work for DB to do if you should + ever need to restore your environment from the backup. +

    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/blocking_deadlocks.html b/db/docs/gsg_txn/JAVA/blocking_deadlocks.html new file mode 100644 index 000000000..4677860bd --- /dev/null +++ b/db/docs/gsg_txn/JAVA/blocking_deadlocks.html @@ -0,0 +1,674 @@ + + + + + + Locks, Blocks, and Deadlocks + + + + + + + + + +
    +
    +
    +
    +

    Locks, Blocks, and Deadlocks

    +
    +
    +
    +
    +

    + It is important to understand how locking works in a + concurrent application before continuing with a description of + the concurrency mechanisms DB makes available to you. + Blocking and deadlocking have important performance implications + for your application. Consequently, this section provides a + fundamental description of these concepts, and how they affect + DB operations. +

    +
    +
    +
    +
    +

    Locks

    +
    +
    +
    +
    +

    + When one thread of control wants to obtain access to an + object, it requests a lock for that + object. This lock is what allows DB to provide your + application with its transactional isolation guarantees by + ensuring that: +

    +
    +
      +
    • +

      + no other thread of control can read that object (in + the case of an exclusive lock), and +

      +
    • +
    • +

      + no other thread of control can modify that object + (in the case of an exclusive or non-exclusive lock). +

      +
    • +
    +
    +
    +
    +
    +
    +

    Lock Resources

    +
    +
    +
    +
    +

    + When locking occurs, there are conceptually three resources + in use: +

    +
    +
      +
    1. +

      + The locker. +

      +

      + This is the thing that holds the lock. In a + transactional application, the locker is a + transaction handle. + + For non-transactional operations, the locker is a cursor or a + + + Database + + handle. + + +

      +
    2. +
    3. +

      + The lock. +

      +

      + This is the actual data structure that locks + the object. In DB, a locked + object structure in the lock manager + is representative of the object that + is locked. +

      +
    4. +
    5. +

      + The locked object. +

      +

      + The thing that your application + actually wants to lock. + In a DB + application, the locked object is usually a + + database page, which in turn contains + multiple database entries (key and data). + + However, for Queue databases, + individual database records are locked. + + + + +

      +
    6. +
    +
    +

    + You can configure how many total lockers, locks, + and locked objects your + application is allowed to support. See + Configuring the Locking Subsystem + for details. +

    +

    + The following figure shows a transaction handle, + Txn A, that is holding a lock on + database + page + + 002. In this graphic, Txn + A is the locker, and the locked object is + page + + 002. Only a single lock is in use + in this operation. +

    +
    + +
    +
    +
    +
    +
    +
    +

    Types of Locks

    +
    +
    +
    +
    +

    + DB applications support both exclusive and + non-exclusive locks. Exclusive + locks are granted when a + locker wants to write to an object. For this reason, + exclusive locks are also sometimes called + write locks. +

    +

    + An exclusive lock prevents any other locker from + obtaining any sort of a lock on the object. This + provides isolation by ensuring that no other locker can + observe or modify an exclusively locked object until the locker is done + writing to that object. +

    +

    + Non-exclusive locks are granted + for read-only access. For this reason, non-exclusive + locks are also sometimes called read + locks. Since multiple lockers can + simultaneously hold read locks on the same + object, read locks are also + sometimes called shared locks. +

    +

    + A non-exclusive lock prevents any other locker from + modifying the locked object while the locker is still + reading the object. This is how transactional cursors are able to + achieve repeatable reads; by default, the + cursor's transaction holds + a read lock on any object that the cursor has examined until + such a time as the transaction is committed + or aborted. + + You can avoid these read locks by using + snapshot isolation. See Using Snapshot Isolation + for details. + +

    +

    + In the following figure, Txn A and + Txn B are both holding read locks on + page + + 002, while Txn C + is holding a write lock on + page + + 003: +

    +
    + +
    +
    +
    +
    +
    +
    +

    Lock Lifetime

    +
    +
    +
    +
    +

    + A locker holds its locks until such a time as it does + not need the lock any more. What this means is: +

    +
    +
      +
    1. +

      + A transaction holds any locks that it obtains + until the transaction is committed or aborted. +

      +
    2. +
    3. +

      + All non-transaction operations hold locks + until such a time as the operation is completed. + For cursor operations, the lock is held until the cursor is moved to a new position or + closed. +

      +
    4. +
    +
    +
    +
    +
    +
    +
    +
    +

    Blocks

    +
    +
    +
    +
    +

    + Simply put, a thread of control is blocked when it attempts + to obtain a lock, but that attempt is denied because some + other thread of control holds a conflicting lock. + Once blocked, the thread of control is temporarily unable + to make any forward progress until the requested lock is + obtained or the operation requesting the lock is + abandoned. +

    +

    + Be aware that when we talk about blocking, strictly + speaking the thread is not what is attempting to obtain the + lock. Rather, some object within the thread (such as a + cursor) is attempting to obtain the + lock. However, once a locker attempts to + obtain a lock, the entire thread of control must pause until the lock + request is in some way resolved. +

    +

    + For example, if Txn A holds a write lock (an exclusive + lock) on + object + + 002, then if Txn B tries to obtain a read or write lock on + that + object, + + the thread of control in which Txn + B is running + is blocked: +

    +
    + +
    +

    + However, if Txn A only holds a read + lock (a shared lock) on + object + + 002, then only those handles that attempt to obtain a + write lock on that + object + + will block. +

    +
    + +
    +
    +

    Note

    +

    + The previous description describes DB's default + behavior when it cannot obtain a lock. It is + possible to configure DB transactions so that + they will not block. Instead, if a lock is + unavailable, the application is immediately notified of a + deadlock situation. See No Wait on Blocks + for more information. +

    +
    +
    +
    +
    +
    +

    Blocking and Application Performance

    +
    +
    +
    +
    +

    + Multi-threaded + + and multi-process + + applications typically perform better than simple + single-threaded applications because the + application can perform one part of its workload + (updating + a database record, + + for example) while it is waiting for some other + lengthy operation to complete (performing disk or + network I/O, for example). This performance + improvement is particularly noticeable if you use + hardware that offers multiple CPUs, because the threads + + and processes + + can run simultaneously. +

    +

    + That said, concurrent applications can see reduced + workload throughput if their threads of control are + seeing a large amount of lock contention. That is, + if threads are blocking on lock requests, then that + represents a performance penalty for your + application. +

    +

    + Consider once again the previous diagram of a blocked write lock request. + In that diagram, Txn C cannot + obtain its requested write lock because + Txn A and Txn + B are both already holding read locks on + the requested + object. + + In this case, the thread in which + Txn C is running will pause until + such a time as Txn C either + obtains its write lock, or the operation + that is requesting the lock is abandoned. + The fact that Txn + C's thread has temporarily halted all + forward progress represents a performance penalty + for your application. +

    +

    + Moreover, any read locks that are requested while + Txn C is waiting for its write + lock will also block until such a time as + Txn C has obtained and + subsequently released its write lock. +

    +
    +
    +
    +
    +
    +

    Avoiding Blocks

    +
    +
    +
    +
    +

    + Reducing lock contention is an important part of + performance tuning your concurrent DB + application. Applications that have multiple + threads of control obtaining exclusive (write) + locks are prone to contention issues. Moreover, as + you increase the numbers of lockers and as you + increase the time that a lock is held, you increase + the chances of your application seeing lock contention. +

    +

    + As you are designing your application, try to do + the following in order to reduce lock contention: +

    +
    +
      +
    • +

      + Reduce the length of time your application + holds locks. +

      +

      + Shorter lived transactions will result in + shorter lock lifetimes, which will in turn + help to reduce lock contention. +

      +

      + In addition, by default transactional cursors hold read + locks until such a time as the transaction is completed. + For this reason, try to + minimize the time you keep + transactional cursors + opened, or reduce your isolation + levels – see below. +

      +
    • +
    • +

      + If possible, access heavily accessed (read + or write) items toward the end of the + transaction. This reduces the amount of + time that a heavily used + + page + + + is locked by the transaction. +

      +
    • +
    • +

      + Reduce your application's isolation + guarantees. +

      +

      + By reducing your isolation guarantees, you + reduce the situations in which a lock can + block another lock. Try using uncommitted reads + for your read operations in order to + prevent a read lock being blocked by a + write lock. +

      +

      + In addition, for cursors you can use degree + 2 (read committed) isolation, which causes + the cursor to release its read locks as + soon as it is done reading the record (as + opposed to holding its read locks until the + transaction ends). +

      +

      + Be aware that reducing your + isolation guarantees can have + adverse consequences for your + application. Before deciding + to reduce your isolation, take + care to examine your + application's isolation + requirements. + For information on isolation + levels, see + Isolation. +

      +
    • +
    • +

      + Consider your data access patterns. +

      +

      + Depending on the nature of your application, + this may be something that you can not + do anything about. However, if it is + possible to create your threads such that + they operate only on non-overlapping + portions of your database, then you can + reduce lock contention because your + threads will rarely (if ever) block on one another's + locks. +

      +
    • +
    +
    +
    +

    Note

    +

    + It is possible to configure DB's transactions + so that they never wait on blocked lock requests. + Instead, if they are blocked on a lock request, + they will notify the application of a deadlock (see + the next section). +

    +

    + You configure this behavior on a transaction by + transaction basis. See No Wait on Blocks for more information. +

    +
    +
    +
    +
    +
    +
    +
    +

    Deadlocks

    +
    +
    +
    +
    +

    + A deadlock occurs when two or more threads of control are + blocked, each waiting on a resource held by the other + thread. When this happens, there is no + possibility of the threads ever making forward progress + unless some outside agent takes action to break the + deadlock. +

    +

    + For example, if + Txn A is + blocked by Txn B at the same time + Txn B is blocked by Txn + A then the threads of control containing + Txn A and Txn B are + deadlocked; neither thread can make + any forward progress because neither thread will ever release the lock + that is blocking the other thread. +

    +
    + +
    +

    + When two threads of control deadlock, the only + solution is to have a mechanism external to the two threads + capable of recognizing the deadlock and notifying at least + one thread that it is in a deadlock situation. + Once notified, a thread of + control must abandon the attempted operation in order to + resolve the deadlock. + + + DB's locking subsystem offers a deadlock notification + mechanism. See + Configuring Deadlock Detection + for more information. + + + +

    +

    + Note that when one locker in a thread of control is blocked + waiting on a lock held by another locker in that same + thread of the control, the thread is said to be + self-deadlocked. +

    +
    +
    +
    +
    +

    Deadlock Avoidance

    +
    +
    +
    +
    +

    + The things that you do to avoid lock contention also + help to reduce deadlocks (see Avoiding Blocks). + + + Beyond that, you can also do the following in order to + avoid deadlocks: + + + +

    +
    +
      +
    • +

      + Make sure all threads access data in the same + order as all other threads. So long as threads + lock database pages + in the same basic order, there is no + possibility of a deadlock (threads can still + block, however). +

      +

      + Be aware that if you are using secondary databases (indices), it is not possible to obtain + locks in a consistent order because you cannot predict the order in which locks are obtained + in secondary databases. If you are writing a concurrent application and you are using + secondary databases, you must be prepared to handle deadlocks. +

      +
    • +
    • +

      + If you are using BTrees in which you are + constantly adding and then deleting data, turn + Btree reverse split off. See + Reverse BTree Splits + for more information. +

      +
    • +
    • +

      + Declare a read/modify/write lock for those + situations where you are reading a record in + preparation of modifying and then writing the + record. Doing this causes DB to give your + read operation a write lock. This means that no + other thread of control can share a read lock + (which might cause contention), but it also + means that the writer thread will not have to + wait to obtain a write lock when it is ready to + write the modified data back to the database. +

      +

      + For information on declaring + read/modify/write locks, see + Read/Modify/Write. +

      +
    • +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/deadlock.jpg b/db/docs/gsg_txn/JAVA/deadlock.jpg new file mode 100644 index 000000000..0995a84d8 Binary files /dev/null and b/db/docs/gsg_txn/JAVA/deadlock.jpg differ diff --git a/db/docs/gsg_txn/JAVA/enabletxn.html b/db/docs/gsg_txn/JAVA/enabletxn.html new file mode 100644 index 000000000..77ed3f571 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/enabletxn.html @@ -0,0 +1,875 @@ + + + + + + Chapter 2. Enabling Transactions + + + + + + + + + +
    +
    +
    +
    +

    Chapter 2. Enabling Transactions

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Environments + +
    +
    +
    +
    + + File Naming + +
    +
    + + Error Support + +
    +
    + + Shared Memory Regions + +
    +
    + + Security Considerations + +
    +
    +
    +
    + + Opening a Transactional Environment and + Database + + + +
    +
    +
    +

    + In order to use transactions with your application, you must turn them + on. To do this you must: +

    +
    +
      +
    • +

      + Use an + environment (see Environments for details). +

      +
    • +
    • +

      + Turn on transactions for your environment. + + + You do this by using the + EnvironmentConfig.setTransactional() + method. + + + + + + Note that initializing the transactional subsystem implies that + the logging subsystem is also initialized. Also, note that + if you do not initialize transactions when you first create + your environment, then you cannot use transactions for that + environment after that. This is because DB + allocates certain structures needed for transactional + locking that are not available if the environment is + created without transactional support. + +

      +
    • +
    • +

      + Initialize the in-memory cache by + + + + passing true to the + EnvironmentConfig.setInitializeCache() + method. + +

      +
    • +
    • +

      + Initialize the locking subsystem. This is what provides locking for concurrent applications. It also is used + to perform deadlock detection. See Concurrency + for more information. +

      +

      + You initialize the locking subsystem by + + + + passing true to the + EnvironmentConfig.setInitializeLocking() + method. + +

      +
    • +
    • +

      + Transaction-enable your databases. You do this by + + using the + DatabaseConfig.setTransactional() + method, and then opening the database from within a transaction. + + + + + + + + Note that the common practice is for auto commit to be used to + transaction-protect the database open. To use auto-commit, you + must still enable transactions as described here, but you do + not have to explicitly use a transaction when you open your + database. An example of this is given in the next section. + +

      +
    • +
    +
    +
    +
    +
    +
    +

    Environments

    +
    +
    +
    +
    +

    + For simple DB applications, environments are optional. However, in + order to transaction protect your database operations, you must use an + environment. +

    +

    + An environment, represents an + encapsulation of one or more databases and any associated log and + region files. They are used to support multi-threaded + and multi-process applications by allowing different threads of + control to share the in-memory cache, the locking tables, the + logging subsystem, and the file namespace. By sharing these things, + your concurrent application is more efficient than if each thread + of control had to manage these resources on its own. +

    +

    + By default all DB databases are backed by files on disk. In + addition to these files, transactional DB applications create + logs that are also by default stored on disk (they can optionally + be backed using shared memory). Finally, transactional + DB applications also create and use shared-memory regions that + are also typically backed by the filesystem. But like databases and + logs, the regions can be maintained strictly in-memory if your + application requires it. For an example of an application that + manages all environment files in-memory, see + + In-Memory Transaction Example. + +

    +
    +
    +
    +
    +

    File Naming

    +
    +
    +
    +
    +

    + In order to operate, your DB application must be able to + locate its database files, log files, and region files. If these + are stored in the filesystem, then you must tell DB where + they are located (a number of mechanisms exist that allow you to + identify the location of these files – see below). Otherwise, + by default they are located in the current working directory. +

    +
    +
    +
    +
    +

    Specifying the Environment Home Directory

    +
    +
    +
    +
    +

    + The environment home directory is used to determine where + DB files are located. Its location + is identified using one of the following mechanisms, in the + following order of priority: +

    +
    +
      +
    • +

      + If no information is given as to where to put the + environment home, then the current working + directory is used. +

      +
    • +
    • +

      + If a home directory is specified on the + + + Environment() + + constructor, + then that location is always used for the environment + home. +

      +
    • +
    • +

      + If a home directory is not supplied to + + + Environment(), + then the directory identified by the DB_HOME environment variable + is used if you specify + + + + true to either the + EnvironmentConfig.setUseEnvironment() + or + EnvironmentConfig.setUseEnvironmentRoot() + method. Both methods allow you to identify the + path to the environment's home directory + using DB_HOME. However, + EnvironmentConfig.setUseEnvironmentRoot() + is honored only if the process is run with root or administrative privileges. + +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    Specifying File Locations

    +
    +
    +
    +
    +

    + By default, all DB files are created relative to the environment + home directory. For example, suppose your environment home is in + /export/myAppHome. Also suppose you name your database + data/myDatabase.db. + + Then in this case, the database is placed in: + /export/myAppHome/data/myDatabase.db. + +

    +

    + That said, DB always defers to absolute pathnames. + This means that if you provide an absolute filename when you + name your database, then that file is not + placed relative to the environment home directory. Instead, it + is placed in the exact location that you specified for the + filename. +

    +

    + On UNIX systems, an absolute pathname is a name that begins with a + forward slash ('/'). On Windows systems, an absolute pathname is a + name that begins with one of the following: +

    +
    +
      +
    • +

      + A backslash ('\'). +

      +
    • +
    • +

      + Any alphabetic letter, followed by a colon (':'), followed + by a backslash ('\'). +

      +
    • +
    +
    +
    +

    Note

    +

    + Try not to use absolute path names for your + environment's files. Under certain recovery scenarios, absolute path names can + render your environment unrecoverable. This occurs if you are attempting to recover + you environment on a system that does not support the absolute path name that you used. +

    +
    +
    +
    +
    +
    +
    +

    Identifying Specific File Locations

    +
    +
    +
    +
    +

    + As described in the previous sections, DB will place all its + files in or relative to the environment home directory. + You can also cause a + specific database file to be placed in a particular location by + using an absolute path name for its name. In this + situation, the environment's home directory is not + considered when naming the file. +

    +

    + It is frequently desirable to place database, log, and region files on separate + disk drives. By spreading I/O across multiple drives, you + can increase parallelism and improve throughput. + Additionally, by placing log files and database files on + separate drives, you improve your application's + reliability by providing your application with a greater + chance of surviving a disk failure. +

    +

    + You can cause DB's files to be placed in specific + locations using the following mechanisms: +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    File TypeTo Override
    database files +

    + You can cause database files to be created + in a directory other than the + environment home by using the + + + EnvironmentConfig.addDataDir() + method. + The directory identified + here must exist. If a relative path is + provided, then the directory location is + resolved relative to the environment's home + directory. +

    +

    + This method modifies the directory + used for database files created and managed by + a single environment handle; it does not + configure the entire environment. + +

    +

    + You can also set a default data location that is used by + the entire environment by using the + set_data_dir parameter + in the environment's DB_CONFIG file. + Note that the set_data_dir + parameter overrides any value set by the + + + EnvironmentConfig.addDataDir() + method. +

    +
    Log files +

    + You can cause log files to be created + in a directory other than the environment home + directory by using the + + + EnvironmentConfig.LogDirectory() + method. The directory identified + here must exist. If a relative path is + provided, then the directory location is + resolved relative to the environment's home + directory. +

    +

    + This method modifies the directory + used for database files created and managed by + a single environment handle; it does not + configure the entire environment. + +

    +

    + You can also set a default log file location that is used by + the entire environment by using the + set_lg_dir parameter + in the environment's DB_CONFIG file. + Note that the set_lg_dir + parameter overrides any value set by the + + + EnvironmentConfig.LogDirectory() + method. +

    +
    Region files + If backed by the filesystem, region + files are always placed in the environment home + directory. +
    +
    +

    + Note that the DB_CONFIG must reside in the + environment home directory. Parameters are specified in it one + parameter to a line. Each parameter is followed by a space, + which is followed by the parameter value. For example: +

    +
        set_data_dir /export1/db/env_data_files 
    +
    +
    +
    +
    +
    +
    +

    Error Support

    +
    +
    +
    +
    +

    + To simplify error handling and to aid in application debugging, environments offer several useful + methods. + + Note that many of these + methods are identical to the error handling methods available for the + + + DatabaseConfig + + class. + + + + They are: +

    +
    +
      +
    • +

      + + EnvironmentConfig.setErrorStream() +

      +

      + Sets the + + Java OutputStream + to be used for displaying error messages issued by the DB library. +

      +
    • +
    • +

      + + EnvironmentConfig.setErrorHandler() +

      +

      + Defines the message handler that is called when an error message is + issued by DB. The error prefix and message are passed to + this callback. It is up to the application to display this + information correctly. +

      +

      + Note that the message handler must be an implementation of the + com.sleepycat.db.ErrorHandler + interface. +

      +
    • +
    • +

      + + EnvironmentConfig.setErrorPrefix() +

      +

      + Sets the prefix used to for any error messages issued by the + DB library. +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    Shared Memory Regions

    +
    +
    +
    +
    +

    + The subsystems that you enable for an environment (in our case, + transaction, logging, locking, and the memory pool) + are described by one or more regions. The regions contain all of the + state information that needs to be shared among threads and/or + processes using the environment. +

    +

    + Regions may be backed by the file system, by heap memory, or by + system shared memory. +

    +
    +

    Note

    +

    + When DB dynamically obtains memory, it uses memory outside of the JVM. Normally the amount of memory + that DB obtains is trivial, a few bytes here and there, so you might not notice it. However, if + heap or system memory is used to back your region files, then this can represent a significant amount of + memory being used by DB above and beyond the memory required by the JCM process. As a result, the + JVM process may appear to be using more memory than you told the process it could use. +

    +
    +
    +
    +
    +
    +

    Regions Backed by Files

    +
    +
    +
    +
    +

    + By default, shared memory regions are created as files in the environment's + home directory (not the environment's data + directory). If it is available, the POSIX mmap + interface is used to map these files into your application's + address space. If mmap + is not available, then the UNIX shmget interfaces + are used instead (again, if they are available). +

    +

    + In this default case, the region files are named + __db.### + (for example, __db.001, __db.002, + and so on). +

    +
    +
    +
    +
    +
    +

    Regions Backed by Heap Memory

    +
    +
    +
    +
    +

    + If heap memory is used to back your shared memory regions, + the environment may only be + accessed by a single process, although that process may be + multi-threaded. In this case, the regions are managed only in + memory, and they are not written to the filesystem. You + indicate that heap memory is to be used for the region files by + specifying + + + + true to the + EnvironmentConfig.setPrivate() + method. + + +

    +

    + (For an example of an entirely in-memory transactional + application, see + + + In-Memory Transaction Example.) + + +

    +
    +
    +
    +
    +
    +

    Regions Backed by System Memory

    +
    +
    +
    +
    +

    + Finally, you can cause system memory to be used for your + regions instead of memory-mapped files. You do this by providing + + + + true to the + EnvironmentConfig.setSystemMemory() + method. + +

    +

    + When region files are backed by system memory, DB creates a + single file in the environment's home directory. This file + contains information necessary to identify the system shared + memory in use by the environment. By creating this file, DB + enables multiple processes to share the environment. +

    +

    + The system memory that is used is architecture-dependent. For + example, on systems supporting X/Open-style shared memory + interfaces, such as UNIX systems, the shmget(2) + and related System V IPC interfaces are used. + + + + Additionally, VxWorks systems use system memory. In these cases, + an initial segment ID must be specified by the application to + ensure that applications do not overwrite each other's + environments, so that the number of segments created does not + grow without bounds. See the + + + + EnvironmentConfig.setSegmentId() + method for more information. + +

    +

    + On Windows platforms, the use of system memory for the region files + is problematic because the operating system uses reference counting + to clean up shared objects in the paging file automatically. In + addition, the default access permissions for shared objects are + different from files, which may cause problems when an environment + is accessed by multiple processes running as different users. See + Windows notes + or more information. +

    +
    +
    +
    +
    +
    +
    +

    Security Considerations

    +
    +
    +
    +
    +

    + When using environments, there are some security considerations to + keep in mind: +

    +
    +
      +
    • +

      + Database environment permissions +

      +

      + The directory used for the environment + should have its permissions set to ensure that files in the + environment are not accessible to users without appropriate + permissions. Applications that add to the user's permissions + (for example, UNIX setuid or + setgid applications), must be + carefully checked to not permit illegal use of those + permissions such as general file access in the environment + directory. +

      +
    • +
    • +

      + Environment variables +

      +

      + Setting + + + + true for EnvironmentConfig.setUseEnvironment() + or + EnvironmentConfig.setUseEnvironmentRoot() + + + so that environment variables can be used during file naming + can be dangerous. Setting those flags in DB + applications with additional permissions (for example, UNIX + setuid or setgid + applications) could potentially allow users + to read and write databases to which they would not normally + have access. +

      +

      + For example, suppose you write a DB application + that runs setuid. This means that + when the application runs, it does so under a + userid different than that of the application's caller. + This is especially problematic if the application is + granting stronger privileges to a user than the user + might ordinarily have. +

      +

      + Now, if + + + true is specified + for EnvironmentConfig.setUseEnvironment() + or + EnvironmentConfig.setUseEnvironmentRoot(), + + + + then the environment that the application is + using is modifiable using the + DB_HOME environment variable. In + this scenario, if the uid used by the application has + sufficiently broad privileges, then the application's caller + can read and/or write databases owned by another user + simply by setting his + DB_HOME environment variable to the + environment used by that other user. +

      +

      + Note that this scenario need not be malicious; the + wrong environment could be used by the application + simply by inadvertently specifying the wrong path to + DB_HOME. +

      +

      + As always, you should use setuid + sparingly, if at all. But if you do use + setuid, then you should refrain from + specifying + + + true for EnvironmentConfig.setUseEnvironment() + or + EnvironmentConfig.setUseEnvironmentRoot() + + for the environment open. And, of course, if you must + use setuid, then make sure you use + the weakest uid possible – preferably one that is + used only by the application itself. +

      +
    • +
    • +

      + File permissions +

      +

      + By default, DB always creates database and log files readable and + writable by the owner and the group (that is, + S_IRUSR, + S_IWUSR, S_IRGRP and + S_IWGRP; or octal mode 0660 on historic + UNIX systems). The group ownership of created files is based + on the system and directory defaults, and is not further + specified by DB. +

      +
    • +
    • +

      + Temporary backing files +

      +

      + If an unnamed database is created and the cache is too small + to hold the database in memory, Berkeley DB will create a + temporary physical file to enable it to page the database to + disk as needed. In this case, environment variables such as + TMPDIR may be used to specify the + location of that temporary file. Although temporary backing + files are created readable and writable by the owner only + (S_IRUSR and S_IWUSR, + or octal mode 0600 on historic UNIX systems), some + filesystems may not sufficiently protect temporary files + created in random directories from improper access. To be + absolutely safe, applications storing sensitive data in + unnamed databases should use the + + + EnvironmentConfig.setTemporaryDirectory() + method to specify a temporary directory with known permissions. +

      +
    • +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/envopen.html b/db/docs/gsg_txn/JAVA/envopen.html new file mode 100644 index 000000000..1e207c1f7 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/envopen.html @@ -0,0 +1,159 @@ + + + + + + Opening a Transactional Environment and + Database + + + + + + + + + + + +
    +
    +
    +
    +

    Opening a Transactional Environment and + Database + +

    +
    +
    +
    +
    +

    + To enable transactions for your environment, you must initialize the + transactional subsystem. Note that doing this also initializes the + logging subsystem. In addition, you must initialize the memory pool + (in-memory cache). Frequently, but not always, you will also + initialize the locking subsystem. For example: +

    +
    package db.txn;
    +                                                                                                                                     
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +    myEnvConfig.setTransactional(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} catch (FileNotFoundException fnfe) {
    +     // Exception handling goes here
    +}
    +

    + You then can use the Environment handle to open + your database(s) using Environment.openDatabase(). + Note that when you do this, you must set + DatabaseConfig.setTransactional() + to true. Note that in effect this causes the + database open to be transactional protected because it results in + auto commit being used for the open (if a transaction is not explicitly + used to protect the open). + For example: +

    +
    package db.txn;
    +                                                                                                                                     
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseType;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +    myEnvConfig.setTransactional(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // Open the database.
    +    DatabaseConfig dbConfig = new DatabaseConfig();
    +    dbConfig.setTransactional(true);
    +    dbConfig.setType(DatabaseType.BTREE);
    +    myDatabase = myEnv.openDatabase(null,               // txn handle
    +                                    "sampleDatabase",   // db file name
    +                                    null,             // db name
    +                                    dbConfig);
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} catch (FileNotFoundException fnfe) {
    +    // Exception handling goes here
    +}
    +
    +

    Note

    +

    + Never close a database that has active transactions. Make sure + all transactions are resolved (either committed or aborted) + before closing the database. +

    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/filemanagement.html b/db/docs/gsg_txn/JAVA/filemanagement.html new file mode 100644 index 000000000..ab748bffa --- /dev/null +++ b/db/docs/gsg_txn/JAVA/filemanagement.html @@ -0,0 +1,484 @@ + + + + + + Chapter 5. Managing DB Files + + + + + + + + + +
    +
    +
    +
    +

    Chapter 5. Managing DB Files

    +
    +
    +
    +
    + +

    + DB is capable of storing several types of files on disk: +

    +
    +
      +
    • +

      + Data files, which contain the actual data in your database. +

      +
    • +
    • +

      + Log files, which contain information required to recover your + database in the event of a system or application failure. +

      +
    • +
    • +

      + Region files, which contain information necessary for the + overall operation of your application. +

      +
    • +
    • +

      + Temporary files, which are created only under certain special circumstances. These files never need to + be backed up or otherwise managed and so they are not a consideration for the topics described in this + chapter. See Security Considerations + for more information on temporary files. +

      +
    • +
    +
    +

    + Of these, you must manage your data and log files by ensuring that they + are backed up. You should also pay attention to the amount of disk space + your log files are consuming, and periodically remove any unneeded + files. Finally, you can optionally tune your logging subsystem to best + suit your application's needs and requirements. + These topics are discussed in this chapter. +

    +
    +
    +
    +
    +

    Checkpoints

    +
    +
    +
    +
    +

    + Before we can discuss DB file management, we need to + describe checkpoints. When databases are modified (that is, a + transaction is committed), the modifications are recorded in + DB's logs, but they are not + necessarily reflected in the actual database files on disk. +

    +

    + This means that as time goes on, increasingly + more data is contained in your log files that is not + contained in your data files. As a result, you must keep more + log files around than you might actually need. Also, any + recovery run from your log files will take increasingly longer + amounts of time, because there is more data in the log files + that must be reflected back into the data files during the + recovery process. +

    +

    + You can reduce these problems by periodically + running a checkpoint against your environment. The checkpoint: +

    +
    +
      +
    • +

      + Flushes dirty pages from the in-memory cache. This means that data modifications found in your + in-memory cache are written to the database files on disk. Note that a checkpoint also causes data + dirtied by an uncommitted transaction to also be written to your database files on disk. In this latter + case, DB's normal recovery is used to remove any such modifications that were subsequently + abandoned by your application using a transaction abort. +

      +

      + Normal recovery is describe in Recovery Procedures. +

      +
    • +
    • +

      + Writes a checkpoint record. +

      +
    • +
    • +

      + Flushes the log. This causes all log data that has not yet been written to disk to be written. +

      +
    • +
    • +

      + Writes a list of open databases. +

      +
    • +
    +
    +

    + There are several ways to run a checkpoint. One way is to use + the db_checkpoint command line utility. (Note, however, that this command line utility + cannot be used if your environment was opened using + + + EnvironmentConfig.setPrivate().) + +

    +

    + You can also run a thread that periodically checkpoints your + environment for you by calling the + + + Environment.checkpoint() + method. +

    +

    + Note that you can prevent a checkpoint from occurring unless more + than a specified amount of log data has been written since the + last checkpoint. You can also prevent the checkpoint from + running unless more than a specified amount of time has + occurred since the last checkpoint. These conditions are + particularly interesting if you have multiple threads + or processes + running checkpoints. +

    +

    + For configuration information, see the + + + + CheckpointConfig Javadoc page. + +

    +

    + Note that running checkpoints can be quite expensive. DB must + flush every dirty page to the backing database files. On the + other hand, if you do not run checkpoints often enough, your + recovery time can be unnecessarily long and you may be using more + disk space than you really need. Also, you cannot remove log files + until a checkpoint is run. Therefore, deciding how frequently + to run a checkpoint is one of the most + common tuning activity for DB applications. +

    +

    + For example, the following class performs a checkpoint every 60 seconds, so long as 500 kb of logging data has been + written since the last checkpoint: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.CheckpointConfig;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +
    +public class CheckPointer extends Thread
    +{
    +    private CheckpointConfig cpc = new CheckpointConfig();
    +    private Environment myEnv = null;
    +    private static boolean canRun = true;
    +
    +
    +    // Constructor.
    +    CheckPointer(Environment env) {
    +        myEnv = env;
    +        // Run a checkpoint only if 500 kbytes of log data has been 
    +        // written.
    +        cpc.setKBytes(500);
    +    }
    +
    +    // Thread method that performs a checkpoint every
    +    // 60 seconds
    +    public void run () {
    +        while (canRun) {
    +            try {
    +                myEnv.checkpoint(cpc);
    +                sleep(60000);
    +            } catch (DatabaseException de) {
    +                System.err.println("Checkpoint error: " +
    +                    de.toString());
    +            } catch (InterruptedException e) {
    +                // Should never get here
    +                System.err.println("got interrupted exception");
    +            }
    +        }
    +    }
    +
    +   public static void stopRunning() {
    +        canRun = false;
    +   }
    +} 
    +

    + And you use this class as follows. Note that we add the call to shutdown the checkpoint thread in our application's + shutdown code: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +
    +
    +public class TryCheckPoint {
    +
    +    private static String myEnvPath = "./";
    +
    +    private static Environment myEnv = null;
    +
    +
    +    private static void usage() {
    +        System.out.println("TxnGuide [-h <env directory>]");
    +        System.exit(-1);
    +    }
    +
    +    public static void main(String args[]) {
    +        try {
    +            // Parse the arguments list
    +            parseArgs(args);
    +            // Open the environment and databases
    +            openEnv();
    +
    +            // Start the checkpoint thread
    +            CheckPointer cp = new CheckPointer(myEnv);
    +            cp.start();
    +
    +            //////////////////////////////////
    +            // Do database work here as normal
    +            //////////////////////////////////
    +
    +            // Once all database work is completed, stop the checkpoint
    +            // thread.
    +            CheckPointer.stopRunning();
    +
    +            // Join the checkpoint thread in case it needs some time to 
    +            // cleanly shutdown.
    +            cp.join();
    +
    +        } catch (Exception e) {
    +            System.err.println("TryCheckPoint: " + e.toString());
    +            e.printStackTrace();
    +        } finally {
    +            closeEnv();
    +        }
    +        System.out.println("All done.");
    +    }
    +
    +    // Open an environment and databases
    +    private static void openEnv() throws DatabaseException {
    +        System.out.println("opening env");
    +
    +        // Set up the environment.
    +        EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +        myEnvConfig.setAllowCreate(true);
    +        myEnvConfig.setInitializeCache(true);
    +        myEnvConfig.setInitializeLocking(true);
    +        myEnvConfig.setInitializeLogging(true);
    +        myEnvConfig.setTransactional(true);
    +        // EnvironmentConfig.setThreaded(true) is the default behavior 
    +        // in Java, so we do not have to do anything to cause the
    +        // environment handle to be free-threaded.
    +
    +        try {
    +            // Open the environment
    +            myEnv = new Environment(new File(myEnvPath),    // Env home
    +                                    myEnvConfig);
    +
    +            // Skipping the database opens and closes for brevity
    +
    +        } catch (FileNotFoundException fnfe) {
    +            System.err.println("openEnv: " + fnfe.toString());
    +            System.exit(-1);
    +        }
    +    }
    +
    +    // Close the environment and databases
    +    private static void closeEnv() {
    +        System.out.println("Closing env");
    +        if (myEnv != null ) {
    +            try {
    +                myEnv.close();
    +            } catch (DatabaseException e) {
    +                System.err.println("closeEnv: " + e.toString());
    +                e.printStackTrace();
    +            }
    +        }
    +    }
    +
    +    private TryCheckPoint() {}
    +
    +    private static void parseArgs(String args[]) {
    +        for(int i = 0; i < args.length; ++i) {
    +            if (args[i].startsWith("-")) {
    +                switch(args[i].charAt(1)) {
    +                    case 'h':
    +                        myEnvPath = new String(args[++i]);
    +                    break;
    +                    default:
    +                        usage();
    +                }
    +            }
    +        }
    +    }
    +} 
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/gettingStarted.css b/db/docs/gsg_txn/JAVA/gettingStarted.css new file mode 100644 index 000000000..c1b4c86b7 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/gettingStarted.css @@ -0,0 +1,41 @@ +body { width: 45em; + margin-left: 3em; + font-family: Arial, Helvetica, sans-serif; + font-size: 11pt; + } + +h2.title { margin-left: -1em; + font-family: Verdana, serif; + font-size: 16pt; + } + +h3.title { font-family: Verdana, serif; + font-size: 14pt; + } + +pre.programlisting { + font-family: monospace; + background-color: #eae8e9; +} + +div.navheader { font-size: 9pt; + width: 60em; + margin-left: -2em; + } + +div.navheader table tr td { font-size: 9pt; } + +div.navfooter { font-size: 9pt; + width: 60em; + margin-left: -2em; + } +div.navfooter table tr td { font-size: 9pt; } + +span.emphasis { font-style: italic; font-size: 9pt;} + +div.appendix div.informaltable { font-size: 9pt; } +div.appendix div.informaltable td { vertical-align: top; } +div.appendix div.informaltable p { margin-top: .25em; } +div.appendix div.informaltable p { margin-bottom: .25em; } + + diff --git a/db/docs/gsg_txn/JAVA/hotfailover.html b/db/docs/gsg_txn/JAVA/hotfailover.html new file mode 100644 index 000000000..fa3dcc152 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/hotfailover.html @@ -0,0 +1,210 @@ + + + + + + Using Hot Failovers + + + + + + + + + +
    +
    +
    +
    +

    Using Hot Failovers

    +
    +
    +
    +
    +

    + You can maintain a backup that can be used for failover purposes. + Hot failovers differ from the backup and restore + procedures described previously in this chapter in that data + used for traditional backups is typically copied to offline storage. + Recovery time for a traditional backup is determined by: +

    +
    +
      +
    • +

      + How quickly you can retrieve that storage media. + Typically storage media for critical backups is moved + to a safe facility in a remote location, so this step can + take a relatively long time. +

      +
    • +
    • +

      + How fast you can read the backup from the storage media + to a local disk drive. If you have very large backups, + or if your storage media is very slow, this can be a + lengthy process. +

      +
    • +
    • +

      + How long it takes you to run catastrophic recovery + against the newly restored backup. As described earlier + in this chapter, this process can be lengthy because + every log file must be examined during the recovery + process. +

      +
    • +
    +
    +

    + When you use a hot failover, the backup is maintained + at a location that is reasonably fast to access. Usually, this + is a second disk drive local to the machine. + In this situation, recovery time is very quick + because you only have to reopen your + environment and database, using the failover environment + for the environment open. +

    +

    + Hot failovers obviously do not protect you from truly + catastrophic disasters (such as a fire in your machine room) + because the backup is still local to the machine. However, + you can guard against more mundane problems (such as a broken + disk drive) by keeping the backup on a + second drive that is managed by an alternate disk controller. +

    +

    + To maintain a hot failover: +

    +
    +
      +
    1. +

      + Copy all the active database files to the failover + directory. Use the db_archive + command line utility with the + -s option to identify all the active + database files. +

      +
    2. +
    3. +

      + Identify all the inactive log files in your production + environment and move these to the failover + directory. Use the db_archive + command with no command line options to obtain a list + of these log files. +

      +
    4. +
    5. +

      + Identify the active log files in your production + environment, and copy these to the + failover directory. Use the + db_archive command with the + -l option to obtain a list of these + log files. +

      +
    6. +
    7. +

      + Run catastrophic recovery against the failover + directory. Use the db_recover + command with the -c option to do + this. +

      +
    8. +
    9. +

      + Optionally copy the backup to an archival location. +

      +
    10. +
    +
    +

    + Once you have performed this procedure, you can maintain an + active hot backup by repeating steps 2 - 5 as often + as is required by your application. +

    +
    +

    Note

    +

    + If you perform step 1, steps 2-5 must follow in order to + ensure consistency of your hot backup. +

    +
    +
    +

    Note

    +

    + Rather than use the previous procedure, you can use the db_hotbackup command line utility + to do the same thing. This utility will (optionally) run a checkpoint and then copy all necessary files to a target + directory for you. +

    +
    +

    + To actually perform a failover, simply: +

    +
    +
      +
    1. +

      + Shut down all processes which are running against the original environment. +

      +
    2. +
    3. +

      + If you have an archival copy of the backup environment, you can optionally try copying the remaining + log files from the original environment and running catastrophic recovery against that backup + environment. Do this only if you have a an archival copy of the backup + environment. +

      +

      + This step can allow you to recover data created or modified in the original environment, but which + did not have a chance to be reflected in the hot backup environment. +

      +
    4. +
    5. +

      + Reopen your environment and databases as normal, but use + the backup environment instead of the production + environment. +

      +
    6. +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/index.html b/db/docs/gsg_txn/JAVA/index.html new file mode 100644 index 000000000..e5d1857d4 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/index.html @@ -0,0 +1,549 @@ + + + + + + Getting Started with Berkeley DB Transaction Processing + + + + + + + +
    +
    +
    +
    +

    Getting Started with Berkeley DB Transaction Processing

    +
    +
    +
    +

    + Legal Notice +

    +

    + This documentation is distributed under an open source license. + You may review the terms of this license at: + http://www.oracle.com/technology/software/products/berkeley-db/htdocs/oslicensing.html + + +

    +

    + Oracle, Berkeley DB, + + + and + Sleepycat are trademarks or registered trademarks of + Oracle Corporation. All rights to these marks are reserved. + No third-party use is permitted without the + express prior written consent of Oracle Corporation. +

    +

    + Java™ and all Java-based marks are a trademark + or registered trademark of Sun Microsystems, + Inc, in the United States and other countries. +

    +

    + To obtain a copy of this document's original source code, please + submit a request to the Oracle Technology Network forum at: + http://forums.oracle.com/forums/forum.jspa?forumID=271 + + +

    +
    +
    +
    +

    9/20/2006

    +
    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Preface + +
    +
    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +
    + + 1. Introduction + +
    +
    +
    +
    + + Transaction Benefits + +
    +
    +
    +
    + + A Note on System Failure + +
    +
    + + Application Requirements + +
    +
    + + Multi-threaded + and Multi-process + Applications + +
    +
    +
    +
    + + Recoverability + +
    +
    + + Performance Tuning + +
    +
    +
    +
    + + 2. Enabling Transactions + +
    +
    +
    +
    + + Environments + +
    +
    +
    +
    + + File Naming + +
    +
    + + Error Support + +
    +
    + + Shared Memory Regions + +
    +
    + + Security Considerations + +
    +
    +
    +
    + + Opening a Transactional Environment and + Database + + + +
    +
    +
    +
    + + 3. Transaction Basics + +
    +
    +
    +
    + + Committing a Transaction + +
    +
    +
    +
    + + Non-Durable Transactions + +
    +
    +
    +
    + + Aborting a Transaction + +
    +
    + + Auto Commit + +
    +
    + + Nested Transactions + +
    +
    + + Transactional Cursors + +
    +
    + + Secondary Indices with Transaction Applications + +
    +
    + + Configuring the Transaction Subsystem + +
    +
    +
    +
    + + 4. Concurrency + +
    +
    +
    +
    + + Which DB Handles are Free-Threaded + +
    +
    + + Locks, Blocks, and Deadlocks + +
    +
    +
    +
    + + Locks + +
    +
    + + Blocks + +
    +
    + + Deadlocks + +
    +
    +
    +
    + + The Locking Subsystem + +
    +
    +
    +
    + + Configuring the Locking Subsystem + +
    +
    + + Configuring Deadlock Detection + +
    +
    + + Resolving Deadlocks + +
    +
    +
    +
    + + Isolation + +
    +
    +
    +
    + + Supported Degrees of Isolation + +
    +
    + + Reading Uncommitted Data + +
    +
    + + Committed Reads + +
    +
    + + Using Snapshot Isolation + +
    +
    +
    +
    + + Transactional Cursors and Concurrent Applications + +
    +
    +
    +
    + + Using Cursors with Uncommitted Data + +
    +
    +
    +
    + + Read/Modify/Write + +
    +
    + + No Wait on Blocks + +
    +
    + + Reverse BTree Splits + +
    +
    +
    +
    + + 5. Managing DB Files + +
    +
    +
    +
    + + Checkpoints + +
    +
    + + Backup Procedures + +
    +
    +
    +
    + + About Unix Copy Utilities + +
    +
    + + Offline Backups + +
    +
    + + Hot Backup + +
    +
    + + Incremental Backups + +
    +
    +
    +
    + + Recovery Procedures + +
    +
    +
    +
    + + Normal Recovery + +
    +
    + + Catastrophic Recovery + +
    +
    +
    +
    + + Designing Your Application for Recovery + +
    +
    +
    +
    + + Recovery for Multi-Threaded Applications + +
    +
    + + Recovery in Multi-Process Applications + +
    +
    +
    +
    + + Using Hot Failovers + +
    +
    + + Removing Log Files + +
    +
    + + Configuring the Logging Subsystem + +
    +
    +
    +
    + + Setting the Log File Size + +
    +
    + + Configuring the Logging Region Size + +
    +
    + + Configuring In-Memory Logging + +
    +
    + + Setting the In-Memory Log Buffer Size + +
    +
    +
    +
    +
    +
    + + 6. Summary and Examples + +
    +
    +
    +
    + + Anatomy of a Transactional Application + +
    +
    + + Transaction Example + +
    +
    +
    +
    + + TxnGuide.java + +
    +
    + + PayloadData.java + +
    +
    + + DBWriter.java + +
    +
    +
    +
    + + In-Memory Transaction Example + +
    +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/inmem_txnexample_java.html b/db/docs/gsg_txn/JAVA/inmem_txnexample_java.html new file mode 100644 index 000000000..3cc8bb0d9 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/inmem_txnexample_java.html @@ -0,0 +1,561 @@ + + + + + + In-Memory Transaction Example + + + + + + + + +
    +
    +
    +
    +

    In-Memory Transaction Example

    +
    +
    +
    +
    +

    + DB is sometimes used for applications that simply need to cache + data retrieved from some other location (such as a remote database + server). DB is also often used in embedded systems. +

    +

    + In both cases, applications may still want to use transactions for + atomicity, consistency, and isolation guarantees, but they may want + to forgo the durability guarantee entirely. That is, they may want + their DB environment and databases kept entirely in-memory so + as to avoid the performance impact of unneeded disk I/O. +

    +

    + To do this: +

    +
    +
      +
    • +

      + Refrain from specifying a home directory when you open your + environment. The exception to this is if you are using the + DB_CONFIG configuration file — in + that case you must identify the environment's home + directory so that the configuration file can be found. +

      +
    • +
    • +

      + Configure your environment to back your regions from + system memory instead of the filesystem. +

      +
    • +
    • +

      + Configure your logging subsystem such that log files are kept + entirely in-memory. +

      +
    • +
    • +

      + Increase the size of your in-memory log buffer so that it + is large enough to hold the largest set of concurrent write operations. +

      +
    • +
    • +

      + Increase the size of your in-memory cache so that it can + hold your entire data set. You do not want your cache to + page to disk. +

      +
    • +
    • +

      + Do not specify a file name when you open your database(s). +

      +
    • +
    +
    +

    + As an example, this section takes the transaction example provided + in Transaction Example + and it updates that example so that the environment, database, log + files, and regions are all kept entirely in-memory. +

    +

    + For illustration purposes, we also modify this example so that + uncommitted reads are no longer used to enable the countRecords() + method. Instead, we simply provide a transaction handle to + countRecords() so as to avoid the + self-deadlock. +

    +

    + The majority of the modifications to the original example are performed in the TxnGuide + example class (see TxnGuide.java). + This is because the majority of the work that we need to do is performed when the environment and + databases are opened. +

    +

    + To begin, we simplify the beginning of the class a bit. We eliminate some variables that the example no longer + needs — specifically variables having to do with the location of the environment and the names of the + database files. + We can also remove our usage() method because we no + longer require any command line arguments. +

    +
    // File TxnGuideInMemory.java
    +
    +package db.txn;
    +
    +import com.sleepycat.bind.serial.StoredClassCatalog;
    +
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.DatabaseType;
    +import com.sleepycat.db.LockDetectMode;
    +
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +
    +public class TxnGuideInMemory {
    +
    +    // DB handles
    +    private static Database myDb = null;
    +    private static Database myClassDb = null;
    +    private static Environment myEnv = null;
    +
    +    private static final int NUMTHREADS = 5; 
    +

    + Next, in our main() method, we + remove the call to parseArgs() because that only existed in the previous example for + collecting the environment home location. Everything else is essentially the same. +

    +
        public static void main(String args[]) {
    +        try {
    +
    +            // Open the environment and databases
    +            openEnv();
    +
    +            // Get our class catalog (used to serialize objects)
    +            StoredClassCatalog classCatalog =
    +                new StoredClassCatalog(myClassDb);
    +
    +            // Start the threads
    +            DBWriter[] threadArray;
    +            threadArray = new DBWriter[NUMTHREADS];
    +            for (int i = 0; i < NUMTHREADS; i++) {
    +                threadArray[i] = new DBWriter(myEnv, myDb, classCatalog);
    +                threadArray[i].start();
    +            }
    +
    +            for (int i = 0; i < NUMTHREADS; i++) {
    +                threadArray[i].join();
    +            }
    +        } catch (Exception e) {
    +            System.err.println("TxnGuideInMemory: " + e.toString());
    +            e.printStackTrace();
    +        } finally {
    +            closeEnv();
    +        }
    +        System.out.println("All done.");
    +    } 
    +

    + Next we open our environment as always. However, in doing so we: +

    +
    +
      +
    • +

      + Set EnvironmentConfig.setPrivate() + to true. + This causes our environment to back regions using our + application's heap memory rather than by using the filesystem. + This is the first important step to keeping our DB data + entirely in-memory. +

      +
    • +
    • +

      + Remove runRecovery() + from the environment configuration. Because all our data will be held entirely in memory, recovery is a + non-issue. Note that if we had left the call to runRecovery() + in, it would be silently ignored. +

      +
    • +
    +
    +
        private static void openEnv() throws DatabaseException {
    +        System.out.println("opening env");
    +
    +        // Set up the environment.
    +        EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +
    +        // Region files are not backed by the filesystem, they are
    +        // backed by heap memory.
    +        myEnvConfig.setPrivate(true);
    +
    +        myEnvConfig.setAllowCreate(true);
    +        myEnvConfig.setInitializeCache(true);
    +        myEnvConfig.setInitializeLocking(true);
    +        myEnvConfig.setInitializeLogging(true);
    +        myEnvConfig.setTransactional(true);
    +        // EnvironmentConfig.setThreaded(true) is the default behavior 
    +        // in Java, so we do not have to do anything to cause the
    +        // environment handle to be free-threaded.
    +
    +        // Indicate that we want db to internally perform deadlock 
    +        // detection. Also indicate that the transaction that has
    +        // performed the least amount of write activity to
    +        // receive the deadlock notification, if any.
    +        myEnvConfig.setLockDetectMode(LockDetectMode.MINWRITE); 
    +

    + Now we configure our environment to keep the log files in memory, + increase the log buffer size to 10 MB, and increase our in-memory + cache to 10 MB. These values should be more than enough for our + application's workload. +

    +
    +        
    +                  // Specify in-memory logging
    +        myEnvConfig.setLogInMemory(true);
    +        // Specify the size of the in-memory log buffer
    +        // Must be large enough to handle the log data created by
    +        // the largest transaction.
    +        myEnvConfig.setLogBufferSize(10 * 1024 * 1024);
    +        // Specify the size of the in-memory cache
    +        // Set it large enough so that it won't page.
    +        myEnvConfig.setCacheSize(10 * 1024 * 1024); 
    +        
    +      
    +

    + Our database configuration is identical to the original example, except that we do not specify + setReadUncomitted() here. We will be causing our countRecords() + method to join the transaction rather than perform uncommitted reads, so we do not need our database to support them. +

    +
            // Set up the database
    +        DatabaseConfig myDbConfig = new DatabaseConfig();
    +        myDbConfig.setType(DatabaseType.BTREE);
    +        myDbConfig.setAllowCreate(true);
    +        myDbConfig.setTransactional(true);
    +        myDbConfig.setSortedDuplicates(true);
    +        // no DatabaseConfig.setThreaded() method available.
    +        // db handles in java are free-threaded so long as the
    +        // env is also free-threaded.  
    +

    + Next, we open the environment. This is + identical to how the example previously worked, except that we do not + provide a location for the environment's home directory. +

    +
            try {
    +            // Open the environment
    +            myEnv = new Environment(null,    // Env home
    +                                    myEnvConfig); 
    +

    + When we open our databases, we also specify null for the file names. The causes the database + to not be backed by the filesystem; that is, the databases are held entirely in memory. +

    +
                // Open the database. Do not provide a txn handle. This open
    +            // is auto committed because DatabaseConfig.setTransactional()
    +            // is true.
    +            myDb = myEnv.openDatabase(null,     // txn handle
    +                                      null,     // Database file name
    +                                      null,     // Database name
    +                                      myDbConfig);
    +
    +            // Used by the bind API for serializing objects 
    +            // Class database must not support duplicates
    +            myDbConfig.setSortedDuplicates(false);
    +            myClassDb = myEnv.openDatabase(null,     // txn handle
    +                                           null,     // Database file name
    +                                           null,     // Database name,
    +                                           myDbConfig);
    +        } catch (FileNotFoundException fnfe) {
    +            System.err.println("openEnv: " + fnfe.toString());
    +            System.exit(-1);
    +        }
    +    } 
    +

    + After that, our class is unchanged, except for some very minor modifications. + Most notably, we remove the parseArgs() + method from the application, because we no longer need it. +

    +
        private static void closeEnv() {
    +        System.out.println("Closing env");
    +        if (myDb != null ) {
    +            try {
    +                myDb.close();
    +            } catch (DatabaseException e) {
    +                System.err.println("closeEnv: myDb: " +
    +                    e.toString());
    +                e.printStackTrace();
    +            }
    +        }
    +
    +        if (myClassDb != null ) {
    +            try {
    +                myClassDb.close();
    +            } catch (DatabaseException e) {
    +                System.err.println("closeEnv: myClassDb: " +
    +                    e.toString());
    +                e.printStackTrace();
    +            }
    +        }
    +
    +        if (myEnv != null ) {
    +            try {
    +                myEnv.close();
    +            } catch (DatabaseException e) {
    +                System.err.println("closeEnv: " + e.toString());
    +                e.printStackTrace();
    +            }
    +        }
    +    }
    +
    +    private TxnGuideInMemory() {}
    +} 
    +

    + That completes our modifications to this class. + We now turn our attention to our DBWriter + class (see DBWriter.java). + It is unchanged, except for one small modification. In the + run() method, we call countRecords() + with a transaction handle, rather than configuring our entire + application for uncommitted reads. Both mechanisms work well-enough + for preventing a self-deadlock. However, the individual count + in this example will tend to be lower than the counts seen in + the previous transaction example, because + countRecords() can no longer see records + created but not yet committed by other threads. + Additionally, the usage of the transaction handle here will + probably cause more deadlocks than using read-uncommitted does, because more locking is being performed in + this case. +

    +
    package db.txn;
    +
    +import com.sleepycat.bind.EntryBinding;
    +import com.sleepycat.bind.serial.StoredClassCatalog;
    +import com.sleepycat.bind.serial.SerialBinding;
    +import com.sleepycat.bind.tuple.StringBinding;
    +
    +import com.sleepycat.db.Cursor;
    +import com.sleepycat.db.CursorConfig;
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.DeadlockException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.LockMode;
    +import com.sleepycat.db.OperationStatus;
    +import com.sleepycat.db.Transaction;
    +
    +import java.io.UnsupportedEncodingException;
    +import java.util.Random;
    +
    +public class DBWriter extends Thread
    +{
    +    private Database myDb = null;
    +    private Environment myEnv = null;
    +    private EntryBinding dataBinding = null;
    +    private Random generator = new Random();
    +
    +    private static final int MAX_RETRY = 20;
    +
    +    private static String[] keys = {"key 1", "key 2", "key 3",
    +                                    "key 4", "key 5", "key 6",
    +                                    "key 7", "key 8", "key 9",
    +                                    "key 10"};
    +
    +
    +    // Constructor. Get our DB handles from here
    +    DBWriter(Environment env, Database db, StoredClassCatalog scc)
    +        throws DatabaseException {
    +        myDb = db;
    +        myEnv = env;
    +        dataBinding = new SerialBinding(scc, PayloadData.class);
    +    }
    +
    +
    +    // Thread method that writes a series of records
    +    // to the database using transaction protection.
    +    // Deadlock handling is demonstrated here.
    +    public void run () {
    +        Transaction txn = null;
    +
    +        // Perform 50 transactions
    +        for (int i=0; i<50; i++) {
    +
    +           boolean retry = true;
    +           int retry_count = 0;
    +           // while loop is used for deadlock retries
    +           while (retry) {
    +                // try block used for deadlock detection and
    +                // general db exception handling
    +                try {
    +
    +                    // Get a transaction
    +                    txn = myEnv.beginTransaction(null, null);
    +                    // Write 10 records to the db
    +                    // for each transaction
    +                    for (int j = 0; j < 10; j++) {
    +                        // Get the key
    +                        DatabaseEntry key = new DatabaseEntry();
    +                        StringBinding.stringToEntry(keys[j], key);
    +
    +                        // Get the data
    +                        PayloadData pd = new PayloadData(i+j, getName(),
    +                            generator.nextDouble());
    +                        DatabaseEntry data = new DatabaseEntry();
    +                        dataBinding.objectToEntry(pd, data);
    +
    +                        // Do the put
    +                        myDb.put(txn, key, data);
    +                    }
    +
    +                    // commit
    +                    System.out.println(getName() + 
    +                        " : committing txn : " + i);
    +
    +                    System.out.println(getName() + " : Found " +
    +                        countRecords(txn) + " records in the database.");
    +                    try {
    +                        txn.commit();
    +                        txn = null;
    +                    } catch (DatabaseException e) {
    +                        System.err.println("Error on txn commit: " +
    +                            e.toString());
    +                    }
    +                    retry = false;
    +
    +                } catch (DeadlockException de) {
    +                    System.out.println("################# " + getName() +
    +                        " : caught deadlock");
    +                    // retry if necessary
    +                    if (retry_count < MAX_RETRY) {
    +                        System.err.println(getName() +
    +                            " : Retrying operation.");
    +                        retry = true;
    +                        retry_count++;
    +                    } else {
    +                        System.err.println(getName() +
    +                            " : out of retries. Giving up.");
    +                        retry = false;
    +                    }
    +                } catch (DatabaseException e) {
    +                    // abort and don't retry
    +                    retry = false;
    +                    System.err.println(getName() +
    +                        " : caught exception: " + e.toString());
    +                    System.err.println(getName() +
    +                        " : errno: " + e.getErrno());
    +                    e.printStackTrace();
    +                } finally {
    +                    if (txn != null) {
    +                        try {
    +                            txn.abort();
    +                        } catch (Exception e) {
    +                            System.err.println(
    +                                "Error aborting transaction: " + 
    +                                e.toString());
    +                            e.printStackTrace();
    +                        }
    +                    }
    +                }
    +            }
    +        }
    +    } 
    +

    + Next we update countRecords(). The only difference + here is that we no longer specify CursorConfig.setReadUncomitted() when + we open our cursor. Note that even this minor change is not required. + If we do not configure our database to support uncommitted reads, + CursorConfig.setReadUncomitted() is silently + ignored. However, we remove the property anyway from the cursor open so as to + avoid confusion. +

    +
        // This simply counts the number of records contained in the
    +    // database and returns the result. You can use this method
    +    // in three ways:
    +    //
    +    // First call it with an active txn handle.
    +    // Secondly, configure the cursor for uncommitted reads
    +    // Third, call count_records AFTER the writer has committed
    +    //    its transaction.
    +    //
    +    // If you do none of these things, the writer thread will 
    +    // self-deadlock.
    +    //
    +    // Note that this method exists only for illustrative purposes.
    +    // A more straight-forward way to count the number of records in
    +    // a database is to use the Database.getStats() method.
    +    private int countRecords(Transaction txn)  throws DatabaseException {
    +        DatabaseEntry key = new DatabaseEntry();
    +        DatabaseEntry data = new DatabaseEntry();
    +        int count = 0;
    +        Cursor cursor = null;
    +
    +        try {
    +            // Get the cursor
    +            CursorConfig cc = new CursorConfig();
    +            cc.setReadUncomitted(true);
    +            cursor = myDb.openCursor(txn, cc);
    +            while (cursor.getNext(key, data, LockMode.DEFAULT) ==
    +                    OperationStatus.SUCCESS) {
    +
    +                    count++;
    +            }
    +        } finally {
    +            if (cursor != null) {
    +                cursor.close();
    +            }
    +        }
    +
    +        return count;
    +
    +    }
    +} 
    +

    + This completes our in-memory transactional example. If you would like to + experiment with this code, you can find the example in the following + location in your DB distribution: +

    +
    DB_INSTALL/examples_java/src/db/txn
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/introduction.html b/db/docs/gsg_txn/JAVA/introduction.html new file mode 100644 index 000000000..d2315cd21 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/introduction.html @@ -0,0 +1,441 @@ + + + + + + Chapter 1. Introduction + + + + + + + + + +
    +
    +
    +
    +

    Chapter 1. Introduction

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Transaction Benefits + +
    +
    +
    +
    + + A Note on System Failure + +
    +
    + + Application Requirements + +
    +
    + + Multi-threaded + and Multi-process + Applications + +
    +
    +
    +
    + + Recoverability + +
    +
    + + Performance Tuning + +
    +
    +
    +

    + This book provides a thorough introduction and discussion on transactions as + used with Berkeley DB (DB). It begins by offering a general overview to + transactions, the guarantees they provide, and the general application + infrastructure required to obtain full transactional protection for your + data. +

    +

    + This book also provides detailed examples on how to write a + transactional application. Both single threaded and multi-threaded (as well as multi-process + applications) are discussed. A detailed description of various + backup and recovery strategies is included in this manual, as is a + discussion on performance considerations for your transactional application. +

    +

    + You should understand the concepts from the + + Getting Started with Berkeley DB + + + + guide before reading this book. +

    +
    +
    +
    +
    +

    Transaction Benefits

    +
    +
    +
    +
    +

    + Transactions offer your application's data protection from + application or system failures. That is, DB transactions offer + your application full ACID support: +

    +
    +
      +
    • +

      + Atomicity +

      +

      + Multiple database operations are treated as a single unit of + work. Once committed, all write operations performed under + the protection of the transaction are saved to your databases. + Further, in the event that you abort a transaction, all write + operations performed during the transaction are discarded. + In this event, your database is left in the state it was in + before the transaction began, regardless of the number or + type of write operations you may have performed during the + course of the transaction. +

      +

      + Note that DB transactions can span one or more + database handles. +

      +
    • +
    • +

      + Consistency +

      +

      + Your databases will never see a partially completed + transaction. This is true even if your application fails while there are + in-progress transactions. If the application or system fails, + then either all of the database changes appear when the + application next runs, or none of them appear. +

      +

      + In other words, whatever consistency requirements your application has will never be violated by DB. + If, for example, your application requires every record to include an employee ID, and your + code faithfully adds that ID to its database records, then DB will never + violate that consistency requirement. The ID will remain in the database records until such a time as your + application chooses to delete it. +

      +
    • +
    • +

      + Isolation +

      +

      + While a transaction is in progress, your databases will appear + to the transaction as if there are no other operations + occurring outside of the transaction. That is, operations + wrapped inside a transaction will always have a clean and + consistent view of your databases. They never have to see + updates currently in progress under the protection of another transaction. + Note, however, that isolation guarantees can be + + relaxed from the default setting. See + Isolation + for more information. +

      +
    • +
    • +

      + Durability +

      +

      + Once committed to your databases, your modifications will + persist even in the event of an application or system failure. + Note that like isolation, your durability guarantee can be + relaxed. See Non-Durable Transactions + for more information. +

      +
    • +
    +
    +
    +
    +
    +
    +

    A Note on System Failure

    +
    +
    +
    +
    +

    + From time to time this manual mentions that transactions protect your data against 'system or application + failure.' This is + true up to a certain extent. However, not all failures are created equal and no data protection + mechanism can protect you against every conceivable way a computing system can find to die. +

    +

    + Generally, when this book talks about protection against failures, it means that + transactions offer protection against + the likeliest culprits for system and application crashes. So long as your data modifications have been + committed to disk, those modifications should persist even if your application or OS subsequently fails. + And, even if the application or OS fails in the middle of a transaction commit (or abort), the data on disk + should be either in a consistent state, or there should be enough data available to bring + your databases into a consistent state (via a recovery procedure, for example). You may, however, + lose whatever data you were committing at the + time of the failure, but your databases will be otherwise unaffected. +

    +

    + Of course, if your disk fails, then the transactional benefits described in this book + are only as good as the backups you have taken. + + By spreading your data and log files across separate disks, + you can minimize the risk of data loss due to a disk failure, but even in this case it is possible to + conjure a scenario where even this protection is insufficient (a fire in the machine room, for example) and + you must go to your backups for protection. + +

    +

    + Finally, by following the programming examples shown in this book, you can write your code so as to protect + your data in the event that your code crashes. However, no programming API can protect you against logic + failures in your own code; transactions cannot protect you from simply writing the wrong thing to your + databases. +

    +
    +
    +
    +
    +
    +

    Application Requirements

    +
    +
    +
    +
    +

    + In order to use transactions, your application has certain + requirements beyond what is required of non-transactional protected + applications. They are: +

    +
    +
      +
    • +

      + Environments. +

      +

      + Environments are optional for non-transactional + applications, but they are required for transactional + applications. +

      +

      + Environment usage is described in detail in + Transaction Basics. +

      +
    • +
    • +

      + Transaction subsystem. +

      +

      + In order to use transactions, you must explicitly + enable the transactional subsystem for your + application, and this must be done at the time that + your environment is first created. +

      +
    • +
    • +

      + Logging subsystem. +

      +

      + The logging subsystem is required for recovery purposes, but + its usage also means your application may require a + little more administrative effort than it does when logging + is not in use. See Managing DB Files for more information. +

      +
    • +
    • +

      + + + Transaction + + handles. +

      +

      + In order to obtain the atomicity guarantee offered by + the transactional subsystem (that is, combine multiple + operations in a single unit of work), your application must use + transaction handles. These handles are obtained from your + + + + Environment + objects. They should normally be short-lived, and their usage is + reasonably simple. To complete a transaction and save + the work it performed, you + call its commit() method. To + complete a transaction and discard its work, you call its + abort() method. +

      +

      + In addition, it is possible to use auto commit if you want + to transactional protect a single write operation. Auto + commit allows a transaction to be used without + obtaining an explicit transaction handle. See + Auto Commit + for information on how to use auto commit. +

      +
    • +
    • +

      + Database + + open requirements. +

      +

      + + In addition to using + environments and initializing the + correct subsystems, your + + application must transaction protect the database + + opens, + and any secondary index associations, + + if subsequent operations on the databases are to be transaction + protected. The database open and secondary index + association are commonly transaction protected using + auto commit. +

      +
    • +
    • +

      + Deadlock detection. +

      +

      + Typically transactional applications use multiple + threads of control when accessing the database. Any + time multiple threads are used on a single resource, + the potential for lock contention arises. In turn, lock + contention can lead to deadlocks. See + Locks, Blocks, and Deadlocks + for more information. +

      +

      + Therefore, transactional applications must frequently + include code for detecting and responding to deadlocks. + Note that this requirement is not + specific to transactions + – you can certainly write concurrent + non-transactional DB applications. Further, not + every transactional application uses concurrency and + so not every transactional application must + manage deadlocks. Still, deadlock management is so + frequently a characteristic of transactional + applications that we discuss it in this + book. See Concurrency + for more information. +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    Multi-threaded + and Multi-process + Applications

    +
    +
    +
    +
    +

    + DB is designed to support multi-threaded and + multi-process applications, but their usage means + you must pay careful attention to issues of concurrency. + Transactions help your application's concurrency by providing various levels of + isolation for your threads of control. In addition, DB + provides mechanisms that allow you to detect and respond to + deadlocks (but strictly speaking, this is not limited to just + transactional applications). +

    +

    + Isolation means that database modifications made by + one transaction will not normally be seen by readers from another + transaction until the first commits its changes. Different threads + use different transaction handles, so + this mechanism is normally used to provide isolation between + database operations performed by different threads. +

    +

    + Note that DB supports different isolation levels. For example, + you can configure your application to see uncommitted reads, which means + that one transaction can see data that has been modified but not yet + committed by another transaction. Doing this might mean your + transaction reads data "dirtied" by another transaction, + but which subsequently might change before that + other transaction commits its changes. + On the other hand, lowering your isolation + requirements means that your application can experience + improved throughput due to reduced lock contention. +

    +

    + For more information on concurrency, on managing isolation + levels, and on deadlock detection, see Concurrency. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/isolation.html b/db/docs/gsg_txn/JAVA/isolation.html new file mode 100644 index 000000000..3e4a7bc2a --- /dev/null +++ b/db/docs/gsg_txn/JAVA/isolation.html @@ -0,0 +1,917 @@ + + + + + + Isolation + + + + + + + + + +
    +
    +
    +
    +

    Isolation

    +
    +
    +
    +
    +

    + Isolation guarantees are an important aspect of transactional + protection. Transactions + ensure the data your transaction is working with will not be changed by some other transaction. + Moreover, the modifications made by a transaction will never be viewable outside of that transaction until + the changes have been committed. +

    +

    + That said, there are different degrees of isolation, and you can choose to relax your isolation + guarantees to one degree or another depending on your application's requirements. The primary reason why + you might want to do this is because of performance; the more isolation you ask your transactions to + provide, the more locking that your application must do. With more locking comes a greater chance of + blocking, which in turn causes your threads to pause while waiting for a lock. Therefore, by relaxing + your isolation guarantees, you can potentially improve your application's throughput. + Whether you actually see any improvement depends, of course, on + the nature of your application's data and transactions. +

    +
    +
    +
    +
    +

    Supported Degrees of Isolation

    +
    +
    +
    +
    +

    + DB supports the following levels of isolation: +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DegreeANSI TermDefinition
    1READ UNCOMMITTED + Uncommitted reads means that one transaction will never + overwrite another transaction's dirty data. Dirty data is + data that a transaction has modified but not yet committed + to the underlying data store. However, uncommitted reads allows a + transaction to see data dirtied by another + transaction. In addition, a transaction may read data + dirtied by another transaction, but which subsequently + is aborted by that other transaction. In this latter + case, the reading transaction may be reading data that + never really existed in the database. +
    2READ COMMITTED +

    + Committed read isolation means that degree 1 is observed, except that dirty data is never read. +

    +

    + In addition, this isolation level guarantees that data will never change so long as + it is addressed by the cursor, but the data may change before the reading cursor is closed. + In the case of a transaction, data at the current + cursor position will not change, but once the cursor + moves, the previous referenced data can change. This + means that readers release read locks before the cursor + is closed, and therefore, before the transaction + completes. Note that this level of isolation causes the + cursor to operate in exactly the same way as it does in + the absence of a transaction. +

    +
    3SERIALIZABLE +

    + Committed read is observed, plus the data read by a transaction, T, + will never be dirtied by another transaction before T completes. + This means that both read and write locks are not + released until the transaction completes. +

    +

    + + In addition, + + + + + no transactions will see phantoms. Phantoms are records + returned as a result of a search, but which were not seen by + the same transaction when the identical + search criteria was previously used. +

    +

    + This is DB's default isolation guarantee. +

    +
    +
    +

    + + By default, DB transactions and transactional cursors offer + + serializable isolation. + + + + You can optionally reduce your isolation level by configuring DB to use + uncommitted read isolation. See + Reading Uncommitted Data + for more information. + + You can also configure DB to use committed read isolation. See + Committed Reads + for more information. + +

    +

    + Finally, in addition to DB's normal degrees of isolation, you + can also use snapshot isolation. This allows + you to avoid the read locks that serializable isolation requires. See + Using Snapshot Isolation + for details. +

    +
    +
    +
    +
    +
    +

    Reading Uncommitted Data

    +
    +
    +
    +
    +

    + You can configure your application to read data that has been modified but not yet + committed by another transaction; that is, dirty data. When you do this, you + may see a performance benefit by allowing your + application to not have to block waiting for write locks. On the other hand, the data that your + application is reading may change before the transaction has completed. +

    +

    + When used with transactions, uncommitted reads means that one transaction can see data + modified but not yet committed by another transaction. When + used with transactional cursors, uncommitted reads means + that any database reader can see data modified by the + cursor before the cursor's transaction has committed. +

    +

    + Because of this, uncommitted reads allow a transaction to read data + that may subsequently be aborted by another transaction. In + this case, the reading transaction will have read data that + never really existed in the database. +

    +

    + To configure your application to read uncommitted data: +

    +
    +
      +
    1. +

      + Open your database such that it will allow uncommitted reads. You do this by + + + specifying true to + + DatabaseConfig.setReadUncommitted(). + + + +

      +
    2. +
    3. +

      + + + Specify that you want to use uncommitted reads when you + + create a transaction or open the cursor. + + + To do this, you use the setReadUncommitted() + + method on the relevant configuration object + (TransactionConfig or + CursorConfig). + + + + +

      +
    4. +
    +
    +

    + For example, the following opens the database such that it supports uncommitted reads, and then creates a + transaction that causes all reads performed within it to use uncommitted reads. Remember that simply opening + the database to support uncommitted reads is not enough; you must also declare your read operations to be + performed using uncommitted reads. +

    +
    package db.txn;
    +                                                                                                                                     
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.Transaction;
    +import com.sleepycat.db.TransactionConfig;
    +
    +import java.io.File;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setTransactional(true);
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // Open the database.
    +    DatabaseConfig dbConfig = new DatabaseConfig();
    +    dbConfig.setTransactional(true);
    +    dbConfig.setType(DatabaseType.BTREE);
    +    dbConfig.setReadUncommitted(true);      // Enable uncommitted reads.
    +    myDatabase = myEnv.openDatabase(null,              // txn handle
    +                                    "sampleDatabase",  // db file name
    +                                    null,              // db name
    +                                    dbConfig);
    +    TransactionConfig txnConfig = new TransactionConfig();
    +    txnConfig.setReadUncommitted(true);          // Use uncommitted reads 
    +                                                 // for this transaction.
    +    Transaction txn = myEnv.beginTransaction(null, txnConfig);
    +
    +    // From here, you perform your database reads and writes as normal,
    +    // committing and aborting the transactions as is necessary, and
    +    // testing for deadlock exceptions as normal (omitted for brevity). 
    +        
    +    ...
    +

    + You can also configure uncommitted read isolation on a read-by-read basis + by specifying LockMode.READ_UNCOMMITTED: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.LockMode;
    +import com.sleepycat.db.Transaction;
    +
    +...
    +
    +Database myDb = null;
    +Environment myEnv = null;
    +Transaction txn = null;
    +
    +try {
    +
    +    // Environment and database open omitted
    +
    +    ...
    +
    +    txn = myEnv.beginTransaction(null, null);
    +
    +    DatabaseEntry theKey =
    +        new DatabaseEntry((new String("theKey")).getBytes("UTF-8"));
    +    DatabaseEntry theData = new DatabaseEntry();
    +
    +    myDb.get(txn, theKey, theData, LockMode.READ_UNCOMMITTED);
    +} catch (Exception e) {
    +    // Exception handling goes here
    +} 
    +
    +
    +
    +
    +
    +

    Committed Reads

    +
    +
    +
    +
    +

    + You can configure your transaction so that the data being + read by a transactional cursor is consistent so long as it + is being addressed by the cursor. However, once the cursor is done reading the + + + record (that is, reading records from the page that it currently has locked), + + the cursor releases its lock on that + + + record or page. + + This means that the data the cursor has read and released + may change before the cursor's transaction has completed. +

    +

    + For example, + suppose you have two transactions, Ta and Tb. Suppose further that + Ta has a cursor that reads record R, but does not modify it. Normally, + Tb would then be unable to write record R because + Ta would be holding a read lock on it. But when you configure your transaction for + committed reads, Tb can modify record + R before Ta completes, so long as the reading cursor is no longer + addressing the + + + record or page. + +

    +

    + When you configure your application for this level of isolation, you may see better performance + throughput because there are fewer read locks being held by your transactions. + Read committed isolation is most useful when you have a cursor that is reading and/or writing records in + a single direction, and that does not ever have to go back to re-read those same records. In this case, + you can allow DB to release read locks as it goes, rather than hold them for the life of the + transaction. +

    +

    + To configure your application to use committed reads, do one of the following: +

    +
    +
      +
    • +

      + Create your transaction such that it allows committed reads. You do this by + + + specifying true to + TransactionConfig.setReadCommitted(). + +

      +
    • +
    • +

      + + + Specify true to + CursorConfig.setReadCommitted(). + +

      +
    • +
    +
    +

    + For example, the following creates a transaction that allows committed reads: +

    +
    package db.txn;
    +                                                                                                                                     
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.Transaction;
    +import com.sleepycat.db.TransactionConfig;
    +
    +import java.io.File;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setTransactional(true);
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // Open the database.
    +    // Notice that we do not have to specify any properties to the 
    +    // database to allow committed reads (this is as opposed to 
    +    // uncommitted reads where we DO have to specify a property on 
    +    // the database open.
    +    DatabaseConfig dbConfig = new DatabaseConfig();
    +    dbConfig.setTransactional(true);
    +    dbConfig.setType(DatabaseType.BTREE);
    +
    +    myDatabase = myEnv.openDatabase(null,              // txn handle
    +                                    "sampleDatabase",  // db file name
    +                                    null,              // db name
    +                                    dbConfig);
    +    String keyString = "thekey";
    +    String dataString = "thedata";
    +    DatabaseEntry key = 
    +        new DatabaseEntry(keyString.getBytes("UTF-8"));
    +    DatabaseEntry data = 
    +        new DatabaseEntry(dataString.getBytes("UTF-8"));
    +
    +    TransactionConfig txnConfig = new TransactionConfig();
    +
    +    // Open the transaction and enable committed reads. All cursors open
    +    // with this transaction handle will use read committed isolation.
    +    txnConfig.setReadCommitted(true);
    +    Transaction txn = myEnv.beginTransaction(null, txnConfig);
    +
    +    // From here, you perform your database reads and writes as normal,
    +    // committing and aborting the transactions as is necessary, and
    +    // testing for deadlock exceptions as normal (omitted for brevity). 
    +
    +    // Using transactional cursors with concurrent applications is 
    +    // described in more detail in the following section.
    +        
    +    ...
    +

    + You can also configure read committed isolation on a read-by-read basis + by specifying LockMode.READ_COMMITTED: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.LockMode;
    +import com.sleepycat.db.Transaction;
    +
    +...
    +
    +Database myDb = null;
    +Environment myEnv = null;
    +Transaction txn = null;
    +
    +try {
    +
    +    // Environment and database open omitted
    +
    +    ...
    +
    +    txn = myEnv.beginTransaction(null, null);
    +
    +    DatabaseEntry theKey =
    +        new DatabaseEntry((new String("theKey")).getBytes("UTF-8"));
    +    DatabaseEntry theData = new DatabaseEntry();
    +
    +    myDb.get(txn, theKey, theData, LockMode.READ_COMMITTED);
    +} catch (Exception e) {
    +    // Exception handling goes here
    +} 
    +
    +
    +
    +
    +
    +

    Using Snapshot Isolation

    +
    +
    +
    +
    +

    + By default DB uses serializable isolation. An + important side effect of this isolation level is that + read operations obtain read locks on database pages, + and then hold those locks until the read operation is + completed. When you are using transactional cursors, this + means that read locks are held until the transaction commits or + aborts. In that case, over time a transactional cursor + can gradually block all other transactions from writing + to the database. +

    +

    + You can avoid this by using snapshot isolation. + Snapshot isolation uses multiversion + concurrency control to guarantee + repeatable reads. What this means is that every time a + writer would take a read lock on a page, instead a copy of + the page is made and the writer operations on that page + copy. This frees other writers from blocking due to a + read lock held on the page. +

    +
    +
    +
    +
    +

    Snapshot Isolation Cost

    +
    +
    +
    +
    +

    + Snapshot isolation does not come without a cost. + Because pages are being duplicated before being + operated upon, the cache will fill up faster. This + means that you might need a larger cache in order to + hold the entire working set in memory. +

    +

    + If the cache becomes full of page copies before old + copies can be discarded, additional I/O will occur as + pages are written to temporary "freezer" files on disk. + This can substantially reduce throughput, and should be + avoided if possible by configuring a large cache and + keeping snapshot isolation transactions short. +

    +

    + You can estimate how large your cache should be by + taking a checkpoint, followed by a call to the + + + Environment.getArchiveLogFiles() + method. The amount of cache required is approximately + double the size of the remaining log files (that is, + the log files that cannot be archived). +

    +
    +
    +
    +
    +
    +

    Snapshot Isolation Transactional Requirements

    +
    +
    +
    +
    +

    + In addition to an increased cache size, you may also + need to increase the maximum number of transactions + that your application supports. (See +

    + Most of the configuration activities that you need to perform + for your transactional DB application will involve the + locking and logging subsystems. See + Concurrency + and + Managing DB Files + for details. +

    + However, there are a couple of things that you can do to + configure your transaction subsystem directly. These things + are: +

    • + Configure the maximum number of simultaneous + transactions needed by your application. + In general, you should not need to do this unless you + use deeply nested transactions or you have many threads all + of which have active transactions. In addition, you may + need to a higher maximum number of transactions if you + are using snapshot isolation. See + Snapshot Isolation Transactional Requirements + for details. +

      + By default, your application can support 20 active + transactions. +

      + You can set the maximum number of simultaneous + transactions supported by your application using + + + EnvironmentConfig.setTxnMaxActive(). + +

      + If your application has exceeded this maximum value, + then any attempt to begin a new transaction will fail. +

      + This value can also be set using the + DB_CONFIG file's + set_tx_max parameter. Remember that + the DB_CONFIG must reside in your + environment home directory. +

    • +

      + + Configure the timeout value for your transactions. + + + + This value represents the longest period of time a + transaction can be active. Note, however, that + transaction timeouts are checked only when DB + examines its lock tables for blocked locks + (see Locks, Blocks, and Deadlocks + for more information). Therefore, a transaction's timeout can + have expired, but the application will not be notified until DB + has a reason to examine its lock tables. +

      +

      + Be aware that some transactions may be + inappropriately timed out before the transaction has a + chance to complete. You should therefore use this + mechanism only if you know your application + might have unacceptably long transactions and + you want to make sure your application will + not stall during their execution. + (This might happen if, for example, your + transaction blocks or requests too much + data.) +

      +

      + Note that by default transaction timeouts are set to 0 seconds, which means that they never time + out. +

      +

      + To set the maximum timeout value for your transactions, + use the + + + EnvironmentConfig.setTxnTimeout() + method. This method configures the entire + environment; not just the handle used to set the + configuration. Further, this value may + be set at any time during the application's + lifetime. (Use + Environment.setConfig() to + set this value after the environment has been + opened.) +

      +

      + This value can also be set using the + DB_CONFIG file's + set_txn_timeout parameter. +

      + +

    + For example: +

    package db.txn;
    +
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.LockDetectMode;
    +
    +import java.io.File;
    +
    +...
    +
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setTransactional(true);
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +
    +    // Configure a maximum transaction timeout of 1 second.
    +    myEnvConfig.setTxnTimeout(1000000);
    +    // Configure 40 maximum transactions.
    +    myEnv.setTxnMaxActive(40);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // From here, you open your databases, proceed with your 
    +    // database operations, and respond to deadlocks as 
    +    // is normal (omitted for brevity).
    +
    +    ...
    + for details on how to set this.) + In the worst case scenario, you might need to configure your application for one + more transaction for every page in the cache. This is + because transactions are retained until the last page + they created is evicted from the cache. +

    +
    +
    +
    +
    +
    +

    When to Use Snapshot Isolation

    +
    +
    +
    +
    +

    + Snapshot isolation is best used when all or most + of the following conditions are true: +

    +
    +
      +
    • +

      + You can have a large cache relative to your working data set size. +

      +
    • +
    • +

      + You require repeatable reads. +

      +
    • +
    • +

      + You will be using transactions that routinely work on + the entire database, or more commonly, + there is data in your database that will be very + frequently written by more than one transaction. +

      +
    • +
    • +

      + Read/write contention is + limiting your application's + throughput, or the application + is all or mostly read-only and + contention for the lock manager + mutex is limiting throughput. +

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    How to use Snapshot Isolation

    +
    +
    +
    +
    +

    + You use snapshot isolation by: +

    +
    +
      +
    • +

      + Opening the database with + multiversion support. You can + configure this either when you + open your environment or when + you open your database. + + Use the + DB_MULTIVERSION + flag to configure this support. + + + + Use either the + EnvironmentConfig.setMultiversion() + or the + DatabaseConfig.setMultiversion() + option to configure + this support. + +

      +
    • +
    • +

      + Configure your cursor or + transaction to use snapshot + isolation. +

      +

      + To do this, + + + + + specify the + TransactionConfig.setSnapshot() + option when you configure + your transaction. + +

      +
    • +
    +
    +

    + The simplest way to take advantage of snapshot + isolation is for queries: keep update + transactions using full read/write locking and + use snapshot isolation on read-only transactions or + cursors. This should minimize blocking of + snapshot isolation transactions and will avoid + deadlock errors. +

    +

    + If the application has update transactions which + read many items and only update a small set (for + example, scanning until a desired record is + found, then modifying it), throughput may be + improved by running some updates at snapshot + isolation as well. But doing this means that + you must manage deadlock errors. + See + Resolving Deadlocks + for details. +

    +

    + The following code fragment turns + on snapshot isolation for a transaction: +

    +
    package db.txn;
    +                                                                                                                                     
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseType;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +    myEnvConfig.setTransactional(true);
    +    myEnvConfig.setMultiversion(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // Open the database.
    +    DatabaseConfig dbConfig = new DatabaseConfig();
    +    dbConfig.setTransactional(true);
    +    dbConfig.setType(DatabaseType.BTREE);
    +    myDatabase = myEnv.openDatabase(null,               // txn handle
    +                                    "sampleDatabase",   // db file name
    +                                    null,             // db name
    +                                    dbConfig);
    +
    +
    +...
    +
    +    TransactionConfig txnConfig = new TransactionConfig();
    +    tnxConfig.setSnapshot(true);
    +    txn = myEnv.beginTransaction(null, txnConfig);
    +
    +...
    +
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} catch (FileNotFoundException fnfe) {
    +    // Exception handling goes here
    +}
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/lockingsubsystem.html b/db/docs/gsg_txn/JAVA/lockingsubsystem.html new file mode 100644 index 000000000..0d86ff00e --- /dev/null +++ b/db/docs/gsg_txn/JAVA/lockingsubsystem.html @@ -0,0 +1,479 @@ + + + + + + The Locking Subsystem + + + + + + + + + +
    +
    +
    +
    +

    The Locking Subsystem

    +
    +
    +
    +
    +

    + In order to allow concurrent operations, DB provides the locking + subsystem. This subsystem provides inter- and intra- process + concurrency mechanisms. It is extensively used by DB concurrent + applications, but it can also be generally used for non-DB + resources. +

    +

    + This section describes the locking subsystem as it is used to + protect DB resources. In particular, issues on configuration are + examined here. For information on using the locking subsystem to + manage non-DB resources, see the + Berkeley DB Programmer's Reference Guide. +

    +
    +
    +
    +
    +

    Configuring the Locking Subsystem

    +
    +
    +
    +
    +

    + You initialize the locking subsystem by specifying + + + true to the + EnvironmentConfig.setInitializeLocking() + method. + +

    +

    + Before opening your environment, you can configure various + maximum values for your locking subsystem. Note that these + limits can only be configured before the environment is + opened. Also, these methods configure the entire environment, + not just a specific environment handle. +

    +

    + Finally, each bullet below identifies the + DB_CONFIG file parameter that can be used + to specify the specific locking limit. If used, these + DB_CONFIG file parameters override any + value that you might specify using the environment handle. +

    +

    + The limits that you can configure are as follows: +

    +
    +
      +
    • +

      + The maximum number of lockers + supported by the environment. This value is used by + the environment when it is opened to estimate the amount + of space that it should allocate for various internal + data structures. By default, 1,000 lockers are + supported. +

      +

      + To configure this value, use the + + + EnvironmentConfig.setMaxLockers() + method. + +

      +

      + As an alternative to this method, you can configure this + value using the DB_CONFIG file's + set_lk_max_lockers parameter. +

      +
    • +
    • +

      + The maximum number of locks supported by the environment. + By default, 1,000 locks are supported. +

      +

      + To configure this value, use the + + + EnvironmentConfig.setMaxLocks() + method. + +

      +

      + As an alternative to this method, you can configure this + value using the DB_CONFIG file's + set_lk_max_locks parameter. +

      +
    • +
    • +

      + The maximum number of locked objects supported by the environment. + By default, 1,000 objects can be locked. +

      +

      + To configure this value, use the + + + EnvironmentConfig.setMaxLockObjects() + method. + +

      +

      + As an alternative to this method, you can configure this + value using the DB_CONFIG file's + set_lk_max_objects parameter. +

      +
    • +
    +
    +

    + For a definition of lockers, locks, and locked objects, see + Lock Resources. +

    +

    + For example, to configure the maximum number of locks that your + environment can use: +

    +
    package db.txn;
    +                                                                                                                                     
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setTransactional(true);
    +    myEnvConfig.setMaxLocks(5000);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} catch (FileNotFoundException fnfe) {
    +     // Exception handling goes here
    +}
    +
    +
    +
    +
    +
    +

    Configuring Deadlock Detection

    +
    +
    +
    +
    +

    + In order for DB to know that a deadlock has occurred, + some mechanism must be used to perform deadlock + detection. There are three ways that deadlock detection can + occur: +

    +
    +
      +
    1. +

      + Allow DB to internally detect deadlocks as they + occur. +

      +

      + To do this, you use + + + EnvironmentConfig.setLockDetectMode(). + This method causes DB to walk its internal lock table + looking for a deadlock whenever a lock request + is blocked. This method also identifies how DB decides which lock + requests are rejected when deadlocks are detected. For example, + DB can decide to reject the lock request for the transaction + that has the most number of locks, the least number of locks, + holds the oldest lock, holds the most number of write locks, and + so forth (see the API reference documentation for a complete + list of the lock detection policies). +

      +

      + You can call this method at any time during your application's + lifetime, but typically it is used before you open your environment. +

      +

      + Note that how you want DB to decide which thread of control should break a deadlock is + extremely dependent on the nature of your application. It is not unusual for some performance + testing to be required in order to make this determination. That said, a transaction that is + holding the maximum number of locks is usually indicative of the transaction that has performed + the most amount of work. Frequently you will not want a transaction that has performed a lot of + work to abandon its efforts and start all over again. It is not therefore uncommon for + application developers to initially select the transaction with the minimum + number of write locks to break the deadlock. +

      +

      + Using this mechanism for deadlock detection means + that your application will never have to wait on a + lock before discovering that a deadlock has + occurred. However, walking the lock table every + time a lock request is blocked can be expensive + from a performance perspective. +

      +
    2. +
    3. +

      + Use a dedicated thread or external process to perform + deadlock detection. Note that this thread must be + performing no other database operations beyond deadlock + detection. +

      +

      + To externally perform lock detection, you can use + either the + + + Environment.detectDeadlocks() + method, or use the + db_deadlock command line + utility. This method (or command) causes DB to walk the + lock table looking for deadlocks. +

      +

      + Note that like + + + EnvironmentConfig.setLockDetectMode(), + you also use this method (or command line utility) + to identify which lock requests are rejected in the + event that a deadlock is detected. +

      +

      + Applications that perform deadlock detection in + this way typically run deadlock detection between every few + seconds and a minute. This means that your + application may have to wait to be notified of a + deadlock, but you also save the overhead of walking + the lock table every time a lock request is blocked. +

      +
    4. +
    5. +

      + Lock timeouts. +

      +

      + You can configure your locking subsystem such that + it times out any lock that is not released within a + specified amount of time. To do this, use the + + + EnvironmentConfig.setLockTimeout() + method. + Note that lock timeouts are only checked when a + lock request is blocked or when deadlock + detection is otherwise performed. Therefore, a lock can have timed out and still be held for + some length of time until DB has a reason to examine its locking tables. +

      +

      + Be aware that extremely long-lived transactions, or + operations that hold locks for a long time, may be + inappropriately timed out before the transaction or + operation has a chance to complete. You should + therefore use this mechanism only if you know your + application will hold locks for very short periods + of time. +

      +
    6. +
    +
    +

    + For example, to configure your application such that DB + checks the lock table for deadlocks every time a lock + request is blocked: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.LockDetectMode;
    +
    +import java.io.File;
    +
    +...
    +
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setTransactional(true);
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);   
    +
    +    // Configure db to perform deadlock detection internally, and to
    +    // choose the transaction that has performed the least amount 
    +    // of writing to break the deadlock in the event that one 
    +    // is detected.
    +    envConfig.setLockDetectMode(LockDetectMode.MINWRITE);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // From here, you open your databases, proceed with your 
    +    // database operations, and respond to deadlocks as 
    +    // is normal (omitted for brevity).
    +
    +    ...
    +

    + Finally, the following command line call causes + deadlock detection to be run against the + environment contained in /export/dbenv. The + transaction with the youngest lock is chosen to break the + deadlock: +

    +
    > /usr/local/db_install/bin/db_deadlock -h /export/dbenv -a y
    +

    + For more information, see the + + db_deadlock reference documentation. + +

    +
    +
    +
    +
    +
    +

    Resolving Deadlocks

    +
    +
    +
    +
    +

    + When DB determines that a deadlock has occurred, it will + select a thread of control to resolve the deadlock and then + + + + throws DeadlockException in that + thread. + + + If a deadlock is detected, the thread must: +

    +
    +
      +
    1. +

      + Cease all read and write operations. +

      +
    2. +
    3. +

      + Close all open cursors. +

      +
    4. +
    5. +

      + Abort the transaction. +

      +
    6. +
    7. +

      + Optionally retry the operation. If your application + retries deadlocked operations, the new attempt must + be made using a new transaction. +

      +
    8. +
    +
    +
    +

    Note

    +

    + If a thread has deadlocked, it may not make any + additional database calls using the handle that has + deadlocked. +

    +
    +

    + For example: +

    +
    // retry_count is a counter used to identify how many times
    +// we've retried this operation. To avoid the potential for 
    +// endless looping, we won't retry more than MAX_DEADLOCK_RETRIES 
    +// times.
    +
    +// txn is a transaction handle.
    +// key and data are DatabaseEntry handles. Their usage is not shown here.
    +while (retry_count < MAX_DEADLOCK_RETRIES) {
    +    try {
    +        txn = myEnv.beginTransaction(null, null);
    +        myDatabase.put(txn, key, data);
    +        txn.commit();
    +        return 0;
    +    } catch (DeadlockException de) {
    +        try {
    +            // Abort the transaction and increment the
    +            // retry counter
    +            txn.abort();
    +            retry_count++;
    +            if (retry_count >= MAX_DEADLOCK_RETRIES) {
    +                System.err.println("Exceeded retry limit. Giving up.");
    +                return -1;
    +            }
    +        } catch (DatabaseException ae) {
    +            System.err.println("txn abort failed: " + ae.toString());
    +            return -1;    
    +        }
    +    } catch (DatabaseException e) {
    +        try {
    +            // Abort the transaction.
    +            txn.abort();
    +        } catch (DatabaseException ae) {
    +            System.err.println("txn abort failed: " + ae.toString());
    +            return -1;    
    +        }
    +    }
    +} 
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/logconfig.html b/db/docs/gsg_txn/JAVA/logconfig.html new file mode 100644 index 000000000..85a711782 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/logconfig.html @@ -0,0 +1,381 @@ + + + + + + Configuring the Logging Subsystem + + + + + + + + + +
    +
    +
    +
    +

    Configuring the Logging Subsystem

    +
    +
    +
    +
    +

    + You can configure the following aspects of the logging + subsystem: +

    +
    + +
    +
    +
    +
    +
    +

    Setting the Log File Size

    +
    +
    +
    +
    +

    + Whenever a pre-defined amount of data is written to a + log file (10 MB by default), DB stops using the + current log file and starts writing to a new file. + You can change the maximum amount of data contained in each + log file by using the + + + EnvironmentConfig.setMaxLogFileSize() + method. + + Note that this method can be used at any time + during an application's lifetime. +

    +

    + Setting the log file size to something larger than its + default value is largely a matter of + convenience and a reflection of the application's + preference in backup media and frequency. However, if + you set the log file size too low relative to your + application's traffic patterns, you can cause + yourself trouble. +

    +

    + From a performance perspective, setting the log file + size to a low value can cause your active transactions to + pause their writing activities more frequently than would + occur with larger log file sizes. Whenever a + transaction completes the log buffer is flushed to + disk. Normally other transactions can continue to + write to the log buffer while this flush is in + progress. However, when one log file is being closed + and another created, all transactions must cease + writing to the log buffer until the switch over is + completed. +

    +

    + Beyond performance concerns, using smaller log files + can cause you to use more physical files on disk. + As a result, your application could run out + of log sequence numbers, depending on how busy your + application is. +

    +

    + Every log file is identified with a 10 digit number. + Moreover, the maximum number of log files that your application + is allowed to create in its lifetime is 2,000,000,000. +

    +

    + For example, if your application performs 6,000 transactions per + second for 24 hours a day, and you are logging 500 bytes of + data per transaction into 10 MB log files, then you + will run out of log files in around 221 years: +

    +
         (10 * 2^20 * 2000000000) / (6000 * 500 * 365 * 60 *60 * 24) = 221 
    +

    + However, if you were writing 2000 bytes of data per + transaction, and using 1 MB log files, then the same + formula shows you running out of log files in 5 years time. +

    +

    + All of these time frames are quite long, to be sure, + but if you do run out of log files after, say, 5 years + of continuous operations, then you must reset your log + sequence numbers. To do so: +

    +
    +
      +
    1. +

      + Backup your databases as if to prepare for + catastrophic failure. See + Backup Procedures + for more information. +

      +
    2. +
    3. +

      + Reset the log file's sequence number using the + db_load utility's + -r option. +

      +
    4. +
    5. +

      + Remove all of the log files from your + environment. Note that this is the only + situation in which all of the log files are + removed from an environment; in all other + cases, at least a single log file is retained. +

      +
    6. +
    7. +

      + Restart your application. +

      +
    8. +
    +
    +
    +
    +
    +
    +
    +

    Configuring the Logging Region Size

    +
    +
    +
    +
    +

    + The logging subsystem's default region size is 60 KB. The + logging region is used to store filenames, and so you may + need to increase its size if a large number of files (that + is, if you have a very large number of databases) will + be opened and registered with DB's log manager. +

    +

    + You can set the size of your logging region by using the + + + EnvironmentConfig.setLogRegionSize() + + method. Note that this method can only be called before the + first environment handle for your application is opened. +

    +
    +
    +
    +
    +
    +

    Configuring In-Memory Logging

    +
    +
    +
    +
    +

    + It is possible to configure your logging subsystem such + that logs are maintained entirely in memory. When + you do this, you give up your transactional durability + guarantee. Without log files, you have no way to run + recovery so any system or software failures that you might + experience can corrupt your databases. +

    +

    + However, by giving up your durability guarantees, you can + greatly improve your application's throughput by avoiding + the disk I/O necessary to write logging information to + disk. In this case, you still retain your transactional + atomicity, consistency, and isolation guarantees. +

    +

    + To configure your logging subsystem to maintain your logs + entirely in-memory: +

    +
    +
      +
    • +

      + Make sure your log buffer is capable of holding all + log information that can accumulate during the longest + running transaction. See Setting the In-Memory Log Buffer Size for details. +

      +
    • +
    • +

      + Do not run normal recovery when you open your environment. In this configuration, there are no + log files available against which you can run recovery. As a result, if you specify recovery + when you open your environment, it is ignored. +

      +
    • +
    • +

      + Specify + + + true + to the + EnvironmentConfig.setLogInMemory() + + method. Note that you must specify this before + your application opens its first environment + handle. +

      +
    • +
    +
    +

    + For example: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +    myEnvConfig.setTransactional(true);
    +
    +    // Specify in-memory logging
    +    myEnvConfig.setLogInMemory(true);   
    +
    +    // Specify the in-memory log buffer size.
    +    myEnvConfig.setLogBufferSize(10 * 1024 * 1024); 
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // From here, you open databases, create transactions and 
    +    // perform database operations exactly as you would if you 
    +    // were logging to disk. This part is omitted for brevity.  
    +
    +
    +
    +
    +
    +

    Setting the In-Memory Log Buffer Size

    +
    +
    +
    +
    +

    + When your application is configured for on-disk logging + (the default behavior for transactional applications), log + information is stored in-memory until the storage space + fills up, or a transaction commit forces the log + information to be flushed to disk. +

    +

    + It is possible to increase the amount of memory available + to your file log buffer. Doing so improves throughput for + long-running transactions, or for transactions that produce + a large amount of data. +

    +

    + When you have your logging subsystem configured to maintain + your log entirely in memory (see + Configuring In-Memory Logging), it is very important + to configure your log buffer size because the log buffer + must be capable of holding all log information that can + accumulate during the longest running transaction. + You must make sure that the in-memory log buffer size is + large enough that no transaction will ever span the entire + buffer. You must also avoid a state where the in-memory + buffer is full and no space can be freed because a + transaction that started the first log "file" is still + active. +

    +

    + When your logging subsystem is configured for on-disk + logging, the default log buffer space is 32 KB. When + in-memory logging is configured, the default log buffer + space is 1 MB. +

    +

    + You can increase your log buffer space using the + + + EnvironmentConfig.setLogBufferSize() + + method. Note that this method can only be called before the + first environment handle for your application is opened. +

    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/logfileremoval.html b/db/docs/gsg_txn/JAVA/logfileremoval.html new file mode 100644 index 000000000..231b164f4 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/logfileremoval.html @@ -0,0 +1,202 @@ + + + + + + Removing Log Files + + + + + + + + + +
    +
    +
    +
    +

    Removing Log Files

    +
    +
    +
    +
    +

    + By default DB does not delete log files for you. For this reason, + DB's log files will eventually grow to consume an + unnecessarily large amount of disk space. To guard against + this, you should periodically take administrative action to + remove log files that are no longer in use by your application. +

    +

    + You can remove a log file if all of the following are true: +

    +
    +
      +
    • +

      + the log file is not involved in an active transaction. +

      +
    • +
    • +

      + a checkpoint has been performed + after the log file was + created. +

      +
    • +
    • +

      + the log file is not the only log file in the + environment. +

      +
    • +
    • +

      + the log file that you want to remove has already been + included in an offline or hot backup. + Failure to observe this last condition can cause your + backups to be unusable. +

      +
    • +
    +
    +

    + DB provides several mechanisms to remove log files that + meet all but the last criteria (DB has no way to know which + log files have already been included in a backup). The + following mechanisms make it easy to remove unneeded log files, + but can result in an unusable backup if the log files are not first + saved to your archive location. All of the following + mechanisms automatically delete unneeded log files for you: +

    +
    +
      +
    • +

      + Run the db_archive command line + utility with the -d option. +

      +
    • +
    • +

      + From within your application, call the + + + Environment.removeOldLogFiles() + method. + +

      +
    • +
    • +

      + + + Specify true to the + EnvironmentConfig.setLogAutoRemove() + method. Note that setting this property affects + all environment handles opened against the + environment; not just the handle used to set + the property. + +

      +

      + Note that unlike the other log removal mechanisms + identified here, this method actually causes log files + to be removed on an on-going basis as they become + unnecessary. This is extremely desirable behavior if + what you want is to use the absolute minimum amount of + disk space possible for your application. This + mechanism will leave you with + the log files that are required to run normal recovery. + However, it is highly likely that this mechanism will + prevent you from running catastrophic recovery. +

      +

      + Do NOT use this mechanism if you want to be able to + perform catastrophic recovery, or if you want to be + able to maintain a hot backup. +

      +
    • +
    +
    +

    + In order to safely remove log files and still be able to + perform catastrophic recovery, use the + db_archive command line utility as follows: +

    +
    +
      +
    1. +

      + Run either a normal or hot backup as described in + Backup Procedures. Make + sure that all of this data is safely stored to your + backup media before continuing. +

      +
    2. +
    3. +

      + If you have not already done so, perform a checkpoint. + See Checkpoints + for more information. +

      +
    4. +
    5. +

      + If you are maintaining a hot backup, perform the hot + backup procedure as described in + Using Hot Failovers. +

      +
    6. +
    7. +

      + Run the db_archive command line + utility with the -d option against + your production environment. +

      +
    8. +
    9. +

      + Run the db_archive command line + utility with the -d option against + your failover environment, if you are maintaining one. +

      +
    10. +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/maxtxns.html b/db/docs/gsg_txn/JAVA/maxtxns.html new file mode 100644 index 000000000..30994a5d5 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/maxtxns.html @@ -0,0 +1,202 @@ + + + + + + Configuring the Transaction Subsystem + + + + + + + + + +
    +
    +
    +
    +

    Configuring the Transaction Subsystem

    +
    +
    +
    +
    +

    + Most of the configuration activities that you need to perform + for your transactional DB application will involve the + locking and logging subsystems. See + Concurrency + and + Managing DB Files + for details. +

    +

    + However, there are a couple of things that you can do to + configure your transaction subsystem directly. These things + are: +

    +
    +
      +
    • +

      + Configure the maximum number of simultaneous + transactions needed by your application. + In general, you should not need to do this unless you + use deeply nested transactions or you have many threads all + of which have active transactions. In addition, you may + need to a higher maximum number of transactions if you + are using snapshot isolation. See + Snapshot Isolation Transactional Requirements + for details. +

      +

      + By default, your application can support 20 active + transactions. +

      +

      + You can set the maximum number of simultaneous + transactions supported by your application using + + + EnvironmentConfig.setTxnMaxActive(). + +

      +

      + If your application has exceeded this maximum value, + then any attempt to begin a new transaction will fail. +

      +

      + This value can also be set using the + DB_CONFIG file's + set_tx_max parameter. Remember that + the DB_CONFIG must reside in your + environment home directory. +

      +
    • +
    • + +

      + + Configure the timeout value for your transactions. + + + + This value represents the longest period of time a + transaction can be active. Note, however, that + transaction timeouts are checked only when DB + examines its lock tables for blocked locks + (see Locks, Blocks, and Deadlocks + for more information). Therefore, a transaction's timeout can + have expired, but the application will not be notified until DB + has a reason to examine its lock tables. +

      +

      + Be aware that some transactions may be + inappropriately timed out before the transaction has a + chance to complete. You should therefore use this + mechanism only if you know your application + might have unacceptably long transactions and + you want to make sure your application will + not stall during their execution. + (This might happen if, for example, your + transaction blocks or requests too much + data.) +

      +

      + Note that by default transaction timeouts are set to 0 seconds, which means that they never time + out. +

      +

      + To set the maximum timeout value for your transactions, + use the + + + EnvironmentConfig.setTxnTimeout() + method. This method configures the entire + environment; not just the handle used to set the + configuration. Further, this value may + be set at any time during the application's + lifetime. (Use + Environment.setConfig() to + set this value after the environment has been + opened.) +

      +

      + This value can also be set using the + DB_CONFIG file's + set_txn_timeout parameter. +

      + +
      +
    • +
    +
    +

    + For example: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.LockDetectMode;
    +
    +import java.io.File;
    +
    +...
    +
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setTransactional(true);
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +
    +    // Configure a maximum transaction timeout of 1 second.
    +    myEnvConfig.setTxnTimeout(1000000);
    +    // Configure 40 maximum transactions.
    +    myEnv.setTxnMaxActive(40);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // From here, you open your databases, proceed with your 
    +    // database operations, and respond to deadlocks as 
    +    // is normal (omitted for brevity).
    +
    +    ...
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/nestedtxn.html b/db/docs/gsg_txn/JAVA/nestedtxn.html new file mode 100644 index 000000000..2ff64399a --- /dev/null +++ b/db/docs/gsg_txn/JAVA/nestedtxn.html @@ -0,0 +1,139 @@ + + + + + + Nested Transactions + + + + + + + + + +
    +
    +
    +
    +

    Nested Transactions

    +
    +
    +
    +
    +

    + A nested transaction is used to provide a + transactional guarantee for a subset of operations performed within + the scope of a larger transaction. Doing this allows you to commit + and abort the subset of operations independently of the larger + transaction. +

    +

    + The rules to the usage of a nested transaction are as follows: +

    +
    +
      +
    • +

      + While the nested (child) transaction is active, the parent + transaction may not perform any operations other than to commit + or abort, or to create more child transactions. +

      +
    • +
    • +

      + Committing a nested transaction has no effect on the state + of the parent transaction. The parent transaction is still + uncommitted. However, the parent transaction can now + see any modifications made by the child transaction. + Those modifications, of course, are still hidden to all + other transactions until the parent also commits. +

      +
    • +
    • +

      + Likewise, aborting the nested transaction has no effect on + the state of the parent transaction. The only result of the + abort is that neither the parent nor any + other transactions will see any of the + database modifications performed under the protection of the + nested transaction. +

      +
    • +
    • +

      + If the parent transaction commits or aborts while it has + active children, the child transactions are resolved in the + same way as the parent. That is, if the parent aborts, then + the child transactions abort as well. If the parent commits, + then whatever modifications have been performed by the child + transactions are also committed. +

      +
    • +
    • +

      + The locks held by a nested transaction are not released when + that transaction commits. Rather, they are now held by the + parent transaction until such a time as that parent commits. +

      +
    • +
    • +

      + Any database modifications performed by the nested transaction + are not visible outside of the larger encompassing + transaction until such a time as that parent transaction is + committed. +

      +
    • +
    • +

      + The depth of the nesting that you can achieve with nested + transaction is limited only by memory. +

      +
    • +
    +
    +

    + To create a nested transaction, simply pass the parent transaction's + handle when you created the nested transaction's handle. For + example: +

    +
        // parent transaction
    +    Transaction parentTxn = myEnv.beginTransaction(null, null);
    +    // child transaction
    +    Transaction childTxn = myEnv.beginTransaction(parentTxn, null); 
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/perftune-intro.html b/db/docs/gsg_txn/JAVA/perftune-intro.html new file mode 100644 index 000000000..e9dff26fc --- /dev/null +++ b/db/docs/gsg_txn/JAVA/perftune-intro.html @@ -0,0 +1,88 @@ + + + + + + Performance Tuning + + + + + + + + + +
    +
    +
    +
    +

    Performance Tuning

    +
    +
    +
    +
    +

    + From a performance perspective, the use of transactions is not free. + Depending on how you configure them, transaction commits + usually require your application to perform disk I/O that a non-transactional + application does not perform. Also, for multi-threaded + and + multi-process applications, the use of transactions can + result in increased lock contention due to extra locking + requirements driven by transactional isolation guarantees. +

    +

    + There is therefore a performance tuning component to transactional applications + that is not applicable for non-transactional applications (although + some tuning considerations do exist whether or not your application uses + transactions). Where appropriate, these tuning considerations are + introduced in the following chapters. + + + However, for a more complete description of them, see the + + Transaction tuning + + and + + Transaction throughput + + sections of the Berkeley DB Programmer's Reference Guide. + + +

    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/preface.html b/db/docs/gsg_txn/JAVA/preface.html new file mode 100644 index 000000000..6f0601ca8 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/preface.html @@ -0,0 +1,227 @@ + + + + + + Preface + + + + + + + + + +
    +
    +
    +
    +

    Preface

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Conventions Used in this Book + +
    +
    +
    +
    + + For More Information + +
    +
    +
    +
    +
    +

    + This document describes how to use transactions with your Berkeley DB + applications. It is intended to describe how to + transaction protect your application's data. The APIs used to perform this task + are described here, as are the environment infrastructure and administrative tasks + required by a transactional application. This book also + describes multi-threaded and + multi-process DB applications and the requirements they + have for deadlock detection. +

    +

    + This book is aimed at the software engineer responsible for writing a + transactional DB application. +

    +

    + This book assumes that you have already read and understood the + concepts contained in the + Getting Started with Berkeley DB + guide. + + +

    +
    +
    +
    +
    +

    Conventions Used in this Book

    +
    +
    +
    +
    +

    + The following typographical conventions are used within in this manual: +

    +

    + Class names are represented in monospaced font, as are method + names. For example: + + + + "The Environment() + constructor returns an Environment class object." + + +

    +

    + Variable or non-literal text is presented in italics. For example: "Go to your + DB_INSTALL directory." +

    +

    + Program examples are displayed in a monospaced font on a shaded background. + For example: +

    +
    import com.sleepycat.db.DatabaseConfig;
    +
    +...
    +
    +// Allow the database to be created.
    +DatabaseConfig myDbConfig = new DatabaseConfig();
    +myDbConfig.setAllowCreate(true);
    +

    + In some situations, programming examples are updated from one chapter to the next. When + this occurs, the new code is presented in monospaced bold font. For example: +

    +
    import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +
    +...
    +
    +// Allow the database to be created.
    +DatabaseConfig myDbConfig = new DatabaseConfig();
    +myDbConfig.setAllowCreate(true);
    +Database myDb = new Database("mydb.db", null, myDbConfig); 
    +
    +

    Note

    +

    + Finally, notes of special interest are represented using a note block such + as this. +

    +
    +
    +
    +
    +
    +

    For More Information

    +
    +
    +
    +
    +

    + Beyond this manual, you may also find the following sources of information useful when building a + transactional DB application: +

    + +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/readblock.jpg b/db/docs/gsg_txn/JAVA/readblock.jpg new file mode 100644 index 000000000..16a511feb Binary files /dev/null and b/db/docs/gsg_txn/JAVA/readblock.jpg differ diff --git a/db/docs/gsg_txn/JAVA/readmodifywrite.html b/db/docs/gsg_txn/JAVA/readmodifywrite.html new file mode 100644 index 000000000..eea954d10 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/readmodifywrite.html @@ -0,0 +1,120 @@ + + + + + + Read/Modify/Write + + + + + + + + + +
    +
    +
    +
    +

    Read/Modify/Write

    +
    +
    +
    +
    +

    + If you are retrieving + a record from the database + + for the purpose of modifying or deleting it, you should declare + a read-modify-write cycle at the time that you read the + record. + + Doing so causes DB to obtain write locks (instead of a read + locks) at the time of the read. This helps to prevent deadlocks by + preventing another transaction from acquiring a read lock on the same + record while the read-modify-write cycle is in progress. +

    +

    + Note that declaring a read-modify-write cycle may actually increase the amount of blocking that your + application sees, because readers immediately obtain write locks and write locks cannot be shared. For this + reason, you should use read-modify-write cycles only if you are seeing a large amount of deadlocking + occurring in your application. +

    +

    + In order to declare a read/modify/write cycle when you perform a + read operation, + + + + + + + specify + com.sleepycat.db.LockMode.RMW + + to the database or cursor get method. + +

    +

    + For example: +

    +
    // Begin the deadlock retry loop as is normal.
    +while (retry_count < MAX_DEADLOCK_RETRIES) {
    +    try {
    +        txn = myEnv.beginTransaction(null, null);
    +
    +        ...
    +        // key and data are DatabaseEntry objects.
    +        // Their usage is omitted for brevity.
    +        ...
    +
    +        // Read the data. Declare the read/modify/write cycle here
    +        myDatabase.get(txn, key, data, LockMode.RMW);
    +
    +
    +        // Put the data. Note that you do not have to provide any 
    +        // additional flags here due to the read/modify/write 
    +        // cycle. Simply put the data and perform your deadlock 
    +        // detection as normal.
    +        myDatabase.put(txn, key, data);
    +        txn.commit();
    +        return 0;
    +    } catch (DeadlockException de) {
    +        // Deadlock detection and exception handling omitted
    +        // for brevity
    +        ... 
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/recovery-intro.html b/db/docs/gsg_txn/JAVA/recovery-intro.html new file mode 100644 index 000000000..ee490b9ba --- /dev/null +++ b/db/docs/gsg_txn/JAVA/recovery-intro.html @@ -0,0 +1,104 @@ + + + + + + Recoverability + + + + + + + + + +
    +
    +
    +
    +

    Recoverability

    +
    +
    +
    +
    +

    + An important part of DB's transactional guarantees is durability. + Durability means that once a + transaction has been committed, the database modifications performed + under its protection will not be lost due to system failure. +

    +

    + In order to provide the transactional durability guarantee, + DB uses a write-ahead logging system. Every operation performed on + your databases is described in a log before it is performed on + your databases. This is done in order to ensure that an operation can be + recovered in the event of an untimely application + or system failure. +

    +

    + + Beyond logging, another important aspect of durability is + recoverability. That is, backup and restore. + + DB supports a normal recovery that runs against a subset of + your log files. This is a routine procedure used whenever your + environment is first opened upon application startup, and it is intended to + ensure that your database is in a consistent state. DB also + supports archival backup and recovery in the case of + catastrophic failure, such as the loss of a physical disk + drive. +

    +

    + This book describes several different backup procedures + you can use to protect your on-disk data. These procedures + range from simple offline backup strategies to hot failovers. Hot failovers + provide not only a backup mechanism, but + also a way to recover from a fatal hardware failure. +

    +

    + This book also describes the recovery procedures you should use + for each of the backup strategies that you might employ. +

    +

    + For a detailed description of backup and restore procedures, see + + Managing DB Files. + + + +

    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/recovery.html b/db/docs/gsg_txn/JAVA/recovery.html new file mode 100644 index 000000000..62ce76220 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/recovery.html @@ -0,0 +1,298 @@ + + + + + + Recovery Procedures + + + + + + + + + +
    +
    +
    +
    +

    Recovery Procedures

    +
    +
    +
    +
    +

    + DB supports two types of recovery: +

    +
    +
      +
    • +

      + Normal recovery, which is run when your environment is + opened upon application startup, examines only those + log records needed to bring the databases to a consistent + state since the last checkpoint. Normal recovery + starts with any logs used by any transactions active at + the time of the last checkpoint, and examines all logs + from then to the current logs. +

      +
    • +
    • +

      + Catastrophic recovery, which is performed in the same + way that normal recovery is except that it examines + all available log files. You use catastrophic recovery + to restore your databases from a previously created backup. +

      +
    • +
    +
    +

    + Of these two, normal recovery should be considered a routine + matter; in fact you should run normal + recovery whenever you start up your application. +

    +

    + Catastrophic recovery is run whenever you have lost or + corrupted your database files and you want to restore from a + backup. You also run catastrophic recovery when + you create a hot backup + (see Using Hot Failovers for more information). +

    +
    +
    +
    +
    +

    Normal Recovery

    +
    +
    +
    +
    +

    + Normal recovery examines the contents of your environment's + log files, and uses this information to ensure that your + database files are consistent relative to the + information contained in the log files. +

    +

    + Normal recovery also recreates your environment's region files. + This has the desired effect of clearing any unreleased locks + that your application may have held at the time of an + unclean application shutdown. +

    +

    + Normal recovery is run only against those log files created + since the time of your last checkpoint. For this reason, + your recovery time is dependent on how much data has been + written since the last checkpoint, and therefore on how + much log file information there is to examine. If you run + checkpoints infrequently, then normal recovery can + take a relatively long time. +

    +
    +

    Note

    +

    + You should run normal recovery every + time you perform application startup. +

    +
    +

    + To run normal recovery: +

    +
    +
      +
    • +

      + Make sure all your environment handles are closed. +

      +
    • +
    • +

      + Normal recovery must + be single-threaded. +

      +
    • +
    • +

      + Specify true to + EnvironmentConfig.setRunRecovery() + when you open your environment. +

      +
    • +
    +
    +

    + You can also run recovery by pausing or shutting down your + application and using the db_recover + command line utility. +

    +

    + For example: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +
    +
    +...
    +
    +
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +    myEnvConfig.setTransactional(true);
    +
    +    // Run normal recovery
    +    myEnvConfig.setRunRecovery(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // All other operations are identical from here. Notice, however,
    +    // that we have not created any other threads of control before
    +    // recovery is complete. You want to run recovery for
    +    // the first thread in your application that opens an environment,
    +    // but not for any subsequent threads. 
    +
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} catch (FileNotFoundException fnfe) {
    +     // Exception handling goes here
    +}
    +
    +
    +
    +
    +
    +

    Catastrophic Recovery

    +
    +
    +
    +
    +

    + Use catastrophic recovery when you are + recovering your databases from a previously created backup. + Note that to restore your databases from a previous backup, you + should copy the backup to a new environment directory, and + then run catastrophic recovery. Failure to do so can lead to + the internal database structures being out of sync with your log files. +

    +

    + Catastrophic recovery must be run single-threaded. +

    +

    + To run catastrophic recovery: +

    +
    +
      +
    • +

      + Shutdown all database operations. +

      +
    • +
    • +

      + Restore the backup to an empty directory. +

      +
    • +
    • +

      + Specify true to + EnvironmentConfig.setRunRecoveryFatal() + when you open your environment. This environment + open must be single-threaded. +

      +
    • +
    +
    +

    + You can also run recovery by pausing or shutting down your + application and using the db_recover + command line utility with the the -c option. +

    +

    + Note that catastrophic recovery examines every available + log file — not just those log files created since the + last checkpoint as is the case for normal recovery. For this reason, + catastrophic recovery is likely to take longer than does + normal recovery. +

    +

    + For example: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +
    +
    +...
    +
    +
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +    myEnvConfig.setTransactional(true);
    +
    +    // Run catastrophic recovery
    +    myEnvConfig.setRunFatalRecovery(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} catch (FileNotFoundException fnfe) {
    +     // Exception handling goes here
    +}
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/reversesplit.html b/db/docs/gsg_txn/JAVA/reversesplit.html new file mode 100644 index 000000000..bade30c43 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/reversesplit.html @@ -0,0 +1,144 @@ + + + + + + Reverse BTree Splits + + + + + + + + + +
    +
    +
    +
    +

    Reverse BTree Splits

    +
    +
    +
    +
    +

    + If your application is using the Btree access method, and your + application is repeatedly deleting then adding records to your + database, then you might be able to reduce lock contention by + turning off reverse Btree splits. +

    +

    + As pages are emptied in a database, DB attempts to + delete empty pages in order to keep + the database as small as possible and minimize search time. + Moreover, when a page in the database fills + up, DB, of course, adds additional pages + to make room for more data. +

    +

    + Adding and deleting pages in the database requires that the + writing thread lock the parent page. Consequently, as the + number of pages in your database diminishes, your application + will see increasingly more lock contention; the maximum level + of concurrency in a database of two pages is far smaller than + that in a database of 100 pages, because there are fewer pages + that can be locked. +

    +

    + Therefore, if you prevent the database from being reduced to a + minimum number of pages, you can improve your application's + concurrency throughput. Note, however, that you should do so + only if your application tends to delete and then add the same + data. If this is not the case, then preventing reverse Btree + splits can harm your database search time. +

    +

    + To turn off reverse Btree splits, + + + set + DatabaseConfig.setReverseSplitOff(). + to true. + +

    +

    + For example: +

    +
    package db.txn;
    +                                                                                                                                     
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseType;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +    myEnvConfig.setTransactional(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // Open the database.
    +    DatabaseConfig dbConfig = new DatabaseConfig();
    +    dbConfig.setTransactional(true);
    +    dbConfig.setType(DatabaseType.BTREE);
    +
    +    // Set BTree reverse split to off
    +    dbConfig.setReverseSplitOff(true);
    +
    +    myDatabase = myEnv.openDatabase(null,               // txn handle
    +                                    "sampleDatabase",   // db file name
    +                                    "null",             // db name
    +                                    dbConfig);
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} catch (FileNotFoundException fnfe) {
    +    // Exception handling goes here
    +}
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/rwlocks1.jpg b/db/docs/gsg_txn/JAVA/rwlocks1.jpg new file mode 100644 index 000000000..0fc88fd31 Binary files /dev/null and b/db/docs/gsg_txn/JAVA/rwlocks1.jpg differ diff --git a/db/docs/gsg_txn/JAVA/simplelock.jpg b/db/docs/gsg_txn/JAVA/simplelock.jpg new file mode 100644 index 000000000..8dca4ad82 Binary files /dev/null and b/db/docs/gsg_txn/JAVA/simplelock.jpg differ diff --git a/db/docs/gsg_txn/JAVA/txn_ccursor.html b/db/docs/gsg_txn/JAVA/txn_ccursor.html new file mode 100644 index 000000000..69caaca20 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/txn_ccursor.html @@ -0,0 +1,166 @@ + + + + + + Transactional Cursors and Concurrent Applications + + + + + + + + + +
    +
    +
    +
    +

    Transactional Cursors and Concurrent Applications

    +
    +
    +
    +
    +

    + When you use transactional cursors with a concurrent application, remember that + in the event of a deadlock you must make sure that you close your cursor before you abort and retry your + transaction. +

    +

    + Also, remember that when you are using the default isolation level, + every time your cursor reads a record it locks + that record until the encompassing transaction is resolved. This + means that walking your database with a transactional cursor + increases the chance of lock contention. +

    +

    + For this reason, if you must routinely walk your database with a + transactional cursor, consider using a reduced isolation level + such as read committed. +

    +
    +
    +
    +
    +

    Using Cursors with Uncommitted Data

    +
    +
    +
    +
    +

    + + As described in Reading Uncommitted Data + above, it is possible to relax your transaction's isolation + level such that it can read data modified but not yet committed + by another transaction. You can configure this when you create + your transaction handle, and when you do so then all cursors opened + inside that transaction will automatically use uncommitted reads. +

    +

    + You can also do this when you create a cursor handle from within + a serializable transaction. When you do this, only those + cursors configured for uncommitted reads uses uncommitted reads. +

    +

    + Either way, you must first configure your database handle to support + uncommitted reads before you can configure your transactions or + your cursors to use them. +

    +

    + The following example shows how to configure an individual cursor handle + to read uncommitted data from within a serializable (full isolation) transaction. + For an example of + configuring a transaction to perform uncommitted reads in + general, see Reading Uncommitted Data. +

    +
    package db.txn;
    +
    +import com.sleepycat.db.Cursor;
    +import com.sleepycat.db.CursorConfig;
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +
    +...
    +
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setTransactional(true);
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // Open the database.
    +    DatabaseConfig dbConfig = new DatabaseConfig();
    +    dbConfig.setTransactional(true);
    +    dbConfig.setType(DatabaseType.BTREE);
    +    dbConfig.setReadUncommitted(true);      // Enable uncommitted reads.
    +    myDatabase = myEnv.openDatabase(null,              // txn handle
    +                                    "sampleDatabase",  // db file name
    +                                    null,              // db name
    +                                    dbConfig);
    +
    +    // Open the transaction. Note that this is a degree 3
    +    // transaction.
    +    Transaction txn = myEnv.beginTransaction(null, null);
    +    Cursor cursor = null;
    +    try {
    +        // Use the transaction handle here
    +        // Get our cursor. Note that we pass the transaction 
    +        // handle here. Note also that we cause the cursor 
    +        // to perform uncommitted reads.
    +        CursorConfig cconfig = new CursorConfig();
    +        cconfig.setReadUncommitted(true);
    +        cursor = db.openCursor(txn, cconfig);
    +
    +        // From here, you perform your cursor reads and writes 
    +        // as normal, committing and aborting the transactions as 
    +        // is necessary, and testing for deadlock exceptions as 
    +        // normal (omitted for brevity). 
    +        
    +        ... 
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/txnconcurrency.html b/db/docs/gsg_txn/JAVA/txnconcurrency.html new file mode 100644 index 000000000..f9a2e52b5 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/txnconcurrency.html @@ -0,0 +1,369 @@ + + + + + + Chapter 4. Concurrency + + + + + + + + + +
    +
    +
    +
    +

    Chapter 4. Concurrency

    +
    +
    +
    +
    + +

    + + DB offers a great deal of support for multi-threaded + + and multi-process + + applications even when transactions are not in use. Many of DB's + handles are + thread-safe, or + can be made thread-safe by providing the appropriate flag at handle creation time, + and DB provides a + flexible locking subsystem for managing databases in a concurrent + application. Further, DB provides a robust mechanism for + detecting and responding to deadlocks. All of these concepts are + explored in this chapter. +

    +

    + Before continuing, it is useful to define a few terms that will appear + throughout this chapter: +

    +
    +
      +
    • +

      + Thread of control +

      +

      + Refers to a thread that is performing work in your application. + Typically, in this book that thread will be performing DB + operations. +

      +

      + Note that this term can also be taken to mean a separate process + that is performing work — DB supports multi-process + operations on your databases. +

      +
    • +
    • +

      + Locking +

      +

      + When a thread of control obtains + access to a shared resource, it is said to be + locking that resource. Note that + DB supports both exclusive and non-exclusive locks. See + Locks for more information. +

      +
    • +
    • +

      + Free-threaded +

      +

      + Data structures and objects are free-threaded if they can be + shared across threads of control without any explicit locking on + the part of the application. Some books, libraries, and + programming languages may use the term + thread-safe for data structures or objects + that have this characteristic. The two terms mean the + same thing. +

      +

      + For a description of free-threaded DB objects, see + Which DB Handles are Free-Threaded. +

      +
    • +
    • +

      + Blocked +

      +

      + When a thread cannot obtain a lock because some other + thread already holds a lock on that object, the lock + attempt is said to be blocked. See + Blocks for more information. +

      +
    • +
    • +

      + Deadlock +

      +

      + Occurs when two or more threads of control attempt to access conflicting resource in such a way as none + of the threads can any longer may further progress. +

      +

      + For example, if Thread A is blocked waiting for a resource held by Thread + B, while at the same time Thread B is blocked waiting for a + resource held by Thread A, then neither thread can make any + forward progress. In this situation, Thread A and Thread B + are said to be deadlocked. +

      +

      + For more information, see Deadlocks. +

      +
    • +
    +
    +
    +
    +
    +
    +

    Which DB Handles are Free-Threaded

    +
    +
    +
    +
    +

    + The following describes to what extent and under what conditions + individual handles are free-threaded. +

    +
    +
      +
    • +

      + + + Environment +

      +

      + Free-threaded so long as + + + EnvironmentConfig.setThreaded() + is set to true. + +

      +
    • +
    • +

      + + + Database +

      +

      + Free-threaded so long as + + + the database is opened in a free-threaded environment. + +

      +
    • +
    • +

      + SecondaryDatabase +

      +

      + Same conditions apply as for Database + handles. +

      +
    • +
    • +

      + + + Cursor +

      +

      + Cursors are not free-threaded. However, they + can be used by multiple threads of control so + long as the application serializes access to the handle. +

      +
    • +
    • +

      + SecondaryCursor +

      +

      + Same conditions apply as for Cursor + handles. +

      +
    • +
    • +

      + + + Transaction + +

      +

      + Access must be serialized by the application across threads of control. +

      +
    • +
    +
    +
    +

    Note

    +

    + All classes found in the bind APIs (com.sleepycat.bind.*) are free-threaded. +

    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/txncursor.html b/db/docs/gsg_txn/JAVA/txncursor.html new file mode 100644 index 000000000..ca8bf7d11 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/txncursor.html @@ -0,0 +1,128 @@ + + + + + + Transactional Cursors + + + + + + + + + +
    +
    +
    +
    +

    Transactional Cursors

    +
    +
    +
    +
    +

    + You can transaction-protect your cursor operations by + specifying a transaction handle at the time that you create + your cursor. Beyond that, you do not ever + provide a transaction handle directly to a cursor method. +

    +

    + Note that if you transaction-protect a cursor, then you must + make sure that the cursor is closed before you either commit or + abort the transaction. For example: +

    +
    package db.txn;
    +
    +import com.sleepycat.db.Cursor;
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.LockMode;
    +import com.sleepycat.db.OperationStatus;
    +import com.sleepycat.db.Transaction;
    +
    +import java.io.File;
    +
    +...
    +
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +
    +    // Database and environment opens omitted
    +
    +    String replacementData = "new data";
    +
    +    Transaction txn = myEnv.beginTransaction(null, null);
    +    Cursor cursor = null;
    +    try {
    +        // Use the transaction handle here
    +        cursor = db.openCursor(txn, null);
    +        DatabaseEntry key, data;
    +        
    +        DatabaseEntry key, data;
    +        while(cursor.getNext(key, data, LockMode.DEFAULT) ==
    +           OperationStatus.SUCCESS) {
    +            
    +            data.setData(replacementData.getBytes("UTF-8"));
    +            // No transaction handle is used on the cursor read or write
    +            // methods.
    +            cursor.putCurrent(data);
    +        }
    +        
    +        cursor.close();
    +        cursor = null;
    +        txn.commit();
    +        txn = null;
    +    } catch (Exception e) {
    +        if (cursor != null) {
    +            cursor.close();
    +        }
    +        if (txn != null) {
    +            txn.abort();
    +            txn = null;
    +        }
    +    }
    +
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} 
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/txnexample_java.html b/db/docs/gsg_txn/JAVA/txnexample_java.html new file mode 100644 index 000000000..74ff5e153 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/txnexample_java.html @@ -0,0 +1,801 @@ + + + + + + Transaction Example + + + + + + + + + +
    +
    +
    +
    +

    Transaction Example

    +
    +
    +
    +
    +

    + The following Java code provides a fully functional example of a + multi-threaded transactional DB application. + The example opens an environment and database, and then creates 5 + threads, each of which writes 500 records to the database. The keys + used for these writes are pre-determined strings, while the data is + a class that contains randomly generated data. This means that the actual + data is arbitrary and therefore uninteresting; we picked it only + because it requires minimum code to implement and therefore will + stay out of the way of the main points of this example. +

    +

    + Each thread writes 10 records under a single transaction + before committing and writing another 10 (this is repeated 50 + times). At the end of each transaction, but before committing, each + thread calls a function that uses a cursor to read every record in + the database. We do this in order to make some points about + database reads in a transactional environment. +

    +

    + Of course, each writer thread performs deadlock detection as + described in this manual. In addition, normal recovery is performed + when the environment is opened. +

    +

    + To implement this example, we need three classes: +

    +
    +
      +
    • +

      + TxnGuide.java +

      +

      + This is the main class for the application. It performs + environment and database management, spawns threads, and + creates the data that is placed in the database. See TxnGuide.java for implementation details. +

      +
    • +
    • +

      + DBWriter.java +

      +

      + This class extends java.lang.Thread, and + as such it is our thread implementation. It is responsible + for actually reading and writing to the database. It also + performs all of our transaction management. See DBWriter.java for + implementation details. +

      +
    • +
    • +

      + PayloadData.java +

      +

      + This is a data class used to encapsulate several data + fields. It is fairly uninteresting, except that the usage + of a class means that we have to use the bind APIs to + serialize it for storage in the database. See PayloadData.java for + implementation details. +

      +
    • +
    +
    +
    +
    +
    +
    +

    TxnGuide.java

    +
    +
    +
    +
    +

    + The main class in our example application is used to open and + close our environment and database. It also spawns all the + threads that we need. We start with the normal series + of Java package and import statements, followed by our class + declaration: +

    +
    // File TxnGuide.java
    +
    +package db.txn;
    +
    +import com.sleepycat.bind.serial.StoredClassCatalog;
    +
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.DatabaseType;
    +import com.sleepycat.db.LockDetectMode;
    +
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +
    +public class TxnGuide { 
    +

    + Next we declare our class' private data members. Mostly these are used + for constants such as the name of the database that we are opening and + the number of threads that we are spawning. However, we also declare + our environment and database handles here. +

    +
        private static String myEnvPath = "./";
    +    private static String dbName = "mydb.db";
    +    private static String cdbName = "myclassdb.db";
    +
    +    // DB handles
    +    private static Database myDb = null;
    +    private static Database myClassDb = null;
    +    private static Environment myEnv = null;
    +
    +    private static final int NUMTHREADS = 5; 
    +

    + Next, we implement our usage() method. This + application optionally accepts a single command line argument which is + used to identify the environment home directory. +

    +
        private static void usage() {
    +        System.out.println("TxnGuide [-h <env directory>]");
    +        System.exit(-1);
    +    } 
    +

    + Now we implement our main() method. This method + simply calls the methods to parse the command line arguments and open + the environment and database. It also creates the stored class catalog + that we use for serializing the data that we want to store in our + database. Finally, it creates and then joins the database writer + threads. +

    +
        public static void main(String args[]) {
    +        try {
    +            // Parse the arguments list
    +            parseArgs(args);
    +            // Open the environment and databases
    +            openEnv();
    +            // Get our class catalog (used to serialize objects)
    +            StoredClassCatalog classCatalog =
    +                new StoredClassCatalog(myClassDb);
    +
    +            // Start the threads
    +            DBWriter[] threadArray;
    +            threadArray = new DBWriter[NUMTHREADS];
    +            for (int i = 0; i < NUMTHREADS; i++) {
    +                threadArray[i] = new DBWriter(myEnv, myDb, classCatalog);
    +                threadArray[i].start();
    +            }
    +
    +            // Join the threads. That is, wait for each thread to 
    +            // complete before exiting the application.
    +            for (int i = 0; i < NUMTHREADS; i++) {
    +                threadArray[i].join();
    +            }
    +        } catch (Exception e) {
    +            System.err.println("TxnGuide: " + e.toString());
    +            e.printStackTrace();
    +        } finally {
    +            closeEnv();
    +        }
    +        System.out.println("All done.");
    +    } 
    +

    + Next we implement openEnv(). This method is used + to open the environment and then a database in that environment. Along + the way, we make sure that every handle is free-threaded, and that the + transactional subsystem is correctly initialized. Because this is a + concurrent application, we also declare how we want deadlock detection + to be performed. In this case, we use DB's internal block detector + to determine whether a deadlock has occurred when a thread attempts to + acquire a lock. We also indicate that we want the deadlocked thread + with the youngest lock to receive deadlock + notification. +

    +

    + Notice that we also cause normal recovery to be run when we open the + environment. This is the standard and recommended thing to do whenever + you start up a transactional application. +

    +

    + For the database open, notice that we open the database such that it + supports duplicate records. This is required purely by the data that + we are writing to the database, and it is only necessary if you run the + application more than once without first deleting the environment. +

    +

    + Finally, notice that we open the database such that it supports + uncommitted reads. We do this so that some cursor activity later in + this example can read uncommitted data. If we did not do this, then + our countRecords() method described later in + this example would cause our thread to self-deadlock. This is because + the cursor could not be opened to support uncommitted reads (that flag + on the cursor open would, in fact, be silently ignored). +

    +
        private static void openEnv() throws DatabaseException {
    +        System.out.println("opening env");
    +
    +        // Set up the environment.
    +        EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +        myEnvConfig.setAllowCreate(true);
    +        myEnvConfig.setInitializeCache(true);
    +        myEnvConfig.setInitializeLocking(true);
    +        myEnvConfig.setInitializeLogging(true);
    +        myEnvConfig.setRunRecovery(true);
    +        myEnvConfig.setTransactional(true);
    +        // EnvironmentConfig.setThreaded(true) is the default behavior 
    +        // in Java, so we do not have to do anything to cause the
    +        // environment handle to be free-threaded.
    +
    +        // Indicate that we want db to internally perform deadlock 
    +        // detection. Also indicate that the transaction that has
    +        // performed the least amount of write activity to
    +        // receive the deadlock notification, if any.
    +        myEnvConfig.setLockDetectMode(LockDetectMode.MINWRITE);
    +
    +        // Set up the database
    +        DatabaseConfig myDbConfig = new DatabaseConfig();
    +        myDbConfig.setType(DatabaseType.BTREE);
    +        myDbConfig.setAllowCreate(true);
    +        myDbConfig.setTransactional(true);
    +        myDbConfig.setSortedDuplicates(true);
    +        myDbConfig.setReadUncomitted(true);
    +        // no DatabaseConfig.setThreaded() method available.
    +        // db handles in java are free-threaded so long as the
    +        // env is also free-threaded.
    +
    +        try {
    +            // Open the environment
    +            myEnv = new Environment(new File(myEnvPath),    // Env home
    +                                    myEnvConfig);
    +
    +            // Open the database. Do not provide a txn handle. This open
    +            // is auto committed because DatabaseConfig.setTransactional()
    +            // is true.
    +            myDb = myEnv.openDatabase(null,     // txn handle
    +                                      dbName,   // Database file name
    +                                      null,     // Database name
    +                                      myDbConfig);
    +
    +            // Used by the bind API for serializing objects 
    +            // Class database must not support duplicates
    +            myDbConfig.setSortedDuplicates(false);
    +            myClassDb = myEnv.openDatabase(null,     // txn handle
    +                                           cdbName,  // Database file name
    +                                           null,     // Database name,
    +                                           myDbConfig);
    +        } catch (FileNotFoundException fnfe) {
    +            System.err.println("openEnv: " + fnfe.toString());
    +            System.exit(-1);
    +        }
    +    } 
    +

    + Finally, we implement the methods used to close our environment and + databases, parse the command line arguments, and provide our class + constructor. This is fairly standard code and it is mostly + uninteresting from the perspective of this manual. We include it here + purely for the purpose of completeness. +

    +
        private static void closeEnv() {
    +        System.out.println("Closing env and databases");
    +        if (myDb != null ) {
    +            try {
    +                myDb.close();
    +            } catch (DatabaseException e) {
    +                System.err.println("closeEnv: myDb: " +
    +                    e.toString());
    +                e.printStackTrace();
    +            }
    +        }
    +
    +        if (myClassDb != null ) {
    +            try {
    +                myClassDb.close();
    +            } catch (DatabaseException e) {
    +                System.err.println("closeEnv: myClassDb: " +
    +                    e.toString());
    +                e.printStackTrace();
    +            }
    +        }
    +
    +        if (myEnv != null ) {
    +            try {
    +                myEnv.close();
    +            } catch (DatabaseException e) {
    +                System.err.println("closeEnv: " + e.toString());
    +                e.printStackTrace();
    +            }
    +        }
    +    }
    +
    +    private TxnGuide() {}
    +
    +    private static void parseArgs(String args[]) {
    +        for(int i = 0; i < args.length; ++i) {
    +            if (args[i].startsWith("-")) {
    +                switch(args[i].charAt(1)) {
    +                    case 'h':
    +                        myEnvPath = new String(args[++i]);
    +                        break;
    +                    default:
    +                        usage();
    +                }
    +            }
    +        }
    +    }
    +} 
    +
    +
    +
    +
    +
    +

    PayloadData.java

    +
    +
    +
    +
    +

    + Before we show the implementation of the database writer thread, we + need to show the class that we will be placing into the database. This + class is fairly minimal. It simply allows you to store and retrieve an + int, a String, and a + double. We will be using the DB bind API from + within the writer thread to serialize instances of this class and place + them into our database. +

    +
    package db.txn;
    +
    +import java.io.Serializable;
    +
    +public class PayloadData implements Serializable {
    +    private int oID;
    +    private String threadName;
    +    private double doubleData;
    +
    +    PayloadData(int id, String name, double data) {
    +        oID = id;
    +        threadName = name;
    +        doubleData = data;
    +    }
    +
    +    public double getDoubleData() { return doubleData; }
    +    public int getID() { return oID; }
    +    public String getThreadName() { return threadName; }
    +} 
    +
    +
    +
    +
    +
    +

    DBWriter.java

    +
    +
    +
    +
    +

    + DBWriter.java provides the implementation + for our database writer thread. It is responsible for: +

    +
    +
      +
    • +

      + All transaction management. +

      +
    • +
    • +

      + Responding to deadlock exceptions. +

      +
    • +
    • +

      + Providing data to be stored into the database. +

      +
    • +
    • +

      + Serializing and then writing the data to the database. +

      +
    • +
    +
    +

    + In order to show off some of the ACID properties provided + by DB's transactional support, + DBWriter.java does some things in a less + efficient way than you would probably decide to use in a + true production application. First, it groups 10 database + writes together in a single transaction when you could just + as easily perform one write for each transaction. If you + did this, you could use auto commit for the individual + database writes, which means your code would be slightly + simpler and you would run a much + smaller chance of encountering blocked and deadlocked + operations. However, by doing things this way, we are able + to show transactional atomicity, as well as deadlock + handling. +

    +

    + At the end of each transaction, + DBWriter.java runs a cursor over the + entire database by way of counting the number of records + currently existing in the database. There are better ways + to discover this information, but in this case we want to + make some points regarding cursors, transactional + applications, and deadlocking (we get into this in more + detail later in this section). +

    +

    + To begin, we provide the usual package and import statements, and we declare our class: +

    +
    package db.txn;
    +
    +import com.sleepycat.bind.EntryBinding;
    +import com.sleepycat.bind.serial.StoredClassCatalog;
    +import com.sleepycat.bind.serial.SerialBinding;
    +import com.sleepycat.bind.tuple.StringBinding;
    +
    +import com.sleepycat.db.Cursor;
    +import com.sleepycat.db.CursorConfig;
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.DeadlockException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.LockMode;
    +import com.sleepycat.db.OperationStatus;
    +import com.sleepycat.db.Transaction;
    +
    +import java.io.UnsupportedEncodingException;
    +import java.util.Random;
    +
    +public class DBWriter extends Thread
    +{ 
    +

    + Next we declare our private data members. Notice that we get handles + for the environment and the database. We also obtain a handle for an + EntryBinding. We will use this to serialize + PayloadData class instances (see PayloadData.java) for storage in + the database. The random number generator that we instantiate is used + to generate unique data for storage in the database. The + MAX_RETRY variable is used to define how many times + we will retry a transaction in the face of a deadlock. And, finally, + keys is a String array that + holds the keys used for our database entries. +

    +
        private Database myDb = null;
    +    private Environment myEnv = null;
    +    private EntryBinding dataBinding = null;
    +    private Random generator = new Random();
    +
    +
    +    private static final int MAX_RETRY = 20;
    +
    +    private static String[] keys = {"key 1", "key 2", "key 3",
    +                                    "key 4", "key 5", "key 6",
    +                                    "key 7", "key 8", "key 9",
    +                                    "key 10"}; 
    +

    + Next we implement our class constructor. The most interesting thing + we do here is instantiate a serial binding for serializing + PayloadData instances. +

    +
        // Constructor. Get our DB handles from here
    +    DBWriter(Environment env, Database db, StoredClassCatalog scc)
    +        throws DatabaseException {
    +        myDb = db;
    +        myEnv = env;
    +        dataBinding = new SerialBinding(scc, PayloadData.class);
    +    } 
    +

    + Now we implement our thread's run() method. + This is the method that is run when DBWriter + threads are started in the main program (see TxnGuide.java). +

    +
        // Thread method that writes a series of records
    +    // to the database using transaction protection.
    +    // Deadlock handling is demonstrated here.
    +    public void run () { 
    +

    + The first thing we do is get a null transaction + handle before going into our main loop. We also begin the top transaction loop here that causes our application to + perform 50 transactions. +

    +
            Transaction txn = null;
    +
    +        // Perform 50 transactions
    +        for (int i=0; i<50; i++) { 
    +

    + Next we declare a retry variable. This is used to + determine whether a deadlock should result in our retrying the + operation. We also declare a retry_count variable + that is used to make sure we do not retry a transaction forever in the + unlikely event that the thread is unable to ever get a necessary lock. + (The only thing that might cause this is if some other thread dies + while holding an important lock. This is the only code that we have to + guard against that because the simplicity of this application makes it + highly unlikely that it will ever occur.) +

    +
               boolean retry = true;
    +           int retry_count = 0;
    +           // while loop is used for deadlock retries
    +           while (retry) { 
    +

    + Now we go into the try block that we use for + deadlock detection. We also begin our transaction here. +

    +
                    // try block used for deadlock detection and
    +                // general db exception handling
    +                try {
    +
    +                    // Get a transaction
    +                    txn = myEnv.beginTransaction(null, null); 
    +

    + Now we write 10 records under the transaction that we have just begun. + By combining multiple writes together under a single transaction, + we increase the likelihood that a deadlock will occur. Normally, + you want to reduce the potential for a deadlock and in this case + the way to do that is to perform a single write per transaction. In + other words, we should be using auto commit to + write to our database for this workload. +

    +

    + However, we want to show deadlock handling and by performing + multiple writes per transaction we can actually observe deadlocks + occurring. We also want to underscore the idea that you can + combing multiple database operations together in a single atomic + unit of work. So for our example, we do the (slightly) wrong thing. +

    +

    + Further, notice that we store our key into a + DatabaseEntry using + com.sleepycat.bind.tuple.StringBinding to + perform the serialization. Also, when we instantiate the + PayloadData object, we call + getName() which gives us the string + representation of this thread's name, as well as + Random.nextDouble() which gives us a random + double value. This latter value is used so as to avoid duplicate + records in the database. +

    +
    +                    // Write 10 records to the db
    +                    // for each transaction
    +                    for (int j = 0; j < 10; j++) {
    +                        // Get the key
    +                        DatabaseEntry key = new DatabaseEntry();
    +                        StringBinding.stringToEntry(keys[j], key);
    +
    +                        // Get the data
    +                        PayloadData pd = new PayloadData(i+j, getName(),
    +                            generator.nextDouble());
    +                        DatabaseEntry data = new DatabaseEntry();
    +                        dataBinding.objectToEntry(pd, data);
    +
    +                        // Do the put
    +                        myDb.put(txn, key, data);
    +                    } 
    +

    + Having completed the inner database write loop, we could simply + commit the transaction and continue on to the next block of 10 + writes. However, we want to first illustrate a few points about + transactional processing so instead we call our + countRecords() method before calling the transaction + commit. countRecords() uses a cursor to read every + record in the database and return a count of the number of records + that it found. +

    +

    + Because + countRecords() + reads every record in the database, if used incorrectly the thread + will self-deadlock. The writer thread has just written 500 records + to the database, but because the transaction used for that write + has not yet been committed, each of those 500 records are still + locked by the thread's transaction. If we then simply run a + non-transactional cursor over the database from within the same + thread that has locked those 500 records, the cursor will + block when it tries to read one of those transactional + protected records. The thread immediately stops operation at that + point while the cursor waits for the read lock it has + requested. Because that read lock will never be released (the thread + can never make any forward progress), this represents a + self-deadlock for the thread. +

    +

    + There are three ways to prevent this self-deadlock: +

    +
    +
      +
    1. +

      + We can move the call to + countRecords() to a point after the + thread's transaction has committed. +

      +
    2. +
    3. +

      + We can allow countRecords() to + operate under the same transaction as all of the writes + were performed. +

      +
    4. +
    5. +

      + We can reduce our isolation guarantee for the application + by allowing uncommitted reads. +

      +
    6. +
    +
    +

    + For this example, we choose to use option 3 (uncommitted reads) to avoid + the deadlock. This means that we have to open our database such + that it supports uncommitted reads, and we have to open our cursor handle + so that it knows to perform uncommitted reads. +

    +

    + Note that in In-Memory Transaction Example, + we simply perform the cursor operation using the same transaction + as is used for the thread's writes. +

    +
                        // commit
    +                    System.out.println(getName() + " : committing txn : " 
    +                        + i);
    +
    +                    // Using uncommitted reads to avoid the deadlock, so null
    +                    // is passed for the transaction here.
    +                    System.out.println(getName() + " : Found " +
    +                        countRecords(null) + " records in the database."); 
    +

    + Having performed this somewhat inelegant counting of the records in the + database, we can now commit the transaction. +

    +
                        try {
    +                        txn.commit();
    +                        txn = null;
    +                    } catch (DatabaseException e) {
    +                        System.err.println("Error on txn commit: " +
    +                            e.toString());
    +                    }
    +                    retry = false; 
    +

    + If all goes well with the commit, we are done and we can move on to the + next batch of 10 records to add to the database. However, in the event + of an error, we must handle our exceptions correctly. The first of + these is a deadlock exception. In the event of a deadlock, we want to + abort and retry the transaction, provided that we have not already + exceeded our retry limit for this transaction. +

    +
                    } catch (DeadlockException de) {
    +                    System.out.println("################# " + getName() +
    +                        " : caught deadlock");
    +                    // retry if necessary
    +                    if (retry_count < MAX_RETRY) {
    +                        System.err.println(getName() +
    +                            " : Retrying operation.");
    +                        retry = true;
    +                        retry_count++;
    +                    } else {
    +                        System.err.println(getName() +
    +                            " : out of retries. Giving up.");
    +                        retry = false;
    +                    } 
    +

    + In the event of a standard, non-specific database exception, we simply + log the exception and then give up (the transaction is not retried). +

    +
                    } catch (DatabaseException e) {
    +                    // abort and don't retry
    +                    retry = false;
    +                    System.err.println(getName() +
    +                        " : caught exception: " + e.toString());
    +                    System.err.println(getName() +
    +                        " : errno: " + e.getErrno());
    +                    e.printStackTrace();  
    +

    + And, finally, we always abort the transaction if the transaction handle + is not null. Note that immediately after committing our transaction, we + set the transaction handle to null to guard against aborting a + transaction that has already been committed. +

    +
                    } finally {
    +                    if (txn != null) {
    +                        try {
    +                            txn.abort();
    +                        } catch (Exception e) {
    +                            System.err.println("Error aborting txn: " +
    +                                e.toString());
    +                            e.printStackTrace();
    +                        }
    +                    }
    +                }
    +            }
    +        }
    +    } 
    +

    + The final piece of our DBWriter class is the + countRecords() implementation. Notice how in + this example we open the cursor such that it performs uncommitted + reads: +

    +
        // A method that counts every record in the database.
    +
    +    // Note that this method exists only for illustrative purposes.
    +    // A more straight-forward way to count the number of records in
    +    // a database is to use the Database.getStats() method.
    +    private int countRecords(Transaction txn)  throws DatabaseException {
    +        DatabaseEntry key = new DatabaseEntry();
    +        DatabaseEntry data = new DatabaseEntry();
    +        int count = 0;
    +        Cursor cursor = null;
    +
    +        try {
    +            // Get the cursor
    +            CursorConfig cc = new CursorConfig();
    +            cc.setReadUncomitted(true);
    +            cursor = myDb.openCursor(txn, cc);
    +            while (cursor.getNext(key, data, LockMode.DEFAULT) ==
    +                    OperationStatus.SUCCESS) {
    +
    +                    count++;
    +            }
    +        } finally {
    +            if (cursor != null) {
    +                cursor.close();
    +            }
    +        }
    +
    +        return count;
    +
    +    }
    +} 
    +
    +

    + This completes our transactional example. If you would like to + experiment with this code, you can find the example in the following + location in your DB distribution: +

    +
    DB_INSTALL/examples_java/src/db/txn
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/txnindices.html b/db/docs/gsg_txn/JAVA/txnindices.html new file mode 100644 index 000000000..ace15812a --- /dev/null +++ b/db/docs/gsg_txn/JAVA/txnindices.html @@ -0,0 +1,136 @@ + + + + + + Secondary Indices with Transaction Applications + + + + + + + + + +
    +
    +
    +
    +

    Secondary Indices with Transaction Applications

    +
    +
    +
    +
    +

    + You can use transactions with your secondary indices so long as you + + + open the secondary index so that it is transactional. + + + +

    +

    + All other aspects of using secondary indices with transactions are + identical to using secondary indices without transactions. In + addition, transaction-protecting + + + secondary cursors is performed just as you protect normal + cursors — you simply have to make sure the cursor is + opened using a transaction handle, and that the cursor is + closed before the handle is either either committed or + aborted. + + See Transactional Cursors for details. +

    +

    + Note that when you use transactions to protect your database writes, your secondary indices are protected from + corruption because updates to the primary and the secondaries are performed in a single atomic transaction. +

    +

    + For example: +

    +
    package db.GettingStarted;
    +
    +import com.sleepycat.bind.tuple.TupleBinding;
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseType;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.SecondaryDatabase;
    +import com.sleepycat.db.SecondaryConfig;
    +
    +import java.io.FileNotFoundException;
    +
    +...
    +
    +// Environment and primary database opens omitted.
    +
    +SecondaryConfig mySecConfig = new SecondaryConfig();
    +mySecConfig.setAllowCreate(true);
    +mySecConfig.setType(DatabaseType.BTREE);
    +mySecConfig.setTransactional(true);
    +
    +SecondaryDatabase mySecDb = null;
    +try {
    +    // A fake tuple binding that is not actually implemented anywhere.
    +    // The tuple binding is dependent on the data in use.
    +    // See the Getting Started Guide for details
    +    TupleBinding myTupleBinding = new MyTupleBinding();
    +
    +    // Open the secondary. FullNameKeyCreator is not actually implemented
    +    // anywhere. See the Getting Started Guide for details.
    +    FullNameKeyCreator keyCreator = new FullNameKeyCreator(myTupleBinding);
    +
    +    // Set the key creator on the secondary config object.
    +    mySecConfig.setKeyCreator(keyCreator);
    +
    +    // Perform the actual open. Because this database is configured to be
    +    // transactional, the open is automatically wrapped in a transaction.
    +    //      - myEnv is the environment handle.
    +    //      - myDb is the primary database handle.
    +    String secDbName = "mySecondaryDatabase";
    +    mySecDb = myEnv.openSecondary(null, secDbName, null, myDb, mySecConfig);
    +} catch (DatabaseException de) {
    +    // Exception handling goes here ...
    +} catch (FileNotFoundException fnfe) {
    +    // Exception handling goes here ...
    +}
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/txnnowait.html b/db/docs/gsg_txn/JAVA/txnnowait.html new file mode 100644 index 000000000..4636f75b1 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/txnnowait.html @@ -0,0 +1,91 @@ + + + + + + No Wait on Blocks + + + + + + + + + +
    +
    +
    +
    +

    No Wait on Blocks

    +
    +
    +
    +
    +

    + Normally when a DB transaction is blocked on a lock request, it + must wait until the requested lock becomes available before its + thread-of-control can proceed. However, it is possible to configure a + transaction handle such that it will report a deadlock rather + than wait for the block to clear. +

    +

    + You do this on a transaction by transaction basis by specifying + + + + + true + to the + TransactionConfig.setNoWait() + method. + +

    +

    + For example: +

    +
        Transaction txn = null;
    +    try {
    +        TransactionConfig tc = new TransactionConfig();
    +        tc.setNoWait(true);
    +        txn = myEnv.beginTransaction(null, tc);
    +
    +        ...
    +    } catch (DatabaseException de) {
    +        // Deadlock detection and exception handling omitted
    +        // for brevity
    +        ... 
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/usingtxns.html b/db/docs/gsg_txn/JAVA/usingtxns.html new file mode 100644 index 000000000..38fe7a16b --- /dev/null +++ b/db/docs/gsg_txn/JAVA/usingtxns.html @@ -0,0 +1,525 @@ + + + + + + Chapter 3. Transaction Basics + + + + + + + + + +
    +
    +
    +
    +

    Chapter 3. Transaction Basics

    +
    +
    +
    +
    + +

    + Once you have enabled transactions for your environment and your databases, + you can use them to protect your database operations. You do this by + acquiring a transaction handle and then using that handle for any + database operation that you want to participate in that transaction. +

    +

    + You obtain a transaction handle using the + + + Environment.beginTransaction() method. + + +

    +

    + Once you have completed all of the operations that you want to include + in the transaction, you must commit the transaction using the + + + Transaction.commit() method. + + + +

    +

    + If, for any reason, you want to abandon the transaction, you abort + it using + + + Transaction.abort(). + + + + +

    +

    + Any transaction handle that has been committed or aborted can no longer + be used by your application. +

    +

    + Finally, you must make sure that all transaction handles are either + committed or aborted before closing your databases and environment. +

    +
    +

    Note

    +

    + If you only want to transaction protect a single database write operation, you can use auto commit to + perform the transaction administration. When you use auto commit, you do not need an explicit transaction + handle. See Auto Commit for more information. +

    +
    +

    + For example, the following example opens a transactional-enabled environment and + database, obtains a transaction handle, and then performs a write + operation under its protection. In the event of any failure in the + write operation, the transaction is aborted and the database is left in a + state as if no operations had ever been attempted in the first place. +

    +
    package db.txn;
    +                                                                                                                                     
    +import com.sleepycat.db.Database;
    +import com.sleepycat.db.DatabaseConfig;
    +import com.sleepycat.db.DatabaseEntry;
    +import com.sleepycat.db.DatabaseException;
    +import com.sleepycat.db.Environment;
    +import com.sleepycat.db.EnvironmentConfig;
    +import com.sleepycat.db.Transaction;
    +
    +import java.io.File;
    +                                                                                                                                     
    +...
    +                                                                                                                                     
    +Database myDatabase = null;
    +Environment myEnv = null;
    +try {
    +    EnvironmentConfig myEnvConfig = new EnvironmentConfig();
    +    myEnvConfig.setInitializeCache(true);
    +    myEnvConfig.setInitializeLocking(true);
    +    myEnvConfig.setInitializeLogging(true);
    +    myEnvConfig.setTransactional(true);
    +
    +    myEnv = new Environment(new File("/my/env/home"),
    +                              myEnvConfig);
    +
    +    // Open the database.
    +    DatabaseConfig dbConfig = new DatabaseConfig();
    +    dbConfig.setTransactional(true);
    +    dbConfig.setType(DatabaseType.BTREE);
    +    myDatabase = myEnv.openDatabase(null,              // txn handle
    +                                    "sampleDatabase",  // db file name
    +                                    null,              // db name
    +                                    dbConfig);
    +    String keyString = "thekey";
    +    String dataString = "thedata";
    +    DatabaseEntry key = 
    +        new DatabaseEntry(keyString.getBytes("UTF-8"));
    +    DatabaseEntry data = 
    +        new DatabaseEntry(dataString.getBytes("UTF-8"));
    +
    +    Transaction txn = myEnv.beginTransaction(null, null);
    +        
    +    try {
    +        myDatabase.put(txn, key, data);
    +        txn.commit();
    +    } catch (Exception e) {
    +        if (txn != null) {
    +            txn.abort();
    +            txn = null;
    +        }
    +    }
    +
    +} catch (DatabaseException de) {
    +    // Exception handling goes here
    +} 
    +
    +
    +
    +
    +

    Committing a Transaction

    +
    +
    +
    +
    +

    + In order to fully understand what is happening when you commit + a transaction, you must first understand a little about what + DB is doing with + + + the logging subsystem. + + + + + Logging causes all database write operations to be identified in + + logs, and by default these + logs are backed by files on disk. These logs are used to restore your databases + + + + + in the event of a system or application failure, so by performing + logging, DB ensures the integrity of your data. +

    +

    + Moreover, DB performs write-ahead + logging. This means that information is written to the logs + before the actual database is changed. + This means that all write activity performed under the + protection of the transaction is noted in the log before + the transaction is committed. Be aware, however, that database + maintains logs in-memory. If you are backing your logs on + disk, the log information will eventually be written to the log + files, but while the transaction is on-going the log data may be + held only in memory. +

    +

    + When you commit a transaction, the following occurs: +

    +
    +
      +
    • +

      + A commit record is written to the log. This + indicates that the modifications made by the + transaction are now permanent. By default, this write is performed synchronously to disk so the + commit record arrives in the log files before any other actions are taken. +

      +
    • +
    • +

      + Any log information held in memory is (by default) + synchronously written to disk. Note that this requirement can be + relaxed, depending on the type of commit you perform. + See Non-Durable Transactions for + more information. + Also, if you are + maintaining your logs entirely in-memory, then this + step will of course not be taken. To configure your + logging system for in-memory usage, see + Configuring In-Memory Logging. + +

      +
    • +
    • +

      + All locks held by the transaction are released. This means + that read operations performed by other transactions or + threads of control can now see the modifications without + resorting to uncommitted reads (see Reading Uncommitted Data for more information). +

      +
    • +
    +
    +

    + To commit a transaction, you simply call + + + Transaction.commit(). + + +

    +

    + Notice that committing a transaction does not necessarily cause data + modified in your memory cache to be written to the files + backing your databases on disk. Dirtied database pages are written + for a number of reasons, but a transactional + commit is not one of them. The following are the things that can cause a dirtied + database page to be written to the backing database file: +

    +
    +
      +
    • +

      + Checkpoints. +

      +

      + Checkpoints cause all dirtied pages currently existing + in the cache to be written to disk, and a checkpoint + record is then written to the logs. You can run checkpoints + explicitly. For more information on checkpoints, + see Checkpoints. +

      +
    • +
    • +

      + Cache is full. +

      +

      + If the in-memory cache fills up, then dirtied pages + might be written to disk in order to free up space for other + pages that your application needs to use. Note that if + dirtied pages are written to the database files, then + any log records that describe how those pages were + dirtied are written to disk before the database + pages are written. +

      +
    • +
    +
    +

    + Be aware that because your transaction commit caused database + modifications recorded in your logs to be forced to disk, your modifications + are by default "persistent" in that they can be recovered in the event of + an application or system failure. However, recovery time is + gated by how much data has been modified since the last + checkpoint, so for applications that perform a lot of writes, + you may want to run a checkpoint with some frequency. +

    +

    + Note that once you have committed a transaction, the transaction + handle that you used for the transaction is no longer valid. To + perform database activities under the control of a new + transaction, you must obtain a fresh transaction handle. +

    +
    +
    +
    +
    +

    Non-Durable Transactions

    +
    +
    +
    +
    +

    + As previously noted, by default transaction commits are + durable because they cause the modifications performed + under the transaction to be synchronously recorded in + your on-disk log files. However, it is possible to use + non-durable transactions. +

    +

    + You may want non-durable transactions for performance + reasons. For example, you might be using transactions + simply for the isolation guarantee. + + + In this case, you might + not want a durability guarantee and so you may want to + prevent the disk I/O that normally accompanies a + transaction commit. + + +

    +

    + There are several ways to remove the durability guarantee + for your transactions: +

    +
    +
      +
    • +

      + Specify + + + true to the + EnvironmentConfig.setTxnNoSync() + + method. + + This causes DB to not synchronously force any + + log + + data to disk upon transaction commit. + + + That is, the modifications are held entirely + in the in-memory cache and the logging + information is not forced to the filesystem for + long-term storage. + + + Note, however, that the + + logging + + data will eventually make it to the filesystem (assuming no + application or OS crashes) as a part of DB's + management of its logging buffers and/or cache. +

      +

      + This form of a commit provides a weak durability + guarantee because data loss can occur due to + an application, JVM, + or OS crash. +

      +

      + This behavior is specified on a per-environment + handle basis. In order for your application to exhibit consistent + behavior, you need to specify this + + method + for all of the environment handles used in your application. +

      +

      + You can achieve this behavior on a transaction by transaction basis by + + + + using Transaction.commitNoSync() + + to commit your transaction, or by specifying true to the + TransactionConfig.setNoSync() method when starting the + transaction. + + +

      +
    • +
    • +

      + Specify + + + + true to the + EnvironmentConfig.setTxnWriteNoSync() + method. + + + This causes + + logging + + data to be synchronously + written to the OS's file system buffers upon + transaction commit. The data will eventually be + written to disk, but this occurs when the + operating system chooses to schedule the + activity; the transaction commit can complete + successfully before this disk I/O is performed + by the OS. +

      +

      + This form of commit protects you against application + and JVM crashes, but not against OS + crashes. This method offers less room for the possibility of data loss than does + + EnvironmentConfig.setTxnNoSync(). +

      +

      + This behavior is specified on a per-environment + handle basis. In order for your application to exhibit consistent + behavior, you need to specify this + + method + for all of the environment handles used in your application. +

      +

      + You can achieve this behavior on a transaction by transaction basis by + + using Transaction.commitWriteNoSync() + to commit your transaction, or by specifying true to + TransactionConfig.setWriteNoSync() method when starting the + transaction. + +

      +
    • +
    • +

      + Maintain your logs entirely in-memory. In this + case, your logs are never written to disk. The + result is that you lose all durability guarantees. + See + Configuring In-Memory Logging + for more information. +

      +
    • +
    +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/wrapup.html b/db/docs/gsg_txn/JAVA/wrapup.html new file mode 100644 index 000000000..698bbbd88 --- /dev/null +++ b/db/docs/gsg_txn/JAVA/wrapup.html @@ -0,0 +1,302 @@ + + + + + + Chapter 6. Summary and Examples + + + + + + + + + +
    +
    +
    +
    +

    Chapter 6. Summary and Examples

    +
    +
    +
    +
    +
    +

    + Table of Contents +

    +
    +
    + + Anatomy of a Transactional Application + +
    +
    + + Transaction Example + +
    +
    +
    +
    + + TxnGuide.java + +
    +
    + + PayloadData.java + +
    +
    + + DBWriter.java + +
    +
    +
    +
    + + In-Memory Transaction Example + +
    +
    +
    +

    + Throughout this manual we have presented the concepts and + mechanisms that you need to provide transactional protection for + your application. In this chapter, we summarize these + mechanisms, and we provide a complete example of a multi-threaded + transactional DB application. +

    +
    +
    +
    +
    +

    Anatomy of a Transactional Application

    +
    +
    +
    +
    +

    + Transactional applications are characterized by performing the + following activities: +

    +
    +
      +
    1. +

      + Create your environment handle. +

      +
    2. +
    3. +

      + Open your environment, specifying that the following + subsystems be used: +

      +
      +
        +
      • +

        + Transactional Subsystem (this also initializes the + logging subsystem). +

        +
      • +
      • +

        + Memory pool (the in-memory cache). +

        +
      • +
      • +

        + Logging subsystem. +

        +
      • +
      • +

        + Locking subsystem (if your application is multi-process or multi-threaded). +

        +
      • +
      +
      +

      + It is also highly recommended that you run normal recovery + upon first environment open. Normal recovery examines only those logs required + to ensure your database files are consistent relative to the information found in your + log files. +

      +
    4. +
    5. +

      + Optionally spawn off any utility threads that you might need. Utility + threads can be used to run checkpoints periodically, or to + periodically run a deadlock detector if you do not want to + use DB's built-in deadlock detector. +

      +
    6. +
    7. +

      + Open whatever database handles that you need. +

      +
    8. +
    9. +

      + Spawn off worker threads. How many of these you need and + how they split their DB workload is entirely up to your + application's requirements. However, any worker threads + that perform write operations against your databases will do + the following: +

      +
      +
        +
      1. +

        + Begin a transaction. +

        +
      2. +
      3. +

        + Perform one or more read and write + operations against your databases. +

        +
      4. +
      5. +

        + Commit the transaction if all goes well. +

        +
      6. +
      7. +

        + Abort and retry the operation if a deadlock is + detected. +

        +
      8. +
      9. +

        + Abort the transaction for most other errors. +

        +
      10. +
      +
      +
    10. +
    11. +

      + On application shutdown: +

      +
      +
        +
      1. +

        + Make sure there are no opened cursors. +

        +
      2. +
      3. +

        + Make sure there are no active transactions. Either + abort or commit all transactions before shutting + down. +

        +
      4. +
      5. +

        + Close your databases +

        +
      6. +
      7. +

        + Close your environment. +

        +
      8. +
      +
      +
    12. +
    +
    +
    +

    Note

    +

    + Robust applications should monitor their database worker threads to + make sure they have not died unexpectedly. If a thread does + terminate abnormally, you must shutdown all your worker threads + and then run normal recovery (you will have to reopen your + environment to do this). This is the only way to clear any + resources (such as a lock or a mutex) that the abnormally + exiting worker thread might have been holding at the time that + it died. +

    +

    + Failure to perform this recovery can cause your + still-functioning worker threads to eventually block forever + while waiting for a lock that will never be released. +

    +
    +

    + In addition to these activities, which are all entirely handled by + code within your application, there are some administrative + activities that you should perform: +

    +
    +
      +
    • +

      + Periodically checkpoint your application. Checkpoints will + reduce the time to run recovery in the event that one is + required. See Checkpoints + for details. +

      +
    • +
    • +

      + Periodically back up your database and log files. This is + required in order to fully obtain the durability guarantee + made by DB's transaction ACID support. See + Backup Procedures + for more information. +

      +
    • +
    • +

      + You may want to maintain a hot failover if 24x7 processing + with rapid restart in the face of a disk hit is important + to you. See Using Hot Failovers + for more information. +

      +
    • +
    +
    +
    +
    + + + diff --git a/db/docs/gsg_txn/JAVA/writeblock.jpg b/db/docs/gsg_txn/JAVA/writeblock.jpg new file mode 100644 index 000000000..4b382b82f Binary files /dev/null and b/db/docs/gsg_txn/JAVA/writeblock.jpg differ diff --git a/db/docs/images/Oracle_BerkeleyDB_clr.bmp b/db/docs/images/Oracle_BerkeleyDB_clr.bmp new file mode 100644 index 000000000..1b79293d0 Binary files /dev/null and b/db/docs/images/Oracle_BerkeleyDB_clr.bmp differ diff --git a/db/docs/index.html b/db/docs/index.html index 4d3ac02ea..ddde46b03 100644 --- a/db/docs/index.html +++ b/db/docs/index.html @@ -1,61 +1,62 @@ - + -Berkeley DB (Version: 4.3.27) +Berkeley DB (Version: 4.5.20)

    -Sleepycat Software Inc. +Oracle Corporation

    -
    -

    Berkeley DB

    -
    -

    - + - - - - - - @@ -63,8 +64,8 @@

    -Version 4.3.27, December 22, 2004
    -Copyright 1997-2004 Sleepycat Software, Inc. All Rights Reserved +Version 4.5.20, September 20, 2006
    +Copyright 1997-2006 Oracle Corporation. All Rights Reserved

    diff --git a/db/docs/java/allclasses-frame.html b/db/docs/java/allclasses-frame.html index f475ed53f..5cdf2b548 100644 --- a/db/docs/java/allclasses-frame.html +++ b/db/docs/java/allclasses-frame.html @@ -2,9 +2,9 @@ - + -All Classes (Sleepycat Software, Inc. - Berkeley DB Java API) +All Classes (Oracle Corporation - Berkeley DB Java API) @@ -44,6 +44,10 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    ClassCatalog
    +CompactConfig +
    +CompactStats +
    CurrentTransaction
    Cursor @@ -76,6 +80,10 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    ErrorHandler
    +EventHandler +
    +EventType +
    ExceptionUnwrapper
    ExceptionWrapper @@ -88,14 +96,14 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    FloatBinding
    -HashStats -
    Hasher
    -IOExceptionWrapper +HashStats
    IntegerBinding
    +IOExceptionWrapper +
    JoinConfig
    JoinCursor @@ -144,10 +152,20 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    MultipleKeyDataEntry
    +MultipleKeyNIODataEntry +
    +MultipleNIODataEntry +
    MultipleRecnoDataEntry
    +MultipleRecnoNIODataEntry +
    +MutexStats +
    OperationStatus
    +PackedInteger +
    PanicHandler
    PreparedTransaction @@ -162,12 +180,32 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    RecoveryOperation
    +ReplicationConfig +
    +ReplicationDuplicateMasterException +
    ReplicationHandleDeadException
    +ReplicationHoldElectionException +
    +ReplicationHostAddress +
    +ReplicationJoinFailureException +
    +ReplicationLockoutException +
    +ReplicationManagerAckPolicy +
    +ReplicationManagerStartPolicy +
    +ReplicationSiteUnavailableException +
    ReplicationStats
    ReplicationStatus
    +ReplicationTimeoutType +
    ReplicationTransport
    RunRecoveryException @@ -188,6 +226,8 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    SequenceStats
    +SerialBase +
    SerialBinding
    SerialInput @@ -200,6 +240,10 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    ShortBinding
    +SortedDoubleBinding +
    +SortedFloatBinding +
    StatsConfig
    StoredClassCatalog @@ -240,8 +284,12 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    TransactionStats
    +TransactionStats.Active +
    TransactionWorker
    +TupleBase +
    TupleBinding
    TupleInput @@ -270,10 +318,14 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    TupleTupleMarshalledKeyCreator
    +UpdateConflictException +
    UtfOps
    VerifyConfig
    +VersionMismatchException +

    API DocumentationBerkeley DB Documentation Building Berkeley DB
    C API
    - C Getting Started Guide: PDF, HTML + C Getting Started Guide: PDF, HTML
    + C Transaction Processing Guide: PDF, HTML
    + C Replication Guide: PDF, HTML

    C++ API
    - C++ Getting Started Guide: PDF, HTML + C++ Getting Started Guide: PDF, HTML
    + C++ Transaction Processing Guide: PDF, HTML
    + C++ Replication Guide: PDF, HTML

    Javadoc
    Java Getting Started Guide: PDF, HTML
    - Java Collections Tutorial: PDF, HTML + Java Transaction Processing Guide: PDF, HTML
    + Java Replication Guide: PDF, HTML
    + Java Collections Tutorial: PDF, HTML

    Tcl API
    -

    - Building for UNIX/POSIX systems

    - Building for VxWorks

    - Building for Win32
    -

    - Upgrading Applications to the 4.3 release
    -

    Additional DocumentationSleepycat Software
    - Troubleshooting common Berkeley DB problems

    Supporting Utilities

    - Programmer's Tutorial and Reference Guide
    + Berkeley DB Programmer's Reference Guide

    - Contacting Sleepycat Software
    - Sleepycat Software Home Page
    - Release Patches and Change Logs
    - License,  Legal Notices
    + Building for UNIX/POSIX systems +

    + Building for VxWorks +

    + Building for Windows +

    + Upgrading Applications to the 4.5 release +

    + Berkeley DB Change Logs and Release Patches +


    + Troubleshooting common Berkeley DB problems +

    + Oracle Technology Network support forums:
    +     Berkeley DB
    +     Berkeley DB High Availability (Replication)
    +


    + Berkeley DB License

    diff --git a/db/docs/java/allclasses-noframe.html b/db/docs/java/allclasses-noframe.html index e02b9950a..525722e29 100644 --- a/db/docs/java/allclasses-noframe.html +++ b/db/docs/java/allclasses-noframe.html @@ -2,9 +2,9 @@ - + -All Classes (Sleepycat Software, Inc. - Berkeley DB Java API) +All Classes (Oracle Corporation - Berkeley DB Java API) @@ -44,6 +44,10 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    ClassCatalog
    +CompactConfig +
    +CompactStats +
    CurrentTransaction
    Cursor @@ -76,6 +80,10 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    ErrorHandler
    +EventHandler +
    +EventType +
    ExceptionUnwrapper
    ExceptionWrapper @@ -88,14 +96,14 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    FloatBinding
    -HashStats -
    Hasher
    -IOExceptionWrapper +HashStats
    IntegerBinding
    +IOExceptionWrapper +
    JoinConfig
    JoinCursor @@ -144,10 +152,20 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    MultipleKeyDataEntry
    +MultipleKeyNIODataEntry +
    +MultipleNIODataEntry +
    MultipleRecnoDataEntry
    +MultipleRecnoNIODataEntry +
    +MutexStats +
    OperationStatus
    +PackedInteger +
    PanicHandler
    PreparedTransaction @@ -162,12 +180,32 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    RecoveryOperation
    +ReplicationConfig +
    +ReplicationDuplicateMasterException +
    ReplicationHandleDeadException
    +ReplicationHoldElectionException +
    +ReplicationHostAddress +
    +ReplicationJoinFailureException +
    +ReplicationLockoutException +
    +ReplicationManagerAckPolicy +
    +ReplicationManagerStartPolicy +
    +ReplicationSiteUnavailableException +
    ReplicationStats
    ReplicationStatus
    +ReplicationTimeoutType +
    ReplicationTransport
    RunRecoveryException @@ -188,6 +226,8 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    SequenceStats
    +SerialBase +
    SerialBinding
    SerialInput @@ -200,6 +240,10 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    ShortBinding
    +SortedDoubleBinding +
    +SortedFloatBinding +
    StatsConfig
    StoredClassCatalog @@ -240,8 +284,12 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    TransactionStats
    +TransactionStats.Active +
    TransactionWorker
    +TupleBase +
    TupleBinding
    TupleInput @@ -270,10 +318,14 @@ All Classes (Sleepycat Software, Inc. - Berkeley DB Java API)
    TupleTupleMarshalledKeyCreator
    +UpdateConflictException +
    UtfOps
    VerifyConfig
    +VersionMismatchException +
    diff --git a/db/docs/java/com/sleepycat/bind/ByteArrayBinding.html b/db/docs/java/com/sleepycat/bind/ByteArrayBinding.html index e4cdd7507..7b9c7d5d6 100644 --- a/db/docs/java/com/sleepycat/bind/ByteArrayBinding.html +++ b/db/docs/java/com/sleepycat/bind/ByteArrayBinding.html @@ -2,9 +2,9 @@ - + -ByteArrayBinding (Sleepycat Software, Inc. - Berkeley DB Java API) +ByteArrayBinding (Oracle Corporation - Berkeley DB Java API) @@ -14,9 +14,11 @@ ByteArrayBinding (Sleepycat Software, Inc. - Berkeley DB Java API) + @@ -28,7 +30,7 @@ function windowTitle() - + NEXT CLASS
    -Berkeley DB
    version 4.3.27
    +Berkeley DB
    version 4.5.20